-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerspectiveCameraComponent.cpp
More file actions
64 lines (40 loc) · 1.1 KB
/
PerspectiveCameraComponent.cpp
File metadata and controls
64 lines (40 loc) · 1.1 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "stdafx.h"
#include "PerspectiveCameraComponent.h"
#include "Visitor.h"
void PerspectiveCameraComponent::init(float fov, float near, float far, float ratio) {
m_fFov = fov;
m_fNear = near;
m_fFar = far;
m_fRatio = ratio;
m_mProjectionMatrix = glm::perspective(fov, m_fRatio, near, far);
}
void PerspectiveCameraComponent::accept(Visitor* visitor) {
visitor->visitPerspectiveCameraComponent(this);
}
const glm::mat4& PerspectiveCameraComponent::getProjectionMatrix() const {
return m_mProjectionMatrix;
}
float PerspectiveCameraComponent::getFov() const {
return m_fFov;
}
float PerspectiveCameraComponent::getNear() const {
return m_fNear;
}
float PerspectiveCameraComponent::getFar() const {
return m_fFar;
}
float PerspectiveCameraComponent::getRatio() const {
return m_fRatio;
}
void PerspectiveCameraComponent::setFov(float value) {
m_fFov = value;
}
void PerspectiveCameraComponent::setNear(float value) {
m_fNear = value;
}
void PerspectiveCameraComponent::setFar(float value) {
m_fFar = value;
}
void PerspectiveCameraComponent::setRatio(float value) {
m_fRatio = value;
}