10 releases

Uses old Rust 2015

0.4.2 Feb 17, 2024
0.4.1 May 15, 2020
0.4.0 Jun 3, 2018
0.3.4 Jun 4, 2017
0.3.2 Jul 21, 2016

#28 in Simulation

Download history 1/week @ 2024-01-15 107/week @ 2024-02-12 47/week @ 2024-02-19 54/week @ 2024-02-26 10/week @ 2024-03-04 21/week @ 2024-03-11 1/week @ 2024-03-18 50/week @ 2024-04-01

73 downloads per month
Used in 2 crates


18K SLoC

C++ 11K SLoC // 0.1% comments Rust 6K SLoC // 0.0% comments Lua 54 SLoC // 0.0% comments

rust_box2d Build Status Crates.io License

A library wrapping around the Box2D physics engine. It aims to provide an idiomatic interface.

Box2D is a 2D rigid body simulation library for games. Programmers can use it in their games to make objects move in realistic ways and make the game world more interactive. From the game engine's point of view, a physics engine is just a system for procedural animation.

You won't find a lot of information about Box2D itself here, look at the official website instead.


You can look at the testbed for examples.


You will need CMake installed in order to build Box2D.

Alternatively, you can supply your own installation of Box2D (version 2.3.1) by pointing the BOX2D_LIB_DIR environment variable to the directory containing the compiled Box2D library. For example:

BOX2D_LIB_DIR="path\to\Box2D\lib" cargo build


~26K SLoC