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.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Physics::MaterialLibraryAsset Class Reference

#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< MaterialFromAssetConfigurationm_materialLibrary
 

Friends

class MaterialLibraryAssetEventHandler
 

Detailed Description

An asset that holds a list of materials to be edited and assigned in Open 3D Engine Editor

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.

Member Function Documentation

◆ AddMaterialData()

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.

Parameters
dataMaterial data to add

◆ GetDataForMaterialId()

bool Physics::MaterialLibraryAsset::GetDataForMaterialId ( const MaterialId materialId,
MaterialFromAssetConfiguration configuration 
) const

Finds MaterialFromAssetConfiguration in the library given MaterialId

Parameters
materialIdmaterial id to find the configuration for
datastores the material data if material with such ID exists
Returns
true if MaterialFromAssetConfiguration was found, False otherwise

◆ GetDataForMaterialName()

bool Physics::MaterialLibraryAsset::GetDataForMaterialName ( const AZStd::string &  materialName,
MaterialFromAssetConfiguration configuration 
) const

Finds MaterialFromAssetConfiguration in the library given material name

Parameters
materialNamematerial name to find the configuration for
datastores the material data if material with such name exists
Returns
true if MaterialFromAssetConfiguration was found, False otherwise

◆ GetMaterialsData()

const AZStd::vector<MaterialFromAssetConfiguration>& Physics::MaterialLibraryAsset::GetMaterialsData ( ) const
inline

Returns all MaterialFromAssetConfiguration instances from this library

Returns
a Vector of all MaterialFromAssetConfiguration stored in this library

◆ HasDataForMaterialId()

bool Physics::MaterialLibraryAsset::HasDataForMaterialId ( const MaterialId materialId) const

Retrieves if there is any data with the given Material Id

Parameters
materialIdmaterial id to find
Returns
true if material with that id was found, False otherwise

The documentation for this class was generated from the following file: