Expand description
Baked compound collision shape.
Port of box3d-cpp-reference/src/compound.c and the compound group of
include/box3d/types.h / collision.h.
Layout:
types— CompoundDef/Data, child accessors, SurfaceMaterial consumerscreate— create/destroy with material/hull/mesh sharingserialize— convert to/from contiguous bytescast— AABB, overlap, ray cast, shape castquery— AABB query, collide mover
Deferred: world shape attach. Compound CCD TOI lives in shape::toi
(matching the live path in C shape.c; compound.c’s copy is #if 0).
SPDX-FileCopyrightText: 2025 Erin Catto SPDX-License-Identifier: MIT
Structs§
- Child
Shape - Child shape of a compound. (b3ChildShape)
- Compound
Capsule - A capsule that lives in a compound. (b3CompoundCapsule)
- Compound
Capsule Def - Definition for a capsule in a compound shape. (b3CompoundCapsuleDef)
- Compound
Data - The runtime data for a baked compound shape. (b3CompoundData)
- Compound
Def - Definition for creating a compound shape. (b3CompoundDef)
- Compound
Hull - A hull that lives in a compound. (b3CompoundHull)
- Compound
Hull Def - Definition for a convex hull in a compound shape. (b3CompoundHullDef)
- Compound
Mesh - A mesh with non-uniform scale that lives in a compound. (b3CompoundMesh)
- Compound
Mesh Def - Definition for a triangle mesh in a compound shape. (b3CompoundMeshDef)
- Compound
Sphere - A sphere that lives in a compound. (b3CompoundSphere)
- Compound
Sphere Def - Definition for a sphere in a compound shape. (b3CompoundSphereDef)
Enums§
- Child
Geometry - Child geometry of a compound. (union half of b3ChildShape)
Constants§
- COMPOUND_
VERSION - The compound version depends on the tree, mesh, and hull versions. (B3_COMPOUND_VERSION)
- MAX_
COMPOUND_ MESH_ MATERIALS - Meshes used in compounds have limited space for materials. (B3_MAX_COMPOUND_MESH_MATERIALS)
Functions§
- collide_
mover_ and_ compound - Collide a capsule mover against a compound. (b3CollideMoverAndCompound)
- compute_
compound_ aabb - Compute the AABB of a compound. (b3ComputeCompoundAABB)
- convert_
bytes_ to_ compound - Restore a compound from a byte buffer. (b3ConvertBytesToCompound)
- convert_
compound_ to_ bytes - Scrub and return the compound as a byte buffer. (b3ConvertCompoundToBytes)
- create_
compound - Create a baked compound shape. (b3CreateCompound)
- destroy_
compound - Destroy a compound shape. (b3DestroyCompound)
- get_
compound_ capsule - Capsule at index. (b3GetCompoundCapsule)
- get_
compound_ child - Child shape by flat index (capsules → hulls → meshes → spheres). (b3GetCompoundChild)
- get_
compound_ hull - Hull at index. (b3GetCompoundHull)
- get_
compound_ materials - Compound materials. (b3GetCompoundMaterials)
- get_
compound_ mesh - Mesh at index. (b3GetCompoundMesh)
- get_
compound_ sphere - Sphere at index. (b3GetCompoundSphere)
- make_
compound_ child_ sweep - Static compound-child sweep for TOI (child fixed in compound frame).
xf = compoundTransform * childTransform. (b3MakeCompoundChildSweep) - overlap_
compound - Test overlap between a compound and a shape proxy. (b3OverlapCompound)
- query_
compound - Query an AABB against compound children. (b3QueryCompound)
- ray_
cast_ compound - Ray cast versus a compound. (b3RayCastCompound)
- shape_
cast_ compound - Shape cast versus a compound. (b3ShapeCastCompound)