Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::physics_material Struct Reference

Represents the physical properties of a material. More...

#include <physics_material.h>

Public Types

using sptr = std::shared_ptr<physics_material>
 Shared pointer to a physics material.
 
using wptr = std::weak_ptr<physics_material>
 Weak pointer to a physics material.
 
using uptr = std::unique_ptr<physics_material>
 Unique pointer to a physics material.
 

Public Member Functions

auto get_stiffness () const -> float
 Converts normalized stiffness to actual stiffness.
 

Public Attributes

float restitution {0}
 
float friction {0.5}
 
float stiffness {0.5}
 
float damping {0.1f}
 
combine_mode restitution_combine {combine_mode::average}
 How to combine restitution values.
 
combine_mode friction_combine {combine_mode::average}
 How to combine friction values.
 

Detailed Description

Represents the physical properties of a material.

Definition at line 28 of file physics_material.h.

Member Typedef Documentation

◆ sptr

Shared pointer to a physics material.

Definition at line 30 of file physics_material.h.

◆ uptr

Unique pointer to a physics material.

Definition at line 32 of file physics_material.h.

◆ wptr

Weak pointer to a physics material.

Definition at line 31 of file physics_material.h.

Member Function Documentation

◆ get_stiffness()

auto unravel::physics_material::get_stiffness ( ) const -> float
inline

Converts normalized stiffness to actual stiffness.

Returns
The actual stiffness value.

< Minimum actual stiffness.

< Maximum actual stiffness.

Definition at line 61 of file physics_material.h.

Member Data Documentation

◆ damping

float unravel::physics_material::damping {0.1f}

Tooltip: Normalized stiffness value. Represents the elasticity of the material. Higher values indicate stiffer materials. Coefficient of damping. Range: [0.0, 1.0].

Definition at line 49 of file physics_material.h.

◆ friction

float unravel::physics_material::friction {0.5}

Tooltip: Restitution represents the bounciness of the material. A value of 0.0 means no bounce (perfectly inelastic collision), while 1.0 means perfect bounce (perfectly elastic collision). Coefficient of friction. Range: [0.0, 1.0] (sometimes slightly above 1.0).

Definition at line 39 of file physics_material.h.

◆ friction_combine

combine_mode unravel::physics_material::friction_combine {combine_mode::average}

How to combine friction values.

Definition at line 55 of file physics_material.h.

◆ restitution

float unravel::physics_material::restitution {0}

Coefficient of restitution. Range: [0.0, 1.0].

Definition at line 34 of file physics_material.h.

◆ restitution_combine

combine_mode unravel::physics_material::restitution_combine {combine_mode::average}

How to combine restitution values.

Tooltip: Coefficient of damping. Represents the material's resistance to motion. Higher values result in more energy loss.

Definition at line 53 of file physics_material.h.

◆ stiffness

float unravel::physics_material::stiffness {0.5}

Tooltip: Friction represents the resistance to sliding motion. A value of 0.0 means no friction (perfectly slippery), while values around 1.0 represent typical real-world friction. Values slightly above 1.0 can simulate very high friction surfaces but should be used cautiously. Normalized stiffness value. Range: [0.0, 1.0].

Definition at line 45 of file physics_material.h.


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