box2d-rs
A native port of Box2D to Rust.
Minimum Rust version: 1.51.0
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
- No unsafe code
TODO
- convert comments from doxygen to rustdoc
- fix some comments
Known differences
- dump() function replaced by serde library (optional dependency)
- comments converted from doxygen to rustdoc
- two additional buttons in the testbed's UI for serialize/deserialize (available only with
serde_support
feature). Serialized data available inserialize_test
directory - query/raycast callback class replaced by closure
Usage
Add this to your Cargo.toml
:
[]
= "0.0.3"
If you want serialize/deserialize world with serde:
[]
= { = "0.0.3", = ["serde_support"] }
Compiling and running the testbed from source
Build and run testbed in debug mode:
# At the reposity root
In debug mode with serde_support
:
Release version with serde_support
:
Run tests
Crate features
Optionally, the following dependencies can be enabled:
serde_support
enables serialize/deserialize of world via theserde
crate
Documentation
- You can look at the testbed for examples.
- Rust generated docs
- Manual
- Discord