Changing it so that the Draw functions always stop at exactly maxAngle

This commit is contained in:
mriegger
2021-06-21 18:05:54 -07:00
parent d2f247ad4f
commit 8d04154fb9
2 changed files with 23 additions and 6 deletions
@@ -332,6 +332,15 @@ namespace AZ::AtomBridge
p0 = p1;
++segmentIndex;
}
// Complete the arc by drawing the last bit
sinCos.SetElement(circleAxis1, sinf(maxAngle));
sinCos.SetElement(circleAxis2, cosf(maxAngle));
p1 = position + radiusV3 * sinCos;
p1 = ToWorldSpacePosition(p1);
if (filterFunc(p0, p1, segmentIndex))
{
lines.AddLineSegment(p0, p1);
}
}
template<typename LineStorageType>
@@ -369,5 +378,13 @@ namespace AZ::AtomBridge
p0 = p1;
++segmentIndex;
}
// Complete the arc by drawing the last bit
AZ::SinCos(maxAngle, sinVF, cosVF);
p1 = position + radiusV3 * (cosVF * a + sinVF * b);
p1 = ToWorldSpacePosition(p1);
if (filterFunc(p0, p1, segmentIndex))
{
lines.AddLineSegment(p0, p1);
}
}
} // namespace AZ::AtomBridge