[This is preliminary documentation and is subject to change.]
Assembly: cai-nav (in cai-nav.dll) Version: 0.4.0.0 (0.4.0.0)
|C#||Visual Basic||Visual C++|
A point within the start polygon representing the start of the ray.
The point to cast the ray toward.
The filter to apply to the query.
The hit parameter. (>1E38 if no hit.)
The normal of the nearest wall hit.
The references of the visited polygons. [(polyRef) * pathCount] (Optional)
The number of visited polygons.
Return ValueThe NavStatus flags for the query.
This method is meant to be used for quick short distance checks.
If the path buffer is too small to hold the result, it will be filled as far as possible from the start point toward the end point.
Using the Hit Paramter
If the hit parameter is a very high value (>1E38), then the ray has hit the end point. In this case the path represents a valid corridor to the end point and the value of hitNormal is undefined.
If the hit parameter is zero, then the start point is on the border that was hit and the value of hitNormal is undefined.
If 0 < hitParameter < 1.0 then the following applies:
distanceToHitBorder = distanceToEndPoint * hitParameter hitPoint = startPoint + (endPoint - startPoint) * hitParameter
Use Case Restriction
The raycast ignores the y-value of the end point. (2D check) This places significant limits on how it can be used. Example scenario:
Consider a scene where there is a main floor with a second floor balcony that hangs over the main floor. So the first floor mesh extends below the balcony mesh. The start point is somewhere on the first floor. The end point is on the balcony.
The raycast will search toward the end point along the first floor mesh. If it reaches the end point's xz-coordinates it will indicate 'no hit', meaning it reached the end point.