CameraInterface.h 635 Bytes
Newer Older
Anakin's avatar
Anakin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include <QMatrix4x4>

class CameraInterface
{
public:
	explicit CameraInterface() {};
	virtual ~CameraInterface() {};

// attributes
protected:
	QMatrix4x4 m_matrix;
	double m_zSpeed = 1.0;

// functions
public:
	virtual void setZoomSpeed(int percent) { m_zSpeed = (double) percent / 100; };

	virtual void rotateAction(QVector2D diff) = 0;
	virtual void moveAction(QVector2D diff) = 0;
	virtual void wheelAction(double value) = 0;
	virtual void resetView() { m_matrix = QMatrix4x4(); m_zSpeed = 1.0; };

	virtual void recalculateMatrix() = 0;
	virtual QMatrix4x4 getMatrix() { recalculateMatrix(); return m_matrix; };
};