public class Rocket extends Launchable implements Directable
Features are:
Modifier and Type | Field and Description |
---|---|
static double |
ACCELERATION
acceleration: m/s^2
|
static double |
DAMAGE_FRONT |
static double |
DAMAGE_REAR |
static double |
DAMAGE_SIDE |
static double |
DETONATION_DISTANCE |
static double |
DETONATION_INNER_RADIUS
Effective explosion radius in [m] with max.
|
static double |
DETONATION_MAX_DAMAGE
Maximum explosion damage (shrinks with distance)
|
static double |
DETONATION_MAX_FORCE
Maximum explosion force dealt to Panzer (shrinks with distance)
|
static double |
DETONATION_OUTER_RADIUS
explosion radius for decreasing effect in [m]
|
static int |
EXPLOSION_SIZE |
static double |
FORCE_HIT |
static double |
FRICTION
slowdown: 1/s
|
protected boolean |
isDetonating |
static double |
LIFE_TIME |
static double |
MUZZLE_VELOCITY |
static double |
RELOADTIME |
protected SmokeGenerator |
smokeGenerator |
protected Angle |
targetBearing |
age, creationTime, orientation, ownerID, pos, timeInFrame, velocity
Constructor and Description |
---|
Rocket(double creationTime,
Vector pos,
Angle orientation,
Vector velocity,
Angle targetBearing,
int ownerID) |
Modifier and Type | Method and Description |
---|---|
void |
applyMotionTarget(MotionTargetLaunchable target)
Applies a motion target, changing the state of the
Projectile . |
MotionTargetLaunchable |
calculateMotion(SimulationState state,
double elapsedTime)
Calculates a target of movement.
|
Rocket |
clone() |
double |
DAMAGE_FRONT()
Damage the Launchable exerts to a Panzer if hitting a given side
directly.
|
double |
DAMAGE_REAR()
Damage the Launchable exerts to a Panzer if hitting a given side
directly.
|
double |
DAMAGE_SIDE()
Damage the Launchable exerts to a Panzer if hitting a given side
directly.
|
void |
detonate()
Is set on collision with an object
(if the Launchable participates in collisions).
|
Collision |
discoverCollision(MotionTargetLaunchable ownTgt,
MotionTargetPanzer panzerTgt)
Constructs the Droppable's individual collision with the specified panzer
|
void |
draw(javax.media.opengl.GL gl,
ArenaController arena)
Draws the object on the given arena.
|
int |
EXPLOSION_SIZE()
The size of explosion generated [1..20].
|
double |
FORCE_HIT()
The impulse induced on target on hit.
|
Vector |
getDestination() |
Vector |
getPosition() |
Angle |
getTargetBearing() |
boolean |
isDetonating()
finds out whether this Directable is to be seen as destroyed
|
double |
LAUNCHER_REFRACTORY_PERIOD()
Time until launcher gear can be reactivated after drop.
|
double |
LIFE_TIME()
Life time [s] of this Launchable.
|
double |
MAX_VELOCITY()
Estimated maximum velocity of this Launchable [m/s].
|
double |
MUZZLE_VELOCITY()
Initial velocity of this Launchable at creation time [m/s].
|
void |
setDestination(Vector lockOnPos)
Sets the
Directable s destination |
void |
setTargetBearing(Angle bearing)
Sets the
Directable s target orientation |
getAge, getOrientation, getOwnerID, getPos, getVelocity
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOwnerID
public static final double ACCELERATION
public static final double DAMAGE_FRONT
public static final double DAMAGE_REAR
public static final double DAMAGE_SIDE
public static final double DETONATION_DISTANCE
public static final double DETONATION_INNER_RADIUS
public static final double DETONATION_MAX_DAMAGE
public static final double DETONATION_MAX_FORCE
public static final double DETONATION_OUTER_RADIUS
public static final int EXPLOSION_SIZE
public static final double FORCE_HIT
public static final double FRICTION
This value is subtracted from the current velocity
protected boolean isDetonating
public static final double LIFE_TIME
public static final double MUZZLE_VELOCITY
public static final double RELOADTIME
protected final SmokeGenerator smokeGenerator
protected Angle targetBearing
public void applyMotionTarget(MotionTargetLaunchable target)
Launchable
Projectile
.
May be overridden (as to generate smoke). A call to super is obligatory.
applyMotionTarget
in class Launchable
target
- state to setpublic MotionTargetLaunchable calculateMotion(SimulationState state, double elapsedTime)
Launchable
May be overridden to change the velocity. A call to super is obligatory at the end of the overriding method.
calculateMotion
in class Launchable
elapsedTime
- >= 0MotionTargetProjectile
representing the position
after the given elapsed timeInFramepublic Rocket clone()
clone
in class Launchable
public double DAMAGE_FRONT()
Launchable
Every descendant may have its own value.
DAMAGE_FRONT
in class Launchable
public double DAMAGE_REAR()
Launchable
Every descendant may have its own value.
DAMAGE_REAR
in class Launchable
public double DAMAGE_SIDE()
Launchable
Every descendant may have its own value.
DAMAGE_SIDE
in class Launchable
public void detonate()
Launchable
Necessity: Directables need to store the information that they are removed from the simulation, so that the Panzer they originate from can remove its uplink.
detonate
in interface Directable
detonate
in class Launchable
public Collision discoverCollision(MotionTargetLaunchable ownTgt, MotionTargetPanzer panzerTgt)
Launchable
discoverCollision
in class Launchable
public void draw(javax.media.opengl.GL gl, ArenaController arena)
Launchable
draw
in class Launchable
public int EXPLOSION_SIZE()
Launchable
Every descendant may have its own value.
EXPLOSION_SIZE
in class Launchable
public double FORCE_HIT()
Launchable
Every descendant may have its own value.
FORCE_HIT
in class Launchable
public Vector getDestination()
getDestination
in interface Directable
public Vector getPosition()
getPosition
in interface Directable
public Angle getTargetBearing()
getTargetBearing
in interface Directable
public boolean isDetonating()
Directable
isDetonating
in interface Directable
public double LAUNCHER_REFRACTORY_PERIOD()
Launchable
Every descendant may have its own value.
LAUNCHER_REFRACTORY_PERIOD
in class Launchable
public double LIFE_TIME()
Launchable
Every descendant may have its own value.
LIFE_TIME
in class Launchable
public double MAX_VELOCITY()
Launchable
Every descendant may have its own value.
MAX_VELOCITY
in class Launchable
public double MUZZLE_VELOCITY()
Launchable
Every descendant may have its own value.
MUZZLE_VELOCITY
in class Launchable
public void setDestination(Vector lockOnPos)
Directable
Directable
s destinationsetDestination
in interface Directable
public void setTargetBearing(Angle bearing)
Directable
Directable
s target orientationsetTargetBearing
in interface Directable