I have a few changes to JME3 code that I think might be of general interest. it would certainly be in my interest to not be relying on forked code for too long.
-
I altered AudioNode so that a single one could be used to play successive assets. The stock implementation does not seem to allow a Node to be loaded with another asset after it finishes playing, which is inefficient for apps like mine that play concatenated speech files a LOT. With very little additional work, the free pool and factory method I am using externally could also be moved into AudioNode. The goal, of course, is to permit the creation of the fewest possible objects and to provide a small savings in 3D calculation. I had to make these changes “in place” due to access restrictions in AudioNode.java and to its intimate relationship to LwjglAudioRenderer.java
-
I made a wider variety of changes to ParticleEmitter.java, primarily to improve consistency and to help enable more realistic smoke effects in an outdoor environment:
a. changed default gravity to Vector3f.ZERO
b. added a wind vector. when non-null, wind will affect this emitter’s particles in concert with …
c. added float windDrag, which affects how rapidly particles take up the wind’s influence –
d. added startColor2 and endColor2. When non-null, the end points of a particle’s color transition have a range of values rather than a single one
e. added boolean chaoticColors. When true, each particle selects independent startColor and endColor pairs within the specified ranges. Else, the starting color value and ending color value will lie at the same proportional but random value within their given range
f. added floats startSize2 and endSize2. When set to a value other than the default Float.NaN, these permit similar variability in size range for each particle
g. altered behavior of gravity so it no longer operates BACKWARD (e.g., gravity with a -Y component should mean that they fall down, yes?). I’d make sure that old objects write() and read() into conformity.
h. added a static method to translate all active particles in the world space by a given offset. I use because I occasionally re-home my top level objects to shove my camera back to the world origin so I can reliably render fine geometry near the camera and also coarse geometry far away without undue Z fighting (my game is a naval sim with a first person perspective-- smoke, handheld devices and ships 30,000m away abound!).