Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class mil.navy.nps.javaViaScriptNode.EspduTransform

java.lang.Object
  |
  +--vrml.BaseNode
        |
        +--vrml.node.Script
              |
              +--mil.navy.nps.javaViaScriptNode.EspduTransform

public class EspduTransform
extends vrml.node.Script
Version:
1.0
Author:
Don Brutzman (http://www.stl.nps.navy.mil/~brutzman)
Location:
http://www.stl.nps.navy.mil/dis-java-vrml/mil/navy/nps/JavaViaScriptNode/EspduReadTransform.java
Summary:
PROTO providing DIS ESPDU read/write interface for a VRML entity.
Explanation
This Java class provides the interface between the EspduReadTransform Script node in the VRML scene, and the DIS class library.
History:
19May98 /Don Brutzman /New, combines previous read & write versions into a single class.
Associated VRML Files:
EspduTransformPROTO.wrl (EXTERNPROTO)
EspduTransformExample.wrl (example use)
Debugging:
DEBUG=false turns off debug/trace messages
INITIALIZE_DEBUG=true turns on debug/trace messages during initialize ()
System.out.println text output appears either on the browswer's Java console or VRML console
Unfinished business:
Need to verify PDU identity and match that given in scene
Need to verify Euler angle order & quaternion conversion
Is there another callback alternative to trigger processEvent originating from DIS rather than VRML?
Is VRML timeSensor processEvent trigger best? Likely so, since it ensures VRML scene redraw doesn't undergo starvation, and it also prevents "simultaneous" data access/modification of Transform node values by VRML browser/Java script.
Exercise clock synchronization or relative local time? dead reckon interval dt is currently estimated by accumulating frame rate (redraw time) during each loop.
Add algorithms for dead-reckoning and smoothing.
Ensure all exposedField parameters can be reset during operation.
See Also:
mil.navy.nps.dis.SimulationManager, mil.navy.nps.dis.EntityStatePdu

Field Summary
float[] angDt
           
float[] ang
           
static boolean DEBUG
          When DEBUG is true, System.out.println text messages trace the internals of script operation.
float[] drAngDt
           
float[] drAng
           
float[] drPosDt
           
float[] drPos
           
static float[] initAngDt
           
static float[] initAng
           
static boolean INITIALIZE_DEBUG
           
static float[] initPosDt
           
static float[] initPos
           
float[] posDt
           
float[] pos
           
static mil.navy.nps.dis.SimulationManager simulationManager
           
Quaternion tmpQuat
           
 
Fields inherited from class vrml.node.Script
loader
 
Method Summary
void addPDU(mil.navy.nps.dis.ProtocolDataUnit pPDU)
          addPDU() is called by the simulation manager when a PDU for the node arrives.
static void debug(java.lang.String pDiagnostic)
          Debugging output.
mil.navy.nps.dis.EntityID getEntityIDObject()
          gets the entity ID, which is the unique triplet that identifies the entity.
java.lang.String getName()
           
void initialize()
          For a good initialize () discussion, see example 3.15, pp. 95-97, "Java for 3D and VRML Worlds," Lea/Matsuda/Miyashita, New Riders Press, 1996.
void processEvent(vrml.Event event)
           
void processEvents(int count, vrml.Event[] events)
          Ignore all but latest event so only one set of PDU network reads and one set of dead-reckon calculations occur.
void processWriteEvent(vrml.Event event)
           
 
Methods inherited from class vrml.node.Script
, eventsProcessed, getEventIn, getEventOut, getField, initialize, mainloadClass, main, objectReady, processEvent, processEvents, shutdown, toString
 
Methods inherited from class vrml.BaseNode
getBrowser, getType
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
When DEBUG is true, System.out.println text messages trace the internals of script operation. Text output appears in the Java Console (CosmoPlayer browser) or in the VRML console (WorldView browser)

INITIALIZE_DEBUG

public static boolean INITIALIZE_DEBUG

initPos

static final float[] initPos

initPosDt

static final float[] initPosDt

initAng

static final float[] initAng

initAngDt

static final float[] initAngDt

tmpQuat

Quaternion tmpQuat

pos

float[] pos

posDt

float[] posDt

ang

float[] ang

angDt

float[] angDt

drPos

float[] drPos

drPosDt

float[] drPosDt

drAng

float[] drAng

drAngDt

float[] drAngDt

simulationManager

public static mil.navy.nps.dis.SimulationManager simulationManager
Method Detail

debug

protected static void debug(java.lang.String pDiagnostic)
Debugging output. Pass in a string, and it gets printed out on the console. You can pass in strings such as "foo " + "bar"

getName

public java.lang.String getName()

initialize

public void initialize()
For a good initialize () discussion, see example 3.15, pp. 95-97, "Java for 3D and VRML Worlds," Lea/Matsuda/Miyashita, New Riders Press, 1996.
Overrides:
initialize in class vrml.node.Script

processEvents

public void processEvents(int count,
                          vrml.Event[] events)
Ignore all but latest event so only one set of PDU network reads and one set of dead-reckon calculations occur. This allows frequent updating triggered by the script eventIn. This might need to be made smarter someday.
Overrides:
processEvents in class vrml.node.Script

addPDU

public void addPDU(mil.navy.nps.dis.ProtocolDataUnit pPDU)
addPDU() is called by the simulation manager when a PDU for the node arrives. The PDU is added to the list of PDUs that have already arrived, and is later processed when processEvent() is called.

getEntityIDObject

public mil.navy.nps.dis.EntityID getEntityIDObject()
gets the entity ID, which is the unique triplet that identifies the entity. The triplet is (site, application, ID). This is set in the VRML node, and retrieved for use here.

processEvent

public void processEvent(vrml.Event event)
Overrides:
processEvent in class vrml.node.Script

processWriteEvent

public void processWriteEvent(vrml.Event event)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD