A general-purpose add-on library for jMonkeyEngine (code has New BSD license)
OTHER License
The Heart Project provides a general-purpose add-on library for the jMonkeyEngine (JME) game engine.
It contains 3 subprojects:
Complete source code (in Java) is provided under a 3-clause BSD license.
Many other libraries depend on the Heart Library, including Acorus, jme3-wireframe, JmePower, Minie, MonkeyWrench, SkyControl, and Wes.
Dumper
to concisely dump a scene graph or a subtree thereof, or toValidate
to validate arguments passed to a library methodAxesVisualizer
to visualize the coordinate axes of a Node
BoundsVisualizer
to visualize the world bounds of a Spatial
PointVisualizer
to visualize a particular location in the worldSkeletonVisualizer
to visualize the bones/joints of an animated modelVectorVisualizer
to visualize a vectorMyAsset.createDebugMaterial()
to visualize mesh normalsMyMesh.boneWeightMaterial()
to visualize bone weights in a Mesh
Mesh
subclasses:
Dodecahedron
, Icosahedron
, Octahedron
, and Tetrahedron
CapsuleMesh
, Cone
, DomeMesh
, Icosphere
, LoopMesh
,Octasphere
, PointMesh
, Prism
, and RectangleOutlineMesh
RectangleMesh
to generate custom quadsDiscMesh
and RoundedRectangle
to generate eye-pleasing backgroundsMyMesh
utilities to analyze and manipulate JMonkeyEngine meshes:
Mesh
by introducing an index bufferMesh
to ensure no vertex data are re-usedMesh
Properties
and String
assetsContrastAdjustmentFilter
AppState
to manage ViewPort
updatingHeart comes pre-built as a single library that depends on the standard "jme3-core" library from jMonkeyEngine. Adding Heart to an existing jMonkeyEngine project should be a simple matter of adding this library to the classpath.
For projects built using Maven or Gradle, it is sufficient to add a dependency on the Heart Library. The build tool should automatically resolve the remaining dependencies.
Add to the project’s "build.gradle" file:
repositories {
mavenCentral()
}
dependencies {
implementation("com.github.stephengold:Heart:9.1.0")
}
For some older versions of Gradle,
it's necessary to replace implementation
with compile
.
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>Heart</artifactId>
<version>9.1.0</version>
</dependency>
For projects built using Ant, download the library from GitHub:
You'll definitely want the class jar and probably the "-sources" and "-javadoc" jars as well.
Open the project's properties in the IDE (JME SDK or NetBeans):
JAVA_HOME
environment variable to your JDK installation:export JAVA_HOME="
path to installation "
set -g JAVA_HOME "
path to installation "
set JAVA_HOME="
path to installation "
$env:JAVA_HOME = '
path to installation '
git clone https://github.com/stephengold/Heart.git
cd Heart
git checkout -b latest 9.1.0
cd
to the extracted directory/folder./gradlew build
.\gradlew build
After a successful build, Maven artifacts will be found in "HeartLibrary/build/libs".
You can install the artifacts to your local Maven repository:
./gradlew install
.\gradlew install
You can restore the project to a pristine state:
./gradlew clean
.\gradlew clean
Newer releases (since v4.5.0) can be downloaded from GitHub.
Older releases (v0.9.5 through v4.4.0) can be downloaded from the Jme3-utilities Project.
Newer Maven artifacts (since v6.3.0) are available from MavenCentral.
Old Maven artifacts (v5.0.0 through v6.4.0) are available from JCenter.
Package names begin with jme3utilities
.
The source code and pre-built libraries are compatible with JDK 8.
Applications have been created to test and demonstrate certain features of Heart.
These can be run from the menu-driven AppChooser app:
./gradlew AppChooser
.\gradlew AppChooser
You can also run specific apps from a command prompt:
./gradlew :HeartExamples:LoopMeshTest
.\gradlew :HeartExamples:LoopMeshTest
This app demonstrates constructing a regular polygon
using the LoopMesh
class.
This app demonstrates visualizing the bounding volume of a geometry
using a BoundsVisualizer
.
Pressing the "B" key toggles the bounding volume between a sphere and an axis-aligned box.
This app demonstrates changing the contrast of a rendered scene
using a ContrastAdjustmentFilter
.
This app demonstrates generating pseudo-random vectors and rotations
using a Generator
.
This app demonstrates translating, indexing, and merging meshes
using the MyMesh
utility class.
This app demonstrates visualizing a mesh with vertex colors using the "multicolor.j3md" material definitions.
This app demonstrates monitoring the maximum time per frame
using a PerformanceAppState
.
This app demonstrates rotation of mesh vertices
using the MyMesh.rotate()
utility method.
Pressing the Enter key rotates both meshes to a new, pseudo-randomly chosen orientation.
This app demonstrates visualizing the skeleton of an animated model
using SkeletonVisualizer
.
Pressing the "." key toggles the animation between paused and running.
This app demonstrates procedurally generating meshes
using the Cone
, Dodecahedron
, DomeMesh
, Icosahedron
, Icosphere
,
Octahedron
, Octasphere
, Prism
, and Tetrahedron
classes.
Pressing the "N" key cycles through 6 different test materials.
This app demonstration subdividing a mesh
using the MyMesh.subdivideTriangles()
utility method.
This app demonstrates visualizing a mesh as a wireframe
using the MyAsset.createWireframeMaterial()
utility method.
This app demonstrates converting a triangle mesh to a line mesh
using the MyMesh.trianglesToLines()
utility method.
The evolution of this project is chronicled in its release log.
The oldest parts of the Heart Library were originally included in SkyControl.
From May 2017 to February 2020, Heart was a subproject of the Jme3-utilities Project.
Since February 2020, Heart has been a separate project, hosted at GitHub.
Like most projects, the Heart Project builds on the work of many who have gone before. I therefore acknowledge the following software developers:
Icosphere.java
I am grateful to GitHub, Sonatype, JFrog, and Imgur 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]