C bindings for Jolt Physics — a fast, modern 3D physics engine.
JoltPhysicsC wraps the Jolt Physics C++ API into a flat C API exposed as a shared or static library. It is primarily designed to be consumed by JoltPhysics.NET, the C# binding used in Evergine.
| Platform | Architecture | Artifact | Library type |
|---|---|---|---|
| Windows | x64, ARM64 | JoltC.dll |
Shared |
| Linux | x64, ARM64 | libJoltC.so |
Shared |
| macOS | ARM64 | libJoltC.dylib |
Shared |
| Android | arm, arm64 | libJoltC.so |
Shared |
| iOS | ARM64 | libJoltC.a |
Static |
| iOS Simulator | ARM64 | libJoltC.a |
Static |
| WebAssembly | wasm | libJoltC.a |
Static |
Note: On iOS and WebAssembly the Jolt engine and the C wrapper are merged into a single
libJoltC.astatic archive.
- CMake 3.20 or later
- A C++17 compiler (MSVC, GCC, Clang, or Apple Clang)
git clone --recursive https://github.com/EvergineTeam/JoltPhysicsC.git
cd JoltPhysicsCIf you already cloned without --recursive, fetch the submodule:
git submodule update --init --recursiveWindows (Visual Studio)
cmake -S JoltC -B JoltC/build -A x64
cmake --build JoltC/build --config ReleaseLinux
cmake -S JoltC -B JoltC/build -DCMAKE_BUILD_TYPE=Release
cmake --build JoltC/buildmacOS
cmake -S JoltC -B JoltC/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64
cmake --build JoltC/buildAndroid (requires the NDK)
cmake -S JoltC -B JoltC/build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-21 \
-DANDROID_STL=c++_static
cmake --build JoltC/buildiOS
cmake -S JoltC -B JoltC/build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
-DJOLTC_STATIC=ON
cmake --build JoltC/buildWebAssembly (requires the Emscripten SDK)
cmake -S JoltC -B JoltC/build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
-DJOLTC_STATIC=ON
cmake --build JoltC/build| Option | Default | Description |
|---|---|---|
JOLTC_STATIC |
OFF |
Build as a static library instead of shared |
JOLTC_DOUBLE_PRECISION |
OFF |
Use double precision for world-space positions |
PHYSICS_REPO_ROOT |
../JoltPhysics |
Path to the Jolt Physics source tree |
Include the umbrella header to access the full API:
#include <JoltC/joltc.h>The API is organized into the following modules:
| Header | Description |
|---|---|
common.h |
Initialization, shutdown, error handling, opaque handles |
math.h |
Vectors, quaternions, matrices |
shape.h |
Collision shapes (box, sphere, capsule, mesh, compound, etc.) |
physics_system.h |
Physics world creation and simulation stepping |
body.h |
Rigid body creation and manipulation |
body_access.h |
Scoped body read/write locking |
constraint.h |
Joints and constraints |
query.h |
Ray casts and shape casts |
character.h |
Character controllers |
filters.h |
Broadphase and object layer filtering |
vehicle.h |
Vehicle simulation |
skeleton.h |
Skeleton and animation support |
This project is licensed under the MIT License. See LICENSE for details.