Constructors
constructor
Parameters
options: { chassisBody?: Body; coordinateSystem?: Vec3 } = {}
Optional chassisBody?: Body
Optional coordinateSystem?: Vec3
Properties
wheelForces
wheelForces: number[]
Methods
addToWorld
- addToWorld(world: World): void
addWheel
- addWheel(options?: { axis?: Vec3; body?: Body; direction?: Vec3; position?: Vec3 }): number
Parameters
options: { axis?: Vec3; body?: Body; direction?: Vec3; position?: Vec3 } = {}
Optional axis?: Vec3
Optional body?: Body
Optional direction?: Vec3
Optional position?: Vec3
Returns number
applyWheelForce
- applyWheelForce(value: number, wheelIndex: number): void
Parameters
value: number
wheelIndex: number
Returns void
disableMotor
- disableMotor(wheelIndex: number): void
getWheelSpeed
- getWheelSpeed(wheelIndex: number): number
removeFromWorld
- removeFromWorld(world: World): void
setMotorSpeed
- setMotorSpeed(value: number, wheelIndex: number): void
Parameters
value: number
wheelIndex: number
Returns void
setSteeringValue
- setSteeringValue(value: number, wheelIndex: number): void
Parameters
value: number
wheelIndex: number
Returns void
setWheelForce
- setWheelForce(value: number, wheelIndex: number): void
Parameters
value: number
wheelIndex: number
Returns void
Simple vehicle helper class with spherical rigid body wheels.