-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Moving camera controller into separate crate in examples #4458
Moving camera controller into separate crate in examples #4458
Conversation
This is awesome! I think this will be really useful. I like the defaults for up/down and sensitivity. Would it be better to have the commands
.spawn_bundle(PerspectiveCameraBundle { ..default() })
.insert(CameraController::default()); I don't think this would add much complexity to the examples, and it would both improve flexibility and make it easier for a new user to see how it works. Also with this configuration Would it make sense to have a key that causes it to capture the mouse input? In Unreal Engine, mouse scroll is used to increase/decrease the moment speed. Would that make sense here? If we were to more fully duplicate Unreal's input it would actually be right click + drag that rotates the camera. Left click + drag moves the camera forward and backward and rotates left and right. And the middle mouse click + drag moves the camera up/down and left/right. It may be worthwhile to use these control as a lot of people would be used to them. And it is nice to have the middle click panning. But I also think the current control scheme you have is good, and could make sense as well. |
Some updates (better late than never):
|
@DGriffin91 I'm personally not familiar with unreal. Using the scroll wheel to change the speed sounds really counterintuitive to me and I'm not aware of any camera that does that. As someone more familiar with unity, the scroll wheel simply zooms in or out, right click to change the orientation, WASD to move around and middle click to pan. Blender and godot also only changes the zoom when using the scroll wheel. Also, middle click panning is not that nice when using a laptop, so having a control scheme that works without a middle click would be nice, but it's not required. |
@IceSentry I should clarify: in Unreal Engine, it's only when you are holding the right mouse button down that the scroll changes the movement speed. Blender also works the same way when in Walk/Fly mode (normal blender navigation does not use WASD movement, so there is no speed component). I agree regarding the laptop input. I don't think Unreal has a alternate by default. But I do think we should make sure navigation is good with touchpads 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.
Some small nits. Overall I'm strongly in favor of this change: I think it adds a lot of functionality to our examples and makes them much cleaner.
If we were to convert this to |
Another approach is to not make it into |
I think I disagree? How do you see this distinction between "directly engine related" and "addition built on top"? Nothing would depend on |
I agree with @mockersf here. I expect we'll accumulate a number of optional leaf node crates over time. cargo is already a great tool to manage that. |
Separation between “engine related” and “additions built on top” is based on my thoughts about Unreal Engine and the idea that when people think about it, they imagine, not the “engine” itself, but the whole ecosystem surrounding it, that is UEEditor, Blueprint editor and so on. So there is a separation between “the thing that runs everything”(that is the But I digress. I will convert |
Down the line, I'd like to move all of our camera-related code into there: there's a lot of scattered duplication across the various rendering crates at the moment. So |
@alice-i-cecile If there's going to be a bunch of things in |
Yes, absolutely :) |
Hm… I really don’t understand why CI fails. It can’t find a new camera crate, but |
I have checked CI one more time and have found out that bevy is compiled with this command cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome,bevy_audio,vorbis" Because of that, the |
So, this PR adds However, if we're planning to move other camera code into here, I think that the correct solution here is to actually add |
Alright, I will add it as a |
Closed since something similar was merged with #11338 |
Objective
Fixes #4408
Solution
Moved camera controller into
bevy_camera
crate.Updated current 3d examples to use
bevy_camera
.