Fixed MD2/MD5 meshs not having normals/tangents

Former-commit-id: 9456620961fc7e75482b4fc29394934a3d695c5e
This commit is contained in:
Lynix 2013-01-29 02:02:35 +01:00
parent fc5b1ade9b
commit afddcd0804
2 changed files with 6 additions and 1 deletions

View File

@ -269,13 +269,14 @@ namespace
}
}
/// Chargement des positions
for (unsigned int v = 0; v < header.num_vertices; ++v)
{
const md2_vertex& vert = vertices[v];
NzVector3f position = rotationQuat * NzVector3f(vert.x * scale.x + translate.x, vert.y * scale.y + translate.y, vert.z * scale.z + translate.z);
vertex->normal = rotationQuat * md2Normals[vert.n];
vertex->position = position;
vertex->normal = rotationQuat * md2Normals[vert.n];
vertex++;
}
@ -287,6 +288,8 @@ namespace
subMesh->SetMaterialIndex(0);
mesh->AddSubMesh(subMesh.release());
mesh->GenerateTangents();
}
return true;

View File

@ -360,6 +360,8 @@ bool NzMD5MeshParser::Parse(NzMesh* mesh)
}
}
mesh->GenerateNormalsAndTangents();
return true;
}