fix: look up the scene at a position as the client does, in constant time

Chunk bounds span (width - 1) * scale; the nearest scene map cell is used and the far edge is kept one cell inside. Chunks are indexed by grid cell when they form a grid. Skipping reads instead of seeking, so a cut-off file can't seek past the end. Terrain mesh indices follow the vertex order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-16 11:13:19 -05:00
parent 53d4c1fe2f
commit 200958dd79
5 changed files with 200 additions and 90 deletions

View File

@@ -77,6 +77,11 @@ public:
*/
std::vector<LWOSCENEID> GetAdjacentScenes(LWOSCENEID sceneID) const;
/**
* @brief (Re)builds the scene graph adjacency list from the loaded zone's scene transitions.
*/
void BuildSceneGraph();
// The world config should not be modified by a caller.
const WorldConfig& GetWorldConfig() {
if (!m_WorldConfig) LoadWorldConfig();
@@ -84,10 +89,6 @@ public:
};
private:
/**
* Builds the scene graph adjacency list from scene transitions
*/
void BuildSceneGraph();
/**
* The starting unique mission ID.
*/