|
1 | 1 | # JoltPhysics-JavaFFM |
2 | 2 | This project provides Java Bindings for [JoltPhysics](https://github.com/jrouwe/JoltPhysics) using the Java FFM API and a [C Wrapper](https://github.com/amerkoleci/joltc). |
3 | 3 |
|
| 4 | +This project is in a usable, working state regarding the features that the C wrapper exposes. When the wrapper exposes new features, I try to update this project as fast as possible. |
| 5 | + |
4 | 6 | # Supported Platforms |
5 | 7 | Windows and Linux are directly supported. The Linux .so file was built on Linux Mint 22.2. |
6 | | -Nevertheless, you can use these bindings for Mac if you provide your own .dylib file and load it. |
| 8 | + |
| 9 | +Nevertheless, you should be able to use these bindings for Mac if you provide your own `.dylib` file and load it. |
| 10 | + |
| 11 | +# Building The Project |
| 12 | +1. Download [Java 26](https://www.oracle.com/de/java/technologies/downloads/) |
| 13 | +2. Download the sources or clone the repo |
| 14 | + |
| 15 | + ## Using The Terminal |
| 16 | + |
| 17 | + 3. Install [Maven](https://maven.apache.org/download.cgi) |
| 18 | + 4. Open the terminal in the directory of the downloaded project |
| 19 | + 5. Run the goal `mvn package`. |
| 20 | + 6. The output is in the `target/` folder |
| 21 | + |
| 22 | + ## Using An IDE |
| 23 | + |
| 24 | + 3. Import the project in an IDE of your choice as a maven project |
| 25 | + - [IntelliJ](https://www.jetbrains.com/guide/java/tutorials/working-with-maven/importing-a-project/) |
| 26 | + - [Eclipse](https://www.lagomframework.com/documentation/1.6.x/java/EclipseMavenInt.html) |
| 27 | + 4. Create a new maven run configuration and add the goal `mvn package` |
| 28 | + - [IntelliJ](https://www.jetbrains.com/help/idea/run-debug-configuration-maven.html) |
| 29 | + - [Eclipse](https://www.genuitec.com/docs/assembly/setting-up-maven-launch-configurations/) |
| 30 | + 5. Run the created configuration |
| 31 | + 6. The output is also in the `target/` folder |
| 32 | + |
| 33 | +If you are using the Eclipse IDE, you do not need to build the project explicitly. You can import this project into a workspace and just add the Maven coordinates into the `pom.xml` file of any other Maven project in the same workspace. This works as Eclipse can resolve Maven dependencies directly from the workspace, without requiring the project to be installed into the local Maven repository. |
7 | 34 |
|
8 | 35 | # Usage |
9 | 36 | This project requires Java 26 and preview features enabled. |
10 | 37 |
|
11 | | -Before calling any method you need to load the native library. For Windows and Linux you can call ```Jolt.loadNativeLibrary()```. Additionally you need to initialize jolt with a call to ```Jolt.init()``` (do not forget to call ```Jolt.shutdown``` when jolt is no longer needed). |
| 38 | +Before calling any method you need to load the native library. For Windows and Linux you can call ```Jolt.loadNativeLibrary()```. Additionally you need to initialize jolt with a call to ```Jolt.init()``` (do not forget to call ```Jolt.shutdown()``` when jolt is no longer needed). |
12 | 39 |
|
13 | 40 | To set the extract directory of the native library, change ```NativeLibraryLoaderConfig.SHARED_LIBRARY_EXTRACT_PATH```. |
14 | 41 |
|
|
0 commit comments