-
Notifications
You must be signed in to change notification settings - Fork 1
/
Camera.h
56 lines (46 loc) · 1.09 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
#ifndef CAMERA_H
#define CAMERA_H
#include <windows.h>
#include <Gl/gl.h>
#include <GL/glu.h>
#include "Matrix.h"
#include "MatrixManager.h"
class Camera
{
protected:
float m_nEyePos[3];
float m_nLookAt[3];
float m_nUp[3];
float m_nRight[3];
float m_nHAngle;
float m_nVAngle;
int m_nLastMouseX, m_nLastMouseY;
float m_nRotSpeed;
public:
Camera();
void mouseRotate();
virtual void move(float nSpeed);
virtual void moveForward(float nSpeed);
virtual void moveBackward(float nSpeed);
virtual void moveLeft(float nSpeed);
virtual void moveRight(float nSpeed);
virtual void moveUp(float nSpeed);
virtual void moveDown(float nSpeed);
void recalculate();
void transform();
glm::mat4 transformToMatrix(glm::mat4 matrix);
void setPosition(float x, float y, float z);
void setLookAt(float x, float y, float z);
void setUp(float x, float y, float z);
void setRight(float x, float y, float z);
void setRotSpeed(float nSpeed);
float getEyeX();
float getEyeY();
float getEyeZ();
float *getEye();
Vector3 getEyeV();
Vector3 getLookAt();
Vector3 getUp();
Vector3 getRight();
};
#endif