21#include <entt/entt.hpp>
22#include <glm/gtc/quaternion.hpp>
23#include <glm/vec3.hpp>
Shared ECS registry type alias for the game engine.
entt::registry Registry
Shared ECS registry type alias.
Definition Registry.hpp:11
Pure physics math — no ECS types, no registry.
Definition BroadphaseTree.cpp:11
void solveJoints(Registry ®istry, const SolverConfig &cfg, float dt)
Solve every joint in the registry using sequential impulses.
Definition Joints.cpp:390
Cone-twist joint — locks anchors AND constrains relative rotation to a swing-cone + twist-limit.
Definition Joints.hpp:72
glm::quat localFrameB
Definition Joints.hpp:78
glm::vec3 localAnchorA
Definition Joints.hpp:75
entt::entity bodyA
Definition Joints.hpp:73
glm::vec3 accumulatedAnchorImpulse
Definition Joints.hpp:83
float twistLimit
Max twist about cone axis, radians.
Definition Joints.hpp:81
entt::entity bodyB
Definition Joints.hpp:74
glm::quat localFrameA
Rest orientation in A's space.
Definition Joints.hpp:77
glm::vec3 localAnchorB
Definition Joints.hpp:76
float swingLimit
Max half-cone angle, radians (~35°).
Definition Joints.hpp:80
glm::vec3 accumulatedAngularImpulse
Definition Joints.hpp:84
Single-axis hinge — locks the bodies' anchors together AND constrains their relative rotation to a si...
Definition Joints.hpp:44
glm::vec3 accumulatedAnchorImpulse
Definition Joints.hpp:64
glm::vec3 localAnchorA
Definition Joints.hpp:47
float maxMotorTorque
Definition Joints.hpp:62
bool motorEnabled
Motor — if enabled, drive angularVelocity toward targetAngularSpeed with at most maxMotorTorque.
Definition Joints.hpp:60
float maxAngle
Definition Joints.hpp:55
float targetAngularSpeed
Definition Joints.hpp:61
glm::vec3 localAnchorB
Definition Joints.hpp:48
glm::vec3 accumulatedAngularImpulse
Definition Joints.hpp:65
glm::vec3 localAxisA
Hinge axis in A's local space.
Definition Joints.hpp:49
float minAngle
Limit angles in radians.
Definition Joints.hpp:54
entt::entity bodyB
Definition Joints.hpp:46
glm::vec3 localAxisB
Hinge axis in B's local space.
Definition Joints.hpp:50
entt::entity bodyA
Definition Joints.hpp:45
bool hasLimit
Definition Joints.hpp:56
Generic 6-DOF joint — per-axis lock / limit / free + optional motor and spring on each axis.
Definition Joints.hpp:91
glm::vec3 localAnchorA
Definition Joints.hpp:94
glm::vec3 localAnchorB
Definition Joints.hpp:95
AxisMode angularMode[3]
Definition Joints.hpp:105
AxisMode linearMode[3]
Definition Joints.hpp:104
glm::vec3 linearMax
Definition Joints.hpp:107
glm::vec3 angularMin
Definition Joints.hpp:108
glm::vec3 linearMin
Definition Joints.hpp:106
AxisMode
Definition Joints.hpp:98
@ Limited
Clamp to [min, max].
Definition Joints.hpp:100
@ Free
No constraint.
Definition Joints.hpp:99
@ Locked
minAngle == maxAngle
Definition Joints.hpp:101
entt::entity bodyB
Definition Joints.hpp:93
entt::entity bodyA
Definition Joints.hpp:92
glm::vec3 angularMax
Definition Joints.hpp:109
Spherical/ball joint — locks the world-space anchor points of two bodies together while permitting ar...
Definition Joints.hpp:31
glm::vec3 localAnchorA
Anchor in body A's local frame.
Definition Joints.hpp:34
entt::entity bodyB
Definition Joints.hpp:33
entt::entity bodyA
Definition Joints.hpp:32
float breakForce
If > 0, joint detaches when impulse exceeds.
Definition Joints.hpp:37
glm::vec3 accumulatedImpulse
Warm-started across frames.
Definition Joints.hpp:36
glm::vec3 localAnchorB
Anchor in body B's local frame.
Definition Joints.hpp:35