All Projects → mtsamis → box2d-optimized

mtsamis / box2d-optimized

Licence: MIT License
A very fast and scalable physics engine, based on Box2D.

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to box2d-optimized

Torque
2d 纯计算高性能刚体物理引擎
Stars: ✭ 62 (+24%)
Mutual labels:  physics-engine, physics-2d
glazejs
A high performance 2D game engine built in Typescript
Stars: ✭ 96 (+92%)
Mutual labels:  physics-engine, physics-2d
prismarine-physics
Provide the physics engine for minecraft entities
Stars: ✭ 24 (-52%)
Mutual labels:  physics-engine
Box2DSwift
Box2DSwift is a Swift port of Box2D Physics Engine.
Stars: ✭ 38 (-24%)
Mutual labels:  physics-engine
Playground
A playground for android developers
Stars: ✭ 41 (-18%)
Mutual labels:  physics-engine
Ockero
Ockero: Kotlin OpenGl Game Engine
Stars: ✭ 67 (+34%)
Mutual labels:  physics-2d
bevy verlet
Verlet physics plugin for bevy.
Stars: ✭ 29 (-42%)
Mutual labels:  physics-2d
3D interactive graphics rendering engine
Develop a 3D interactive graphics rendering engine
Stars: ✭ 31 (-38%)
Mutual labels:  physics-engine
Rayon
Rigid body simulation for Minecraft
Stars: ✭ 25 (-50%)
Mutual labels:  physics-engine
apic2d
Affine Particle-in-Cell Water Simulation in 2D
Stars: ✭ 79 (+58%)
Mutual labels:  physics-2d
alien
ALIEN is a CUDA-powered artificial life simulation program.
Stars: ✭ 2,493 (+4886%)
Mutual labels:  physics-engine
CubbyFlow
Voxel-based fluid simulation engine for computer games
Stars: ✭ 215 (+330%)
Mutual labels:  physics-engine
Legion-Engine
Rythe is a data-oriented C++17 game engine built to make optimal use of modern hardware.
Stars: ✭ 502 (+904%)
Mutual labels:  physics-engine
ign-physics
Abstract physics interface designed to support simulation and rapid development of robot applications.
Stars: ✭ 40 (-20%)
Mutual labels:  physics-engine
Py3ODE
Port of PyODE for Python 3
Stars: ✭ 29 (-42%)
Mutual labels:  physics-engine
crystal-chipmunk
Crystal bindings to Chipmunk, a fast and lightweight 2D game physics library
Stars: ✭ 38 (-24%)
Mutual labels:  physics-engine
ant sugar
Genetic Algorithms, Mutation, Crossover, Mating, Particle Animation, Gaming, Learning, P5JS, Fun Project
Stars: ✭ 33 (-34%)
Mutual labels:  physics-engine
amethyst physics
Amethyst physics engine abstraction layer
Stars: ✭ 29 (-42%)
Mutual labels:  physics-engine
Vortex2D
Real-time fluid simulation engine running on GPU with Vulkan
Stars: ✭ 91 (+82%)
Mutual labels:  physics-engine
multiplayer-babylon-js-game
Multiplayer BabylonJS game with Server and Client-Side physics engine synchronization
Stars: ✭ 74 (+48%)
Mutual labels:  physics-engine

Box2D-optimized

This project is currently in alpha, work in progress

Box2D is a 2D physics engine for games, developed and maintained by Erin Catto.

Box2D-optimized is a Box2D fork that aims to offer improved perfromance and scalability, while maintining a similar API and feature set. This library merges commits from upstream Box2D regularly in order to be up to date.

A collection of various benchmarks and graphs showcasing the performance improvement can be found in the box2d-benchmarks repository.

There are a lot of under-the-hood changes in order to achieve this stated speedup, which are described in my dissertation for optimizing Box2D: optimizing-box2d

Contributing

Feel free to open issues for bugs and discussions or make pull requests.

License

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

Box2D-optimized is developed by Manolis Tsamis and also uses the MIT license.

Box2D

The rest of the Box2D README is copied here for convinience

Features

Collision

  • Continuous collision detection
  • Contact callbacks: begin, end, pre-solve, post-solve
  • Convex polygons and circles
  • Multiple shapes per body
  • One-shot contact manifolds
  • Dynamic tree broadphase
  • Efficient pair management
  • Fast broadphase AABB queries
  • Collision groups and categories

Physics

  • Continuous physics with time of impact solver
  • Persistent body-joint-contact graph
  • Island solution and sleep management
  • Contact, friction, and restitution
  • Stable stacking with a linear-time solver
  • Revolute, prismatic, distance, pulley, gear, mouse joint, and other joint types
  • Joint limits, motors, and friction
  • Momentum decoupled position correction
  • Fairly accurate reaction forces/impulses

System

  • Small block and stack allocators
  • Centralized tuning parameters
  • Highly portable C++ with no use of STL containers

Testbed

  • OpenGL with GLFW
  • Graphical user interface with imgui
  • Extensible test framework
  • Support for loading world dumps

Building

  • Install CMake
  • Ensure CMake is in the user PATH
  • Visual Studio: run build.bat from the command prompt
  • Otherwise: run build.sh from a bash shell
  • Results are in the build sub-folder
  • On Windows you can open box2d.sln

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

  • Install CMake
  • Add Cmake to the path in .zprofile (the default Terminal shell is zsh)
    • export PATH="/Applications/CMake.app/Contents/bin:$PATH"
  • mkdir build
  • cd build
  • cmake -G Xcode ..
  • open box2d.xcodeproj
  • Select the testbed scheme
  • Edit the scheme to set a custom working directory, make this be in box2d/testbed
  • You can now build and run the testbed

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

Sponsorship

Support development of Box2D through Github Sponsors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].