HitTestResult


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

Vector3?

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

Vector3?

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

Int

the HitTestResult.SurfaceType that was hit.

Public constructors

HitTestResult

Added in 1.0.0-alpha05
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-alpha05
val distanceFloat

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

hitPosition

Added in 1.0.0-alpha05
val hitPositionVector3?

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

surfaceNormal

Added in 1.0.0-alpha05
val surfaceNormalVector3?

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

surfaceType

Added in 1.0.0-alpha05
val surfaceTypeInt

the HitTestResult.SurfaceType that was hit.