Package 

Class ParticleExplosion

  • All Implemented Interfaces:

    
    public final class ParticleExplosion
    
                        

    Models particle explosions.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final List<Body> particles
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final List<Body> getParticles() Getter to return the list of particles in the world.
      final Unit createParticles(Double size, Integer density, Integer radius, World world) Creates particles in the supplied world.
      final Unit applyBlastImpulse(Double blastPower) Applies a blast impulse to all particles created.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParticleExplosion

        ParticleExplosion(Vec2 epicentre, Integer noOfParticles, Double lifespan)
        Parameters:
        epicentre - Vector location of explosion epicenter.
        noOfParticles - Total number of particles the explosion has.
        lifespan - The life time of the particle.
    • Method Detail

      • createParticles

         final Unit createParticles(Double size, Integer density, Integer radius, World world)

        Creates particles in the supplied world.

        Parameters:
        size - The size of the particles.
        density - The density of the particles.
        radius - The distance away from the epicenter the particles are placed.
        world - The world the particles are created in.
      • applyBlastImpulse

         final Unit applyBlastImpulse(Double blastPower)

        Applies a blast impulse to all particles created.

        Parameters:
        blastPower - The impulse magnitude.