Interface FovCalculation

Specifies how the FOV (Field of View) should be calculated.

Hierarchy

  • FovCalculation

Properties

Properties

fov: number

Vertical field of view in degrees. If [[type]] is fixed then the supplied [[fov]] is fixed regardless of [[viewportHeight]] or [[viewportWidth]].

If [[type]] is dynamic then the supplied [[fov]] is applied to the first frame, and the focal length calculated. Changes to the viewport height no longer shrink the content because the field of view is updated dynamically.

type: "fixed" | "dynamic"

How to interpret the [[fov]], can be either fixed or dynamic.

fixed means that the FOV is fixed regardless of the [[viewportHeight]], such that shrinking the height causes the map to shrink to keep the content in view. The benefit is that, regardless of any resizes, the field of view is constant, which means there is no change in the distortion of buildings near the edges. However the trade off is that the zoom level changes, which means that the map will pull in new tiles, hence causing some flickering.

dynamic means that the focal length is calculated based on the supplied [[fov]] and [[viewportHeight]], this means that the map doesn't scale (the image is essentially cropped but not shrunk) when the [[viewportHeight]] or [[viewportWidth]] is changed. The benefit is that the zoom level is (currently) stable during resize, because the focal length is used, however the tradeoff is that changing from a small to a big height will cause the fov to change a lot, and thus introduce distortion.

Generated using TypeDoc