-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorientation_compass.h
More file actions
90 lines (72 loc) · 1.99 KB
/
orientation_compass.h
File metadata and controls
90 lines (72 loc) · 1.99 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
#ifndef ORIENTATION_COMPASS_H
#define ORIENTATION_COMPASS_H
#include "gl_drawable.h"
#include "glm/glm.hpp"
#include "shape_factory.h"
#include "controllers.h"
/***********
* CONTOUR *
***********/
class Contour : public GlCircle
{
public:
Contour();
virtual void render();
};
/***************
* NORTH ARROW *
***************/
class NorthArrow : public GlArrow
{
public:
NorthArrow();
virtual void render();
};
/********************
* TRUE NORTH ARROW *
*******************/
class TrueNorthArrow : public GlArrow
{
public:
TrueNorthArrow();
virtual void render();
};
//------------------------------
class OrientationCompass : public QObject{
Q_OBJECT
public:
OrientationCompass(PositionControllers & position_controllers);
~OrientationCompass();
void rotateNorth(float rotation);
std::vector<Asset*> getAssets();
glm::vec3 getNorthOrientation() const;
glm::vec3 getTrueNorthOrientation() const;
glm::vec3 getEastOrientation() const;
signals:
void orientationChanged(float north_x, float north_y, float north_z,
float true_north_x, float true_north_y, float true_north_z,
float east_x, float east_y, float east_z);
public slots:
void setLatitude(int latitude);
void setTerrainDimensions(int width, int depth, int base_height, int max_height);
private:
float m_north_rotation;
Contour * get_contour();
NorthArrow * get_north_arrow();
TrueNorthArrow * get_true_north_arrow();
void refresh_true_north();
void refresh_contour();
void refresh_north();
void emit_orientation_changed();
Contour * m_contour;
NorthArrow * m_north_arrow;
TrueNorthArrow * m_true_north_arrow;
int m_latitude;
glm::vec3 m_north_orientation;
glm::vec3 m_east_orientation;
glm::vec3 m_true_north_orientation;
glm::mat4x4 m_north_rotation_mat;
glm::mat4x4 m_true_north_rotation_mat;
glm::mat4x4 m_center_translation_mat;
};
#endif // ORIENTATION_COMPASS_H