-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(pan-cam): add scaffolding for 2D pan camera controller #21520
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
base: main
Are you sure you want to change the base?
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
Hi @alice-i-cecile, thank you for your quick and helpful feedback! I really appreciate it and have applied all of your suggestions. Outstanding Questions:
Additionally, you added the |
I don't have strong preferences here. Linear zoom is fine to start: we can change that later.
This is about what I would expect. I think that 2D games have a lot more scale variance than in 3D, so I expect more per-game tuning.
This is great for this particular example.
Yes please! Definitely belongs in the camera folder. |
The generated |
Thanks for the feedback! I've incorporated all of it. |
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.
Almost there! Just a couple of release note nits then I'm happy with this.
This looks like quite a specialised camera to me, mostly because of the WASD movement. That's not a bad thing since it's exactly what the related issue asks for, and I think this definitely fills the hole of having a 2d camera available, but I expect it's very easy to run into a situation where you can't really benefit from it as soon as you want to change one aspect of the controls: I also think a camera like this would be neat for 3D/2.5D as well, which I believe this will currently not correctly zoom for. |
I think that having a few bools for toggling the different behavior would be nice :) Or we could swap to I agree that better e.g. mouse and gamepad support would be nice, but I really don't want to embed mediocre input mapping tools into this crate. |
implements review feedback Co-authored-by: Janis <[email protected]>
Thank you @alice-i-cecile and @janis-bhm for your feedback. I will think about a way to incorporate the request for toggling and also fix the rotation bug. Additionally, do you think it would make sense to split this into two components, similar to the approach suggested in #21456 for |
Yes, let's do that now :) |
Objective
Implements scaffolding for a 2D pan camera controller.
Fixes #21468
Solution
PanCam
component with settings for panning, zooming, and rotation via keyboard input, following the design of the existingFreeCam
.PanCamPlugin
to register the controller system.TODOs
Testing
Unfortunately, I was unable to fully test this implementation due to issues running graphical output with GPU acceleration under WSL.
As a result, zoom behavior and rotation effects remain TODOs, and the whole code could not be fully verified.
Once I resolve the GPU passthrough issues, I plan to complete and test the remaining features (with a more meaningful example).
I'm happy to hear any suggestions or feedback in the meantime!