API Docs for: 0.6.0
Show:

RaycastVehicle Class

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

Parameters:

  • [options.chassisBody] Object optional
  • [options.indexRightAxis] Object optional
  • [options.indexLeftAxis] Object optional
  • [options.indexUpAxis] Object optional

Methods

addToWorld

(
  • world
)

Add the vehicle including its constraints to the world.

Parameters:

addWheel

(
  • [options]
)

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

Parameters:

  • [options] Object optional

applyEngineForce

(
  • value
  • wheelIndex
)

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

Parameters:

  • value Number
  • wheelIndex Integer

removeFromWorld

(
  • world
)

Remove the vehicle including its constraints from the world.

Parameters:

setBrake

(
  • brake
  • wheelIndex
)

Set the braking force of a wheel

Parameters:

  • brake Number
  • wheelIndex Integer

setSteeringValue

(
  • value
  • wheelIndex
)

Set the steering value of a wheel.

Parameters:

  • value Number
  • wheelIndex Integer

Properties

chassisBody

Body

indexForwardAxis

Integer

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

Default: 0

indexRightAxis

Integer

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

Default: 1

indexUpAxis

Integer

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

Default: 2

sliding

Boolean

Will be set to true if the car is sliding.

wheelInfos An array of WheelInfo objects.

Array