PathEngine home previous: iAgent::findPathAway_WithQueryCallBack()next: iAgent::findShortestPathTo_WithQueryCallBack()
Contents, API Reference, Interfaces, iAgent, findShortestPathTo

iAgent::findShortestPathTo()

Description

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

Syntax

std::unique_ptr<iPath> findShortestPathTo(const iCollisionContext* context, const cPosition& target) const

Parameters

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.
target The target position for pathfinding. This position must be a valid position on the agent's mesh.

Requirements

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

The start point for pathfinding (i.e. the agent's current position) must not be obstructed by the base mesh or burnt-in obstacles.

Return Value

A newly created Interface iPath object, if a path can be found.
Otherwise a zero pointer is returned.

Remarks

Calling this method is functionally equivalent to calling iAgent::findShortestPathTo_WithQueryCallBack(), with null for the callback parameter.

C# Mapping

Path findShortestPathTo(CollisionContext context, PathEngine.Position target);

Java Mapping

Path findShortestPathTo(CollisionContext context, Position target);

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