PathEngine home previous: iMesh::testPointCollision()next: iAgent::advanceAlongPath()
Contents, API Reference, Interfaces, iAgent

Interface iAgent

Description

iAgent objects represent the placement of a shape at a position on a mesh.

Defined in SDKRoot/include/i_pathengine.h.

An iAgent object represents an instance of a shape placed on a mesh.
An iAgent object can be used to represent a true pathfinding agent, but also to represent an obstacle that is simply placed on a mesh and does not need to perform collision or pathfinding queries.
iAgent objects cannot be moved from one mesh to another.
To move a character from one mesh to another you need to delete the iAgent corresponding to placement on the first mesh and create a new iAgent to represent the placement of the character on the new mesh.

Construction and Deletion

iAgent objects are constructed by calling iMesh::placeAgent().
iAgent objects can be deleted explicitly by calling delete on the pointer or by calling the object's destroy() function. All iAgent objects are deleted by a call to iPathEngine::deleteAllObjects().
A pointer to an iAgent object must not be used after the object has been deleted.

All agents placed on a mesh get destroyed automatically when the mesh is destroyed.

Methods:

advanceAlongPath

Advances the agent along a path without allowing the agent to enter obstructed regions because of position approximation.

advanceAlongPathWithPrecision

Similar to advanceAlongPath(), but provides extra precision components of the agent's position.

canCollide

A helper function to determine whether collision queries can be made for the agent.

canPathfind

A helper function to determine whether pathfinding queries can be made for the agent.

findClosestUnobstructedPosition

Finds the closest unobstructed position, if one exists within a specified region around the agent's position.

findPathAway

Finds the shortest path of escape from a specified region for the agent.

findPathAway_WithQueryCallBack

Finds the shortest path of escape from a specified region for the agent.
(This version supports passing in a callback object to enable the query to be aborted early.)

findShortestPathTo

Finds the shortest path from the agent's current position to a specified target position.

findShortestPathTo_WithQueryCallBack

Finds the shortest path from the agent's current position to a specified target position.
(This version supports passing in a callback object to enable the query to be aborted early.)

firstCollisionTo

Determines the first contact, if any, for movement by the agent along a line to a specified target position.

generateCurvedPath

Post process path smoothing.
Returns a new path based on a 'base path', but with corners smoothed according to supplied parameters.

generateCurvedPath_WithEndVector

Post process path smoothing.
Returns a new path based on a 'base path', but with corners smoothed according to supplied parameters.

getAllAgentsOverlapped

Fills a buffer with the set of agents in a given context overlapped by this agent.

getMesh

A helper function to obtain the mesh on which this agent is placed.

getPosition

A helper function to obtain the current position of the agent.

getShape

A helper function to obtain the Interface iShape that was used to place the agent.

getTraverseCost

A helper function which can be used to determine whether an agent is set to behave as a 'soft obstacle', and the traverse cost associated with the agent.

getTraverseCostDirection

A helper function which can be used to determine whether a direction has been associated with a soft obstacle, and retrieve the direction.

getUserData

Used to retrieve a void pointer previously passed in to iAgent::setUserData().

isMoveable

A helper function to determine whether an agent can be moved.

moveTo

Move the agent to a specified position, without any collision checking.

setTraverseCost

Specifies if the obstacle should function as a 'soft obstacle', and specifies the traversal cost.

setTraverseCostDirection

Enables a direction to be associated with the traverse cost for a soft obstacle.

setUserData

Enables the client application to associate arbitrary application data with an agent.

testCollisionAt

Tests whether the agent can be placed at a specified position.

testCollisionDirectlyAgainstPlacedShape

Tests whether a specified shape at a specified position will obstruct the agent.

testCollisionTo

Tests whether the agent can move along a line to a specified position.

testCollisionTo_XY

Tests whether the agent can move along a line specified in terms of target x and y coordinates.


Documentation for PathEngine release 5.16 - Copyright © 2002-2008 PathEnginenext: iAgent::advanceAlongPath()