Builds a hinge. See HingeJointOptions and JointOptions.
ReadonlyaxisWorld-space hinge axis at construction, or undefined for the default.
ReadonlybodyFirst constrained body (§28).
ReadonlybodySecond constrained body (§28).
ReadonlybrokenSet once when a §28 break threshold is exceeded; never cleared.
ReadonlyidThe world's monotonic id while registered, undefined otherwise.
ReadonlytypeWhich §28 constraint this is — the descriptor's discriminant.
Attachment point on Joint.bodyA.
World space until Joint.setAnchors or world.addJoint converts it
to bodyA's local frame. After that, reads and writes are body-local
(PH-22f). undefined means the body's own origin.
Sets the attachment point on Joint.bodyA in body-local space and queues it when the joint is registered. See Joint.setAnchors.
Attachment point on Joint.bodyB. See Joint.anchorA.
Sets the attachment point on Joint.bodyB in body-local space and queues it when the joint is registered. See Joint.setAnchors.
Whether Joint.anchorA / Joint.anchorB are body-local
(PH-22f). false after construction (world-space options); true after
addJoint writes the converted frames back, or after Joint.setAnchors.
Whether either §28 break threshold is set, so the world must monitor it.
Reaction force in newtons above which this joint breaks (§28), or
undefined for a joint that never breaks.
Settable at any time, registered or not: the threshold is compared by the
world after each step and never reaches the solver, so there is nothing to
reconfigure. Setting one on a registered joint whose adapter cannot report
reactions is not rejected here — the check belongs where the adapter is
known, at world.addJoint.
Reaction torque in N·m above which this joint breaks (§28).
Whether the two bodies still collide with each other (§28).
Live since PH-22f (2026-08-08). Setting it on a registered joint
queues the change, exactly as HingeJoint.setLimits does, and the
world drains it into SolverJointAccess.setJointCollisionEnabled at the
top of the next fixed step (§26's commands-not-mutations rule — the solver
may be mid-step, and §6b forbids physics work during dispatch). Writing
the value it already holds queues nothing.
Anchors joined it as the other live §28 property every shipped solver can change — see Joint.setAnchors. Axis, rope length, spring terms and the spherical swing cone stay frozen; see the module header's table.
What this joint has been asked to reconfigure (§28). See JointCommands.
Whether Joint.dispose has run. Disposal is terminal (§83): a
disposed joint refuses world registration with INVALID_APPLICATION_STATE
(§89) rather than silently working.
The angular travel in radians, or undefined when the hinge spins freely
(§28). A copy — call HingeJoint.setLimits to change it.
The motor, or undefined when the hinge is undriven (§28). A copy — call
HingeJoint.setMotor to change it.
Whether a world currently holds this joint (its Joint.id is set).
ProtecteddescribeThe fields every descriptor shares, for Joint.toDescriptor.
Drops every listener (§83). Removing the joint from its world is the
world's business, exactly as it is for RigidBody.
Delivers event to the listeners registered for type in registration
order. Re-entrant emission of type is deferred (rule 4).
Turns the motor on or off, keeping its target and effort (§28).
Number of live registrations for type (diagnostics, §83).
Number of live listener registrations across every event type (§83).
Used by teardown diagnostics — a detached node that still holds listeners pins its subtree until those listeners are removed.
Removes the earliest still-registered registration of listener for
type. Removing a listener that is not registered is a no-op.
Registers listener for type. Returns a function that removes it.
The same listener may be registered more than once; each registration is independent and is delivered once per dispatch.
Registers listener for a single delivery. Returns an unsubscriber.
ProtectedqueueMarks the reconfiguration queue; used by the limit and motor setters.
ProtectedqueueMarks the reconfiguration queue; used by the motor setters.
Removes every listener, or every listener of one type. Used by teardown paths that must not leave detached nodes retaining listeners (§83).
Optionaltype: KReplaces both attachment points with body-local vectors and queues them for the solver (§28, PH-22f).
The frames are the same ones stored after world.addJoint converts the
world-space constructor options. They are not re-measured against the
current world poses and not re-measured against the authoring poses — the
caller supplies local-space points. undefined means that body's origin.
Takes effect at the next fixed step, like HingeJoint.setLimits.
Writing the values already stored queues nothing. Unregistered, the write
is immediate and the next addJoint uses these locals as-is (it does not
convert them as world-space).
Sets the angular travel in radians and queues it for the solver (§28).
Takes effect at the next fixed step, like every other command in this engine. Limits can be changed but not removed once the joint is registered: no adapter here can drop a live limit, and a "clearLimits" that silently did nothing would be worse than its absence.
Sets the velocity motor and queues it for the solver (§28's motor).
setMotor({ enabled: false, … }) — or HingeJoint.enableMotor —
stops the drive without removing it, which is what "limit switches" and a
stopped shaft need. Like limits, a motor cannot be added to a registered
joint, only reconfigured.
The descriptor an adapter is handed for this joint (§37 createJoint),
with the body-local frames binding carries.
The record is fresh; its vectors are binding's, which the adapter reads
during createJoint and must not retain (the contract
RigidBody.toDescriptor already sets).
+Z in a "2d" world (§21); the authored axis otherwise, or zero.
A hinge (§28 "revolute/hinge"): one rotational degree of freedom about HingeJoint.axis. Both dimensions.
§28 names this type twice; RevoluteJoint is the same class under its other name.