3D Rigid body physics engine.
Same API as Muli, with the dynamics expanded to 3D and multi-threading support.
- Shapes: sphere, capsule, box, polygon, convex, height field, and triangle mesh
- Support for rounded shapes
- Multiple colliders attached to a single body
- Dynamic, static, and kinematic bodies
- Collision filtering
- Dynamic AABB tree broad phase
- Ray cast, shape cast, and area queries
- PGS solver with a separate position correction (PGS NGS)
- Persistent constraint graph
- Graph coloring based solver with multi-threading
- SIMD optimized solver backend
- Constraint islanding and sleeping
- Deterministic simulation
- Contact callbacks: begin, touching, end, pre-solve, and destroy
- Physics material: friction, restitution, and surface velocity
- Various joints with limits and motors
- Cross platform library (C++20)
- 30+ Demos
#include "muli3/muli3.h"
using namespace muli3;
int main()
{
ThreadPool pool(8);
WorldSettings settings;
settings.thread_pool = &pool;
World world(&settings);
Body* box = world.CreateBox(1.0f);
box->SetPosition(0.0f, 5.0f, 0.0f);
// Run simulation for one second
float dt = 1.0f / 60.0f;
for(int i = 0; i < 60; ++i)
{
world.Step(dt);
}
return 0;
}- Install CMake.
- Ensure CMake is in the system
PATH. - Clone the repository:
git clone https://github.com/Sopiro/Muli3 - Run the following commands:
git clone https://github.com/Sopiro/Muli3 cd Muli3 cmake -S . -B build cmake --build build --config Release
- You can find the demo executable in
build/bin.
You can easily include the library using CMake's FetchContent module.
include(FetchContent)
FetchContent_Declare(
muli3
GIT_REPOSITORY https://github.com/Sopiro/Muli3
)
set(MULI3_BUILD_DEMO OFF)
FetchContent_MakeAvailable(muli3)