]> git.lizzy.rs Git - minetest.git/blob - src/util/directiontables.cpp
297058c9c8092beb1a8743e664438b0c7cbbd2ff
[minetest.git] / src / util / directiontables.cpp
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 #include "directiontables.h"
21
22 const v3s16 g_6dirs[6] =
23 {
24         // +right, +top, +back
25         v3s16( 0, 0, 1), // back
26         v3s16( 0, 1, 0), // top
27         v3s16( 1, 0, 0), // right
28         v3s16( 0, 0,-1), // front
29         v3s16( 0,-1, 0), // bottom
30         v3s16(-1, 0, 0) // left
31 };
32
33 const v3s16 g_7dirs[7] =
34 {
35         v3s16(0,0,1), // back
36         v3s16(0,1,0), // top
37         v3s16(1,0,0), // right
38         v3s16(0,0,-1), // front
39         v3s16(0,-1,0), // bottom
40         v3s16(-1,0,0), // left
41         v3s16(0,0,0), // self
42 };
43
44 const v3s16 g_26dirs[26] =
45 {
46         // +right, +top, +back
47         v3s16( 0, 0, 1), // back
48         v3s16( 0, 1, 0), // top
49         v3s16( 1, 0, 0), // right
50         v3s16( 0, 0,-1), // front
51         v3s16( 0,-1, 0), // bottom
52         v3s16(-1, 0, 0), // left
53         // 6
54         v3s16(-1, 1, 0), // top left
55         v3s16( 1, 1, 0), // top right
56         v3s16( 0, 1, 1), // top back
57         v3s16( 0, 1,-1), // top front
58         v3s16(-1, 0, 1), // back left
59         v3s16( 1, 0, 1), // back right
60         v3s16(-1, 0,-1), // front left
61         v3s16( 1, 0,-1), // front right
62         v3s16(-1,-1, 0), // bottom left
63         v3s16( 1,-1, 0), // bottom right
64         v3s16( 0,-1, 1), // bottom back
65         v3s16( 0,-1,-1), // bottom front
66         // 18
67         v3s16(-1, 1, 1), // top back-left
68         v3s16( 1, 1, 1), // top back-right
69         v3s16(-1, 1,-1), // top front-left
70         v3s16( 1, 1,-1), // top front-right
71         v3s16(-1,-1, 1), // bottom back-left
72         v3s16( 1,-1, 1), // bottom back-right
73         v3s16(-1,-1,-1), // bottom front-left
74         v3s16( 1,-1,-1), // bottom front-right
75         // 26
76 };
77
78 const v3s16 g_27dirs[27] =
79 {
80         // +right, +top, +back
81         v3s16( 0, 0, 1), // back
82         v3s16( 0, 1, 0), // top
83         v3s16( 1, 0, 0), // right
84         v3s16( 0, 0,-1), // front
85         v3s16( 0,-1, 0), // bottom
86         v3s16(-1, 0, 0), // left
87         // 6
88         v3s16(-1, 1, 0), // top left
89         v3s16( 1, 1, 0), // top right
90         v3s16( 0, 1, 1), // top back
91         v3s16( 0, 1,-1), // top front
92         v3s16(-1, 0, 1), // back left
93         v3s16( 1, 0, 1), // back right
94         v3s16(-1, 0,-1), // front left
95         v3s16( 1, 0,-1), // front right
96         v3s16(-1,-1, 0), // bottom left
97         v3s16( 1,-1, 0), // bottom right
98         v3s16( 0,-1, 1), // bottom back
99         v3s16( 0,-1,-1), // bottom front
100         // 18
101         v3s16(-1, 1, 1), // top back-left
102         v3s16( 1, 1, 1), // top back-right
103         v3s16(-1, 1,-1), // top front-left
104         v3s16( 1, 1,-1), // top front-right
105         v3s16(-1,-1, 1), // bottom back-left
106         v3s16( 1,-1, 1), // bottom back-right
107         v3s16(-1,-1,-1), // bottom front-left
108         v3s16( 1,-1,-1), // bottom front-right
109         // 26
110         v3s16(0,0,0),
111 };
112
113 const u8 wallmounted_to_facedir[6] = {
114         20,
115         0,
116         16 + 1,
117         12 + 3,
118         8,
119         4 + 2
120 };
121
122 const v3s16 wallmounted_dirs[8] = {
123         v3s16(0, 1, 0),
124         v3s16(0, -1, 0),
125         v3s16(1, 0, 0),
126         v3s16(-1, 0, 0),
127         v3s16(0, 0, 1),
128         v3s16(0, 0, -1),
129 };
130
131 const v3s16 facedir_dirs[32] = {
132         //0
133         v3s16(0, 0, 1),
134         v3s16(1, 0, 0),
135         v3s16(0, 0, -1),
136         v3s16(-1, 0, 0),
137         //4
138         v3s16(0, -1, 0),
139         v3s16(1, 0, 0),
140         v3s16(0, 1, 0),
141         v3s16(-1, 0, 0),
142         //8
143         v3s16(0, 1, 0),
144         v3s16(1, 0, 0),
145         v3s16(0, -1, 0),
146         v3s16(-1, 0, 0),
147         //12
148         v3s16(0, 0, 1),
149         v3s16(0, -1, 0),
150         v3s16(0, 0, -1),
151         v3s16(0, 1, 0),
152         //16
153         v3s16(0, 0, 1),
154         v3s16(0, 1, 0),
155         v3s16(0, 0, -1),
156         v3s16(0, -1, 0),
157         //20
158         v3s16(0, 0, 1),
159         v3s16(-1, 0, 0),
160         v3s16(0, 0, -1),
161         v3s16(1, 0, 0),
162 };
163
164 const v3s16 fourdir_dirs[4] = {
165         v3s16(0, 0, 1),
166         v3s16(1, 0, 0),
167         v3s16(0, 0, -1),
168         v3s16(-1, 0, 0),
169 };