perf: constexpr reciprocals, cache redundant lookups, consolidate texture maps

- Hoist DBC field index lookups before loops in game_handler (7 DBC iteration loops)
- Cache getSkybox()/getPosition() calls instead of redundant per-frame queries
- Merge textureHasAlphaByPtr_ + textureColorKeyBlackByPtr_ into single map
- Add constexpr for DEG_TO_RAD, reciprocal constants, physics delta
- Add reserve() for WMO/M2 collision grid queries and portal BFS
- Frustum plane normalize: inversesqrt instead of length+divide
- M2 particle emission: inversesqrt for direction normalization
- Parse creature display IDs from query response
- UI: show spell names/IDs as fallback instead of "Unknown"
This commit is contained in:
Kelsi 2026-03-27 16:47:30 -07:00
parent b0466e9029
commit d26eed1e7c
9 changed files with 153 additions and 104 deletions

View file

@ -18,6 +18,8 @@ namespace rendering {
namespace {
constexpr float kMaxPhysicsDelta = 1.0f / 30.0f;
std::optional<float> selectReachableFloor(const std::optional<float>& terrainH,
const std::optional<float>& wmoH,
float refZ,
@ -157,7 +159,7 @@ void CameraController::update(float deltaTime) {
return;
}
// Keep physics integration stable during render hitches to avoid floor tunneling.
const float physicsDeltaTime = std::min(deltaTime, 1.0f / 30.0f);
const float physicsDeltaTime = std::min(deltaTime, kMaxPhysicsDelta);
// During taxi flights, skip movement logic but keep camera orbit/zoom controls.
if (externalFollow_) {