jrouwe / JoltPhysics

A multi core friendly rigid body physics and collision detection library. Written in C++. Suitable for games and VR applications. Used by Horizon Forbidden West.
MIT License
6k stars 374 forks source link
c-plus-plus cpp game-development game-engine physics physics-engine physics-simulation simulation vr

CLA assistant Build Status Quality Gate Status Bugs Code Smells

Jolt Physics

A multi core friendly rigid body physics and collision detection library. Suitable for games and VR applications. Used by Horizon Forbidden West.

Horizon Forbidden West Cover Art

Ragdoll Pile
A YouTube video showing a ragdoll pile simulated with Jolt Physics.

For more demos and videos go to the Samples section.

Design considerations

Why create yet another physics engine? Firstly, it has been a personal learning project. Secondly, I wanted to address some issues that I had with existing physics engines:

Features

Supported platforms

Required CPU features

Documentation

To learn more about Jolt go to the latest Architecture and API documentation. Documentation for a specific release is also available.

To get started, look at the HelloWorld example. A HelloWorld example using CMake FetchContent is also available to show how you can integrate Jolt Physics in a CMake project.

Some algorithms used by Jolt are described in detail in my GDC 2022 talk: Architecting Jolt Physics for 'Horizon Forbidden West' (slides, slides with speaker notes, video).

Compiling

If you want to run on Platform Blue you'll need to provide your own build environment and PlatformBlue.h due to NDA requirements. This file is available on the Platform Blue developer forum.

For build instructions go to the Build section. When upgrading from an older version of the library go to the Release Notes or API Changes sections.

Performance

If you're interested in how Jolt scales with multiple CPUs and compares to other physics engines, take a look at this document.

Folder structure

Bindings for other languages

Integrations in other engines

See a list of projects that use Jolt Physics here.

License

The project is distributed under the MIT license.

Contributions

All contributions are welcome! If you intend to make larger changes, please discuss first in the GitHub Discussion section. For non-trivial changes, we require that you agree to a Contributor Agreement. When you create a PR, CLA assistant will prompt you to sign it.