Merge pull request #1782 from pacomont/Fix_AbstractPolyList_addBox

Fixes AbstractPolyList::addBox(). Complete each face with missing 2nd triangle.
This commit is contained in:
Anis 2016-10-08 19:15:28 +02:00 committed by GitHub
commit 98b52d1fed

View file

@ -56,17 +56,24 @@ void AbstractPolyList::addBox(const Box3F &box, BaseMatInstance* material)
pos.x += dx; addPoint(pos);
for (S32 i = 0; i < 6; i++) {
begin(material, i);
S32 v1 = base + PolyFace[i][0];
S32 v2 = base + PolyFace[i][1];
S32 v3 = base + PolyFace[i][2];
S32 v4 = base + PolyFace[i][3];
// First triangle
begin(material, i);
vertex(v1);
vertex(v2);
vertex(v3);
vertex(v4);
plane(v1, v2, v3);
end();
// Second triangle
begin(material, i);
vertex(v3);
vertex(v4);
vertex(v1);
plane(v3, v4, v1);
end();
}
}