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 debug_draw;
18pub mod distance;
19pub mod distance_joint;
20pub mod dynamic_tree;
21pub mod events;
22pub mod geometry;
23pub mod hull;
24pub mod id;
25pub mod id_pool;
26pub mod island;
27pub mod joint;
28pub mod manifold;
29pub mod math_functions;
30pub mod motor_joint;
31pub mod mover;
32pub mod prismatic_joint;
33pub mod recording;
34pub mod revolute_joint;
35pub mod sensor;
36pub mod shape;
37pub mod solver;
38pub mod solver_set;
39pub mod table;
40pub mod timer;
41pub mod types;
42pub mod weld_joint;
43pub mod wheel_joint;
44pub mod world;
45
46#[cfg(test)]
47mod aabb_tests;
48#[cfg(test)]
49mod bitset_tests;
50#[cfg(test)]
51mod body_api_tests;
52#[cfg(test)]
53mod contact_api_tests;
54#[cfg(test)]
55mod debug_draw_tests;
56#[cfg(test)]
57mod determinism_tests;
58#[cfg(test)]
59mod distance_tests;
60#[cfg(test)]
61mod dynamic_tree_tests;
62#[cfg(test)]
63mod geometry_tests;
64#[cfg(test)]
65mod hull_tests;
66#[cfg(test)]
67mod id_tests;
68#[cfg(test)]
69mod large_world_tests;
70#[cfg(test)]
71mod manifold_tests;
72#[cfg(test)]
73mod math_functions_tests;
74#[cfg(test)]
75mod player_tests;
76#[cfg(test)]
77mod recording_tests;
78#[cfg(test)]
79mod shape_api_tests;
80#[cfg(test)]
81mod snapshot_tests;
82#[cfg(test)]
83mod table_tests;
84#[cfg(test)]
85mod types_tests;
86#[cfg(test)]
87mod world_api_tests;
88
89pub use collision::CastOutput;
90pub use core::{get_version, is_double_precision, Version};
91pub use id::{BodyId, ChainId, ContactId, JointId, ShapeId, WorldId};
92pub use math_functions::{Aabb, CosSin, Mat22, Plane, Pos, Rot, Transform, Vec2, WorldTransform};
93
94/// Library version, kept in sync with Cargo.toml.
95pub const VERSION: &str = env!("CARGO_PKG_VERSION");