summaryrefslogtreecommitdiffstats
path: root/demos/boxes/trackball.h
diff options
context:
space:
mode:
Diffstat (limited to 'demos/boxes/trackball.h')
-rw-r--r--demos/boxes/trackball.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/demos/boxes/trackball.h b/demos/boxes/trackball.h
index 5e3f40c..66e9b68 100644
--- a/demos/boxes/trackball.h
+++ b/demos/boxes/trackball.h
@@ -44,7 +44,8 @@
#include <QtGui>
-#include "vector.h"
+#include <QtGui/qvector3d.h>
+#include <QtGui/qquaternion.h>
class TrackBall
{
@@ -55,17 +56,17 @@ public:
Sphere,
};
TrackBall(TrackMode mode = Sphere);
- TrackBall(float angularVelocity, const gfx::Vector3f& axis, TrackMode mode = Sphere);
+ TrackBall(float angularVelocity, const QVector3D& axis, TrackMode mode = Sphere);
// coordinates in [-1,1]x[-1,1]
- void push(const QPointF& p, const gfx::Quaternionf &transformation);
- void move(const QPointF& p, const gfx::Quaternionf &transformation);
- void release(const QPointF& p, const gfx::Quaternionf &transformation);
+ void push(const QPointF& p, const QQuaternion &transformation);
+ void move(const QPointF& p, const QQuaternion &transformation);
+ void release(const QPointF& p, const QQuaternion &transformation);
void start(); // starts clock
void stop(); // stops clock
- gfx::Quaternionf rotation() const;
+ QQuaternion rotation() const;
private:
- gfx::Quaternionf m_rotation;
- gfx::Vector3f m_axis;
+ QQuaternion m_rotation;
+ QVector3D m_axis;
float m_angularVelocity;
QPointF m_lastPos;