Configures wheel braking with brake torque and handbrake torque values.
Takes vehicleHandle (vehicle from b3dCreateVehicle), wheelIndex (wheel index from b3dAddVehicleWheel), brakeTorque (regular brake torque in Nm), handBrakeTorque (handbrake torque in Nm).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
vehicleHandleInt
wheelIndexInt
brakeTorqueDouble
handBrakeTorqueDouble
Returns
Void
Quick Summary
Configures wheel braking with brake torque and handbrake torque values.
Takes vehicleHandle (vehicle from b3dCreateVehicle), wheelIndex (wheel index from b3dAddVehicleWheel), brakeTorque (regular brake torque in Nm), handBrakeTorque (handbrake torque in Nm).
Returns nothing.
Technical Exegesis...
Configures wheel braking with brake torque and handbrake torque values. Takes vehicleHandle (vehicle created with b3dCreateVehicle), wheelIndex (0-based wheel index from b3dAddVehicleWheel), brakeTorque (regular brake torque in Newton-meters applied when forward < 0 in b3dSetVehicleInput), handBrakeTorque (handbrake/parking brake torque in Newton-meters applied when handBrake > 0 in b3dSetVehicleInput). Returns nothing.
Configures wheel braking with brake torque and handbrake torque values. Takes vehicleHandle (vehicle created with b3dCreateVehicle), wheelIndex (0-based wheel index from b3dAddVehicleWheel), brakeTorque (regular brake torque in Newton-meters applied when forward < 0 in b3dSetVehicleInput), handBrakeTorque (handbrake/parking brake torque in Newton-meters applied when handBrake > 0 in b3dSetVehicleInput). Returns nothing. Sets brake torque for wheel in Jolt WheeledVehicle, determines braking power when brakes engaged.
This function configures braking. Parameters: brakeTorque (regular brake torque in Nm, applied when b3dSetVehicleInput forward < 0, higher = stronger braking, typical car 1000-2000 Nm per wheel, typical truck 2000-4000 Nm), handBrakeTorque (handbrake/parking brake torque in Nm, applied when b3dSetVehicleInput handBrake > 0, typically higher than brakeTorque 2000-4000 Nm, locks wheels for drifting). Brake behavior: forward = -1.0 applies full brakeTorque (maximum braking force), forward = -0.5 applies 50% brakeTorque (partial braking), handBrake = 1.0 applies full handBrakeTorque (maximum handbrake), handBrake = 0.5 applies 50% handBrakeTorque, both brakes can be applied simultaneously (total brake torque = brakeTorque * abs(forward) + handBrakeTorque * handBrake).
Typical configurations: all 4 wheels braking (sedan typically has brakeTorque on all wheels, handBrakeTorque only on rear wheels for drift capability), front-biased braking (front wheels higher brakeTorque 1500-2000 Nm, rear wheels lower 1000-1500 Nm, mimics real brake distribution), rear-only handbrake (typical car has handBrake only on rear wheels, front handBrakeTorque = 0, allows drift without affecting steering). Typical values: compact car (brakeTorque 1000-1500 Nm, handBrakeTorque 2500-3000 Nm rear), sedan (brakeTorque 1200-1800 Nm, handBrakeTorque 3000-3500 Nm rear), sports car (brakeTorque 1500-2500 Nm, handBrakeTorque 3500-4500 Nm rear), truck (brakeTorque 2000-4000 Nm, handBrakeTorque 4000-6000 Nm rear), race car (brakeTorque 2000-3500 Nm, handBrakeTorque 4000-5000 Nm rear).
Use cases: (1) Standard braking (configure all 4 wheels with brakeTorque, rear wheels with handBrakeTorque), (2) Arcade drift (high handBrakeTorque on rear wheels for easy drifting), (3) Simulation braking (front-biased brakeTorque for realistic brake balance), (4) Truck braking (very high brakeTorque for heavy loads), (5) Performance braking (high brakeTorque for quick stops). Common patterns: front wheels (brakeTorque 1800, handBrakeTorque 0), rear wheels (brakeTorque 1200, handBrakeTorque 3000).
Braking physics: brake torque opposes wheel rotation (slows angular velocity, reduces vehicle speed), excessive brake torque locks wheels (tire skids, loses traction, sliding instead of controlled braking), ABS typically not simulated (script ABS by modulating brakeTorque based on wheel slip if desired). Brake balance: front brakes typically stronger (60-70% braking force on front wheels in real cars, prevents rear lockup and spin-out), rear brakes weaker (30-40% braking force, maintains stability), configure front wheels higher brakeTorque than rear for realistic balance.
HandBrake usage: handbrake typically applied to rear wheels only (locks rear wheels for drift, front wheels maintain steering), handBrake input 0-1 scales handBrakeTorque (partial handbrake for controlled drift), combine with throttle for drift (forward > 0 and handBrake > 0 creates power slide). Drift mechanics: high handBrakeTorque on rear (2x-3x regular brakeTorque, easily locks rear wheels), reduced rear lateral friction (script lower friction for easier drift), or leave default for challenging drift.
Performance: O(1) operation (sets Jolt wheel brake parameters), braking applied during physics step (torque opposes wheel rotation, integrated into vehicle simulation). Validation: silently returns if vehicleHandle invalid, silently returns if wheelIndex out of bounds, no validation on torque values (negative values allowed but not meaningful, use positive values).