Click or drag to resize
Ab4d.SharpEngine logo

SceneViewGetAllHitObjects(Ray, HitTestOptions) Method

GetAllHitObjects method executes a hit testing by using the specified Ray on the SceneNodes that are shown by this SceneView and returns a list of RayHitTestResult objects sorted from the closest to the farthest object. When no object is hit, an empty list is returned.

Namespace: Ab4d.SharpEngine
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public List<RayHitTestResult> GetAllHitObjects(
	Ray ray,
	HitTestOptions? customHitTestOptions = null
)

Parameters

ray  Ray
Ray object that defines the ray that is used for hit testing
customHitTestOptions  HitTestOptions  (Optional)
Optional HitTestOptions that will be used for this hit test. When null (by default), then DefaultHitTestOptions from Scene will be used.

Return Value

ListRayHitTestResult
a list of RayHitTestResult objects or an empty list when no object is hit
Remarks

GetAllHitObjects method executes a hit testing on the SceneNodes that are shown by this SceneView and 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, Boolean) or GetRayFromNearPlane(Single, Single, Boolean, Boolean) methods. You can also use the [!:GetAllHitObjects(float, float, bool)] 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(float, float, bool)] or [!:GetClosestHitObject(Ray)] methods.

See Also

Reference

SceneView Class
GetAllHitObjects Overload
Ab4d.SharpEngine Namespace
[!:GetAllHitObjects(float, float, bool)]