2
0

C Wrapper for the Jolt Physics engine.
#c #physics #3d #gamedev #simulation #collision #library #wrapper #cpp

Lucien Greathouse 3ff31fb0d0 Some enums 6 сар өмнө
.cargo 4cb4a72bd9 Port a bunch of enums 6 сар өмнө
.github 2265632ee5 Get outta here, ubuntu-latestl+Release 1 жил өмнө
HelloWorld 6647048bea ConvexHullShape 1 жил өмнө
JoltC 3ff31fb0d0 Some enums 6 сар өмнө
JoltCImpl 3ff31fb0d0 Some enums 6 сар өмнө
JoltPhysics @ e071001ba1 52d0447345 Update to Jolt Physics master, bind SimShapeFilter 9 сар өмнө
generate 1284a92fb1 Remove the little bit crazy cps crate 6 сар өмнө
input 3ff31fb0d0 Some enums 6 сар өмнө
.editorconfig a371375686 Add .editorconfig 1 жил өмнө
.gitignore 1ba2c30f83 Possible to generate a bunch of structs automatically 6 сар өмнө
.gitmodules 39b33067d3 Initial commit 1 жил өмнө
CMakeLists.txt 1ba2c30f83 Possible to generate a bunch of structs automatically 6 сар өмнө
Cargo.lock 1284a92fb1 Remove the little bit crazy cps crate 6 сар өмнө
Cargo.toml 1ba2c30f83 Possible to generate a bunch of structs automatically 6 сар өмнө
LICENSE-APACHE 7907eaa304 Update license and README 1 жил өмнө
LICENSE-MIT 7907eaa304 Update license and README 1 жил өмнө
README.md 9cad13df67 Move C++ implementation to new module and start specializing to_jpc/to_jph 6 сар өмнө
test-all-flags.sh cdcf8ecba2 Set up GitHub Actions correctly on my first try 1 жил өмнө

README.md

JoltC

C wrapper for Jolt Physics 5.1.0.

Currently a work in progress. Bindings contain functions that we've needed as part of our game or the Rust bindings we're working on in jolt-rust.

The JoltC directory contains headers for the C interface that you can bind to.

The JoltCImpl directory contains the C++ implementation of the C interface and serves as the glue between the C++ and C code.

Goals

  1. Sound C wrapper around current version of Jolt Physics
  2. Headers suitable for usage in automatic binding generation tools (i.e. Rust bindgen, LuaJIT FFI)

Building

Use CMake:

# Configure the build
cmake -B build

# Optionally, you can enable double precision, or make ObjectLayer use 32 bits
# We aim to support most of the configuration of Jolt's C++ API.
cmake -B build -DDOUBLE_PRECISION=ON -DOBJECT_LAYER_BITS=32

# Build
cmake --build build

Hello, world!

A port of Jolt's "HelloWorld" example is provided in HelloWorld/main.cpp.

Other C Wrappers

Other C wrappers for Jolt Physics include:

The goal of this project is to be the first C wrapper around Jolt Physics that is not part of a larger binding project and to eliminate sources of undefined behavior. It's intended to be useful for any other language-specific bindings and to reduce the need to duplicate work.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.