Contents, API Reference, Interfaces, iMesh, firstCollision
Determines the first contact, if any, for an agent with the specified collision shape moving along the specified line.
bool firstCollision(const iShape* shape, const iCollisionContext* context, const cPosition& start, int32_t x, int32_t y, int32_t& cell, cCollidingLine& collidingLine, iAgent*& agent) 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
X coordinate for the end of the line.
Y coordinate for the end of the line.
If there is no collision then this value will be set to the cell at the end of the line.
If there is a collision then this will be filled in to describe a line of first contact.
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.
Requires that unobstructed space has been generated on this mesh for the collision shape specified.
Returns true if movement along the line is obstructed, otherwise false.
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 The PathEngine Movement Model for details about PathEngine collision.
bool firstCollision(Shape shape, CollisionContext context, PathEngine.Position start, int x, int y, out int cell, out PathEngine.CollidingLine collidingLine, out Agent agent);
boolean firstCollision(Shape shape, CollisionContext context, Position start, int x, int y, int_OutArgument cell, Object_OutArgument collidingLine, Object_OutArgument agent);