]> git.lizzy.rs Git - minetest.git/blob - src/util/directiontables.h
8x block meshes (#13133)
[minetest.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 // all positions around an octablock in sector-first order
35 extern const v3s16 g_64dirs[64];
36
37 extern const u8 wallmounted_to_facedir[6];
38
39 extern const v3s16 wallmounted_dirs[8];
40
41 extern const v3s16 facedir_dirs[32];
42
43 extern const v3s16 fourdir_dirs[4];
44
45 /// Direction in the 6D format. g_27dirs contains corresponding vectors.
46 /// Here P means Positive, N stands for Negative.
47 enum Direction6D {
48 // 0
49         D6D_ZP,
50         D6D_YP,
51         D6D_XP,
52         D6D_ZN,
53         D6D_YN,
54         D6D_XN,
55 // 6
56         D6D_XN_YP,
57         D6D_XP_YP,
58         D6D_YP_ZP,
59         D6D_YP_ZN,
60         D6D_XN_ZP,
61         D6D_XP_ZP,
62         D6D_XN_ZN,
63         D6D_XP_ZN,
64         D6D_XN_YN,
65         D6D_XP_YN,
66         D6D_YN_ZP,
67         D6D_YN_ZN,
68 // 18
69         D6D_XN_YP_ZP,
70         D6D_XP_YP_ZP,
71         D6D_XN_YP_ZN,
72         D6D_XP_YP_ZN,
73         D6D_XN_YN_ZP,
74         D6D_XP_YN_ZP,
75         D6D_XN_YN_ZN,
76         D6D_XP_YN_ZN,
77 // 26
78         D6D,
79
80 // aliases
81         D6D_BACK   = D6D_ZP,
82         D6D_TOP    = D6D_YP,
83         D6D_RIGHT  = D6D_XP,
84         D6D_FRONT  = D6D_ZN,
85         D6D_BOTTOM = D6D_YN,
86         D6D_LEFT   = D6D_XN,
87 };
88
89 /// Direction in the wallmounted format.
90 /// P is Positive, N is Negative.
91 enum DirectionWallmounted {
92         DWM_YP,
93         DWM_YN,
94         DWM_XP,
95         DWM_XN,
96         DWM_ZP,
97         DWM_ZN,
98 };