-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Migrate cameras to required components #15641
Merged
alice-i-cecile
merged 14 commits into
bevyengine:main
from
Jondolf:camera-required-components
Oct 5, 2024
Merged
Migrate cameras to required components #15641
alice-i-cecile
merged 14 commits into
bevyengine:main
from
Jondolf:camera-required-components
Oct 5, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cart
approved these changes
Oct 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Jondolf
commented
Oct 4, 2024
LiamGallagher737
approved these changes
Oct 4, 2024
KirmesBude
reviewed
Oct 4, 2024
KirmesBude
reviewed
Oct 4, 2024
KirmesBude
approved these changes
Oct 4, 2024
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 11, 2024
# Objective Since #15641, `loading_screen` panics. ``` called `Result::unwrap()` on an `Err` value: MultipleEntities("bevy_ecs::query::state::QueryState<&mut bevy_render::view::visibility::Visibility, bevy_ecs::query::filter::With<loading_screen::LoadingScreen>>") ``` Before that PR, the camera did not have a `Visibility` component. But `Visibility` is now a required component of `Camera`. So the query matches multiple entities. ## Solution Minimal change to make the example behave like it used to. Plus a tiny drive-by cleanup to remove a redundant unwrap. ## Testing `cargo run --example loading_screen`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-ECS
Entities, components, systems, and events
A-Rendering
Drawing game state to the screen
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
X-Contentious
There are nontrivial implications that should be thought through
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Yet another PR for migrating stuff to required components. This time, cameras!
Solution
As per the selected proposal, deprecate
Camera2dBundle
andCamera3dBundle
in favor ofCamera2d
andCamera3d
.Adding a
Camera
withoutCamera2d
orCamera3d
now logs a warning, as suggested by Cart on Discord. I would personally like cameras to work a bit differently and be split into a few more components, to avoid some footguns and confusing semantics, but that is more controversial, and shouldn't block this core migration.Testing
I ran a few 2D and 3D examples, and tried cameras with and without render graphs.
Migration Guide
Camera2dBundle
andCamera3dBundle
have been deprecated in favor ofCamera2d
andCamera3d
. Inserting them will now also insert the other components required by them automatically.