#

API Docs for: 0.6.0
Show: Inherited Protected Private Deprecated

# RigidVehicle Class

Defined in: `src/objects/RigidVehicle.js:9`

Simple vehicle helper class with spherical rigid body wheels.

## Constructor

### `RigidVehicle`

(

- `[options.chassisBody]`

)

Defined in `src/objects/RigidVehicle.js:9`

#### Parameters:

- `[options.chassisBody]` Object optional

- Index
- Methods
- Properties

## Item Index

### Methods

- addToWorld
- addWheel
- applyWheelForce
- disableMotor
- getWheelSpeed
- removeFromWorld
- setMotorSpeed
- setSteeringValue
- setWheelForce

### Properties

- chassisBody
- constraints
- coordinateSystem

## Methods

### `addToWorld`

(

- `world`

)

Defined in `src/objects/RigidVehicle.js:162`

Add the vehicle including its constraints to the world.

#### Parameters:

- `world` World

### `addWheel`

(

- `options`

)

Defined in `src/objects/RigidVehicle.js:45`

Add a wheel

#### Parameters:

- `options` Object
  - `[isFrontWheel]` Object optional
  - `[position]` Vec3 optional

    Position of the wheel, locally in the chassis body.

  - `[direction]` Vec3 optional

    Slide direction of the wheel along the suspension.

  - `[axis]` Vec3 optional

    Axis of rotation of the wheel, locally defined in the chassis.

  - `[body]` Body optional

    The wheel body.

### `applyWheelForce`

(

- `value`
- `wheelIndex`

)

Defined in `src/objects/RigidVehicle.js:146`

Apply a torque on one of the wheels.

#### Parameters:

- `value` Number
- `wheelIndex` Integer

### `disableMotor`

(

- `value`
- `wheelIndex`

)

Defined in `src/objects/RigidVehicle.js:123`

Set the target rotational speed of the hinge constraint.

#### Parameters:

- `value` Number
- `wheelIndex` Integer

### `getWheelSpeed`

(

- `wheelIndex`

)

Defined in `src/objects/RigidVehicle.js:209`

Get current rotational velocity of a wheel

#### Parameters:

- `wheelIndex` Integer

### `removeFromWorld`

(

- `world`

)

Defined in `src/objects/RigidVehicle.js:189`

Remove the vehicle including its constraints from the world.

#### Parameters:

- `world` World

### `setMotorSpeed`

(

- `value`
- `wheelIndex`

)

Defined in `src/objects/RigidVehicle.js:111`

Set the target rotational speed of the hinge constraint.

#### Parameters:

- `value` Number
- `wheelIndex` Integer

### `setSteeringValue`

(

- `value`
- `wheelIndex`

)

Defined in `src/objects/RigidVehicle.js:89`

Set the steering value of a wheel.

#### Parameters:

- `value` Number
- `wheelIndex` Integer

### `setWheelForce`

(

- `value`
- `wheelIndex`

)

Defined in `src/objects/RigidVehicle.js:136`

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

#### Parameters:

- `value` Number
- `wheelIndex` Integer

## Properties

### `chassisBody`

Body

Defined in `src/objects/RigidVehicle.js:24`

### `constraints`

Array

Defined in `src/objects/RigidVehicle.js:35`

### `coordinateSystem`

Vec3

Defined in `src/objects/RigidVehicle.js:18`