Rubeus::Awerere::APhysicsMaterial class

A physics material used to characterise physics objects.

Constructors, destructors, conversion operators

APhysicsMaterial()
Constructor.
~APhysicsMaterial()
Destructor.

Public functions

void makeMaterial(const float& mass, const RML::Vector2D& gravity, const float& friction, const float& restitution)
Make a material with by specifying physics constants.
auto isCollisionEnabled() const -> bool
Returns if the material has collision enabled.
void setCollision(bool override = false)
Sets the collision parameter.

Public variables

bool m_EnableCollision
Whether enables collision for this type of material or not.
float m_Mass
Value of mass of this physics object.
RML::Vector2D m_Gravity
Gravity vector acting on a physics object.
float m_CoefficientOfFriction
Coefficient of friction of this physics material.
float m_CoefficientOfRestitution
Coefficient of restitution of this physics material.

Function documentation

void Rubeus::Awerere::APhysicsMaterial::makeMaterial(const float& mass, const RML::Vector2D& gravity, const float& friction, const float& restitution)

Make a material with by specifying physics constants.

Parameters
mass Mass of the material.
gravity Gravity acting on the physics object.
friction Friction coefficient of the surfaces.
restitution Restitution coefficient for resolving collisions.

bool Rubeus::Awerere::APhysicsMaterial::isCollisionEnabled() const

Returns if the material has collision enabled.

Returns Whether collision has been enabled.

void Rubeus::Awerere::APhysicsMaterial::setCollision(bool override = false)

Sets the collision parameter.

Parameters
override New collision value.