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;
The collision shape to use for this query.
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.
The start of the line. This position must be a valid position on this mesh
The end of the line. This position must be a valid position on this mesh
Returns true, if the line is not passible for pathfinding.
Pathfinding preprocess must be present for the specified shape, on this mesh.
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.
uint calculatePathfindingCostForLine(Shape shape, CollisionContext context, PathEngine.Position start, PathEngine.Position end, out bool blocked);
long calculatePathfindingCostForLine(Shape shape, CollisionContext context, Position start, Position end, boolean_OutArgument blocked);