public abstract class Launchable
extends java.lang.Object
implements java.io.Serializable
Launchables move along the direction they were launched. They are moved internally by motion targets. They may collide with panzers.
Relevant aspects:
Missile
)
Projectile
)
Missile
)
Modifier and Type | Field and Description |
---|---|
protected double |
age
age in seconds since creation
|
protected double |
creationTime |
protected Angle |
orientation |
protected int |
ownerID |
protected Vector |
pos |
protected double |
timeInFrame |
protected Vector |
velocity |
Constructor and Description |
---|
Launchable(double creationTime,
Vector pos,
Angle orientation,
Vector velocity,
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.
|
abstract Launchable |
clone() |
abstract double |
DAMAGE_FRONT()
Damage the Launchable exerts to a Panzer if hitting a given side
directly.
|
abstract double |
DAMAGE_REAR()
Damage the Launchable exerts to a Panzer if hitting a given side
directly.
|
abstract double |
DAMAGE_SIDE()
Damage the Launchable exerts to a Panzer if hitting a given side
directly.
|
abstract void |
detonate()
Is set on collision with an object
(if the Launchable participates in collisions).
|
abstract Collision |
discoverCollision(MotionTargetLaunchable ownTgt,
MotionTargetPanzer panzerTgt)
Constructs the Droppable's individual collision with the specified panzer
|
abstract void |
draw(javax.media.opengl.GL gl,
ArenaController arena)
Draws the object on the given arena.
|
abstract int |
EXPLOSION_SIZE()
The size of explosion generated [1..20].
|
abstract double |
FORCE_HIT()
The impulse induced on target on hit.
|
double |
getAge() |
Angle |
getOrientation() |
int |
getOwnerID() |
Vector |
getPos() |
Vector |
getVelocity() |
abstract double |
LAUNCHER_REFRACTORY_PERIOD()
Time until launcher gear can be reactivated after drop.
|
abstract double |
LIFE_TIME()
Life time [s] of this Launchable.
|
abstract double |
MAX_VELOCITY()
Estimated maximum velocity of this Launchable [m/s].
|
abstract double |
MUZZLE_VELOCITY()
Initial velocity of this Launchable at creation time [m/s].
|
protected double age
protected final double creationTime
protected Angle orientation
protected int ownerID
protected Vector pos
protected transient double timeInFrame
protected Vector velocity
public void applyMotionTarget(MotionTargetLaunchable target)
Projectile
.
May be overridden (as to generate smoke). A call to super is obligatory.
target
- state to setpublic MotionTargetLaunchable calculateMotion(SimulationState state, double elapsedTime)
May be overridden to change the velocity. A call to super is obligatory at the end of the overriding method.
state
- elapsedTime
- >= 0MotionTargetProjectile
representing the position
after the given elapsed timeInFramepublic abstract Launchable clone()
clone
in class java.lang.Object
public abstract double DAMAGE_FRONT()
Every descendant may have its own value.
public abstract double DAMAGE_REAR()
Every descendant may have its own value.
public abstract double DAMAGE_SIDE()
Every descendant may have its own value.
public abstract void detonate()
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.
public abstract Collision discoverCollision(MotionTargetLaunchable ownTgt, MotionTargetPanzer panzerTgt)
ownTgt
- public abstract void draw(javax.media.opengl.GL gl, ArenaController arena)
public abstract int EXPLOSION_SIZE()
Every descendant may have its own value.
public abstract double FORCE_HIT()
Every descendant may have its own value.
public final double getAge()
public final Angle getOrientation()
public final int getOwnerID()
public final Vector getPos()
public final Vector getVelocity()
public abstract double LAUNCHER_REFRACTORY_PERIOD()
Every descendant may have its own value.
public abstract double LIFE_TIME()
Every descendant may have its own value.
public abstract double MAX_VELOCITY()
Every descendant may have its own value.
public abstract double MUZZLE_VELOCITY()
Every descendant may have its own value.