Class Playback
java.lang.Object
|
+--vrml.VrmlObject
|
+--vrml.BaseNode
|
+--vrml.node.Script
|
+--Playback
- All Implemented Interfaces:
- NetListener
- public class Playback
- extends vrml.node.Script
- implements NetListener
The java that interfaces with the Script in Sensors.wrl. Will read in a
file and play back the sensor orientations that it reads. It opens a
socket to a server that will play files to it.
|
Field Summary |
private float |
a
|
(package private) boolean |
animate
Used to indicate that data has come to the network, and
the script should send orientation events |
private int |
currentTime
|
private static int |
dataSize
|
private int |
frameCount
count the number of frames that have come in over the network |
private boolean |
frameReady
true if there is a new frame to animate |
(package private) int |
getCounter
|
private int |
id
|
private static int |
jointPayloadSize
|
(package private) Net |
net
|
private int |
njoints
The number of joints we are dealing with |
private float[][] |
orientation
|
private float[][] |
orientationBuffer
|
private static int |
PORT
|
(package private) vrml.field.SFRotation[] |
rotField
References to the rotation fields of the script |
private static int |
timePayloadSize
|
private float |
x
|
private float |
y
|
private float |
z
|
| Fields inherited from class vrml.BaseNode |
browser |
| Fields inherited from class vrml.VrmlObject |
handle |
|
Method Summary |
private void |
bufferOrientation(int newid,
float newx,
float newy,
float newz,
float newa)
The network thread writes into this buffer. |
private void |
getOrientations()
The VRML event thread uses this to update the avatar rotations. |
void |
initialize()
Get references to the EventOut's of the Script. |
private void |
loadFrame()
When all the joint data for a new frame as arrived, then update the vrml display |
void |
NetReadData(java.io.DataInputStream in_stream)
Part of the NetListener interface, this reads the packets that come in
over the network socket and sends them to the VRML player. |
void |
processEvent(vrml.Event e)
|
void |
shutdown()
Part of VRML Script Java interface |
| Methods inherited from class vrml.node.Script |
eventsProcessed, getEventIn, getEventOut, getField, processEvents |
| Methods inherited from class vrml.BaseNode |
getBrowser, getBrowserHandle, getFieldHandle, getFieldName, getNode, getPeer, getType, setBrowser, toString |
| Methods inherited from class vrml.VrmlObject |
assign, doAddRef, doRelease, equals, finalize, getHandle, hashCode, makeTimeStamp, setHandle |
| Methods inherited from class java.lang.Object |
, clone, getClass, notify, notifyAll, registerNatives, wait, wait, wait |
rotField
vrml.field.SFRotation[] rotField
- References to the rotation fields of the script
animate
boolean animate
- Used to indicate that data has come to the network, and
the script should send orientation events
net
Net net
PORT
private static int PORT
jointPayloadSize
private static int jointPayloadSize
timePayloadSize
private static int timePayloadSize
dataSize
private static int dataSize
currentTime
private int currentTime
id
private int id
x
private float x
y
private float y
z
private float z
a
private float a
njoints
private int njoints
- The number of joints we are dealing with
orientation
private float[][] orientation
orientationBuffer
private float[][] orientationBuffer
frameReady
private boolean frameReady
- true if there is a new frame to animate
frameCount
private int frameCount
- count the number of frames that have come in over the network
getCounter
int getCounter
Playback
public Playback()
initialize
public void initialize()
- Get references to the EventOut's of the Script.
- Overrides:
initialize in class vrml.node.Script
processEvent
public void processEvent(vrml.Event e)
- Overrides:
processEvent in class vrml.node.Script
shutdown
public void shutdown()
- Part of VRML Script Java interface
- Overrides:
shutdown in class vrml.node.Script
bufferOrientation
private void bufferOrientation(int newid,
float newx,
float newy,
float newz,
float newa)
- The network thread writes into this buffer.
loadFrame
private void loadFrame()
- When all the joint data for a new frame as arrived, then update the vrml display
getOrientations
private void getOrientations()
- The VRML event thread uses this to update the avatar rotations.
NetReadData
public void NetReadData(java.io.DataInputStream in_stream)
- Part of the NetListener interface, this reads the packets that come in
over the network socket and sends them to the VRML player.
Packet format:
Addr | x | y | z | a
short |float|float|float| float
or
TIME_STAMP | time
short | int;
- Specified by:
NetReadData in interface NetListener