API/core/AnimationClip/

AnimationClip

Data for an animation, set of Samples and Channels.

Hierarchy: EngineObject

constructor 

new AnimationClip(name: string)

Parameters

  • name

    The AnimationClip's name.

channels 

channels: []

duration 

duration: number

durationIndex 

durationIndex: number

instanceId ReadOnly

instanceId: number = ++EngineObject._instanceIdCounter

Engine unique id.

name ReadOnly

name: string

samplers 

samplers: []

addChannel 

addChannel(samplerIndex: number, targetID: string, targetPath: string): void

Add channel to channels of the AnimationClip.

Parameters

  • samplerIndex

    The sampler's index in channel's sampler property.

  • targetID

    Entity name.

  • targetPath

    Transform property name: position, rotation, scale.

addSampler 

addSampler(_input: List, _output: List, _outputSize: number, _interpolation: InterpolationType): void

Add sampler to samplers of the AnimationClip.

Parameters

  • _input

    The index of an accessor containing keyframe input values.

  • _output

    The index of an accessor containing keyframe output values.

  • _outputSize

    The length of the output values.

  • _interpolation

    Interpolation algorithm.

createChannelValue 

createChannelValue(channelIndex: number):

Get the channel value.

Parameters

  • channelIndex

    The channel's index in AnimationClip's channels property.

Returns

channel value

evaluate 

evaluate(outValue: Value, channelIndex: number, frameIndex: number, nextFrameIndex: number, alpha: number): Value

Parameters

  • outValue

    The output value after interpolation.

  • channelIndex

    The channel's index in AnimationClip's channels property.

  • frameIndex

    The keyframe's index in sampler.input.

  • nextFrameIndex

    The next keyframe's index in sampler.input.

  • alpha

    The weight of the next keyframe in interpolation algorithm.

evaluateCubicSpline 

evaluateCubicSpline(outValue: Value, output: List, outputSize: number, frameIndex: number, nextFrameIndex: number, alpha: number): void

Parameters

  • outValue

  • output

  • outputSize

  • frameIndex

  • nextFrameIndex

  • alpha

evaluateLinear 

evaluateLinear(outValue: Value, output: List, outputSize: number, frameIndex: number, nextFrameIndex: number, alpha: number): void

Parameters

  • outValue

  • output

  • outputSize

  • frameIndex

  • nextFrameIndex

  • alpha

getChannelCount 

getChannelCount(): number

Get length of the channel.

Returns

Number of channels.

getChannelObject 

getChannelObject(channelIndex: number): IChannel

Get the object which the channel acting on.

Parameters

  • channelIndex

    The channel's index in AnimationClip's channels property.

Returns

Channel objects.

getChannelTimeLength 

getChannelTimeLength(channelIndex: number): number

Get length of the channel.

Parameters

  • channelIndex

    The channel's index in AnimationClip's channels property.

Returns

channel time length

getFrameCount 

getFrameCount(channelIndex: number): number

Get frame count of the channel.

Parameters

  • channelIndex

    The channel's index in AnimationClip's channels property.

Returns

Channel frame count.

getFrameTime 

getFrameTime(channelIndex: number, frameIndex: number): number

Get frame time of the channel by channelIndex and frameIndex.

Parameters

  • channelIndex

    The channel's index in AnimationClip's channels property.

  • frameIndex

    The keyframe's index in sampler.input.

Returns

channel frame time