Skip to main content

Module joint

Module joint 

Source
Expand description

Joints (constraints) between bodies.

Create typed joints with the create_*_joint helpers (distance, motor, parallel, prismatic, revolute, spherical, weld, wheel, filter), each taking the matching def from crate::types (default_revolute_joint_def, etc.).

Port of joint.h / joint.c (lifecycle, plumbing, and per-type solve).

SPDX-FileCopyrightText: 2025 Erin Catto SPDX-License-Identifier: MIT

Structs§

DistanceJoint
(b3DistanceJoint)
Joint
Map from JointId to joint data in the solver sets. (b3Joint)
JointEdge
A joint edge connects bodies and joints in a joint graph. (b3JointEdge)
JointSim
The base joint simulation class. (b3JointSim)
MotorJoint
(b3MotorJoint)
ParallelJoint
(b3ParallelJoint)
PrismaticJoint
(b3PrismaticJoint)
RevoluteJoint
(b3RevoluteJoint)
SphericalJoint
(b3SphericalJoint)
WeldJoint
(b3WeldJoint)
WheelJoint
(b3WheelJoint)

Enums§

JointType
Joint type enumeration. (types.h: b3JointType)
JointUnion
Joint-specific simulation union. (C anonymous union in b3JointSim) Filter joints have no simulation payload.

Functions§

create_distance_joint
(b3CreateDistanceJoint)
create_filter_joint
(b3CreateFilterJoint)
create_motor_joint
(b3CreateMotorJoint)
create_parallel_joint
(b3CreateParallelJoint)
create_prismatic_joint
(b3CreatePrismaticJoint)
create_revolute_joint
(b3CreateRevoluteJoint)
create_spherical_joint
(b3CreateSphericalJoint)
create_weld_joint
(b3CreateWeldJoint)
create_wheel_joint
(b3CreateWheelJoint)
destroy_joint
(b3DestroyJoint)
destroy_joint_internal
Destroy a joint: unlink it from both bodies’ joint lists, the island graph, and the solver set or constraint graph that owns its sim, then free the id. (b3DestroyJointInternal — C takes the joint pointer; Rust takes the id.)
distance_joint_enable_limit
(b3DistanceJoint_EnableLimit)
distance_joint_enable_motor
(b3DistanceJoint_EnableMotor)
distance_joint_enable_spring
(b3DistanceJoint_EnableSpring)
distance_joint_get_current_length
(b3DistanceJoint_GetCurrentLength)
distance_joint_get_length
(b3DistanceJoint_GetLength)
distance_joint_get_max_length
(b3DistanceJoint_GetMaxLength)
distance_joint_get_max_motor_force
(b3DistanceJoint_GetMaxMotorForce)
distance_joint_get_min_length
(b3DistanceJoint_GetMinLength)
distance_joint_get_motor_force
(b3DistanceJoint_GetMotorForce)
distance_joint_get_motor_speed
(b3DistanceJoint_GetMotorSpeed)
distance_joint_get_spring_damping_ratio
(b3DistanceJoint_GetSpringDampingRatio)
distance_joint_get_spring_force_range
(b3DistanceJoint_GetSpringForceRange)
distance_joint_get_spring_hertz
(b3DistanceJoint_GetSpringHertz)
distance_joint_is_limit_enabled
(b3DistanceJoint_IsLimitEnabled)
distance_joint_is_motor_enabled
(b3DistanceJoint_IsMotorEnabled)
distance_joint_is_spring_enabled
(b3DistanceJoint_IsSpringEnabled)
distance_joint_set_length
(b3DistanceJoint_SetLength)
distance_joint_set_length_range
(b3DistanceJoint_SetLengthRange)
distance_joint_set_max_motor_force
(b3DistanceJoint_SetMaxMotorForce)
distance_joint_set_motor_speed
(b3DistanceJoint_SetMotorSpeed)
distance_joint_set_spring_damping_ratio
(b3DistanceJoint_SetSpringDampingRatio)
distance_joint_set_spring_force_range
(b3DistanceJoint_SetSpringForceRange)
distance_joint_set_spring_hertz
(b3DistanceJoint_SetSpringHertz)
draw_joint
(b3DrawJoint)
get_distance_joint_force
(b3GetDistanceJointForce)
get_joint_full_id
Validate a JointId and return the raw joint index. (b3GetJointFullId — C returns a pointer; Rust returns the index into world.joints)
get_joint_reaction
Scalar force/torque magnitudes from accumulated impulses. (b3GetJointReaction)
get_joint_sim
Borrow a joint’s sim data mutably: constraint graph color for awake joints, otherwise the owning solver set. (b3GetJointSim)
get_joint_sim_check_type
(b3GetJointSimCheckType)
get_joint_sim_check_type_ref
Shared-reference variant of get_joint_sim_check_type.
get_joint_sim_ref
Shared-reference variant of get_joint_sim for read-only accessors.
get_motor_joint_force
(b3GetMotorJointForce)
get_motor_joint_torque
(b3GetMotorJointTorque)
get_parallel_joint_torque
(b3GetParallelJointTorque)
get_prismatic_joint_force
(b3GetPrismaticJointForce)
get_prismatic_joint_torque
(b3GetPrismaticJointTorque)
get_revolute_joint_force
(b3GetRevoluteJointForce)
get_revolute_joint_torque
(b3GetRevoluteJointTorque — recomputes perpAxisX/perpAxisY for warm starting as a side effect, so base is mutable like the C pointer)
get_spherical_joint_force
(b3GetSphericalJointForce)
get_spherical_joint_torque
(b3GetSphericalJointTorque)
get_weld_joint_force
(b3GetWeldJointForce)
get_weld_joint_torque
(b3GetWeldJointTorque)
get_wheel_joint_force
(b3GetWheelJointForce)
get_wheel_joint_torque
(b3GetWheelJointTorque)
joint_get_angular_separation
(b3Joint_GetAngularSeparation)
joint_get_body_a
(b3Joint_GetBodyA)
joint_get_body_b
(b3Joint_GetBodyB)
joint_get_collide_connected
(b3Joint_GetCollideConnected)
joint_get_constraint_force
(b3GetJointConstraintForce / b3Joint_GetConstraintForce)
joint_get_constraint_torque
(b3GetJointConstraintTorque / b3Joint_GetConstraintTorque)
joint_get_constraint_tuning
(b3Joint_GetConstraintTuning)
joint_get_force_threshold
(b3Joint_GetForceThreshold)
joint_get_linear_separation
(b3Joint_GetLinearSeparation)
joint_get_local_frame_a
(b3Joint_GetLocalFrameA)
joint_get_local_frame_b
(b3Joint_GetLocalFrameB)
joint_get_torque_threshold
(b3Joint_GetTorqueThreshold)
joint_get_type
(b3Joint_GetType)
joint_get_user_data
(b3Joint_GetUserData)
joint_get_world
(b3Joint_GetWorld)
joint_is_valid
Joint id validity. (b3Joint_IsValid — world-registry checks collapse to the world argument)
joint_set_collide_connected
(b3Joint_SetCollideConnected)
joint_set_constraint_tuning
(b3Joint_SetConstraintTuning)
joint_set_force_threshold
(b3Joint_SetForceThreshold)
joint_set_local_frame_a
(b3Joint_SetLocalFrameA)
joint_set_local_frame_b
(b3Joint_SetLocalFrameB)
joint_set_torque_threshold
(b3Joint_SetTorqueThreshold)
joint_set_user_data
(b3Joint_SetUserData) — Rust stores u64 instead of void*.
joint_wake_bodies
(b3Joint_WakeBodies)
motor_joint_get_angular_damping_ratio
(b3MotorJoint_GetAngularDampingRatio)
motor_joint_get_angular_hertz
(b3MotorJoint_GetAngularHertz)
motor_joint_get_angular_velocity
(b3MotorJoint_GetAngularVelocity)
motor_joint_get_linear_damping_ratio
(b3MotorJoint_GetLinearDampingRatio)
motor_joint_get_linear_hertz
(b3MotorJoint_GetLinearHertz)
motor_joint_get_linear_velocity
(b3MotorJoint_GetLinearVelocity)
motor_joint_get_max_spring_force
(b3MotorJoint_GetMaxSpringForce)
motor_joint_get_max_spring_torque
(b3MotorJoint_GetMaxSpringTorque)
motor_joint_get_max_velocity_force
(b3MotorJoint_GetMaxVelocityForce)
motor_joint_get_max_velocity_torque
(b3MotorJoint_GetMaxVelocityTorque)
motor_joint_set_angular_damping_ratio
(b3MotorJoint_SetAngularDampingRatio)
motor_joint_set_angular_hertz
(b3MotorJoint_SetAngularHertz)
motor_joint_set_angular_velocity
(b3MotorJoint_SetAngularVelocity)
motor_joint_set_linear_damping_ratio
(b3MotorJoint_SetLinearDampingRatio)
motor_joint_set_linear_hertz
(b3MotorJoint_SetLinearHertz)
motor_joint_set_linear_velocity
(b3MotorJoint_SetLinearVelocity)
motor_joint_set_max_spring_force
(b3MotorJoint_SetMaxSpringForce)
motor_joint_set_max_spring_torque
(b3MotorJoint_SetMaxSpringTorque)
motor_joint_set_max_velocity_force
(b3MotorJoint_SetMaxVelocityForce)
motor_joint_set_max_velocity_torque
(b3MotorJoint_SetMaxVelocityTorque)
parallel_joint_get_max_torque
(b3ParallelJoint_GetMaxTorque)
parallel_joint_get_spring_damping_ratio
(b3ParallelJoint_GetSpringDampingRatio)
parallel_joint_get_spring_hertz
(b3ParallelJoint_GetSpringHertz)
parallel_joint_set_max_torque
(b3ParallelJoint_SetMaxTorque)
parallel_joint_set_spring_damping_ratio
(b3ParallelJoint_SetSpringDampingRatio)
parallel_joint_set_spring_hertz
(b3ParallelJoint_SetSpringHertz)
prepare_distance_joint
(b3PrepareDistanceJoint)
prepare_joint
Clamp constraint hertz and dispatch prepare. (b3PrepareJoint)
prepare_motor_joint
(b3PrepareMotorJoint)
prepare_parallel_joint
(b3PrepareParallelJoint)
prepare_prismatic_joint
(b3PreparePrismaticJoint)
prepare_revolute_joint
(b3PrepareRevoluteJoint)
prepare_spherical_joint
(b3PrepareSphericalJoint)
prepare_weld_joint
(b3PrepareWeldJoint)
prepare_wheel_joint
(b3PrepareWheelJoint)
prismatic_joint_enable_limit
(b3PrismaticJoint_EnableLimit)
prismatic_joint_enable_motor
(b3PrismaticJoint_EnableMotor)
prismatic_joint_enable_spring
(b3PrismaticJoint_EnableSpring)
prismatic_joint_get_lower_limit
(b3PrismaticJoint_GetLowerLimit)
prismatic_joint_get_max_motor_force
(b3PrismaticJoint_GetMaxMotorForce)
prismatic_joint_get_motor_force
(b3PrismaticJoint_GetMotorForce)
prismatic_joint_get_motor_speed
(b3PrismaticJoint_GetMotorSpeed)
prismatic_joint_get_speed
(b3PrismaticJoint_GetSpeed)
prismatic_joint_get_spring_damping_ratio
(b3PrismaticJoint_GetSpringDampingRatio)
prismatic_joint_get_spring_hertz
(b3PrismaticJoint_GetSpringHertz)
prismatic_joint_get_target_translation
(b3PrismaticJoint_GetTargetTranslation)
prismatic_joint_get_translation
(b3PrismaticJoint_GetTranslation)
prismatic_joint_get_upper_limit
(b3PrismaticJoint_GetUpperLimit)
prismatic_joint_is_limit_enabled
(b3PrismaticJoint_IsLimitEnabled)
prismatic_joint_is_motor_enabled
(b3PrismaticJoint_IsMotorEnabled)
prismatic_joint_is_spring_enabled
(b3PrismaticJoint_IsSpringEnabled)
prismatic_joint_set_limits
(b3PrismaticJoint_SetLimits)
prismatic_joint_set_max_motor_force
(b3PrismaticJoint_SetMaxMotorForce)
prismatic_joint_set_motor_speed
(b3PrismaticJoint_SetMotorSpeed)
prismatic_joint_set_spring_damping_ratio
(b3PrismaticJoint_SetSpringDampingRatio)
prismatic_joint_set_spring_hertz
(b3PrismaticJoint_SetSpringHertz)
prismatic_joint_set_target_translation
(b3PrismaticJoint_SetTargetTranslation)
revolute_joint_enable_limit
(b3RevoluteJoint_EnableLimit)
revolute_joint_enable_motor
(b3RevoluteJoint_EnableMotor)
revolute_joint_enable_spring
(b3RevoluteJoint_EnableSpring)
revolute_joint_get_angle
(b3RevoluteJoint_GetAngle)
revolute_joint_get_lower_limit
(b3RevoluteJoint_GetLowerLimit)
revolute_joint_get_max_motor_torque
(b3RevoluteJoint_GetMaxMotorTorque)
revolute_joint_get_motor_speed
(b3RevoluteJoint_GetMotorSpeed)
revolute_joint_get_motor_torque
(b3RevoluteJoint_GetMotorTorque)
revolute_joint_get_spring_damping_ratio
(b3RevoluteJoint_GetSpringDampingRatio)
revolute_joint_get_spring_hertz
(b3RevoluteJoint_GetSpringHertz)
revolute_joint_get_target_angle
(b3RevoluteJoint_GetTargetAngle)
revolute_joint_get_upper_limit
(b3RevoluteJoint_GetUpperLimit)
revolute_joint_is_limit_enabled
(b3RevoluteJoint_IsLimitEnabled)
revolute_joint_is_motor_enabled
(b3RevoluteJoint_IsMotorEnabled)
revolute_joint_is_spring_enabled
(b3RevoluteJoint_IsSpringEnabled)
revolute_joint_set_limits
(b3RevoluteJoint_SetLimits)
revolute_joint_set_max_motor_torque
(b3RevoluteJoint_SetMaxMotorTorque)
revolute_joint_set_motor_speed
(b3RevoluteJoint_SetMotorSpeed)
revolute_joint_set_spring_damping_ratio
(b3RevoluteJoint_SetSpringDampingRatio)
revolute_joint_set_spring_hertz
(b3RevoluteJoint_SetSpringHertz)
revolute_joint_set_target_angle
(b3RevoluteJoint_SetTargetAngle)
solve_distance_joint
(b3SolveDistanceJoint)
solve_joint
(b3SolveJoint)
solve_motor_joint
(b3SolveMotorJoint)
solve_parallel_joint
(b3SolveParallelJoint)
solve_prismatic_joint
(b3SolvePrismaticJoint ΓÇö the C source has no type assert on this function, unlike prepare/warm-start)
solve_revolute_joint
(b3SolveRevoluteJoint ΓÇö the C source has no type assert on this function, unlike prepare/warm-start)
solve_spherical_joint
(b3SolveSphericalJoint)
solve_weld_joint
(b3SolveWeldJoint)
solve_wheel_joint
(b3SolveWheelJoint)
spherical_joint_enable_cone_limit
(b3SphericalJoint_EnableConeLimit)
spherical_joint_enable_motor
(b3SphericalJoint_EnableMotor)
spherical_joint_enable_spring
(b3SphericalJoint_EnableSpring)
spherical_joint_enable_twist_limit
(b3SphericalJoint_EnableTwistLimit)
spherical_joint_get_cone_angle
(b3SphericalJoint_GetConeAngle)
spherical_joint_get_cone_limit
(b3SphericalJoint_GetConeLimit)
spherical_joint_get_lower_twist_limit
(b3SphericalJoint_GetLowerTwistLimit)
spherical_joint_get_max_motor_torque
(b3SphericalJoint_GetMaxMotorTorque)
spherical_joint_get_motor_torque
(b3SphericalJoint_GetMotorTorque)
spherical_joint_get_motor_velocity
(b3SphericalJoint_GetMotorVelocity)
spherical_joint_get_spring_damping_ratio
(b3SphericalJoint_GetSpringDampingRatio)
spherical_joint_get_spring_hertz
(b3SphericalJoint_GetSpringHertz)
spherical_joint_get_target_rotation
(b3SphericalJoint_GetTargetRotation)
spherical_joint_get_twist_angle
(b3SphericalJoint_GetTwistAngle)
spherical_joint_get_upper_twist_limit
(b3SphericalJoint_GetUpperTwistLimit)
spherical_joint_is_cone_limit_enabled
(b3SphericalJoint_IsConeLimitEnabled)
spherical_joint_is_motor_enabled
(b3SphericalJoint_IsMotorEnabled)
spherical_joint_is_spring_enabled
(b3SphericalJoint_IsSpringEnabled)
spherical_joint_is_twist_limit_enabled
(b3SphericalJoint_IsTwistLimitEnabled)
spherical_joint_set_cone_limit
(b3SphericalJoint_SetConeLimit)
spherical_joint_set_max_motor_torque
(b3SphericalJoint_SetMaxMotorTorque)
spherical_joint_set_motor_velocity
(b3SphericalJoint_SetMotorVelocity)
spherical_joint_set_spring_damping_ratio
(b3SphericalJoint_SetSpringDampingRatio)
spherical_joint_set_spring_hertz
(b3SphericalJoint_SetSpringHertz)
spherical_joint_set_target_rotation
(b3SphericalJoint_SetTargetRotation)
spherical_joint_set_twist_limits
(b3SphericalJoint_SetTwistLimits)
warm_start_distance_joint
(b3WarmStartDistanceJoint)
warm_start_joint
(b3WarmStartJoint)
warm_start_motor_joint
(b3WarmStartMotorJoint)
warm_start_parallel_joint
(b3WarmStartParallelJoint)
warm_start_prismatic_joint
(b3WarmStartPrismaticJoint)
warm_start_revolute_joint
(b3WarmStartRevoluteJoint)
warm_start_spherical_joint
(b3WarmStartSphericalJoint)
warm_start_weld_joint
(b3WarmStartWeldJoint)
warm_start_wheel_joint
(b3WarmStartWheelJoint)
weld_joint_get_angular_damping_ratio
(b3WeldJoint_GetAngularDampingRatio)
weld_joint_get_angular_hertz
(b3WeldJoint_GetAngularHertz)
weld_joint_get_linear_damping_ratio
(b3WeldJoint_GetLinearDampingRatio)
weld_joint_get_linear_hertz
(b3WeldJoint_GetLinearHertz)
weld_joint_set_angular_damping_ratio
(b3WeldJoint_SetAngularDampingRatio)
weld_joint_set_angular_hertz
(b3WeldJoint_SetAngularHertz)
weld_joint_set_linear_damping_ratio
(b3WeldJoint_SetLinearDampingRatio)
weld_joint_set_linear_hertz
(b3WeldJoint_SetLinearHertz)
wheel_joint_enable_spin_motor
(b3WheelJoint_EnableSpinMotor)
wheel_joint_enable_steering
(b3WheelJoint_EnableSteering)
wheel_joint_enable_steering_limit
(b3WheelJoint_EnableSteeringLimit)
wheel_joint_enable_suspension
(b3WheelJoint_EnableSuspension)
wheel_joint_enable_suspension_limit
(b3WheelJoint_EnableSuspensionLimit)
wheel_joint_get_lower_steering_limit
(b3WheelJoint_GetLowerSteeringLimit)
wheel_joint_get_lower_suspension_limit
(b3WheelJoint_GetLowerSuspensionLimit)
wheel_joint_get_max_spin_torque
(b3WheelJoint_GetMaxSpinTorque)
wheel_joint_get_max_steering_torque
(b3WheelJoint_GetMaxSteeringTorque)
wheel_joint_get_spin_motor_speed
(b3WheelJoint_GetSpinMotorSpeed)
wheel_joint_get_spin_speed
(b3WheelJoint_GetSpinSpeed)
wheel_joint_get_spin_torque
(b3WheelJoint_GetSpinTorque)
wheel_joint_get_steering_angle
(b3WheelJoint_GetSteeringAngle)
wheel_joint_get_steering_damping_ratio
(b3WheelJoint_GetSteeringDampingRatio)
wheel_joint_get_steering_hertz
(b3WheelJoint_GetSteeringHertz)
wheel_joint_get_steering_torque
(b3WheelJoint_GetSteeringTorque)
wheel_joint_get_suspension_damping_ratio
(b3WheelJoint_GetSuspensionDampingRatio)
wheel_joint_get_suspension_hertz
(b3WheelJoint_GetSuspensionHertz)
wheel_joint_get_target_steering_angle
(b3WheelJoint_GetTargetSteeringAngle)
wheel_joint_get_upper_steering_limit
(b3WheelJoint_GetUpperSteeringLimit)
wheel_joint_get_upper_suspension_limit
(b3WheelJoint_GetUpperSuspensionLimit)
wheel_joint_is_spin_motor_enabled
(b3WheelJoint_IsSpinMotorEnabled)
wheel_joint_is_steering_enabled
(b3WheelJoint_IsSteeringEnabled)
wheel_joint_is_steering_limit_enabled
(b3WheelJoint_IsSteeringLimitEnabled)
wheel_joint_is_suspension_enabled
(b3WheelJoint_IsSuspensionEnabled)
wheel_joint_is_suspension_limit_enabled
(b3WheelJoint_IsSuspensionLimitEnabled)
wheel_joint_set_max_spin_torque
(b3WheelJoint_SetMaxSpinTorque)
wheel_joint_set_max_steering_torque
(b3WheelJoint_SetMaxSteeringTorque)
wheel_joint_set_spin_motor_speed
(b3WheelJoint_SetSpinMotorSpeed)
wheel_joint_set_steering_damping_ratio
(b3WheelJoint_SetSteeringDampingRatio)
wheel_joint_set_steering_hertz
(b3WheelJoint_SetSteeringHertz)
wheel_joint_set_steering_limits
(b3WheelJoint_SetSteeringLimits)
wheel_joint_set_suspension_damping_ratio
(b3WheelJoint_SetSuspensionDampingRatio)
wheel_joint_set_suspension_hertz
(b3WheelJoint_SetSuspensionHertz)
wheel_joint_set_suspension_limits
(b3WheelJoint_SetSuspensionLimits)
wheel_joint_set_target_steering_angle
(b3WheelJoint_SetTargetSteeringAngle)