Skip to content

Class: AnimationCurve

Animation Cureve has frame list data

Constructors

Properties

Accessors

Methods

Constructors

constructor

new AnimationCurve(frames?, preWarpMode?, postWarpMode?): AnimationCurve

Parameters

NameTypeDefault value
frames?Keyframe[]undefined
preWarpModeWrapTimeModeWrapTimeMode.Repeat
postWarpModeWrapTimeModeWrapTimeMode.Repeat

Returns

AnimationCurve

Defined in

src/math/AnimationCurve.ts:37

Properties

curve

curve: Keyframe[] = []

Defined in

src/math/AnimationCurve.ts:23


serializedVersion

serializedVersion: number

Defined in

src/math/AnimationCurve.ts:25


preWarpMode

preWarpMode: number

Defined in

src/math/AnimationCurve.ts:27


postWarpMode

postWarpMode: number

Defined in

src/math/AnimationCurve.ts:29


rotationOrder

rotationOrder: number

Defined in

src/math/AnimationCurve.ts:31

Accessors

cacheOut

get cacheOut(): Object

Returns

Object

NameType
lhsIndexnumber
rhsIndexnumber

Defined in

src/math/AnimationCurve.ts:33


totalTime

get totalTime(): number

return this curve use total time

Returns

number

Defined in

src/math/AnimationCurve.ts:49


first

get first(): Keyframe

get curve first keframe time

Returns

Keyframe

Defined in

src/math/AnimationCurve.ts:56


last

get last(): Keyframe

get curve last keyframe time

Returns

Keyframe

Defined in

src/math/AnimationCurve.ts:63

Methods

addKeyFrame

addKeyFrame(keyFrame): void

add keyFrame to curve keyframe last and calcTotalTime

Parameters

NameTypeDescription
keyFrameKeyframeKeyframe sea: one key frame data

Returns

void

Defined in

src/math/AnimationCurve.ts:71


removeKeyFrame

removeKeyFrame(keyFrame): void

remove keyframe from this curve

Parameters

NameTypeDescription
keyFrameKeyframeKeyframe

Returns

void

Defined in

src/math/AnimationCurve.ts:82


calculateCacheData

calculateCacheData(cache, lhsIndex, rhsIndex, timeOffset?): void

calculate keyframe list in to timeline

Parameters

NameTypeDefault valueDescription
cacheFrameCacheundefinedFrameCache
lhsIndexnumberundefinedleft frame index
rhsIndexnumberundefinedright frame index
timeOffsetnumber0offset time default 0.0

Returns

void

Defined in

src/math/AnimationCurve.ts:98


getValue

getValue(time): number

get caculate frames value

Parameters

NameType
timenumber

Returns

number

Defined in

src/math/AnimationCurve.ts:134


getCurveFramesExtent

getCurveFramesExtent(time): Object

get caculate frames extent

Parameters

NameType
timenumber

Returns

Object

NameType
lhsIndexnumber
rhsIndexnumber
timenumber

Defined in

src/math/AnimationCurve.ts:149


getKeyCount

getKeyCount(): number

get has Keyframe list count

Returns

number

int

Defined in

src/math/AnimationCurve.ts:161


getKey

getKey(index): Keyframe

Get a Keyframe Data by Index

Parameters

NameTypeDescription
indexnumbermust int

Returns

Keyframe

Keyframe Keyframe

Defined in

src/math/AnimationCurve.ts:170


unSerialized

unSerialized(data): this

Parameters

NameType
dataany

Returns

this

Defined in

src/math/AnimationCurve.ts:174


unSerialized2

unSerialized2(data): this

Parameters

NameType
dataObject

Returns

this

Defined in

src/math/AnimationCurve.ts:188


wrapTime

wrapTime(curveT): number

Parameters

NameType
curveTnumber

Returns

number

Defined in

src/math/AnimationCurve.ts:202


scaleCurveValue

scaleCurveValue(curve, scale): void

Parameters

NameType
curveAnimationCurve
scalenumber

Returns

void

Defined in

src/math/AnimationCurve.ts:262

Released under the MIT License