Configures wheel tire friction for lateral (cornering) and longitudinal (acceleration/braking) forces.
Takes vehicleHandle (vehicle from b3dCreateVehicle), wheelIndex (wheel index from b3dAddVehicleWheel), lateralFriction (sideways tire friction affecting cornering), longitudinalFriction (forward/backward tire friction affecting acceleration/braking).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
vehicleHandleInt
wheelIndexInt
lateralFrictionDouble
longitudinalFrictionDouble
Returns
Void
Quick Summary
Configures wheel tire friction for lateral (cornering) and longitudinal (acceleration/braking) forces.
Takes vehicleHandle (vehicle from b3dCreateVehicle), wheelIndex (wheel index from b3dAddVehicleWheel), lateralFriction (sideways tire friction affecting cornering), longitudinalFriction (forward/backward tire friction affecting acceleration/braking).
Returns nothing.
Technical Exegesis...
Configures wheel tire friction for lateral (cornering) and longitudinal (acceleration/braking) forces. Takes vehicleHandle (vehicle from b3dCreateVehicle), wheelIndex (0-based wheel index from b3dAddVehicleWheel), lateralFriction (tire friction coefficient for sideways forces, affects cornering grip, typical 0.8-2.0), longitudinalFriction (tire friction coefficient for forward/backward forces, affects acceleration and braking grip, typical 0.8-2.0). Returns nothing.
Configures wheel tire friction for lateral (cornering) and longitudinal (acceleration/braking) forces. Takes vehicleHandle (vehicle from b3dCreateVehicle), wheelIndex (0-based wheel index from b3dAddVehicleWheel), lateralFriction (tire friction coefficient for sideways forces, affects cornering grip, typical 0.8-2.0), longitudinalFriction (tire friction coefficient for forward/backward forces, affects acceleration and braking grip, typical 0.8-2.0). Returns nothing. Sets Jolt tire friction model determining how much grip wheel has for turning and accelerating/braking.
This function configures tire friction. Parameters: lateralFriction (sideways friction coefficient, higher = better cornering grip, lower = easier drifting, typical values 0.8-1.2 normal tires, 1.5-2.0 racing slicks, 0.3-0.6 ice/snow), longitudinalFriction (forward/backward friction coefficient, higher = better acceleration and braking, lower = wheel spin and lockup, typical values 0.8-1.2 normal tires, 1.5-2.0 racing tires, 0.3-0.6 ice/snow). Friction behavior: friction coefficient multiplies maximum force tire can apply (frictionForce = normalForce * frictionCoefficient, normalForce depends on vehicle weight and suspension compression), forces exceeding friction limit cause slip (wheel spins during acceleration, wheel locks during braking, tire slides during cornering).
Use cases: (1) Normal road tires (lateral 1.0, longitudinal 1.0 balanced grip), (2) Racing slicks (lateral 1.8, longitudinal 1.8 maximum grip), (3) Drift tires (lateral 0.5, longitudinal 1.0 easy sliding, good acceleration), (4) Ice/snow (lateral 0.3, longitudinal 0.3 very slippery), (5) Off-road tires (lateral 0.8, longitudinal 0.9 moderate grip on dirt), (6) Wet tires (lateral 0.7, longitudinal 0.7 reduced grip). Common patterns: arcade racing (lateral 1.2, longitudinal 1.2 forgiving grip), simulation (lateral 1.0, longitudinal 1.0 realistic), drift car (lateral 0.4-0.6, longitudinal 0.9-1.1).
Friction and surface: BambooBasic friction values independent of surface (no automatic surface detection, script different friction for different surfaces if desired, detect surface under wheel, adjust friction accordingly), single friction value applies to all surfaces wheel touches. Advanced scripting: dynamic friction based on surface (if wheel over ice then b3dSetVehicleWheelFriction(vehicle, wheelIndex, 0.3, 0.3), if wheel over asphalt then friction 1.0, 1.0, use raycasting to detect surface material), speed-sensitive friction (reduce lateral friction at very high speed for realistic behavior).
Asymmetric friction: different lateral vs longitudinal (lateral 0.5, longitudinal 1.0 = drifts in turns but grips straight, lateral 1.0, longitudinal 0.5 = grips corners but spins wheels accelerating), typical drift setup (reduce lateral only for slide-out in turns, maintain longitudinal for power). Per-wheel friction: different friction per wheel (front wheels higher lateral for steering grip, rear wheels lower lateral for oversteer/drift, all wheels same longitudinal for consistent acceleration), script front-rear balance (front lateral 1.2 for steering, rear lateral 0.8 for oversteer).
Friction and weight: heavier vehicle = more normal force = more friction force (same friction coefficient produces more grip with more weight, lightweight vehicle needs higher friction coefficient for same grip level), adjust friction based on vehicle mass for consistent feel across different vehicles. Friction limits: friction coefficient > 2.0 possible but unrealistic (extremely sticky tires, magnet-like grip, useful for arcade feel), friction coefficient < 0.2 very slippery (almost no grip, ice-like, difficult to control), typical range 0.5-1.5 for most gameplay.
Performance: O(1) operation (sets Jolt tire friction parameters), friction applied during physics step (tire force calculations use friction coefficients). Validation: silently returns if vehicleHandle invalid, silently returns if wheelIndex out of bounds, no validation on friction values (negative values allowed but not meaningful, use positive values 0.1-3.0 typical).
; Normal road tires on all wheelsFor i = 0To3
b3dSetVehicleWheelFriction(vehicle, i, 1.0, 1.0)
Next; Racing slicks for maximum gripFor i = 0To3
b3dSetVehicleWheelFriction(raceCar, i, 1.8, 1.8)
Next; Drift car (low lateral, normal longitudinal)For i = 0To3
b3dSetVehicleWheelFriction(driftCar, i, 0.5, 1.0)
Next; Ice racing (very slippery)For i = 0To3
b3dSetVehicleWheelFriction(iceCar, i, 0.3, 0.3)
Next; Front-grip, rear-drift setup
b3dSetVehicleWheelFriction(vehicle, 0, 1.2, 1.0) ; Front-left
b3dSetVehicleWheelFriction(vehicle, 1, 1.2, 1.0) ; Front-right
b3dSetVehicleWheelFriction(vehicle, 2, 0.6, 1.0) ; Rear-left
b3dSetVehicleWheelFriction(vehicle, 3, 0.6, 1.0) ; Rear-right