#include "o3d/mesh.h" #include #include #include #include "math/vector.h" using namespace engine::o3d; Mesh Mesh::plane(float width, float height) { const float w2 = width / 2, h2 = height / 2; return { { {-w2 / 2, 0.f, -h2 / 2, 1.f}, {+w2 / 2, 0.f, -h2 / 2, 1.f}, {+w2 / 2, 0.f, +h2 / 2, 1.f}, {-w2 / 2, 0.f, +h2 / 2, 1.f}, }, { {0.f, -1.f, 0.f}, {0.f, +1.f, 0.f}, }, { {{ {{0, 0}}, {{1, 0}}, {{2, 0}} }}, {{ {{2, 0}}, {{3, 0}}, {{0, 0}} }}, {{ {{0, 1}}, {{3, 1}}, {{2, 1}} }}, {{ {{2, 1}}, {{1, 1}}, {{0, 1}} }}, } }; }