Class ParticleSystem

    • Constructor Detail

      • ParticleSystem

        public ParticleSystem()
    • Method Detail

      • 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
      • 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 ttl
        max - 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 mass
        max - Maximum mass
      • setSizeRange

        public void setSizeRange​(float min,
                                 float max)
        Setting the range of new particles size
        Parameters:
        min - Minimum size
        max - 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 velocity
        max - 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 offset
        max - 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 count
        max - Maximum count