#include <PhysicsMaterialManager.h>
Public Member Functions | |
AZ_RTTI (Physics::MaterialManager, "{39EF1222-BE2E-461D-B517-0395CF82C156}") | |
void | Init () |
AZStd::shared_ptr< Material > | FindOrCreateMaterial (const MaterialId &id, const AZ::Data::Asset< MaterialAsset > &materialAsset) |
void | DeleteMaterial (const MaterialId &id) |
void | DeleteAllMaterials () |
AZStd::shared_ptr< Material > | GetDefaultMaterial () |
Get default material. | |
AZStd::shared_ptr< Material > | GetMaterial (const MaterialId &id) |
Returns a physics material instance with the given id. | |
Protected Attributes | |
AZStd::shared_ptr< Material > | m_defaultMaterial |
AZStd::unordered_map< MaterialId, AZStd::shared_ptr< Material > > | m_materials |
This class manages all the creation and deletion of physics materials. To use it call AZ::Interface<Physics::MaterialManager>::Get().
void Physics::MaterialManager::DeleteAllMaterials | ( | ) |
Deletes all physics material instances. Default material will not be destroyed.
void Physics::MaterialManager::DeleteMaterial | ( | const MaterialId & | id | ) |
Deletes a physics material instance with the given id. Default material will not be destroyed.
AZStd::shared_ptr< Material > Physics::MaterialManager::FindOrCreateMaterial | ( | const MaterialId & | id, |
const AZ::Data::Asset< MaterialAsset > & | materialAsset | ||
) |