Class ParticleSystem
- java.lang.Object
-
- de.coreengine.system.GameObject
-
- de.coreengine.system.gameObjects.particle.ParticleSystem
-
public class ParticleSystem extends GameObject
-
-
Field Summary
-
Fields inherited from class de.coreengine.system.GameObject
parent
-
-
Constructor Summary
Constructors Constructor Description ParticleSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.vecmath.Vector3fgetPosition()voidonUpdate()This method gets called every frame before the render method.voidsetGenerationCountRange(int min, int max)Setting the range of new particles count
How much particles should be generated, if generation speed expired?voidsetGenerationSpeed(float generationSpeed)voidsetMassRange(float min, float max)Setting the range of new particles mass
Gravity formula: mass * Physics.GRAVITY_OF_EARTH * FrameTimer.getTslf()voidsetParticleClass(Class<? extends MovingParticle> particleClass)Setting class to instantiate when creating new particles.voidsetSizeRange(float min, float max)Setting the range of new particles sizevoidsetSpawnOffsetRange(javax.vecmath.Vector3f min, javax.vecmath.Vector3f max)Setting the range of new particles spawn offset.
The offset will be added to the system positionvoidsetTexture(String texture)voidsetTtlRange(float min, float max)Setting the range of new particles time to live (ttl) in secondsvoidsetVelocityRange(javax.vecmath.Vector3f min, javax.vecmath.Vector3f max)Setting the range of new particles velocity (direction and speed).
The velocity will be added every frame to the position and then multiplied by particles damping.
Formula: position + (velocity * damping)-
Methods inherited from class de.coreengine.system.GameObject
addActionToPhysicWorld, addChild, addRigidBodyToWorld, getScene, onAdd, onInit, onLoad, onPauseUpdate, onRemove, onRender, onSave, onSyncronize, removeChild, setShouldRender, setShouldSyncronize, setShouldUpdate
-
-
-
-
Method Detail
-
onUpdate
public void onUpdate()
Description copied from class:GameObjectThis method gets called every frame before the render method. Here is place for the GameObject logic updates, e.g. input handling, physics, actions, ...- Overrides:
onUpdatein classGameObject
-
getPosition
public javax.vecmath.Vector3f getPosition()
- Returns:
- Read/writeable vector of the particle system center position
-
setTexture
public void setTexture(String texture)
- Parameters:
texture- TextureData for next generated particles
-
setTtlRange
public void setTtlRange(float min, float max)Setting the range of new particles time to live (ttl) in seconds- Parameters:
min- Minimum ttlmax- Maximum ttl
-
setMassRange
public void setMassRange(float min, float max)Setting the range of new particles mass
Gravity formula: mass * Physics.GRAVITY_OF_EARTH * FrameTimer.getTslf()- Parameters:
min- Minimum massmax- Maximum mass
-
setSizeRange
public void setSizeRange(float min, float max)Setting the range of new particles size- Parameters:
min- Minimum sizemax- Maximum size
-
setGenerationSpeed
public void setGenerationSpeed(float generationSpeed)
- Parameters:
generationSpeed- Speed to generate new particles in seconds
-
setParticleClass
public void setParticleClass(Class<? extends MovingParticle> particleClass)
Setting class to instantiate when creating new particles. The class must expand from the MovingParticle class and must have an empty constructor.- Parameters:
particleClass- Class to instantiate when creating new particles
-
setVelocityRange
public void setVelocityRange(javax.vecmath.Vector3f min, javax.vecmath.Vector3f max)Setting the range of new particles velocity (direction and speed).
The velocity will be added every frame to the position and then multiplied by particles damping.
Formula: position + (velocity * damping)- Parameters:
min- Minimum velocitymax- Maximum velocity
-
setSpawnOffsetRange
public void setSpawnOffsetRange(javax.vecmath.Vector3f min, javax.vecmath.Vector3f max)Setting the range of new particles spawn offset.
The offset will be added to the system position- Parameters:
min- Minimum offsetmax- Maximum offset
-
setGenerationCountRange
public void setGenerationCountRange(int min, int max)Setting the range of new particles count
How much particles should be generated, if generation speed expired?- Parameters:
min- Minimum countmax- Maximum count
-
-