Repository navigation
A3D_EulerToQuaternion
imshooter edited this page Oct 17, 2026
·
1 revision
Turn the rotation of an object into a quaternion, in the order of GetVehicleRotationQuat.
native bool:A3D_EulerToQuaternion(
Float:rx,
Float:ry,
Float:rz,
&Float:w,
&Float:x,
&Float:y,
&Float:z
);| Parameter | Description |
|---|---|
Float:rx |
Rotation on the X axis. |
Float:ry |
Rotation on the Y axis. |
Float:rz |
Rotation on the Z axis. |
&Float:w |
Real part of the quaternion. |
&Float:x |
Part of the X axis. |
&Float:y |
Part of the Y axis. |
&Float:z |
Part of the Z axis. |
-
truewhen the quaternion was written.
The angles are those of SetObjectRot. The quaternion is the one GetVehicleRotationQuat would give for a vehicle turned the same way, in the same order: w first, then x, y and z. ColAndreas writes w last, so swap the order when porting.
Tells whether a vehicle stands turned like an object, slopes included.
stock bool:IsTurnedLike(vehicleid, Float:rx, Float:ry, Float:rz) {
new
Float:w,
Float:x,
Float:y,
Float:z,
Float:vehicleW,
Float:vehicleX,
Float:vehicleY,
Float:vehicleZ
;
A3D_EulerToQuaternion(rx, ry, rz, w, x, y, z);
GetVehicleRotationQuat(vehicleid, vehicleW, vehicleX, vehicleY, vehicleZ);
return floatabs(w * vehicleW + x * vehicleX + y * vehicleY + z * vehicleZ) > 0.99;
}-
A3D_QuaternionToEuler: Turn a quaternion, such as one from
GetVehicleRotationQuat, into the rotation of an object. - A3D_GetRotation: The rotation of a physics object, as an object rotation.
3DAndreas 0.7.1 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions