GetVehicleRotation
Description:
Function GetVehicleRotation get the rotation of a vehicle on the XYZ axis.
|
Parameters:
(vehicleid, &Float:rx, &Float:ry, &Float:rz)
int | vehicleid | The ID of the vehicle to get the rotation of. |
float | rx | The variable to store the X (pitch) rotation, passed by reference. |
float | ry | The variable to store the Y (roll) rotation, passed by reference. |
float | rz | The variable to store the Z (yaw) rotation, passed by reference. |
Return Values:
This function does not return any specific values.
Examples:
//GetVehicleRotation Created by IllidanS4 stock GetVehicleRotation(vehicleid,&Float:rx,&Float:ry,&Float:rz){ new Float:qw,Float:qx,Float:qy,Float:qz; GetVehicleRotationQuat(vehicleid,qw,qx,qy,qz); rx = asin(2*qy*qz-2*qx*qw); ry = -atan2(qx*qz+qy*qw,0.5-qx*qx-qy*qy); rz = -atan2(qx*qy+qz*qw,0.5-qx*qx-qz*qz); }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetVehicleZAngle: Check the current angle of a vehicle.
- GetVehicleRotationQuat: Get the quaternion rotation of a vehicle.