PathEngine home previous: iAgent::testCollisionTo()next: Interface iCollisionContext
Contents, API Reference, Interfaces, iAgent, testCollisionTo_XY



Tests whether the agent can move along a line specified in terms of target x and y coordinates.


bool testCollisionTo_XY(const iCollisionContext* context, int32_t x, int32_t y, int32_t& cell) const;


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.
x X coordinate for the end of the line.
y Y coordinate for the end of the line.
cell If there is no collision then this value will be set to the cell at the end of the line.


Requires that the agent is moveable and that collision preprocess has been generated on the agent's mesh for the agent's collision shape. (But see also Performing Collision Queries without Preprocess.)

Return Value

true if the line to the specified position is obstructed, otherwise false.


If a fully specified cPosition is available for the end of the line then iAgent::testCollisionTo() should be used instead.

See The PathEngine Movement Model for details about PathEngine collision.

See Also


C# Mapping

bool testCollisionTo_XY(CollisionContext context, int x, int y, out int cell);

Java Mapping

boolean testCollisionTo_XY(CollisionContext context, int x, int y, int_OutArgument cell);

Documentation for PathEngine release 6.03 - Copyright © 2002-2021 PathEnginenext: Interface iCollisionContext