-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Let Gizmos support arcs in 3D #11536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 28, 2024
# Objective - Implement an arc3d API for gizmos - Solves #11536 ## Solution ### `arc_3d` - The current `arc3d` method on gizmos only takes an angle - It draws an "standard arc" by default, this is an arc starting at `Vec3::X`, in the XZ plane, in counter clockwise direction with a normal that is facing up - The "standard arc" can be customized with the usual gizmo builder pattern. This way you'll be able to draw arbitrary arcs ### `short/long_arc_3d_between` - Given `center`, `from`, `to` draws an arc between `from` and `to` --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - Added: `Gizmos::arc3d(&mut self, angle)` method - Added: `Gizmos::long_arc_3d_between(&mut self, center, from, to)` method - Added: `Gizmos::short_arc_3d_between(&mut self, center, from, to)` method --- This PR factors out an orthogonal part of another PR as mentioned in [this comment](#11072 (comment))
Merged, so closing this 👍 |
tjamaan
pushed a commit
to tjamaan/bevy
that referenced
this issue
Feb 6, 2024
# Objective - Implement an arc3d API for gizmos - Solves bevyengine#11536 ## Solution ### `arc_3d` - The current `arc3d` method on gizmos only takes an angle - It draws an "standard arc" by default, this is an arc starting at `Vec3::X`, in the XZ plane, in counter clockwise direction with a normal that is facing up - The "standard arc" can be customized with the usual gizmo builder pattern. This way you'll be able to draw arbitrary arcs ### `short/long_arc_3d_between` - Given `center`, `from`, `to` draws an arc between `from` and `to` --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - Added: `Gizmos::arc3d(&mut self, angle)` method - Added: `Gizmos::long_arc_3d_between(&mut self, center, from, to)` method - Added: `Gizmos::short_arc_3d_between(&mut self, center, from, to)` method --- This PR factors out an orthogonal part of another PR as mentioned in [this comment](bevyengine#11072 (comment))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What problem does this solve or what need does it fill?
Currently we don't have the functionality of drawing 3D arcs with gizmos. This is useful for drawing any kind of compound shape however.
What solution would you like?
Initial thoughts (just here for documentation of the process)
I explored the APIs of other engines for this and documented my findings [here](https://github.com//pull/11072#issuecomment-1882755344). It seems that it would make most sense to replicate unity's API because:Update:
I opted for a custom implementation in the end. The unity-like implementation had some flaws and other unintuitive quirks. I think the API should draw orientation from easy to get mental models for placement/orientation/general configuration of the arcs. I went for a combination of:
What alternative(s) have you considered?
Initial thoughts (just here for documentation of the process)
I searched for the implementations in other engines and even tried to come up with an original approach myself but unity's API. Compared to unity's API there were too many cons to follow these paths further.Update:
I looked into other implementations of similar APIs and documented this here. I even implemented the unity API in the first implementation of this issue but that was not really feeling good in the end when I tried to use it in the examples.
Additional context
The functionality for this is already there. I'll cherry-pick it from another PR branch, open a distinct one just for this feature and link it here.
The text was updated successfully, but these errors were encountered: