-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Gizmo Arrows #10550
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
Gizmo Arrows #10550
Conversation
Basically looks good once the TODOs are addressed. Can you grab a screenshot or video for reviewers and the curious passer-by to check out and add it to your PR description? |
was already doing it <3 |
ready! |
The size of the arrow head should probably be clamped. 1/10 does make sense, but if someone makes a really long arrow it will definitely end up looking weird. It's a bit hard to tell what should be the limit though. Would be interesting to see how it looks if you also connect the base of the arrow head. To me it looks like there's something missing without a base. |
I think it makes sense to keep the head proportional to the arrow length. In 3D, consider an arrow that is very far away, if you clamp the head size, it will look tinny. There is no good general algorithm to figure out a "good" clamped arrow head size. In any case, this PR allow controlling the "tip length". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a minor grip.
suggested by @nicopap Co-authored-by: Nicola Papale <[email protected]>
Co-authored-by: Nicola Papale <[email protected]>
Co-authored-by: Nicola Papale <[email protected]>
Co-authored-by: Nicola Papale <[email protected]>
Co-authored-by: Nicola Papale <[email protected]>
remove "which is sufficient for most applications." Co-authored-by: Nicola Papale <[email protected]>
so their lenth is actually `tip_length` and not `sqrt(2)*tip_length`
Yeah, I didn't mean to not keep it proportional. Just limit how big it can get, but that was before I saw that you can specify a size manually so this can just be ignored. |
Rerunning CI for you: it's been failing all over the place for no good reason. |
For consistency, I think I'd prefer keeping arrows inside the gizmos file. If we want to go with separate files per shape I'd prefer if this was done in a separate PR. Not a blocker, just voicing my preference. |
I figured the next thing I would do would be to start splitting out the different shapes into their own files |
Yeah, that's fair, I'd prefer if it was done in a separate PR to make sure people can voice their opinions separately to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like mentioned earlier, I'd like to have the tips connected at the base, but it's not a blocker and can be implemented in a future PR.
are we waiting for me? or for someone else to hit the merge button |
Bevy PRs require 2 community approvals for a maintainer to then be allowed to do a final review pass and it the merge button. There's more detail here: https://github.com/bevyengine/bevy/blob/main/CONTRIBUTING.md#making-changes-to-bevy So we still need another review and a maintainer to hit merge |
Just paranoid that y'all were waiting for me and i hadn't realized <3 |
## Objective - Add an arrow gizmo as suggested by bevyengine#9400 ## Solution (excuse my Protomen music) https://github.com/bevyengine/bevy/assets/14184826/192adf24-079f-4a4b-a17b-091e892974ec Wasn't horribly hard when i remembered i can change coordinate systems whenever I want. Gave them four tips (as suggested by @alice-i-cecile in discord) instead of trying to decide what direction the tips should point. Made the tip length default to 1/10 of the arrow's length, which looked good enough to me. Hard-coded the angle from the body to the tips to 45 degrees. ## Still TODO - [x] actual doc comments - [x] doctests - [x] `ArrowBuilder.with_tip_length()` --- ## Changelog - Added `gizmos.arrow()` and `gizmos.arrow_2d()` - Added arrows to `2d_gizmos` and `3d_gizmos` examples ## Migration Guide N/A --------- Co-authored-by: Nicola Papale <[email protected]>
Objective
Solution
(excuse my Protomen music)
2023-11-13.22-30-00.mp4
Wasn't horribly hard when i remembered i can change coordinate systems whenever I want. Gave them four tips (as suggested by @alice-i-cecile in discord) instead of trying to decide what direction the tips should point.
Made the tip length default to 1/10 of the arrow's length, which looked good enough to me. Hard-coded the angle from the body to the tips to 45 degrees.
Still TODO
ArrowBuilder.with_tip_length()
Changelog
gizmos.arrow()
andgizmos.arrow_2d()
2d_gizmos
and3d_gizmos
examplesMigration Guide
N/A