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
Support for pitching the camera #79
Conversation
Already getting the cinematic stuff going, I see. Can't you just revert all the unnecessarily changed lines that don't have anything to do? Also would be nice if you could either not add any default keybindings at all or make them pretty obscure, so you don't accidentally tilt the camera. |
Just to be clear, this is for looking up and down with the camera, not tilting it sideways. Tilt might have been a bad descriptor. I decided to implement this mostly because I felt that the default angle was too big. I can definitely remove any usage from the game code itself, but I would personally find it an incredibly useful feature to have. |
Oh I see, confusing indeed. Maybe "pitch" like for planes? ...and yes, that is much more useful. |
That is a far better name for it. I'll change the naming scheme in the source right away. We also currently have yaw implemented, but it's simply called 'rotation'. Should I rename that too? |
Yeah that would be cool and consistent. Thank you! |
This wasn't the place for it, but I do think we should run |
Because of the way camera translation works, panning to almost-horizontal makes the camera move very slowly. I don't think there's much we can do right now, but we should be aware of the issue. Maybe movement speed should be based on the cameras distance to the target instead of the cameras height, since the reason for the original feature was different speeds at different zoom-levels. |
It seems to work fairly well, but I'm not sure if the camera is a tad bit too slow. At least that is easily changeable. |
Maybe a separate modifier key can be added, and bound by default to the same as the rotational modifier keys, for people who want them separated. |
That is easily added. The only problem with that is that we check for mouse input in an After testing: Removing the |
I think the problem is that this clause https://github.com/citybound/citybound/blob/master/src/core/ui.rs#L335 needs to be triggered if and only if none of the other branches execute. |
I decided to do it slightly differently, but the result is ultimately the same. Any other comments/ideas? |
Looks great to me! |
Just tried it, works great, thank you! |
This was a fairly simple implementation. Right now it uses the rotation modifier keys and speed, but I can add separate settings if that is needed.
Do note that I, unfortunately, ran
rustfmt
onsrc/core/ui.rs
. I can revert and re-implement, if you'd prefer that.