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.
- Translating Jolt Physics applications into Java
- How to add Jolt JNI to an existing project
- How to build Jolt JNI from source
- Freeing native objects
- External links
- Acknowledgments
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 theBody
class in Jolt Physics. - The
ConstBody
interface will include all theconst
methods of the Jolt PhysicsBody
class, such as itsGetPosition()
method, which in Jolt JNI is calledgetPosition()
.
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 aBodyIdVector
. - The
mConvexRadius
member of theBoxShapeSettings
class is accessed usinggetConvexRadius()
andsetConvexRadius()
in Jolt JNI.
For a couple well-known Jolt Physics examples, line-for-line translations into Java are provided.
How to add Jolt JNI to an existing project
How to build Jolt JNI from source
Jolt JNI is derived from open-source software:
- the Jolt Physics project
- Khaled Mamou's V-HACD Library for approximate convex decomposition
This project also made use of the following software tools:
- the Android Studio, IntelliJ IDEA, and NetBeans integrated development environments
- the Checkstyle tool
- the Firefox web browser
- the GNU Compiler Collection and Project Debugger
- the Git revision-control system and GitK commit viewer
- the GitKraken client
- the Gradle build tool
- the Java compiler, standard doclet, and runtime environment
- the Linux Mint operating system
- the LLVM Compiler Infrastructure
- the Markdown document-conversion tool
- the Meld visual merge tool
- Microsoft Windows and Visual Studio
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]