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

Open
alice-i-cecile opened this issue Apr 8, 2021 · 3 comments
Open

Add marker components for different camera types #1854

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

Comments

@alice-i-cecile
Copy link
Member

@alice-i-cecile 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.

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
Copy link
Member Author

@alice-i-cecile alice-i-cecile commented Apr 8, 2021

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

@alice-i-cecile alice-i-cecile commented Apr 8, 2021

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

@alice-i-cecile alice-i-cecile commented Apr 9, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant