Skip to content

Camera FOV rework - #3139

Draft
ohlidalp wants to merge 3 commits into
RigsOfRods:masterfrom
ohlidalp:danmackey_FOV_rework
Draft

Camera FOV rework#3139
ohlidalp wants to merge 3 commits into
RigsOfRods:masterfrom
ohlidalp:danmackey_FOV_rework

Conversation

@ohlidalp

@ohlidalp ohlidalp commented Mar 10, 2024

Copy link
Copy Markdown
Member

With this ticket I try to clear some confusion about adjusting FOV and the meaning of the slider(s) in Top Menubar UI.

The slider is actually context sensitive; We have multiple presets:

  • gfx_static_cam_fov_exp ~ (smooth) ~ A "zoom factor" of static camera (the actual FOV is dynamic based on distance); Adjust by 'Ctrl+mouse wheel' or TopMenubar/Settings.
  • gfx_fov_internal ~ (stepped) ~ FOV of cinecam; Adjust by hotkeys EV_COMMON_FOV_{LESS/MORE/RESET}.
  • gfx_fov_external ~ (stepped) ~ FOV of exterior cameras (3rd person, free cam, freefixed cam), adjustable by hotkeys. EV_COMMON_FOV_{LESS/MORE/RESET}.

To start this off, I clarified and commented the code in Top Menubar (as well as related CameraManager code), and I added a combobox to select camera mode:
obrazek

Note: having FOV stepped in whole numbers is sort of a convention; thing is, angle degrees aren't typical (base 10) numbers but base 60 numbers, meaning 1 Degree = 60 Angular Minutes. Using a float to represent FOV in degrees would be kind of bastardized, but I think I'll do it anyway.

@ohlidalp ohlidalp changed the title Danmackey fov rework Camera FOV rework Mar 10, 2024
Changes:
* cvar `gfx_camera_speed` replaces `CameraManager::m_cam_ratio` which was used/updated chaotically and didn't always account frame time. Default value is 4.0 like before.
* New `smoothXXX()` helpers to CameraManager, replacing copypasted smoothing code.
* Clarified staticcam fov exponent smoothing: Removed `Cameramanager::m_staticcam_fov_exponent` which just duplicated `gfx_static_cam_fov_exp`. Added `Cameramanager::m_staticcam_fov_exp_current` which replaces `static fovExp` (CameraManager.cpp, line 789). Comments clearly indicate what is what.
@ohlidalp

ohlidalp commented Mar 11, 2024

Copy link
Copy Markdown
Member Author

I analyzed how the smoothing works and added a slider for it. I didn't add smoothing anywhere, but all existing smoothed values were unified around this slider. Default value is 4.0 which is the same as before (although the code was finnicky so it may not be always in effect).

obrazek

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.

1 participant