-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.h
More file actions
47 lines (36 loc) · 838 Bytes
/
Camera.h
File metadata and controls
47 lines (36 loc) · 838 Bytes
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
#ifndef _CAMERA_H_
#define _CAMERA_H_
#include "vec.h"
class Camera {
public:
Camera(const vec3& position, const vec3& target, const vec3& up);
void setPosition(const vec3& position);
void setTarget(const vec3& target);
void setUpVector(const vec3& up);
vec3 getPosition() const;
vec3 getTarget() const;
vec3 getUpVector() const;
vec3 getDirection() const;
void setCameraMatrix();
protected:
vec3 mPosition;
vec3 mTarget;
vec3 mUpVector;
};
class FirstPersonCamera : public Camera {
public:
FirstPersonCamera();
void move(float step);
void strafe(float step);
void changePitch(float step);
void changeYaw(float step);
private:
vec3 cameraOriginalUp;
vec3 cameraOriginalLook;
vec3 cameraOriginalStrafe;
vec3 mDirection;
float pitch, yaw;
vec3 mStrafeDirection;
void updateAxes();
};
#endif // _CAMERA_H_