[Libreoffice-commits] core.git: avmedia/source
Zolnai Tamás
tamas.zolnai at collabora.com
Fri Jul 4 04:24:39 PDT 2014
avmedia/source/opengl/oglwindow.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 2946c7c62718cb74feab554b5939ec340e6c4280
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Fri Jul 4 13:21:58 2014 +0200
glTF: camera movement constraint: use distance from the boundary box
... instead of distance from model center position.
Change-Id: I379ab5e32cc5009d0eb751c4808fecf0109d1e5a
diff --git a/avmedia/source/opengl/oglwindow.cxx b/avmedia/source/opengl/oglwindow.cxx
index 9060145..9f09533 100644
--- a/avmedia/source/opengl/oglwindow.cxx
+++ b/avmedia/source/opengl/oglwindow.cxx
@@ -266,7 +266,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
{
// Limit zooming in orbit mode
m_fCameraDistance += vMoveBy.z;
- if ((m_fCameraDistance < 0.75 * fModelSize && vMoveBy.z < 0.0 ) ||
+ if ((m_fCameraDistance < 0.5 * fModelSize && vMoveBy.z < 0.0 ) ||
(m_fCameraDistance > 2 * fModelSize && vMoveBy.z > 0.0 ))
{
m_fCameraDistance -= vMoveBy.z;
@@ -292,7 +292,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
glm::vec3 vView;
glm::vec3 vUp;
gltf_get_camera_pos(&m_rHandle, &vEye,&vView,&vUp);
- m_fCameraDistance = vEye.z - gltf_get_model_center_pos(&m_rHandle)->z;
+ m_fCameraDistance = vEye.z - gltf_get_model_center_pos(&m_rHandle)->z - (gltf_get_model_size(&m_rHandle)/2.0);
}
}
else if(nCode == KEY_F)
More information about the Libreoffice-commits
mailing list