Skip to main content

box3d_rust/compound/
mod.rs

1//! Baked compound collision shape.
2//!
3//! Port of `box3d-cpp-reference/src/compound.c` and the compound group of
4//! `include/box3d/types.h` / `collision.h`.
5//!
6//! Layout:
7//! - `types`     — CompoundDef/Data, child accessors, SurfaceMaterial consumers
8//! - `create`    — create/destroy with material/hull/mesh sharing
9//! - `serialize` — convert to/from contiguous bytes
10//! - `cast`      — AABB, overlap, ray cast, shape cast
11//! - `query`     — AABB query, collide mover
12//!
13//! Deferred: world shape attach. Compound CCD TOI lives in `shape::toi`
14//! (matching the live path in C `shape.c`; compound.c's copy is `#if 0`).
15//!
16//! SPDX-FileCopyrightText: 2025 Erin Catto
17//! SPDX-License-Identifier: MIT
18
19mod cast;
20mod create;
21mod query;
22mod serialize;
23mod types;
24
25pub use cast::{
26    compute_compound_aabb, make_compound_child_sweep, overlap_compound, ray_cast_compound,
27    shape_cast_compound,
28};
29pub use create::{create_compound, destroy_compound};
30pub use query::{collide_mover_and_compound, query_compound};
31pub use serialize::{convert_bytes_to_compound, convert_compound_to_bytes};
32pub use types::{
33    get_compound_capsule, get_compound_child, get_compound_hull, get_compound_materials,
34    get_compound_mesh, get_compound_sphere, ChildGeometry, ChildShape, CompoundCapsule,
35    CompoundCapsuleDef, CompoundData, CompoundDef, CompoundHull, CompoundHullDef, CompoundMesh,
36    CompoundMeshDef, CompoundSphere, CompoundSphereDef, COMPOUND_VERSION,
37    MAX_COMPOUND_MESH_MATERIALS,
38};