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 marker components for different camera types #1854

Closed
alice-i-cecile opened this issue Apr 8, 2021 · 5 comments
Closed

Add marker components for different camera types #1854

alice-i-cecile opened this issue Apr 8, 2021 · 5 comments
Labels
C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Apr 8, 2021

What problem does this solve or what need does it fill?

Selecting particular camera types is frustrating, relying on checking the name field within a system.

What solution would you like?

Add a simple marker components for UiCamera and GameplayCamera.

Various rendering systems should use this mechanism, instead of the camera's name.

What alternative(s) have you considered?

Users can add their own marker components manually.

Only tag UiCamera and use Without<UiCamera>.

Add a unique marker component for each of 2dCamera, 3dCamera and so on. This is less clear, and it seems extremely rare that you will have more than one different type of gameplay camera at once.

Additional context

Example of this problem in #help

@alice-i-cecile alice-i-cecile added core D-Trivial Nice and easy! A great choice to get started with Bevy C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Apr 8, 2021
@alice-i-cecile
Copy link
Member Author

As part of the PR to fix this issue, it might be nice to demonstrate how to use it in a small example (or as part of one of the games). Combine it with query.single_mut() to show idiomatic usage.

@alice-i-cecile
Copy link
Member Author

While we're fixing this, we should probably just rework how Bevy's internal systems manage cameras as well.

It's probably worth removing the name field entirely, to avoid exposing / using an inferior API. Now that sparse set storage exists, there's no reason not to use marker components for all of the "name X" use cases.

@alice-i-cecile
Copy link
Member Author

This resulted in a confusing problem for a user trying to make their own camera variant.

@alice-i-cecile alice-i-cecile removed the D-Trivial Nice and easy! A great choice to get started with Bevy label Dec 28, 2021
@alice-i-cecile
Copy link
Member Author

#3412 will significantly impact how this is handled and add complexity, so this should wait until after it's merged.

@james7132
Copy link
Member

Is this still relevant after #4745? UiCamera and it's bundle are no longer a thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants