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
vehicleHandleInt
leftWheelIndexInt
rightWheelIndexInt
stiffnessDouble
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.
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.
Anti-roll bar physics: when one wheel compresses more than other (inside wheel in turn compresses, outside extends), anti-roll bar applies opposite forces (resists compression difference, reduces body roll angle), stiffness determines resistance strength (higher stiffness = stronger resistance = less roll). Use to improve handling stability and reduce body lean in turns.
Typical configurations: front axle anti-roll bar (links front-left and front-right, reduces nose dive and front roll), rear axle anti-roll bar (links rear-left and rear-right, reduces rear squat and roll), both axles (balanced roll resistance, best stability). Stiffness values: soft (500-1000 for comfort-oriented), moderate (1000-1500 for balanced), stiff (1500-2500 for sports/racing, minimal body roll).
Use cases: (1) Sports car (high stiffness for flat cornering), (2) SUV (moderate stiffness to reduce tip-over risk), (3) Rally car (balanced stiffness for rough terrain), (4) Race car (very high stiffness for maximum stability). Common patterns: front bar (b3dAddVehicleAntiRollBar(vehicle, 0, 1, 1500)), rear bar (b3dAddVehicleAntiRollBar(vehicle, 2, 3, 1200)).
Related: b3dAddVehicleWheel adds wheels (anti-roll bar links these wheels), b3dSetVehicleAntiRollbar updates stiffness after creation.
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)