[Include] Quaternion Converter - Convert GetVehicleRotationQuat angles to XYZ [1.0.0|13/08/10]
#1

NOTE: This release requires SA-MP 0.3b, (minimum RC1) currently in Release Candidate testing.

Quaternion Converter
Convert GetVehicleRotationQuat angles to XYZ!
What is it?
Quaternion Converter is a simple include which provides functions to convert a quaternion set (most commonly used in GetVehicleRotationQuat) to XYZ. (yaw, pitch and roll)

How do I use it?
Copy the include to your includes directory.
Include the "quaternion.inc" file in any scripts which you would like to use these functions in. (with "#include <quaternion>")

What am I allowed to do with it?
Quaternion Converter is licensed under the GNU General Public License. Please see COPYING in the download package, or http://www.gnu.org/licenses/gpl.html.

Where can I download it?
http://www.megaupload.com/?d=BGXYITTT (1.0.0 @ 13/08/10)
Please abide by the terms of the license!


Function list
Код:
stock QuaternionToYawPitchRoll(Float:quat_w,Float:quat_x,Float:quat_y,Float:quat_z,&Float:x,&Float:y,&Float:z)
Takes the quaternion values specified by quat_w, quat_x, quat_y and quat_z, then converts them into roll, pitch and yaw (respectively) and saves them into the variables specified by x, y and z.

Код:
stock QuaternionGetRoll(Float:quat_w,Float:quat_x,Float:quat_y,Float:quat_z,&Float:roll)
Takes the quaternion values specified by quat_w, quat_x, quat_y and quat_z, then converts them into roll (respectively) and saves them into the variables specified by roll.

Код:
stock QuaternionGetPitch(Float:quat_w,Float:quat_x,Float:quat_y,Float:quat_z,&Float:pitch)
Takes the quaternion values specified by quat_w, quat_x, quat_y and quat_z, then converts them into pitch and saves them into the variables specified by pitch.

Код:
stock QuaternionGetYaw(Float:quat_w,Float:quat_x,Float:quat_y,Float:quat_z,&Float:yaw)
Takes the quaternion values specified by quat_w, quat_x, quat_y and quat_z, then converts them into yaw and saves them into the variable specified by yaw.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)