• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H18-Oct-2020-2417

docs/H03-May-2022-6,2174,868

extern/H18-Oct-2020-74,72152,693

include/box2d/H18-Oct-2020-7,3563,784

src/H03-May-2022-15,25310,528

testbed/H03-May-2022-13,0878,975

unit-test/H03-May-2022-6,3884,797

.gitignoreH A D18-Oct-202068 87

.travis.ymlH A D18-Oct-2020388 3326

CHANGELOG.mdH A D18-Oct-20202.2 KiB6151

LICENSEH A D18-Oct-20201 KiB2117

README.mdH A D18-Oct-20203.7 KiB11695

build.batH A D18-Oct-2020137 87

build.shH A D18-Oct-2020161 95

build_docs.shH A D18-Oct-2020142 95

deploy_docs.shH A D18-Oct-2020106 51

README.md

1![Box2D Logo](https://box2d.org/images/logo.svg)
2
3# Build Status
4[![Build Status](https://travis-ci.org/erincatto/box2d.svg?branch=master)](https://travis-ci.org/erincatto/box2d)
5
6# Box2D
7
8Box2D is a 2D physics engine for games.
9
10## Contributing
11
12Please 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.
13
14## Features
15
16### Collision
17- Continuous collision detection
18- Contact callbacks: begin, end, pre-solve, post-solve
19- Convex polygons and circles
20- Multiple shapes per body
21- One-shot contact manifolds
22- Dynamic tree broadphase
23- Efficient pair management
24- Fast broadphase AABB queries
25- Collision groups and categories
26
27### Physics
28- Continuous physics with time of impact solver
29- Persistent body-joint-contact graph
30- Island solution and sleep management
31- Contact, friction, and restitution
32- Stable stacking with a linear-time solver
33- Revolute, prismatic, distance, pulley, gear, mouse joint, and other joint types
34- Joint limits, motors, and friction
35- Momentum decoupled position correction
36- Fairly accurate reaction forces/impulses
37
38### System
39- Small block and stack allocators
40- Centralized tuning parameters
41- Highly portable C++ with no use of STL containers
42
43### Testbed
44- OpenGL with GLFW
45- Graphical user interface with imgui
46- Extensible test framework
47- Support for loading world dumps
48
49## Building
50- Install [CMake](https://cmake.org/)
51- Ensure CMake is in the user `PATH`
52- Visual Studio: run `build.bat` from the command prompt
53- Otherwise: run `build.sh` from a bash shell
54- Results are in the build sub-folder
55- On Windows you can open box2d.sln
56
57## Building Box2D - Using vcpkg
58You can download and install Box2D using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
59
60- git clone https://github.com/Microsoft/vcpkg.git
61- cd vcpkg
62- ./bootstrap-vcpkg.sh
63- ./vcpkg integrate install
64- ./vcpkg install box2d
65
66The 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](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
67
68Note: vcpkg support is not provided by the Box2D project
69
70## Building for Xcode
71- Install [CMake](https://cmake.org)
72- Add Cmake to the path in .zprofile (the default Terminal shell is zsh)
73    - export PATH="/Applications/CMake.app/Contents/bin:$PATH"
74- mkdir build
75- cd build
76- cmake -G Xcode ..
77- open box2d.xcodeproj
78- Select the testbed scheme
79- Edit the scheme to set a custom working directory, make this be in box2d/testbed
80- You can now build and run the testbed
81
82## Installing using CMake
83You can use the CMake install feature to deploy the library to a central location that can
84be accessed using:
85```
86find_package(box2d REQUIRED)
87target_link_libraries(mytarget PRIVATE box2d)
88```
89You can build and install the library and docs using this command sequence (requires Doxygen):
90```
91mkdir build
92cd build
93cmake -DBOX2D_BUILD_DOCS=ON ..
94cmake --build .
95cmake --build . --target INSTALL
96```
97On Windows this tries to install in `Program Files` and thus requires admin privileges. Alternatively you can target another directory using something like this:
98```
99mkdir build
100cd build
101cmake -DBOX2D_BUILD_DOCS=ON -DCMAKE_INSTALL_PREFIX="C:/packages" ..
102cmake --build .
103cmake --build . --target INSTALL
104```
105
106## Documentation
107- [Manual](https://box2d.org/documentation/)
108- [reddit](https://www.reddit.com/r/box2d/)
109- [Discord](https://discord.gg/NKYgCBP)
110
111## License
112Box2D is developed by Erin Catto, and uses the [MIT license](https://en.wikipedia.org/wiki/MIT_License).
113
114## Sponsorship
115Support development of Box2D through [Github Sponsors](https://github.com/sponsors/erincatto)
116