b3dAddVehicleAntiRollBar

Adds anti-roll bar linking two wheels to reduce body roll in turns. Takes vehicleHandle (vehicle from b3dCreateVehicle), leftWheelIndex/rightWheelIndex (wheel indices from b3dAddVehicleWheel), stiffness (anti-roll bar stiffness coefficient). Returns nothing.

3D Graphics

Parameters & Returns

Parameters

vehicleHandle Int
leftWheelIndex Int
rightWheelIndex Int
stiffness Double

Returns

Void

Quick Summary

Adds anti-roll bar linking two wheels to reduce body roll in turns. Takes vehicleHandle (vehicle from b3dCreateVehicle), leftWheelIndex/rightWheelIndex (wheel indices from b3dAddVehicleWheel), stiffness (anti-roll bar stiffness coefficient). Returns nothing.

Technical Exegesis...

Adds anti-roll bar (sway bar) linking two wheels to reduce body roll in turns. Takes vehicleHandle (vehicle created with b3dCreateVehicle), leftWheelIndex/rightWheelIndex (wheel indices from b3dAddVehicleWheel, typically left and right wheels on same axle), stiffness (anti-roll bar stiffness, higher = less body roll, typical 500-2000). Returns nothing. Creates stabilizer bar in Jolt vehicle physics that resists suspension compression differences between left and right wheels.

Example

Example.bam
; Add anti-roll bars to both axles
; Front axle (stiffer for responsive handling)
b3dAddVehicleAntiRollBar(vehicle, 0, 1, 1800.0)

; Rear axle (slightly softer for comfort)
b3dAddVehicleAntiRollBar(vehicle, 2, 3, 1400.0)

; Sports car with very stiff bars
b3dAddVehicleAntiRollBar(sportsCar, 0, 1, 2200.0)
b3dAddVehicleAntiRollBar(sportsCar, 2, 3, 2000.0)