HitTestResult


public final class HitTestResult


Defines an intersection between a ray and the scene.

This can be obtained by running hitTest or hitTestAsync on an ActivityPose.

Summary

Nested types

public static class HitTestResult.SurfaceType

Public constructors

HitTestResult(
    Vector3 hitPosition,
    Vector3 surfaceNormal,
    int surfaceType,
    float distance
)

Public methods

boolean
equals(Object other)
final float

the distance from the origin to the hit location.

final Vector3

the Vector3 position of the intersection between a ray and the Scene.

final Vector3

The normal of the surface of the entity that was hit.

final int

the HitTestSurfaceType that was hit.

int

Public constructors

HitTestResult

Added in 1.0.0-alpha04
public HitTestResult(
    Vector3 hitPosition,
    Vector3 surfaceNormal,
    int surfaceType,
    float distance
)

Public methods

equals

public boolean equals(Object other)

getDistance

Added in 1.0.0-alpha04
public final float getDistance()

the distance from the origin to the hit location. If nothing was hit the distance will be POSITIVE_INFINITY.

getHitPosition

Added in 1.0.0-alpha04
public final Vector3 getHitPosition()

the Vector3 position of the intersection between a ray and the Scene. This will be null if nothing was hit

getSurfaceNormal

Added in 1.0.0-alpha04
public final Vector3 getSurfaceNormal()

The normal of the surface of the entity that was hit. This will be null if nothing was hit

getSurfaceType

Added in 1.0.0-alpha04
public final int getSurfaceType()

the HitTestSurfaceType that was hit.

hashCode

public int hashCode()