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

ParameterTypeDefault
bodiesCollectionOf(Points)
world_idString"default"
joint_typeString"Ball"
body_a_idNumber0
body_b_idNumber1
anchor_a_xNumber0
anchor_a_yNumber0
anchor_a_zNumber0
anchor_b_xNumber0
anchor_b_yNumber0
anchor_b_zNumber0
axis_xNumber0
axis_yNumber1
axis_zNumber0
limit_enabledBooleanfalse
limit_loNumber-1.571
limit_hiNumber1.571
motor_enabledBooleanfalse
motor_targetNumber0
motor_stiffnessNumber50000
complianceNumber0
strengthNumber1

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