Added KeyframeMesh::Get/Set vertex components

Former-commit-id: ff51b02dfd5f0675c33c01f39418312834c5d8a9
This commit is contained in:
Lynix
2013-01-02 21:51:03 +01:00
parent 520643140c
commit c998a5c457
3 changed files with 191 additions and 13 deletions

View File

@@ -189,20 +189,19 @@ namespace
// On fait en sorte d'étendre l'AABB pour qu'il contienne ce sommet
aabb.ExtendTo(position);
// Et on finit par copier les éléments dans le buffer
NzMeshVertex vertex;
vertex.normal = md2Normals[vert.n];
vertex.position = position;
// On calcule l'indice (On affecte dans le sens inverse)
unsigned int vertexIndex = vertexCount - (t*3 + v) - 1;
// Et on finit par copier les éléments dans le buffer
subMesh->SetNormal(f, vertexIndex, md2Normals[vert.n]);
subMesh->SetPosition(f, vertexIndex, position);
if (f == 0)
{
// On ne définit les coordonnées de texture que lors de la première frame
const md2_texCoord& texC = texCoords[triangles[t].texCoords[v]];
subMesh->SetTexCoords(vertexIndex, NzVector2f(texC.u / static_cast<float>(header.skinwidth), 1.f - texC.v / static_cast<float>(header.skinheight)));
}
subMesh->SetVertex(f, vertexIndex, vertex);
}
}