I’ve been posting some screenshots in the WIP and I am ready to start gathering feedback on the particle system i’ve been working on for jME. This code was originally based on early code from t0neg0d which I then heavily modified to allow for animation over time in Spoxel. I’ve spent a lot of time cleaning it up and incorporating some new concepts i picked up from other particle editors / systems. I’m working on SDK integration as well but I wanted to get some feedback on the particle system itself before I finished that.
I’m still working on some of the documentation, but I think the API has mostly stabilized at this point.
The particle system is an extension of the node class and holds 1 or more geometries as children depending on what modules a particle system contains. Modules each work upon the particle system in some way IE control speed / color / particle trails. At the moment I have the following modules:
- Color Module - Change the color of the particle over time
- Emission Module - This allows you to make additional “extra” particle emissions during the life of the emitter
- Gravity Module - Applies gravity to the particle over time
- Impulse Module - WIP… kind of a duplicate of the velocity module… not sure if it will stay
- Preferred Destination - Attempts to force a particle to travel to a given position over time
- Preferred Direction - Tries to force a particle to travel a given direction
- Random Module - Adds noise to the particles position
- Rotation Lifetime - Controls a particles rotation over it’s lifetime
- Rotation Velocity - Controls a particles rotation based on velocity
- Size Module - Handles particle size over time
- Sprite Module - Controls sprite animation for particles
- Trail Module - Adds trails for each of the particles… There are still a few things I want to polish here
- Velocity Module - Controls the velocity over time of a particle (includes linear and rotational)
One of the big design changes for this particle system is that most “attributes” can be animated. This breaks down into 3 different object types. They are ValueType (Float), VectorValueType(Vector3f), Gradient (Color). Each of those types can be set / animated.
Value / Vector
- Constant / Float Value
- Random Between two values
- Curve - Animated curve over time
- Random between two curves - Each particle has a random value assigned to it between 0-1 which is then used to interpolate between both curves
Gradient / Color Type
- Constant color
- Random color
- Random between two colors
- Gradient over time
- Random between two gradients - Each particle has a random value assigned to it between 0-1 which is then used to interpolate between both gradients
Currently there are a handful of emitter shapes which includes circle, cone, line, sphere and mesh. Each of those shapes has a handful of attributes you can edit to control how particles are emitted using that shape that will be pretty familiar to anyone that has used unity before.
Link to the code on github:
Any feedback would be appreciated