|
DXSceneGetClosestHitObject Method |
GetClosestHitObject method executes a hit testing on the SceneNodes in this DXScene (or when specified on rootSceneNode and its children) and returns a
DXRayHitTestResult object with the closest triangle hit by the specified ray.
When no triangle is hit, null is returned.
Namespace: Ab3d.DirectXAssembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax public DXRayHitTestResult GetClosestHitObject(
Ray ray,
SceneNode rootSceneNode = null
)
Parameters
- ray Ray
- SharpDX.Ray object that defines the ray that is used for hit testing
- rootSceneNode SceneNode (Optional)
- SceneNode where the hit testing begins and continues to SceneNode's children. When not set or null, then DXScene.RootNode is used (optional)
Return Value
DXRayHitTestResultDXRayHitTestResult 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 (or when specified on rootSceneNode and its children) 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(Ray, SceneNode) method.
See Also