Skip to content

Class: CubicBezierCurve

Cubic Bezier Curve

Constructors

Methods

Constructors

constructor

new CubicBezierCurve(cvs): CubicBezierCurve

Parameters

NameTypeDescription
cvsVector3[]controller points

Returns

CubicBezierCurve

Defined in

src/math/CubicBezierCurve.ts:14

Methods

setControlVertices

setControlVertices(cvs): void

update controller points

Parameters

NameTypeDescription
cvsVector3[]controller points

Returns

void

Defined in

src/math/CubicBezierCurve.ts:22


getPoint

getPoint(t): Vector3

get position by calc from curve

Parameters

NameTypeDescription
tnumbera position in range [0-1]

Returns

Vector3

Vector3

Defined in

src/math/CubicBezierCurve.ts:34


getTangent

getTangent(t): Vector3

get tagent by calc from curve

Parameters

NameTypeDescription
tnumbera position in range [0-1]

Returns

Vector3

tagent direction See: http://bimixual.org/AnimationLibrary/beziertangents.html

Defined in

src/math/CubicBezierCurve.ts:56


getClosestParam

getClosestParam(pos, paramThreshold?): number

get adjacent coordinates

Parameters

NameTypeDefault valueDescription
posVector3undefinedposition
paramThresholdnumber0.000001threshold value

Returns

number

a position in range [0-1]

Defined in

src/math/CubicBezierCurve.ts:77


getClosestParamRec

getClosestParamRec(pos, beginT, endT, thresholdT): number

get adjacent coordinates by given range

Parameters

NameTypeDescription
posVector3position
beginTnumberrange from
endTnumberrange end
thresholdTnumberthreshold value

Returns

number

Defined in

src/math/CubicBezierCurve.ts:89