| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
  |
  +--vrml.BaseNode
        |
        +--vrml.node.Script
              |
              +--mil.navy.nps.dis.EspduTransform
This Java class provides the communicatons interface between the EspduTransform Script node (in the VRML scene) and the rest of the DIS class library used for entities.
 
| 1 February 2000 | Olivier Doucy, Don Brutzman | added timestamp as an eventOut | 
| 3 September 99 | Don Brutzman | added rtpEnabled boolean flag | 
| 19 June 99 | Don Brutzman | Removed articulationParameterValue15 to stay within VRML browser conformance limit of 25 eventOuts | 
| 1 June 99 | Don Brutzman, Quay Jones | Added detonated and detonateTime | 
| 18 May 99 | Don Brutzman, Quay Jones | Changed fired to fired1 and fired2 in VRML scene to enable primary and secondary weapons. | 
| 6 Apr 99 | Don Brutzman | Adding ArticulatedParameter eventOuts, shutdown, various thread/trace fixes. Ignore received PDUs when sending. Changed MFVec3f LineOfFirePointArray code to SFVec3f's munitionStartPoint & munitionEndPoint for run-time reliability. | 
| 20 Feb 99, 14 Mar 99 | Don Brutzman, Don McGregor, Bill Bohman | Added collided, active, fired, multicastRelayHost, multicastRelayPort. Also added FirePdu geometry to show munitions. Incorporated entityDispatcher.checkForTrafficAndFallBackToTunnel (...) for automatic unicast connectivity when multicast is not locally available. | 
| 6 Feb 99 | Don Brutzman | Move VRML EspduTransformPROTO to same directory as dis package Fix write capability | 
| 02 Dec 98 | Scott Heller | Added smoothing. See SmoothingDesign.pdf | 
| 25 Oct 98 | Don Brutzman | Javadoc updates for jdk1.2b4 Restructure classes, move EspduTransform to dis package | 
| 12 Feb 98 | Don Brutzman | changes for documentation templates + complements in documentation | 
| 5 Feb 98 | Don McGregor | changes for multiple entities, using EntityDispatcher | 
| 1 Aug 97 | Don Brutzman | New | 
          DIS                 VRML
      -Z entity up         Y entity up
           ^                   ^
           |                   |
           |                   |
           |                   |
           +------> X          +-------> X    nose of entity body
          /                   /
         /                   /
        /                   /
       Y                   Z
         right-hand side
         of entity body
  Rotation angle axes (right-hand rule applies):
           DIS        VRML      Angle of rotation
  Roll      X          X         phi
  Pitch     Y          Z        theta
  Yaw       Z         -Y         psi
EntityDispatcher, 
BehaviorStreamBuffer, 
RunningAverage, 
CollisionPdu, 
DetonationPdu, 
EntityStatePdu, 
FirePdu| Field Summary | |
| protected  SFInt32 | articulationParameterCount | 
| protected  SFFloat | articulationParameterValue0 | 
| protected  SFFloat | articulationParameterValue1 | 
| protected  SFFloat | articulationParameterValue10 | 
| protected  SFFloat | articulationParameterValue11 | 
| protected  SFFloat | articulationParameterValue12 | 
| protected  SFFloat | articulationParameterValue13 | 
| protected  SFFloat | articulationParameterValue14 | 
| protected  SFFloat | articulationParameterValue2 | 
| protected  SFFloat | articulationParameterValue3 | 
| protected  SFFloat | articulationParameterValue4 | 
| protected  SFFloat | articulationParameterValue5 | 
| protected  SFFloat | articulationParameterValue6 | 
| protected  SFFloat | articulationParameterValue7 | 
| protected  SFFloat | articulationParameterValue8 | 
| protected  SFFloat | articulationParameterValue9 | 
| protected  Browser | browser | 
| protected  boolean | DEBUGWhen DEBUG is true, console text messages trace the internals of script operation. | 
| protected  float | DR_LIMIT | 
| protected static EntityDispatcher | entityDispatcher | 
| protected static java.lang.Thread | entityDispatcherThread | 
| protected  EntityStatePdu | espdu | 
| protected  Timer | localFireTimer1 | 
| protected  Timer | localFireTimer2 | 
| protected  int | MAX_ARTICULATION_PARAMETERS | 
| protected  SFVec3f | munitionEndPointmunitionEndPoint is node's field (hook to VRML scene) computed from FirePdu matching detonation point of munition. | 
| protected  SFVec3f | munitionStartPointmunitionStartPoint is node's field (hook to VRML scene) obtained from FirePdu matching launch point of munition. | 
| protected  ProtocolDataUnit | pdu | 
| protected  float | SMOOTH_LIMITwhat portion of an averageupdateTime should we smooth for? For example 0.5 will cause the the smoothing algorithm to reaquire the most recent DR track with in half the PDU averageUpdateTime. | 
| protected  SecurityStrategy | strategyGet platform-specific security strategy | 
| Constructor Summary | |
| EspduTransform()Constructor that includes setting security permissions since Internet Explorer will throw a com.ms.security.SecurityExceptionEx if initialize () is called from an external source (i.e. | |
| Method Summary | |
| protected  void | debug(java.lang.String pDiagnostic)Debugging output routine. | 
|  boolean | getDEBUG()Access DEBUG trace variable. | 
|  boolean | getDoNotSmooth()Get Smoothing flag. | 
|  EntityID | getEntityIDObject()gets the entity ID, which is the unique triplet that identifies the entity, consisting of (site, application, entity) ID numbers. | 
|  java.lang.String | getName()Simple name for the ESPDU is the marking field. | 
|  void | initialize()initialize () gets needed information for setup from the invoking scene entity and VRML browser, and also prints the values if DEBUG is true. | 
| static void | main(java.lang.String[] args)main method was originally intended to be used for debugging, to determine if EntityDispatcher really is sending things to us. | 
|  void | processEvent(Event event)This is the main method, called by the VRML scene with periodicity readInterval (or writeInterval). | 
|  void | receivePDU(ProtocolDataUnit pPDU)receivePDU () is called by the entity dispatcher when a PDU for the node arrives from the network. | 
|  void | setDEBUG(boolean pDEBUG)Modify DEBUG trace variable. | 
|  void | setDoNotSmooth(boolean pDoNotSmooth)Set Smoothing flag. | 
|  void | setEntityIDObject(EntityID pEIO)resets the entity ID triplet = (site, application, entity) ID numbers. | 
|  void | shutdown()shutdown() is called when VRML scene exits. | 
|  void | startEntityDispatcherThread()Simple method to launch thread because Microsoft puts security restraints on everything. | 
|  boolean | toggleSmoothing()Turn Smoothing on or off. | 
| protected  void | trace(java.lang.String pDiagnostic)Guaranteed trace output routine. | 
| Methods inherited from class vrml.node.Script | 
| eventsProcessed, getEventIn, getEventOut, getField, processEvents, toString | 
| Methods inherited from class vrml.BaseNode | 
| getBrowser, getType | 
| Methods inherited from class java.lang.Object | 
|  | 
| Field Detail | 
protected static EntityDispatcher entityDispatcher
protected static java.lang.Thread entityDispatcherThread
protected Browser browser
protected ProtocolDataUnit pdu
protected EntityStatePdu espdu
protected final int MAX_ARTICULATION_PARAMETERS
protected SFInt32 articulationParameterCount
protected SFFloat articulationParameterValue0
protected SFFloat articulationParameterValue1
protected SFFloat articulationParameterValue2
protected SFFloat articulationParameterValue3
protected SFFloat articulationParameterValue4
protected SFFloat articulationParameterValue5
protected SFFloat articulationParameterValue6
protected SFFloat articulationParameterValue7
protected SFFloat articulationParameterValue8
protected SFFloat articulationParameterValue9
protected SFFloat articulationParameterValue10
protected SFFloat articulationParameterValue11
protected SFFloat articulationParameterValue12
protected SFFloat articulationParameterValue13
protected SFFloat articulationParameterValue14
protected final float SMOOTH_LIMIT
protected final float DR_LIMIT
protected SFVec3f munitionStartPoint
protected SFVec3f munitionEndPoint
protected SecurityStrategy strategy
protected boolean DEBUG
protected Timer localFireTimer1
protected Timer localFireTimer2
| Constructor Detail | 
public EspduTransform()
| Method Detail | 
public boolean toggleSmoothing()
public boolean getDoNotSmooth()
public void setDoNotSmooth(boolean pDoNotSmooth)
public boolean getDEBUG()
public void setDEBUG(boolean pDEBUG)
protected void debug(java.lang.String pDiagnostic)
protected void trace(java.lang.String pDiagnostic)
 Can't be static or all entities look the same.
public java.lang.String getName()
public void initialize()
initialize in class Scriptpublic void startEntityDispatcherThread()
EntityDispatcher is static; only one copy is shared between all instances of the EspduTransform. If it's null the first time through here, create and thread it.
This is synchronized, since we may have N EspduTransforms attempting to instantiate themselves at once, all accessing this shared class variable. The synchronization prevents multiple access.
This is actually some magic code. Java keeps several mutex locks around, one for every instance of a class and one for the class itself. We can't sychronize on entityDispatcher because that's null the first time through, which will fail silently. We also can't use a java primitive type. So I created a completely arbitrary instance of an object as a class variable, and synchronize on that. It's a standin for the EntityDispatcher in a way.
public void receivePDU(ProtocolDataUnit pPDU)
receivePDU in interface PduSubscriberpublic EntityID getEntityIDObject()
public void setEntityIDObject(EntityID pEIO)
public void processEvent(Event event)
processEvent in class Scriptpublic void shutdown()
shutdown in class Scriptpublic static void main(java.lang.String[] args)
Sigh. We can't actually use main(), since that's declared in Script, and we can't override static methods. So as an alternative we rename this something else and then call it from another class that can have a main method. Reverify that this block of code is correct if you do resurrect it.
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||