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

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.Wander
Enclosing class:
BehaviorLogic

public static class BehaviorLogic.Wander
extends BehaviorLogic.Evaluating

Handles the wander behavior.


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 _origin
          The translation of the actor when initialized.
protected  float _rotation
          The rotation that we will face when we stop pausing.
protected  int _startMoving
          The time at which we should start moving.
protected  int _startRotating
          The time at which we should start rotating.
 
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.Wander()
           
 
Method Summary
protected  void changeDirection()
          Changes the direction of the agent.
protected  void changeDirection(float rotation)
          Changes the direction of the agent.
protected  void didInit()
          Override to perform custom initialization.
protected  void evaluate()
          Performs an evaluation.
 void penetratedEnvironment(Vector2f penetration)
          Notifies the behavior that the agent has penetrated its environment during advancement.
 void reachedTargetRotation()
          Notifies the behavior that the agent has reached its target rotation.
 void startup()
          Starts up the behavior after initialization or suspension.
 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, postponeNextEvaluation, scheduleNextEvaluation
 
Methods inherited from class com.threerings.tudey.server.logic.BehaviorLogic
getCurrentTarget, getEntityKey, getRotation, getTranslation, init, isActive, 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

_origin

protected Vector2f _origin
The translation of the actor when initialized.


_startRotating

protected int _startRotating
The time at which we should start rotating.


_rotation

protected float _rotation
The rotation that we will face when we stop pausing.


_startMoving

protected int _startMoving
The time at which we should start moving.

Constructor Detail

BehaviorLogic.Wander

public BehaviorLogic.Wander()
Method Detail

startup

public void startup()
Description copied from class: BehaviorLogic
Starts up the behavior after initialization or suspension.

Overrides:
startup in class BehaviorLogic.Evaluating

tick

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

Overrides:
tick in class BehaviorLogic.Evaluating

reachedTargetRotation

public void reachedTargetRotation()
Description copied from class: BehaviorLogic
Notifies the behavior that the agent has reached its target rotation.

Overrides:
reachedTargetRotation in class BehaviorLogic

penetratedEnvironment

public void penetratedEnvironment(Vector2f penetration)
Description copied from class: BehaviorLogic
Notifies the behavior that the agent has penetrated its environment during advancement.

Overrides:
penetratedEnvironment in class BehaviorLogic
Parameters:
penetration - the sum penetration vector.

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

didInit

protected void didInit()
Description copied from class: BehaviorLogic
Override to perform custom initialization.

Overrides:
didInit in class BehaviorLogic

evaluate

protected void evaluate()
Description copied from class: BehaviorLogic.Evaluating
Performs an evaluation. Default implementation simply schedules the next evaluation.

Overrides:
evaluate in class BehaviorLogic.Evaluating

changeDirection

protected void changeDirection()
Changes the direction of the agent.


changeDirection

protected void changeDirection(float rotation)
Changes the direction of the agent.

Parameters:
rotation - the rotation to use as a base.