-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Fix CameraProjectionPlugin
not implementing Plugin
in some cases
#11766
Merged
alice-i-cecile
merged 1 commit into
bevyengine:main
from
doonv:fix-cameraprojectionplugin-bounds
Feb 26, 2024
Merged
Fix CameraProjectionPlugin
not implementing Plugin
in some cases
#11766
alice-i-cecile
merged 1 commit into
bevyengine:main
from
doonv:fix-cameraprojectionplugin-bounds
Feb 26, 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
pablo-lua
approved these changes
Feb 11, 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.
If the Plugin has thoses bounds, and I cannot use a CameraProjectionPlugin
as a Plugin
unless thoses bounds are fulfilled, then we must require thoses bounds in the struct as well.
nicopap
approved these changes
Feb 21, 2024
msvbg
pushed a commit
to msvbg/bevy
that referenced
this pull request
Feb 26, 2024
…evyengine#11766) # Objective `CameraProjectionPlugin<T>`'s bounds are `T: CameraProjection`. But the bounds for `CameraProjectionPlugin` implementing `Plugin` are `T: CameraProjection + Component + GetTypeRegistration`. This means that if `T` is valid for `CameraProjectionPlugin`'s bounds, but not the plugin implementation's bounds, then `CameraProjectionPlugin` would not implement `Plugin`. Which is weird because you'd expect a struct with `Plugin` in the name to implement `Plugin`. ## Solution Make `CameraProjectionPlugin<T>`'s bounds `T: CameraProjection + Component + GetTypeRegistration`. I also rearranged some of the code. --- ## Changelog - Changed `CameraProjectionPlugin<T>`'s bounds to `T: CameraProjection + Component + GetTypeRegistration` ## Migration Guide `CameraProjectionPlugin<T>`'s trait bounds now require `T` to implement `CameraProjection`, `Component`, and `GetTypeRegistration`. This shouldn't affect most existing code as `CameraProjectionPlugin<T>` never implemented `Plugin` unless those bounds were met.
msvbg
pushed a commit
to msvbg/bevy
that referenced
this pull request
Feb 26, 2024
…evyengine#11766) # Objective `CameraProjectionPlugin<T>`'s bounds are `T: CameraProjection`. But the bounds for `CameraProjectionPlugin` implementing `Plugin` are `T: CameraProjection + Component + GetTypeRegistration`. This means that if `T` is valid for `CameraProjectionPlugin`'s bounds, but not the plugin implementation's bounds, then `CameraProjectionPlugin` would not implement `Plugin`. Which is weird because you'd expect a struct with `Plugin` in the name to implement `Plugin`. ## Solution Make `CameraProjectionPlugin<T>`'s bounds `T: CameraProjection + Component + GetTypeRegistration`. I also rearranged some of the code. --- ## Changelog - Changed `CameraProjectionPlugin<T>`'s bounds to `T: CameraProjection + Component + GetTypeRegistration` ## Migration Guide `CameraProjectionPlugin<T>`'s trait bounds now require `T` to implement `CameraProjection`, `Component`, and `GetTypeRegistration`. This shouldn't affect most existing code as `CameraProjectionPlugin<T>` never implemented `Plugin` unless those bounds were met.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 27, 2024
…1808) # Objective Fix #11799 and improve `CameraProjectionPlugin` ## Solution `CameraProjectionPlugin` is now an all-in-one plugin for adding a custom `CameraProjection`. I also added `PbrProjectionPlugin` which is like `CameraProjectionPlugin` but for PBR. P.S. I'd like to get this merged after #11766. --- ## Changelog - Changed `CameraProjectionPlugin` to be an all-in-one plugin for adding a `CameraProjection` - Removed `VisibilitySystems::{UpdateOrthographicFrusta, UpdatePerspectiveFrusta, UpdateProjectionFrusta}`, now replaced with `VisibilitySystems::UpdateFrusta` - Added `PbrProjectionPlugin` for projection-specific PBR functionality. ## Migration Guide `VisibilitySystems`'s `UpdateOrthographicFrusta`, `UpdatePerspectiveFrusta`, and `UpdateProjectionFrusta` variants were removed, they were replaced with `VisibilitySystems::UpdateFrusta`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Rendering
Drawing game state to the screen
C-Bug
An unexpected or incorrect behavior
M-Needs-Migration-Guide
A breaking change to Bevy's public API that needs to be noted in a migration guide
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
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
CameraProjectionPlugin<T>
's bounds areT: CameraProjection
. But the bounds forCameraProjectionPlugin
implementingPlugin
areT: CameraProjection + Component + GetTypeRegistration
. This means that ifT
is valid forCameraProjectionPlugin
's bounds, but not the plugin implementation's bounds, thenCameraProjectionPlugin
would not implementPlugin
. Which is weird because you'd expect a struct withPlugin
in the name to implementPlugin
.Solution
Make
CameraProjectionPlugin<T>
's boundsT: CameraProjection + Component + GetTypeRegistration
. I also rearranged some of the code.Changelog
CameraProjectionPlugin<T>
's bounds toT: CameraProjection + Component + GetTypeRegistration
Migration Guide
CameraProjectionPlugin<T>
's trait bounds now requireT
to implementCameraProjection
,Component
, andGetTypeRegistration
. This shouldn't affect most existing code asCameraProjectionPlugin<T>
never implementedPlugin
unless those bounds were met.