# 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)

*** ** * ** ***


```
public final class InputEvent.HitInfo
```

<br />

*** ** * ** ***

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

## Summary

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.HitInfo#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.HitInfo#getHitPosition()()` The position of the hit in the receiver's activity space. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity` | `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.HitInfo#getInputEntity()()` The `https://developer.android.com/reference/androidx/xr/scenecore/Entity` that was hit by the input ray. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Matrix4` | `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.HitInfo#getTransform()()` The matrix transforming activity space coordinates into the hit entity's local coordinate space. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.HitInfo#hashCode()()` |

## Public constructors

### HitInfo

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

```
public HitInfo(
    @NonNull Entity inputEntity,
    Vector3 hitPosition,
    @NonNull Matrix4 transform
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity inputEntity` | The `https://developer.android.com/reference/androidx/xr/scenecore/Entity` that was hit by the input ray. `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.Action#MOVE()`, `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.Action#UP()` and `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.Action#CANCEL()` events will report the same node as was hit during the initial `https://developer.android.com/reference/androidx/xr/scenecore/InputEvent.Action#DOWN()`. |
| `https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 hitPosition` | 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). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Matrix4 transform` | The matrix transforming activity space coordinates into the hit entity's local coordinate space. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getHitPosition

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

```
public final Vector3 getHitPosition()
```

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).

### getInputEntity

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

```
public final @NonNull Entity getInputEntity()
```

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

### getTransform

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

```
public final @NonNull Matrix4 getTransform()
```

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

### hashCode

```
public int hashCode()
```