//
// PlayerObject::updateRotation from 0x7517f4 to 0x75194c (344 bytes)
//
// 5 xrefs:
// > PlayerObject::updateSlopeRotation @ 0x7519c0
// > PlayerObject::updateRotation @ 0x751ae8
// > PlayerObject::updateRotation @ 0x751b70
// > PlayerObject::updateMove @ 0x7584bc
// > ??> @ 0xad230
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:52:55 +0000
//
_BYTE *__fastcall PlayerObject::updateRotation(_BYTE *this, float a2, float a3)
{
__int64 v3; // x19
float v6; // s12
float v7; // s0
float v8; // s8
long double v9; // q0
char v10; // w0
char isFlying; // w0
long double v12; // [xsp+40h] [xbp+40h]
float v13; // [xsp+40h] [xbp+40h]
v3 = (__int64)this;
if ( !*(this + 2460) )
{
v6 = a3 * 0.017453;
v7 = (*(float (__fastcall **)(_BYTE *))(*(_QWORD *)this + 368LL))(this) * 0.017453;
v8 = *(float *)(v3 + 2476) * 0.175;
if ( *(_BYTE *)(v3 + 2417) )
{
v8 = v8 * 0.5;
}
else
{
v13 = v7;
isFlying = PlayerObject::isFlying((PlayerObject *)v3);
v7 = v13;
if ( !isFlying
&& !*(_BYTE *)(v3 + 2419)
&& *(_BYTE *)(v3 + 2500)
&& !*(_BYTE *)(v3 + 2408)
&& !*(_BYTE *)(v3 + 2409) )
{
v8 = v8 * 3.0;
}
}
if ( a2 <= (float)(a2 * v8) )
{
*(float *)&v9 = Slerp2D(v7, v6, a2) * 57.296;
if ( !*(_BYTE *)(v3 + 2832) )
return (_BYTE *)(*(__int64 (__fastcall **)(__int64, long double))(*(_QWORD *)v3 + 360LL))(v3, v9);
}
else
{
*(float *)&v9 = Slerp2D(v7, v6, a2 * v8) * 57.296;
if ( !*(_BYTE *)(v3 + 2832) )
return (_BYTE *)(*(__int64 (__fastcall **)(__int64, long double))(*(_QWORD *)v3 + 360LL))(v3, v9);
}
v12 = v9;
v10 = PlayerObject::isFlying((PlayerObject *)v3);
v9 = v12;
if ( v10 && *(_BYTE *)(v3 + 2408) && *(int *)(v3 + 2432) > 0 )
*(float *)&v9 = a3;
return (_BYTE *)(*(__int64 (__fastcall **)(__int64, long double))(*(_QWORD *)v3 + 360LL))(v3, v9);
}
return this;
}