//
// cocos2d::CCOrbitCamera::sphericalRadius from 0xd26444 to 0xd265b4 (368 bytes)
//
// 2 xrefs:
// > cocos2d::CCOrbitCamera::startWithTarget @ 0xd265f4
// > ??> @ 0xe44f0
//
// 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 13:07:14 +0000
//
__int64 __fastcall cocos2d::CCOrbitCamera::sphericalRadius(
cocos2d::CCOrbitCamera *this,
float *a2,
float *a3,
float *a4)
{
cocos2d::CCCamera *v7; // x23
float v8; // s11
float v9; // s9
float v10; // s10
float v11; // s8
float v12; // s13
float v13; // s12
float v14; // s8
float v15; // s0
cocos2d::CCCamera *v16; // x0
float v18; // [xsp+70h] [xbp+70h] BYREF
float v19; // [xsp+74h] [xbp+74h] BYREF
float v20; // [xsp+78h] [xbp+78h] BYREF
float v21; // [xsp+7Ch] [xbp+7Ch] BYREF
float v22; // [xsp+80h] [xbp+80h] BYREF
float v23; // [xsp+84h] [xbp+84h] BYREF
v7 = (cocos2d::CCCamera *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 8) + 672LL))(*((_QWORD *)this + 8));
cocos2d::CCCamera::getEyeXYZ(v7, &v18, &v19, &v20);
cocos2d::CCCamera::getCenterXYZ(v7, &v21, &v22, &v23);
v8 = v19 - v22;
v9 = v18 - v21;
v10 = v20 - v23;
v11 = (float)(v8 * v8) + (float)(v9 * v9);
v12 = sqrtf(v11 + (float)(v10 * v10));
v13 = v12;
v14 = sqrtf(v11);
if ( v14 == 0.0 )
v14 = 0.00000011921;
if ( v12 == 0.0 )
v13 = 0.00000011921;
*a3 = acosf(v10 / v13);
v15 = v8 / v14;
if ( v9 < 0.0 )
*a4 = 3.1416 - asinf(v15);
else
*a4 = asinf(v15);
*a2 = v13 / cocos2d::CCCamera::getZEye(v16);
return _stack_chk_guard;
}