using only the neeeded number of vertex positions

This commit is contained in:
devZoGok
2024-08-19 18:23:09 +03:00
parent 6ce16b0837
commit 19990e48f4
8 changed files with 145 additions and 72 deletions
+4 -4
View File
@@ -63,14 +63,14 @@ namespace vb01{
MeshData::Vertex *vertices = new MeshData::Vertex[3 * numTris];
for(int i = 0; i < 3 * numTris; i++){
MeshData::Vertex v;
v.pos = pos[data[3 * i]];
v.norm = norm[data[3 * i + 1]];
MeshData::Vertex v;
v.pos = &pos[data[3 * i]];
v.norm = &norm[data[3 * i + 1]];
v.uv = tex[data[3 * i + 2]];
vertices[i] = v;
indices[i] = i;
}
meshBase = MeshData(vertices, indices, numTris);
meshBase = MeshData((Vector3*)pos, nullptr, nullptr, nullptr, 8, (Vector3*)norm, vertices, indices, numTris);
}
}