Class: AnimationCurve
Animation Cureve has frame list data
Constructors
Properties
Accessors
Methods
- addKeyFrame
- removeKeyFrame
- calculateCacheData
- getValue
- getCurveFramesExtent
- getKeyCount
- getKey
- unSerialized
- unSerialized2
- wrapTime
- scaleCurveValue
Constructors
constructor
• new AnimationCurve(frames?
, preWarpMode?
, postWarpMode?
): AnimationCurve
Parameters
Name | Type | Default value |
---|---|---|
frames? | Keyframe [] | undefined |
preWarpMode | WrapTimeMode | WrapTimeMode.Repeat |
postWarpMode | WrapTimeMode | WrapTimeMode.Repeat |
Returns
Defined in
Properties
curve
• curve: Keyframe
[] = []
Defined in
serializedVersion
• serializedVersion: number
Defined in
preWarpMode
• preWarpMode: number
Defined in
postWarpMode
• postWarpMode: number
Defined in
rotationOrder
• rotationOrder: number
Defined in
Accessors
cacheOut
• get
cacheOut(): Object
Returns
Object
Name | Type |
---|---|
lhsIndex | number |
rhsIndex | number |
Defined in
totalTime
• get
totalTime(): number
return this curve use total time
Returns
number
Defined in
first
• get
first(): Keyframe
get curve first keframe time
Returns
Defined in
last
• get
last(): Keyframe
get curve last keyframe time
Returns
Defined in
Methods
addKeyFrame
▸ addKeyFrame(keyFrame
): void
add keyFrame to curve keyframe last and calcTotalTime
Parameters
Name | Type | Description |
---|---|---|
keyFrame | Keyframe | Keyframe sea: one key frame data |
Returns
void
Defined in
removeKeyFrame
▸ removeKeyFrame(keyFrame
): void
remove keyframe from this curve
Parameters
Name | Type | Description |
---|---|---|
keyFrame | Keyframe | Keyframe |
Returns
void
Defined in
calculateCacheData
▸ calculateCacheData(cache
, lhsIndex
, rhsIndex
, timeOffset?
): void
calculate keyframe list in to timeline
Parameters
Name | Type | Default value | Description |
---|---|---|---|
cache | FrameCache | undefined | FrameCache |
lhsIndex | number | undefined | left frame index |
rhsIndex | number | undefined | right frame index |
timeOffset | number | 0 | offset time default 0.0 |
Returns
void
Defined in
getValue
▸ getValue(time
): number
get caculate frames value
Parameters
Name | Type |
---|---|
time | number |
Returns
number
Defined in
src/math/AnimationCurve.ts:134
getCurveFramesExtent
▸ getCurveFramesExtent(time
): Object
get caculate frames extent
Parameters
Name | Type |
---|---|
time | number |
Returns
Object
Name | Type |
---|---|
lhsIndex | number |
rhsIndex | number |
time | number |
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
Name | Type | Description |
---|---|---|
index | number | must int |
Returns
Keyframe Keyframe
Defined in
src/math/AnimationCurve.ts:170
unSerialized
▸ unSerialized(data
): this
Parameters
Name | Type |
---|---|
data | any |
Returns
this
Defined in
src/math/AnimationCurve.ts:174
unSerialized2
▸ unSerialized2(data
): this
Parameters
Name | Type |
---|---|
data | Object |
Returns
this
Defined in
src/math/AnimationCurve.ts:188
wrapTime
▸ wrapTime(curveT
): number
Parameters
Name | Type |
---|---|
curveT | number |
Returns
number
Defined in
src/math/AnimationCurve.ts:202
scaleCurveValue
▸ scaleCurveValue(curve
, scale
): void
Parameters
Name | Type |
---|---|
curve | AnimationCurve |
scale | number |
Returns
void