#include "mesh.hpp" #include #include #include #include "constraints.hpp" Mesh::Mesh(const std::string &fileName) { Assimp::Importer importer; auto scene = importer.ReadFile(fileName, aiProcess_Triangulate); auto mesh = scene->mMeshes[0]; for (size_t i = 0; i < mesh->mNumVertices; i++){ vertices.push_back({ *reinterpret_cast(&mesh->mVertices[i]), glm::vec3(1, 0, 0) }); } for (size_t i = 0; i < mesh->mNumFaces; i++){ faces.push_back(*reinterpret_cast(mesh->mFaces[i].mIndices)); } }