public abstract class Emitter extends ParticleControllerComponent implements Json.Serializable
Emitter
is a ParticleControllerComponent
which will handle the particles emission.
It must update the percent
to reflect the current percentage of the current emission cycle.
It should consider minParticleCount
and maxParticleCount
to rule particle emission.
It should notify the particle controller when particles are activated, killed, or when an emission cycle begins.Modifier and Type | Field and Description |
---|---|
int |
maxParticleCount
The min/max quantity of particles
|
int |
minParticleCount
The min/max quantity of particles
|
float |
percent
Current state of the emission, should be currentTime/ duration
Must be updated on each update
|
Constructor and Description |
---|
Emitter() |
Emitter(Emitter regularEmitter) |
Modifier and Type | Method and Description |
---|---|
void |
end()
Called at the end of the simulation.
|
int |
getMaxParticleCount() |
int |
getMinParticleCount() |
void |
init()
Called once during intialization
|
void |
read(Json json,
JsonValue jsonData) |
void |
set(Emitter emitter) |
void |
setMaxParticleCount(int maxParticleCount) |
void |
setMinParticleCount(int minParticleCount) |
void |
setParticleCount(int aMin,
int aMax) |
void |
write(Json json) |
activateParticles, allocateChannels, copy, dispose, killParticles, load, save, set, start, update
public int minParticleCount
public int maxParticleCount
public float percent
public Emitter(Emitter regularEmitter)
public Emitter()
public void init()
ParticleControllerComponent
init
in class ParticleControllerComponent
public void end()
ParticleControllerComponent
end
in class ParticleControllerComponent
public int getMinParticleCount()
public void setMinParticleCount(int minParticleCount)
public int getMaxParticleCount()
public void setMaxParticleCount(int maxParticleCount)
public void setParticleCount(int aMin, int aMax)
public void set(Emitter emitter)
public void write(Json json)
write
in interface Json.Serializable
write
in class ParticleControllerComponent
public void read(Json json, JsonValue jsonData)
read
in interface Json.Serializable
read
in class ParticleControllerComponent
Copyright © 2015. All rights reserved.