|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 03-May-2022 | - |
| .github/ | H | 18-Oct-2020 | - | 24 | 17 |
| docs/ | H | 03-May-2022 | - | 6,217 | 4,868 |
| extern/ | H | 18-Oct-2020 | - | 74,721 | 52,693 |
| include/box2d/ | H | 18-Oct-2020 | - | 7,356 | 3,784 |
| src/ | H | 03-May-2022 | - | 15,253 | 10,528 |
| testbed/ | H | 03-May-2022 | - | 13,087 | 8,975 |
| unit-test/ | H | 03-May-2022 | - | 6,388 | 4,797 |
| .gitignore | H A D | 18-Oct-2020 | 68 | 8 | 7 |
| .travis.yml | H A D | 18-Oct-2020 | 388 | 33 | 26 |
| CHANGELOG.md | H A D | 18-Oct-2020 | 2.2 KiB | 61 | 51 |
| LICENSE | H A D | 18-Oct-2020 | 1 KiB | 21 | 17 |
| README.md | H A D | 18-Oct-2020 | 3.7 KiB | 116 | 95 |
| build.bat | H A D | 18-Oct-2020 | 137 | 8 | 7 |
| build.sh | H A D | 18-Oct-2020 | 161 | 9 | 5 |
| build_docs.sh | H A D | 18-Oct-2020 | 142 | 9 | 5 |
| deploy_docs.sh | H A D | 18-Oct-2020 | 106 | 5 | 1 |
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