[Libreoffice-commits] core.git: avmedia/source
Zolnai Tamás
tamas.zolnai at collabora.com
Thu May 15 11:54:04 PDT 2014
avmedia/source/opengl/oglwindow.cxx | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 684b0a11040a4f46d9a4971583c21350b6395d18
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Thu May 15 20:50:30 2014 +0200
OGLWindow: improve camera movement, make it faster
By now there is no a timer which rerender the
scene all the time so we need to move camera
without setting time.
Change-Id: Iba1bfd9b9dc87309cf83d5dcd6832f0e4cb2cd92
diff --git a/avmedia/source/opengl/oglwindow.cxx b/avmedia/source/opengl/oglwindow.cxx
index ca2ffbf..90e32ed 100644
--- a/avmedia/source/opengl/oglwindow.cxx
+++ b/avmedia/source/opengl/oglwindow.cxx
@@ -270,14 +270,14 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
vMup = glm::normalize(vMup);
vMup *= 25.0f;
- if(nCode == KEY_Q)vMoveBy += vMove*(0.1f*fModelSize);
- if(nCode == KEY_E)vMoveBy -= vMove*(0.1f*fModelSize);
- if(nCode == KEY_A)vMoveBy -= vStrafe*(0.1f*fModelSize);
- if(nCode == KEY_D)vMoveBy += vStrafe*(0.1f*fModelSize);
- if(nCode == KEY_W)vMoveBy -= vMup*(0.1f*fModelSize);
- if(nCode == KEY_S)vMoveBy += vMup*(0.1f*fModelSize);
+ if(nCode == KEY_Q)vMoveBy += vMove*(0.001f*fModelSize);
+ if(nCode == KEY_E)vMoveBy -= vMove*(0.001f*fModelSize);
+ if(nCode == KEY_A)vMoveBy -= vStrafe*(0.001f*fModelSize);
+ if(nCode == KEY_D)vMoveBy += vStrafe*(0.001f*fModelSize);
+ if(nCode == KEY_W)vMoveBy -= vMup*(0.001f*fModelSize);
+ if(nCode == KEY_S)vMoveBy += vMup*(0.001f*fModelSize);
}
- gltf_renderer_move_camera(vMoveBy.x,vMoveBy.y,vMoveBy.z,10.0);
+ gltf_renderer_move_camera(vMoveBy.x,vMoveBy.y,vMoveBy.z,0.0);
update();
}
}
@@ -290,7 +290,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
m_aLastMousePos = pMouseEvt->GetPosPixel();
}
}
- else if( pEvent->GetId() == VCLEVENT_WINDOW_MOUSEBUTTONUP )
+ else if( pEvent->GetId() == VCLEVENT_WINDOW_MOUSEMOVE )
{
MouseEvent* pMouseEvt = (MouseEvent*)pEvent->GetData();
if(pMouseEvt && pMouseEvt->IsLeft())
@@ -299,9 +299,9 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
long nDeltaX = m_aLastMousePos.X()-aCurPos.X();
long nDeltaY = aCurPos.Y()-m_aLastMousePos.Y();
- static const float fSensitivity = 4.0;
+ static const float fSensitivity = 1.0;
// TODO: It seems this method just moves the camera but not rotate it.
- gltf_renderer_rotate_camera((float)nDeltaX*fSensitivity,(float)nDeltaY*fSensitivity,0.0,10.0);
+ gltf_renderer_rotate_camera((float)nDeltaX*fSensitivity,(float)nDeltaY*fSensitivity,0.0,0.0);
update();
}
}
More information about the Libreoffice-commits
mailing list