Skip to main content

Module joints

Module joints 

Source
Expand description

Joint builders and creation helpers (modularized).

Two creation styles are available:

  • Scoped handles: World::create_*_joint(&def) -> Joint returning a scoped handle for immediate configuration/queries. Dropping the handle does not destroy the joint.
  • Owned handles: World::create_*_joint_owned(&def) -> OwnedJoint or World::*().build_owned() -> OwnedJoint returning a RAII handle that destroys the joint on drop.
  • ID style: World::create_*_joint_id(&def) -> b2JointId returning the raw id for storage.

The World convenience builders (revolute, prismatic, wheel, distance, weld, motor_joint, filter_joint) help compose joints in world space and build local frames from world anchors/axes.

Structs§

ConstraintTuning
Shared constraint tuning (Hertz + damping ratio) used by Box2D joints.
DistanceJointBuilder
Fluent builder for distance joints working in world space.
DistanceJointDef
Distance joint definition (maps to b2DistanceJointDef).
FilterJointBuilder
Builder for a filter joint that disables collision between two bodies while keeping them in the same island. Fluent builder for filter joints.
FilterJointDef
Filter joint definition (maps to b2FilterJointDef). A lightweight joint used primarily for contact filtering scenarios.
Joint
A scoped joint handle tied to a mutable borrow of the world.
JointBase
Base joint definition builder for common properties.
JointBaseBuilder
MotorJointBuilder
Fluent builder for motor joints.
MotorJointDef
Motor joint definition (maps to b2MotorJointDef). Drives relative motion between two bodies using linear and angular offsets with configurable maximum forces.
OwnedJoint
A RAII-owned joint that is destroyed on drop.
PrismaticJointBuilder
Builder for a prismatic joint in world space. Fluent builder for prismatic joints using world anchors and axis.
PrismaticJointDef
Prismatic (slider) joint definition (maps to b2PrismaticJointDef).
RevoluteJointBuilder
Builder for a revolute (hinge) joint in world space. Fluent builder for revolute joints using a world anchor.
RevoluteJointDef
Revolute (hinge) joint definition (maps to b2RevoluteJointDef).
WeldJointBuilder
Fluent builder for weld joints using a world anchor.
WeldJointDef
Weld joint definition (maps to b2WeldJointDef). Rigidly attaches two bodies at an anchor with optional soft-constraint tuning.
WheelJointBuilder
Fluent builder for wheel joints using world anchors and axis.
WheelJointDef
Wheel (suspension) joint definition (maps to b2WheelJointDef).

Enums§

JointType
Joint kinds reported by Box2D.