[fixes #468] Fixes rendering issue with freeform fins

Cause by a fencepost-error when generating body points for freeform fins on transitions.
Induced by the imprecision of floating point calculations.
This commit is contained in:
Daniel_M_Williams 2018-11-04 12:59:28 -05:00
parent 151a4d864d
commit 786dd97558

View File

@ -1095,6 +1095,13 @@ public abstract class FinSet extends ExternalComponent implements RingInstanceab
xCur += increment;
}
// correct last point, if beyond a rounding error from body's end.
final int lastIndex = points.length - 1;
if( body.getLength()-0.000001 < points[lastIndex].x) {
points[lastIndex] = points[lastIndex].setX(body.getLength()).setY(body.getAftRadius());
}
return points;
}