Added handling of an odd number rows in the capsule rendering and primitive calculation.

This commit is contained in:
Robert Osfield
2013-06-28 12:45:39 +00:00
parent 097aedf23c
commit b2c838033d

View File

@@ -826,6 +826,9 @@ void DrawShapeVisitor::apply(const Capsule& capsule)
numRows = MIN_NUM_ROWS;
}
// if numRows is odd the top and bottom halves of sphere won't match, so bump up to the next event numRows
if ((numRows%2)!=0) ++numRows;
// capsule cylindrical body
if (createBody)
@@ -1818,6 +1821,9 @@ void PrimitiveShapeVisitor::apply(const Capsule& capsule)
numSegments = MIN_NUM_SEGMENTS;
}
// if numRows is odd the top and bottom halves of sphere won't match, so bump up to the next event numRows
if ((numRows%2)!=0) ++numRows;
// capsule body
if (createBody)
createCylinderBody(numSegments, capsule.getRadius(), capsule.getHeight(), matrix);