Fix interior WMO floor gaps, water exit stair clipping, NPC equipment, portal animation

- Fix Stormwind barracks floor: interior WMO groups named "facade" were
  incorrectly marked as LOD shells and hidden when close. Add !isIndoor
  guard to all LOD detection conditions so interior groups always render.
- Fix water exit stair clipping: anchor lastGroundZ to current position
  on swim exit, set grounded=true for full step-up budget, add upward
  velocity boost to clear stair lip geometry.
- Re-enable NPC humanoid equipment geosets (kEnableNpcHumanoidOverrides)
  so guards render with proper armor instead of underwear.
- Keep instance portal GameObjects animated (spinning/glowing) instead
  of freezing all GO animations indiscriminately.
- Fix equipment disappearing after instance round-trip by resetting
  dirty tracking on world reload.
- Fix multi-doodad-set loading: load both set 0 (global) and placement-
  specific doodad set, with dedup to avoid double-loading.
- Clear placedWmoIds in softReset/unloadAll to prevent stale dedup.
- Apply MODF rotation to instance WMOs, snap player to WMO floor.
- Re-enable rebuildSpatialIndex in setInstanceTransform.
- Store precomputeFloorCache results in precomputed grid.
- Add F8 debug key for WMO floor diagnostics at player position.
- Expand mapIdToName with all Classic/TBC/WotLK instance map IDs.
This commit is contained in:
Kelsi 2026-03-04 19:47:01 -08:00
parent bec7a678aa
commit 16d44c5bb3
6 changed files with 285 additions and 28 deletions

View file

@ -522,10 +522,18 @@ std::shared_ptr<PendingTile> TerrainManager::prepareTile(int x, int y) {
wmoMatrix = glm::rotate(wmoMatrix, rot.y, glm::vec3(0, 1, 0));
wmoMatrix = glm::rotate(wmoMatrix, rot.x, glm::vec3(1, 0, 0));
const auto& doodadSet = wmoModel.doodadSets[0];
// Load doodads from set 0 (global) + placement-specific set
std::vector<uint32_t> setsToLoad = {0};
if (placement.doodadSet > 0 && placement.doodadSet < wmoModel.doodadSets.size()) {
setsToLoad.push_back(placement.doodadSet);
}
std::unordered_set<uint32_t> loadedDoodadIndices;
for (uint32_t setIdx : setsToLoad) {
const auto& doodadSet = wmoModel.doodadSets[setIdx];
for (uint32_t di = 0; di < doodadSet.count; di++) {
uint32_t doodadIdx = doodadSet.startIndex + di;
if (doodadIdx >= wmoModel.doodads.size()) break;
if (!loadedDoodadIndices.insert(doodadIdx).second) continue;
const auto& doodad = wmoModel.doodads[doodadIdx];
auto nameIt = wmoModel.doodadNames.find(doodad.nameIndex);
@ -623,6 +631,7 @@ std::shared_ptr<PendingTile> TerrainManager::prepareTile(int x, int y) {
doodadReady.modelMatrix = worldMatrix;
pending->wmoDoodads.push_back(std::move(doodadReady));
}
}
}
PendingTile::WMOReady ready;
@ -1311,6 +1320,7 @@ void TerrainManager::unloadAll() {
pendingTiles.clear();
finalizingTiles_.clear();
placedDoodadIds.clear();
placedWmoIds.clear();
LOG_INFO("Unloading all terrain tiles");
loadedTiles.clear();
@ -1358,6 +1368,7 @@ void TerrainManager::softReset() {
pendingTiles.clear();
finalizingTiles_.clear();
placedDoodadIds.clear();
placedWmoIds.clear();
// Clear tile cache — keys are (x,y) without map name, so stale entries from
// a different map with overlapping coordinates would produce wrong geometry.