Class: SkeletonAnimationComponent
skeleton animation
Hierarchy
↳
SkeletonAnimationComponent
Properties
Accessors
Methods
- init
- stop
- onEnable
- onDisable
- onLateUpdate
- onBeforeUpdate
- onCompute
- onGraphic
- onParentChange
- destroy
- start
- getJointIndexTable
- addAnimationClip
- getAnimationClip
- getAnimationClips
- getAnimationClipState
- getAnimationClipStates
- pause
- resume
- play
- crossFade
- setAnimIsLoop
- addJointBind
- removeJointBind
- cloneTo
Constructors
Properties
object3D
• object3D: Object3D
= null
owner object3D
Inherited from
Defined in
src/components/ComponentBase.ts:17
isPlaying
• isPlaying: boolean
= true
Whether it is playing
Defined in
src/components/SkeletonAnimationComponent.ts:18
timeScale
• timeScale: number
= 1.0
Global animation time scaling
Defined in
src/components/SkeletonAnimationComponent.ts:23
Accessors
transform
• get
transform(): Transform
Return the Transform component attached to the Object3D.
Returns
Inherited from
ComponentBase.transform
Defined in
src/components/ComponentBase.ts:38
enable
• get
enable(): boolean
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Returns
boolean
Inherited from
ComponentBase.enable
Defined in
src/components/ComponentBase.ts:59
• set
enable(value
): void
Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
ComponentBase.enable
Defined in
src/components/ComponentBase.ts:45
currName
• get
currName(): string
The name of the currently playing animation
Returns
string
Defined in
src/components/SkeletonAnimationComponent.ts:46
skeleton
• get
skeleton(): Skeleton
Skeleton data
Returns
Skeleton
Defined in
src/components/SkeletonAnimationComponent.ts:68
• set
skeleton(value
): void
Skeleton data
Parameters
Name | Type |
---|---|
value | Skeleton |
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:56
finalSkeletonPose
• get
finalSkeletonPose(): SkeletonPose
Current final skeleton posture data
Returns
Defined in
src/components/SkeletonAnimationComponent.ts:75
jointMatrixIndexTableBuffer
• get
jointMatrixIndexTableBuffer(): StorageGPUBuffer
Bone matrix index table data
Returns
Defined in
src/components/SkeletonAnimationComponent.ts:82
Methods
init
▸ init(param?
): void
Parameters
Name | Type |
---|---|
param? | any |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:106
stop
▸ stop(): void
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:108
onEnable
▸ Optional
onEnable(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:109
onDisable
▸ Optional
onDisable(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:110
onLateUpdate
▸ Optional
onLateUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:112
onBeforeUpdate
▸ Optional
onBeforeUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:113
onCompute
▸ Optional
onCompute(view?
, command?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
command? | GPUCommandEncoder |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:114
onGraphic
▸ Optional
onGraphic(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:115
onParentChange
▸ Optional
onParentChange(lastParent?
, currentParent?
): any
Parameters
Name | Type |
---|---|
lastParent? | Object3D |
currentParent? | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:116
destroy
▸ destroy(force?
): void
release this component
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:190
start
▸ start(): void
Returns
void
Overrides
Defined in
src/components/SkeletonAnimationComponent.ts:39
getJointIndexTable
▸ getJointIndexTable(skinJointsName
): number
[]
Get the bone index information by the bone name
Parameters
Name | Type | Description |
---|---|---|
skinJointsName | string [] | bone name |
Returns
number
[]
bone index
Defined in
src/components/SkeletonAnimationComponent.ts:91
addAnimationClip
▸ addAnimationClip(clip
): void
Add a skeleton animation clip
Parameters
Name | Type | Description |
---|---|---|
clip | SkeletonAnimationClip | Skeletal animation clip |
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:105
getAnimationClip
▸ getAnimationClip(name
): SkeletonAnimationClip
Gets the animation clip data object with the specified name
Parameters
Name | Type | Description |
---|---|---|
name | string | Name of animation |
Returns
SkeletonAnimationClip
Animation clip data object
Defined in
src/components/SkeletonAnimationComponent.ts:122
getAnimationClips
▸ getAnimationClips(): SkeletonAnimationClip
[]
Gets all animation clip data objects
Returns
SkeletonAnimationClip
[]
Animation clip data object
Defined in
src/components/SkeletonAnimationComponent.ts:134
getAnimationClipState
▸ getAnimationClipState(name
): SkeletonAnimationClipState
Gets the animation clip state object with the specified name
Parameters
Name | Type | Description |
---|---|---|
name | string | Name of animation |
Returns
SkeletonAnimationClipState
Animation clip state object
Defined in
src/components/SkeletonAnimationComponent.ts:143
getAnimationClipStates
▸ getAnimationClipStates(): Map
<string
, SkeletonAnimationClipState
>
Gets all animation clip state objects
Returns
Map
<string
, SkeletonAnimationClipState
>
Animation clip state object
Defined in
src/components/SkeletonAnimationComponent.ts:154
pause
▸ pause(): void
stop playing
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:161
resume
▸ resume(): void
Resume playback
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:168
play
▸ play(animName
, speed?
, reset?
): boolean
Play the specified animation
Parameters
Name | Type | Default value | Description |
---|---|---|---|
animName | string | undefined | The data set name for the animation |
speed | number | 1 | Animation playback speed, default value is 1.0 |
reset | boolean | false | When true, each play starts with the first frame |
Returns
boolean
Defined in
src/components/SkeletonAnimationComponent.ts:179
crossFade
▸ crossFade(animName
, crossTime
): void
Fades the current animation and fades into another animation state for a specified time.
Parameters
Name | Type | Description |
---|---|---|
animName | string | The name of the animation to fade in. |
crossTime | number | The time of transition, in seconds. |
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:209
setAnimIsLoop
▸ setAnimIsLoop(animName
, isLoop
): void
Set the animation loop
Parameters
Name | Type | Description |
---|---|---|
animName | string | The data set name for the animation |
isLoop | boolean | If true, loop the animation |
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:249
addJointBind
▸ addJointBind(jointName
, obj
): void
Add joint bindings to the object
Parameters
Name | Type | Description |
---|---|---|
jointName | string | Name of joint |
obj | Object3D | Object of binding |
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:260
removeJointBind
▸ removeJointBind(obj
): void
Removes the joint binding of the specified object
Parameters
Name | Type | Description |
---|---|---|
obj | Object3D | Object of binding |
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:272
cloneTo
▸ cloneTo(obj
): void
Clones the current component to the specified object
Parameters
Name | Type | Description |
---|---|---|
obj | Object3D | target object |
Returns
void
Overrides
Defined in
src/components/SkeletonAnimationComponent.ts:320
Constructors
constructor
• new SkeletonAnimationComponent()