forked from eu07/maszyna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCamera.h
57 lines (52 loc) · 1.46 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
/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#ifndef CameraH
#define CameraH
#include "dumb3d.h"
using namespace Math3D;
//---------------------------------------------------------------------------
enum TCameraType
{ // tryby pracy kamery
tp_Follow, // jazda z pojazdem
tp_Free, // stoi na scenerii
tp_Satelite // widok z góry (nie u¿ywany)
};
class TCamera
{
private:
vector3 pOffset; // nie u¿ywane (zerowe)
public: // McZapkie: potrzebuje do kiwania na boki
double Pitch;
double Yaw; // w œrodku: 0=do przodu; na zewn¹trz: 0=na po³udnie
double Roll;
TCameraType Type;
vector3 Pos; // wspó³rzêdne obserwatora
vector3 LookAt; // wspó³rzêdne punktu, na który ma patrzeæ
vector3 vUp;
vector3 Velocity;
vector3 OldVelocity; // lepiej usredniac zeby nie bylo rozbiezne przy malym FPS
vector3 CrossPos;
double CrossDist;
void Init(vector3 NPos, vector3 NAngle);
void Reset()
{
Pitch = Yaw = Roll = 0;
};
void OnCursorMove(double x, double y);
void Update();
vector3 GetDirection();
// vector3 inline GetCrossPos() { return Pos+GetDirection()*CrossDist+CrossPos; };
bool SetMatrix();
void SetCabMatrix(vector3 &p);
void RaLook();
void Stop();
// bool GetMatrix(matrix4x4 &Matrix);
vector3 PtNext, PtPrev;
};
#endif