10 #ifndef CUBBYFLOW_MARCHING_SQUARES_TABLE_H 11 #define CUBBYFLOW_MARCHING_SQUARES_TABLE_H 17 static const float vertexOffset2D[4][2] =
19 { 0.0f, 0.0f }, { 1.0f, 0.0f }, { 1.0f, 1.0f }, { 0.0f, 1.0f }
24 static const int edgeConnection2D[4][2] =
26 { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 0 }
30 static const float edgeDirection2D[4][2] =
32 { 1.0f, 0.0f }, { 0.0f, 1.0f }, { -1.0f, 0.0f }, { 0.0f, -1.0f }
44 static const int squareEdgeFlags[16] =
46 0x000, 0x009, 0x003, 0x00a, 0x006, 0x00f, 0x005, 0x00c,
47 0x00c, 0x005, 0x00f, 0x006, 0x00a, 0x003, 0x009, 0x000
71 static const int triangleConnectionTable2D[16][13] =
73 {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
74 { 0, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
75 { 4, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
76 { 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1 },
77 { 5, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
78 { 0, 4, 7, 2, 6, 5, -1, -1, -1, -1, -1, -1, -1 },
79 { 4, 1, 6, 1, 2, 6, -1, -1, -1, -1, -1, -1, -1 },
80 { 0, 1, 7, 7, 1, 6, 1, 2, 6, -1, -1, -1, -1 },
81 { 7, 6, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
82 { 0, 4, 6, 0, 6, 3, -1, -1, -1, -1, -1, -1, -1 },
83 { 3, 7, 6, 6, 7, 4, 6, 4, 5, 1, 5, 4, -1 },
84 { 0, 6, 3, 0, 5, 6, 0, 1, 5, -1, -1, -1, -1 },
85 { 7, 5, 3, 5, 2, 3, -1, -1, -1, -1, -1, -1, -1 },
86 { 3, 0, 4, 3, 4, 5, 3, 5, 2, -1, -1, -1, -1 },
87 { 2, 3, 7, 2, 7, 4, 2, 4, 1, -1, -1, -1, -1 },
88 { 0, 1, 3, 1, 2, 3, -1, -1, -1, -1, -1, -1, -1 },
Definition: pybind11Utils.h:24