Page Summary
-
HitTestResultstores the results of Scene hit tests, providing information about the hit. -
It contains data about the hit node, distance to the hit, and the hit location in world-space.
-
You can access this information via
getNode(),getDistance(), andgetPoint()methods respectively. -
Primarily used with
Scene.hitTestandScene.hitTestAllfor detecting collisions in AR scenes.
Stores the results of calls to Scene.hitTest and Scene.hitTestAll. Contains a node that was hit by the hit test, and associated information.
Public Constructors
Public Methods
| float |
getDistance()
Get the distance along the ray to the impact point on the surface of the collision shape.
|
| Node |
getNode()
The node that was hit by the hit test.
|
| Vector3 |
getPoint()
Get the position in world-space where the ray hit the collision shape.
|
Inherited Methods
Public Constructors
public HitTestResult ()
Public Methods
public float getDistance ()
Get the distance along the ray to the impact point on the surface of the collision shape.
Returns
- distance along the ray that the hit occurred at
public Node getNode ()
The node that was hit by the hit test. Null when there is no hit.
Returns
- the hit node
public Vector3 getPoint ()
Get the position in world-space where the ray hit the collision shape.
Returns
- a new vector that represents the position in world-space that the hit occurred at