Options
All
  • Public
  • Public/Protected
  • All
Menu

FoV Utilities

Index

Type Aliases

aspectRatio: `${number}:${number}`
filmNotation: `${filmWithAspect | filmWithoutAspect}`
filmWithAspect: `${number}M${"L" | "I" | "F" | "S"}${number}`
filmWithoutAspect: `${"V" | "H"}ML`

Functions

  • convertFOV(fov: number, inputAspect: number, outputAspect: number): number
  • Converts one horizontal FoV to another based on the input and output of the engine or screen aspect ratio

    Parameters

    • fov: number
    • inputAspect: number

      horizontal/vertical

    • outputAspect: number

      horizontal/vertical

    Returns number

  • filmToAspect(filmNotation: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}`): number
  • Takes FILM notation and parses the aspect ratio parameters

    Parameters

    • filmNotation: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}`

    Returns number

    the aspect ratio in horizontal/vertical format

  • filmToFilm(fov: number, inFILM: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML", outFILM: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML", aspectRatio: number): number
  • Parameters

    • fov: number
    • inFILM: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML"

      {@link film}

    • outFILM: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML"

      {@link film}

    • aspectRatio: number

    Returns number

  • filmToTrue(fov: number, film: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML", aspectRatio: number): fovValues
  • Parameters

    • fov: number
    • film: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML"
    • aspectRatio: number

    Returns fovValues

  • lockHorizontal(fov: number, aspectRatio: number): fovValues
  • lockVertical(fov: number, aspectRatio: number, filmAspect?: number): fovValues
  • Parameters

    • fov: number
    • aspectRatio: number
    • Optional filmAspect: number

    Returns fovValues

  • parseAspect(aspectRatio: `${number}:${number}`): null | number
  • Parameters

    • aspectRatio: `${number}:${number}`

    Returns null | number

  • parseFilm(film: string): null | `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML"
  • Parses any string that is a implementation of FILM

    Parameters

    • film: string

      a string that only contains the text that is the film notation

    Returns null | `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML"

    the string back or null if its not film notation

  • trueToFILM(param0: fovValues, film: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML", aspectRatio: number): number
  • Parameters

    • param0: fovValues
    • film: `${number}ML${number}` | `${number}MI${number}` | `${number}MF${number}` | `${number}MS${number}` | "VML" | "HML"

      {@link film}

    • aspectRatio: number

    Returns number