From 700f3ad448673e646f3ab2ab8bddfe536e65c206 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Fri, 19 Feb 2016 17:22:20 +0100 Subject: [PATCH] Edge camera speed fix --- src/graphics/engine/camera.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp index 9c1a76a6..43a68206 100644 --- a/src/graphics/engine/camera.cpp +++ b/src/graphics/engine/camera.cpp @@ -1133,6 +1133,9 @@ bool CCamera::EventMouseMove(const Event &event) if (m_mouseDeltaEdge.y < 0.0f) m_engine->SetMouseType(ENG_MOUSE_SCROLLD); } + + m_mouseDeltaEdge.x /= 2*Math::PI; + m_mouseDeltaEdge.y /= Math::PI; } m_mousePos = event.mousePos; @@ -1315,12 +1318,14 @@ bool CCamera::EventFrameEdit(const Event &event) { float factor = m_editHeight * 0.5f + 30.0f; - m_directionH -= m_mouseDelta.x * 2*Math::PI; + m_directionH -= m_mouseDelta.x * 0.7f * 2*Math::PI; m_eyePt = Math::LookatPoint(m_eyePt, m_directionH, m_directionV, m_mouseDelta.y * factor * m_speed); - m_mouseDelta.LoadZero(); + m_fixDirectionH += m_mouseDelta.x * 2*Math::PI; m_fixDirectionH = Math::NormAngle(m_fixDirectionH); + m_mouseDelta.LoadZero(); + m_terrain->AdjustToBounds(m_eyePt, 10.0f); if (m_terrain->AdjustToFloor(m_eyePt, false))