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:
-
world
World
addWheel
(
-
options
Add a wheel
Parameters:
-
options
Object-
[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:
-
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:
-
world
World
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