# RaycastResult

Class · category: Physics

Source: https://github.com/playcanvas/engine/blob/f059dc005842f76e052cdf44d8370c8c7ec475ac/src/framework/components/rigid-body/raycast-result.js#L17

Contains the result of a successful raycast intersection with a rigid body. When a ray
intersects with a rigid body in the physics simulation, this class stores the complete
information about that intersection including the entity, the exact point of impact, the normal
at the impact point, and the fractional distance along the ray where the intersection occurred.

Instances of this class are created and returned by [RigidBodyComponentSystem#raycastFirst](https://api.playcanvas.com/engine/classes/RigidBodyComponentSystem.md#raycastfirst)
and [RigidBodyComponentSystem#raycastAll](https://api.playcanvas.com/engine/classes/RigidBodyComponentSystem.md#raycastall) methods when performing physics raycasts.

## Properties

### entity

```ts
entity: Entity
```

The entity that was hit.

### hitFraction

```ts
hitFraction: number
```

The normalized distance (between 0 and 1) at which the ray hit occurred from the
starting point.

### normal

```ts
normal: Vec3
```

The normal vector of the surface where the ray hit in world space.

### point

```ts
point: Vec3
```

The point at which the ray hit the entity in world space.
