Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Simple

Distance constraint component (5 DOF).

Distance constraint component (5 DOF)Maintains a distance range between two bodies while allowing free rotation. The constraint has 5 degrees of freedom (3 rotational for each body connection point, minus 1 for the distance constraint).

Degrees of Freedom: 5 (rotation free, distance constrained)

rope:

anchorEntity,
swingingEntity,
3.0f, // Fixed distance of 3 meters
glm::vec3(0, -0.5f, 0), // Bottom of anchor
glm::vec3(0, 0.5f, 0), // Top of swinging body
);
static ConstraintSettings Rigid()
Create settings for a perfectly rigid constraint.
Definition ConstraintSettings.hpp:136
static DistanceConstraint Create(Engine::EntityId a, Engine::EntityId b, float distance, const glm::vec3 &pointA=glm::vec3(0.0f), const glm::vec3 &pointB=glm::vec3(0.0f), const ConstraintSettings &constraintSettings=ConstraintSettings::Rigid())
Create a fixed-distance constraint (rope).
Definition DistanceConstraint.hpp:177