[colobot] 300/377: Edge camera speed fix
Didier Raboud
odyx at moszumanska.debian.org
Wed Mar 30 13:34:29 UTC 2016
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit 700f3ad448673e646f3ab2ab8bddfe536e65c206
Author: krzys-h <krzys_h at interia.pl>
Date: Fri Feb 19 17:22:20 2016 +0100
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 9c1a76a..43a6820 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))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list