Skip to content

Conversation

TheDujin
Copy link
Contributor

@TheDujin TheDujin commented Sep 3, 2025

Work done

Investigate engine cardinal lock code and, based on these investigations, devise a better fix for the camera flip widget.

Addresses Issue(s)

#3767

This issue was not fully resolved. While the current widget works when camera ry is set to exactly 0, often, after manually rotating the Spring camera, using Alt+O to flip the camera does not flip the camera by exactly 180 degrees as expected.

Setup

Start a skirmish and toggle to Spring camera (Ctrl+F6).

Test steps

  1. Using Alt+middle mouse, set the camera to any rotation. A cardinally locked direction can be tested, and non-cardinally locked directions can also be tested.
    1. If desired, Echo Camera State under Settings->Developer UI can be used to view the value of the camera ry both before and after the camera flip.
  2. Press Alt+O to flip camera.
    1. Note that the camera flips perfectly by 180 degrees regardless of whether the original rotation was cardinally locked or not.
  3. Repeat steps 1 and 2 with different initial rotations until satisfied.
    1. Verify that when ry is set to very close to 0 (i.e. between -0.1 and 0.1 radians), the camera rotation is still 180 degrees. A camera ry of 0 can be easily obtained by switching to Overhead camera (Ctrl+F5) then switching back to Spring camera (Ctrl+F6).

@TheDujin TheDujin marked this pull request as draft September 3, 2025 07:19
@TheDujin
Copy link
Contributor Author

TheDujin commented Sep 3, 2025

Converting to draft because I realized I haven't handled the "close to 0" edge case.

@TheDujin TheDujin marked this pull request as ready for review September 3, 2025 07:35
@TheDujin
Copy link
Contributor Author

TheDujin commented Sep 6, 2025

I adjusted the comment. It remains wordy, but delves less into tangentially-relevant technical details of the Engine formula and focuses more on why the code behaves how it does. Is this an improvement or is it worse? 😅

@TheDujin TheDujin requested a review from efrec September 6, 2025 05:15
@efrec
Copy link
Collaborator

efrec commented Sep 6, 2025

Much improved.

The cardinal lock feature could be recreated game-side easily, which could help in ironing out its quirks. Then, it would be even easier to selectively disable the feature from game code, as well.

I think this is an improvement, regardless, so I'd approve the change. I think this solves the minor issue without getting into the weeds which is welcome.

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