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 Particle
getParticle()
void
onRender()
In this method the GameObject gets rendered onto the screen (if it has an graphical representation).void
onUpdate()
This method gets called every frame before the render method.void
setDamping(float damping)
Setting damping of the particle.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()boolean
shouldDie()
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:GameObject
This method gets called every frame before the render method. Here is place for the GameObject logic updates, e.g. input handling, physics, actions, ...- Overrides:
onUpdate
in 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:GameObject
In this method the GameObject gets rendered onto the screen (if it has an graphical representation). Its primary used for MasterRenderer calls.- Overrides:
onRender
in classGameObject
-
-