#include <PhysXMaterial.h>
Inherits Physics::Material, AZStd::enable_shared_from_this< Material >, and AZ::Data::AssetBus::Handler.
|
| AZ_CLASS_ALLOCATOR (Material, AZ::SystemAllocator) |
|
| AZ_RTTI (PhysX::Material, "{57A9681F-4025-4D66-891B-80CBC78BDEB9}", Physics::Material) |
|
Physics::MaterialPropertyValue | GetProperty (AZStd::string_view propertyName) const override |
|
void | SetProperty (AZStd::string_view propertyName, Physics::MaterialPropertyValue value) override |
|
float | GetDynamicFriction () const |
|
void | SetDynamicFriction (float dynamicFriction) |
|
float | GetStaticFriction () const |
|
void | SetStaticFriction (float staticFriction) |
|
float | GetRestitution () const |
|
void | SetRestitution (float restitution) |
|
CombineMode | GetFrictionCombineMode () const |
|
void | SetFrictionCombineMode (CombineMode mode) |
|
CombineMode | GetRestitutionCombineMode () const |
|
void | SetRestitutionCombineMode (CombineMode mode) |
|
float | GetDensity () const |
|
void | SetDensity (float density) |
|
bool | IsCompliantContactModeEnabled () const |
|
void | EnableCompliantContactMode (bool enabled) |
|
float | GetCompliantContactModeDamping () const |
|
void | SetCompliantContactModeDamping (float damping) |
|
float | GetCompliantContactModeStiffness () const |
|
void | SetCompliantContactModeStiffness (float stiffness) |
|
const AZ::Color & | GetDebugColor () const |
|
void | SetDebugColor (const AZ::Color &debugColor) |
|
const physx::PxMaterial * | GetPxMaterial () const |
|
|
void | OnAssetReady (AZ::Data::Asset< AZ::Data::AssetData > asset) override |
|
void | OnAssetReloaded (AZ::Data::Asset< AZ::Data::AssetData > asset) override |
|
Runtime PhysX material instance. It handles the reloading of its data if the material asset it was created from is modified. It also provides functions to create PhysX materials.
◆ CreateMaterialWithRandomId()
static AZStd::shared_ptr<Material> PhysX::Material::CreateMaterialWithRandomId |
( |
const AZ::Data::Asset< Physics::MaterialAsset > & |
materialAsset | ) |
|
|
static |
Function to create a material instance from an asset. A random material will be used. This function is useful to create several instances from the same asset.
- Parameters
-
materialAsset | Material asset to create the material instance from. |
- Returns
- Material instance created. It can return nullptr if the creation failed or if the asset passed is invalid.
◆ FindOrCreateMaterial()
static AZStd::shared_ptr<Material> PhysX::Material::FindOrCreateMaterial |
( |
const AZ::Data::Asset< Physics::MaterialAsset > & |
materialAsset | ) |
|
|
static |
Function to create a material instance from an asset. The material id will be constructed from the asset id. If the material id is found in the manager it returns the existing material instance.
- Parameters
-
materialAsset | Material asset to create the material instance from. |
- Returns
- Material instance created or found. It can return nullptr if the creation failed or if the asset passed is invalid.
◆ FindOrCreateMaterials()
static AZStd::vector<AZStd::shared_ptr<Material> > PhysX::Material::FindOrCreateMaterials |
( |
const Physics::MaterialSlots & |
materialSlots | ) |
|
|
static |
Function to create material instances from material slots. The material ids will be constructed from the asset ids of the assets assigned to the slots. It will always return a valid list of materials, the slots with invalid or no assets will have the default material instance.
- Parameters
-
materialSlots | Material slots with the list of material assets to create the material instances from. |
- Returns
- List of material instances created. It will always return a valid list.
The documentation for this class was generated from the following file:
- Gems/PhysX/Core/Code/Include/PhysX/Material/PhysXMaterial.h