Ok,
Here’s how I was planning on implementing the particle system.
It will actually be somewhat similar to the com.jme.scene.Point class.
A ParticleSystem will extend Geometry. Each particle in the system will define:
current location, size, color, texture, alpha, etc.
ParticleSystem will also have a ParticleController that extends com.jme.scene.Controller. This adds/deletes particles, changes velocity, size, color, etc etc.
The ParticleController will be where the user can set the attributes of the particle system.
Then Renderer will have a method draw(ParticleSystem).
LWJGLRenderer will handle rendering it using LWJGL billboards.
Does that sound reasonable?
I’ll try My ASCII art skills are very poor though
Spatial
^
|
Geometry
^
|
ParticleSystem
//ParticleSystem extends Geometry
Particle 1
*ParticleSystem
//ParticleSystem contains 1 or more Particles contained within somethink like
//an array list.
//A particle will contain necessary information about it's current state. //Color, position, size etc. This information will be used to render the //individual particle.
ParticleController 1
1 ParticleSystem
//ParticleSystem contains 1 reference to a ParticleController
ParticleController knows the max number of particles allowed. Creates new particles to reach the max. Kill particles whose life span is up. Updates living particles (position (based on velocity), color, size, etc).
This is done through it's update(float time) method, where time will let you know how much to change.
Renderer <>
^
|
LWJGLRenderer
//LWJGL implements Renderer
This is already in place (it's how jME draws the the screen). You'd just add
a draw(ParticleSystem ps) method.
Within that method you'd get all particles and render them.
Does that clear anything up? Not sure how well I did with my UML :)
E-mail works for me.
Yep
sorry about that.