-
Notifications
You must be signed in to change notification settings - Fork 17
/
Camera.cpp
154 lines (117 loc) · 2.62 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* This file is part of TSRE5.
*
* TSRE5 - train sim game engine and MSTS/OR Editors.
* Copyright (C) 2016 Piotr Gadecki <[email protected]>
*
* Licensed under GNU General Public License 3.0 or later.
*
* See LICENSE.md or https://www.gnu.org/licenses/gpl.html
*/
#include "Camera.h"
#include <math.h>
#include "GLMatrix.h"
#include "Game.h"
#include "GeoCoordinates.h"
#include "GameObj.h"
#include "GLUU.h"
Camera::Camera(float* pt) {
pozT = pt;
up[0] = 0;
up[1] = 1;
up[2] = 0;
playerRot[0] = 0.0;
playerRot[1] = 0.0;
playerPos[0] = 0;
playerPos[1] = 10;
playerPos[2] = 0;
relativeRot[0] = 0;
relativeRot[1] = 0;
relativeRot[2] = 0;
relativePos[0] = 0;
relativePos[1] = 0;
relativePos[2] = 0;
Mat4::identity(lookAt);
moveF = moveR = moveB = moveL = false;
fov = Game::cameraFov;
}
Camera::Camera(const Camera& orig) {
}
Camera::~Camera() {
}
PreciseTileCoordinate* Camera::getCurrentPos(){
if(this->currentPos == NULL)
this->currentPos = new PreciseTileCoordinate();
return this->currentPos;
}
float* Camera::getMatrix() {
return lookAt;
};
float* Camera::getTarget() {
return target;
}
float* Camera::getUp() {
return up;
}
void Camera::setPos(float* pos){
}
void Camera::setPos(float x, float y, float z){
}
void Camera::setPlayerRot(float x, float y){
this->playerRot[0] = x;
this->playerRot[1] = y;
}
void Camera::setPozT(int x, int y){
}
float* Camera::getPos() {
return pos;
}
float Camera::getRotX() {
return 0;
}
float Camera::getRotY() {
return 0;
}
void Camera::update(float fps) {
}
void Camera::renderHud(GLUU *gluu){
if(cameraObject != NULL)
cameraObject->renderHud();
}
void Camera::setCameraObject(GameObj* o){
cameraObject = o;
playerRot[0] = M_PI;
playerRot[1] = 0.0;
playerPos[0] = 0;
playerPos[1] = 3;
playerPos[2] = 0;
}
void Camera::moveForward(float fps) {
}
void Camera::moveBackward(float fps) {
}
void Camera::moveLeft(float fps) {
}
void Camera::moveRight(float fps) {
}
void Camera::moveUp() {
}
void Camera::moveDown() {
}
void Camera::patrzX(float f) {
}
void Camera::patrzY(float f) {
}
void Camera::check_coords() {
}
void Camera::MouseWheel(QWheelEvent* e) {
}
void Camera::MouseMove(QMouseEvent* e) {
}
void Camera::MouseDown(QMouseEvent* e) {
}
void Camera::MouseUp(QMouseEvent* e) {
}
void Camera::keyUp(QKeyEvent * e) {
}
void Camera::keyDown(QKeyEvent * e) {
};