-
- All Implemented Interfaces:
-
de.chaffic.explosions.Explosion
public final class RaycastExplosion implements Explosion
Models raycast explosions.
-
-
Field Summary
Fields Modifier and Type Field Description private final RayScatter
rayScatter
-
Constructor Summary
Constructors Constructor Description RaycastExplosion(Vec2 epicentre, Integer noOfRays, Double distance, ArrayList<TranslatableBody> worldBodies)
-
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. -
-
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
-
getRayScatter
final RayScatter getRayScatter()
-
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.
-
-
-
-