OpenSource-Hub

JoltPhysics

Library

jrouwe/JoltPhysics

Multi-core friendly rigid body physics and collision detection library for games and VR.

Overview

Jolt Physics is a high-performance, multi-core friendly rigid body physics and collision detection library written in C++. It is suitable for games and VR applications, and has been used in major titles like Horizon Forbidden West and Death Stranding 2. The library supports a wide range of features including constraints, soft bodies, vehicles, and extensive collision queries.

README Preview

[](https://cla-assistant.io/jrouwe/JoltPhysics)\n[](https://github.com/jrouwe/JoltPhysics/actions/)\n[](https://sonarcloud.io/dashboard?id=jrouwe_JoltPhysics)\n[](https://sonarcloud.io/dashboard?id=jrouwe_JoltPhysics)\n[](https://sonarcloud.io/dashboard?id=jrouwe_JoltPhysics)\n[](https://sonarcloud.io/dashboard?id=jrouwe_JoltPhysics)\n\n# Jolt Physics\n\nA multi core friendly rigid body physics and collision detection library. Suitable for games and VR applications. Used by Horizon Forbidden West and Death Stranding 2: On the Beach.\n\n[](https://www.playstation.com/en-us/games/horizon-forbidden-west/)\n[](https://www.playstation.com/en-us/games/death-stranding-2-on-the-beach/)\n\n|[](https://www.youtube.com/watch?v=pwyCW0yNKMA)|\n|:-|\n|*A YouTube video showing a ragdoll pile simulated with Jolt Physics.*|\n\nFor more demos and [videos](https://www.youtube.com/watch?v=pwyCW0yNKMA&list=PLYXVwtOr1CBxbA50jVg2dKUQvHW_5OOom) go to the [Samples](Docs/Samples.md) section.\n\n## Design considerations\n\nWhy 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:\n\n* Games do more than simulating physics. These things happen across multiple threads. We emphasize on concurrently accessing physics data outside of the main simulation update:\n	* Sections of the simulation can be loaded / unloaded in the background. We prepare a batch of physics bodies on a background thread without locking or affecting the simulation. We insert the batch into the simulation with a minimal impact on performance.\n	* Collision queries can run parallel to adding / removing or updating a body. If a change to a body happened on the same thread, the change will be immediately visible. If the change happened on another thread, the query will see a consistent before or after state. An alternative would be to have a read and write version of the world. This prevents changes from being visib