-
Notifications
You must be signed in to change notification settings - Fork 0
/
Camera.h
53 lines (35 loc) · 872 Bytes
/
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
#ifndef _CAMERA_H
#define _CAMERA_H
#include "sgtypes.h"
#include "Math3d.h"
#include "Context.h"
#include <allegro5\allegro.h>
#include <allegro5\allegro_opengl.h>
#include <GL/GLU.h>
#include <stdio.h>
class Camera {
protected:
Vector3f focus_location;
Vector3f camera_location;
ALLEGRO_DISPLAY_MODE display_data;
Quaternion rotation;
Quaternion pitch;
CameraContext * context;
public:
float yaw;
//float pitch;
float roll;
Camera();
void initialize(CameraContext * cctxt);
void setupProjection(ALLEGRO_DISPLAY_MODE _display_data);
//void gluPerspective(float fov, float aspect, float near_plane, float far_plane);
void preRender();
void postRender();
void moveTo(Vector3f location);
void lookAt(Vector3f location);
void moveY(float inc);
void changePitch(float a);
void applyRotation(float a, Vector3f axis);
~Camera();
};
#endif