- LWO: fix crash when computing normals for meshes that contain line or point faces. Thanks to Thomas Sevaldrud for the patch.

pull/34/head
Alexander Gessler 2013-04-26 16:49:24 +02:00
parent 758e470a49
commit 7efb94580f
1 changed files with 4 additions and 0 deletions

View File

@ -467,6 +467,10 @@ void LWOImporter::ComputeNormals(aiMesh* mesh, const std::vector<unsigned int>&
for (; begin != end; ++begin) {
aiFace& face = *begin;
if(face.mNumIndices < 3) {
continue;
}
// LWO doc: "the normal is defined as the cross product of the first and last edges"
aiVector3D* pV1 = mesh->mVertices + face.mIndices[0];
aiVector3D* pV2 = mesh->mVertices + face.mIndices[1];