Skip to main content

FieldOfViewUtils

Utility functions involving field of view.

Functions

fovToHeight

FieldOfViewUtils.fovToHeight(fovnumber) → number

Converts field of view to height

heightToFov

FieldOfViewUtils.heightToFov(heightnumber) → number

Converts height to field of view

safeLog

FieldOfViewUtils.safeLog(
heightnumber,
linearAtnumber
) → number

Linear way to log a value so we don't get floating point errors or infinite values

safeExp

FieldOfViewUtils.safeExp(
logHeightnumber,
linearAtnumber
) → number

Linear way to exponentiate field of view so we don't get floating point errors or infinite values.

lerpInHeightSpace

FieldOfViewUtils.lerpInHeightSpace(
fov0number,
fov1number,
percentnumber
) → number--

Fov in degrees

Interpolates field of view in height space, instead of degrees.

Show raw api
{
    "functions": [
        {
            "name": "fovToHeight",
            "desc": "Converts field of view to height",
            "params": [
                {
                    "name": "fov",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 17,
                "path": "src/camera/src/Client/Utility/FieldOfViewUtils.lua"
            }
        },
        {
            "name": "heightToFov",
            "desc": "Converts height to field of view",
            "params": [
                {
                    "name": "height",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 26,
                "path": "src/camera/src/Client/Utility/FieldOfViewUtils.lua"
            }
        },
        {
            "name": "safeLog",
            "desc": "Linear way to log a value so we don't get floating point errors or infinite values",
            "params": [
                {
                    "name": "height",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "linearAt",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 36,
                "path": "src/camera/src/Client/Utility/FieldOfViewUtils.lua"
            }
        },
        {
            "name": "safeExp",
            "desc": "Linear way to exponentiate field of view so we don't get floating point errors or\ninfinite values.",
            "params": [
                {
                    "name": "logHeight",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "linearAt",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 52,
                "path": "src/camera/src/Client/Utility/FieldOfViewUtils.lua"
            }
        },
        {
            "name": "lerpInHeightSpace",
            "desc": "Interpolates field of view in height space, instead of degrees.",
            "params": [
                {
                    "name": "fov0",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "fov1",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "percent",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "Fov in degrees",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 69,
                "path": "src/camera/src/Client/Utility/FieldOfViewUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "FieldOfViewUtils",
    "desc": "Utility functions involving field of view.",
    "source": {
        "line": 5,
        "path": "src/camera/src/Client/Utility/FieldOfViewUtils.lua"
    }
}