A native port of Box2D to Rust.
Minimum Rust version: 1.47.0
Ported Box2D version: 2.4.1
When porting, I pursued the following goals - Keep file system structure as is for simpler further updates - Keep all identifiers names(except case convertion) and code order(except some specific cases) - Store all new not original code in separate files
serde_support
feature). Serialized data available in serialize_test
directoryAdd this to your Cargo.toml
:
toml
[dependencies]
box2d-rs = "0.0.2"
If you want serialize/deserialize world with serde:
toml
[dependencies]
box2d-rs = { version = "0.0.2", features = ["serde_support"] }
Build and run testbed in debug mode:
```bash
cargo build --examples --tests cargo run --example testbed ```
In debug mode with serde_support
:
bash
cargo build --examples --tests --features serde_support
cargo run --example testbed --features serde_support
Release version with serde_support
:
bash
cargo build --examples --tests --release --features serde_support
cargo run --example testbed --release --features serde_support
Run tests
bash
cargo test --features serde_support
Optionally, the following dependencies can be enabled:
serde_support
enables serialize/deserialize of world via the serde
crate