PathEngine home | previous: | next: |
Determines the first contact, if any, for movement by the agent along a line to a specified target position.
bool firstCollisionTo(const iCollisionContext* context, int32_t x, int32_t y, int32_t& cell, cCollidingLine& collidingLine, std::unique_ptr<iAgent>& agent) 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. | ||
collidingLine | If there is a collision then this will be filled in to describe a line of first contact. | ||
agent | If there is a collision, and first contact is with an agent in the supplied collision context, this returns a pointer to the obstructing agent. If there is no collision, this is set to zero. |
The start position passed into this query should not be obstructed.
In the case of a collision, the line of contact is guaranteed to cross the direction of travel from right to left, but note the start and end points of this line of contact serve only to describe the position and direction of the 'infinite line' at point of collision, and should not be considered as meaningful in of themselves.
See
bool firstCollisionTo(CollisionContext context, int x, int y, out int cell, out PathEngine.CollidingLine collidingLine, out Agent agent); |
boolean firstCollisionTo(CollisionContext context, int x, int y, int_OutArgument cell, Object_OutArgument collidingLine, Object_OutArgument agent); |
Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEngine | next: |