20 #ifndef ANTKEEPER_PHYSICS_COLLIDER_MATERIAL_HPP
21 #define ANTKEEPER_PHYSICS_COLLIDER_MATERIAL_HPP
42 inline constexpr
collider_material(
float restitution,
float static_friction,
float dynamic_friction) noexcept:
43 m_restitution{restitution},
44 m_static_friction{static_friction},
45 m_dynamic_friction{dynamic_friction}
57 m_restitution = restitution;
67 m_static_friction = friction;
77 m_dynamic_friction = friction;
87 m_restitution_combine_mode = mode;
97 m_friction_combine_mode = mode;
113 return m_restitution;
119 return m_static_friction;
125 return m_dynamic_friction;
131 return m_restitution_combine_mode;
137 return m_friction_combine_mode;
148 float m_restitution{};
151 float m_static_friction{};
154 float m_dynamic_friction{};
163 float m_density{1.0f};
Describes the collision response of a collider.
constexpr void set_restitution_combine_mode(restitution_combine_mode mode) noexcept
Sets the restitution combine mode of the material.
constexpr void set_dynamic_friction(float friction) noexcept
Sets the dynamic friction of the material.
constexpr float get_dynamic_friction() const noexcept
Returns the dynamic friction of the material.
constexpr restitution_combine_mode get_restitution_combine_mode() const noexcept
Returns the restitution combine mode.
constexpr collider_material() noexcept=default
Constructs a collider material.
constexpr void set_static_friction(float friction) noexcept
Sets the static friction of the material.
constexpr void set_density(float density) noexcept
Sets the density of the material.
constexpr friction_combine_mode get_friction_combine_mode() const noexcept
Returns the friction combine mode.
constexpr collider_material(float restitution, float static_friction, float dynamic_friction) noexcept
Constructs a collider material.
constexpr void set_restitution(float restitution) noexcept
Sets the of restitution of the material.
constexpr float get_restitution() const noexcept
Returns the restitution of the material.
constexpr float get_static_friction() const noexcept
Returns the static friction of the material.
constexpr float get_density() const noexcept
Returns the density of the material.
constexpr void set_friction_combine_mode(friction_combine_mode mode) noexcept
Sets the friction combine mode of the material.
restitution_combine_mode
Specifies how coefficients of restitution should be calculated.
@ average
Coefficient of restitution is calculated as (a + b) / 2.
friction_combine_mode
Specifies how coefficients of friction should be calculated.
@ average
Coefficient of friction is calculated as (a + b) / 2.