-
-
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
Add marker components for cameras #1888
Conversation
/// Marker component used in [PerspectiveCameraBundle] and | ||
/// [OrthographicCameraBundle]. | ||
#[derive(Default)] | ||
pub struct GameplayCamera; |
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.
I don't like the name GameplayCamera
.
I think MainCamera
would be better, considering that we have the MainPass
marker component for entities that are to be rendered in the "main pass", which is where this camera is used.
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.
Ok, I don't mind one way or the other, I think your reasoning is good though so I can change it to MainCamera
.
Will ping @alice-i-cecile though as the original naming came from #1854 .
Any comments?
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.
I'd like to avoid MainCamera:
it becomes very confusing with multiple viewports when you have multiple cameras, all of which have the MainCamera
marker component.
The idea to communicate here is "renders objects in the game world, not the UI". WorldCamera
might also makes sense, and is less game-specific, but given that UI entities are also going to be stored in the World
it could be confusing as well.
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.
IMO we should remove the name field from Camera
as part of this PR as well.
Ok, I started on this. That system is based around It sounds very manageable with a little time, but please give me some input on what the best way forward is:
|
Taking a closer look @Grindv1k, I think that removing the name field deserves to be part of a follow-up issue and PR. This solves the end-user case; we can do code-quality clean-up on the internals separately, particularly since the rendering is due for a rework. |
Camera names are also "end user" apis. I do think marker components and names solve very similar problems and having both feels a bit odd. I think marker components are the right move, but I'd want a concrete plan before committing to them. Prior to adding marker components, I think we should have either:
While we wait, users can already grab the entity for a given camera name using |
Signed-off-by: Torstein Grindvik <torstein.grindvik@gmail.com>
Closing in favor of #3635 <3 Thanks for all the exploration you did here! |
Adds marker components for cameras, as suggested in #1854.
Fixes #1854.
Changes alien cake addict example to use the
GameplayCamera
marker in order to show use.