|
Engine²
Open-source game engine written in C++.
|
#include <FixedConstraint.hpp>
Public Member Functions | |
| bool | IsWorldConstraint () const |
| Check if this is a world constraint (body to world, not body to body). | |
Static Public Member Functions | |
| static FixedConstraint | Create (Engine::EntityId a, Engine::EntityId b, const glm::vec3 &pointA=glm::vec3(0.0f), const glm::vec3 &pointB=glm::vec3(0.0f), const ConstraintSettings &constraintSettings=ConstraintSettings::Rigid()) |
| Create a fixed constraint between two bodies. | |
| static FixedConstraint | CreateToWorld (Engine::EntityId body, const glm::vec3 &worldPoint, const ConstraintSettings &constraintSettings=ConstraintSettings::Rigid()) |
| Create a fixed constraint from one body to the world. | |
Public Attributes | |
| Engine::EntityId | bodyA = Engine::EntityId::Null() |
| First body entity (the entity this component is attached to). | |
| Engine::EntityId | bodyB = Engine::EntityId::Null() |
| Second body entity (the entity to connect to). | |
| glm::vec3 | localPointA = glm::vec3(0.0f) |
| Attachment point on bodyA in local body space. | |
| glm::vec3 | localPointB = glm::vec3(0.0f) |
| Attachment point on bodyB in local body space. | |
| ConstraintSettings | settings |
| Constraint settings (stiffness, damping, breaking thresholds). | |
| bool | broken = false |
| Whether this constraint has been broken. | |
|
inlinestaticnodiscard |
Create a fixed constraint between two bodies.
| a | First body entity (owner of this component) |
| b | Second body entity |
| pointA | Local attachment point on bodyA |
| pointB | Local attachment point on bodyB |
| constraintSettings | Constraint behavior settings |
|
inlinestaticnodiscard |
Create a fixed constraint from one body to the world.
Attaches a body to a fixed point in world space.
| body | The body entity to constrain |
| worldPoint | Point in world space to attach to |
| constraintSettings | Constraint behavior settings |
|
inlinenodiscard |
Check if this is a world constraint (body to world, not body to body).
| Engine::EntityId Physics::Component::FixedConstraint::bodyA = Engine::EntityId::Null() |
First body entity (the entity this component is attached to).
This should be the entity that owns this constraint component. World constraints are encoded by setting bodyB invalid (see CreateToWorld()).
| Engine::EntityId Physics::Component::FixedConstraint::bodyB = Engine::EntityId::Null() |
Second body entity (the entity to connect to).
The other entity involved in the constraint.
| bool Physics::Component::FixedConstraint::broken = false |
Whether this constraint has been broken.
When a breakable constraint exceeds its force/torque threshold, this flag is set to true and the Jolt constraint is disabled. The component remains attached to allow user code to react.
| glm::vec3 Physics::Component::FixedConstraint::localPointA = glm::vec3(0.0f) |
Attachment point on bodyA in local body space.
The point on the first body where the constraint attaches. Coordinates are relative to the body's center of mass.
| glm::vec3 Physics::Component::FixedConstraint::localPointB = glm::vec3(0.0f) |
Attachment point on bodyB in local body space.
The point on the second body where the constraint attaches. Coordinates are relative to the body's center of mass.
| ConstraintSettings Physics::Component::FixedConstraint::settings |
Constraint settings (stiffness, damping, breaking thresholds).