39 const Vertex*
const vertices,
40 const std::size_t numVertices,
41 const Index*
const indices,
42 const std::size_t numIndices,
43 VerticesToTriFace verticesToTriFace) :
47 m_verticesToTriFace(
std::move(verticesToTriFace))
50 PH_ASSERT_GT(numVertices, 0);
51 PH_ASSERT_LE(numVertices - 1, std::numeric_limits<Index>::max());
53 PH_ASSERT_GT(numIndices, 0);
55 m_numVertices = numVertices;
56 m_numIndices = numIndices;
58 m_vertices = std::make_unique<Vertex[]>(
new Vertex[numVertices]);
59 for(std::size_t i = 0; i < numVertices; ++i)
61 m_vertices[i] = vertices[i];
64 m_indices = std::make_unique<Index[]>(
new Index[numIndices]);
65 for(std::size_t i = 0; i < numIndices; ++i)
67 PH_ASSERT_IN_RANGE_INCLUSIVE(indices[i], Index(0), std::numeric_limits<Index>::max());
69 m_indices[i] = indices[i];
79getFace(
const std::size_t faceIndex)
const
82 PH_ASSERT_LT(faceIndex, numFaces());
84 const std::size_t indicesIndex = faceIndex * 3;
85 PH_ASSERT_LT(indicesIndex + 2, m_numIndices);
87 return m_verticesToTriFace(
89 m_vertices[m_indices[indicesIndex]],
90 m_vertices[m_indices[indicesIndex + 1]],
91 m_vertices[m_indices[indicesIndex + 2]]);
TAosTriMesh(std::vector< Vertex > vertices, std::vector< Index > indices, VerticesToTriFace verticesToTriFace)
Definition TAosTriMesh.ipp:19