JoltPhysics README

The project's README from github.com/jrouwe/JoltPhysics. As one markdown file: README.md.

CLA assistant Build Status Quality Gate Status Bugs Code Smells Coverage

Jolt Physics

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

Horizon Forbidden West Cover Art Death Stranding 2 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 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.

Every feature in Jolt has its own sample. Running the Samples application and browsing through the code is a great way to learn about the library!

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

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.

Note that all PRs will be squashed before merging, so there's no need to force-push to git to keep the history clean.

JoltPhysics (jrouwe/JoltPhysics)

Searching Database…

Что это такое?Jolt Physics — это библиотека для физики твёрдых тел и обнаружения столкновений, написанная на C++ и хорошо работающая на нескольких ядрах процессора. Она создана для игр и VR-приложений. На ней работают «Horizon Forbidden West» и «Death Stranding 2: On the Beach».
Это полноценный игровой движок или просто библиотека физики, которую подключают к другому проекту?Это самостоятельная библиотека физики и обнаружения столкновений, а не полноценный игровой движок. Её встраивают в вашу игру или движок, и уже есть интеграции с Godot, Source Engine и Unreal.
Как добавить её в свой проект?Соберите её с помощью CMake или подключите через CMake FetchContent, как показано в примере HelloWorld. Она компилируется в Visual Studio 2022+, Clang 16+ или GCC 12+ с использованием C++17.
Нужны ли внешние библиотеки для сборки?Нет, Jolt зависит только от стандартной библиотеки шаблонов и не использует RTTI и исключения, так что для сборки достаточно компилятора, который поддерживает C++17.
Детерминирована ли симуляция, если мне нужна физика по сети?Симуляция детерминированная, поэтому её можно воспроизвести на удалённом клиенте, передавая только входные данные. В README также указано отдельное описание «Deterministic Simulation» с точными ограничениями этой гарантии.
Какие платформы и процессоры она действительно поддерживает?Windows, Linux, FreeBSD, Android, macOS и iOS на архитектурах x86/x64/ARM/RISC-V/PowerPC, а также MSYS2 MinGW64 и отдельная сборка для WebAssembly. На x86/x64 минимальное требование к процессору — SSE2, а ARM64 использует NEON.
Может ли она симулировать мягкие тела, например ткань или волосы, а не только твёрдые тела?Да. Поддерживается симуляция мягких тел (ограничения по рёбрам, изгибу, давлению и привязкам для таких объектов, как ткань или мячи), а также основанная на GPU симуляция волос из прядей на основе стержней Коссера.
Можно ли использовать Jolt из языков, отличных от C++?Да, существуют сообщества-разработанные привязки для C, C#, Java/Kotlin, JavaScript, Rust, Python, Zig и Jai.
Зачем автор написал ещё один физический движок?Проект начинался как личный учебный. Он задумывался, чтобы исправить проблемы с многопоточностью, которые автор видел в существующих движках, например, чтобы запросы на столкновения и загрузка тел безопасно выполнялись в нескольких потоках без блокировки всей симуляции.
Какие типы тел и ограничений я могу моделировать?Твёрдые тела форм сфер, коробок, капсул, выпуклых оболочек, мешей и карт высот, а также широкий набор ограничений (шарнир, слайдер, конус, шестерня, блок, swing-twist, 6-DOF) и полноценную симуляцию транспорта для колёсных, гусеничных и мотоциклетных машин.
What are similar projects?box2d, bullet3, cocos2d-x, box3d, taskflow, OpenRCT2, bgfx, assimp
Creator
jrouwe
Size
30.7 MB
Stars
11.8K
Age
5y
Commits · 90 Days