Merge pull request #1473 from aws-lumberyard-dev/Atom/mriegger/ATOM-15318

Atom/mriegger/atom 15318
main
mrieggeramzn 5 years ago committed by GitHub
commit 37155fe0bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -904,7 +904,7 @@ namespace AZ::AtomBridge
{
// Draw circle with single radius.
const float step = DegToRad(10.0f);
const float maxAngle = DegToRad(360.0f) + step;
const float maxAngle = DegToRad(360.0f);
SingleColorStaticSizeLineHelper<40> lines; // hard code 40 lines until DegToRad is constexpr.
AZ::Vector3 radiusV3 = AZ::Vector3(radius);
@ -1134,7 +1134,7 @@ namespace AZ::AtomBridge
// This matches Cry behavior, the DrawWireSphere above may need modifying to use the same approach.
// Draw 3 axis aligned circles
const float step = DegToRad(10.0f);
const float maxAngle = DegToRad(360.0f) + step;
const float maxAngle = DegToRad(360.0f);
SingleColorStaticSizeLineHelper<40*3> lines; // hard code to 40 lines * 3 circles until DegToRad is constexpr.
// Z Axis
@ -1160,8 +1160,8 @@ namespace AZ::AtomBridge
// Draw 3 axis aligned circles
const float stepAngle = DegToRad(11.25f);
const float startAngle = DegToRad(0.0f);
const float stopAngle = DegToRad(360.0f) + startAngle;
SingleColorDynamicSizeLineHelper lines(2+static_cast<int>(360.0f/11.25f)); // num disk segments + 1 for azis line + 1 for spare
const float stopAngle = DegToRad(360.0f);
SingleColorDynamicSizeLineHelper lines(2 + static_cast<int>(360.0f / 11.25f)); // num disk segments + 1 for axis line + 1 for spare
const AZ::Vector3 radiusV3 = AZ::Vector3(radius);
CreateArbitraryAxisArc(
lines,

@ -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

Loading…
Cancel
Save