Skip to main content

trajectory

Utility function for estimating low and high arcs of projectiles. Solves for bullet drop given

Functions

trajectory

trajectory.trajectory(
originVector3,--

Origin the the bullet

targetVector3,--

Target for the bullet

initialVelocitynumber,--

Magnitude of the initial velocity

gravityForcenumber--

Force of the gravity

) → (
Vector3?,--

lowTrajectory Initial velocity for a low trajectory arc

Vector3?,--

highTrajectory Initial velocity for a high trajectory arc

Vector3?--

fallbackTrajectory Trajectory directly at target as afallback

)

Returns two possible paths from origin to target where the magnitude of the initial velocity is initialVelocity

Show raw api
{
    "functions": [
        {
            "name": "trajectory",
            "desc": "Returns two possible paths from origin to target where the magnitude of the initial velocity is initialVelocity",
            "params": [
                {
                    "name": "origin",
                    "desc": "Origin the the bullet",
                    "lua_type": "Vector3"
                },
                {
                    "name": "target",
                    "desc": "Target for the bullet",
                    "lua_type": "Vector3"
                },
                {
                    "name": "initialVelocity",
                    "desc": "Magnitude of the initial velocity",
                    "lua_type": "number"
                },
                {
                    "name": "gravityForce",
                    "desc": "Force of the gravity",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "lowTrajectory Initial velocity for a low trajectory arc",
                    "lua_type": "Vector3?"
                },
                {
                    "desc": "highTrajectory Initial velocity for a high trajectory arc",
                    "lua_type": "Vector3?"
                },
                {
                    "desc": "fallbackTrajectory Trajectory directly at target as afallback",
                    "lua_type": "Vector3?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 20,
                "path": "src/trajectory/src/Shared/trajectory.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "trajectory",
    "desc": "Utility function for estimating low and high arcs of projectiles. Solves for bullet\ndrop given",
    "source": {
        "line": 6,
        "path": "src/trajectory/src/Shared/trajectory.lua"
    }
}