Skip to main content

PolyBezierCurve

Represents a composite Bézier curve.

Properties

Curves

PolyBezierCurve.Curves: {BezierCurve?}

The points of the curve.

Length

PolyBezierCurve.Length: number?

The approximate length of the curve. Only exists if GetLength has been called.

Functions

GetLength

PolyBezierCurve:GetLength() → number

Calculates the total length of all curves.

GetAllPoints

PolyBezierCurve:GetAllPoints() → {Vector3}

Returns all points of the curves, the connection points only get get returned once.

AddCurve

PolyBezierCurve:AddCurve(
curveBezierCurve--

The curve to be added

) → ()

Adds a new curve at the end. Take into consideration that the first two points of the new curve may get changed in order to guarantee a smooth join.

GetPoint

PolyBezierCurve:GetPoint(tnumber) → Vector3

Calculates a point on the whole composite curve using the time t. This uses arc length parameterization, so t = 0.25 is actually guaranteed to be approximately at 25% of the length.

GetCurveAndT

PolyBezierCurve:GetCurveAndT(tnumber) → BezierCurve,number

Given a t value of the whole composite curve, it returns the Bézier curve and a t value for it which are at the same position. This is essentially what GetPoint does internally, but this can be used for many other functions.

GetBoundingBox

PolyBezierCurve:GetBoundingBox() → ()

Fast approximation algorithm which returns the minimal and maximal coordinates (the corners) of an axis-aligned bounding box.

Show raw api
{
    "functions": [
        {
            "name": "GetLength",
            "desc": "Calculates the total length of all curves.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\r\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 76,
                "path": "src/PolyBezier.lua"
            }
        },
        {
            "name": "GetAllPoints",
            "desc": "Returns all points of the curves, the connection points only get\nget returned once.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{Vector3}\r\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 90,
                "path": "src/PolyBezier.lua"
            }
        },
        {
            "name": "AddCurve",
            "desc": "Adds a new curve at the end. Take into consideration that the first two points\nof the new curve may get changed in order to guarantee a smooth join.",
            "params": [
                {
                    "name": "curve",
                    "desc": "The curve to be added",
                    "lua_type": "BezierCurve"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 107,
                "path": "src/PolyBezier.lua"
            }
        },
        {
            "name": "GetPoint",
            "desc": "Calculates a point on the whole composite curve using the time t.\nThis uses arc length parameterization, so t = 0.25 is actually\nguaranteed to be approximately at 25% of the length.",
            "params": [
                {
                    "name": "t",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Vector3\r\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 126,
                "path": "src/PolyBezier.lua"
            }
        },
        {
            "name": "GetCurveAndT",
            "desc": "Given a t value of the whole composite curve, it returns the Bézier curve\nand a t value for it which are at the same position. This is essentially\nwhat `GetPoint` does internally, but this can be used for many other functions.",
            "params": [
                {
                    "name": "t",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "BezierCurve, number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 150,
                "path": "src/PolyBezier.lua"
            }
        },
        {
            "name": "GetBoundingBox",
            "desc": "Fast approximation algorithm which returns the minimal and maximal coordinates\n(the corners) of an axis-aligned bounding box.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Vector3"
                },
                {
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 171,
                "path": "src/PolyBezier.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "Curves",
            "desc": "The points of the curve.",
            "lua_type": "{BezierCurve?}",
            "source": {
                "line": 41,
                "path": "src/PolyBezier.lua"
            }
        },
        {
            "name": "Length",
            "desc": "The approximate length of the curve. Only exists if `GetLength` has been called.",
            "lua_type": "number?",
            "source": {
                "line": 47,
                "path": "src/PolyBezier.lua"
            }
        }
    ],
    "types": [],
    "name": "PolyBezierCurve",
    "desc": "Represents a composite Bézier curve.",
    "source": {
        "line": 33,
        "path": "src/PolyBezier.lua"
    }
}