RigidVehicle Class
Simple vehicle helper class with spherical rigid body wheels.
Constructor
Item Index
Methods
Properties
Methods
addToWorld
(
-
world
Add the vehicle including its constraints to the world.
Parameters:
-
worldWorld
addWheel
(
-
options
Add a wheel
Parameters:
-
optionsObject-
[isFrontWheel]Boolean optional -
[position]Vec3 optionalPosition of the wheel, locally in the chassis body.
-
[direction]Vec3 optionalSlide direction of the wheel along the suspension.
-
[axis]Vec3 optionalAxis of rotation of the wheel, locally defined in the chassis.
-
[body]Body optionalThe wheel body.
-
applyWheelForce
(
-
value -
wheelIndex
Apply a torque on one of the wheels.
Parameters:
-
valueNumber -
wheelIndexInteger
disableMotor
(
-
value -
wheelIndex
Set the target rotational speed of the hinge constraint.
Parameters:
-
valueNumber -
wheelIndexInteger
getWheelSpeed
(
-
wheelIndex
Get current rotational velocity of a wheel
Parameters:
-
wheelIndexInteger
removeFromWorld
(
-
world
Remove the vehicle including its constraints from the world.
Parameters:
-
worldWorld
setMotorSpeed
(
-
value -
wheelIndex
Set the target rotational speed of the hinge constraint.
Parameters:
-
valueNumber -
wheelIndexInteger
setSteeringValue
(
-
value -
wheelIndex
Set the steering value of a wheel.
Parameters:
-
valueNumber -
wheelIndexInteger
setWheelForce
(
-
value -
wheelIndex
Set the wheel force to apply on one of the wheels each time step
Parameters:
-
valueNumber -
wheelIndexInteger
