Create a new instance.
Optional
v0: Vector2The starting point.
Optional
v1: Vector2– The first control point.
Optional
v2: Vector2The second control point.
Optional
v3: Vector2The ending point.
Determines the amount of divisions when calculating the
cumulative segment lengths of a curve via .getLengths
. To ensure
precision when using methods like .getSpacedPoints
, it is recommended
to increase .arcLengthDivisions
if the curve is very large.
200
Readonly
issubclass should override
false
Readonly
issubclass should override
true
Readonly
istrue
Readonly
issubclass should override
false
Readonly
issubclass should override
false
Readonly
issubclass should override
false
Readonly
issubclass should override
false
Readonly
issubclass should override
false
Readonly
issubclass should override
false
Readonly
issubclass should override
false
Readonly
type'CubicBezierCurve'
The starting point.
new Vector2()
The first control point.
new Vector2()
The second control point.
new Vector2()
The end point.
new Vector2()
Generates the Frenet frames. Learn more at http://www.cs.indiana.edu/pub/techreports/TR425.pdf
An object with shape: { tangents: Vector3[]; normals: Vector3[]; binormals: Vector3[]; }
Number of segments
Optional
closed: booleanTrue if this curve is closed.
Copies another Curve object's properties to this instance.
This instance.
The source curve.
Copies the data from the given JSON object to this instance.
This instance.
The source JSON object.
Find the point (vector) for point t of the curve where t is between 0 and 1.
The point.
A position on the curve. Must be in the range [ 0, 1 ].
Optional
optionalTarget: Vector2(optional) If specified, the result will be copied into this Vector, otherwise a new Vector will be created.
Find a vector for point at relative position in curve according to arc length
The point.
A position on the curve according to the arc length. Must be in the range [ 0, 1 ].
Optional
optionalTarget: Vector2(optional) If specified, the result will be copied into this Vector, otherwise a new Vector will be created.
Compute a unit vector tangent at t. If the subclassed curve do not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation getTangent(t: number, optionalTarget?: T): T;
A vector tangent to t.
A position on the curve. Must be in the range [ 0, 1 ].
Optional
optionalTarget: Vector2— (optional) If specified, the result will be copied into this Vector, otherwise a new Vector will be created.
Compute the tangent at a point which is equidistant to the ends of the
curve from the point given in getTangent()
.
a vector tangent to u.
A position on the curve according to the arc length. Must be in the range [ 0, 1 ].
Optional
optionalTarget: Vector2(optional) If specified, the result will be copied into this Vector, otherwise a new Vector will be created.
A smooth 2d cubic bezier curve, defined by a start point, endpoint and two control points.
Example