# InputEvent.HitInfo

Artifact: [androidx.xr.scenecore:scenecore](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/InputEvent.kt+class:androidx.xr.scenecore.InputEvent.HitInfo) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class InputEvent.HitInfo
```

<br />

*** ** * ** ***

Information about the hit result of the input ray, originating from one of the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Source`, and intersecting with some `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` on the scene.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.HitInfo#HitInfo(androidx.xr.scenecore.Entity,androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Matrix4)(inputEntity: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity, hitPosition: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3?, transform: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Matrix4)` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.HitInfo#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.HitInfo#hashCode()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.HitInfo#hitPosition()` The position of the hit in the receiver's activity space. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.HitInfo#inputEntity()` The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` that was hit by the input ray. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Matrix4` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.HitInfo#transform()` The matrix transforming activity space coordinates into the hit entity's local coordinate space. |

## Public constructors

### HitInfo

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
HitInfo(inputEntity: Entity, hitPosition: Vector3?, transform: Matrix4)
```

| Parameters |
|---|---|
| `inputEntity: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` | The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` that was hit by the input ray. `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Action#MOVE()`, `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Action#UP()` and `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Action#CANCEL()` events will report the same node as was hit during the initial `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Action#DOWN()`. |
| `hitPosition: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3?` | The position of the hit in the receiver's activity space. All events may report the current ray's hit position. This can be null if there no longer is a collision between the ray and the input node (e.g. during a drag event). |
| `transform: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Matrix4` | The matrix transforming activity space coordinates into the hit entity's local coordinate space. |

## Public functions

### equals

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

### hashCode

```
open fun hashCode(): Int
```

## Public properties

### hitPosition

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val hitPosition: Vector3?
```

The position of the hit in the receiver's activity space. All events may report the current ray's hit position. This can be null if there no longer is a collision between the ray and the input node (e.g. during a drag event).

### inputEntity

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val inputEntity: Entity
```

The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Entity` that was hit by the input ray. `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Action#MOVE()`, `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Action#UP()` and `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Action#CANCEL()` events will report the same node as was hit during the initial `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/InputEvent.Action#DOWN()`.

### transform

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val transform: Matrix4
```

The matrix transforming activity space coordinates into the hit entity's local coordinate space.