Only use triangles to calculate the mesh bounding box.

This commit is contained in:
Leonardo Zide 2018-01-20 17:35:21 -08:00
parent 6f940a473e
commit 5c1cfa4bc9

View file

@ -1393,10 +1393,19 @@ lcMesh* lcPiecesLibrary::CreateMesh(PieceInfo* Info, lcLibraryMeshData& MeshData
DstVertex.Position = lcVector3LDrawToLeoCAD(SrcVertex.Position);
DstVertex.Normal = lcPackNormal(lcVector3LDrawToLeoCAD(SrcVertex.Normal));
}
lcVector3& Position = DstVertex.Position;
Min = lcMin(Min, Position);
Max = lcMax(Max, Position);
for (const lcLibraryMeshSection* Section : MeshData.mSections[MeshDataIdx])
{
if (Section->mPrimitiveType != LC_MESH_TRIANGLES)
continue;
for (quint32 Index : Section->mIndices)
{
lcVector3 Position = lcVector3LDrawToLeoCAD(Vertices[Index].Position);
Min = lcMin(Min, Position);
Max = lcMax(Max, Position);
}
}
}