[This is preliminary documentation and is subject to change.]

Finds the corners in the corridor from the position toward the target. (The straightened path.)

Namespace: org.critterai.nav
Assembly: cai-nav (in cai-nav.dll) Version: (


 C#  Visual Basic  Visual C++ 
public int FindCorners(
	CornerData buffer
Public Function FindCorners ( _
	buffer As CornerData _
) As Integer
int FindCorners(
	CornerData^ buffer


The buffer to load the results into. [Length: >= 2]

Return Value

The number of corners returned in the buffers.


This method can be used to do corner searches that exceed the capacity of the corridor's normal corner buffers.

This method performs essentially the same function as GetStraightPath(Vector3, Vector3, array<UInt32>[]()[][], Int32, Int32, array<Vector3>[]()[][], array<WaypointFlag>[]()[][], array<UInt32>[]()[][], Int32%).

Due to internal optimizations, the actual maximum number of corners returned will be (buffer.MaxCorners - 1)

If the target is within range, it will be the last corner and have a polygon reference of zero.

Behavior is undefined if the buffer structure is malformed. E.g. The flag and polygon buffers are different sizes.

See Also