]> git.lizzy.rs Git - dragonfireclient.git/blob - src/util/directiontables.h
97e18343afe4c2b09a82d078130c216cfe0d04a6
[dragonfireclient.git] / src / util / directiontables.h
1 /*
2 Minetest
3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #pragma once
21
22 #include "../irrlichttypes.h"
23 #include "../irr_v3d.h"
24
25 extern const v3s16 g_6dirs[6];
26
27 extern const v3s16 g_7dirs[7];
28
29 extern const v3s16 g_26dirs[26];
30
31 // 26th is (0,0,0)
32 extern const v3s16 g_27dirs[27];
33
34 extern const u8 wallmounted_to_facedir[6];
35
36 /// Direction in the 6D format. g_27dirs contains corresponding vectors.
37 /// Here P means Positive, N stands for Negative.
38 enum Direction6D {
39 // 0
40         D6D_ZP,
41         D6D_YP,
42         D6D_XP,
43         D6D_ZN,
44         D6D_YN,
45         D6D_XN,
46 // 6
47         D6D_XN_YP,
48         D6D_XP_YP,
49         D6D_YP_ZP,
50         D6D_YP_ZN,
51         D6D_XN_ZP,
52         D6D_XP_ZP,
53         D6D_XN_ZN,
54         D6D_XP_ZN,
55         D6D_XN_YN,
56         D6D_XP_YN,
57         D6D_YN_ZP,
58         D6D_YN_ZN,
59 // 18
60         D6D_XN_YP_ZP,
61         D6D_XP_YP_ZP,
62         D6D_XN_YP_ZN,
63         D6D_XP_YP_ZN,
64         D6D_XN_YN_ZP,
65         D6D_XP_YN_ZP,
66         D6D_XN_YN_ZN,
67         D6D_XP_YN_ZN,
68 // 26
69         D6D,
70
71 // aliases
72         D6D_BACK   = D6D_ZP,
73         D6D_TOP    = D6D_YP,
74         D6D_RIGHT  = D6D_XP,
75         D6D_FRONT  = D6D_ZN,
76         D6D_BOTTOM = D6D_YN,
77         D6D_LEFT   = D6D_XN,
78 };
79
80 /// Direction in the wallmounted format.
81 /// P is Positive, N is Negative.
82 enum DirectionWallmounted {
83         DWM_YP,
84         DWM_YN,
85         DWM_XP,
86         DWM_XN,
87         DWM_ZP,
88         DWM_ZN,
89 };