GetVehicleRotationQuat

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:18, 5 January 2017
Sprtik (Talk | contribs)

← Previous diff
Current revision
IstuntmanI (Talk | contribs)

Line 6: Line 6:
{{Parameters|vehicleid, &Float:w, &Float:x, &Float:y, &Float:z}} {{Parameters|vehicleid, &Float:w, &Float:x, &Float:y, &Float:z}}
- 
{{Param|vehicleid|The ID of the vehicle to get the rotation of.}} {{Param|vehicleid|The ID of the vehicle to get the rotation of.}}
{{Param|&Float:w|A float variable in which to store the first quaternion angle, passed by reference.}} {{Param|&Float:w|A float variable in which to store the first quaternion angle, passed by reference.}}
Line 13: Line 12:
{{Param|&Float:z|A float variable in which to store the fourth quaternion angle, passed by reference.}} {{Param|&Float:z|A float variable in which to store the fourth quaternion angle, passed by reference.}}
-{{Returns|+{{ReturnsSuccess||This means the vehicle specified does not exist.
-* 0: Failed (vehicle doesn't exist)+* The vehicle's rotation is stored in the specified variables.}}
-* 1: Success}}+
{{notes| {{notes|

Current revision



Description:

Returns a vehicle's rotation on all axes as a quaternion.


GetVehicleRotationQuat was added in SA-MP 0.3b This function was added in SA-MP 0.3b and will not work in earlier versions!


Parameters:
(vehicleid, &Float:w, &Float:x, &Float:y, &Float:z)
vehicleidThe ID of the vehicle to get the rotation of.
&Float:wA float variable in which to store the first quaternion angle, passed by reference.
&Float:xA float variable in which to store the second quaternion angle, passed by reference.
&Float:yA float variable in which to store the third quaternion angle, passed by reference.
&Float:zA float variable in which to store the fourth quaternion angle, passed by reference.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. This means the vehicle specified does not exist.
  • The vehicle's rotation is stored in the specified variables.


Image:32px-Ambox_warning_orange.png

Notes

  • There is no 'set' variation of this function; you can not SET a vehicle's rotation (apart from the Z angle)
  • This function may return incorrect values for unoccupied vehicles. The reason is that the third row of the vehicle's internal rotation matrix gets corrupted if it gets updated while unoccupied.


Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools