Jolt JNI
The Jolt-JNI Project provides JVM bindings for Jolt Physics and Khaled Mamou's V-HACD Library, to facilitate 3-D 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
- How to add Jolt JNI to an existing project
- How to build Jolt JNI from source
- Freeing native objects
- External links
- Acknowledgments
Translating Jolt Physics applications into Java
There’s close correspondence between the class/method names of Jolt Physics and Jolt JNI. For example:
- The
Bodyclass in Jolt JNI will (eventually) provide all the functionality of theBodyclass in Jolt Physics. - The
ConstBodyinterface will include all theconstmethods of the Jolt PhysicsBodyclass, 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
mConvexRadiusmember of theBoxShapeSettingsclass 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 add Jolt JNI to an existing project
How to build Jolt JNI from source
How to build Jolt JNI from source
Freeing native objects
External links
Acknowledgments
Jolt JNI is derived from open-source software:
- the Jolt Physics project
- Khaled Mamou's V-HACD Library for approximate convex decomposition
Useful code was contributed by TropheusJ, wil (aka JNightRider), xI-Mx-Ix, MORIMORI0317, and David J. Morfe (aka jakeee51).
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: sgold@sonic.net
more like this
mc-fps-jvm-args
JVM arguments that you can use from your Minecraft launcher to increase game performance.