acdream/src/AcDream.Core/World
Erik 0afd741ea7 feat(A.5 T18): use cached WorldEntity AABB in dispatcher; populate at register
Per Phase A.5 spec §4.6 Change #2: WalkEntities's per-entity AABB
frustum cull was recomputing Position±5 per frame per entity. With
~10.7K entities (N1=4) at 240 FPS that is ~2.5M wasted Vector3
ops/sec.

Read the AABB from the WorldEntity cache (T8 schema) instead.
RefreshAabb runs lazily on AabbDirty=true. Populate at register time:

- LandblockLoader.BuildEntitiesFromInfo: RefreshAabb after each new
  WorldEntity construction (stabs + buildings). Refactored from
  inline object-initializer to named variable to enable the call.
- EntitySpawnAdapter.OnCreate: RefreshAabb after entity state init
  (position/rotation already set via the WorldEntity passed in).

Dynamic entities (NPCs, players) move every frame via direct
Position writes in GameWindow.cs. Migrated all three per-frame
write sites to SetPosition() (T8 mutator) so AabbDirty propagates:
  - line 5942: player entity render position update
  - line 6951: remote animated entity interpolated path
  - line 7279: remote animated entity landing/movement path

The lazy RefreshAabb in WalkEntities catches up on the next frame
after any SetPosition call — render thread only, no races.

Build green, 986 passed / 8 pre-existing failures unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 08:20:20 +02:00
..
DerethDateTime.cs fix(time): retail-canonical month enum + absolute Portal Year + title-bar calendar 2026-04-27 14:43:49 +02:00
LandblockLoader.cs feat(A.5 T18): use cached WorldEntity AABB in dispatcher; populate at register 2026-05-10 08:20:20 +02:00
LoadedLandblock.cs feat(core): add LandblockLoader with Stab+Building → WorldEntity mapping 2026-04-10 17:58:30 +02:00
MeshRef.cs feat(net+app): TextureChanges applied via Surface→OrigTex resolution (Phase 5a) 2026-04-11 16:22:23 +02:00
PaletteOverride.cs feat(net+app): SubPalette overlays applied to palette-indexed textures (Phase 5b) 2026-04-11 16:30:08 +02:00
SceneryGenerator.cs phase(N.1): delete legacy scenery code path; WB is the only path 2026-05-08 10:37:55 +02:00
SkyDescLoader.cs feat(vfx): Phase C.1 — PES particle renderer + post-review fixes 2026-04-28 22:47:11 +02:00
SkyState.cs fix(sky): retail-faithful sun-vector magnitude for SunColor / AmbientColor 2026-04-27 22:42:53 +02:00
WbSceneryAdapter.cs phase(N.1): document LandBlock length-81 invariant on adapter 2026-05-08 09:20:53 +02:00
WeatherState.cs weather(phase-7): gut WeatherSystem.Snapshot — passthrough keyframe fog 2026-04-24 12:55:19 +02:00
WorldEntity.cs feat(A.5 T8): WorldEntity AABB cache + dirty flag 2026-05-09 22:54:25 +02:00
WorldView.cs feat(core): add WorldView with 3x3 neighbor landblock computation 2026-04-10 18:02:41 +02:00