HitTestResult


public final class HitTestResult


Specifies an intersection between a ray and the Scene.

This can be obtained by running ScenePose.hitTest or ScenePose.hitTestAsync.

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, or POSITIVE_INFINITY if nothing was hit.

final Vector3

the Vector3 position of the intersection between a ray and the Scene, or null if nothing was hit.

final Vector3

The normal of the surface of the Entity or surface that was hit, or null if nothing was hit.

final int

the HitTestResult.SurfaceType that was hit.

int

Public constructors

HitTestResult

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

Public methods

equals

public boolean equals(Object other)

getDistance

Added in 1.0.0-alpha05
public final float getDistance()

the distance from the origin to the hit location, or POSITIVE_INFINITY if nothing was hit.

getHitPosition

Added in 1.0.0-alpha05
public final Vector3 getHitPosition()

the Vector3 position of the intersection between a ray and the Scene, or null if nothing was hit.

getSurfaceNormal

Added in 1.0.0-alpha05
public final Vector3 getSurfaceNormal()

The normal of the surface of the Entity or surface that was hit, or null if nothing was hit.

getSurfaceType

Added in 1.0.0-alpha05
public final int getSurfaceType()

the HitTestResult.SurfaceType that was hit.

hashCode

public int hashCode()