Local anchor offset on bodyA.
Local anchor offset on bodyB, or world-space anchor if bodyB is null.
Local hinge axis on bodyA.
Local hinge axis on bodyB.
The primary Object3D entity constrained by this joint.
The secondary Object3D entity, or null to anchor bodyA to static world space.
Maximum force or impulse threshold before joint rupture.
Whether collision response between bodyA and bodyB is enabled.
Whether the joint is actively evaluated during physics simulation ticks.
Whether the rotational angle limits are enforced.
Whether the motor is active.
Whether the joint has exceeded breakForce and ruptured.
Upper rotation limit in radians.
Maximum motor torque in N*m.
Lower rotation limit in radians.
Target rotation speed in rad/s.
ProtectedisTrue when every dynamic body connected by this joint is currently asleep (static bodies do not count). A fully-asleep joint has nothing to solve: both endpoints are frozen, so the solve can be skipped without waking them. This mirrors the collision solver, which only applies impulses to approaching contacts and therefore never re-wakes settled bodies.
OptionalapplyOptional pre-solve hook to accumulate continuous forces (e.g. Hookean spring tension).
Fixed substep delta time in seconds.
Measured hinge angle between bodyB and bodyA around the hinge axis, in [-PI, PI]. Built fresh from the current body frames each call: no accumulation, so the value is always the actual relative rotation (mod 2-PI) and never drifts.
When bodyB is absent the hinge is anchored to a fixed world frame and this returns the rotation of bodyA relative to that frame. Returns NaN if no usable reference could be built (every canonical axis is parallel to the hinge axis).
Solves positional drift and geometric error projection to prevent numerical stretching.
Solves velocity constraints using Projected Gauss-Seidel iterations.
Fixed substep delta time in seconds.
A revolute hinge connecting two bodies at a shared anchor point. The hinge keeps the anchors coincident (3 linear DOFs) and keeps both hinge axes parallel (2 rotational DOFs), leaving a single rotational DOF around the hinge axis. A torque-capped motor can drive that DOF, and optional min/max angle limits bound it.
The hinge angle is measured geometrically from the current body frames (never accumulated), so it stays correct even after many full rotations and never drifts. Relative angular speeds in this file always use
angVel = (omegaB - omegaA) dot axis, i.e. the rate at whichgetRelativeAngle()grows.