Public Member Functions | Public Attributes
RAIN.Path.MoveToTarget Class Reference

MoveToTarget is an Action that attempts to use Instantaneous SimpleSteering to move toward the position identified by AI Context variable PathConstants.PATHMOVETARGET. More...

Inheritance diagram for RAIN.Path.MoveToTarget:
RAIN.Action.Action

List of all members.

Public Member Functions

override ActionResult Start (Agent agent, float deltaTime)
 Start is called by an Action Executor one time prior to calling consecutive Execute calls.
override ActionResult Execute (Agent agent, float deltaTime)
 Execute is called by an Action Executor to perform the work of the Action. An Action can run to completion, but will typically perform only the work for a single timestep, then continue at the next timestep for long running actions.
override ActionResult Stop (Agent agent, float deltaTime)
 Stop is called to support cleanup and termination of execution activites. Stop should always be called by the Action Executor after a Start, regardless of the SUCCESS or FAILURE of any Execute calls.

Public Attributes

const string ACTION_NAME = "MoveToTarget"
float closeEnoughDistance = 0.1f
 How close is good enough?
float closeEnoughRadius = 3.0f
 How close do we have to be (rotation degrees)?
float faceBeforeMoveAngle = 90f
 How close do we have to be facing the target before we allow linear movement?
bool allow3DMovement = false
 Do we assume we are using a 2D path or 2D following? (e.g., navgrid or navmesh)
bool allow3DRotation = false
 Do we assume that the AI stays y axis up?

Detailed Description

MoveToTarget is an Action that attempts to use Instantaneous SimpleSteering to move toward the position identified by AI Context variable PathConstants.PATHMOVETARGET.


Member Function Documentation

override ActionResult RAIN.Path.MoveToTarget.Execute ( Agent  agent,
float  deltaTime 
) [virtual]

Execute is called by an Action Executor to perform the work of the Action. An Action can run to completion, but will typically perform only the work for a single timestep, then continue at the next timestep for long running actions.

Parameters:
agentThe AI agent owning this action
deltaTimetimestep in seconds
Returns:
Returns SUCCESS if the action completed successfully, FAILURE if a failure occured, RUNNING if more work is to be done

Reimplemented from RAIN.Action.Action.

override ActionResult RAIN.Path.MoveToTarget.Start ( Agent  agent,
float  deltaTime 
) [virtual]

Start is called by an Action Executor one time prior to calling consecutive Execute calls.

Parameters:
agentThe AI agent owning this action
deltaTimetimestep in seconds
Returns:
Returns an ActionResult of SUCCESS or FAILURE, which may be ignored by the caller if desired

Reimplemented from RAIN.Action.Action.

override ActionResult RAIN.Path.MoveToTarget.Stop ( Agent  agent,
float  deltaTime 
) [virtual]

Stop is called to support cleanup and termination of execution activites. Stop should always be called by the Action Executor after a Start, regardless of the SUCCESS or FAILURE of any Execute calls.

Parameters:
agentThe AI agent owning this action
deltaTimetimestep in seconds
Returns:
Returns an ActionResult of SUCCESS or FAILURE, which may be ignored by the caller if desired

Reimplemented from RAIN.Action.Action.


Member Data Documentation

Do we assume we are using a 2D path or 2D following? (e.g., navgrid or navmesh)

Do we assume that the AI stays y axis up?

How close is good enough?

How close do we have to be (rotation degrees)?

How close do we have to be facing the target before we allow linear movement?