Skip to main content

Module types

Module types 

Source

Re-exports§

pub use crate::dynamic_tree::DEFAULT_CATEGORY_BITS;
pub use crate::dynamic_tree::DEFAULT_MASK_BITS;

Structs§

BodyDef
A body definition holds all the data needed to construct a rigid body. Must be initialized using default_body_def. (b2BodyDef)
Capacity
Optional world capacities that can be used to avoid run-time allocations. (b2Capacity)
ChainDef
Used to create a chain of line segments. Must be initialized using default_chain_def. (b2ChainDef)
DistanceJointDef
Distance joint definition. Connects a point on body A with a point on body B by a segment. Useful for ropes and springs. (b2DistanceJointDef)
Filter
Collision filtering data for shapes. (b2Filter)
FilterJointDef
A filter joint is used to disable collision between two specific bodies. (b2FilterJointDef)
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. (b2MotionLocks)
MotorJointDef
A motor joint is used to control the relative velocity and or transform between two bodies. With a velocity of zero this acts like top-down friction. (b2MotorJointDef)
PrismaticJointDef
Prismatic joint definition. Body B may slide along the x-axis in local frame A. Body B cannot rotate relative to body A. The joint translation is zero when the local frame origins coincide in world space. (b2PrismaticJointDef)
QueryFilter
The query filter is used to filter collisions between queries and shapes. (b2QueryFilter)
RayResult
Result from b2World_RayCastClosest. (b2RayResult)
RevoluteJointDef
Revolute joint definition. A point on body B is fixed to a point on body A. Allows relative rotation. (b2RevoluteJointDef)
ShapeDef
Used to create a shape. Must be initialized using default_shape_def. (b2ShapeDef)
SurfaceMaterial
Surface materials allow chain shapes to have per segment surface properties. (b2SurfaceMaterial)
WeldJointDef
Weld joint definition. Connects two bodies together rigidly. This constraint provides springs to mimic soft-body simulation. Note: The approximate solver in Box2D cannot hold many bodies together rigidly. (b2WeldJointDef)
WheelJointDef
Wheel joint definition. Body B is a wheel that may rotate freely and slide along the local x-axis in frame A. The joint translation is zero when the local frame origins coincide in world space. (b2WheelJointDef)
WorldDef
World definition used to create a simulation world. Must be initialized using default_world_def. (b2WorldDef)

Enums§

BodyType
The body simulation type. Each body is one of these three types. (b2BodyType)

Constants§

BODY_TYPE_COUNT
Number of body types. (b2_bodyTypeCount)

Functions§

default_body_def
Initialize a body definition with the default values. (b2DefaultBodyDef)
default_chain_def
Initialize a chain definition with the default values. (b2DefaultChainDef)
default_distance_joint_def
(b2DefaultDistanceJointDef)
default_filter
Initialize a filter with the default values. (b2DefaultFilter)
default_filter_joint_def
(b2DefaultFilterJointDef)
default_motor_joint_def
(b2DefaultMotorJointDef)
default_prismatic_joint_def
(b2DefaultPrismaticJointDef)
default_query_filter
Initialize a query filter with the default values. (b2DefaultQueryFilter)
default_revolute_joint_def
(b2DefaultRevoluteJointDef)
default_shape_def
Initialize a shape definition with the default values. (b2DefaultShapeDef)
default_surface_material
Initialize a surface material with the default values. (b2DefaultSurfaceMaterial)
default_weld_joint_def
(b2DefaultWeldJointDef)
default_wheel_joint_def
(b2DefaultWheelJointDef)
default_world_def
Initialize a world definition with the default values. (b2DefaultWorldDef)

Type Aliases§

FrictionCallback
Optional friction mixing callback. The default uses sqrt(frictionA * frictionB). (b2FrictionCallback)
RestitutionCallback
Optional restitution mixing callback. The default uses max(restitutionA, restitutionB). (b2RestitutionCallback)