![]() | |
Scene |
public List<RayHitTestResult> GetAllHitObjects( Ray ray, SceneNode? rootSceneNode, HitTestOptions? customHitTestOptions = null )
GetAllHitObjects method executes a hit testing by using the specified Ray on the SceneNodes that are children of the specified rootSceneNode. GetAllHitObjects method executes a hit testing by using the specified Ray on the SceneNodes that are children of the specified rootSceneNode. The method returns a list of RayHitTestResult objects sorted from the closest to the farthest object When no object is hit, an empty list is returned.
This method takes a Ray as a parameter. The ray can be created by the GetRayFromCamera(Single, Single, Boolean) or GetRayFromNearPlane(Single, Single, Boolean) methods. You can also use the GetAllHitObjects(Single, Single, Boolean, HitTestOptions) method that takes mouse coordinates instead of a Ray.
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 only the closest hit result, use the GetClosestHitObject(Single, Single, Boolean, HitTestOptions) or GetClosestHitObject(Ray, HitTestOptions) methods.
This method creates a new instance of List{RayHitTestResult}. To prevent generating new objects on each hit test and to reuse an existing List, call the GetAllHitObjects method that takes a List{RayHitTestResult} as the first parameter.