mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Performance optimizations and collision improvements
Performance:
- Remove expensive inverse() from all vertex shaders (terrain, WMO, M2, water, character)
- Add uniform location caching to avoid repeated glGetUniformLocation calls
- Add proper frustum culling for WMO groups using AABB intersection
- Add distance-based culling for WMO and M2 instances
- Add cleanup of unused M2/WMO models when tiles unload
Collision & Movement:
- Add M2 doodad collision detection (fences, boxes, etc.)
- Reduce character eye height (5.0 -> 1.8) and collision radius (2.5 -> 0.5)
- Enable WoW-style movement speed by default (14 units/sec run, 5 walk, 9 back)
- Fix emote grammar ("You waves." -> "You wave.")
Misc:
- Rename window title to "Wowee"
This commit is contained in:
parent
0c85fcd444
commit
4287878a73
16 changed files with 258 additions and 32 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "rendering/camera_controller.hpp"
|
||||
#include "rendering/terrain_manager.hpp"
|
||||
#include "rendering/wmo_renderer.hpp"
|
||||
#include "rendering/m2_renderer.hpp"
|
||||
#include "rendering/water_renderer.hpp"
|
||||
#include "game/opcodes.hpp"
|
||||
#include "core/logger.hpp"
|
||||
|
|
@ -152,7 +153,7 @@ void CameraController::update(float deltaTime) {
|
|||
targetPos.z += verticalVelocity * deltaTime;
|
||||
}
|
||||
|
||||
// Wall collision for character
|
||||
// Wall collision for character (WMO buildings)
|
||||
if (wmoRenderer) {
|
||||
glm::vec3 feetPos = targetPos;
|
||||
glm::vec3 oldFeetPos = *followTarget;
|
||||
|
|
@ -164,6 +165,15 @@ void CameraController::update(float deltaTime) {
|
|||
}
|
||||
}
|
||||
|
||||
// Collision with M2 doodads (fences, boxes, etc.)
|
||||
if (m2Renderer) {
|
||||
glm::vec3 adjusted;
|
||||
if (m2Renderer->checkCollision(*followTarget, targetPos, adjusted)) {
|
||||
targetPos.x = adjusted.x;
|
||||
targetPos.y = adjusted.y;
|
||||
}
|
||||
}
|
||||
|
||||
// Ground the character to terrain or WMO floor
|
||||
{
|
||||
std::optional<float> terrainH;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue