#

API Docs for: 0.6.1
Show: Inherited Protected Private Deprecated

# RaycastResult Class

Defined in: `src/collision/RaycastResult.js:5`

Storage for Ray casting data.

## Constructor

### `RaycastResult`

()

Defined in `src/collision/RaycastResult.js:5`

- Index
- Methods
- Properties

## Item Index

### Methods

- abort
- reset
- set

### Properties

- _shouldStop
- body
- distance
- hasHit
- hitFaceIndex
- hitNormalWorld
- hitPointWorld
- rayFromWorld
- rayToWorld
- shape

## Methods

### `abort`

()

Defined in `src/collision/RaycastResult.js:89`

### `reset`

()

Defined in `src/collision/RaycastResult.js:72`

Reset all result data.

### `set`

(

- `rayFromWorld`
- `rayToWorld`
- `hitNormalWorld`
- `hitPointWorld`
- `shape`
- `body`
- `distance`

)

Defined in `src/collision/RaycastResult.js:96`

#### Parameters:

- `rayFromWorld` Vec3
- `rayToWorld` Vec3
- `hitNormalWorld` Vec3
- `hitPointWorld` Vec3
- `shape` Shape
- `body` Body
- `distance` Number

## Properties

### `_shouldStop`

Boolean private

Defined in `src/collision/RaycastResult.js:63`

If the ray should stop traversing the bodies.

Default: false

### `body`

Body

Defined in `src/collision/RaycastResult.js:43`

The hit body, or null.

### `distance`

Number

Defined in `src/collision/RaycastResult.js:56`

Distance to the hit. Will be set to -1 if there was no hit.

Default: -1

### `hasHit`

Boolean

Defined in `src/collision/RaycastResult.js:32`

### `hitFaceIndex`

Number

Defined in `src/collision/RaycastResult.js:49`

The index of the hit triangle, if the hit shape was a trimesh.

Default: -1

### `hitNormalWorld`

Vec3

Defined in `src/collision/RaycastResult.js:22`

### `hitPointWorld`

Vec3

Defined in `src/collision/RaycastResult.js:27`

### `rayFromWorld`

Vec3

Defined in `src/collision/RaycastResult.js:12`

### `rayToWorld`

Vec3

Defined in `src/collision/RaycastResult.js:17`

### `shape`

Shape

Defined in `src/collision/RaycastResult.js:37`

The hit shape, or null.