See odin-joltc as well
Jolt Physics bindings for Odin via joltc.
This project provides Odin language bindings for the Jolt Physics engine, enabling high-performance physics simulation in Odin applications. The bindings are automatically generated using odin-c-bindgen from the joltc C API.
- Odin compiler
- Python 3
- libclang (required for binding generation)
To build only the shared library (.so on Linux, .dll on Windows, .dylib on macOS):
python build.py --build-joltcThis downloads and compiles joltc automatically.
Window Run the above inside the VS2022 Dev Console
Linux Installation:
cd joltc/build
sudo make install
sudo ldconfigIf you need fresh bindings from the latest JoltC changes:
python build.py --build-bindgen --gen-bindingsThis will:
- Download and compile odin-c-bindgen
- Generate new Odin bindings from the C headers
- Copy the
joltc-odindirectory to your project root - Include the appropriate shared library for your platform:
- Linux:
libjoltc.so(place in /usr/local/lib to make it available to the system) - Windows:
joltc.dll - macOS:
libjoltc.dylib
- Linux:
- Import and initialize Jolt in your code:
package my_game
import jph "jolt"
main :: proc() {
// Initialize Jolt Physics
assert(jph.Init())
defer jph.Shutdown()
// Setup physics world, job system, etc.
// See samples for complete examples
}odin test .For complete working examples, see the jolt-odin-samples repository.
Run examples with odin run examples -debug
joltc-odin/
├── jolt/ # Generated Odin bindings
├── build.py # Build script
└── README.md # This file
Make sure the shared library is:
- In the same directory as your executable, or
- In your system's library path, or
- Properly referenced in your build configuration
You may need to adjust library paths in the joltc-odin package if your setup differs from the default.
Ensure all requirements are installed and accessible in your PATH:
- Odin compiler
- Python 3
- libclang development headers
This project builds upon the excellent work of:
- Jolt Physics - The high-performance physics engine (MIT License)
- joltc - C bindings for Jolt Physics (MIT License)
- odin-c-bindgen - Automatic binding generator for Odin (MIT License)
Please refer to the individual projects for their respective licenses.