-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathCamera.h
82 lines (76 loc) · 2.26 KB
/
Camera.h
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
/* 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
*/
#ifndef CAMERA_H
#define CAMERA_H
#include "Vector2i.h"
#include "Vector2f.h"
#include "Vector3f.h"
#include <QMatrix4x4>
#include <QVector3D>
#include <QMouseEvent>
class PreciseTileCoordinate;
class GameObj;
class GLUU;
class Camera {
public:
Camera(float* pt = 0);
Camera(const Camera& orig);
virtual ~Camera();
virtual float* getTarget();
virtual float* getUp();
virtual float* getMatrix();
virtual float* getPos();
virtual void setPos(float* pos);
virtual void setPos(float x, float y, float z);
virtual void setPlayerRot(float x, float y);
virtual float getRotX();
virtual float getRotY();
virtual void setPozT(int x, int y);
virtual void moveForward(float fps);
virtual void moveBackward(float fps);
virtual void moveLeft(float fps);
virtual void moveRight(float fps);
virtual void moveUp();
virtual void moveDown();
virtual void patrzX(float f);
virtual void patrzY(float f);
virtual void check_coords();
virtual void MouseWheel(QWheelEvent* e);
virtual void MouseMove(QMouseEvent* e);
virtual void MouseDown(QMouseEvent* e);
virtual void MouseUp(QMouseEvent* e);
virtual void keyDown(QKeyEvent * e);
virtual void keyUp(QKeyEvent * e);
virtual void update(float fps);
virtual void renderHud(GLUU *gluu);
virtual void setCameraObject(GameObj* o);
virtual PreciseTileCoordinate* getCurrentPos();
float * pozT = NULL;
int starex, starey;
float fov;
protected:
float pos[3];
float target[3];
float up[3];
float playerPos[3];
float playerRot[2];
float relativePos[3];
float relativeRot[3];
float lookAt[16];
float przesx = 3, przesy = 1, przesz = 3;
bool lockYaxis = false;
int jestcontrol;
int lpm = 0;
int rpm = 0;
bool moveF, moveR, moveB, moveL;
PreciseTileCoordinate* currentPos = 0;
GameObj* cameraObject = NULL;
};
#endif /* CAMERA_H */