Home

Awesome

Box2D Logo

Build Status

Build Status

Box2D

Box2D is a 2D physics engine for games.

Contributing

Please do not submit pull requests with new features or core library changes. Instead, please file an issue first for discussion. For bugs, I prefer detailed bug reports over pull requests.

Features

Collision

Physics

System

Testbed

Building

Building Box2D - Using vcpkg

You can download and install Box2D using the vcpkg dependency manager:

The Box2D port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Note: vcpkg support is not provided by the Box2D project

Building for Xcode

Installing using CMake

You can use the CMake install feature to deploy the library to a central location that can be accessed using:

find_package(box2d REQUIRED)
target_link_libraries(mytarget PRIVATE box2d)

You can build and install the library and docs using this command sequence (requires Doxygen):

mkdir build
cd build
cmake -DBOX2D_BUILD_DOCS=ON ..
cmake --build .
cmake --build . --target INSTALL

On Windows this tries to install in Program Files and thus requires admin privileges. Alternatively you can target another directory using something like this:

mkdir build
cd build
cmake -DBOX2D_BUILD_DOCS=ON -DCMAKE_INSTALL_PREFIX="C:/packages" ..
cmake --build .
cmake --build . --target INSTALL

Documentation

License

Box2D is developed by Erin Catto, and uses the MIT license.

Sponsorship

Support development of Box2D through Github Sponsors