com.threerings.tudey.util
Class PawnAdvancer

java.lang.Object
  extended by com.threerings.tudey.util.ActorAdvancer
      extended by com.threerings.tudey.util.MobileAdvancer
          extended by com.threerings.tudey.util.ActiveAdvancer
              extended by com.threerings.tudey.util.PawnAdvancer

public class PawnAdvancer
extends ActiveAdvancer

Used on the client and the server to advance the state of a pawn based on its inputs and surroundings.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.tudey.util.ActiveAdvancer
ActiveAdvancer.Activity
 
Nested classes/interfaces inherited from class com.threerings.tudey.util.ActorAdvancer
ActorAdvancer.Environment
 
Field Summary
protected  InputFrame _frame
          The most current input frame.
protected  Pawn _pawn
          A casted reference to the pawn.
protected  Shape _swept
          Holds the actor's swept shape.
 
Fields inherited from class com.threerings.tudey.util.ActiveAdvancer
_active, _activities
 
Fields inherited from class com.threerings.tudey.util.MobileAdvancer
_mobile, _otrans, _penetration, MAX_SUBSTEP
 
Fields inherited from class com.threerings.tudey.util.ActorAdvancer
_actor, _environment, _shape, _timestamp, _transform
 
Constructor Summary
PawnAdvancer(ActorAdvancer.Environment environment, Pawn pawn, int timestamp)
          Creates a new advancer for the supplied pawn.
 
Method Summary
 void advance(InputFrame frame)
          Advances to the timestamp of the provided input frame and sets the pawn's current input.
protected  boolean ignoreInputPosition()
          Checks whether we should ignore the input position and instead perform the full movement simulation.
 void init(Actor actor, int timestamp)
          (Re)initializes the advancer.
protected  void step(float elapsed)
          Takes an Euler step of the specified length.
protected  void takeSubsteps(float elapsed)
          Executes the substeps required for the current step.
protected  void updateInput()
          Updates the pawn's state based on the current input frame.
protected  void updateRotation()
          Called to update a pawns rotation based on input.
 
Methods inherited from class com.threerings.tudey.util.ActiveAdvancer
canMove, canRotate, getActivity, mobileStep
 
Methods inherited from class com.threerings.tudey.util.MobileAdvancer
substep
 
Methods inherited from class com.threerings.tudey.util.ActorAdvancer
advance, getActor, getTimestamp, jump, transfer, updateShape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_pawn

protected Pawn _pawn
A casted reference to the pawn.


_frame

protected InputFrame _frame
The most current input frame.


_swept

protected Shape _swept
Holds the actor's swept shape.

Constructor Detail

PawnAdvancer

public PawnAdvancer(ActorAdvancer.Environment environment,
                    Pawn pawn,
                    int timestamp)
Creates a new advancer for the supplied pawn.

Method Detail

advance

public void advance(InputFrame frame)
Advances to the timestamp of the provided input frame and sets the pawn's current input.


init

public void init(Actor actor,
                 int timestamp)
Description copied from class: ActorAdvancer
(Re)initializes the advancer.

Overrides:
init in class ActiveAdvancer

step

protected void step(float elapsed)
Description copied from class: ActorAdvancer
Takes an Euler step of the specified length.

Overrides:
step in class ActiveAdvancer

takeSubsteps

protected void takeSubsteps(float elapsed)
Description copied from class: MobileAdvancer
Executes the substeps required for the current step.

Overrides:
takeSubsteps in class MobileAdvancer

ignoreInputPosition

protected boolean ignoreInputPosition()
Checks whether we should ignore the input position and instead perform the full movement simulation.


updateInput

protected void updateInput()
Updates the pawn's state based on the current input frame.


updateRotation

protected void updateRotation()
Called to update a pawns rotation based on input.