Package 

Class RaycastExplosion

  • All Implemented Interfaces:
    de.chaffic.explosions.Explosion

    
    public final class RaycastExplosion
     implements Explosion
                        

    Models raycast explosions.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final RayScatter getRayScatter()
      Unit setEpicentre(Vec2 v) Sets the epicentre to a different coordinate.
      Unit update(ArrayList<TranslatableBody> bodiesToEvaluate) Updates the arraylist to reevaluate what objects are effected/within the proximity.
      Unit applyBlastImpulse(Double blastPower) Applies a blast impulse to the effected bodies.
      • Methods inherited from class java.lang.Object

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

      • RaycastExplosion

        RaycastExplosion(Vec2 epicentre, Integer noOfRays, Double distance, ArrayList<TranslatableBody> worldBodies)
        Parameters:
        epicentre - The epicentre of the explosion.
        noOfRays - Number of projected rays.
        distance - Distance of projected rays.
        worldBodies - The world the rays effect and are projected in.
    • Method Detail

      • setEpicentre

         Unit setEpicentre(Vec2 v)

        Sets the epicentre to a different coordinate.

        Parameters:
        v - The vector position of the new epicentre.
      • update

         Unit update(ArrayList<TranslatableBody> bodiesToEvaluate)

        Updates the arraylist to reevaluate what objects are effected/within the proximity.

        Parameters:
        bodiesToEvaluate - Arraylist of bodies in the world to check.
      • applyBlastImpulse

         Unit applyBlastImpulse(Double blastPower)

        Applies a blast impulse to the effected bodies.

        Parameters:
        blastPower - The impulse magnitude.