com.threerings.tudey.server.logic
Class BehaviorLogic.Pathing

java.lang.Object
  extended by com.threerings.util.ShallowObject
      extended by com.threerings.tudey.server.logic.Logic
          extended by com.threerings.tudey.server.logic.BehaviorLogic
              extended by com.threerings.tudey.server.logic.BehaviorLogic.Evaluating
                  extended by com.threerings.tudey.server.logic.BehaviorLogic.Pathing
Direct Known Subclasses:
BehaviorLogic.Follow, BehaviorLogic.Patrol
Enclosing class:
BehaviorLogic

public abstract static class BehaviorLogic.Pathing
extends BehaviorLogic.Evaluating

Base class for behaviors that involve following paths.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.BehaviorLogic
BehaviorLogic.Combined, BehaviorLogic.Evaluating, BehaviorLogic.Follow, BehaviorLogic.Idle, BehaviorLogic.PathCandidate, BehaviorLogic.Pathing, BehaviorLogic.Patrol, BehaviorLogic.Random, BehaviorLogic.Scripted, BehaviorLogic.Wander
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic
Logic.ShapeObserver
 
Field Summary
protected  Vector2f[] _path
          The waypoints of the path being followed.
protected  int _pidx
          The index of the next point on the path.
 
Fields inherited from class com.threerings.tudey.server.logic.BehaviorLogic.Evaluating
_nextEvaluation
 
Fields inherited from class com.threerings.tudey.server.logic.BehaviorLogic
_agent, _config, MAX_FOLLOW_PATH_LENGTH
 
Fields inherited from class com.threerings.tudey.server.logic.Logic
_scenemgr, _variables
 
Constructor Summary
BehaviorLogic.Pathing()
           
 
Method Summary
protected  void clearPath()
          Clears the path.
protected  void completedPath()
          Called when we complete the set path.
protected  float getReachRadius()
          Returns the radius within which we can be consider ourselves to have reached a node (which depends on the actor's speed, since it's possible to overshoot).
protected  void reachedPathIndex(int idx)
          Called when we reach each node in the path (except for the last one, for which we call completedPath().
protected  void setPath(Vector2f[] path)
          Sets the path to follow.
 void tick(int timestamp)
          Ticks the behavior.
 void transfer(Logic source, Map<Object,Object> refs)
          Transfers state from the specified source logic.
 
Methods inherited from class com.threerings.tudey.server.logic.BehaviorLogic.Evaluating
advanceEvaluation, evaluate, postponeNextEvaluation, scheduleNextEvaluation, startup
 
Methods inherited from class com.threerings.tudey.server.logic.BehaviorLogic
didInit, getCurrentTarget, getEntityKey, getRotation, getTranslation, init, isActive, penetratedEnvironment, reachedTargetRotation, shutdown, suspend
 
Methods inherited from class com.threerings.tudey.server.logic.Logic
addShapeObserver, createAction, createCondition, createExpression, createHandler, createRegion, createTarget, getModel, getPatrolPath, getSceneManager, getShape, getTags, getTransform, getTransform, getVariable, init, isDefaultEntrance, isVisible, removeShapeObserver, request, resolveTarget, setVariable, signal
 
Methods inherited from class com.threerings.util.ShallowObject
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_path

protected Vector2f[] _path
The waypoints of the path being followed.


_pidx

protected int _pidx
The index of the next point on the path.

Constructor Detail

BehaviorLogic.Pathing

public BehaviorLogic.Pathing()
Method Detail

tick

public void tick(int timestamp)
Description copied from class: BehaviorLogic
Ticks the behavior.

Overrides:
tick in class BehaviorLogic.Evaluating

transfer

public void transfer(Logic source,
                     Map<Object,Object> refs)
Description copied from class: Logic
Transfers state from the specified source logic. Where relevant, this also takes the place of addition/startup notification.

Overrides:
transfer in class BehaviorLogic.Evaluating

setPath

protected void setPath(Vector2f[] path)
Sets the path to follow.


clearPath

protected void clearPath()
Clears the path.


getReachRadius

protected float getReachRadius()
Returns the radius within which we can be consider ourselves to have reached a node (which depends on the actor's speed, since it's possible to overshoot).


reachedPathIndex

protected void reachedPathIndex(int idx)
Called when we reach each node in the path (except for the last one, for which we call completedPath().


completedPath

protected void completedPath()
Called when we complete the set path.