Click or drag to resize
AB4D logo

MeshColliderGetClosestPosition Method

GetClosestPosition returns a DXRayHitTestResult with HitPosition set to the closest position on the mesh, DistanceToRayOrigin is set to the distance from the specified position to the position on the mesh and TriangleIndex is set to the position index in the Positions array (or vertex buffer array).

Namespace: Ab3d.DirectX.Utilities
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.0.8865.1045
Syntax
C#
public DXRayHitTestResult GetClosestPosition(
	Vector3 position
)

Parameters

position  Vector3
position as Vector3 that is used to find the closest position on the mesh

Return Value

DXRayHitTestResult
DXRayHitTestResult with set HitPosition, DistanceToRayOrigin and TriangleIndex (the later is set to the position index in the Positions array)
See Also