Class MovingParticle

    • Constructor Detail

      • MovingParticle

        public MovingParticle()
    • 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 mass
        velocity - Particles velocity/move direction
        ttl - 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 class GameObject
      • 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 class GameObject