class PhysicsMaterial

Inherits: Resource

Material that controls how two physical objects interact with each other.

Materials of both objects are used during their interaction and their combined values are used.

Public

Methods

~PhysicsMaterial

virtual ~PhysicsMaterial() noexcept = default

SetStaticFriction

virtual void SetStaticFriction(float value) = 0

Controls friction when two in-contact objects are not moving lateral to each other (for example how difficult it is to get an object moving from a static state while it is in contact with other object(s)).

GetStaticFriction

virtual float GetStaticFriction() const = 0

SetDynamicFriction

virtual void SetDynamicFriction(float value) = 0

Controls friction when two in-contact objects are moving lateral to each other (for example how quickly does an object slow down when sliding along another object).

GetDynamicFriction

virtual float GetDynamicFriction() const = 0

SetRestitutionCoefficient

virtual void SetRestitutionCoefficient(float value) = 0

Controls "bounciness" of an object during a collision.

Value of 1 means the collision is elastic, and value of 0 means the value is inelastic. Must be in [0, 1] range.

GetRestitutionCoefficient

virtual float GetRestitutionCoefficient() const = 0

staticCreate

static HPhysicsMaterial Create(float staticFriction = 0.F, float dynamicFriction = 0.F, float restitution = 0.F)

Creates a new physics material.

staticFriction
Controls friction when two in-contact objects are not moving lateral to each other (for example how difficult is to get an object moving from a static state while it is in contact other object(s)).
dynamicFriction
Sets dynamic friction of the material. Controls friction when two in-contact objects are moving lateral to each other (for example how quickly does an object slow down when sliding along another object).
restitution
Controls "bounciness" of an object during a collision. Value of 1 means the collision is elastic, and value of 0 means the value is inelastic. Must be in [0, 1] range.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

Internal

Methods

staticCreatePtrInternal

static SPtr<PhysicsMaterial> CreatePtrInternal(float staticFriction = 0.F, float dynamicFriction = 0.F, float restitution = 0.F)