PathEngine home previous: iAgent::addExternalRef()next: iAgent::advanceAlongPathWithCollisionInfo()
Contents, API Reference, Interfaces, iAgent, advanceAlongPath

iAgent::advanceAlongPath()

Description

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

Syntax

bool advanceAlongPath(iPath* path, float distance, const iCollisionContext* context);

Parameters

path A path along which to advance the agent.
The path must start at the agent's current position, and the path will then be updated so to start at the agent's new position after the advance.
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 nullptr for this argument.
Note that the agent is not considered to obstruct itself even if included in this context.

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

Returns true if there was a collision, otherwise false.

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.

Refer to Advancing Along Paths for general information about PathEngine's built-in advance along path functionality.

See Also

iAgent::advanceAlongPathWithPrecision(), iAgent::advanceAlongPathWithCollisionInfo()

C# Mapping

bool advanceAlongPath(Path path, float distance, CollisionContext context);

Java Mapping

boolean advanceAlongPath(Path path, float distance, CollisionContext context);

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iAgent::advanceAlongPathWithCollisionInfo()