GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::physics::Material Struct Reference

Properties regarding the dynamics of an object. More...

#include <GREM/physics/objects.hpp>

Public Types

enum class  FrictionCombine : uint8_t { AVERAGE = 0 , MINIMUM = 1 , MAXIMUM = 2 , MULTIPLY = 3 }
 Friction combination mode. More...
enum class  RestitutionCombine : uint8_t { AVERAGE = 0 , MINIMUM = 1 , MAXIMUM = 2 , MULTIPLY = 3 }
 Restitution combination mode. More...

Public Member Functions

constexpr bool operator== (const Material &other) const noexcept=default
 Compare this material to another for equality.

Public Attributes

Coefficient staticFriction = static_cast<Scalar>(0.8)
 Coefficient of static friction of the object.
Coefficient kineticFriction = static_cast<Scalar>(0.707)
 Coefficient of kinetic friction of the object.
Coefficient rollingResistance = static_cast<Scalar>(0.01)
 Coefficient of rolling resistance of the object.
Coefficient restitution = Scalar{0.5}
 Coefficient of restitution of the object.
Coefficient linearDrag = Scalar{0.5}
 Linear drag coefficient of the object.
Coefficient angularDrag = Scalar{0.5}
 Angular drag coefficient of the object.
FrictionCombine frictionCombine = FrictionCombine::MINIMUM
 How to combine the friction when this object collides with another.
RestitutionCombine restitutionCombine = RestitutionCombine::MAXIMUM
 How to combine the restitution when this object collides with another.

Detailed Description

Properties regarding the dynamics of an object.

Member Enumeration Documentation

◆ FrictionCombine

enum class grem::physics::Material::FrictionCombine : uint8_t
strong

Friction combination mode.

When two objects collide, the friction combination mode with the lowest value of the two is used.

Enumerator
AVERAGE 

The two values are averaged.

MINIMUM 

The smallest of the two values is used.

MAXIMUM 

The largest of the two values is used.

MULTIPLY 

The two values are multiplied with each other.

◆ RestitutionCombine

enum class grem::physics::Material::RestitutionCombine : uint8_t
strong

Restitution combination mode.

When two objects collide, the restitution combination mode with the lowest value of the two is used.

Enumerator
AVERAGE 

The two values are averaged.

MINIMUM 

The smallest of the two values is used.

MAXIMUM 

The largest of the two values is used.

MULTIPLY 

The two values are multiplied with each other.

Member Function Documentation

◆ operator==()

bool grem::physics::Material::operator== ( const Material & other) const
nodiscardconstexprdefaultnoexcept

Compare this material to another for equality.

Parameters
otherthe material to compare this one to.
Returns
true if the materials are equal, false otherwise.

Member Data Documentation

◆ staticFriction

Coefficient grem::physics::Material::staticFriction = static_cast<Scalar>(0.8)

Coefficient of static friction of the object.

Must be non-negative.

◆ kineticFriction

Coefficient grem::physics::Material::kineticFriction = static_cast<Scalar>(0.707)

Coefficient of kinetic friction of the object.

Must be non-negative.

◆ rollingResistance

Coefficient grem::physics::Material::rollingResistance = static_cast<Scalar>(0.01)

Coefficient of rolling resistance of the object.

Must be non-negative.

◆ restitution

Coefficient grem::physics::Material::restitution = Scalar{0.5}

Coefficient of restitution of the object.

Must be between 0 and 1 (inclusive).

◆ linearDrag

Coefficient grem::physics::Material::linearDrag = Scalar{0.5}

Linear drag coefficient of the object.

Must be non-negative.

◆ angularDrag

Coefficient grem::physics::Material::angularDrag = Scalar{0.5}

Angular drag coefficient of the object.

Must be non-negative.

◆ frictionCombine

FrictionCombine grem::physics::Material::frictionCombine = FrictionCombine::MINIMUM

How to combine the friction when this object collides with another.

◆ restitutionCombine

RestitutionCombine grem::physics::Material::restitutionCombine = RestitutionCombine::MAXIMUM

How to combine the restitution when this object collides with another.


The documentation for this struct was generated from the following file: