|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.util.ShallowObject
com.threerings.tudey.server.logic.Logic
com.threerings.tudey.server.logic.ActorLogic
com.threerings.tudey.server.logic.MobileLogic
com.threerings.tudey.server.logic.ActiveLogic
com.threerings.tudey.server.logic.AgentLogic
public class AgentLogic
Controls an autonomous agent.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.ActorLogic |
|---|
ActorLogic.CollisionFlagObserver |
| Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic |
|---|
Logic.ShapeObserver |
| Field Summary | |
|---|---|
protected BehaviorLogic |
_behavior
The agent's behavior logic. |
protected float |
_targetRotation
The agent's target rotation. |
protected int |
_timestamp
The timestamp of the last tick. |
protected float |
_turnRate
The agent's turn rate. |
| Fields inherited from class com.threerings.tudey.server.logic.ActiveLogic |
|---|
_activities, _lastActivityStarted |
| Fields inherited from class com.threerings.tudey.server.logic.MobileLogic |
|---|
_advancer, _inStasis, _penetrationCount, _penetrationSum |
| Fields inherited from class com.threerings.tudey.server.logic.ActorLogic |
|---|
_activator, _actor, _collisionFlagObservers, _collisionFlags, _config, _destroyed, _entityKey, _handlers, _previousSnapshot, _shape, _shapeDidChangeOp, _shapeObservers, _shapeWillChangeOp, _snapshot, _snapshotDelta, _snaptime, _source, MAX_ADJUSTMENT_DISTANCE, MAX_ADJUSTMENT_PATH_LENGTH |
| Fields inherited from class com.threerings.tudey.server.logic.Logic |
|---|
_scenemgr, _variables |
| Constructor Summary | |
|---|---|
AgentLogic()
|
|
| Method Summary | |
|---|---|
boolean |
canMove()
Checks whether we can move. |
boolean |
canRotate()
Checks whether we can rotate. |
boolean |
canThink()
Checks whether we can evaluate our behavior. |
void |
clearSpeed()
Clears a modified speed. |
void |
clearTargetRotation()
Clears the agent's target rotation. |
void |
clearTurnRate()
Clears the turn rate. |
BehaviorLogic |
createBehavior(ConfigReference<BehaviorConfig> ref)
Creates a behavior for this agent. |
protected void |
didInit()
Override to perform custom initialization. |
void |
face(Logic logic)
Sets the target rotation to face another entity. |
void |
face(Logic logic,
boolean force)
Sets the target rotation to face another entity. |
Logic |
getBehaviorTarget()
Returns the logic currently being targeted by our behavior, if any. |
float |
getTargetRotation()
Returns the target rotation. |
protected void |
penetratedEnvironment(Vector2f penetration)
Notes that the actor collided with one or more things during its advancement. |
protected void |
reachedTargetRotation()
Called when we reach our target rotation. |
void |
setSpeed(float speed)
Sets the speed. |
void |
setTargetRotation(float rotation)
Sets the target rotation for the agent to turn towards. |
void |
setTurnRate(float rate)
Sets the turn rate. |
void |
startMoving()
Sets the agent in motion. |
void |
stopMoving()
Stops the agent. |
boolean |
tick(int timestamp)
Ticks the participant. |
void |
transfer(Logic source,
Map<Object,Object> refs)
Transfers state from the specified source logic. |
protected void |
wasDestroyed()
Override to perform custom cleanup. |
| Methods inherited from class com.threerings.tudey.server.logic.ActiveLogic |
|---|
getActivityAdvance, updateActivities |
| Methods inherited from class com.threerings.tudey.server.logic.MobileLogic |
|---|
collides, createAdvancer, enteredStasis, getDirection, getPenetration, getSceneModel, getSnapshot, leftStasis, stepLimit, updateShape |
| Methods inherited from class com.threerings.tudey.server.logic.ActorLogic |
|---|
addCollisionFlagObserver, addShapeObserver, adjustSpawnPoint, adjustSpawnPoint, bodyWillEnter, bodyWillLeave, createActor, destroy, getActivator, getActor, getCollisionFlags, getEntityKey, getModel, getPreviousSnapshot, getRotation, getShape, getShapeElement, getSnapshotDelta, getSource, getTags, getTranslation, init, isActive, isDefaultEntrance, isDestroyed, isRemoved, isStatic, move, remove, removeCollisionFlagObserver, removeOnNextTick, removeShapeObserver, request, set, setActivator, setSource, setVariable, signal, testSpawnPoint, updateCollisionFlags, updateSnapshot, warp, warp, warp, wasRemoved, wasUpdated |
| Methods inherited from class com.threerings.tudey.server.logic.Logic |
|---|
createAction, createCondition, createExpression, createHandler, createRegion, createTarget, getPatrolPath, getSceneManager, getTransform, getTransform, getVariable, init, isVisible, resolveTarget |
| 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 |
|---|
protected BehaviorLogic _behavior
protected float _targetRotation
protected float _turnRate
protected int _timestamp
| Constructor Detail |
|---|
public AgentLogic()
| Method Detail |
|---|
public boolean canMove()
public boolean canRotate()
public boolean canThink()
public Logic getBehaviorTarget()
public void face(Logic logic)
public void face(Logic logic,
boolean force)
public void setTargetRotation(float rotation)
public float getTargetRotation()
public void clearTargetRotation()
public void setTurnRate(float rate)
public void clearTurnRate()
public void setSpeed(float speed)
public void clearSpeed()
public void startMoving()
public void stopMoving()
public BehaviorLogic createBehavior(ConfigReference<BehaviorConfig> ref)
public void transfer(Logic source,
Map<Object,Object> refs)
Logic
transfer in class ActiveLogicpublic boolean tick(int timestamp)
TudeySceneManager.TickParticipant
tick in interface TudeySceneManager.TickParticipanttick in class ActiveLogictimestamp - the timestamp of the current tick.
protected void wasDestroyed()
ActorLogic
wasDestroyed in class MobileLogicprotected void didInit()
ActorLogic
didInit in class MobileLogicprotected void penetratedEnvironment(Vector2f penetration)
MobileLogic
penetratedEnvironment in class MobileLogicpenetration - the sum of the penetration vectors.protected void reachedTargetRotation()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||