-
Notifications
You must be signed in to change notification settings - Fork 0
/
ICamera.h
54 lines (49 loc) · 1.92 KB
/
ICamera.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 ICAMERA_H
#define ICAMERA_H
#include "ILogger.h"
class ICamera
{
enum CameraType { LAND, AIRCRAFT }; //òèï êàìåðû
CameraType cameraType;
float accumPitchDegrees; //äëÿ õðàíåíèÿ óãëîâ
float accumYawDegrees;
float accumRollDegrees;
float maxPitchDegrees; //ìàêñèìàëüíûå óãëû ïîâîðîòà
float maxYawDegrees;
float maxRollDegrees;
float fovy; //îáëàñòü âèäèìîñòè ïî ó
float aspectRatio; //àñïåêò
float zNear; // áëèæíÿÿ ïëîñêîñòü
float zFar; //äàëüíÿÿ
D3DXVECTOR3 viewDir; //íàïðàâëåíèå îáçîðà
D3DXQUATERNION orientation; //êâàòåðíèîíû äëÿ âðàùåíèÿ
D3DXQUATERNION rotQuaternion;
D3DXMATRIXA16 viewMatrix; //ìàòðèöû
D3DXMATRIXA16 projMatrix;
D3DXMATRIXA16 rotMatrix;
D3DXVECTOR3 xAxis; //ëîêàëüíûå êîîðäèíàòû êàìåðû
D3DXVECTOR3 zAxis;
D3DXVECTOR3 yAxis;
public:
D3DXVECTOR3 eye; //ïîçèöèÿ íàáëþäàòåëÿ(êàìåðû)
ICamera();
~ICamera();
void SetEyeVector(D3DXVECTOR3 eye); //óñòàíàâëèâàåò ïîçèöèþ êàìåðû
void SetProjectionMatrix(float fovY, float aspect, float zNear, float zFar); //ñòðîèò ìàòðèöó ïðîåêöèè
void Move(float dx, float dy, float dz); //äâèãàåò êàìåðó â å¸ ëîêàëüíûõ êîîðäèíàòàõ
void Move(const D3DXVECTOR3 &direction, const D3DXVECTOR3 &amount); //äâèãàåò êàìåðó â ïðîèçâîëüíîì íàïðàâëåíèè
void Move(const D3DXVECTOR3 &direction, float dx, float dy, float dz); //äâèãàåò êàìåðó â ïðîèçâîëüíîì íàïðàâëåíèè
void MoveGlobal(float dx, float dy, float dz); //äâèãàåò êàìåðó â ãëîáàëüíûõ êîîðäèíàòàõ
void Pitch(float degrees); //íàêëîí
void Yaw(float degrees); //ðûñêàíüå
void Roll(float degrees); //âðàùåíèå
D3DXMATRIXA16& UpdateViewMatrix(); //îáíîâëåíèè ìàòðèöû âèäà
void LookAt(const D3DXVECTOR3 &target); //ôîêóñèðóåò êàìåðó íà îïðåäåëåííóþ òî÷êó
float GetYaw(); //âîçâðàùàåò óãëû íàêëîíà, ðûñêàíüÿ è âðàùåíèÿ
float GetPitch();
float GetRoll();
void Reset();
D3DXMATRIXA16& GetViewMatrix(); //âîçâðàùàåò ìàòðèöó âèäà
D3DXMATRIXA16& GetProjMatrix(); //âîçâðàùàåò ìàòðèöó ïðîåêöèè
};
#endif