#box2d #physics #physics-engine #game-engine #liquidfun

sys libliquidfun-sys

A thin Rust ffi wrapper on top of Box2D and LiquidFun. Built using autocxx.

4 releases (breaking)

0.4.0 Aug 14, 2024
0.3.0 Jan 12, 2024
0.2.0 Oct 28, 2023
0.1.0 Oct 27, 2023

#1699 in Game dev

36 downloads per month
Used in bevy_liquidfun

MIT/Apache

3MB
63K SLoC

C++ 42K SLoC // 0.1% comments C 17K SLoC // 0.1% comments Objective-C 2.5K SLoC // 0.1% comments Rust 636 SLoC GNU Style Assembly 387 SLoC Shell 12 SLoC // 0.4% comments Batch 7 SLoC

🚨WARNING: WORK IN PROGRESS🚨

This crate is a work in progress and version changes may introduce breaking changes without warning.

libliquidfun-sys

A thin Rust ffi wrapper on top of Box2D (version 2.4.1) and LiquidFun. Built using autocxx.

This crate is used by bevy_liquidfun to integrate Box2D and LiquidFun with the bevy game engine.

Remarks

  • A forked version of Box2D included as git subtree under ./box2d/
  • Additions to the automatically generated wrappers are under ./include/extras.hpp
  • The autocxx generated wrappers for all the joint definitions have some misalignment, possibly caused by the inheritance hierarchy. This is worked around by having factory methods for joint creation with all the parameters.

Acknowledgements

This small wrapper stands on the shoulders of giants. Big thanks go to the original libraries, which do the heavy lifting:

Box2D by Erin Catto

LiquidFun by Google

autocxx by Google

Additionally, the version of Box2D used is a fork of Box2D:

LiquidFun rebase onto newer Box2D by Birch-san

License

This work is licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~3.5–8MB
~156K SLoC