A 3D game engine from scratch.
1// (c) 2020 Vlad-Stefan Harbuz <vlad@vladh.net>
2
3static constexpr v3 CUBEMAP_OFFSETS[6] = {
4 v3(1.0f, 0.0f, 0.0f),
5 v3(-1.0f, 0.0f, 0.0f),
6 v3(0.0f, 1.0f, 0.0f),
7 v3(0.0f, -1.0f, 0.0f),
8 v3(0.0f, 0.0f, 1.0f),
9 v3(0.0f, 0.0f, -1.0f)
10};
11
12static constexpr v3 CUBEMAP_UPS[6] = {
13 v3(0.0f, -1.0f, 0.0f),
14 v3(0.0f, -1.0f, 0.0f),
15 v3(0.0f, 0.0f, 1.0f),
16 v3(0.0f, 0.0f, -1.0f),
17 v3(0.0f, -1.0f, 0.0f),
18 v3(0.0f, -1.0f, 0.0f)
19};
20
21static constexpr geom::Vertex AXES_VERTICES[] = {
22 { .position = { 0.0f, 0.0f, 0.0f }, .normal = { 1.0f, 0.0f, 0.0f }, .tex_coords = { 0.0f, 0.0f }},
23 { .position = { 20.0f, 0.0f, 0.0f }, .normal = { 1.0f, 0.0f, 0.0f }, .tex_coords = { 0.0f, 0.0f }},
24 { .position = { 0.0f, 0.0f, 0.0f }, .normal = { 0.0f, 1.0f, 0.0f }, .tex_coords = { 0.0f, 0.0f }},
25 { .position = { 0.0f, 20.0f, 0.0f }, .normal = { 0.0f, 1.0f, 0.0f }, .tex_coords = { 0.0f, 0.0f }},
26 { .position = { 0.0f, 0.0f, 0.0f }, .normal = { 0.0f, 0.0f, 1.0f }, .tex_coords = { 0.0f, 0.0f }},
27 { .position = { 0.0f, 0.0f, 20.0f }, .normal = { 0.0f, 0.0f, 1.0f }, .tex_coords = { 0.0f, 0.0f }},
28};
29
30static constexpr geom::Vertex SCREENQUAD_VERTICES[] = {
31 { .position = {-1.0f, 1.0f, 0.0f}, .normal = { 0.0f, 0.0f, 0.0f }, .tex_coords = { 0.0f, 1.0f }},
32 { .position = {-1.0f, -1.0f, 0.0f}, .normal = { 0.0f, 0.0f, 0.0f }, .tex_coords = { 0.0f, 0.0f }},
33 { .position = { 1.0f, -1.0f, 0.0f}, .normal = { 0.0f, 0.0f, 0.0f }, .tex_coords = { 1.0f, 0.0f }},
34 { .position = {-1.0f, 1.0f, 0.0f}, .normal = { 0.0f, 0.0f, 0.0f }, .tex_coords = { 0.0f, 1.0f }},
35 { .position = { 1.0f, -1.0f, 0.0f}, .normal = { 0.0f, 0.0f, 0.0f }, .tex_coords = { 1.0f, 0.0f }},
36 { .position = { 1.0f, 1.0f, 0.0f}, .normal = { 0.0f, 0.0f, 0.0f }, .tex_coords = { 1.0f, 1.0f }},
37};