mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-22 10:37:00 +08:00
chore: add clang-format and pre-commit configuration
This commit is contained in:
@@ -39,12 +39,12 @@ constexpr float VERTICES_POS[6][6][3] = {
|
||||
{0.0f, 1.0f, 1.0f}, // front left
|
||||
{0.0f, 1.0f, 0.0f}}, // back left
|
||||
// ===== bottom (y = -1) =====
|
||||
{{0.0f, 0.0f, 1.0f}, // front left
|
||||
{1.0f, 0.0f, 1.0f}, // front right
|
||||
{1.0f, 0.0f, 0.0f}, // back right
|
||||
{1.0f, 0.0f, 0.0f}, // back right
|
||||
{0.0f, 0.0f, 0.0f}, // back left
|
||||
{0.0f, 0.0f, 1.0f}} // front left
|
||||
{{0.0f, 0.0f, 1.0f}, // front left
|
||||
{1.0f, 0.0f, 1.0f}, // front right
|
||||
{1.0f, 0.0f, 0.0f}, // back right
|
||||
{1.0f, 0.0f, 0.0f}, // back right
|
||||
{0.0f, 0.0f, 0.0f}, // back left
|
||||
{0.0f, 0.0f, 1.0f}} // front left
|
||||
};
|
||||
|
||||
constexpr float TEX_COORDS[6][6][2] = {
|
||||
@@ -84,49 +84,34 @@ constexpr float TEX_COORDS[6][6][2] = {
|
||||
{0.0f, 1.0f}, // front left
|
||||
{0.0f, 0.0f}}, // back left
|
||||
// ===== bottom (y = -1) =====
|
||||
{{0.0f, 0.0f}, // front left
|
||||
{1.0f, 0.0f}, // front right
|
||||
{1.0f, 1.0f}, // back right
|
||||
{1.0f, 1.0f}, // back right
|
||||
{0.0f, 1.0f}, // back left
|
||||
{0.0f, 0.0f}} // front left
|
||||
{{0.0f, 0.0f}, // front left
|
||||
{1.0f, 0.0f}, // front right
|
||||
{1.0f, 1.0f}, // back right
|
||||
{1.0f, 1.0f}, // back right
|
||||
{0.0f, 1.0f}, // back left
|
||||
{0.0f, 0.0f}} // front left
|
||||
};
|
||||
|
||||
constexpr float CUBE_VER[24] = {
|
||||
0.0, 0.0, 0.0,
|
||||
1.0, 0.0, 0.0,
|
||||
1.0, 1.0, 0.0,
|
||||
0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 1.0,
|
||||
1.0, 0.0, 1.0,
|
||||
1.0, 1.0, 1.0,
|
||||
0.0, 1.0, 1.0
|
||||
};
|
||||
constexpr float CUBE_VER[24] = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0,
|
||||
0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0,
|
||||
0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0};
|
||||
|
||||
|
||||
constexpr int OUTLINE_CUBE_INDICES[24] = {
|
||||
0,1, 1,2, 2,3, 3,0,
|
||||
4,5, 5,6, 6,7, 7,4,
|
||||
0,4, 1,5, 2,6, 3,7
|
||||
};
|
||||
constexpr int OUTLINE_CUBE_INDICES[24] = {0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6,
|
||||
6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7};
|
||||
|
||||
constexpr float SQUARE_VERTICES[6][2] = {
|
||||
{-0.5f, -0.5f}, // bottom left
|
||||
{-0.5f, 0.5f}, // top left
|
||||
{ 0.5f, 0.5f}, // top right
|
||||
{ 0.5f, 0.5f}, // top right
|
||||
{ 0.5f, -0.5f}, // bottom right
|
||||
{-0.5f, -0.5f} // bottom left
|
||||
{-0.5f, -0.5f}, // bottom left
|
||||
{-0.5f, 0.5f}, // top left
|
||||
{0.5f, 0.5f}, // top right
|
||||
{0.5f, 0.5f}, // top right
|
||||
{0.5f, -0.5f}, // bottom right
|
||||
{-0.5f, -0.5f} // bottom left
|
||||
};
|
||||
|
||||
constexpr float SQUARE_TEXTURE_POS[6][2] = {
|
||||
{0.0f, 0.0f},
|
||||
{0.0f, 1.0f},
|
||||
{1.0f, 1.0f},
|
||||
{1.0f, 1.0f},
|
||||
{1.0f, 0.0f},
|
||||
{0.0f, 0.0f},
|
||||
};
|
||||
{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f},
|
||||
{1.0f, 1.0f}, {1.0f, 0.0f}, {0.0f, 0.0f},
|
||||
};
|
||||
|
||||
struct Vertex {
|
||||
float x = 0.0f, y = 0.0f, z = 0.0f;
|
||||
@@ -140,4 +125,4 @@ struct Vertex2D {
|
||||
float layer = 0.0f;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace Cubed
|
||||
Reference in New Issue
Block a user