![]() | |
Scene |
public RayHitTestResult? GetClosestHitObject( float x, float y, bool adjustForDpiScale = true, HitTestOptions? customHitTestOptions = null )
GetClosestHitObject method executes a hit testing on the SceneNodes that are shown by this SceneView and returns a RayHitTestResult object with the closest triangle hit. When no triangle is hit, null is returned.
This method is first creating the ray by calling GetRayFromCamera(Single, Single, Boolean) method and then calling the GetClosestHitObject(Ray, SceneNode, HitTestOptions) method.
To control advanced hit-testing options set the customHitTestOptions parameter (HitTestOptions) or change the Scene.DefaultHitTestOptions that is used when customHitTestOptions parameter is not set (null by default).
To get all hit results (ant not just the closest hit), use the GetAllHitObjects method.