forked from afavaro/SPACEBATS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCamera.h
More file actions
43 lines (28 loc) · 634 Bytes
/
Camera.h
File metadata and controls
43 lines (28 loc) · 634 Bytes
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
#ifndef CAMERA_H
#define CAMERA_H
#include "Framework.h"
#include "InputListener.h"
#include "btBulletDynamicsCommon.h"
#define Z_NEAR 0.1
#define Z_FAR 1000.0
struct Zoom {
btVector3 startPos, endPos;
btScalar time, duration;
};
class Camera : public InputListener {
public:
Camera();
~Camera();
void setProjectionAndView(float aspectRatio);
void handleEvent(sf::Event &event, const sf::Input &input);
void update(float tstep);
void setTarget(btVector3 target);
private:
void setZoom(btVector3 endPos);
btVector3 pos;
btQuaternion quat;
Zoom *curZoom;
bool mousePressed;
int mouseX, mouseY;
};
#endif