aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/mesh.cpp
blob: 60c7f8bdf2991b6fffb1808161f30adec02550f1 (plain) (blame)
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
#include "o3d/mesh.h"
#include <vector>
#include <array>
#include <cstddef>
#include "math/vector.h"

using namespace engine::o3d;

Mesh Mesh::plane() {
    return {
        {
            {-1.f, 0.f, -1.f, 1.f},
            {+1.f, 0.f, -1.f, 1.f},
            {+1.f, 0.f, +1.f, 1.f},
            {-1.f, 0.f, +1.f, 1.f},
        },
        { {0.f, 0.f, -1.f} },
        {
            {0.f, 0.f},
            {1.f, 0.f},
            {1.f, 1.f},
            {0.f, 1.f},
        },
        {
            {{ {{0, 0, 0}}, {{1, 0, 1}}, {{2, 0, 2}} }},
            {{ {{2, 0, 2}}, {{3, 0, 3}}, {{0, 0, 0}} }},
            {{ {{0, 0, 0}}, {{3, 0, 3}}, {{2, 0, 2}} }},
            {{ {{2, 0, 2}}, {{1, 0, 1}}, {{0, 0, 0}} }},
        }
    };
}