Class MovingParticle
- java.lang.Object
-
- de.coreengine.system.GameObject
-
- de.coreengine.system.gameObjects.particle.MovingParticle
-
public class MovingParticle extends GameObject
-
-
Field Summary
-
Fields inherited from class de.coreengine.system.GameObject
parent
-
-
Constructor Summary
Constructors Constructor Description MovingParticle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParticlegetParticle()voidonRender()In this method the GameObject gets rendered onto the screen (if it has an graphical representation).voidonUpdate()This method gets called every frame before the render method.voidsetDamping(float damping)Setting damping of the particle.voidsetup(float mass, javax.vecmath.Vector3f velocity, float ttl)Setting up particle behavior and physics
Gravity formula: mass * Physics.GRAVITY_OF_EARTH * FrameTimer.getTslf()booleanshouldDie()If this method return true, the ttl of the particle is expired and it should be removed from the scene-
Methods inherited from class de.coreengine.system.GameObject
addActionToPhysicWorld, addChild, addRigidBodyToWorld, getScene, onAdd, onInit, onLoad, onPauseUpdate, onRemove, onSave, onSyncronize, removeChild, setShouldRender, setShouldSyncronize, setShouldUpdate
-
-
-
-
Method Detail
-
getParticle
public Particle getParticle()
- Returns:
- Read/Writeable particle renderable, that represents the particle in the scene
-
setup
public void setup(float mass, javax.vecmath.Vector3f velocity, float ttl)Setting up particle behavior and physics
Gravity formula: mass * Physics.GRAVITY_OF_EARTH * FrameTimer.getTslf()- Parameters:
mass- Particles massvelocity- Particles velocity/move directionttl- Particles time to live (in seconds)
-
setDamping
public void setDamping(float damping)
Setting damping of the particle. Will be multiplied every frame to the velocity.- Parameters:
damping- New damping factor
-
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
-
shouldDie
public boolean shouldDie()
If this method return true, the ttl of the particle is expired and it should be removed from the scene- Returns:
- Should the particle be removed
-
onRender
public void onRender()
Description copied from class:GameObjectIn this method the GameObject gets rendered onto the screen (if it has an graphical representation). Its primary used for MasterRenderer calls.- Overrides:
onRenderin classGameObject
-
-