PathEngine home previous: iMesh::storeNamedObstacle()next: iMesh::testLineCollision_XY()
Contents, API Reference, Interfaces, iMesh, testLineCollision

iMesh::testLineCollision()

Description

Tests whether agents with the given collision shape can move along the specified line without being obstructed.

Syntax

bool testLineCollision(const iShape& shape, const iCollisionContext* context, const cPosition& start, const cPosition& end) const;

Parameters

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

Requirements

Requires that unobstructed space has been generated on this mesh for the collision shape specified.
(But see also Performing Collision Queries without Preprocess.)

Return Value

true if movement along the line is obstructed for an agent with the specified shape and given the specified state of dynamic collision, otherwise false.

Remarks

This method tests collision for a line between two fully specified positions.
In many situations the 'cell' at a target position is not known. In this case, use iMesh::testLineCollision_XY().

See The PathEngine Movement Model for details about PathEngine collision.

See Also

iMesh::testLineCollision_XY(), iMesh::firstCollision()

C# Mapping

bool testLineCollision(Shape shape, CollisionContext context, PathEngine.Position start, PathEngine.Position end);

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iMesh::testLineCollision_XY()