 |
SceneGetAllHitObjects(ListRayHitTestResult, Ray, SceneNode, HitTestOptions) Method |
GetAllHitObjects method executes a hit testing on the SceneNodes in this Scene (or when specified on rootSceneNode and its children).
The hit results are added to the specified allHitResults (as List{RayHitTestResult}).
Hit objects are added in order from the closest to the farthest object.
Namespace: Ab4d.SharpEngineAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.1.9316+94bbd23b55747f096f056a5602f7dd90558b3673
Syntaxpublic void GetAllHitObjects(
List<RayHitTestResult> allHitResults,
Ray ray,
SceneNode? rootSceneNode = null,
HitTestOptions? customHitTestOptions = null
)
Parameters
- allHitResults ListRayHitTestResult
- List of RayHitTestResult items to which the hit results are added
- ray Ray
- 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)
- customHitTestOptions HitTestOptions (Optional)
- Optional HitTestOptions that will be used for this hit test. When null (by default), then DefaultHitTestOptions will be used.
Remarks
GetAllHitObjects method executes a hit testing on the SceneNodes in this Scene (or when specified on rootSceneNode and its children).
The hit results are added to the specified allHitResults (as List{RayHitTestResult}).
Hit objects are added in order from the closest to the farthest object.
To control advanced hit-testing options set the customHitTestOptions parameter (HitTestOptions) or change the DefaultHitTestOptions that is used when customHitTestOptions parameter is not set (null by default).
To get only the closest hit result, use the GetClosestHitObject(Ray, SceneNode, HitTestOptions) method.
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.
See Also