com.threerings.tudey.data.actor
Class Mobile

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.tudey.data.actor.Actor
          extended by com.threerings.tudey.data.actor.Mobile
All Implemented Interfaces:
Deltable, com.threerings.io.Streamable, Copyable, Cloneable
Direct Known Subclasses:
Active

public class Mobile
extends Actor

An actor capable of moving by itself.


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 MOVING
          A flag indicating that the actor is in motion.
 
Fields inherited from class com.threerings.tudey.data.actor.Actor
WARP
 
Constructor Summary
Mobile()
          No-arg constructor for deserialization.
Mobile(ConfigReference<ActorConfig> config, int id, int created, Vector2f translation, float rotation)
          Creates a new mobile actor.
 
Method Summary
 void addStepLimiter(StepLimiter limiter)
          Adds a step limiter.
 Object copy(Object dest)
          Creates a copy of this object, (re)populating the supplied destination object if possible.
 ActorAdvancer createAdvancer(ActorAdvancer.Environment environment, int timestamp)
          Creates an advancer for the actor.
 boolean equals(Object other)
           
 Actor extrapolate(float elapsed, int timestamp, Actor result)
          Extrapolates the state of this actor after the specified time interval, in seconds (which may be negative).
 float getDirection()
          Returns the direction of motion.
 float getMaxStep()
          Returns the max translation amount.
 float getMaxStepSquared()
          Returns the max translation amount squared.
 float getSpeed()
          Returns the (base) speed of the actor.
 int getTurnDirection()
          Returns the direction of rotation (+1 if counterclockwise, -1 if clockwise, 0 if none).
 float getTurnRate()
          Returns the rate of turning (radians per second).
 int hashCode()
           
 void removeStepLimiter(StepLimiter limiter)
          Removes a step limiter.
 void setDirection(float direction)
          Sets the direction of motion.
 void setMaxStep(float maxStep)
          Sets the max step amount.
 void step(float elapsed, int timestamp)
          Takes an Euler step of the specified duration.
 
Methods inherited from class com.threerings.tudey.data.actor.Actor
canCollide, canCollide, clear, getCollisionFlags, getCollisionMask, getConfig, getCreated, getDestroyed, getFlags, getId, getOriginal, getPreloads, getRotation, getTranslation, init, interpolate, isClientControlled, isDirty, isSet, maybeCreateAdvancer, set, set, setConfig, setDestroyed, setDirty, setFlags, setRotation, setTranslation, toString
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MOVING

public static final int MOVING
A flag indicating that the actor is in motion.

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

Mobile

public Mobile(ConfigReference<ActorConfig> config,
              int id,
              int created,
              Vector2f translation,
              float rotation)
Creates a new mobile actor.


Mobile

public Mobile()
No-arg constructor for deserialization.

Method Detail

setDirection

public void setDirection(float direction)
Sets the direction of motion.


getDirection

public float getDirection()
Returns the direction of motion.


setMaxStep

public void setMaxStep(float maxStep)
Sets the max step amount.


getMaxStep

public float getMaxStep()
Returns the max translation amount.


getMaxStepSquared

public float getMaxStepSquared()
Returns the max translation amount squared.


getTurnDirection

public int getTurnDirection()
Returns the direction of rotation (+1 if counterclockwise, -1 if clockwise, 0 if none).


getTurnRate

public float getTurnRate()
Returns the rate of turning (radians per second).


addStepLimiter

public void addStepLimiter(StepLimiter limiter)
Adds a step limiter.


removeStepLimiter

public void removeStepLimiter(StepLimiter limiter)
Removes a step limiter.


getSpeed

public float getSpeed()
Returns the (base) speed of the actor.


step

public void step(float elapsed,
                 int timestamp)
Takes an Euler step of the specified duration.

Parameters:
timestamp - the timestamp at the end of the step.

extrapolate

public Actor extrapolate(float elapsed,
                         int timestamp,
                         Actor result)
Description copied from class: Actor
Extrapolates the state of this actor after the specified time interval, in seconds (which may be negative).

Overrides:
extrapolate in class Actor

createAdvancer

public ActorAdvancer createAdvancer(ActorAdvancer.Environment environment,
                                    int timestamp)
Description copied from class: Actor
Creates an advancer for the actor.

Overrides:
createAdvancer in class Actor

copy

public Object copy(Object dest)
Description copied from interface: Copyable
Creates a copy of this object, (re)populating the supplied destination object if possible.

Specified by:
copy in interface Copyable
Overrides:
copy in class Actor
Returns:
either a reference to the destination object, if it could be repopulated, or a new object containing the copied state.

equals

public boolean equals(Object other)
Overrides:
equals in class Actor

hashCode

public int hashCode()
Overrides:
hashCode in class Actor


Copyright © 2011. All Rights Reserved.