GlobeEngine
FlightCamera.h
Go to the documentation of this file.
1 
9 #ifndef GlobeEngine_FlightCamera_h
10 #define GlobeEngine_FlightCamera_h
11 
12 #include "OpenGL_Includes.h"
13 #include "Camera.h"
14 #include <vector>
15 #include <vmmlib/matrix.hpp>
16 #include <vmmlib/quaternion.hpp>
17 #include "ViewFrustum.h"
18 #include "Common.h"
19 
20 namespace ge {
21 
22  class FlightCamera : public Camera
23  {
24  public:
25 
26  FlightCamera();
27  ~FlightCamera ();
28 
29  void clear() override;
30  void destroy() override;
31  void update() override;
32  void print() override;
33 
34  void create(ViewFrustumProperties _in);
36  vmml::Vector3d _pos,
37  double _velocity,
38  double _pitch,
39  double _heading);
41  vmml::Vector3d _pos,
42  vmml::Vector3d _camDir,
43  vmml::Vector3d _camRight,
44  vmml::Vector3d _camUp,
45  double _velocity,
46  double _pitch,
47  double _heading);
48 
49  void createQuatFromAxisAngle(vmml::Quaterniond & quat, GLfloat x, GLfloat y, GLfloat z, GLfloat degrees);
50  void calculateViewMatrix() override;
51 
52  void setPitch(GLfloat _deg);
53  void setHeading(GLfloat _deg);
54  void changeHeading(GLfloat _degrees);
55  void changePitch(GLfloat _degrees);
56  void changeWithinXZPlane(vmml::Vector2f _changeVector);
57  void changeInDirection(float _value);
58 
59  void setMoving_X(GLint _value);
60  void setMoving_Z(GLint _value);
61 
62  double getVelocity();
63  void setVelocity(double _velocity);
64 
65  double getHeading();
66  double getPitch();
67 
68 
69  protected:
70  void create(ViewFrustumProperties _in, vmml::Vector3d _pos);
71 
72  GLfloat maxPitchRate;
73  GLfloat maxHeadingRate;
74  GLfloat headingDegrees;
75  GLfloat pitchDegrees;
76 
77  vmml::Quaterniond quatHeading;
78  vmml::Quaterniond quatPitch;
79 
80  double velocity;
81  GLint moving_X; // 0 = keine Bewegung, 1 = vorwaerts, 2 = rueckwaerts
82  GLint moving_Z;
83 
84  };
85 }
86 #endif
void clear() override
Definition: FlightCamera.cpp:20
void changePitch(GLfloat _degrees)
Definition: FlightCamera.cpp:184
GLint moving_Z
Definition: FlightCamera.h:82
double getVelocity()
Definition: FlightCamera.cpp:322
vmml::Quaterniond quatPitch
Definition: FlightCamera.h:78
void createQuatFromAxisAngle(vmml::Quaterniond &quat, GLfloat x, GLfloat y, GLfloat z, GLfloat degrees)
Definition: FlightCamera.cpp:287
GLfloat headingDegrees
Definition: FlightCamera.h:74
GLfloat pitchDegrees
Definition: FlightCamera.h:75
void setMoving_X(GLint _value)
Definition: FlightCamera.cpp:310
void setVelocity(double _velocity)
Definition: FlightCamera.cpp:328
void changeInDirection(float _value)
Definition: FlightCamera.cpp:162
FlightCamera()
Definition: FlightCamera.cpp:11
double velocity
Definition: FlightCamera.h:80
~FlightCamera()
Definition: FlightCamera.cpp:16
void print() override
Definition: FlightCamera.cpp:342
Definition: Camera.h:18
double getHeading()
Definition: FlightCamera.cpp:338
void calculateViewMatrix() override
Definition: FlightCamera.cpp:86
void setPitch(GLfloat _deg)
Definition: FlightCamera.cpp:302
vmml::Quaterniond quatHeading
Definition: FlightCamera.h:77
void destroy() override
Definition: FlightCamera.cpp:33
Definition: ViewFrustum.h:18
Definition: AvalancheTrainingSimulationEngine.h:28
void changeHeading(GLfloat _degrees)
Definition: FlightCamera.cpp:226
GLint moving_X
Definition: FlightCamera.h:81
void setHeading(GLfloat _deg)
Definition: FlightCamera.cpp:306
void changeWithinXZPlane(vmml::Vector2f _changeVector)
Definition: FlightCamera.cpp:170
void setMoving_Z(GLint _value)
Definition: FlightCamera.cpp:316
GLfloat maxPitchRate
Definition: FlightCamera.h:72
Definition: FlightCamera.h:22
void update() override
Definition: FlightCamera.cpp:79
void create(ViewFrustumProperties _in)
Definition: FlightCamera.cpp:70
GLfloat maxHeadingRate
Definition: FlightCamera.h:73
double getPitch()
Definition: FlightCamera.cpp:334