Camera FOV

How do I get FOV of current view ?

I calucalte camera inside of ATPPPlayerCamera::UpdateViewTarget(FTViewTarget& OutVT, float DeltaTime)

And when I resize viewport fov is dynamically adjusted (I think, I actually don’t know where the current fov value is stored).
And my camera offsets just fall apart as the viewport size changes.
I’d like to calucate the with regard to current fov so they always stay the same regardless of vieport aspec ratio.

Hi Lukasz,

The FOV is fixed (based on what you set for OutVT.POV.FOV), but as the viewport size changes, the aspect ratio is allowed to change, adjusting how much you see in the non-constrained axis. FOV can be expressed either as a fixed horizontal FOV or a fixed vertical FOV, and the engine currently uses fixed horizontal FOV, so the vertical FOV changes as the aspect ratio changes.

As the aspect ratio or screen size changes, you shouldn’t be seeing a change in the effective distance of the camera, only how much is shown vertically. If you want to have fixed vertical FOV, you can recalculate the horizontal FOV each frame to simulate it, or alternatively you could add black bars when the aspect ratio is mismatched by setting bConstrainAspectRatio to true and setting your desired value in PlayerCamera’s AspectRatio.

If you want to simulate a vertical FOV, I think you can use PlayerController::GetViewportSize() to get the current screen dimensions.

Cheers,
Michael Noland