Skip to content

Conversation

@Stubbjax
Copy link

@Stubbjax Stubbjax commented Nov 13, 2025

Merge after #1854

This change adds the ability to rotate the camera in 45 degree increments by holding the CTRL modifier key when rotating the camera via the NumPad4 and NumPad6 keys.

ROTATE.mp4

@Stubbjax Stubbjax self-assigned this Nov 13, 2025
@Stubbjax Stubbjax added Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Input labels Nov 13, 2025
@Skyaero42
Copy link

Use case:

  • I manually rotate the camera 20 degrees to the left
  • I then rotate the camera to the left with the Alt key.

Current outcome:

  • Camera rotated 20 + 45 = 65 degrees

(Possible) expected outcome:

  • Camera rotates and snaps to 45 degrees.

To do exact 45 step rotations in this PR, the camera needs to be reset first (numkey 5)

How do others look at this? +-45 degree rotating or 45 degree snapping?

@Stubbjax
Copy link
Author

@Skyaero42 I considered the same thing. But you've already pointed out the solution: In the (probably rare?) situation the user unintentionally rotates the camera e.g. 20 degrees while intending their camera to be in direct 45 degree angles, they can easily reset the orientation by using NumPad5.

I would estimate changing the behaviour from 45 degree increments to 45 degree snapping would add quite a bit of complexity in comparison to the relatively simple current approach. As a solution exists for the offset use case (and the feature is unlikely to see much use), I opted for simplicity.

@xezon
Copy link

xezon commented Nov 13, 2025

I did not expect it to be implemented for numpad buttons, but mouse3 (middle mouse button). When holding that button and moving the mouse, the camera rotates.

@Stubbjax
Copy link
Author

I did not expect it to be implemented for numpad buttons, but mouse3 (middle mouse button). When holding that button and moving the mouse, the camera rotates.

Is that a problem?

@xezon
Copy link

xezon commented Nov 13, 2025

Is that a problem?

Not per se, but I would have expected implementation for that to be similar to the building placement and easier to do.

@Stubbjax
Copy link
Author

Is that a problem?

Not per se, but I would have expected implementation for that to be similar to the building placement and easier to do.

I actually found this approach easier to do. I did attempt it with the mouse initially, but it felt very awkward and the solution of tracking the mouse delta as stateful data separately to the camera rotation did not feel as clean.

@Stubbjax
Copy link
Author

Is that a problem?

Not per se, but I would have expected implementation for that to be similar to the building placement and easier to do.

I had another go and managed to get it working correctly. See #1848.

@Stubbjax Stubbjax changed the title feat: Add ability to rotate the camera in 45 degree increments feat: Add ability to rotate the camera in 45 degree increments using the numpad Nov 13, 2025
@Stubbjax Stubbjax force-pushed the segmented-camera-rotation branch from 2db1e5a to e581044 Compare November 14, 2025 09:26
@xezon xezon changed the title feat: Add ability to rotate the camera in 45 degree increments using the numpad feat(view): Add ability to rotate the camera in 45 degree increments using the numpad Nov 14, 2025
@xezon xezon merged commit 2677c39 into TheSuperHackers:main Nov 14, 2025
19 checks passed
@Stubbjax Stubbjax deleted the segmented-camera-rotation branch November 15, 2025 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals Input Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants