mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
rendering: re-enable WMO camera collision with asymmetric smoothing
Previously disabled because the per-frame raycast caused erratic zoom snapping at doorway transitions. Re-enable using an asymmetrically- smoothed collision limit: pull-in reacts quickly (τ≈60 ms) to prevent the camera from ever visibly clipping through walls, while recovery is slow (τ≈400 ms) so walking through a doorway zooms back out gradually instead of snapping. Uses wmoRenderer->raycastBoundingBoxes() which already has strict wall filters (|normal.z|<0.20, surface-alignment check, ±0.9 height band) to ignore floors, ramps, and arch geometry.
This commit is contained in:
parent
c622e547c9
commit
b2dccca58c
2 changed files with 29 additions and 4 deletions
|
|
@ -156,6 +156,7 @@ private:
|
|||
static constexpr float MAX_PITCH = 35.0f; // Limited upward look
|
||||
glm::vec3* followTarget = nullptr;
|
||||
glm::vec3 smoothedCamPos = glm::vec3(0.0f); // For smooth camera movement
|
||||
float smoothedCollisionDist_ = -1.0f; // Asymmetrically-smoothed WMO collision limit (-1 = uninitialised)
|
||||
|
||||
// Gravity / grounding
|
||||
float verticalVelocity = 0.0f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue