demo.helicopter
Class HumanActionInterpreterSingle

java.lang.Object
  extended byjava.lang.Thread
      extended bydemo.helicopter.HumanActionInterpreterSingle
All Implemented Interfaces:
java.lang.Runnable

public class HumanActionInterpreterSingle
extends java.lang.Thread


Field Summary
 double JUMP
          Behavior code.
 double KNEEL
          Behavior code.
 double NOTHING
          Behavior code.
 double RUN
          Behavior code.
 double STAND
          Behavior code.
 double verticalOffset
          Meters above local terrain for entity's geometric center.
 double WALK
          Behavior code.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HumanActionInterpreterSingle(java.lang.String ipAddr, int portNum, int timeToLive, short siteNum, short appNum, short idNum, java.lang.String marking, boolean rtpHeaderEnabled, HumanControlPanel panel)
           
 
Method Summary
 void brake()
           
 void checkCollision(EntityStatePdu entityPdu)
           
 void checkFirePdu(FirePdu shot)
          Function Works as Follows : 1.
 void checkForGroundCollision()
           
 void checkForGunElevate()
           
 void checkForReload()
           
 void checkForTurretTurn()
           
 void collectFirePdus()
           
 void depressGun()
           
 void elevateGun()
           
 boolean getDriving()
           
 EntityStatePdu getEspdu()
           
 java.lang.String getFrameHeaderInfo()
           
 boolean getIsCollided()
           
 double getSpeed()
           
 void kneel()
           
 void leftTurretTurn()
           
 void reset()
           
 void rightTurretTurn()
           
 void run()
           
 void selfDestruct()
           
 void sendFirePdu()
           
 void setDriving(boolean setValue)
           
 void setIsCollided(boolean setValue)
           
 void setSpeed(float spd)
           
 void setTurnAngle(float turnAngle)
           
 void startDriving()
           
 void stopRun()
           
 
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
 

Field Detail

verticalOffset

public double verticalOffset
Meters above local terrain for entity's geometric center.


NOTHING

public final double NOTHING
Behavior code.

See Also:
Constant Field Values

STAND

public final double STAND
Behavior code.

See Also:
Constant Field Values

WALK

public final double WALK
Behavior code.

See Also:
Constant Field Values

RUN

public final double RUN
Behavior code.

See Also:
Constant Field Values

JUMP

public final double JUMP
Behavior code.

See Also:
Constant Field Values

KNEEL

public final double KNEEL
Behavior code.

See Also:
Constant Field Values
Constructor Detail

HumanActionInterpreterSingle

public HumanActionInterpreterSingle(java.lang.String ipAddr,
                                    int portNum,
                                    int timeToLive,
                                    short siteNum,
                                    short appNum,
                                    short idNum,
                                    java.lang.String marking,
                                    boolean rtpHeaderEnabled,
                                    HumanControlPanel panel)
Method Detail

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()

brake

public void brake()

kneel

public void kneel()

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)