Class PhysicalMaterial
Physical materials are used to define the response of a physical object when interacting dynamically with the world.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Physics/PhysicalMaterial.h
Syntax
public class PhysicalMaterial : public ScriptingObject, public ISerializable
Constructors
~PhysicalMaterial()
Declaration
public ~PhysicalMaterial()
Fields
Density
Physical material density in kilograms per cubic meter (kg/m^3). Higher density means a higher weight of the object using this material. Wood is around 700, water is 1000, steel is around 8000.
Declaration
public float Density = 1000.0f
Field Value
float
|
Friction
The friction value of surface, controls how easily things can slide on this surface.
Declaration
public float Friction = 0.7f
Field Value
float
|
FrictionCombineMode
The friction combine mode, controls how friction is computed for multiple materials.
Declaration
public PhysicsCombineMode FrictionCombineMode = PhysicsCombineMode::Average
Field Value
PhysicsCombineMode
|
OverrideFrictionCombineMode
If set we will use the FrictionCombineMode of this material, instead of the FrictionCombineMode found in the Physics settings.
Declaration
public bool OverrideFrictionCombineMode = false
Field Value
bool
|
OverrideRestitutionCombineMode
If set we will use the RestitutionCombineMode of this material, instead of the RestitutionCombineMode found in the Physics settings.
Declaration
public bool OverrideRestitutionCombineMode = false
Field Value
bool
|
Restitution
The restitution or 'bounciness' of this surface, between 0 (no bounce) and 1 (outgoing velocity is same as incoming).
Declaration
public float Restitution = 0.3f
Field Value
float
|
RestitutionCombineMode
The restitution combine mode, controls how restitution is computed for multiple materials.
Declaration
public PhysicsCombineMode RestitutionCombineMode = PhysicsCombineMode::Average
Field Value
PhysicsCombineMode
|
Tag
Physical material tag used to identify it (eg. Surface.Wood
). Can be used to play proper footstep sounds when walking over object with that material.
Declaration
public Tag Tag
Field Value
Tag
|
Methods
GetPhysicsMaterial()
Gets the PhysX material.
Declaration
public void* GetPhysicsMaterial()
Returns
void
The native material object. |
UpdatePhysicsMaterial()
Updates the physics material (after any property change).
Declaration
public void UpdatePhysicsMaterial()