summaryrefslogtreecommitdiffstats
path: root/src/datavis3d/utils/camerahelper.cpp
diff options
context:
space:
mode:
authorKeränen Pasi <pasi.keranen@digia.com>2013-06-19 10:31:08 +0300
committerPasi Keränen <pasi.keranen@digia.com>2013-06-19 10:39:12 +0300
commit4f160767b41f230dc6f0be83869c74960c85e3b7 (patch)
treebbc45b6d62ab39f2a17505787d4ac5c46cd0945d /src/datavis3d/utils/camerahelper.cpp
parent41ba83fdb2c91cf7ab9691989f097018f4edbce8 (diff)
CameraHelper made non-static to support multiple concurrent 3D views.
Change-Id: I88ba9ff299b4469784459e0409dfe3c629119af3 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavis3d/utils/camerahelper.cpp')
-rw-r--r--src/datavis3d/utils/camerahelper.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/datavis3d/utils/camerahelper.cpp b/src/datavis3d/utils/camerahelper.cpp
index 5b0183b0..4523ee9a 100644
--- a/src/datavis3d/utils/camerahelper.cpp
+++ b/src/datavis3d/utils/camerahelper.cpp
@@ -47,19 +47,24 @@
QT_DATAVIS3D_BEGIN_NAMESPACE
-// Initial camera position
-QVector3D m_position = QVector3D(0, 0.25, 3);
-QVector3D m_target = QVector3D(0, 0, 0);
-QVector3D m_up = QVector3D(0, 1, 0);
-
-QPoint m_previousMousePos(0, 0);
+CameraHelper::CameraHelper(QObject *parent) :
+ QObject(parent),
+ m_position(0, 0.25, 3),
+ m_target(0, 0, 0),
+ m_up(0, 1, 0),
+ m_previousMousePos(0,0),
+ m_xRotation(0),
+ m_yRotation(0),
+ m_defaultXRotation(0),
+ m_defaultYRotation(0),
+ m_rotationSpeed(100)
+{
+}
-GLfloat m_xRotation = 0;
-GLfloat m_yRotation = 0;
-GLfloat m_defaultXRotation = 0;
-GLfloat m_defaultYRotation = 0;
+CameraHelper::~CameraHelper()
+{
+}
-GLfloat m_rotationSpeed = 100;
// FUNCTIONS
void CameraHelper::setRotationSpeed(int speed)