Skip to content

Integrate Jolt Physics into jMonkeyEngine projects (code has New BSD license)

License

Notifications You must be signed in to change notification settings

stephengold/kk-physics

Repository files navigation

The KK Physics Project is about integrating the Jolt Physics engine into the jMonkeyEngine (JME) game engine.

This project is currently a proof of concept and is not intended for production use.

It contains 2 subprojects:

  1. library: the KK Physics JVM runtime library
  2. apps: non-automated test software

Complete source code (in Java) is provided under a 3-clause BSD license.

Contents of this document

How to add KK Physics to an existing project

KK Physics comes pre-built as a single library that depends on the standard "jme3-core" library from jMonkeyEngine.

For projects built using Maven or Gradle, it is sufficient to add dependencies on the KK Physics library and the jolt-java Linux native library. The build tool should automatically resolve the remaining dependencies.

Gradle-built projects

Add to the project’s "build.gradle" file:

repositories {
    mavenCentral()
}
dependencies {
    implementation 'com.github.stephengold:kk-physics:0.1.0'
    runtimeOnly 'com.github.stephengold:jolt-java-natives-linux-x86:0.1.0'
}

For some older versions of Gradle, it's necessary to replace implementation with compile.

Maven-built projects

Add to the project’s "pom.xml" file:

<repositories>
  <repository>
    <id>mvnrepository</id>
    <url>https://repo1.maven.org/maven2/</url>
  </repository>
</repositories>

<dependency>
  <groupId>com.github.stephengold</groupId>
  <artifactId>kk-physics</artifactId>
  <version>0.1.0</version>
</dependency>
<dependency>
  <groupId>com.github.stephengold</groupId>
  <artifactId>jolt-java-natives-linux-x86</artifactId>
  <version>0.1.0</version>
</dependency>

How to build KK Physics from source

  1. Install a Java 19 Development Kit (JDK), if you don't already have one.
  2. Point the JAVA_HOME environment variable to your JDK installation: (In other words, set it to the path of a directory/folder containing a "bin" that contains a Java executable. That path might look something like "C:\Program Files\Eclipse Adoptium\jdk-19.0.3.7-hotspot" or "/usr/lib/jvm/java-19-openjdk-amd64/" or "/Library/Java/JavaVirtualMachines/zulu-19.jdk/Contents/Home" .)
  • using Bash or Zsh: export JAVA_HOME=" path to installation "
  • using Fish: set -g JAVA_HOME " path to installation "
  • using Windows Command Prompt: set JAVA_HOME=" path to installation "
  • using PowerShell: $env:JAVA_HOME = ' path to installation '
  1. Download and extract the KK Physics source code from GitHub:
  • using Git:
    • git clone https://github.com/stephengold/kk-physics.git
    • cd kk-physics
    • git checkout -b latest 0.1.0
  1. Run the Gradle wrapper:
  • using Bash or Fish or PowerShell or Zsh: ./gradlew build
  • using Windows Command Prompt: .\gradlew build

After a successful build, Maven artifacts will be found in "library/build/libs".

You can install the artifacts to your local Maven repository:

  • using Bash or Fish or PowerShell or Zsh: ./gradlew install
  • using Windows Command Prompt: .\gradlew install

You can restore the project to a pristine state:

  • using Bash or Fish or PowerShell or Zsh: ./gradlew clean
  • using Windows Command Prompt: .\gradlew clean

Jump to the table of contents

External links

Jump to the table of contents

History

The API and much of the source code is derived from Minie.

Jump to the table of contents

Acknowledgments

Like most projects, the KK Physics Project builds on the work of many who have gone before. I therefore acknowledge the following software developers:

  • "aecsocket" for creating the jolt-java bindings to the Jolt Physics Engine
  • Normen Hansen (aka "normen") for creating most of the jme3-bullet library (from which the KK Physics API is derived)
  • plus the creators of (and contributors to) the following software:
    • the Firefox web browser
    • the Git revision-control system and GitK commit viewer
    • the GitKraken client
    • the Gradle build tool
    • the Java compiler, standard doclet, and runtime environment
    • jMonkeyEngine and the jME3 Software Development Kit
    • the Jolt Physics Engine
    • the Linux Mint operating system
    • LWJGL, the Lightweight Java Game Library
    • the Markdown document-conversion tool
    • the Meld visual merge tool
    • the NetBeans integrated development environment

I am grateful to GitHub and Sonatype 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