//
// PlayerObject::updateShipRotation from 0x100223f40 to 0x1002242b0 (880 bytes)
//
// 1 xrefs:
// > PlayerObject::updateRotation_1 @ 0x100224328
//
// 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::updateShipRotation(PlayerObject *a1, float a2)
{
__int64 *v4; // x0
_BOOL4 m_isBird; // w8
bool v6; // w20
float v7; // s1
float v8; // s0
float v9; // s9
__n128 v10; // q0
__n128 v11; // q2
float v12; // s1
float v13; // s2
float v14; // s2
float v15; // s1
float v16; // s3
bool v17; // nf
float v18; // s0
__int64 v19; // [xsp+8h] [xbp-28h] BYREF
if ( !a1->m_isOnSlope && !a1->m_isDashing )
{
v4 = (__int64 *)((__int64 (__fastcall *)(PlayerObject *))a1->getPosition)(a1);
sub_1000229B8(&v19, v4);
m_isBird = a1->m_isBird;
v6 = m_isBird || a1->m_isShip || a1->m_isSwing || a1->m_isDart;
if ( a1->m_isSideways )
{
v7 = v6 && a1->m_isGoingLeft
? vabds_f32(*((float *)&v19 + 1), a1->m_shipRotation.y)
: *((float *)&v19 + 1) - a1->m_shipRotation.y;
v8 = *(float *)&v19 - a1->m_shipRotation.x;
}
else
{
v7 = v6 && a1->m_isGoingLeft
? vabds_f32(*(float *)&v19, a1->m_shipRotation.x)
: *(float *)&v19 - a1->m_shipRotation.x;
v8 = -(float)(*((float *)&v19 + 1) - a1->m_shipRotation.y);
}
if ( (float)((float)(v8 * v8) + (float)(v7 * v7)) >= (float)(a2 * 1.2)
|| a1->m_isPlatformer && (a1->m_isShip || m_isBird) )
{
v9 = atan2f(v8, v7);
((void (__fastcall *)(PlayerObject *))a1->getRotation)(a1);
v12 = v9 * -0.4;
if ( !a1->m_isBird )
v12 = v9;
if ( a1->m_isCollidingWithSlope )
{
if ( a1->m_isShip || a1->m_isBird || a1->m_isDart || (v12 = v9, a1->m_isSwing) )
v12 = 0.0;
}
if ( v6 && a1->m_isGoingLeft )
v12 = -v12;
v10.n128_f32[0] = v10.n128_f32[0] * 0.017453;
if ( a1->m_isBird )
{
v13 = fmaxf(v12, -0.1);
v12 = fminf(v12, 0.1);
if ( a1->m_isGoingLeft == a1->m_isUpsideDown )
v12 = v13;
v14 = 0.07;
if ( a1->m_isPlatformer && (fabs(a1->m_platformerXVelocity) <= 0.5 || a1->m_isOnGround2) )
{
v12 = 0.0;
if ( !a1->m_isCollidingWithSlope )
goto LABEL_63;
goto LABEL_58;
}
}
else
{
if ( a1->m_isDart )
{
v14 = 0.4;
if ( a1->m_vehicleSize == 1.0 )
v14 = 0.25;
if ( !a1->m_isCollidingWithSlope )
goto LABEL_63;
goto LABEL_58;
}
v14 = 0.15;
if ( a1->m_isPlatformer && a1->m_isShip )
{
if ( !a1->m_holdingLeft && !a1->m_holdingRight && !a1->m_platformerMovingLeft && !a1->m_platformerMovingRight )
{
v12 = 0.0;
v14 = 0.06;
if ( !a1->m_isCollidingWithSlope )
goto LABEL_63;
goto LABEL_58;
}
v15 = 1.0;
if ( a1->m_isGoingLeft )
v15 = -1.0;
if ( a1->m_isUpsideDown != a1->m_isSideways )
v15 = -v15;
v16 = v15 * 0.5236;
v17 = (float)(fabsf(v15 * 0.5236) - fabsf(v10.n128_f32[0])) < 0.1;
v12 = v15 * 0.7854;
v14 = flt_10063A8E0[v17];
if ( !v17 )
v12 = v16;
}
}
if ( !a1->m_isCollidingWithSlope )
{
LABEL_63:
v11.n128_f32[0] = v14 * a2;
if ( v11.n128_f32[0] >= a2 )
v11.n128_f32[0] = a2;
v18 = sub_1003B30B4(v10, v12, v11);
((void (__fastcall *)(PlayerObject *, float))a1->setRotation)(a1, v18 * 57.296);
return;
}
LABEL_58:
if ( a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing )
v14 = v14 * 0.25;
goto LABEL_63;
}
}
}