#include <PointConstraint.hpp>
|
| static PointConstraint | 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 point constraint between two bodies.
|
| static PointConstraint | CreateToWorld (Engine::EntityId body, const glm::vec3 &worldPoint, const ConstraintSettings &constraintSettings=ConstraintSettings::Rigid()) |
| | Create a point constraint from body to world (pendulum, anchor).
|
| static PointConstraint | CreateToWorldWithOffset (Engine::EntityId body, const glm::vec3 &worldPoint, const glm::vec3 &localPoint, const ConstraintSettings &constraintSettings=ConstraintSettings::Rigid()) |
| | Create a point constraint from body to world with local attachment.
|
◆ Create()
Create a point constraint between two bodies.
- Parameters
-
| 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 |
- Returns
- Configured PointConstraint component
- Examples
- Elbow, and Ragdoll.
◆ CreateToWorld()
Create a point constraint from body to world (pendulum, anchor).
Creates a ball-and-socket joint connecting a body to a fixed point in world space. The body can rotate freely around this point.
- Parameters
-
| body | The body entity to constrain |
| worldPoint | Fixed anchor point in world space |
| constraintSettings | Constraint behavior settings |
- Returns
- Configured PointConstraint component
- Examples
- Pendulum.
◆ CreateToWorldWithOffset()
Create a point constraint from body to world with local attachment.
Same as CreateToWorld, but allows specifying an offset on the body.
- Parameters
-
| body | The body entity to constrain |
| worldPoint | Fixed anchor point in world space |
| localPoint | Attachment point on the body in local space |
| constraintSettings | Constraint behavior settings |
- Returns
- Configured PointConstraint component
◆ IsWorldConstraint()
| bool Physics::Component::PointConstraint::IsWorldConstraint |
( |
| ) |
const |
|
inlinenodiscard |
Check if this is a world constraint.
- Returns
- true if bodyB is invalid (world constraint)
◆ bodyA
First body entity (the entity this component is attached to).
◆ bodyB
Second body entity (the entity to connect to).
If invalid (default constructed), this becomes a world constraint.
◆ broken
| bool Physics::Component::PointConstraint::broken = false |
Whether this constraint has been broken.
◆ localPointA
| glm::vec3 Physics::Component::PointConstraint::localPointA = glm::vec3(0.0f) |
Attachment point on bodyA in local body space.
The point on the first body where the joint is located. Coordinates are relative to the body's center of mass.
◆ localPointB
| glm::vec3 Physics::Component::PointConstraint::localPointB = glm::vec3(0.0f) |
Attachment point on bodyB in local body space (or world space if world constraint).
For body-to-body constraints: local coordinates on bodyB For world constraints: world space coordinates of the anchor point
◆ settings
Constraint settings (stiffness, damping, breaking thresholds).
The documentation for this struct was generated from the following file: