//
// PlayerObject::runRotateAction from 0x100402710 to 0x10040293a (554 bytes)
//
// 13 xrefs:
// > PlayerObject::updateTimeMod @ 0x1003fc7a0
// > PlayerObject::updateJump @ 0x1003ffa49
// > PlayerObject::updateJump @ 0x1003ffcd6
// > PlayerObject::updateMove @ 0x100400ff0
// > PlayerObject::doReversePlayer @ 0x1004025ea
// > PlayerObject::postCollision @ 0x100404cee
// > PlayerObject::hitGround @ 0x10040c18c
// > PlayerObject::rotateGameplay @ 0x1004127db
// > PlayerObject::togglePlayerScale @ 0x1004130cc
// > PlayerObject::ringJump @ 0x100414b61
// > PlayerObject::ringJump @ 0x100414f02
// > PlayerObject::resetPlayerIcon @ 0x100416bd0
// > PlayerObject::propellPlayer @ 0x10041af02
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall PlayerObject::runRotateAction(PlayerObject *a1, bool a2, int a3)
{
float m_playerSpeed; // xmm1_4
float v4; // xmm1_4
__m128 v5; // rt1
__int64 v6; // rax
int v7; // edx
int v8; // ecx
float v9; // xmm0_4
float v10; // xmm0_4
__m128 v11; // rt1
__int64 v12; // rax
int v13; // edx
int v14; // ecx
float v15; // xmm0_4
if ( !a1->m_isLocked && !a1->m_isDashing )
{
*(_WORD *)&a1->m_isRotating = 0;
a1->m_isBallRotating = 0;
a1->m_rotationSpeed = 0.0;
if ( a1->m_isBall )
{
if ( a1->m_isPlatformer )
return;
a1->m_rotateSpeed = 1.0;
m_playerSpeed = a1->m_playerSpeed;
if ( m_playerSpeed == 0.69999999 )
{
v4 = 1.2405638;
}
else if ( m_playerSpeed == 1.1 )
{
v4 = 0.80424345;
}
else if ( m_playerSpeed == 1.3 )
{
v4 = 0.66576928;
}
else if ( m_playerSpeed == 1.6 )
{
v4 = 0.54093748;
}
else
{
v4 = 1.0;
}
v11.i32[0] = 1065353216;
v12 = _mm_cvtsi128_si32((__m128i)_mm_cmpeq_ss((__m128)LODWORD(a1->m_vehicleSize), v11)) & 1;
v13 = 120;
if ( a1->m_isUpsideDown )
v13 = -120;
v14 = -v13;
if ( !a1->m_isGoingLeft )
v14 = v13;
v15 = (float)v14 / (float)(v4 * flt_10081B660[v12]);
a1->m_rotationSpeed = v15;
if ( !a1->m_isSideways )
goto LABEL_39;
v10 = -v15;
LABEL_38:
a1->m_rotationSpeed = v10;
LABEL_39:
a1->m_isRotating = 1;
return;
}
if ( !a1->m_isShip
&& !a1->m_isBird
&& !a1->m_isDart
&& !a1->m_isSwing
&& !a1->m_isRobot
&& !a1->m_isSpider
&& (!a1->m_isPlatformer
|| a1->m_holdingLeft
|| a1->m_holdingRight
|| a1->m_platformerMovingLeft
|| a1->m_platformerMovingRight) )
{
v5.i32[0] = LODWORD(a1->m_vehicleSize);
v6 = _mm_cvtsi128_si32((__m128i)_mm_cmpeq_ss((__m128)0x3F800000u, v5)) & 1;
v7 = 180;
if ( a1->m_isUpsideDown )
v7 = -180;
v8 = -v7;
if ( !a1->m_isGoingLeft )
v8 = v7;
v9 = (float)v8;
if ( a1->m_isSideways )
v9 = -v9;
v10 = (float)(v9 * a1->m_gravityMod) / flt_10081B570[v6];
goto LABEL_38;
}
}
}