2020-07-08 18:12:38 +02:00
|
|
|
//
|
|
|
|
// Created by Wouter Groeneveld on 08/07/20.
|
|
|
|
//
|
|
|
|
|
2020-07-15 10:52:13 +02:00
|
|
|
#include <libgba-bitmap-engine/mesh.h>
|
2020-07-08 18:12:38 +02:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
2020-07-09 13:29:02 +02:00
|
|
|
void Mesh::add(VectorFx v) {
|
2020-07-15 12:03:50 +02:00
|
|
|
verticesArr.push_back(std::unique_ptr<Vertex>(new Vertex(v)));
|
2020-07-08 18:12:38 +02:00
|
|
|
}
|
|
|
|
|
2020-07-15 12:03:50 +02:00
|
|
|
void Mesh::add(VectorFx coords, VectorFx normal) {
|
|
|
|
verticesArr.push_back(std::unique_ptr<Vertex>(new Vertex(coords, normal)));
|
|
|
|
}
|
|
|
|
|
2020-07-16 16:14:46 +02:00
|
|
|
void Mesh::add(VectorFx coords, VectorFx normal, float u, float v) {
|
|
|
|
verticesArr.push_back(std::unique_ptr<Vertex>(new Vertex(coords, normal, u, v)));
|
|
|
|
}
|
|
|
|
|
2020-07-15 12:03:50 +02:00
|
|
|
void Mesh::addFace(int a, int b, int c) {
|
|
|
|
auto &vertexA = verticesArr[a];
|
|
|
|
auto &vertexB = verticesArr[b];
|
|
|
|
auto &vertexC = verticesArr[c];
|
|
|
|
|
|
|
|
facesArr.push_back(std::unique_ptr<Face>(new Face(a, b, c, *vertexA, *vertexB, *vertexC)));
|
2020-07-10 14:41:32 +02:00
|
|
|
}
|