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
Two rigid bodies swinging from a shared point: Ball
A door, arm, wheel or pendulum rotating about one axis: Hinge, with its axis set
Stopping a hinge swinging past a range: Limit, with Limit Lo / Limit Hi
A hinge actively rotating toward an angle like a powered motor: Motor, with Motor Target and Motor Stiffness
A pin that gives a little, like a soft spring, instead of a rigid lock: Compliance above 0
| Parameter | Type | Default |
|---|---|---|
bodies | CollectionOf(Points) | — |
world_id | String | "default" |
joint_type | String | "Ball" |
body_a_id | Number | 0 |
body_b_id | Number | 1 |
anchor_a_x | Number | 0 |
anchor_a_y | Number | 0 |
anchor_a_z | Number | 0 |
anchor_b_x | Number | 0 |
anchor_b_y | Number | 0 |
anchor_b_z | Number | 0 |
axis_x | Number | 0 |
axis_y | Number | 1 |
axis_z | Number | 0 |
limit_enabled | Boolean | false |
limit_lo | Number | -1.571 |
limit_hi | Number | 1.571 |
motor_enabled | Boolean | false |
motor_target | Number | 0 |
motor_stiffness | Number | 50000 |
compliance | Number | 0 |
strength | Number | 1 |
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
Add a Physics Joint and set Joint Type to Hinge.
Set Body A ID and Body B ID to match the
@idvalues of the two rigid bodies to connect.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.
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.
Wire the joint's output into Physics World's joints input.