Class: SkeletonAnimationComponent
skeleton animation
Hierarchy
↳
SkeletonAnimationComponent
Constructors
Properties
Accessors
Methods
- init
- stop
- onEnable
- onDisable
- onLateUpdate
- onBeforeUpdate
- onCompute
- onGraphic
- onParentChange
- onAddChild
- onRemoveChild
- copyComponent
- beforeDestroy
- destroy
- start
- getJointIndexTable
- addAnimationClip
- getAnimationClip
- getAnimationClips
- getAnimationClipState
- getAnimationClipStates
- pause
- resume
- play
- crossFade
- setAnimIsLoop
- addJointBind
- removeJointBind
- cloneTo
Constructors
constructor
• new SkeletonAnimationComponent(): SkeletonAnimationComponent
Returns
Overrides
Defined in
src/components/SkeletonAnimationComponent.ts:37
Properties
object3D
• object3D: Object3D
= null
owner object3D
Inherited from
Defined in
src/components/ComponentBase.ts:17
isDestroyed
• Optional
isDestroyed: boolean
Inherited from
Defined in
src/components/ComponentBase.ts:38
isPlaying
• isPlaying: boolean
= true
Whether it is playing
Defined in
src/components/SkeletonAnimationComponent.ts:20
timeScale
• timeScale: number
= 1.0
Global animation time scaling
Defined in
src/components/SkeletonAnimationComponent.ts:25
Accessors
eventDispatcher
• get
eventDispatcher(): CEventDispatcher
Returns
Inherited from
ComponentBase.eventDispatcher
Defined in
src/components/ComponentBase.ts:23
• set
eventDispatcher(value
): void
Parameters
Name | Type |
---|---|
value | CEventDispatcher |
Returns
void
Inherited from
ComponentBase.eventDispatcher
Defined in
src/components/ComponentBase.ts:28
isStart
• get
isStart(): boolean
Returns
boolean
Inherited from
ComponentBase.isStart
Defined in
src/components/ComponentBase.ts:40
transform
• get
transform(): Transform
Return the Transform component attached to the Object3D.
Returns
Inherited from
ComponentBase.transform
Defined in
src/components/ComponentBase.ts:47
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:68
• 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:54
currName
• get
currName(): string
The name of the currently playing animation
Returns
string
Defined in
src/components/SkeletonAnimationComponent.ts:48
skeleton
• get
skeleton(): Skeleton
Skeleton data
Returns
Skeleton
Defined in
src/components/SkeletonAnimationComponent.ts:70
• set
skeleton(value
): void
Skeleton data
Parameters
Name | Type |
---|---|
value | Skeleton |
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:58
finalSkeletonPose
• get
finalSkeletonPose(): SkeletonPose
Current final skeleton posture data
Returns
Defined in
src/components/SkeletonAnimationComponent.ts:77
jointMatrixIndexTableBuffer
• get
jointMatrixIndexTableBuffer(): StorageGPUBuffer
Bone matrix index table data
Returns
Defined in
src/components/SkeletonAnimationComponent.ts:84
Methods
init
▸ init(param?
): void
Parameters
Name | Type |
---|---|
param? | any |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:112
stop
▸ stop(): void
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:114
onEnable
▸ onEnable(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:115
onDisable
▸ onDisable(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:116
onLateUpdate
▸ onLateUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:118
onBeforeUpdate
▸ onBeforeUpdate(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:119
onCompute
▸ onCompute(view?
, command?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
command? | GPUCommandEncoder |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:120
onGraphic
▸ onGraphic(view?
): any
Parameters
Name | Type |
---|---|
view? | View3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:121
onParentChange
▸ onParentChange(lastParent?
, currentParent?
): any
Parameters
Name | Type |
---|---|
lastParent? | Object3D |
currentParent? | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:122
onAddChild
▸ onAddChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:123
onRemoveChild
▸ onRemoveChild(child
): any
Parameters
Name | Type |
---|---|
child | Object3D |
Returns
any
Inherited from
Defined in
src/components/ComponentBase.ts:124
copyComponent
▸ copyComponent(from
): this
Parameters
Name | Type |
---|---|
from | this |
Returns
this
Inherited from
Defined in
src/components/ComponentBase.ts:133
beforeDestroy
▸ beforeDestroy(force?
): void
before release this component, object refrences are not be set null now.
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:200
destroy
▸ destroy(force?
): void
release this component
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void
Inherited from
Defined in
src/components/ComponentBase.ts:207
start
▸ start(): void
Returns
void
Overrides
Defined in
src/components/SkeletonAnimationComponent.ts:41
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:93
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:107
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:124
getAnimationClips
▸ getAnimationClips(): SkeletonAnimationClip
[]
Gets all animation clip data objects
Returns
SkeletonAnimationClip
[]
Animation clip data object
Defined in
src/components/SkeletonAnimationComponent.ts:136
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:145
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:156
pause
▸ pause(): void
stop playing
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:163
resume
▸ resume(): void
Resume playback
Returns
void
Defined in
src/components/SkeletonAnimationComponent.ts:170
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:181
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:211
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:251
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:262
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:274
cloneTo
▸ cloneTo(obj
): void
Clones the current component to the specified object
Parameters
Name | Type | Description |
---|---|---|
obj | Object3D | target object |
Returns
void