-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conflict between UiCamera and OrthographicCamera #4
Comments
Brainstorming a few ways to do this:
|
I think the best solution would be to add a To allow tracking the world-local mouse position for multiple cameras concurrently, I think the best option would be to automatically add a Thoughts? |
I really like the proposal in the second paragraph. That approach is much more idiomatic to an ECS than a HashMap (and keeps everything Copy and light). I think the use case for multiple cameras is a pretty common one, given that there might be a UI and Game Camera, and perhaps even multiple game 'views' with their own cameras. The first paragraph I think makes sense. Though it's unclear how the system should act if there is no MainCamera but there are multiple cameras. I'd suggest that failing clearly and loudly would be the right approach rather than trying to guess the right 'magic'. Therefore, I'd suggest that |
If I get a chance, I can work on that this week. |
No need, I've been working on it today, and it's mostly done. Thank you though :). I'll link the PR here before merging it in case you wanna give feedback. |
Added some thoughts. Feel free to reach out in discord if you want to discuss some of those in more detail. |
The current camera query for the
update_post_orth
system doesn't distinguish which camera is being queried. This is because bothUiCameraBundle
andOrthographicCameraBundle
implement the exact same components, with the exception of theFrustum
component on Orthographic Camera.This leads to bugs given the different coordinate systems of different cameras. UI Cameras have origin in lower left while regular orthographic cameras origin is in the center of the screen.
Current workaround is to filter out non-UI camera via
Frustum
component until bevyengine/bevy#1854 is addressed.However, given Bevy's support for multiple windows and cameras, this plugin should implement a means by which the MousePosWorld can be retrieved for any arbitrary camera.
The text was updated successfully, but these errors were encountered: