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

Finds the nearest point on the surface of the navigation mesh.

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

Syntax

         
 C#  Visual Basic  Visual C++ 
public NavStatus GetNearestPoint(
	Vector3 searchPoint,
	Vector3 extents,
	NavmeshQueryFilter filter,
	out NavmeshPoint result
)
Public Function GetNearestPoint ( _
	searchPoint As Vector3, _
	extents As Vector3, _
	filter As NavmeshQueryFilter, _
	<OutAttribute> ByRef result As NavmeshPoint _
) As NavStatus
public:
NavStatus GetNearestPoint(
	Vector3 searchPoint, 
	Vector3 extents, 
	NavmeshQueryFilter^ filter, 
	[OutAttribute] NavmeshPoint% result
)

Parameters

searchPoint
Vector3
The center of the search box.
extents
Vector3
The search distance along each axis.
filter
NavmeshQueryFilter
The filter to apply to the query.
result
NavmeshPoint%
The nearest point on the polygon.

Return Value

The NavStatus flags for the query.

Remarks

If the search box does not intersect any polygons the search will return success, but the result polygon reference will be zero. So always check the polygon reference before using the point data.

Warning: This function is not suitable for large area searches. If the search extents overlaps more than 128 polygons it may return an invalid result.

The detail mesh is used to correct the y-value of result.

See Also