/
ofxGameCamera.h
61 lines (44 loc) · 961 Bytes
/
ofxGameCamera.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
/*
* ofxGameCamera.h
*
* Created by James George on 1/19/11.
* Copyright 2011 FlightPhase. All rights reserved.
*
*/
#pragma once
#include "ofMain.h"
#include "ofxXmlSettings.h"
class ofxGameCamera : public ofCamera {
public:
ofxGameCamera();
void setup();
void update(ofEventArgs& args);
float sensitivityX;
float sensitivityY;
float minimumX;
float maximumX;
float minimumY;
float maximumY;
float rotationX;
float rotationY;
float rotationZ;
float targetXRot;
float targetYRot;
float targetZRot;
float rollSpeed;
float speed;
virtual void begin(ofRectangle rect = ofGetWindowRect());
void updateRotation();
ofNode targetNode;
ofVec2f lastMouse;
bool usemouse;
bool useArrowKeys;
bool autosavePosition;
bool applyRotation;
bool applyTranslation;
string cameraPositionFile;
void saveCameraPosition();
void loadCameraPosition();
void setAnglesFromOrientation();
void reset();
};