mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 03:33:04 +08:00
[saco] Implement/match FUNC_100B5620; the quaternion to euler conversion doubles with x * 2.0f and reaches asin through the __CIasin intrinsic
This commit is contained in:
@@ -2041,3 +2041,19 @@ void FUNC_100B5480(float *pQuatOut, float *pQuatFrom, float *pQuatTo, float fT)
|
||||
pQuatOut[2] = qOut.y;
|
||||
pQuatOut[3] = qOut.z;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void FUNC_100B5620(float *pQuat, float *pEuler)
|
||||
{
|
||||
float f0 = pQuat[0] * pQuat[0];
|
||||
float f1 = pQuat[1] * pQuat[1];
|
||||
float f2 = pQuat[2] * pQuat[2];
|
||||
float f3 = pQuat[3] * pQuat[3];
|
||||
|
||||
pEuler[0] = (float)atan2((pQuat[2] * pQuat[1] + pQuat[3] * pQuat[0]) * 2.0f,
|
||||
f1 - f2 - f3 + f0);
|
||||
pEuler[1] = (float)asin((pQuat[3] * pQuat[1] - pQuat[2] * pQuat[0]) * -2.0f);
|
||||
pEuler[2] = (float)atan2((pQuat[3] * pQuat[2] + pQuat[1] * pQuat[0]) * 2.0f,
|
||||
f3 - (f2 + f1) + f0);
|
||||
}
|
||||
|
||||
@@ -168,6 +168,7 @@ void FUNC_100B57E0(int a1, int nIndex, int a3, int a4); // .text:100B57E0
|
||||
void FUNC_100B5790(int a1, int nIndex, int a3); // .text:100B5790
|
||||
void FUNC_100B5740(int a1, int a2); // .text:100B5740
|
||||
void FUNC_100B5830(int a1, int nIndex, float *pfOut); // .text:100B5830
|
||||
void FUNC_100B5620(float *pQuat, float *pEuler); // .text:100B5620
|
||||
void FUNC_100B5210(int a1, void *a2); // .text:100B5210, __cdecl: the caller's
|
||||
// stack cleanup is folded into the next call's argument setup
|
||||
|
||||
|
||||
Reference in New Issue
Block a user