PathEngine home previous: iAgent::advanceAlongPath()next: iAgent::canCollide()
Contents, API Reference, Interfaces, iAgent, advanceAlongPathWithPrecision

iAgent::advanceAlongPathWithPrecision()

Description

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

Syntax

iCollisionInfo* advanceAlongPathWithPrecision(iPath* path, float distance, const iCollisionContext* context, float& precisionX, float& precisionY);

Parameters

path A path along which to advance the agent.
The path must start at the agent's current position.
A null pointer may safely be passed in to this argument, in which case the call will have no effect.
distance The distance to advance along the path.
context The state of dynamic collision that will apply for this query.
An empty context can be specified by passing a value of zero for this argument.
Note that the agent is not considered to obstruct itself even if included in this context.
precisionX Extra precision for the x component of the agent's position is returned in this parameter.
precisionY Extra precision for the y component of the agent's position is returned in this parameter.

Requirements

Requires that the agent is moveable and that collision preprocess has been generated on the agent's mesh for the agent's collision shape.

Return Value

If the agent is successfully advanced along the path then zero is returned.
Otherwise a newly created Interface iCollisionInfo object is returned with information about the collision preventing the movement.

Remarks

The agent will be moved along the path and at the same time the path updated to start at the agents new position.

When approximating positions along diagonal path segments, collision checks are used to prevent the agent from getting placed inside obstructed space.

Information is stored within Interface iPath to prevent artifacts due to approximation when small distance values are used.

The precision components returned in precisionX and precisionY can be added to the integer part of the position to obtain higher precision coordinates for rendering purposes.

See Also

iAgent::advanceAlongPath(), Interface iPath
Documentation for PathEngine release 5.17 - Copyright © 2002-2008 PathEnginenext: iAgent::canCollide()