Click or drag to resize
AB4D logo

OptimizedPointMeshTGetClosestPositionIndex(Ray, Single) Method

Returns an index of the position that is the closest to the specified ray. The method also sets the distance to the out parameter. The method is highly optimized and checks only the segments that ray goes through (ray intersects segment's bounding box) and this significantly reduces the number of checked positions. When no segment is hit by the ray, then -1 is returned and distance is set to NaN.

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.1.9105.2048 (1.0.0.0)
Syntax
C#
public int GetClosestPositionIndex(
	Ray ray,
	out float distance
)

Parameters

ray  Ray
SharpDX.Ray
distance  Single
out parameter that is set to the distance of the position to the ray

Return Value

Int32
an index of the position that is the closest to the specified ray; or -1 when no segment is hit by the ray
See Also