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