-
Notifications
You must be signed in to change notification settings - Fork 1
/
camera.cpp
60 lines (47 loc) · 1.05 KB
/
camera.cpp
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
#include "camera.h"
Camera::Camera() : m_view(Matrix4f::IDENTITY)
{
}
Camera::~Camera()
{
}
void Camera::KeyPressEvent(unsigned char key)
{
// Default camera behavior, do nothing
}
void Camera::KeyReleaseEvent(unsigned char key)
{
// Default camera behavior, do nothing
}
void Camera::MouseMoveEvent(int x, int y)
{
// Default camera behavior, do nothing
}
void Camera::MousePressEvent(const MOUSE_BUTTON &button, int x, int y)
{
// Default camera behavior, do nothing
}
void Camera::MouseReleaseEvent(const MOUSE_BUTTON &button, int x, int y)
{
// Default camera behavior, do nothing
}
void Camera::WindowFocusEvent(bool hasFocus)
{
// Default camera behavior, do nothing
}
void Camera::WindowResizeEvent(int width, int height)
{
// Default camera behavior, do nothing
}
const Matrix4f& Camera::GetMatrix() const
{
return m_view;
}
Vector3f Camera::GetWorldPosition() const
{
return m_view.GetTranslation();
}
Vector3f Camera::GetViewDirection() const
{
return Vector3f(-m_view.Get31(), -m_view.Get32(), -m_view.Get33());
}