HitTestResult


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 constructors

HitTestResult(
    hitPosition: Vector3?,
    surfaceNormal: Vector3?,
    surfaceType: Int,
    distance: Float
)

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public properties

Float

the distance from the origin to the hit location.

Vector3?

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

Vector3?

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

Int

the HitTestSurfaceType that was hit.

Public constructors

HitTestResult

Added in 1.0.0-alpha04
HitTestResult(
    hitPosition: Vector3?,
    surfaceNormal: Vector3?,
    surfaceType: Int,
    distance: Float
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

distance

Added in 1.0.0-alpha04
val distanceFloat

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

hitPosition

Added in 1.0.0-alpha04
val hitPositionVector3?

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

surfaceNormal

Added in 1.0.0-alpha04
val surfaceNormalVector3?

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

surfaceType

Added in 1.0.0-alpha04
val surfaceTypeInt

the HitTestSurfaceType that was hit.