Physics Joint

Create ball or hinge joints between two rigid bodies.

What it does

Links two rigid bodies with an articulated constraint: a Ball joint, a shared pin point free to swing in any direction, or a Hinge, a single rotation axis like a door or an elbow. Bodies are matched by their @id attribute rather than by wire order, so each joint points at the bodies it connects with ID numbers.

A Hinge can do more than pivot. Limit clamps how far it swings, and Motor drives it toward a target angle at a given stiffness. Compliance makes a Ball joint act as a soft spring instead of a rigid pin. The output plugs into Physics World's joints input; the node drives nothing on its own.

When to use it

ParameterTypeDefaultWhat it does
bodiesPoints——
world_idString"default"Physics world identifier
joint_typeString"Ball"Joint type: Ball (point pin) or Hinge (single-axis revolute)
body_a_idNumber0Body A @id
body_b_idNumber1Body B @id
anchor_a_xNumber0Anchor point A - X (local to body A)
anchor_a_yNumber0Anchor point A - Y
anchor_a_zNumber0Anchor point A - Z
anchor_b_xNumber0Anchor point B - X (local to body B)
anchor_b_yNumber0Anchor point B - Y
anchor_b_zNumber0Anchor point B - Z
axis_xNumber0Hinge axis - X (local to both bodies; Hinge only)
axis_yNumber1Hinge axis - Y (local to both bodies; Hinge only)
axis_zNumber0Hinge axis - Z (local to both bodies; Hinge only)
limit_enabledBooleanfalseClamp the hinge angle to [Limit Lo, Limit Hi] (Hinge only)
limit_loNumber-1.571Lower hinge-angle limit (radians)
limit_hiNumber1.571Upper hinge-angle limit (radians)
motor_enabledBooleanfalseDrive the hinge angle toward Motor Target (Hinge only)
motor_targetNumber0Motor target hinge angle (radians)
motor_stiffnessNumber50000Motor stiffness (torque per radian)
complianceNumber0Ball compliance — 0 = rigid, >0 = soft spring
strengthNumber1Effect strength / wet-dry (0 = no effect, 1 = full). Editable, wirable, keyframable.

Gotchas

Limit and Motor apply to Hinge joints only. On a Ball joint they are ignored, since a ball pin has no single rotation axis to limit or drive.

The Hinge Axis is defined once and shared by both bodies, which lines up only when the two bodies start in the same rest orientation. Otherwise the hinge does not swing as expected.

Body A and Body B are matched by the @id attribute on the rigid bodies, not by connection order. The bodies feeding Physics World must carry the @id values typed into Body A ID / Body B ID, or the joint binds silently to the wrong bodies, or to none.

A Physics Joint node does nothing by itself. Its output must be wired into Physics World's joints input before the constraint is simulated.

Worked example

  1. Add a Physics Joint and set Joint Type to Hinge.

  2. Set Body A ID and Body B ID to match the @id values of the two rigid bodies to connect.

  3. Set the Anchors so the pivot sits at the right point on each body, and set Hinge Axis to the direction it should rotate about.

  4. Enable Limit and set Limit Lo / Limit Hi to keep the swing within range, or enable Motor and set Motor Target to drive it to an angle.

  5. Wire the joint's output into Physics World's joints input.

See also

Rigid Body Sim · Physics World · Physics Query · Attributes