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

Point constraint component (3 DOF).

Point constraint component (3 DOF)Connects two bodies at a point, allowing free rotation but no translation. Also known as a ball-and-socket joint or spherical joint.

Degrees of Freedom: 3 (rotation free, translation locked)

(body to world):

// Create swinging pendulum attached to fixed point
pendulumWeight,
glm::vec3(0, 5, 0), // Fixed point in world space
);
pendulumWeight.AddComponent<Physics::Component::PointConstraint>(core, constraint);
static ConstraintSettings Rigid()
Create settings for a perfectly rigid constraint.
Definition ConstraintSettings.hpp:136
Definition PointConstraint.hpp:76
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).
Definition PointConstraint.hpp:172