com.threerings.tudey.data
Class InputFrame

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.tudey.data.InputFrame
All Implemented Interfaces:
com.threerings.io.Streamable, Copyable, Cloneable

public class InputFrame
extends DeepObject
implements com.threerings.io.Streamable

Represents a single frame of user input.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Field Summary
static int LAST_FLAG
          The value of the last flag defined in this class.
static int MOVE
          Indicates that the user wants to move.
 
Constructor Summary
InputFrame()
          No-arg constructor for deserialization.
InputFrame(int timestamp, float rotation, float direction, int flags)
          Creates a new input frame.
 
Method Summary
 int getApproximateSize()
          Returns the approximate size of the frame in bytes (including its two-byte class code).
 float getDirection()
          Returns the direction of movement requested by the user.
 int getFlags()
          Returns the user's input flags.
 float getRotation()
          Returns the rotation requested by the user.
 int getTimestamp()
          Returns the timestamp of this frame.
 Vector2f getTranslation()
          Returns a reference to the computed translation.
 boolean isSet(int flag)
          Determines whether a flag is set.
 void setTranslation(Vector2f translation)
          Sets the computed translation reference.
 String toString()
           
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MOVE

public static final int MOVE
Indicates that the user wants to move.

See Also:
Constant Field Values

LAST_FLAG

public static final int LAST_FLAG
The value of the last flag defined in this class.

See Also:
Constant Field Values
Constructor Detail

InputFrame

public InputFrame(int timestamp,
                  float rotation,
                  float direction,
                  int flags)
Creates a new input frame.


InputFrame

public InputFrame()
No-arg constructor for deserialization.

Method Detail

getTimestamp

public int getTimestamp()
Returns the timestamp of this frame.


setTranslation

public void setTranslation(Vector2f translation)
Sets the computed translation reference. This is done on the client so that the server knows where the client thinks he should be.


getTranslation

public Vector2f getTranslation()
Returns a reference to the computed translation.


getRotation

public float getRotation()
Returns the rotation requested by the user.


getDirection

public float getDirection()
Returns the direction of movement requested by the user.


getFlags

public int getFlags()
Returns the user's input flags.


isSet

public boolean isSet(int flag)
Determines whether a flag is set.


getApproximateSize

public int getApproximateSize()
Returns the approximate size of the frame in bytes (including its two-byte class code).


toString

public String toString()
Overrides:
toString in class DeepObject


Copyright © 2011. All Rights Reserved.