forked from acaudwell/Gource
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzoomcamera.h
More file actions
90 lines (64 loc) · 2.19 KB
/
Copy pathzoomcamera.h
File metadata and controls
90 lines (64 loc) · 2.19 KB
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
/*
Copyright (C) 2009 Andrew Caudwell (acaudwell@gmail.com)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version
3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ZOOM_CAMERA_H
#define ZOOM_CAMERA_H
#include "core/bounds.h"
#include "core/frustum.h"
#include "gource_settings.h"
class ZoomCamera {
vec3 pos;
vec3 dest;
vec3 target;
vec3 up;
vec3 _pos;
vec3 _target;
bool lockon;
float speed;
float lockon_time;
float padding;
float min_distance, max_distance;
float fov;
float znear, zfar;
public:
ZoomCamera();
ZoomCamera(vec3 start, vec3 target, float min_distance, float max_distance);
void setSpeed(float speed);
void lockOn(bool lockon);
void look();
void lookAt(const vec3& target);
void focus();
const vec3& getPos() const { return pos; };
const vec3& getUp() const { return up; };
const vec3& getTarget() const { return target; };
const vec3& getDest() const { return dest; };
float getFOV() { return fov; };
float getZNear() { return znear; };
float getZFar() { return zfar; };
void setPos(const vec3& pos, bool keep_angle = false);
float getMinDistance();
float getMaxDistance();
void setPadding(float padding);
void setDistance(float distance);
void setMinDistance(float min);
void setMaxDistance(float max);
void reset();
void logic(float dt);
void adjustDistance();
void adjust(const Bounds2D& bounds);
void adjust(const Bounds2D& bounds, bool adjust_distance);
void stop();
};
extern bool gGourceVerticalCrop;
extern bool gGourceHorizontalCrop;
#endif