[saco] Implement/match FUNC_10015460; the turn-speed clamp is gated by an initialised global and _gap16C is the synced quaternion

This commit is contained in:
ricardoofnl
2026-09-05 08:35:06 +07:00
parent 5f492d0791
commit 03b2f5b5a5
3 changed files with 43 additions and 2 deletions
+2
View File
@@ -113,6 +113,8 @@ void FUNC_100B52B0(MATRIX4X4 *pMatrix, float *pQuatOut); // .text:100B52B0
void FUNC_100B5480(float *pQuatOut, float *pQuatFrom, float *pQuatTo, float fT); // .text:100B5480
void FUNC_100B6A80(float *pQuat, MATRIX4X4 *pMatrix); // .text:100B6A80
void __stdcall FUNC_100B6900(VECTOR *pFront, VECTOR *pOut); // .text:100B6900
void FUNC_100B5470(float *pQuat, MATRIX4X4 *pMatrix); // .text:100B5470
void FUNC_100B5500(float *pQuat); // .text:100B5500
void FUNC_100B5210(int a1, void *a2); // .text:100B5210, __cdecl: the caller's
// stack cleanup is folded into the next call's argument setup
+39 -1
View File
@@ -8,6 +8,8 @@ using namespace RakNet;
extern CNetGame* pNetGame;
extern CChatWindow *pChatWindow;
int bClampVehicleTurnSpeed = 1;
//----------------------------------------------------
// layout locks: a negative array size fails the build if any offset moves
@@ -212,7 +214,7 @@ void CRemotePlayer::FUNC_100150D0(VECTOR *pPos, VECTOR *pMoveSpeed)
void CRemotePlayer::FUNC_100155E0(int a1, VECTOR *pPos, VECTOR *pMoveSpeed)
{
FUNC_100B5210(a1, &_gap16C);
FUNC_100B5210(a1, quat16C);
field_194 = *pPos;
field_1A0 = *pMoveSpeed;
field_1E1->SetMoveSpeedVector(*pMoveSpeed);
@@ -407,6 +409,42 @@ void CRemotePlayer::FUNC_10017260(BYTE *pSync, int iTime)
//----------------------------------------------------
void CRemotePlayer::FUNC_10015460()
{
MATRIX4X4 mat;
float quatCur[4];
float quatBlend[4];
VECTOR vecTurn;
vecTurn.X = 0.0f;
vecTurn.Y = 0.0f;
vecTurn.Z = 0.0f;
if(!field_1E1) return;
if(bClampVehicleTurnSpeed) {
field_1E1->GetTurnSpeedVector(&vecTurn);
if(vecTurn.X > 0.02f) vecTurn.X = 0.02f;
else if(vecTurn.X < -0.02f) vecTurn.X = -0.02f;
if(vecTurn.Y > 0.02f) vecTurn.Y = 0.02f;
else if(vecTurn.Y < -0.02f) vecTurn.Y = -0.02f;
if(vecTurn.Z > 0.02f) vecTurn.Z = 0.02f;
else if(vecTurn.Z < -0.02f) vecTurn.Z = -0.02f;
field_1E1->SetTurnSpeedVector(vecTurn);
}
field_1E1->GetMatrix(&mat);
FUNC_100B5210((int)&mat, quatCur);
FUNC_100B5480(quatBlend, quat16C, quatCur, 0.75f);
FUNC_100B5500(quatBlend);
FUNC_100B5470(quatBlend, &mat);
field_1E1->SetMatrix(mat);
}
//----------------------------------------------------
void CRemotePlayer::FUNC_10015760(BYTE *pAim)
{
if(!m_pPlayerPed) return;
+2 -1
View File
@@ -37,7 +37,7 @@ public:
int field_110;
char _gap114[88];
char _gap16C[16];
float quat16C[4];
VECTOR field_17C;
VECTOR field_188;
VECTOR field_194;
@@ -86,6 +86,7 @@ public:
void FUNC_100148F0(); // .text:100148F0
void FUNC_10014FF0(); // .text:10014FF0
void FUNC_10017260(BYTE *pSync, int iTime); // .text:10017260
void FUNC_10015460(); // .text:10015460
void FUNC_10015760(BYTE *pAim); // .text:10015760
BOOL FUNC_10017130(int a1, int iSkin, int a3, VECTOR *pPos, float fRotation,
DWORD dwColor, BYTE byteStyle); // .text:10017130