 |
SceneViewGetAllHitObjects(ListRayHitTestResult, Single, Single, SceneNode, Boolean, HitTestOptions) Method |
GetAllHitObjects method executes a hit testing from the specified x and y positions on the SceneNodes that are children of the specified rootSceneNode.
The hit objects 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,
float x,
float y,
SceneNode? rootSceneNode,
bool adjustForDpiScale = true,
HitTestOptions? customHitTestOptions = null
)
Parameters
- allHitResults ListRayHitTestResult
- List of RayHitTestResult items to which the hit results are added
- x Single
- x position in this view (for example, a mouse x position)
- y Single
- y position in this view (for example, a mouse y position)
- rootSceneNode SceneNode
- SceneNode where the hit testing begins - only rootSceneNode and its child SceneNodes are hit tested.
- adjustForDpiScale Boolean (Optional)
- when true (by default) the x and y positions are multiplied by the DpiScaleX and DpiScaleY. This should be used when x and y are get from mouse location on the SceneView object. When x any y are from the SceneView.Width and SceneView.Height, then this parameter needs to be false.
- customHitTestOptions HitTestOptions (Optional)
- Optional HitTestOptions that will be used for this hit test. When null (by default), then DefaultHitTestOptions from Scene will be used.
Remarks
GetAllHitObjects method executes a hit testing from the specified x and y positions on the SceneNodes that are children of the specified rootSceneNode.
The hit objects are added to the specified allHitResults (as List{RayHitTestResult}).
Hit objects are added in order from the closest to the farthest object.
This method first creates a ray by calling GetRayFromCamera(Single, Single, Boolean) method and
then calls the GetAllHitObjects(ListRayHitTestResult, 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 only the closest hit result, use the GetClosestHitObject(Single, Single, Boolean, HitTestOptions) or GetClosestHitObject(Ray, HitTestOptions) methods.
See AlsoReference
GetAllHitObjects(ListRayHitTestResult, Single, Single, SceneNode, Boolean, HitTestOptions)