removed timer rotation, now the user has full control,
added keyboard support, reset rotation with space
This commit is contained in:
@@ -24,7 +24,8 @@ public:
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
|
||||
void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
|
||||
|
||||
void initializeGL() Q_DECL_OVERRIDE;
|
||||
void resizeGL(int w, int h) Q_DECL_OVERRIDE;
|
||||
@@ -34,17 +35,17 @@ protected:
|
||||
void initTextures();
|
||||
|
||||
private:
|
||||
QBasicTimer timer;
|
||||
struct {
|
||||
bool left = false;
|
||||
bool right = false;
|
||||
QVector2D position;
|
||||
} m_mouse;
|
||||
QOpenGLShaderProgram program;
|
||||
GeometryEngine *geometries;
|
||||
|
||||
QOpenGLTexture *texture;
|
||||
|
||||
QMatrix4x4 projection;
|
||||
|
||||
QVector2D mousePressPosition;
|
||||
QVector3D rotationAxis;
|
||||
qreal angularSpeed;
|
||||
QQuaternion rotation;
|
||||
QMatrix4x4 m_projection;
|
||||
QQuaternion m_rotation;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user