HitTestResult


public final class HitTestResult


Specifies an intersection between a ray and the Scene.

This can be obtained by running ScenePose.hitTest and related methods.

Summary

Nested types

public static class HitTestResult.SurfaceType

Public constructors

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

Public methods

boolean
equals(Object other)
final @FloatRange(from = 0.0) float

the distance from the origin to the hit location.

final @NonNull Vector3

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

final Vector3

The normal of the surface of the Entity or surface that was hit, or null if the normal could not be computed.

final int

the HitTestResult.SurfaceType that was hit.

int

Public constructors

HitTestResult

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

Public methods

equals

public boolean equals(Object other)

getDistance

Added in 1.0.0-alpha09
public final @FloatRange(from = 0.0) float getDistance()

the distance from the origin to the hit location.

getHitPosition

Added in 1.0.0-alpha09
public final @NonNull Vector3 getHitPosition()

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

getSurfaceNormal

Added in 1.0.0-alpha09
public final Vector3 getSurfaceNormal()

The normal of the surface of the Entity or surface that was hit, or null if the normal could not be computed.

getSurfaceType

Added in 1.0.0-alpha09
public final int getSurfaceType()

the HitTestResult.SurfaceType that was hit.

hashCode

public int hashCode()