mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-01 11:33:48 +00:00
Merge pull request #1782 from pacomont/Fix_AbstractPolyList_addBox
Fixes AbstractPolyList::addBox(). Complete each face with missing 2nd triangle.
This commit is contained in:
commit
98b52d1fed
1 changed files with 9 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue