-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Global Gizmos #22107
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
Global Gizmos #22107
Conversation
janhohenheim
left a comment
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.
Great idea :)
| /// gizmo().sphere(Isometry3d::IDENTITY, 0.5, WHITE); | ||
| /// } | ||
| /// ``` | ||
| pub fn gizmo() -> impl core::ops::DerefMut<Target = GizmoBuffer<DefaultGizmoConfigGroup, ()>> { |
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.
nit: we usually call the thing that creates gizmos Gizmos in plural, so you may want to rename this to gizmos()
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.
my reasoning for singular was that i was designing the api to discourage holding this as an object to get multiple gizmos out of, so i called it gizmo and made it return a hard-to-name type intentionally
NicoZweifel
left a comment
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.
Nice, works! I already see use cases for this.
I am wondering about situations where a calculation only happens occasionally and I want to draw persistent gizmos until the next calculation. Is there an easy way to do this without using a new component or resource to track the state or do I always have to call gizmo every frame?
Approving since it works and the above behavior is achievable with a bit of extra code (or std gizmos), so no need to resolve the comment to merge.
|
@NicoZweifel ive been thinking about this, I have a solution in mind but its gonna be more code and more complicated. I want to land this first |
Objective
Solution
Testing