Click or drag to resize
Ab4d.SharpEngine logo

SceneViewGetAllHitObjects(ListRayHitTestResult, Ray, SceneNode, HitTestOptions) Method

GetAllHitObjects method executes a hit testing by using the specified Ray 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.SharpEngine
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 3.1.9316+94bbd23b55747f096f056a5602f7dd90558b3673
Syntax
C#
public void GetAllHitObjects(
	List<RayHitTestResult> allHitResults,
	Ray ray,
	SceneNode? rootSceneNode,
	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
SceneNode where the hit testing begins - only rootSceneNode and its child SceneNodes are hit tested.
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 by using the specified Ray 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 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.

See Also