Skip to content
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

Added camera zoom #35

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Icodextrin
Copy link

@Icodextrin Icodextrin commented Oct 31, 2024

Features implemented:

optional zoom (zoom_enable)
zoom toggle or zoom hold
adjustable zoom multiplier (1x, 2x, etc.)
optional automatic mouse sensitivity adjustment such that the zoomed view keeps the same sensitivity as unzoomed

Needed a camera zoom for an immersive sim and came up with this. Made it a bit more flexible so it would fit with other fps type uses.

@Icodextrin Icodextrin changed the title Add camera zoom Added camera zoom Oct 31, 2024
@CZakarya
Copy link
Member

I see that you have zooming as a state. This is an interesting way to implement camera zoom. This would prevent players from sprinting or crouching while the camera is zoomed in. I can understand why you may want to prevent players from zooming in while sprinting, but I think the utility of zooming in while crouching is reasonable and useful. I recommend having a separate state machine for zooming, something like camera_state. This would not only allow developers to implement multiple zoom modes (like mini zoom or super zoom), it would enable protecting camera tricks that may break when zoomed in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants