Skip to content

Latest commit

 

History

296 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Muli3

Build

3D Rigid body physics engine.

Features

Same API as Muli, with the dynamics expanded to 3D and multi-threading support.

Collision

  • 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

Physics Simulation

  • 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

Others

  • Cross platform library (C++20)
  • 30+ Demos

Example

#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;
}

Building and running the demo

  • 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.

Including the library

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)

About

3D Physics Engine

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages