]> git.lizzy.rs Git - minetest.git/blob - src/util/directiontables.cpp
8x block meshes (#13133)
[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 v3s16 g_64dirs[64] =
114 {
115         // +right, +top, +back
116         v3s16( -1, -1, -1),
117         v3s16( -1,  0, -1),
118         v3s16( -1,  1, -1),
119         v3s16( -1,  2, -1),
120         v3s16( -1, -1,  0),
121         v3s16( -1,  0,  0),
122         v3s16( -1,  1,  0),
123         v3s16( -1,  2,  0),
124         v3s16( -1, -1,  1),
125         v3s16( -1,  0,  1),
126         v3s16( -1,  1,  1),
127         v3s16( -1,  2,  1),
128         v3s16( -1, -1,  2),
129         v3s16( -1,  0,  2),
130         v3s16( -1,  1,  2),
131         v3s16( -1,  2,  2),
132
133         v3s16(  0, -1, -1),
134         v3s16(  0,  0, -1),
135         v3s16(  0,  1, -1),
136         v3s16(  0,  2, -1),
137         v3s16(  0, -1,  0),
138         v3s16(  0,  0,  0),
139         v3s16(  0,  1,  0),
140         v3s16(  0,  2,  0),
141         v3s16(  0, -1,  1),
142         v3s16(  0,  0,  1),
143         v3s16(  0,  1,  1),
144         v3s16(  0,  2,  1),
145         v3s16(  0, -1,  2),
146         v3s16(  0,  0,  2),
147         v3s16(  0,  1,  2),
148         v3s16(  0,  2,  2),
149
150         v3s16(  1, -1, -1),
151         v3s16(  1,  0, -1),
152         v3s16(  1,  1, -1),
153         v3s16(  1,  2, -1),
154         v3s16(  1, -1,  0),
155         v3s16(  1,  0,  0),
156         v3s16(  1,  1,  0),
157         v3s16(  1,  2,  0),
158         v3s16(  1, -1,  1),
159         v3s16(  1,  0,  1),
160         v3s16(  1,  1,  1),
161         v3s16(  1,  2,  1),
162         v3s16(  1, -1,  2),
163         v3s16(  1,  0,  2),
164         v3s16(  1,  1,  2),
165         v3s16(  1,  2,  2),
166
167         v3s16(  2, -1, -1),
168         v3s16(  2,  0, -1),
169         v3s16(  2,  1, -1),
170         v3s16(  2,  2, -1),
171         v3s16(  2, -1,  0),
172         v3s16(  2,  0,  0),
173         v3s16(  2,  1,  0),
174         v3s16(  2,  2,  0),
175         v3s16(  2, -1,  1),
176         v3s16(  2,  0,  1),
177         v3s16(  2,  1,  1),
178         v3s16(  2,  2,  1),
179         v3s16(  2, -1,  2),
180         v3s16(  2,  0,  2),
181         v3s16(  2,  1,  2),
182         v3s16(  2,  2,  2),
183 };
184
185 const u8 wallmounted_to_facedir[6] = {
186         20,
187         0,
188         16 + 1,
189         12 + 3,
190         8,
191         4 + 2
192 };
193
194 const v3s16 wallmounted_dirs[8] = {
195         v3s16(0, 1, 0),
196         v3s16(0, -1, 0),
197         v3s16(1, 0, 0),
198         v3s16(-1, 0, 0),
199         v3s16(0, 0, 1),
200         v3s16(0, 0, -1),
201 };
202
203 const v3s16 facedir_dirs[32] = {
204         //0
205         v3s16(0, 0, 1),
206         v3s16(1, 0, 0),
207         v3s16(0, 0, -1),
208         v3s16(-1, 0, 0),
209         //4
210         v3s16(0, -1, 0),
211         v3s16(1, 0, 0),
212         v3s16(0, 1, 0),
213         v3s16(-1, 0, 0),
214         //8
215         v3s16(0, 1, 0),
216         v3s16(1, 0, 0),
217         v3s16(0, -1, 0),
218         v3s16(-1, 0, 0),
219         //12
220         v3s16(0, 0, 1),
221         v3s16(0, -1, 0),
222         v3s16(0, 0, -1),
223         v3s16(0, 1, 0),
224         //16
225         v3s16(0, 0, 1),
226         v3s16(0, 1, 0),
227         v3s16(0, 0, -1),
228         v3s16(0, -1, 0),
229         //20
230         v3s16(0, 0, 1),
231         v3s16(-1, 0, 0),
232         v3s16(0, 0, -1),
233         v3s16(1, 0, 0),
234 };
235
236 const v3s16 fourdir_dirs[4] = {
237         v3s16(0, 0, 1),
238         v3s16(1, 0, 0),
239         v3s16(0, 0, -1),
240         v3s16(-1, 0, 0),
241 };