Package tripleplay.particle
Class Generator
java.lang.Object
tripleplay.particle.Generator
Adds particles to an emitter according to some policy.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Generator
constant
(float particlesPerSecond) Returns a generator that emits the specified number of particles per second, and is never exhausted.abstract boolean
Requests that particles be generated, if appropriate.static Generator
impulse
(int particles) Returns a generator that emits the specified number of particles all at once, and is then immediately exhausted.
-
Field Details
-
NOOP
A generator that emits no particles and is never exhausted.
-
-
Constructor Details
-
Generator
public Generator()
-
-
Method Details
-
impulse
Returns a generator that emits the specified number of particles all at once, and is then immediately exhausted. -
constant
Returns a generator that emits the specified number of particles per second, and is never exhausted. The number of particles may be fractional if you wish to emit one particle every N seconds where N is greater than 1. -
generate
Requests that particles be generated, if appropriate.- Parameters:
emitter
- the emitter for which the particles should be generated.now
- the current time stamp (in seconds).dt
- the elapsed time since the last frame (in seconds).- Returns:
- true if this generator is exhausted, false if it has more particles to generate.
-