Class AnimProtocol

java.lang.Object
  |
  +--AnimProtocol
All Implemented Interfaces:
NetListener

public class AnimProtocol
extends java.lang.Object
implements NetListener

Defines a protocol for sending and receving animation packets. Packets are either joint data or they are timestamps.


Field Summary
private  boolean debug
           
private  boolean debug_nonet
           
private static int jointPayloadSize
          The number of bytes in a Joint packet payload
private static int minPacketSize
          The number of bytes in the smallest packet
private  Net net
           
private static int packetHeaderSize
          The number of bytes in a packet header
private static int port
           
private  short r_elbow_id
           
private  short r_shoulder_id
           
private  short r_wrist_id
           
private static int timePayloadSize
          The number of bytes in a Timestamp packet payload
private static short timeStampHeader
          The time stamp header
 
Constructor Summary
AnimProtocol()
          This constructor is for the SERVER.
 
Method Summary
 void close()
          Close the network connection.
private  short jointNametoID(java.lang.String name)
          Translate from an hanim name to its numeric id.
 void NetReadData(java.io.DataInputStream in_stream)
          Part of netListenerInterface.
 void sendJointData(java.lang.String name, float x, float y, float z, float a)
           
 void sendTimeStamp(int ts)
          Send out this time stamp over the net.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

net

private Net net

port

private static int port

packetHeaderSize

private static int packetHeaderSize
The number of bytes in a packet header

jointPayloadSize

private static int jointPayloadSize
The number of bytes in a Joint packet payload

timePayloadSize

private static int timePayloadSize
The number of bytes in a Timestamp packet payload

minPacketSize

private static int minPacketSize
The number of bytes in the smallest packet

timeStampHeader

private static short timeStampHeader
The time stamp header

r_shoulder_id

private final short r_shoulder_id

r_elbow_id

private final short r_elbow_id

r_wrist_id

private final short r_wrist_id

debug

private boolean debug

debug_nonet

private final boolean debug_nonet
Constructor Detail

AnimProtocol

public AnimProtocol()
This constructor is for the SERVER.
Method Detail

sendTimeStamp

public void sendTimeStamp(int ts)
Send out this time stamp over the net. If the net is not connected nothing happens.

sendJointData

public void sendJointData(java.lang.String name,
                          float x,
                          float y,
                          float z,
                          float a)

jointNametoID

private short jointNametoID(java.lang.String name)
Translate from an hanim name to its numeric id.

close

public void close()
Close the network connection.

NetReadData

public void NetReadData(java.io.DataInputStream in_stream)
Part of netListenerInterface. This doesn't do anything because we aren't expecting the client to talk back, but we have to have a listener in order to use the Net class.
Specified by:
NetReadData in interface NetListener