Skip to main content

box2d_rust/
lib.rs

1//! Pure Rust port of [Box2D v3](https://github.com/erincatto/box2d), Erin Catto's 2D physics
2//! engine. The port matches the C implementation's behavior exactly, including its
3//! cross-platform deterministic math.
4//!
5//! Ported module by module from the pinned C reference in `box2d-cpp-reference/`.
6
7pub mod aabb;
8pub mod bitset;
9pub mod body;
10pub mod broad_phase;
11pub mod collision;
12pub mod constants;
13pub mod constraint_graph;
14pub mod contact;
15pub mod contact_solver;
16pub mod core;
17pub mod distance;
18pub mod distance_joint;
19pub mod dynamic_tree;
20pub mod events;
21pub mod geometry;
22pub mod hull;
23pub mod id;
24pub mod id_pool;
25pub mod island;
26pub mod joint;
27pub mod manifold;
28pub mod math_functions;
29pub mod motor_joint;
30pub mod prismatic_joint;
31pub mod revolute_joint;
32pub mod sensor;
33pub mod shape;
34pub mod solver;
35pub mod solver_set;
36pub mod table;
37pub mod types;
38pub mod weld_joint;
39pub mod wheel_joint;
40pub mod world;
41
42#[cfg(test)]
43mod aabb_tests;
44#[cfg(test)]
45mod bitset_tests;
46#[cfg(test)]
47mod distance_tests;
48#[cfg(test)]
49mod dynamic_tree_tests;
50#[cfg(test)]
51mod geometry_tests;
52#[cfg(test)]
53mod hull_tests;
54#[cfg(test)]
55mod id_tests;
56#[cfg(test)]
57mod manifold_tests;
58#[cfg(test)]
59mod math_functions_tests;
60#[cfg(test)]
61mod table_tests;
62#[cfg(test)]
63mod types_tests;
64
65pub use collision::CastOutput;
66pub use core::{get_version, is_double_precision, Version};
67pub use id::{BodyId, ChainId, ContactId, JointId, ShapeId, WorldId};
68pub use math_functions::{Aabb, CosSin, Mat22, Plane, Pos, Rot, Transform, Vec2, WorldTransform};
69
70/// Library version, kept in sync with Cargo.toml.
71pub const VERSION: &str = env!("CARGO_PKG_VERSION");