Merge pull request #7381 from sethalves/fix-crashes-1

fix FBXGeometry::convexHullContains crash
This commit is contained in:
Brad Hefta-Gaub 2016-03-17 16:00:58 -07:00
commit a6ecfd789c

View file

@ -76,7 +76,9 @@ bool FBXGeometry::convexHullContains(const glm::vec3& point) const {
auto checkEachPrimitive = [=](FBXMesh& mesh, QVector<int> indices, int primitiveSize) -> bool {
// Check whether the point is "behind" all the primitives.
for (int j = 0; j < indices.size(); j += primitiveSize) {
for (int j = 0;
j < indices.size() - 2; // -2 in case the vertices aren't the right size -- we access j + 2 below
j += primitiveSize) {
if (!isPointBehindTrianglesPlane(point,
mesh.vertices[indices[j]],
mesh.vertices[indices[j + 1]],