#

API Docs for: 0.6.0
Show: Inherited Protected Private Deprecated

# RaycastVehicle Class

Defined in: `src/objects/RaycastVehicle.js:10`

Vehicle helper class that casts rays from the wheel positions towards the ground and applies forces.

## Constructor

### `RaycastVehicle`

(

- `[options.chassisBody]`
- `[options.indexRightAxis]`
- `[options.indexLeftAxis]`
- `[options.indexUpAxis]`

)

Defined in `src/objects/RaycastVehicle.js:10`

#### Parameters:

- `[options.chassisBody]` Object optional
- `[options.indexRightAxis]` Object optional
- `[options.indexLeftAxis]` Object optional
- `[options.indexUpAxis]` Object optional

- Index
- Methods
- Properties

## Item Index

### Methods

- addToWorld
- addWheel
- applyEngineForce
- removeFromWorld
- setBrake
- setSteeringValue

### Properties

- chassisBody
- indexForwardAxis
- indexRightAxis
- indexUpAxis
- sliding
- wheelInfos An array of WheelInfo objects.
- world

## Methods

### `addToWorld`

(

- `world`

)

Defined in `src/objects/RaycastVehicle.js:120`

Add the vehicle including its constraints to the world.

#### Parameters:

- `world` World

### `addWheel`

(

- `[options]`

)

Defined in `src/objects/RaycastVehicle.js:72`

Add a wheel. For information about the options, see WheelInfo.

#### Parameters:

- `[options]` Object optional

### `applyEngineForce`

(

- `value`
- `wheelIndex`

)

Defined in `src/objects/RaycastVehicle.js:100`

Set the wheel force to apply on one of the wheels each time step

#### Parameters:

- `value` Number
- `wheelIndex` Integer

### `removeFromWorld`

(

- `world`

)

Defined in `src/objects/RaycastVehicle.js:269`

Remove the vehicle including its constraints from the world.

#### Parameters:

- `world` World

### `setBrake`

(

- `brake`
- `wheelIndex`

)

Defined in `src/objects/RaycastVehicle.js:110`

Set the braking force of a wheel

#### Parameters:

- `brake` Number
- `wheelIndex` Integer

### `setSteeringValue`

(

- `value`
- `wheelIndex`

)

Defined in `src/objects/RaycastVehicle.js:87`

Set the steering value of a wheel.

#### Parameters:

- `value` Number
- `wheelIndex` Integer

## Properties

### `chassisBody`

Body

Defined in `src/objects/RaycastVehicle.js:21`

### `indexForwardAxis`

Integer

Defined in `src/objects/RaycastVehicle.js:49`

Index of the forward axis, 0=x, 1=y, 2=z

Default: 0

### `indexRightAxis`

Integer

Defined in `src/objects/RaycastVehicle.js:42`

Index of the right axis, 0=x, 1=y, 2=z

Default: 1

### `indexUpAxis`

Integer

Defined in `src/objects/RaycastVehicle.js:56`

Index of the up axis, 0=x, 1=y, 2=z

Default: 2

### `sliding`

Boolean

Defined in `src/objects/RaycastVehicle.js:31`

Will be set to true if the car is sliding.

### `wheelInfos An array of WheelInfo objects.`

Array

Defined in `src/objects/RaycastVehicle.js:26`

### `world`

World

Defined in `src/objects/RaycastVehicle.js:37`