Click or drag to resize
AB4D logo

DXViewportViewGetClosestHitObject Method

GetClosestHitObject method executes a hit testing on the SceneNodes in this DXScene and returns a DXRayHitTestResult object with the closest triangle hit by the specified ray. When no triangle is hit, null is returned.

Namespace: Ab3d.DirectX.Controls
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.0.8865.1045
Syntax
C#
public DXRayHitTestResult GetClosestHitObject(
	Point position
)

Parameters

position  Point
2D position in Viewport3D that is used to create a 3D ray that is used for hit testing (usually mouse position)

Return Value

DXRayHitTestResult
DXRayHitTestResult with the closest hit object or null if no object was hit
Remarks

HitTest method executes a hit testing on the SceneNodes in this DXScene and returns DXRayHitTestResult object with the closest triangle hit by the specified ray. When no triangle is hit, null is returned.

It is possible to adjust hit testing with changing the value in the DXHitTestOptions property.

To get all hit results, use the GetAllHitObjects(Point) method.

See Also