summaryrefslogtreecommitdiffstats
path: root/demos/boxes/trackball.h
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-05-01 01:41:12 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-05-01 01:41:53 (GMT)
commit79bc8f778f0b7b935ce3d808d8c91c3730f886bb (patch)
treeffe8356a7c1038af0c104fee1516ce4d84defcef /demos/boxes/trackball.h
parent1092ef425b9ed5835e4863c5ec32f9fc21af8d4d (diff)
downloadQt-79bc8f778f0b7b935ce3d808d8c91c3730f886bb.zip
Qt-79bc8f778f0b7b935ce3d808d8c91c3730f886bb.tar.gz
Qt-79bc8f778f0b7b935ce3d808d8c91c3730f886bb.tar.bz2
Port boxes demo to use math3d throughout
Patch originally by Ian Walters.
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;