Skip to content

Conversation

@atlv24
Copy link
Contributor

@atlv24 atlv24 commented Dec 13, 2025

Objective

Solution

  • mutex + deref

Testing

@pablo-lua pablo-lua added C-Feature A new feature, making something new possible A-Gizmos Visual editor and debug gizmos S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 13, 2025
Copy link
Member

@janhohenheim janhohenheim left a 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, ()>> {
Copy link
Member

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()

Copy link
Contributor Author

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

Copy link
Contributor

@NicoZweifel NicoZweifel left a 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.

image

@atlv24
Copy link
Contributor Author

atlv24 commented Dec 15, 2025

@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

@janhohenheim janhohenheim added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 15, 2025
@janhohenheim janhohenheim added this to the 0.18 milestone Dec 15, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 15, 2025
Merged via the queue into bevyengine:main with commit 5971710 Dec 15, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Gizmos Visual editor and debug gizmos C-Feature A new feature, making something new possible S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants