//
// GJBaseGameLayer::playerCircleCollision from 0x140211df0 to 0x1402120a1 (689 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::checkCollisions @ 0x140214804
// > GJBaseGameLayer::collisionCheckObjects @ 0x140214afa
// > ??> @ 0x14067f0c4
// > ??> @ 0x14067f0d4
// > ??> @ 0x1406ccf90
//
// 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
//
bool GJBaseGameLayer::playerCircleCollision(GJBaseGameLayer *a1, PlayerObject *a2, GameObject *a3)
{
const struct cocos2d::CCPoint *v5; // rbx
cocos2d *v6; // rax
const struct cocos2d::CCPoint *v7; // r8
float v8; // xmm0_4
float m_scaleX; // xmm6_4
float m_objectRadius; // xmm6_4
bool result; // al
const struct cocos2d::CCRect *v12; // rax
float v13; // xmm6_4
float v14; // xmm6_4
float MaxX; // xmm8_4
float MinX; // xmm9_4
float MinY; // xmm0_4
cocos2d *v18; // rax
const struct cocos2d::CCPoint *v19; // r8
float v20; // xmm0_4
cocos2d *v21; // rax
const struct cocos2d::CCPoint *v22; // r8
float v23; // xmm0_4
cocos2d *v24; // rax
const struct cocos2d::CCPoint *v25; // r8
float v26; // xmm0_4
cocos2d *v27; // rax
const struct cocos2d::CCPoint *v28; // r8
cocos2d::CCRect v29; // [rsp+38h] [rbp-90h] BYREF
struct cocos2d::CCPoint v30; // [rsp+D0h] [rbp+8h] BYREF
if ( a1->m_levelSettings->m_fixRadiusCollision )
{
v5 = (const struct cocos2d::CCPoint *)((__int64 (__fastcall *)(GameObject *, struct cocos2d::CCPoint *))a3->getRealPosition)(
a3,
&v30);
v6 = (cocos2d *)a2->getPosition_0(a2);
v8 = cocos2d::ccpDistance(v6, v5, v7);
m_scaleX = a3->m_scaleX;
if ( m_scaleX == 1.0 && a3->m_scaleY == 1.0 )
m_objectRadius = a3->m_objectRadius;
else
m_objectRadius = fmaxf(m_scaleX, a3->m_scaleY) * a3->m_objectRadius;
return (float)((float)(a2->getObjectRect_0(a2)->size.width * 0.5) + m_objectRadius) >= v8;
}
else
{
v12 = a2->getObjectRect_0(a2);
cocos2d::CCRect::CCRect(&v29, v12);
v13 = a3->m_scaleX;
if ( v13 == 1.0 && a3->m_scaleY == 1.0 )
v14 = a3->m_objectRadius;
else
v14 = fmaxf(v13, a3->m_scaleY) * a3->m_objectRadius;
((void (__fastcall *)(GameObject *, struct cocos2d::CCPoint *))a3->getRealPosition)(a3, &v30);
MaxX = cocos2d::CCRect::getMaxX(&v29);
MinX = cocos2d::CCRect::getMinX(&v29);
cocos2d::CCRect::getMaxY(&v29);
MinY = cocos2d::CCRect::getMinY(&v29);
result = true;
if ( !cocos2d::CCRect::containsPoint(&v29, &v30) )
{
cocos2d::CCPoint::CCPoint(MinY, MaxX);
v20 = fabs(cocos2d::ccpDistance(v18, &v30, v19));
if ( v14 <= v20 )
{
cocos2d::CCPoint::CCPoint(v20, MaxX);
v23 = fabs(cocos2d::ccpDistance(v21, &v30, v22));
if ( v14 <= v23 )
{
cocos2d::CCPoint::CCPoint(v23, MinX);
v26 = fabs(cocos2d::ccpDistance(v24, &v30, v25));
if ( v14 <= v26 )
{
cocos2d::CCPoint::CCPoint(v26, MinX);
if ( v14 <= fabs(cocos2d::ccpDistance(v27, &v30, v28)) )
return false;
}
}
}
}
}
return result;
}