ReactPhysics3D  v0.10.2
C++ Physics engine library
Loading...
Searching...
No Matches
reactphysics3d::Material Class Reference

This class contains the material properties of a collider that will be use for the dynamics simulation like the friction coefficient or the bounciness of the rigid body. More...

#include <include/reactphysics3d/engine/Material.h>

Public Member Functions

decimal getBounciness () const
 Return the bounciness.
 
void setBounciness (decimal bounciness)
 Set the bounciness.
 
decimal getFrictionCoefficient () const
 Return the friction coefficient.
 
void setFrictionCoefficient (decimal frictionCoefficient)
 Set the friction coefficient.
 
decimal getFrictionCoefficientSqrt () const
 Return the square root friction coefficient.
 
decimal getMassDensity () const
 Return the mass density of the collider.
 
void setMassDensity (decimal massDensity)
 Set the mass density of the collider.
 
std::string to_string () const
 Return a string representation for the material.
 

Detailed Description

This class contains the material properties of a collider that will be use for the dynamics simulation like the friction coefficient or the bounciness of the rigid body.

Member Function Documentation

◆ getBounciness()

RP3D_FORCE_INLINE decimal reactphysics3d::Material::getBounciness ( ) const

Return the bounciness.

Returns
Bounciness factor (between 0 and 1) where 1 is very bouncy

◆ getFrictionCoefficient()

RP3D_FORCE_INLINE decimal reactphysics3d::Material::getFrictionCoefficient ( ) const

Return the friction coefficient.

Returns
Friction coefficient (positive value)

◆ setBounciness()

RP3D_FORCE_INLINE void reactphysics3d::Material::setBounciness ( decimal  bounciness)

Set the bounciness.

The bounciness should be a value between 0 and 1.

The value 1 is used for a very bouncy body and zero is used for a body that is not bouncy at all.

Parameters
bouncinessBounciness factor (between 0 and 1) where 1 is very bouncy

◆ setFrictionCoefficient()

RP3D_FORCE_INLINE void reactphysics3d::Material::setFrictionCoefficient ( decimal  frictionCoefficient)

Set the friction coefficient.

The friction coefficient has to be a positive value.

The value zero is used for no friction at all.

Parameters
frictionCoefficientFriction coefficient (positive value)

◆ setMassDensity()

RP3D_FORCE_INLINE void reactphysics3d::Material::setMassDensity ( decimal  massDensity)

Set the mass density of the collider.

Parameters
massDensityThe mass density of the collider

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