Package tripleplay.particle
Class Initializer
java.lang.Object
tripleplay.particle.Initializer
Used to initialize a new particle.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Initializer
public Initializer()
-
-
Method Details
-
willInit
public void willInit(int count) Called just before an initializer is used to initialize one or more particles. Gives the initializer a chance to do any computation that will be shared across all particles initialized on this frame. -
init
public abstract void init(int index, float[] data, int start) Applies this initializer to theindex
th particle in the supplied buffer. The initializer must use theParticleBuffer
offsets to write fields intodata
, for example:data[start+ParticleBuffer.POS_X] = x
.- Parameters:
index
- the index of the particle, which can be used to index into other per-particle data arrays.data
- the particle field data.start
- the offset intodata
at which the particle's fields start.
-