aboutsummaryrefslogtreecommitdiff
path: root/src/o3d/tri.hpp
blob: 712c135103cdcdde7a6578be1e24e49e55185135 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef O3D_TRI_HPP
#define O3D_TRI_HPP

#include <vector>
#include "o3d/vertex.hpp"
#include "o3d/tri_deriv.hpp"

namespace engine::o3d {

struct Triangle {
    Vertex vertex1;
    Vertex vertex2;
    Vertex vertex3;

    constexpr TriangleDerived to_derived() const & {
        return {{vertex1.vertex, 1.f, 0.f}, {vertex2.vertex, 0.f, 1.f}, {vertex3.vertex, 0.f, 0.f}};
    }
};

}

#endif // O3D_TRI_HPP