Skip to content
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

Add RayMap::map_mut #16824

Closed
wants to merge 1 commit into from
Closed

Add RayMap::map_mut #16824

wants to merge 1 commit into from

Conversation

chompaa
Copy link
Member

@chompaa chompaa commented Dec 14, 2024

Objective

  • Manually generate rays used for picking (partially resolves Support generating or redirecting rays for picking #16664).
  • My use case is portals. I would like portal PointerHits to be propagated "through" the portal. This is of course doable by having manual backend implementations live locally, but having a mutable RayMap::map accessor can let these rays be processed next frame and handled by backends as usual.

Solution

  • Add RayMap::map_mut.

Testing

  • Ran CI.

Open Questions

  • Can this make it into 0.15.1 (if uncontroversial)? I'm not overly familiar with Bevy's versioning :)
  • Perhaps RayMap::push would be better, so that existing rays cannot be modified?
  • Should we also have RayMap::iter_mut?

@chompaa chompaa added C-Feature A new feature, making something new possible S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Picking Pointing at and selecting objects of all sorts labels Dec 14, 2024
@chompaa
Copy link
Member Author

chompaa commented Dec 15, 2024

I realised that mutating RayMap wasn't necessary for my use case, so I'm closing this PR (the mentioned issue has the same use case).

If any reader is curious what I did instead, I have my (poorly documented) impl here.

@chompaa chompaa closed this Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Picking Pointing at and selecting objects of all sorts C-Feature A new feature, making something new possible S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support generating or redirecting rays for picking
1 participant