-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCamera.h
More file actions
27 lines (20 loc) · 780 Bytes
/
Camera.h
File metadata and controls
27 lines (20 loc) · 780 Bytes
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
27
#ifndef CAMERA_H
#define CAMERA_H
#include "Transform.h"
#include <QMatrix4x4>
class Camera
{
public:
Camera(Transform transform);
Camera(QVector3D position = QVector3D(0.0f, 0.0f, 0.0f),
QQuaternion rotation = QQuaternion(1.0f, 0.0f, 0.0f, 0.0f),
QVector3D scale = QVector3D(1.0f, 1.0f, 1.0f));
Transform& transform();
const Transform& transform() const;
void setTransform(Transform transform);
static QMatrix4x4 perspective(float fieldOfView, float aspectRatio, float nearPlane, float farPlane);
static QMatrix4x4 orthographic(float right, float left, float top, float bottom, float nearPlane, float farPlane);
private:
Transform cameraTransform;
};
#endif // CAMERA_H