|
Engine²
Open-source game engine written in C++.
|
#include <ConstraintSettings.hpp>
Public Member Functions | |
| bool | IsBreakable () const |
| Check if this constraint is breakable. | |
| bool | IsRigid () const |
| Check if this constraint is rigid (no spring behavior). | |
Static Public Member Functions | |
| static ConstraintSettings | Rigid () |
| Create settings for a perfectly rigid constraint. | |
| static ConstraintSettings | Breakable (float force, float torque=0.0f) |
| Create settings for a breakable constraint. | |
| static ConstraintSettings | Soft (float stiff=0.5f, float damp=0.1f) |
| Create settings for a soft spring-like constraint. | |
Public Attributes | |
| float | stiffness = 1.0f |
| Constraint stiffness [0.0, 1.0]. | |
| float | damping = 0.0f |
| Constraint damping [0.0, 1.0]. | |
| float | breakForce = 0.0f |
| Maximum force before constraint breaks (Newtons). | |
| float | breakTorque = 0.0f |
| Maximum torque before constraint breaks (Newton-meters). | |
| bool | enableCollision = false |
| Enable collision between constrained bodies. | |
|
inlinestaticnodiscard |
Create settings for a breakable constraint.
Breakable constraints are rigid until the force/torque exceeds the specified thresholds, then they snap and are disabled.
| force | Maximum force before breaking (Newtons) |
| torque | Maximum torque before breaking (Newton-meters), defaults to 0 (force only) |
|
inlinenodiscard |
Check if this constraint is breakable.
|
inlinenodiscard |
Check if this constraint is rigid (no spring behavior).
|
inlinestaticnodiscard |
Create settings for a perfectly rigid constraint.
Rigid constraints have no spring behavior and cannot break. Use for fixed attachments, welding, etc.
|
inlinestaticnodiscard |
Create settings for a soft spring-like constraint.
Soft constraints have spring behavior and gradually enforce the constraint over time. Use for ropes, springs, etc.
| stiff | Stiffness coefficient [0.0, 1.0] |
| damp | Damping coefficient [0.0, 1.0] |
| float Physics::Component::ConstraintSettings::breakForce = 0.0f |
Maximum force before constraint breaks (Newtons).
When the constraint force exceeds this threshold, the constraint is marked as broken and disabled.
| float Physics::Component::ConstraintSettings::breakTorque = 0.0f |
Maximum torque before constraint breaks (Newton-meters).
When the constraint torque exceeds this threshold, the constraint is marked as broken and disabled.
| float Physics::Component::ConstraintSettings::damping = 0.0f |
Constraint damping [0.0, 1.0].
Controls how much energy is absorbed to prevent oscillation:
Internally mapped to Jolt's SpringSettings::mDamping
| bool Physics::Component::ConstraintSettings::enableCollision = false |
Enable collision between constrained bodies.
When true, the two bodies connected by this constraint can still collide with each other. When false (default), collisions between the constrained bodies are disabled.
| float Physics::Component::ConstraintSettings::stiffness = 1.0f |
Constraint stiffness [0.0, 1.0].
Controls how rigid the constraint is:
Internally mapped to Jolt's SpringSettings::mStiffness