PathEngine home previous: iMesh::burnContextIntoMesh()next: iMesh::clearAllAnchors()
Contents, API Reference, Interfaces, iMesh, calculatePathfindingCostForLine



Calculates the movement cost for a given line, as applied during pathfinding.


uint32_t calculatePathfindingCostForLine(const iShape& shape, const iCollisionContext* context, const cPosition& start, const cPosition& end, bool& blocked) const;


shape The collision shape to use for this query.
context The state of dynamic collision that will apply for this query.
An empty context can be specified by passing nullptr for this argument.
start The start of the line. This position must be a valid position on this mesh
end The end of the line. This position must be a valid position on this mesh
blocked Returns true, if the line is not passible for pathfinding.


Pathfinding preprocess must be present for the specified shape, on this mesh.

Return Value

The pathfinding cost for the line from start to end, if the line is not blocked.
(If the line is blocked then blocked is set to true, and return value is undefined.)


This method applies the same calculations as are applied during pathfinding for the cost of movement along a line.

Any soft obstacle traverse costs or surface type based traverse costs, either 'burnt in' to the base mesh, or set dynamically on the supplied collision context, will be included in this calculation, as well as a base cost corresponding to the horizontal distance travelled by the line.

The line can be blocked either by hard collision, or by a special surface type traverse cost value of -1 indicating an 'impassible' surface type region.

C# Mapping

uint calculatePathfindingCostForLine(Shape shape, CollisionContext context, PathEngine.Position start, PathEngine.Position end, out bool blocked);

Documentation for PathEngine release 6.03 - Copyright © 2002-2021 PathEnginenext: iMesh::clearAllAnchors()