-
-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathCamera.h
94 lines (73 loc) · 1.67 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
83
84
85
86
87
88
89
90
91
92
93
94
/*
* Copyright (c) scott.cgi All Rights Reserved.
*
* This source code belongs to project Mojoc, which is a pure C Game Engine hosted on GitHub.
* The Mojoc Game Engine is licensed under the MIT License, and will continue to be iterated with coding passion.
*
* License : https://github.com/scottcgi/Mojoc/blob/master/LICENSE
* GitHub : https://github.com/scottcgi/Mojoc
* CodeStyle: https://github.com/scottcgi/Mojoc/blob/master/Docs/CodeStyle.md
*
* Since : 2013-1-10
* Update : 2019-1-24
* Author : scott.cgi
*/
#ifndef CAMERA_H
#define CAMERA_H
#include "Engine/Toolkit/Math/Matrix.h"
#include "Engine/Toolkit/Math/Math.h"
/**
* Control main camera.
*/
struct ACamera
{
float left;
float right;
float bottom;
float top;
float near;
float far;
/**
* Camera position.
*/
float eyeX;
float eyeY;
float eyeZ;
/**
* We are looking toward the distance.
*/
float lookX;
float lookY;
float lookZ;
/**
* The up vector control camera direction, perpendicular to the camera plane.
*/
float upX;
float upY;
float upZ;
/**
* Store view projection matrix.
*/
Matrix4 vp [1];
/**
* Store projection matrix.
*/
Matrix4 projection[1];
/**
* Store the view matrix.
*/
Matrix4 view [1];
void (*SetOrthographic)(void);
void (*SetFrustum) (void);
void (*SetLookAt) (void);
/**
* The ZOrder most near camera.
*/
float (*GetNearZOrder)(void);
/**
* The ZOrder most far camera.
*/
float (*GetFarZOrder) (void);
};
extern struct ACamera ACamera[1];
#endif