Class ParticleSystem

  • All Implemented Interfaces:
    be.yildizgames.common.gameobject.Deletable, be.yildizgames.common.gameobject.Movable

    public abstract class ParticleSystem
    extends Object
    implements be.yildizgames.common.gameobject.Movable
    Particle system, contains the material use by the particles, their size, the quota and a list of emitters.
    Author:
    Grégory Van den Borre
    • Constructor Detail

      • ParticleSystem

        protected ParticleSystem()
        Protected constructor, only called from children.
    • Method Detail

      • addEmitter

        public final ParticleEmitter addEmitter​(ParticleEmitter.EmitterType type)
        Create a new particle emitter and add it to the list.
        Parameters:
        type - Type of the emitter.
        Returns:
        the newly built particle emitter.
      • addColorAffector

        public final ParticleColorAffector addColorAffector()
        Create a color affector.
        Returns:
        The newly created color affector.
      • addForceAffector

        public final ParticleForceAffector addForceAffector()
        Create a force affector.
        Returns:
        The newly created force affector.
      • addScaleAffector

        public final ParticleScaleAffector addScaleAffector()
        Create a scale affector.
        Returns:
        The newly created scale affector.
      • stop

        public final void stop()
        Stops all emitters.
      • start

        public final void start()
        Starts all emitters.
      • getMaterial

        public final Material getMaterial()
      • getQuota

        public final int getQuota()
      • createColorAffector

        protected abstract ParticleColorAffector createColorAffector()
        Create a color affector in implementation.
        Returns:
        The newly created color affector.
      • createForceAffector

        protected abstract ParticleForceAffector createForceAffector()
        Create a force affector in implementation.
        Returns:
        The newly created force affector.
      • createScaleAffector

        protected abstract ParticleScaleAffector createScaleAffector()
        Create a scale affector in implementation.
        Returns:
        The newly created scale affector.
      • keepInLocalSpace

        public abstract void keepInLocalSpace​(boolean keep)
        Parameters:
        keep - true To keep particles in local space.
      • setMaterial

        public final ParticleSystem setMaterial​(Material material)
        Set a material for the particles.
        Parameters:
        material - New material.
        Returns:
        This.
      • setQuota

        public final ParticleSystem setQuota​(int newQuota)
        Set the maximum number of particle at one time for this system.
        Parameters:
        newQuota - New quota value.
        Returns:
        This.
      • setSize

        public final ParticleSystem setSize​(float newWidth,
                                            float newHeight)
        Set the size for the particles.
        Parameters:
        newWidth - New width for the particles.
        newHeight - New height for the particles.
        Returns:
        This.
      • setSize

        public final ParticleSystem setSize​(be.yildizgames.common.geometry.Size2 size)
      • setOrientation

        public final ParticleSystem setOrientation​(ParticleSystem.Orientation newOrientation)
        Set the particle orientation type.
        Parameters:
        newOrientation - New orientation.
        Returns:
        This.
      • getEmitter

        public final ParticleEmitter getEmitter​(int index)
        Get the emitter for the given index.
        Parameters:
        index - Index of the emitter to retrieve.
        Returns:
        The Emitter matching the given index.
      • setOrientationImpl

        protected abstract void setOrientationImpl​(ParticleSystem.Orientation newOrientation)
        Set the particle orientation type in implementation.
        Parameters:
        newOrientation - New orientation value.
      • setSizeImpl

        protected abstract void setSizeImpl​(float width,
                                            float height)
        set the particle size in implementation.
        Parameters:
        width - New width value.
        height - New height value.
      • setMaterialImpl

        protected abstract void setMaterialImpl​(Material newMaterial)
        Set the material in implementation.
        Parameters:
        newMaterial - New material to use.
      • setQuotaImpl

        protected abstract void setQuotaImpl​(int newQuota)
        Set the quota value in implementation.
        Parameters:
        newQuota - New quota value.
      • setOriginImpl

        protected abstract void setOriginImpl​(ParticleSystem.Origin origin)
        Implementation specific to set the particle origin.
        Parameters:
        origin - Particle origin.
      • hide

        public abstract void hide()
      • show

        public abstract void show()
      • rotate

        public abstract void rotate​(float yaw,
                                    float pitch)