Skip to main content

Module types

Module types 

Source
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)
DistanceJointDef
Distance joint definition. Connects a point on body A with a point on body B by a segment. Useful for ropes and springs. (b3DistanceJointDef)
ExplosionDef
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)
FilterJointDef
Disables collision between two specific bodies. (b3FilterJointDef)
JointDef
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:
MotionLocks
Motion locks to restrict the body movement. (b3MotionLocks)
MotorJointDef
A motor joint controls relative position and velocity. (b3MotorJointDef)
ParallelJointDef
Parallel joint: spring between body A z-axis and body B z-axis. (b3ParallelJointDef)
PrismaticJointDef
Prismatic joint: body B slides along frame A x-axis. (b3PrismaticJointDef)
QueryFilter
The query filter is used to filter collisions between queries and shapes. (b3QueryFilter)
RayResult
Result from b3World_CastRayClosest. (b3RayResult)
RevoluteJointDef
Revolute joint: point constraint with relative rotation about z. (b3RevoluteJointDef)
ShapeDef
Used to create a shape. (b3ShapeDef)
SphericalJointDef
Spherical joint: point constraint allowing free rotation. (b3SphericalJointDef)
WeldJointDef
Weld joint: rigid connection with optional soft springs. (b3WeldJointDef)
WheelJointDef
Wheel joint: chassis A + wheel B with suspension and steering. (b3WheelJointDef)
WorldCastOutput
World-space cast output from a single-shape ray cast. (b3WorldCastOutput)
WorldDef
World definition used to create a simulation world. Must be initialized using default_world_def. (b3WorldDef)

Enums§

BodyType
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§

FrictionCallback
Optional friction mixing callback. (b3FrictionCallback)
RestitutionCallback
Optional restitution mixing callback. (b3RestitutionCallback)