Class RegularEmitter
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.particles.ParticleControllerComponent
-
- com.badlogic.gdx.graphics.g3d.particles.emitters.Emitter
-
- com.badlogic.gdx.graphics.g3d.particles.emitters.RegularEmitter
-
- All Implemented Interfaces:
ResourceData.Configurable,Disposable,Json.Serializable
public class RegularEmitter extends Emitter implements Json.Serializable
It's a generic useEmitterwhich fits most of the particles simulation scenarios.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRegularEmitter.EmissionModePossible emission modes.
-
Field Summary
Fields Modifier and Type Field Description protected floatdelayprotected floatdelayTimerRangedNumericValuedelayValueprotected floatdurationprotected floatdurationTimerRangedNumericValuedurationValueprotected intemissionprotected intemissionDeltaprotected intemissionDiffScaledNumericValueemissionValueprotected intlifeprotected intlifeDiffprotected intlifeOffsetprotected intlifeOffsetDiffScaledNumericValuelifeOffsetValueScaledNumericValuelifeValue-
Fields inherited from class com.badlogic.gdx.graphics.g3d.particles.emitters.Emitter
maxParticleCount, minParticleCount, percent
-
-
Constructor Summary
Constructors Constructor Description RegularEmitter()RegularEmitter(RegularEmitter regularEmitter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateParticles(int startIndex, int count)Called to initialize new emitted particles.voidallocateChannels()Called during initialization to allocate additional particles channelsParticleControllerComponentcopy()RangedNumericValuegetDelay()RangedNumericValuegetDuration()ScaledNumericValuegetEmission()RegularEmitter.EmissionModegetEmissionMode()Gets current emission mode.ScaledNumericValuegetLife()ScaledNumericValuegetLifeOffset()floatgetPercentComplete()voidinit()Called once during intializationbooleanisComplete()booleanisContinuous()voidread(Json json, JsonValue jsonData)voidset(RegularEmitter emitter)voidsetContinuous(boolean continuous)voidsetEmissionMode(RegularEmitter.EmissionMode emissionMode)Sets emission mode.voidstart()Called at the start of the simulation.voidupdate()Called to execute the component behavior.voidwrite(Json json)-
Methods inherited from class com.badlogic.gdx.graphics.g3d.particles.emitters.Emitter
end, getMaxParticleCount, getMinParticleCount, set, setMaxParticleCount, setMinParticleCount, setParticleCount
-
Methods inherited from class com.badlogic.gdx.graphics.g3d.particles.ParticleControllerComponent
dispose, killParticles, load, save, set
-
-
-
-
Field Detail
-
delayValue
public RangedNumericValue delayValue
-
durationValue
public RangedNumericValue durationValue
-
lifeOffsetValue
public ScaledNumericValue lifeOffsetValue
-
lifeValue
public ScaledNumericValue lifeValue
-
emissionValue
public ScaledNumericValue emissionValue
-
emission
protected int emission
-
emissionDiff
protected int emissionDiff
-
emissionDelta
protected int emissionDelta
-
lifeOffset
protected int lifeOffset
-
lifeOffsetDiff
protected int lifeOffsetDiff
-
life
protected int life
-
lifeDiff
protected int lifeDiff
-
duration
protected float duration
-
delay
protected float delay
-
durationTimer
protected float durationTimer
-
delayTimer
protected float delayTimer
-
-
Constructor Detail
-
RegularEmitter
public RegularEmitter()
-
RegularEmitter
public RegularEmitter(RegularEmitter regularEmitter)
-
-
Method Detail
-
allocateChannels
public void allocateChannels()
Description copied from class:ParticleControllerComponentCalled during initialization to allocate additional particles channels- Overrides:
allocateChannelsin classParticleControllerComponent
-
start
public void start()
Description copied from class:ParticleControllerComponentCalled at the start of the simulation.- Overrides:
startin classParticleControllerComponent
-
init
public void init()
Description copied from class:ParticleControllerComponentCalled once during intialization
-
activateParticles
public void activateParticles(int startIndex, int count)Description copied from class:ParticleControllerComponentCalled to initialize new emitted particles.- Overrides:
activateParticlesin classParticleControllerComponent
-
update
public void update()
Description copied from class:ParticleControllerComponentCalled to execute the component behavior.- Overrides:
updatein classParticleControllerComponent
-
getLife
public ScaledNumericValue getLife()
-
getEmission
public ScaledNumericValue getEmission()
-
getDuration
public RangedNumericValue getDuration()
-
getDelay
public RangedNumericValue getDelay()
-
getLifeOffset
public ScaledNumericValue getLifeOffset()
-
isContinuous
public boolean isContinuous()
-
setContinuous
public void setContinuous(boolean continuous)
-
getEmissionMode
public RegularEmitter.EmissionMode getEmissionMode()
Gets current emission mode.- Returns:
- Current emission mode.
-
setEmissionMode
public void setEmissionMode(RegularEmitter.EmissionMode emissionMode)
Sets emission mode. Emission mode does not affect already emitted particles.- Parameters:
emissionMode- Emission mode to set.
-
isComplete
public boolean isComplete()
- Overrides:
isCompletein classEmitter
-
getPercentComplete
public float getPercentComplete()
-
set
public void set(RegularEmitter emitter)
-
copy
public ParticleControllerComponent copy()
- Specified by:
copyin classParticleControllerComponent
-
write
public void write(Json json)
- Specified by:
writein interfaceJson.Serializable- Overrides:
writein classEmitter
-
-