API Docs for: 0.6.1
Show:

RigidVehicle Class

Simple vehicle helper class with spherical rigid body wheels.

Constructor

RigidVehicle

(
  • [options.chassisBody]
)

Parameters:

  • [options.chassisBody] Body optional

Methods

addToWorld

(
  • world
)

Add the vehicle including its constraints to the world.

Parameters:

addWheel

(
  • options
)

Add a wheel

Parameters:

  • options Object
    • [isFrontWheel] Boolean 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
)

Apply a torque on one of the wheels.

Parameters:

  • value Number
  • wheelIndex Integer

disableMotor

(
  • value
  • wheelIndex
)

Set the target rotational speed of the hinge constraint.

Parameters:

  • value Number
  • wheelIndex Integer

getWheelSpeed

(
  • wheelIndex
)

Get current rotational velocity of a wheel

Parameters:

  • wheelIndex Integer

removeFromWorld

(
  • world
)

Remove the vehicle including its constraints from the world.

Parameters:

setMotorSpeed

(
  • value
  • wheelIndex
)

Set the target rotational speed of the hinge constraint.

Parameters:

  • value Number
  • wheelIndex Integer

setSteeringValue

(
  • value
  • wheelIndex
)

Set the steering value of a wheel.

Parameters:

  • value Number
  • wheelIndex Integer

setWheelForce

(
  • value
  • wheelIndex
)

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

Parameters:

  • value Number
  • wheelIndex Integer

Properties

chassisBody

Body

constraints

Array

coordinateSystem

Vec3