enable async loading, optimize rendering and distance checks

This commit is contained in:
savis
2025-12-26 06:21:13 +01:00
parent 1592ec93f6
commit 9907febf28
5 changed files with 40 additions and 6 deletions

View File

@@ -178,8 +178,10 @@ void CPythonCharacterManager::Update()
continue;
}
int nDistance = int(pkInstEach->NEW_GetDistanceFromDestInstance(*pkInstMain));
if (nDistance > CHAR_STAGE_VIEW_BOUND + 10)
// Optimized: Use squared distance to avoid sqrt
float fDistanceSquared = pkInstEach->NEW_GetDistanceFromDestInstanceSquared(*pkInstMain);
const float fViewBoundSquared = (CHAR_STAGE_VIEW_BOUND + 10) * (CHAR_STAGE_VIEW_BOUND + 10);
if (fDistanceSquared > fViewBoundSquared)
{
__DeleteBlendOutInstance(pkInstEach);
m_kAliveInstMap.erase(c);