-
- All Implemented Interfaces:
-
de.chaffic.explosions.Explosion
public final class ProximityExplosion implements Explosion
Models proximity explosions.
-
-
Field Summary
Fields Modifier and Type Field Description private final ArrayList<Vec2>
linesToBodies
private final Integer
proximity
-
Constructor Summary
Constructors Constructor Description ProximityExplosion(Vec2 epicentre, Integer proximity)
-
Method Summary
Modifier and Type Method Description final ArrayList<Vec2>
getLinesToBodies()
final Integer
getProximity()
Unit
setEpicentre(Vec2 v)
Sets the epicentre to a different coordinate. final Vec2
getEpicentre()
Unit
update(ArrayList<TranslatableBody> bodiesToEvaluate)
Updates the arraylist to reevaluate what bodies are effected/within the proximity. final Unit
updateLinesToBody()
Updates the lines to body array for the debug drawer. Unit
applyBlastImpulse(Double blastPower)
Applies blast impulse to all effected bodies centre of mass. -
-
Method Detail
-
getLinesToBodies
final ArrayList<Vec2> getLinesToBodies()
-
getProximity
final Integer getProximity()
-
setEpicentre
Unit setEpicentre(Vec2 v)
Sets the epicentre to a different coordinate.
- Parameters:
v
- The vector position of the new epicentre.
-
getEpicentre
final Vec2 getEpicentre()
-
update
Unit update(ArrayList<TranslatableBody> bodiesToEvaluate)
Updates the arraylist to reevaluate what bodies are effected/within the proximity.
- Parameters:
bodiesToEvaluate
- Arraylist of bodies in the world to check.
-
updateLinesToBody
final Unit updateLinesToBody()
Updates the lines to body array for the debug drawer.
-
applyBlastImpulse
Unit applyBlastImpulse(Double blastPower)
Applies blast impulse to all effected bodies centre of mass.
- Parameters:
blastPower
- Blast magnitude.
-
-
-
-