Skip to content

Search

Documentation

joint3d

Joins this node's body to connected_body. kind is fixed, hinge, slider, ball_socket, rope, spring or generic; both ends need a body3d on or above the…

On this page

3d · physics · 13 properties · 3D

Joins this node's body to connected_body. kind is fixed, hinge, slider, ball_socket, rope, spring or generic; both ends need a body3d on or above the node. axes limits and drives each free axis.

In a scene, joint3d is the node key that applies it. A script reaches each property below as a field on node.joint3d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.joint3d.get() and node.joint3d.set(table).

Properties

property type default description
anchor vec3 [0,0,0] Where the joint attaches on this node, in its own space
anchor_rotation vec3 [0,0,0] Turns this end's joint frame about its own axes, x first: what a hinge's angle and its limits measure from, and the relative turn a fixed joint holds. Euler radians in the file
axes list [] One record per free axis to limit or drive. A rope's x takes no limits (max_length is its limit); a spring's x is its spring, whose motor stays off
axis vec3 [0,0,1] The joint frame's x axis: what a hinge turns about, a slider slides along, and a generic joint's x and rotation_x name
collide_connected bool false Let the two joined bodies collide with each other
connected_anchor vec3 [0,0,0] Where it attaches on the other node, in that node's space
connected_anchor_rotation vec3 [0,0,0] The same for the other end's frame
connected_axis vec3 [0,0,0] The same axis in the other node's space, for a hinge, a slider or a generic joint; zero takes axis
connected_body node — The node at the joint's other end; this node is the first end
enabled bool true Hold the two bodies together at all. Off keeps the joint and stops solving it; an articulation leaves its chain instead, as rapier's chains ignore the switch
kind enum fixed How the two bodies may move relative to each other One of fixed, hinge, slider, ball_socket, rope, spring, generic.
softness_damping_ratio float 1 The damping ratio of that spring; 1 settles without overshooting At least 0.
softness_hz float 1000000 How stiffly the joint's locked axes and limits are held, as a spring frequency in hertz; lower lets them stretch and spring back At least 0.

Script functions

Methods of node.joint3d, the handle a node carrying this component exposes. Every handle also has get(), set(table), patch(table), has() and remove().

From physics3d:

method what it does
joint_force() -> physics3d::JointForce The force and the torque the joint held through the last step: what break_force and break_torque are measured against. An articulation has none to read, and says so.
joint_state() -> physics3d::JointState What the joint is doing.
remove_joint() Undo the node's joint, leaving both bodies free.
set_joint_limits(string, float, float) Set how far one of the joint's free axes may travel, in radians about a rotation axis and units along a linear one; equal values lift the limit. Rewrites that axis's axes record.
set_motor_position(string, float, float, float) Drive one of the joint's free axes towards an angle or a distance, with a spring's stiffness and damping. Rewrites that axis's axes record.
set_motor_velocity(string, float, float) Drive one of the joint's free axes towards a speed: how a wheel is powered or a door swings itself shut. Rewrites that axis's axes record.
solve_ik(float, float, float, physics3d::IkOptions?) Move a reduced-coordinates chain so its last link reaches a world position, leaving every joint inside its limits. Options: rotation (euler radians to turn the link to), constrain (the world axes to match: x, y, z, rotation_x, rotation_y, rotation_z; the translation by default, every axis when rotation is given), damping (1.0), iterations (10), tolerance (0.001).

Are you sure?