Repository navigation
Expand file tree
/
Copy pathcube_tables.h
More file actions
76 lines (57 loc) · 1.54 KB
/
Copy pathcube_tables.h
File metadata and controls
76 lines (57 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef CUBE_TABLES_H
#define CUBE_TABLES_H
#include "math/vector3i.h"
#include <core/math/vector3.h>
namespace Cube {
// Index convention used in some lookup tables
enum Side {
SIDE_LEFT = 0,
SIDE_RIGHT,
SIDE_BOTTOM,
SIDE_TOP,
SIDE_BACK,
SIDE_FRONT,
SIDE_COUNT
};
// Index convention used in some lookup tables
enum Edge {
EDGE_BOTTOM_BACK = 0,
EDGE_BOTTOM_RIGHT,
EDGE_BOTTOM_FRONT,
EDGE_BOTTOM_LEFT,
EDGE_BACK_LEFT,
EDGE_BACK_RIGHT,
EDGE_FRONT_RIGHT,
EDGE_FRONT_LEFT,
EDGE_TOP_BACK,
EDGE_TOP_RIGHT,
EDGE_TOP_FRONT,
EDGE_TOP_LEFT,
EDGE_COUNT
};
// Index convention used in some lookup tables
enum Corner {
CORNER_BOTTOM_BACK_LEFT = 0,
CORNER_BOTTOM_BACK_RIGHT,
CORNER_BOTTOM_FRONT_RIGHT,
CORNER_BOTTOM_FRONT_LEFT,
CORNER_TOP_BACK_LEFT,
CORNER_TOP_BACK_RIGHT,
CORNER_TOP_FRONT_RIGHT,
CORNER_TOP_FRONT_LEFT,
CORNER_COUNT
};
extern const Vector3 g_corner_position[CORNER_COUNT];
extern const int g_side_quad_triangles[SIDE_COUNT][6];
//extern const unsigned int g_side_coord[SIDE_COUNT];
//extern const unsigned int g_side_sign[SIDE_COUNT];
extern const Vector3i g_side_normals[SIDE_COUNT];
extern const unsigned int g_side_corners[SIDE_COUNT][4];
extern const unsigned int g_side_edges[SIDE_COUNT][4];
extern const Vector3i g_corner_inormals[CORNER_COUNT];
extern const Vector3i g_edge_inormals[EDGE_COUNT];
extern const unsigned int g_edge_corners[EDGE_COUNT][2];
const unsigned int MOORE_NEIGHBORING_3D_COUNT = 26;
extern const Vector3i g_moore_neighboring_3d[MOORE_NEIGHBORING_3D_COUNT];
} // namespace Cube
#endif // CUBE_TABLES_H