Skip to content

stephengold/jolt-jni

Repository files navigation

Jolt JNI

The Jolt-JNI Project provides JVM bindings for Jolt Physics and Khaled Mamou's V-HACD Library, to facilitate physics simulation in JVM languages such as Java and Kotlin.

Source code (in Java and C++) is provided under an MIT license.

Contents of this document

Translating Jolt Physics applications into Java

There’s close correspondence between the class/method names of Jolt Physics and Jolt JNI. For example:

  • The Body class in Jolt JNI will (eventually) provide all the functionality of the Body class in Jolt Physics.
  • The ConstBody interface will include all the const methods of the Jolt Physics Body class, such as its GetPosition() method, which in Jolt JNI is called getPosition().

Things become slightly more interesting when C++ templates and public member data are involved. For instance:

  • An array of body IDs is Array<BodyID> in Jolt Physics; in Jolt JNI it’s called a BodyIdVector.
  • The mConvexRadius member of the BoxShapeSettings class is accessed using getConvexRadius() and setConvexRadius() in Jolt JNI.

For a couple well-known Jolt Physics examples, line-for-line translations into Java are provided.

Jump to the table of contents

How to add Jolt JNI to an existing project

How to add Jolt JNI to an existing project

Jump to the table of contents

How to build Jolt JNI from source

How to build Jolt JNI from source

Jump to the table of contents

Freeing native objects

Freeing native memory

Jump to the table of contents

External links

Jump to the table of contents

Acknowledgments

Jolt JNI is derived from open-source software:

This project also made use of the following software tools:

I am grateful to Riccardo Balbo (aka "riccardo") for bringing V-HACD to my attention.

I am grateful to GitHub, Sonatype, Travis, and MacStadium for providing free hosting for this project and many other open-source projects.

I'm also grateful to my dear Holly, for keeping me sane.

If I've misattributed anything or left anyone out, please let me know, so I can correct the situation: [email protected]

Jump to the table of contents