Class Initializer

java.lang.Object
tripleplay.particle.Initializer

public abstract class Initializer extends Object
Used to initialize a new particle.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    init(int index, float[] data, int start)
    Applies this initializer to the indexth particle in the supplied buffer.
    void
    willInit(int count)
    Called just before an initializer is used to initialize one or more particles.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the indexth particle in the supplied buffer. The initializer must use the ParticleBuffer offsets to write fields into data, 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 into data at which the particle's fields start.