summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-07-03 18:07:58 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-07-03 18:10:29 +0200
commit09fe9db46615265c6c7119f2524d19335d0e0283 (patch)
tree7c535050ba9fce1d7ba5b229c9046f41bbe13f2a
parent50a5d6ac3f81540ec510b6f88a26060f443395e9 (diff)
glTF: improve camera movement constraint
Stop moving only on the wrong direction. Change-Id: Ic9e7f2e7814d9adcbcf707e7fb786bf17fac3125
-rw-r--r--avmedia/source/opengl/oglwindow.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/avmedia/source/opengl/oglwindow.cxx b/avmedia/source/opengl/oglwindow.cxx
index b3b177782950..9060145d228e 100644
--- a/avmedia/source/opengl/oglwindow.cxx
+++ b/avmedia/source/opengl/oglwindow.cxx
@@ -266,7 +266,8 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
{
// Limit zooming in orbit mode
m_fCameraDistance += vMoveBy.z;
- if (m_fCameraDistance < 0.75 * fModelSize || m_fCameraDistance > 2 * fModelSize)
+ if ((m_fCameraDistance < 0.75 * fModelSize && vMoveBy.z < 0.0 ) ||
+ (m_fCameraDistance > 2 * fModelSize && vMoveBy.z > 0.0 ))
{
m_fCameraDistance -= vMoveBy.z;
vMoveBy = glm::vec3(0.0);