Class ParticleEmitter
- java.lang.Object
-
- be.yildizgames.module.graphic.particle.ParticleEmitter
-
public abstract class ParticleEmitter extends Object
Emitter for a particle system.- Author:
- Grégory Van den Borre
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParticleEmitter.EmitterTypePossible emitter types.
-
Constructor Summary
Constructors Modifier Constructor Description protectedParticleEmitter()Simple constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description floatgetAngle()be.yildizgames.common.geometry.Point3DgetDirection()floatgetDuration()be.yildizgames.module.color.ColorgetEndColor()floatgetLifeTime()floatgetMaxSpeed()floatgetMinSpeed()floatgetRate()floatgetRepeatDelay()be.yildizgames.module.color.ColorgetStartColor()voidsetAngle(float newAngle)Set the emitter angle.protected abstract voidsetAngleImpl(float angle)Set the angle in implementation.ParticleEmittersetDirection(be.yildizgames.common.geometry.Point3D direction)Change the emitter direction.protected abstract voidsetDirectionImpl(be.yildizgames.common.geometry.Point3D direction)Set the direction in implementation.ParticleEmittersetDuration(float newDuration)Set the emission duration, in second, minimum value is 0.protected abstract voidsetDurationImpl(float duration)Set the duration in implementation.ParticleEmittersetEndColor(be.yildizgames.module.color.Color end)Set the particle color when dying.protected abstract voidsetEndColorImpl(be.yildizgames.module.color.Color end)Set the end color in implementation.ParticleEmittersetLifeTime(float lifeTime)Set the time a particle live, in seconds.protected abstract voidsetLifeTimeImpl(float lifeTime)Set the life time in implementation.ParticleEmittersetMaxSpeed(float maxSpeed)Set the particle maximum speed.protected abstract voidsetMaxSpeedImpl(float maxSpeed)Set the maximum speed in implementation.ParticleEmittersetMinSpeed(float minSpeed)Set the particle minimum speed.protected abstract voidsetMinSpeedImpl(float minSpeed)Set the minimum speed in implementation.ParticleEmittersetRate(float newRate)Set the emission rate per second, minimum value is 0.protected abstract voidsetRateImpl(float rate)Set the rate in implementation.ParticleEmittersetRepeatDelay(float repeatDelay)Set the time to wait for the emitter restart when it has finished its job.protected abstract voidsetRepeatDelayImpl(float repeatDelay)Set the delay in implementation.ParticleEmittersetSpeed(float speed)Set a constant speed for the emission.ParticleEmittersetStartColor(be.yildizgames.module.color.Color start)Set the particle color when created.protected abstract voidsetStartColorImpl(be.yildizgames.module.color.Color start)Set the start color in implementation.ParticleEmitterstart()Restart the emission if it has been stopped by the stop method.ParticleEmitterstop()Stop the emission by setting the rate at 0, call start to restart it.
-
-
-
Method Detail
-
setAngle
public final void setAngle(float newAngle)
Set the emitter angle.- Parameters:
newAngle- New angle value in degree, must be between 0 and 180.
-
setRate
public final ParticleEmitter setRate(float newRate)
Set the emission rate per second, minimum value is 0.- Parameters:
newRate- Number of particles emitted per second.- Returns:
- This object for chaining.
-
setDuration
public final ParticleEmitter setDuration(float newDuration)
Set the emission duration, in second, minimum value is 0. 0 is infinite duration.- Parameters:
newDuration- New emission duration value.- Returns:
- This object for chaining.
-
setLifeTime
public final ParticleEmitter setLifeTime(float lifeTime)
Set the time a particle live, in seconds.- Parameters:
lifeTime- Particle life time.- Returns:
- This object for chaining.
-
setDirection
public final ParticleEmitter setDirection(be.yildizgames.common.geometry.Point3D direction)
Change the emitter direction.- Parameters:
direction- Emitter direction, it is a copy, modifying it from outside wont affect the emitter direction.- Returns:
- This object for chaining.
-
setMinSpeed
public final ParticleEmitter setMinSpeed(float minSpeed)
Set the particle minimum speed.- Parameters:
minSpeed- Particle minimum speed value.- Returns:
- This object for chaining.
-
setMaxSpeed
public final ParticleEmitter setMaxSpeed(float maxSpeed)
Set the particle maximum speed.- Parameters:
maxSpeed- Particle maximum speed value.- Returns:
- This object for chaining.
-
setStartColor
public final ParticleEmitter setStartColor(be.yildizgames.module.color.Color start)
Set the particle color when created.- Parameters:
start- Particle color at the beginning of their life.- Returns:
- This object for chaining.
-
setEndColor
public final ParticleEmitter setEndColor(be.yildizgames.module.color.Color end)
Set the particle color when dying.- Parameters:
end- Particle color at the end of their life.- Returns:
- This object for chaining.
-
setRepeatDelay
public final ParticleEmitter setRepeatDelay(float repeatDelay)
Set the time to wait for the emitter restart when it has finished its job.- Parameters:
repeatDelay- Time to wait.- Returns:
- This object for chaining.
-
stop
public final ParticleEmitter stop()
Stop the emission by setting the rate at 0, call start to restart it.- Returns:
- This object for chaining.
-
start
public final ParticleEmitter start()
Restart the emission if it has been stopped by the stop method.- Returns:
- This object for chaining.
-
setSpeed
public final ParticleEmitter setSpeed(float speed)
Set a constant speed for the emission.- Parameters:
speed- The particles speed.- Returns:
- This object for chaining.
-
getAngle
public float getAngle()
-
getRate
public float getRate()
-
getDuration
public float getDuration()
-
getLifeTime
public float getLifeTime()
-
getDirection
public be.yildizgames.common.geometry.Point3D getDirection()
-
getMinSpeed
public float getMinSpeed()
-
getMaxSpeed
public float getMaxSpeed()
-
getStartColor
public be.yildizgames.module.color.Color getStartColor()
-
getEndColor
public be.yildizgames.module.color.Color getEndColor()
-
getRepeatDelay
public float getRepeatDelay()
-
setAngleImpl
protected abstract void setAngleImpl(float angle)
Set the angle in implementation.- Parameters:
angle- New angle value.
-
setRepeatDelayImpl
protected abstract void setRepeatDelayImpl(float repeatDelay)
Set the delay in implementation.- Parameters:
repeatDelay- new Delay value.
-
setEndColorImpl
protected abstract void setEndColorImpl(be.yildizgames.module.color.Color end)
Set the end color in implementation.- Parameters:
end- New color value.
-
setMinSpeedImpl
protected abstract void setMinSpeedImpl(float minSpeed)
Set the minimum speed in implementation.- Parameters:
minSpeed- New speed value.
-
setMaxSpeedImpl
protected abstract void setMaxSpeedImpl(float maxSpeed)
Set the maximum speed in implementation.- Parameters:
maxSpeed- New speed value.
-
setStartColorImpl
protected abstract void setStartColorImpl(be.yildizgames.module.color.Color start)
Set the start color in implementation.- Parameters:
start- New start color.
-
setDirectionImpl
protected abstract void setDirectionImpl(be.yildizgames.common.geometry.Point3D direction)
Set the direction in implementation.- Parameters:
direction- New direction value.
-
setDurationImpl
protected abstract void setDurationImpl(float duration)
Set the duration in implementation.- Parameters:
duration- New duration value.
-
setRateImpl
protected abstract void setRateImpl(float rate)
Set the rate in implementation.- Parameters:
rate- New rate value.
-
setLifeTimeImpl
protected abstract void setLifeTimeImpl(float lifeTime)
Set the life time in implementation.- Parameters:
lifeTime- New lifeTime value.
-
-