demo.helicopter
Class TankActionInterpreter
java.lang.Object
java.lang.Thread
demo.helicopter.TankActionInterpreter
- All Implemented Interfaces:
- java.lang.Runnable
- public class TankActionInterpreter
- extends java.lang.Thread
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary |
TankActionInterpreter(java.lang.String ipAddr,
int portNum,
int timeToLive,
short siteNum,
short appNum,
short idNum,
java.lang.String marking,
boolean rtpHeaderEnabled,
TankControlPanel panel)
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TankActionInterpreter
public TankActionInterpreter(java.lang.String ipAddr,
int portNum,
int timeToLive,
short siteNum,
short appNum,
short idNum,
java.lang.String marking,
boolean rtpHeaderEnabled,
TankControlPanel panel)
run
public void run()
setIsCollided
public void setIsCollided(boolean setValue)
getIsCollided
public boolean getIsCollided()
setDriving
public void setDriving(boolean setValue)
getDriving
public boolean getDriving()
setSpeed
public void setSpeed(float spd)
getSpeed
public double getSpeed()
setTurnAngle
public void setTurnAngle(float turnAngle)
getEspdu
public EntityStatePdu getEspdu()
startDriving
public void startDriving()
checkForGroundCollision
public void checkForGroundCollision()
stopRun
public void stopRun()
checkForGunElevate
public void checkForGunElevate()
checkForTurretTurn
public void checkForTurretTurn()
checkForReload
public void checkForReload()
selfDestruct
public void selfDestruct()
getFrameHeaderInfo
public java.lang.String getFrameHeaderInfo()
reset
public void reset()
sendFirePdu
public void sendFirePdu()
sendMainFirePdu
public void sendMainFirePdu()
brake
public void brake()
leftTurretTurn
public void leftTurretTurn()
rightTurretTurn
public void rightTurretTurn()
elevateGun
public void elevateGun()
depressGun
public void depressGun()
collectFirePdus
public void collectFirePdus()
checkFirePdu
public void checkFirePdu(FirePdu shot)
- Function Works as Follows :
1. Get X, Y, Z components of launch velocity.
2. Calculate launch velocity vector.
3. Get X, Y, Z location of the launch.
4. Get X, Y, Z velocity componets of this tank at launch.
5. Get X, Y, Z location of this tank at launch.
6. Calculate the distance between this tank and the launch point.
7. Calculate the relative velocity of the fire with respect to this tank.
8. Find the time to fly for this distance.
9. Find the actual X, Y, Z location for the fire after "time to fly".
10. Calculate the distance between this tank and the new location of the fire after "time
to fly.
11. If the distance is equal to or less than HIT_RADIUS a hit has occured.
- Parameters:
shot
- Fire PDU that is being checked.
checkCollision
public void checkCollision(EntityStatePdu entityPdu)