Skip map objects beyond the AVA2 object loading distance

AVA2 builds with ENABLE_MAP_OBJECT_OPTIMIZATION: CArea::
__UpdateLoadedObjectInstances unloads objects whose 2D distance from the
main actor is at least max(OBJECT_DIST, 5000). CPythonBackground::Update
now takes the main actor position (as CPythonApplication passes it) and
sets that loading center on MapObjectManager, which skips farther
objects before their frustum test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-12 17:14:00 +09:00
co-authored by Claude Opus 5.5
parent 46880be537
commit b57f2fba99
5 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -2023,7 +2023,7 @@ const auto profileActiveStart = std::chrono::steady_clock::now();
#ifdef AVA2_HAS_PYTHON
bool bg_rendered = false;
if (ava2::CPythonBackground::Instance().IsMapReady()) {
ava2::CPythonBackground::Instance().Update(eyeX, eyeY, eyeZ);
ava2::CPythonBackground::Instance().Update(player_world_x, player_world_y, player_world_z);
float camPos[3] = {eyeX, eyeY, eyeZ};
ava2::CPythonBackground::Instance().BuildDrawCommands(renderer3d->GetViewMatrix(), renderer3d->GetProjMatrix(), camPos, draws, &draw_refs);
bg_rendered = true;