gba-bitmap-engine/engine/src/mesh.cpp

28 lines
751 B
C++
Raw Normal View History

//
// Created by Wouter Groeneveld on 08/07/20.
//
2020-07-15 10:52:13 +02:00
#include <libgba-bitmap-engine/mesh.h>
#include <memory>
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-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
}