Class: SkeletonAnimation
骨骼动画组件
Hierarchy
↳
SkeletonAnimation
Properties
Accessors
Methods
- onVisible
- destroy
- onUpdate
- onLateUpdate
- onBeforeUpdate
- serialization
- unSerialization
- getJointIndexTable
- addAnimationClip
- getAnimationClip
- getAnimationClips
- getAnimationClipState
- getAnimationClipStates
- pause
- resume
- play
- crossFade
- setAnimIsLoop
- addJointBind
- removeJointBind
- cloneTo
Constructors
Properties
object3D
• object3D: Object3D
= null
此组件附加到的Object3D对象。
Inherited from
Defined in
src/engine/components/ComponentBase.ts:14
serializeTag
• Optional
serializeTag: SerializeTag
Inherited from
Defined in
src/engine/components/ComponentBase.ts:30
isPlaying
• isPlaying: boolean
= true
是否正在播放
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:18
timeScale
• timeScale: number
= 1.0
全局动画时间缩放
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:23
Accessors
transform
• get
transform(): Transform
附加到此 Object3D对象 的 Transform组件。
Returns
Inherited from
ComponentBase.transform
Defined in
src/engine/components/ComponentBase.ts:39
enable
• get
enable(): boolean
启用/禁用 组件。启用的组件可更新,禁用的组件不可更新。
Returns
boolean
Inherited from
ComponentBase.enable
Defined in
src/engine/components/ComponentBase.ts:62
• set
enable(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
ComponentBase.enable
Defined in
src/engine/components/ComponentBase.ts:43
currName
• get
currName(): string
当前播放的动画名称
Returns
string
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:45
skeleton
• get
skeleton(): Skeleton
骨架数据
Returns
Skeleton
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:67
• set
skeleton(value
): void
骨架数据
Parameters
Name | Type |
---|---|
value | Skeleton |
Returns
void
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:55
finalSkeletonPose
• get
finalSkeletonPose(): SkeletonPose
当前最终骨架姿势数据
Returns
SkeletonPose
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:74
jointMatrixIndexTableBuffer
• get
jointMatrixIndexTableBuffer(): StorageGPUBuffer
骨骼矩阵索引表数据
Returns
StorageGPUBuffer
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:81
Methods
onVisible
▸ onVisible(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
Defined in
src/engine/components/ComponentBase.ts:66
destroy
▸ destroy(): void
移除组件时候调用
Returns
void
Inherited from
Defined in
src/engine/components/ComponentBase.ts:119
onUpdate
▸ onUpdate(call
): void
添加更新函数。会在每帧更新时执行。
Parameters
Name | Type | Description |
---|---|---|
call | Function | 回调函数 |
Returns
void
Inherited from
Defined in
src/engine/components/ComponentBase.ts:135
onLateUpdate
▸ onLateUpdate(call
): void
添加延迟更新函数。
Parameters
Name | Type | Description |
---|---|---|
call | Function | 回调函数 |
Returns
void
Inherited from
Defined in
src/engine/components/ComponentBase.ts:148
onBeforeUpdate
▸ onBeforeUpdate(call
): void
添加帧更新前执行的函数。
Parameters
Name | Type | Description |
---|---|---|
call | Function | 回调函数 |
Returns
void
Inherited from
Defined in
src/engine/components/ComponentBase.ts:161
serialization
▸ serialization(assets
): SerializeComponentBase
Parameters
Name | Type |
---|---|
assets | ISerializeAssetsCollect |
Returns
Inherited from
Defined in
src/engine/components/ComponentBase.ts:170
unSerialization
▸ unSerialization(componentData
, data
): void
Parameters
Name | Type |
---|---|
componentData | SerializeComponentBase |
data | UnSerializeData |
Returns
void
Inherited from
Defined in
src/engine/components/ComponentBase.ts:175
getJointIndexTable
▸ getJointIndexTable(skinJointsName
): number
[]
通过骨骼名称获取骨骼索引信息
Parameters
Name | Type | Description |
---|---|---|
skinJointsName | string [] | 骨骼名称集合 |
Returns
number
[]
对应的骨骼索引
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:90
addAnimationClip
▸ addAnimationClip(clip
): void
添加骨骼动画剪辑
Parameters
Name | Type | Description |
---|---|---|
clip | SkeletonAnimationClip | 骨骼动画数据 |
Returns
void
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:104
getAnimationClip
▸ getAnimationClip(name
): SkeletonAnimationClip
获取指定名称的动画剪辑数据对象
Parameters
Name | Type | Description |
---|---|---|
name | string | 动画名称 |
Returns
SkeletonAnimationClip
动画剪辑数据对象
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:121
getAnimationClips
▸ getAnimationClips(): SkeletonAnimationClip
[]
获取所有动画剪辑数据对象
Returns
SkeletonAnimationClip
[]
动画剪辑数据对象
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:133
getAnimationClipState
▸ getAnimationClipState(name
): SkeletonAnimationClipState
获取指定名称的动画剪辑状态对象
Parameters
Name | Type | Description |
---|---|---|
name | string | 动画名称 |
Returns
SkeletonAnimationClipState
动画剪辑状态对象
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:142
getAnimationClipStates
▸ getAnimationClipStates(): Map
<string
, SkeletonAnimationClipState
>
获取所有动画剪辑状态对象
Returns
Map
<string
, SkeletonAnimationClipState
>
动画剪辑状态对象
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:153
pause
▸ pause(): void
暂停播放
Returns
void
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:160
resume
▸ resume(): void
恢复播放
Returns
void
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:167
play
▸ play(animName
, speed?
, reset?
): boolean
播放指定动画
Parameters
Name | Type | Default value | Description |
---|---|---|---|
animName | string | undefined | 动画的数据集名称 |
speed | number | 1 | 动画播放速度,默认值为1 |
reset | boolean | false | 为true时,每次播放从首帧开始 |
Returns
boolean
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:187
crossFade
▸ crossFade(animName
, crossTime
): void
在指定的时间内将当前动画淡出,并淡入另一个动画状态。
Parameters
Name | Type | Description |
---|---|---|
animName | string | 需要淡入的动画名称。 |
crossTime | number | 过渡的时间,单位秒。 |
Returns
void
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:217
setAnimIsLoop
▸ setAnimIsLoop(animName
, isLoop
): void
设置动画循环
Parameters
Name | Type | Description |
---|---|---|
animName | string | 动画的数据集名称 |
isLoop | boolean | 为true时循环播放动画 |
Returns
void
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:257
addJointBind
▸ addJointBind(jointName
, obj
): void
给对象添加关节绑定
Parameters
Name | Type | Description |
---|---|---|
jointName | string | 关节名称 |
obj | Object3D | 绑定的对象 |
Returns
void
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:268
removeJointBind
▸ removeJointBind(obj
): void
移除指定对象的关节绑定
Parameters
Name | Type | Description |
---|---|---|
obj | Object3D | 绑定的对象 |
Returns
void
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:280
cloneTo
▸ cloneTo(obj
): void
克隆当前组件到指定对象
Parameters
Name | Type | Description |
---|---|---|
obj | Object3D | 目标对象 |
Returns
void
Overrides
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:328
Constructors
constructor
• new SkeletonAnimation()
Overrides
Defined in
src/engine/components/anim/skeletonAnim/SkeletonAnimation.ts:34