|
group2 0.1.0
CSE 125 Group 2
|
Constraint definitions for point, hinge, cone-twist, and 6-DOF joints. More...
#include <cstdint>#include <entt/entt.hpp>#include <glm/gtc/quaternion.hpp>#include <glm/vec3.hpp>#include "ecs/registry/Registry.hpp"Go to the source code of this file.
Classes | |
| struct | physics::PointJoint |
| Spherical/ball joint — locks the world-space anchor points of two bodies together while permitting arbitrary rotation. More... | |
| struct | physics::HingeJoint |
| Single-axis hinge — locks the bodies' anchors together AND constrains their relative rotation to a single axis. More... | |
| struct | physics::ConeTwistJoint |
| Cone-twist joint — locks anchors AND constrains relative rotation to a swing-cone + twist-limit. More... | |
| struct | physics::Joint6DOF |
| Generic 6-DOF joint — per-axis lock / limit / free + optional motor and spring on each axis. More... | |
Namespaces | |
| namespace | physics |
| Pure physics math — no ECS types, no registry. | |
Functions | |
| void | physics::solveJoints (Registry ®istry, const SolverConfig &cfg, float dt) |
| Solve every joint in the registry using sequential impulses. | |
Constraint definitions for point, hinge, cone-twist, and 6-DOF joints.
Each joint is stored as an ECS component on a "joint entity" — the joint entity itself isn't a body, just a constraint between two bodies bodyA and bodyB. Joints feed into the Phase 10 PGS solver via solveJoints() which runs alongside solveContacts().
Anchor frames. Each side holds the joint anchor in the body's local space so the world-space anchors track the bodies as they translate / rotate. Setting up a joint at construction time computes these local frames from the current world transforms.
Limits + motors. Phase-11 ships position limits (clamp) and velocity motors (maxForce-capped impulse driver) — sufficient for ragdolls, doors, hinged platforms.