PathEngine home previous: iMesh::testPointCollision()next: iAgent::addConstExternalRef()
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/code/externalAPI/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 released explicitly by calling delete on the pointer or by calling the object's release() function. 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:

addConstExternalRef

Increments the internal reference count for this API object.

addExternalRef

Increments the internal reference count for this API object.

advanceAlongPath

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

advanceAlongPathWithCollisionInfo

A version of advanceAlongPath() with extra precision components of the agent's position and collision information.

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 access the mesh on which this agent is placed.

getNumberOfVertices

A helper function for access to underlying agent geometry, e.g. for debug rendering.

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().

getVertexCoordinates

A helper function for access to underlying agent geometry, e.g. for debug rendering.

hasRefs

Enables you to check whether there are any outstanding references on this object, other than the interface reference through which you are calling, and therefore whether this object will actually be deleted if you call its release method.

isMoveable

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

moveTo

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

refMesh

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

release

Releases the API object pointer.

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 6.04 - Copyright © 2002-2024 PathEnginenext: iAgent::addConstExternalRef()