CedricGuillemet / ImGuizmo

Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui
MIT License
3.22k stars 907 forks source link

Fix segment counts in the rotation gizmo #298

Closed xDUDSSx closed 1 year ago

xDUDSSx commented 1 year ago

These issues are apparent when halfCircleSegmentCount is a low value like 8.

  1. When drawing a full circle the actual segment count used was halfCircleSegmentCount when it should be double that. That also caused it to loop onto itself once making it a little bolder that it should be.
  2. The active rotation indicator was missing its last segment, making it a little shorter than it should be, not noticable with a high segment count but when the segment count is low it stops following the mouse properly.

I'm working on some improvements to the rotation gizmo and noticed these issues along the way.

xDUDSSx commented 1 year ago

Here's a picture demonstrating the issue. I've marked in red where my mouse actually was. The half circle indicator stopped short. Also in the same picture it's visible that the indicator half circle has the same amount of segments (well minus the missing one) as the rotation axis circle while its segment count should be half of that. Or rather the axis circle should have twice as many.

segmentIssue1

CedricGuillemet commented 1 year ago

Thanks!