Expand description
Public definition types and C-compatible defaults.
Every create API expects a def built from the matching default_*_def
helper — for example default_world_def, default_body_def,
default_shape_def, and the joint defaults. These mirror
b3Default*Def in the C API (including the internal cookie).
Port of include/box3d/types.h and src/types.c. Split by domain with flat
re-exports for callers.
SPDX-FileCopyrightText: 2025 Erin Catto SPDX-License-Identifier: MIT
Structs§
- BodyDef
- A body definition holds all the data needed to construct a rigid body.
Must be initialized using
default_body_def. (b3BodyDef) - Capacity
- Optional world capacities that can be used to avoid run-time allocations. (b3Capacity)
- Counters
- Counters that give details of the simulation size. (b3Counters)
- Distance
Joint Def - Distance joint definition. Connects a point on body A with a point on body B by a segment. Useful for ropes and springs. (b3DistanceJointDef)
- Explosion
Def - The explosion definition is used to configure options for explosions. Explosions consider shape geometry when computing the impulse. (b3ExplosionDef)
- Filter
- This is used to filter collisions. (b3Filter)
- Filter
Joint Def - Disables collision between two specific bodies. (b3FilterJointDef)
- Joint
Def - Base joint definition used by all joint types. The local frames are measured from the body’s origin rather than the center of mass because:
- Motion
Locks - Motion locks to restrict the body movement. (b3MotionLocks)
- Motor
Joint Def - A motor joint controls relative position and velocity. (b3MotorJointDef)
- Parallel
Joint Def - Parallel joint: spring between body A z-axis and body B z-axis. (b3ParallelJointDef)
- Prismatic
Joint Def - Prismatic joint: body B slides along frame A x-axis. (b3PrismaticJointDef)
- Query
Filter - The query filter is used to filter collisions between queries and shapes. (b3QueryFilter)
- RayResult
- Result from b3World_CastRayClosest. (b3RayResult)
- Revolute
Joint Def - Revolute joint: point constraint with relative rotation about z. (b3RevoluteJointDef)
- Shape
Def - Used to create a shape. (b3ShapeDef)
- Spherical
Joint Def - Spherical joint: point constraint allowing free rotation. (b3SphericalJointDef)
- Weld
Joint Def - Weld joint: rigid connection with optional soft springs. (b3WeldJointDef)
- Wheel
Joint Def - Wheel joint: chassis A + wheel B with suspension and steering. (b3WheelJointDef)
- World
Cast Output - World-space cast output from a single-shape ray cast. (b3WorldCastOutput)
- World
Def - World definition used to create a simulation world.
Must be initialized using
default_world_def. (b3WorldDef)
Enums§
- Body
Type - The body simulation type. Each body is one of these three types. (b3BodyType)
Constants§
- BODY_
TYPE_ COUNT - Number of body types. (b3_bodyTypeCount)
Functions§
- default_
body_ def - Initialize a body definition with the default values. (b3DefaultBodyDef)
- default_
distance_ joint_ def - (b3DefaultDistanceJointDef)
- default_
explosion_ def - Use this to initialize your explosion definition. (b3DefaultExplosionDef)
- default_
filter - Use this to initialize your filter. (b3DefaultFilter)
- default_
filter_ joint_ def - (b3DefaultFilterJointDef)
- default_
motor_ joint_ def - (b3DefaultMotorJointDef)
- default_
parallel_ joint_ def - (b3DefaultParallelJointDef)
- default_
prismatic_ joint_ def - (b3DefaultPrismaticJointDef)
- default_
query_ filter - Use this to initialize your query filter. (b3DefaultQueryFilter)
- default_
revolute_ joint_ def - (b3DefaultRevoluteJointDef)
- default_
shape_ def - Use this to initialize your shape definition. (b3DefaultShapeDef)
- default_
spherical_ joint_ def - (b3DefaultSphericalJointDef)
- default_
weld_ joint_ def - (b3DefaultWeldJointDef)
- default_
wheel_ joint_ def - (b3DefaultWheelJointDef)
- default_
world_ def - Use this to initialize your world definition. (b3DefaultWorldDef)
Type Aliases§
- Friction
Callback - Optional friction mixing callback. (b3FrictionCallback)
- Restitution
Callback - Optional restitution mixing callback. (b3RestitutionCallback)