VehicleController¶
Add this component to a node to enable moving it like a vehicle.
Vehicles in games are usually more complex than standard physical objects: they have suspension, engines, and gearboxes that all interact to make movement feel realistic. This component can be used for such physical vehicles. It can:
Simulate acceleration and braking using gas and brake pedals
Steer the vehicle based on wheel configuration
Engage handbrakes and clutches
Manage automatic gear shifting and RPM
Handle suspension and wheel rotation constraints
Lean into turns like a two-wheeled motorcycle (optional)
Note
A RigidBody component is required for the vehicle to work properly, and a
Collider is recommended so the vehicle body collides with other objects.
See the documentation for RigidBody for details.
Simplest Example¶
A minimal 4-wheel car. Copy it, adjust the wheel positions to match your mesh, then wire the input fields to your controls in on_update:
var vehicleNode : NodeId
def on_initialize() {
vehicleNode = create_node(NodeData(name = "vehicle", position = float3(0, 10, 0)))
add_component(vehicleNode, new RigidBody())
add_component(vehicleNode, new VehicleController())
get_component(vehicleNode) $(var vc : VehicleController?) {
vc.wheels[0].position = float3(-1, 0, 1) // front-left
vc.wheels[0].maxSteeringAngle = deg_to_rad(30.)
vc.wheels[1].position = float3( 1, 0, 1) // front-right
vc.wheels[1].maxSteeringAngle = deg_to_rad(30.)
vc.wheels[2].position = float3(-1, 0, -1) // rear-left
vc.wheels[3].position = float3( 1, 0, -1) // rear-right
}
}
def on_update(dt : float) {
vehicleNode?.VehicleController.gasInput = 0. // -1..1
vehicleNode?.VehicleController.steeringInput = 0. // -1..1
vehicleNode?.VehicleController.brakeInput = 0. // 0..1
}
How It Works¶
Wheels
Think of the car body as floating in the air, held up by soft springs at each wheel position. The springs push against the ground and keep the body at the right height. The visual wheel meshes just hang down to where the springs end.
In real life a tire is a rubber ring that squishes against the road. Simulating actual rubber deformation in physics is very expensive, so games use a trick to achieve the same feel. At each wheel position, the physics system shoots a single ray straight down. When that ray hits the ground, a soft spring pushes the car body upward. The visual wheel mesh is then placed where the ray landed. This is why you configure a wheel with a position and radius rather than building a cylinder shape — the wheel is mostly a spring with some numbers attached to it, not a real physics object.
For most cars this ray is enough: the wheel is tucked under the car body, and the ray from the center of the wheel reliably finds the road. Switch to useCylinderShapes = true when the wheel is large or sticks out past the edges of the body (tractors, off-road trucks, go-karts) — in that case a wide cylinder cast catches rocks and kerbs that a single center ray would miss.
Engine and gears
gasInput
│
▼
Engine ──(RPM, torque)──► Gearbox ──(× gear ratio)──► Differential ──► Wheels
│ │
minRPM / maxRPM car moves forward
maxTorque / torqueCurve
A high gear ratio (1st gear) gives more force but less wheel speed — good for getting a heavy car moving. A low ratio (top gear) gives less force but more speed. Reverse ratios are negative, so the wheels spin the other way.
Other Parameters
All the other parameters — engine torque, gear ratios, spring stiffness, friction curves — have working defaults that produce a reasonable car. You don’t need to touch them to get started.
When you want a specific vehicle, look up its real-world specs. Gear ratios, differential ratios, and engine torque curves are published for most production cars and can be entered directly. Search for, e.g., "sedan gear ratios" or "engine torque curve data".
Configuration Parameters¶
Wheels¶
The wheels array holds one VehicleWheel entry per physical wheel:
position— Where the suspension attaches to the body, in local space.rotation— Wheel orientation as a quaternion. Controls the suspension travel direction, steering axis, and roll direction.radius— Wheel radius in metres.width— Wheel width in metres. Only matters whenuseCylinderShapesis true.maxSteeringAngle— How far this wheel can steer, in radians. Set to 0 for non-steering wheels.mass— Wheel mass in kg. Heavier wheels take longer to spin up or lock under braking (inertia = 0.5 × mass × radius²).visualNode— Child node moved to the wheel’s position each frame. Must be a child of the vehicle node.
Each wheel also exposes linearSpeed() — the wheel’s current linear speed (m/s) along its rolling direction, positive when rotating forward. Use it, e.g., to display individual wheel speeds: vc.wheels[i].linearSpeed().
Axles and Differentials¶
The axles array pairs wheels into differentials and controls torque distribution.
If the array is empty, wheels are paired automatically (0–1, 2–3, etc.) with equal torque split.
Each VehicleAxle entry has:
leftWheel— Index of the left wheel in thewheelsarray. Use -1 for no wheel on that side.rightWheel— Index of the right wheel in thewheelsarray. Use -1 for no wheel on that side.torque— How much engine torque goes to this axle relative to the others. Normalized across all axles automatically.differentialRatio— Final drive ratio. Multiplies all gear ratios.limitedSlipRatio— How much faster the fast wheel can spin compared to the slow one before torque shifts to the slow wheel. Use 1 for a locked diff, or a large value (e.g. 1e10) for open.
Suspension¶
These settings are shared by all wheels:
wheelsSuspensionRange— float2(min, max)travel in metres, measured downward from the attachment point.xis fully raised (compressed),yis fully lowered (extended).wheelsSuspensionSpring— float2(frequency, damping): bounce frequency in Hz and damping ratio (0 = no damping, 1 = critical damping, >1 = over-damped).
Engine¶
maxTorque— Peak torque in Nm.minRPM— Idle speed. The engine won’t drop below this.maxRPM— Rev limit. The engine won’t exceed this.inertia— Engine rotational inertia in kg·m². Higher values make the engine respond more slowly to throttle changes.angularDamping— How fast the engine loses speed when off throttle. Simulates internal friction.torqueCurve— Torque shape as a float2 array of(rpm_fraction, torque_fraction)points.xgoes from 0 (=minRPM) to 1 (=maxRPM);yis scaled bymaxTorque.
Transmission¶
gearRatios— Forward gear ratios; index 0 is 1st gear.reverseGearRatios— Reverse gear ratios; values must be negative.isAutomatic— Enables auto shifting. In manual mode, setcurrentGearandclutchInputdirectly each frame.clutchStrength— How strongly the clutch couples engine to wheels. Higher = more aggressive engagement.
The following settings only apply when isAutomatic is true:
shiftUpRPM— RPM at which the transmission shifts up.shiftDownRPM— RPM at which the transmission shifts down.switchTime— How long a gear change takes, in seconds.clutchReleaseTime— How long to re-engage the clutch after shifting, in seconds.switchLatency— Minimum time between shifts, in seconds.
Braking and Tire Friction¶
These settings are applied to every wheel:
wheelsMaxBrakeTorque— Max brake torque per wheel in Nm at fullbrakeInput.wheelsMaxHandBrakeTorque— Max hand-brake torque per wheel in Nm at fullhandbrakeInput.wheelsAngularDamping— Passive spin drag on all wheels. Prevents wheels spinning freely when airborne.wheelsLongitudinalFriction— Traction curve: float2 array of(slip_ratio, friction_factor). Slip ratio = (vehicle_speed − wheel_speed) / max(vehicle_speed, 1e-6).wheelsLateralFriction— Cornering curve: float2 array of(slip_angle_rad, friction_factor). Slip angle is the angle between the wheel’s heading and its actual travel direction.
Physics and Collision¶
maxPitchRollAngle— How far the vehicle can tilt from upright, in radians. Set toPIto disable.useCylinderShapes— If true, wheels use a cylinder cast for ground contact (more accurate on rough terrain, higher cost). If false, a downward raycast is used.wheelsCollisionLayer— Collision layer for wheel casts. SeeCollider.collisionLayer.
Motorcycle Lean¶
Set enableMotorcycleLean to turn a two-wheeled vehicle (one wheel per axle — see Axles and Differentials above) into a motorcycle: instead of just yawing when you steer, the body leans into turns and a spring holds it upright the rest of the time.
enableMotorcycleLean— Enables the motorcycle lean controller.leanMaxAngle— How far we’re willing to make the bike lean over in turns.leanSpring— float2(constant, damping)for the spring that pulls the bike back upright. UnlikewheelsSuspensionSpringthis is a raw stiffness/damping pair, not a frequency — its actual response depends on the vehicle’s real moment of inertia, so tune it by feel on the real vehicle rather than from the numbers alone.leanSpringIntegrationCoefficient— The lean spring applies an additional force equal to this coefficient × Integral(delta angle, 0, t), effectively making the lean spring a PID controller.leanSpringIntegrationCoefficientDecay— How much to decay the angle integral when the wheels are not touching the floor:new_value = e^(-decay * t) * value.leanSmoothingFactor— How much to smooth the lean angle (0 = no smoothing, 1 = lean angle never changes); depends on the physics frame rate since the formula issmoothing_factor * previous + (1 - smoothing_factor) * current.
Runtime Input¶
Set these fields every frame to drive the vehicle. They are not saved to the prefab.
gasInput— −1 to 1. In auto mode, negative values drive in reverse. In manual mode, use 0–1 for throttle only.steeringInput— −1 (full left) to 1 (full right).brakeInput— 0 to 1.handbrakeInput— 0 to 1.clutchInput— 0 (disengaged) to 1 (fully engaged). Manual mode only.
Runtime State¶
These fields are updated by the physics simulation each frame and are not saved to the prefab.
currentRPM— Engine RPM this frame. Can be set to pre-seed the RPM before the first update.currentGear— Current gear: −1 = reverse, 0 = neutral, 1 = 1st forward gear, etc.
Classes¶
- VehicleController : NativeComponent¶
class VehicleController
- Properties:
- VehicleController.gasInput: float¶
- VehicleController.gasInput =(value: float)¶
Value between -1 and 1 for auto transmission and value between 0 and 1 indicating desired driving direction and amount the gas pedal is pressed
- Arguments:
value : float
- VehicleController.steeringInput: float¶
- VehicleController.steeringInput =(value: float)¶
Value between -1 and 1 indicating desired steering angle (1 = right)
- Arguments:
value : float
- VehicleController.brakeInput: float¶
- VehicleController.brakeInput =(value: float)¶
Value between 0 and 1 indicating how strong the brake pedal is pressed
- Arguments:
value : float
- VehicleController.handbrakeInput: float¶
- VehicleController.handbrakeInput =(value: float)¶
Value between 0 and 1 indicating how strong the hand brake is pulled
- Arguments:
value : float
- VehicleController.clutchInput: float¶
- VehicleController.clutchInput =(value: float)¶
Value between 0 and 1 indicating how much friction the clutch gives (0 = no friction, 1 = full friction)
- Arguments:
value : float
- VehicleController.currentRPM: float¶
- VehicleController.currentRPM =(value: float)¶
Current amount of revolutions per minute (rpm) of a body
Note
This field is not serialized and is not saved to the prefab.
- Arguments:
value : float
- VehicleController.currentGear: int¶
- VehicleController.currentGear =(value: int)¶
Current gear, -1 = reverse, 0 = neutral, 1 = 1st gear etc.
Note
This field is not serialized and is not saved to the prefab.
- Arguments:
value : int
- VehicleController.maxTorque: float¶
- VehicleController.maxTorque =(value: float)¶
Max amount of torque (Nm) that the engine can deliver
- Arguments:
value : float
- VehicleController.minRPM: float¶
- VehicleController.minRPM =(value: float)¶
Min amount of revolutions per minute (rpm) the engine can produce without stalling
- Arguments:
value : float
- VehicleController.maxRPM: float¶
- VehicleController.maxRPM =(value: float)¶
Max amount of revolutions per minute (rpm) the engine can generate
- Arguments:
value : float
- VehicleController.inertia: float¶
- VehicleController.inertia =(value: float)¶
Moment of inertia (kg m^2) of the engine
- Arguments:
value : float
- VehicleController.maxPitchRollAngle: float¶
- VehicleController.maxPitchRollAngle =(value: float)¶
Defines the maximum pitch/roll angle (rad), can be used to avoid the car from getting upside down. The vehicle up direction will stay within a cone centered around the Y-axis with half top angle maxPitchRollAngle, set to PI to turn off.
- Arguments:
value : float
- VehicleController.angularDamping: float¶
- VehicleController.angularDamping =(value: float)¶
Angular damping factor of the wheel: dw/dt = -c * w. Value should be zero or positive and is usually close to 0.
- Arguments:
value : float
- VehicleController.useCylinderShapes: bool¶
- VehicleController.useCylinderShapes =(value: bool)¶
Whether to use a cylindrical shape for wheel collision resolution, or a simple downward raycast.
- Arguments:
value : bool
- VehicleController.wheelsCollisionLayer: uint8¶
- VehicleController.wheelsCollisionLayer =(value: uint8)¶
The collision layer that the wheels belongs to. See Collider.collisionLayer
- Arguments:
value : uint8
- VehicleController.wheels: VehicleWheelsHandle¶
Array of vehicle wheels
- VehicleController.axles: VehicleAxlesHandle¶
Array of axles defining wheel pairings and torque distribution
- VehicleController.wheelsAngularDamping: float¶
- VehicleController.wheelsAngularDamping =(value: float)¶
Angular damping factor of the wheels: dw/dt = -c * w. Applies to all wheels.
- Arguments:
value : float
- VehicleController.wheelsLongitudinalFriction: VehicleControllerWheelsLongitudinalFrictionHandle¶
Friction in the forward direction of the tire as a function of the slip ratio (ratio of wheel velocity to vehicle velocity): slip_ratio = (vehicle_speed - wheel_speed) / max(vehicle_speed, 1e-6). X-axis: slip ratio, Y-axis: friction factor. Applies to all wheels.
- VehicleController.wheelsLateralFriction: VehicleControllerWheelsLateralFrictionHandle¶
Friction in the sideways direction of the tire as a function of the slip angle (angle between the velocity of the wheel and the direction the wheel is pointing in the ground plane). X-axis: slip angle in radians, Y-axis: friction factor. Applies to all wheels.
- VehicleController.wheelsMaxBrakeTorque: float¶
- VehicleController.wheelsMaxBrakeTorque =(value: float)¶
How much torque (Nm) the brakes can apply to each wheel.
- Arguments:
value : float
- VehicleController.wheelsMaxHandBrakeTorque: float¶
- VehicleController.wheelsMaxHandBrakeTorque =(value: float)¶
How much torque (Nm) the hand brake can apply to each wheel (usually only applied to the rear wheels).
- Arguments:
value : float
- VehicleController.torqueCurve: VehicleTorqueCurveHandle¶
Y-axis: Curve that describes a ratio of the max torque the engine can produce (0 = 0, 1 = maxTorque). X-axis: the fraction of the RPM of the engine (0 = minRPM, 1 = maxRPM)
- VehicleController.gearRatios: VehicleGearRatiosHandle¶
Ratio in rotation rate between engine and gear box, first element is 1st gear, 2nd element 2nd gear etc.
- VehicleController.reverseGearRatios: VehicleReverseGearRatiosHandle¶
Ratio in rotation rate between engine and gear box when driving in reverse.
- VehicleController.wheelsSuspensionRange: float2¶
- VehicleController.wheelsSuspensionRange =(value: float2)¶
How long the suspension is in maximum upper and maximum lower positions in downward direction relative to the attachment point.
- Arguments:
value : float2
- VehicleController.wheelsSuspensionSpring: float2¶
- VehicleController.wheelsSuspensionSpring =(value: float2)¶
Settings for the suspension spring. The spring settings are packed to float2 where x is a spring frequency in Hz, and y is a spring damping (0 = no damping, 1 = critical damping, >1 = overdamp).
- Arguments:
value : float2
- VehicleController.isAutomatic: bool¶
- VehicleController.isAutomatic =(value: bool)¶
How to switch gears.
- Arguments:
value : bool
- VehicleController.switchTime: float¶
- VehicleController.switchTime =(value: float)¶
How long it takes to switch gears (s), only used in auto mode.
- Arguments:
value : float
- VehicleController.clutchReleaseTime: float¶
- VehicleController.clutchReleaseTime =(value: float)¶
How long it takes to release the clutch (go to full friction), only used in auto mode.
- Arguments:
value : float
- VehicleController.switchLatency: float¶
- VehicleController.switchLatency =(value: float)¶
How long to wait after releasing the clutch before another switch is attempted (s), only used in auto mode.
- Arguments:
value : float
- VehicleController.shiftUpRPM: float¶
- VehicleController.shiftUpRPM =(value: float)¶
If RPM of engine is bigger then this we will shift a gear up, only used in auto mode.
- Arguments:
value : float
- VehicleController.shiftDownRPM: float¶
- VehicleController.shiftDownRPM =(value: float)¶
If RPM of engine is smaller then this we will shift a gear down, only used in auto mode.
- Arguments:
value : float
- VehicleController.clutchStrength: float¶
- VehicleController.clutchStrength =(value: float)¶
Strength of the clutch when fully engaged. Total torque a clutch applies is Torque = ClutchStrength * (Velocity Engine - Avg Velocity Wheels At Clutch) (units: k m^2 s^-1).
- Arguments:
value : float
- VehicleController.enableMotorcycleLean: bool¶
- VehicleController.enableMotorcycleLean =(value: bool)¶
Enables the motorcycle lean controller: the vehicle body leans into turns like a two-wheeled motorcycle, balanced by a spring. Intended for a two-wheeled setup (one wheel per axle).
- Arguments:
value : bool
- VehicleController.leanMaxAngle: float¶
- VehicleController.leanMaxAngle =(value: float)¶
How far we’re willing to make the bike lean over in turns (angle)
- Arguments:
value : float
- VehicleController.leanSpring: float2¶
- VehicleController.leanSpring =(value: float2)¶
Settings for the lean spring that balances the motorcycle. Packed to float2 where x is the spring constant and y is the damping constant.
- Arguments:
value : float2
- VehicleController.leanSpringIntegrationCoefficient: float¶
- VehicleController.leanSpringIntegrationCoefficient =(value: float)¶
The lean spring applies an additional force equal to this coefficient * Integral(delta angle, 0, t), this effectively makes the lean spring a PID controller
- Arguments:
value : float
- VehicleController.leanSpringIntegrationCoefficientDecay: float¶
- VehicleController.leanSpringIntegrationCoefficientDecay =(value: float)¶
How much to decay the angle integral when the wheels are not touching the floor: new_value = e^(-decay * t) * value
- Arguments:
value : float
- VehicleController.leanSmoothingFactor: float¶
- VehicleController.leanSmoothingFactor =(value: float)¶
How much to smooth the lean angle (0 = no smoothing, 1 = lean angle never changes); Note that this is dependent on the physics frame rate because the formula is: smoothing_factor * previous + (1 - smoothing_factor) * current
- Arguments:
value : float
Structures¶
- VehicleWheelsHandle¶
Handle to the wheels field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- VehicleWheelsHandle.length(): int¶
Returns the number of elements in the array.
- VehicleWheelsHandle.push(): VehicleWheelHandle¶
Appends an element to the end of the array and returns a handle to it.
- VehicleWheelsHandle.pop()¶
Removes the last element from the array.
- VehicleWheelsHandle.clear()¶
Removes all elements from the array.
- VehicleWheelsHandle.insert(pos: int): VehicleWheelHandle¶
Inserts an element at the specified position in the array.
- Arguments:
pos : int
- VehicleWheelsHandle.erase(pos: int)¶
Removes the element at the specified position in the array.
- Arguments:
pos : int
- VehicleWheelsHandle.[](index: int): VehicleWheelHandle¶
Retrieves a handle to the i-th element of the array field.
- Arguments:
index : int
- VehicleWheelHandle¶
Handle to the i-th element of the wheels field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
index0 : int - Index within the
wheelsfield of the component.
- Properties:
- VehicleWheelHandle.position: float3¶
- VehicleWheelHandle.position =(value: float3)¶
Attachment point of wheel suspension in local space of the body
- Arguments:
value : float3
- VehicleWheelHandle.rotation: float4¶
- VehicleWheelHandle.rotation =(value: float4)¶
Orientation of the wheel
- Arguments:
value : float4
- VehicleWheelHandle.radius: float¶
- VehicleWheelHandle.radius =(value: float)¶
Radius of the wheel
- Arguments:
value : float
- VehicleWheelHandle.width: float¶
- VehicleWheelHandle.width =(value: float)¶
Width of the wheel
- Arguments:
value : float
- VehicleWheelHandle.maxSteeringAngle: float¶
- VehicleWheelHandle.maxSteeringAngle =(value: float)¶
How much this wheel can steer
- Arguments:
value : float
- VehicleWheelHandle.mass: float¶
- VehicleWheelHandle.mass =(value: float)¶
Mass of the wheel (kg). The moment of inertia is calculated as 0.5 * mass * radius^2 (solid cylinder approximation).
- Arguments:
value : float
- VehicleWheelHandle.visualNode: NodeId¶
- VehicleWheelHandle.visualNode =(value: NodeId)¶
Node that will be positioned at the wheel. Should be a child of the vehicle node.
- Arguments:
value : NodeId
- VehicleAxlesHandle¶
Handle to the axles field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- VehicleAxlesHandle.length(): int¶
Returns the number of elements in the array.
- VehicleAxlesHandle.push(): VehicleAxleHandle¶
Appends an element to the end of the array and returns a handle to it.
- VehicleAxlesHandle.pop()¶
Removes the last element from the array.
- VehicleAxlesHandle.clear()¶
Removes all elements from the array.
- VehicleAxlesHandle.insert(pos: int): VehicleAxleHandle¶
Inserts an element at the specified position in the array.
- Arguments:
pos : int
- VehicleAxlesHandle.erase(pos: int)¶
Removes the element at the specified position in the array.
- Arguments:
pos : int
- VehicleAxlesHandle.[](index: int): VehicleAxleHandle¶
Retrieves a handle to the i-th element of the array field.
- Arguments:
index : int
- VehicleAxleHandle¶
Handle to the i-th element of the axles field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
index0 : int - Index within the
axlesfield of the component.
- Properties:
- VehicleAxleHandle.leftWheel: int¶
- VehicleAxleHandle.leftWheel =(value: int)¶
Index (in wheels) that represents the left wheel of this differential (can be -1 to indicate no wheel)
- Arguments:
value : int
- VehicleAxleHandle.rightWheel: int¶
- VehicleAxleHandle.rightWheel =(value: int)¶
Index (in wheels) that represents the right wheel of this differential (can be -1 to indicate no wheel)
- Arguments:
value : int
- VehicleAxleHandle.torque: float¶
- VehicleAxleHandle.torque =(value: float)¶
How much of the engines torque is applied to this differential (0 = none, 1 = full).
- Arguments:
value : float
- VehicleAxleHandle.differentialRatio: float¶
- VehicleAxleHandle.differentialRatio =(value: float)¶
Ratio between rotation speed of gear box and wheels (final drive ratio). Multiplies all gear ratios.
- Arguments:
value : float
- VehicleAxleHandle.limitedSlipRatio: float¶
- VehicleAxleHandle.limitedSlipRatio =(value: float)¶
Ratio max / min wheel speed. When this ratio is exceeded, all torque gets distributed to the slowest moving wheel. This allows implementing a limited slip differential. Set to 1 for near-locked behavior, or a large value (e.g. 1e10) for an open differential.
- Arguments:
value : float
- VehicleControllerWheelsLongitudinalFrictionHandle¶
Handle to the wheelsLongitudinalFriction field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- VehicleControllerWheelsLongitudinalFrictionHandle.length(): int¶
Returns the number of elements in the array.
- VehicleControllerWheelsLongitudinalFrictionHandle.push(): VehicleControllerWheelsLongitudinalFrictionElemHandle¶
Appends an element to the end of the array and returns a handle to it.
- VehicleControllerWheelsLongitudinalFrictionHandle.pop()¶
Removes the last element from the array.
- VehicleControllerWheelsLongitudinalFrictionHandle.clear()¶
Removes all elements from the array.
- VehicleControllerWheelsLongitudinalFrictionHandle.insert(pos: int): VehicleControllerWheelsLongitudinalFrictionElemHandle¶
Inserts an element at the specified position in the array.
- Arguments:
pos : int
- VehicleControllerWheelsLongitudinalFrictionHandle.erase(pos: int)¶
Removes the element at the specified position in the array.
- Arguments:
pos : int
- VehicleControllerWheelsLongitudinalFrictionHandle.[](index: int): VehicleControllerWheelsLongitudinalFrictionElemHandle¶
Retrieves a handle to the i-th element of the array field.
- Arguments:
index : int
- VehicleControllerWheelsLongitudinalFrictionElemHandle¶
Handle to the i-th element of the wheelsLongitudinalFriction field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
index0 : int - Index within the
wheelsLongitudinalFrictionfield of the component.
- VehicleControllerWheelsLateralFrictionHandle¶
Handle to the wheelsLateralFriction field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- VehicleControllerWheelsLateralFrictionHandle.length(): int¶
Returns the number of elements in the array.
- VehicleControllerWheelsLateralFrictionHandle.push(): VehicleControllerWheelsLateralFrictionElemHandle¶
Appends an element to the end of the array and returns a handle to it.
- VehicleControllerWheelsLateralFrictionHandle.pop()¶
Removes the last element from the array.
- VehicleControllerWheelsLateralFrictionHandle.clear()¶
Removes all elements from the array.
- VehicleControllerWheelsLateralFrictionHandle.insert(pos: int): VehicleControllerWheelsLateralFrictionElemHandle¶
Inserts an element at the specified position in the array.
- Arguments:
pos : int
- VehicleControllerWheelsLateralFrictionHandle.erase(pos: int)¶
Removes the element at the specified position in the array.
- Arguments:
pos : int
- VehicleControllerWheelsLateralFrictionHandle.[](index: int): VehicleControllerWheelsLateralFrictionElemHandle¶
Retrieves a handle to the i-th element of the array field.
- Arguments:
index : int
- VehicleControllerWheelsLateralFrictionElemHandle¶
Handle to the i-th element of the wheelsLateralFriction field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
index0 : int - Index within the
wheelsLateralFrictionfield of the component.
- VehicleTorqueCurveHandle¶
Handle to the torqueCurve field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- VehicleTorqueCurveHandle.length(): int¶
Returns the number of elements in the array.
- VehicleTorqueCurveHandle.push(): VehicleTorqueCurveElemHandle¶
Appends an element to the end of the array and returns a handle to it.
- VehicleTorqueCurveHandle.pop()¶
Removes the last element from the array.
- VehicleTorqueCurveHandle.clear()¶
Removes all elements from the array.
- VehicleTorqueCurveHandle.insert(pos: int): VehicleTorqueCurveElemHandle¶
Inserts an element at the specified position in the array.
- Arguments:
pos : int
- VehicleTorqueCurveHandle.erase(pos: int)¶
Removes the element at the specified position in the array.
- Arguments:
pos : int
- VehicleTorqueCurveHandle.[](index: int): VehicleTorqueCurveElemHandle¶
Retrieves a handle to the i-th element of the array field.
- Arguments:
index : int
- VehicleTorqueCurveElemHandle¶
Handle to the i-th element of the torqueCurve field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
index0 : int - Index within the
torqueCurvefield of the component.
- VehicleGearRatiosHandle¶
Handle to the gearRatios field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- VehicleGearRatiosHandle.length(): int¶
Returns the number of elements in the array.
- VehicleGearRatiosHandle.push(): VehicleGearRatiosElemHandle¶
Appends an element to the end of the array and returns a handle to it.
- VehicleGearRatiosHandle.pop()¶
Removes the last element from the array.
- VehicleGearRatiosHandle.clear()¶
Removes all elements from the array.
- VehicleGearRatiosHandle.insert(pos: int): VehicleGearRatiosElemHandle¶
Inserts an element at the specified position in the array.
- Arguments:
pos : int
- VehicleGearRatiosHandle.erase(pos: int)¶
Removes the element at the specified position in the array.
- Arguments:
pos : int
- VehicleGearRatiosHandle.[](index: int): VehicleGearRatiosElemHandle¶
Retrieves a handle to the i-th element of the array field.
- Arguments:
index : int
- VehicleGearRatiosElemHandle¶
Handle to the i-th element of the gearRatios field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
index0 : int - Index within the
gearRatiosfield of the component.
- VehicleReverseGearRatiosHandle¶
Handle to the reverseGearRatios field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
- VehicleReverseGearRatiosHandle.length(): int¶
Returns the number of elements in the array.
- VehicleReverseGearRatiosHandle.push(): VehicleReverseGearRatiosElemHandle¶
Appends an element to the end of the array and returns a handle to it.
- VehicleReverseGearRatiosHandle.pop()¶
Removes the last element from the array.
- VehicleReverseGearRatiosHandle.clear()¶
Removes all elements from the array.
- VehicleReverseGearRatiosHandle.insert(pos: int): VehicleReverseGearRatiosElemHandle¶
Inserts an element at the specified position in the array.
- Arguments:
pos : int
- VehicleReverseGearRatiosHandle.erase(pos: int)¶
Removes the element at the specified position in the array.
- Arguments:
pos : int
- VehicleReverseGearRatiosHandle.[](index: int): VehicleReverseGearRatiosElemHandle¶
Retrieves a handle to the i-th element of the array field.
- Arguments:
index : int
- VehicleReverseGearRatiosElemHandle¶
Handle to the i-th element of the reverseGearRatios field of VehicleController component.
- Fields:
nodeId : NodeId - The node this component is attached to.
index0 : int - Index within the
reverseGearRatiosfield of the component.
Functions¶
clone (var handle: VehicleControllerWheelsLateralFrictionElemHandle; value: float2)
clone (var handle: VehicleControllerWheelsLongitudinalFrictionElemHandle; value: float2)
clone (var handle: VehicleGearRatiosElemHandle; value: float)
clone (var handle: VehicleReverseGearRatiosElemHandle; value: float)
clone (var handle: VehicleTorqueCurveElemHandle; value: float2)
float2 (handle: VehicleControllerWheelsLateralFrictionElemHandle) : float2
float2 (handle: VehicleControllerWheelsLongitudinalFrictionElemHandle) : float2
- clone(handle: VehicleControllerWheelsLateralFrictionElemHandle; value: float2)¶
- Arguments:
value : float2
- clone(handle: VehicleControllerWheelsLongitudinalFrictionElemHandle; value: float2)
- Arguments:
handle : VehicleControllerWheelsLongitudinalFrictionElemHandle
value : float2
- clone(handle: VehicleGearRatiosElemHandle; value: float)
- Arguments:
handle : VehicleGearRatiosElemHandle
value : float
- clone(handle: VehicleReverseGearRatiosElemHandle; value: float)
- Arguments:
handle : VehicleReverseGearRatiosElemHandle
value : float
- clone(handle: VehicleTorqueCurveElemHandle; value: float2)
- Arguments:
handle : VehicleTorqueCurveElemHandle
value : float2
- float(handle: VehicleGearRatiosElemHandle): float¶
- Arguments:
handle : VehicleGearRatiosElemHandle
- float(handle: VehicleReverseGearRatiosElemHandle): float
- Arguments:
handle : VehicleReverseGearRatiosElemHandle
- float2(handle: VehicleControllerWheelsLateralFrictionElemHandle): float2¶
- Arguments:
- float2(handle: VehicleControllerWheelsLongitudinalFrictionElemHandle): float2
- Arguments:
- float2(handle: VehicleTorqueCurveElemHandle): float2
- Arguments:
handle : VehicleTorqueCurveElemHandle
- linearSpeed(wheel: VehicleWheelHandle): float¶
Get the linear speed (m/s) of this wheel along its rolling direction. Positive means the wheel is rotating in the forward direction.
- Arguments:
wheel : VehicleWheelHandle