lovr.math.newCurve

Creates a new Curve from a list of control points.

Create a Curve from a set of initial control points.

curve = lovr.math.newCurve(x, y, z, ...)

Arguments

NameTypeDescription
xnumberThe x coordinate of the first control point.
ynumberThe y coordinate of the first control point.
znumberThe z coordinate of the first control point.
...*Additional control points.

Returns

NameTypeDescription
curveCurveThe new Curve.

Create a Curve from a (flat) table of points.

curve = lovr.math.newCurve(points)

Arguments

NameTypeDescription
pointstableA table of points, as above.

Returns

NameTypeDescription
curveCurveThe new Curve.

Create an empty Curve, reserving space ahead of time for a certain number of control points.

curve = lovr.math.newCurve(n)

Arguments

NameTypeDescription
nnumberThe number of points to reserve for the Curve.

Returns

NameTypeDescription
curveCurveThe new Curve.

See also