Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Physics::MaterialManager Class Reference

#include <PhysicsMaterialManager.h>

Public Member Functions

 AZ_RTTI (Physics::MaterialManager, "{39EF1222-BE2E-461D-B517-0395CF82C156}")
 
void Init ()
 
AZStd::shared_ptr< MaterialFindOrCreateMaterial (const MaterialId &id, const AZ::Data::Asset< MaterialAsset > &materialAsset)
 
void DeleteMaterial (const MaterialId &id)
 
void DeleteAllMaterials ()
 
AZStd::shared_ptr< MaterialGetDefaultMaterial ()
 Get default material.
 
AZStd::shared_ptr< MaterialGetMaterial (const MaterialId &id)
 Returns a physics material instance with the given id.
 

Protected Attributes

AZStd::shared_ptr< Materialm_defaultMaterial
 
AZStd::unordered_map< MaterialId, AZStd::shared_ptr< Material > > m_materials
 

Detailed Description

This class manages all the creation and deletion of physics materials. To use it call AZ::Interface<Physics::MaterialManager>::Get().

Member Function Documentation

◆ DeleteAllMaterials()

void Physics::MaterialManager::DeleteAllMaterials ( )

Deletes all physics material instances. Default material will not be destroyed.

◆ DeleteMaterial()

void Physics::MaterialManager::DeleteMaterial ( const MaterialId id)

Deletes a physics material instance with the given id. Default material will not be destroyed.

◆ FindOrCreateMaterial()

AZStd::shared_ptr< Material > Physics::MaterialManager::FindOrCreateMaterial ( const MaterialId id,
const AZ::Data::Asset< MaterialAsset > &  materialAsset 
)

Finds or creates a physics material instance with the given id.

Parameters
idMaterial id used to identify the material.
materialAssetMaterial asset to create the material from.
Returns
Material instance created or found. It can return nullptr if the creation failed.

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