![]() |
Open 3D Engine AzFramework API Reference
2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <Material.h>
Inherits AssetData.
Public Member Functions | |
AZ_CLASS_ALLOCATOR (MaterialLibraryAsset, AZ::SystemAllocator, 0) | |
AZ_RTTI (Physics::MaterialLibraryAsset, "{9E366D8C-33BB-4825-9A1F-FA3ADBE11D0F}", AZ::Data::AssetData) | |
bool | GetDataForMaterialId (const MaterialId &materialId, MaterialFromAssetConfiguration &configuration) const |
bool | HasDataForMaterialId (const MaterialId &materialId) const |
bool | GetDataForMaterialName (const AZStd::string &materialName, MaterialFromAssetConfiguration &configuration) const |
void | AddMaterialData (const MaterialFromAssetConfiguration &data) |
const AZStd::vector< MaterialFromAssetConfiguration > & | GetMaterialsData () const |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Protected Member Functions | |
void | GenerateMissingIds () |
Protected Attributes | |
AZStd::vector< MaterialFromAssetConfiguration > | m_materialLibrary |
Friends | |
class | MaterialLibraryAssetEventHandler |
Use Asset Editor to create a MaterialLibraryAsset and add materials to it.
You can assign this library on primitive colliders, terrain layers, mesh colliders. You can later select a specific material out of the library.
Please note, MaterialLibraryAsset is used only to provide a way to edit materials in the Editor, if you need to create materials at runtime (for example, from custom configuration files) please use Physics::Material class directly.
void Physics::MaterialLibraryAsset::AddMaterialData | ( | const MaterialFromAssetConfiguration & | data | ) |
Adds material data to the asset library.
If MaterialId is not set, it'll be generated automatically.
If MaterialId is set and is unique for this collection it'll be added to the library unchanged.
data | Material data to add |
bool Physics::MaterialLibraryAsset::GetDataForMaterialId | ( | const MaterialId & | materialId, |
MaterialFromAssetConfiguration & | configuration | ||
) | const |
Finds MaterialFromAssetConfiguration in the library given MaterialId
materialId | material id to find the configuration for |
data | stores the material data if material with such ID exists |
bool Physics::MaterialLibraryAsset::GetDataForMaterialName | ( | const AZStd::string & | materialName, |
MaterialFromAssetConfiguration & | configuration | ||
) | const |
Finds MaterialFromAssetConfiguration in the library given material name
materialName | material name to find the configuration for |
data | stores the material data if material with such name exists |
|
inline |
Returns all MaterialFromAssetConfiguration instances from this library
bool Physics::MaterialLibraryAsset::HasDataForMaterialId | ( | const MaterialId & | materialId | ) | const |
Retrieves if there is any data with the given Material Id
materialId | material id to find |