b3dApplyVehicleTorque

Applies external torque to vehicle body for rotational forces. Takes vehicleHandle (vehicle from b3dCreateVehicle), torqueX/torqueY/torqueZ (torque vector in Nm around X/Y/Z axes). Returns nothing.

3D Graphics

Parameters & Returns

Parameters

vehicleHandle Int
torqueX Double
torqueY Double
torqueZ Double

Returns

Void

Quick Summary

Applies external torque to vehicle body for rotational forces. Takes vehicleHandle (vehicle from b3dCreateVehicle), torqueX/torqueY/torqueZ (torque vector in Nm around X/Y/Z axes). Returns nothing.

Technical Exegesis...

Applies external torque to vehicle body for rotational forces. Takes vehicleHandle (vehicle created with b3dCreateVehicle and finalized), torqueX/torqueY/torqueZ (torque components in Newton-meters around world X/Y/Z axes, causing rotation). Returns nothing. Adds rotational force to Jolt vehicle physics body, causing vehicle to spin or flip.

Example

Example.bam
; Apply upward flip torque to help vehicle right itself after crash
If vehicleUpsideDown Then
    b3dApplyVehicleTorque(vehicle, 5000.0, 0.0, 0.0)  ; Pitch torque
EndIf

; Wind effect (apply yaw torque)
windTorque = windStrength * 1000.0
b3dApplyVehicleTorque(vehicle, 0.0, windTorque, 0.0)