Skip to main content

box3d_rust/mesh/
mod.rs

1//! Triangle mesh collision shape.
2//!
3//! Port of `box3d-cpp-reference/src/mesh.c` and the mesh group of
4//! `include/box3d/types.h` / `collision.h`.
5//!
6//! Layout:
7//! - `types`   — MeshDef/Data/Node/Triangle, edge flags, blob serialization
8//! - `bvh`     — vertex welding, SAH/median BVH build, DFS triangle sort
9//! - `create`  — create/destroy, edge identification, validation
10//! - `factory` — grid/wave/torus/box/hollow/platform helpers
11//! - `cast`    — AABB, ray cast, shape cast
12//! - `query`   — overlap, query, mover collide, triangle accessor
13//!
14//! Deferred: world shape attach.
15//!
16//! SPDX-FileCopyrightText: 2026 Erin Catto
17//! SPDX-License-Identifier: MIT
18
19mod bvh;
20mod cast;
21mod create;
22mod factory;
23mod query;
24mod types;
25
26pub use cast::{compute_mesh_aabb, ray_cast_mesh, shape_cast_mesh};
27pub use create::{create_mesh, destroy_mesh, get_height, is_valid_mesh};
28pub use factory::{
29    create_box_mesh, create_grid_mesh, create_hollow_box_mesh, create_platform_mesh,
30    create_torus_mesh, create_wave_mesh,
31};
32pub use query::{collide_mover_and_mesh, get_mesh_triangle, overlap_mesh, query_mesh};
33pub use types::{
34    convert_bytes_to_mesh, get_mesh_flags, get_mesh_material_indices, get_mesh_nodes,
35    get_mesh_triangles, get_mesh_vertices, Mesh, MeshData, MeshDef, MeshNode, MeshTriangle,
36    ALL_CONCAVE_EDGES, ALL_FLAT_EDGES, CONCAVE_EDGE1, CONCAVE_EDGE2, CONCAVE_EDGE3, FLAT_EDGE1,
37    FLAT_EDGE2, FLAT_EDGE3, INVERSE_CONCAVE_EDGE1, INVERSE_CONCAVE_EDGE2, INVERSE_CONCAVE_EDGE3,
38    LEAF_NODE, MESH_DATA_SIZE, MESH_NODE_SIZE, MESH_STACK_SIZE, MESH_TRIANGLE_SIZE, MESH_VERSION,
39};