-
Notifications
You must be signed in to change notification settings - Fork 4
/
TilingData.h
78 lines (68 loc) · 1.4 KB
/
TilingData.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef TILING_H
#define TILING_H
//#include <QMatrix3x3>
//#include <vector>
//#include <AVector.h>
enum ShapeType
{
S_REGULAR = 0,
S_POLYGON = 1,
};
struct TileData
{
public:
ShapeType _shapeType;
float _sides;
std::vector<QMatrix3x3> _transforms;
std::vector<AVector> _vertices;
float GetRotation()
{
if(this->_shapeType == ShapeType::S_POLYGON)
{
return 0;
}
else if(this->_sides == 3)
{
return M_PI / (this->_sides * 2.0f);
}
else if(this->_sides == 4)
{
return M_PI / this->_sides;
}
else if(this->_sides == 5)
{
// to do: why?
return M_PI / (-2.0f) ;
}
else if(this->_sides == 6)
{
return 0;
}
else if(this->_sides == 8)
{
return M_PI / this->_sides;
}
else if(this->_sides == 9)
{
return M_PI / 6.0f;
}
else if(this->_sides == 12)
{
return M_PI / this->_sides;
}
else if(this->_sides == 16)
{
return M_PI / this->_sides;
}
return 0;
}
};
struct TilingData
{
public:
std::string _name;
AVector _translation1;
AVector _translation2;
std::vector<TileData> _tiles;
};
#endif // TILING_H