Skip to content

Commit a6f5165

Browse files
committed
Declare GetVehicleRotation
this function is already present in docs and server implementation
1 parent 03b1f55 commit a6f5165

File tree

1 file changed

+41
-15
lines changed

1 file changed

+41
-15
lines changed

omp_vehicle.inc

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,9 @@ native bool:SetVehiclePos(vehicleid, Float:x, Float:y, Float:z);
579579
* <param name="vehicleid">The ID of the vehicle to get the z angle of</param>
580580
* <param name="angle">A float variable in which to store the z rotation, passed by reference</param>
581581
* <seealso name="GetVehicleRotationQuat" />
582-
* <seealso name="GetVehicleRotation" />
583582
* <seealso name="SetVehicleZAngle" />
584583
* <seealso name="GetVehiclePos" />
584+
* <seealso name="GetVehicleMatrix" />
585585
* <seealso name="GetPlayerFacingAngle" />
586586
* <returns>
587587
* <b><c>1</c></b>: The function executed successfully.<br />
@@ -599,20 +599,8 @@ native bool:GetVehicleZAngle(vehicleid, &Float:angle);
599599
* <param name="y">A float variable in which to store the third quaternion angle, passed by reference</param>
600600
* <param name="z">A float variable in which to store the fourth quaternion angle, passed by reference</param>
601601
* <seealso name="GetVehicleZAngle" />
602-
* <remarks>
603-
* <b>To euler:</b><br />
604-
* <code>
605-
* // GetVehicleRotation Created by IllidanS4<br />
606-
* stock GetVehicleRotation(vehicleid, &amp;Float:rx, &amp;Float:ry, &amp;Float:rz)<br />
607-
* {<br />
608-
* new Float:qw, Float:qx, Float:qy, Float:qz;<br />
609-
* GetVehicleRotationQuat(vehicleid, qw, qx, qy, qz);<br />
610-
* rx = asin((2 * qy * qz) - (2 * qx * qw));<br />
611-
* ry = -atan2((qx * qz) + (qy * qw), 0.5 - (qx * qx) - (qy * qy));<br />
612-
* rz = -atan2((qx * qy) + (qz * qw), 0.5 - (qx * qx) - (qz * qz));<br />
613-
* }
614-
* </code>
615-
* </remarks>
602+
* <seealso name="GetVehicleRotation" />
603+
* <seealso name="GetVehicleMatrix" />
616604
* <remarks>There is no 'set' variation of this function; you can not SET a vehicle's rotation (apart
617605
* from the <a href="#SetVehicleZAngle">z angle</a>) </remarks>
618606
* <remarks>This function may return incorrect values for unoccupied vehicles. The reason is that the
@@ -1606,9 +1594,47 @@ native bool:IsVehicleSirenEnabled(vehicleid);
16061594

16071595
/**
16081596
* <library>omp_vehicle</library>
1597+
* <summary>Gets the actual rotation matrix of the vehicle.</summary>
1598+
* <param name="vehicleid">The ID of the vehicle</param>
1599+
* <param name="rightX">A float variable in which to store the rightX coordinate, passed by reference</param>
1600+
* <param name="rightY">A float variable in which to store the rightY coordinate, passed by reference</param>
1601+
* <param name="rightZ">A float variable in which to store the rightZ coordinate, passed by reference</param>
1602+
* <param name="upX">A float variable in which to store the upX coordinate, passed by reference</param>
1603+
* <param name="upY">A float variable in which to store the upY coordinate, passed by reference</param>
1604+
* <param name="upZ">A float variable in which to store the upZ coordinate, passed by reference</param>
1605+
* <param name="atX">A float variable in which to store the atX coordinate, passed by reference</param>
1606+
* <param name="atY">A float variable in which to store the atY coordinate, passed by reference</param>
1607+
* <param name="atZ">A float variable in which to store the atZ coordinate, passed by reference</param>
1608+
* <seealso name="GetVehicleRotationQuat" />
1609+
* <returns>
1610+
* <b><c>1</c></b>: The function executed successfully.<br />
1611+
* <b><c>0</c></b>: The function failed to execute. This means the vehicle specified does not exist.
1612+
* </returns>
16091613
*/
16101614
native bool:GetVehicleMatrix(vehicleid, &Float:rightX, &Float:rightY, &Float:rightZ, &Float:upX, &Float:upY, &Float:upZ, &Float:atX, &Float:atY, &Float:atZ);
16111615

1616+
/**
1617+
* <library>omp_vehicle</library>
1618+
* <summary>Returns a vehicle's rotation as euler.</summary>
1619+
* <param name="vehicleid">The ID of the vehicle to get the rotation of</param>
1620+
* <param name="x">A float variable in which to store the X axis angle, passed by reference</param>
1621+
* <param name="y">A float variable in which to store the Y axis angle, passed by reference</param>
1622+
* <param name="z">A float variable in which to store the Z axis angle, passed by reference</param>
1623+
* <seealso name="GetVehicleZAngle" />
1624+
* <seealso name="GetVehicleRotationQuat" />
1625+
* <seealso name="GetVehicleMatrix" />
1626+
* <remarks>There is no 'set' variation of this function; you can not SET a vehicle's rotation (apart
1627+
* from the <a href="#SetVehicleZAngle">z angle</a>) </remarks>
1628+
* <remarks>This function may return incorrect values for unoccupied vehicles. The reason is that the
1629+
* third row of the vehicle's internal rotation matrix gets corrupted if it gets updated while unoccupied.
1630+
* </remarks>
1631+
* <returns>
1632+
* <b><c>1</c></b>: The function executed successfully.<br />
1633+
* <b><c>0</c></b>: The function failed to execute. This means the vehicle specified does not exist.
1634+
* </returns>
1635+
*/
1636+
native bool:GetVehicleRotation(vehicleid, &Float:x, &Float:y, &Float:z);
1637+
16121638
/**
16131639
* <library>omp_vehicle</library>
16141640
*/

0 commit comments

Comments
 (0)