summaryrefslogtreecommitdiff
path: root/assetFactory/shape.cpp
blob: ec6594ee50e3af7729129cd7060d5a9b8b4d2593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "shape.h"
#include "gfx/models/vertex.hpp"
#include "maths.h"
#include "modelFactoryMesh.h"
#include "shape.h"

std::vector<OpenMesh::VertexHandle>
Shape::addToMesh(ModelFactoryMesh & mesh, const std::span<const glm::vec3> vertices)
{
	std::vector<OpenMesh::VertexHandle> vhs;
	std::transform(vertices.begin(), vertices.end(), std::back_inserter(vhs), [&mesh](const auto & p) {
		return mesh.add_vertex({p.x, p.y, p.z});
	});
	return vhs;
}