Most visited

Recently visited

HitTestResult

public class HitTestResult
extends Object

java.lang.Object
   ↳ com.viro.core.HitTestResult


HitTestResult encapsulates a single result of a virtual based hit-test. Virtual hit-tests are hit-tests that intersect virtual (e.g. not real-world) objects, and are initiated from ViroView. These hit tests are a mechanism to discover what virtual world objects are contained along a given ray in the Scene or at a given 2D point on the ViroView.

Summary

Public methods

float getDistance()

Get the distance from the origin of the intersection ray to the intersection point, in world space.

Vector getIntersectionPoint()

Get the point in world space where the source ray intersected a virtual object.

String getTag()

Get the tag of the Node that this hit-test intersected.

Public methods

getDistance

float getDistance ()

Get the distance from the origin of the intersection ray to the intersection point, in world space.

Returns
float The distance between the origin of the intersection ray and the intersection point.

getIntersectionPoint

Vector getIntersectionPoint ()

Get the point in world space where the source ray intersected a virtual object.

Returns
Vector The intersection point of the hit-test, in world coordinates.

getTag

String getTag ()

Get the tag of the Node that this hit-test intersected. Tags are used to identify the intersected Node; they can be set via setTag(String).

Returns
String The tag of the intersected Node.

Hooray!