Skip to content

@orillusion/core


Class: AnimatorComponent

Defined in: src/components/anim/AnimatorComponent.ts:16

Skeletal + blend-shape animation driver. Samples property-animation clips to pose an avatar's joints, supports clip cross-fading, stacked override/additive layers, a pluggable state machine, IK solvers and cross-rig retargeting, and dispatches blend-shape (morph) influences.

Extends

Constructors

Constructor

new AnimatorComponent(): AnimatorComponent

Returns

AnimatorComponent

Inherited from

ComponentBase.constructor

Properties

object3D

object3D: Object3D = null

Defined in: src/components/ComponentBase.ts:29

owner object3D

Inherited from

ComponentBase.object3D


isDestroyed

isDestroyed: boolean = false

Defined in: src/components/ComponentBase.ts:77

Inherited from

ComponentBase.isDestroyed


timeScale

timeScale: number = 1.0

Defined in: src/components/anim/AnimatorComponent.ts:18

Global playback speed multiplier applied to all clips and layers.


jointMatrixIndexTableBuffer

jointMatrixIndexTableBuffer: StorageGPUBuffer

Defined in: src/components/anim/AnimatorComponent.ts:20

GPU buffer mapping joints to their world-matrix indices.


playBlendShapeLoop

playBlendShapeLoop: boolean = false

Defined in: src/components/anim/AnimatorComponent.ts:22

Whether the blend-shape (morph) animation loops.


root

root: Object3D

Defined in: src/components/anim/AnimatorComponent.ts:44

Accessors

visibleLayer

Get Signature

get visibleLayer(): number

Defined in: src/components/ComponentBase.ts:46

Composition-layer membership bitmask. The pass / camera / collector filters via

(component.visibleLayer & pass.layerMask & camera.cullingMask) !== 0

Defaults to VisibleLayer.Default (bit 0) so a fresh subclass is visible to passes whose layerMask is VisibleLayer.All (which includes bit 0). Application code can assign project-specific bits (1..31) to organise the scene into composition layers.

Returns

number

Set Signature

set visibleLayer(value): void

Defined in: src/components/ComponentBase.ts:50

Parameters
value

number

Returns

void

Inherited from

ComponentBase.visibleLayer


eventDispatcher

Get Signature

get eventDispatcher(): CEventDispatcher

Defined in: src/components/ComponentBase.ts:63

Returns

CEventDispatcher

Set Signature

set eventDispatcher(value): void

Defined in: src/components/ComponentBase.ts:68

Parameters
value

CEventDispatcher

Returns

void

Inherited from

ComponentBase.eventDispatcher


isStart

Get Signature

get isStart(): boolean

Defined in: src/components/ComponentBase.ts:79

Returns

boolean

Inherited from

ComponentBase.isStart


transform

Get Signature

get transform(): Transform

Defined in: src/components/ComponentBase.ts:89

Return the Transform component attached to the Object3D. Null before the component is attached — addComponent assigns object3D only after construction — so constructor-time callers can probe safely via this.transform?..

Returns

Transform

Inherited from

ComponentBase.transform


enable

Get Signature

get enable(): boolean

Defined in: src/components/ComponentBase.ts:113

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Returns

boolean

Set Signature

set enable(value): void

Defined in: src/components/ComponentBase.ts:96

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Parameters
value

boolean

Returns

void

Inherited from

ComponentBase.enable


avatar

Set Signature

set avatar(name): void

Defined in: src/components/anim/AnimatorComponent.ts:219

Assign the avatar (skeleton) by registered resource name and build its pose.

Parameters
name

string

Returns

void


numJoint

Get Signature

get numJoint(): number

Defined in: src/components/anim/AnimatorComponent.ts:232

Number of joints in the current avatar.

Returns

number


clips

Get Signature

get clips(): PropertyAnimationClip[]

Defined in: src/components/anim/AnimatorComponent.ts:377

The animation clips assigned to this animator.

Returns

PropertyAnimationClip[]

Set Signature

set clips(clips): void

Defined in: src/components/anim/AnimatorComponent.ts:358

Assign the animation clips, building per-clip state and auto-playing the first.

Parameters
clips

PropertyAnimationClip[]

Returns

void


clipsState

Get Signature

get clipsState(): PropertyAnimationClipState[]

Defined in: src/components/anim/AnimatorComponent.ts:382

Per-clip playback state (weights, etc.).

Returns

PropertyAnimationClipState[]


layers

Get Signature

get layers(): readonly AnimationLayer[]

Defined in: src/components/anim/AnimatorComponent.ts:677

All stacked layers (excluding the implicit base layer).

Returns

readonly AnimationLayer[]

Methods

stop()

stop(): void

Defined in: src/components/ComponentBase.ts:163

Returns

void

Inherited from

ComponentBase.stop


onEnable()?

optional onEnable(view?): any

Defined in: src/components/ComponentBase.ts:164

Parameters

view?

View3D

Returns

any

Inherited from

ComponentBase.onEnable


onDisable()?

optional onDisable(view?): any

Defined in: src/components/ComponentBase.ts:165

Parameters

view?

View3D

Returns

any

Inherited from

ComponentBase.onDisable


onLateUpdate()?

optional onLateUpdate(view?): any

Defined in: src/components/ComponentBase.ts:167

Parameters

view?

View3D

Returns

any

Inherited from

ComponentBase.onLateUpdate


onBeforeUpdate()?

optional onBeforeUpdate(view?): any

Defined in: src/components/ComponentBase.ts:168

Parameters

view?

View3D

Returns

any

Inherited from

ComponentBase.onBeforeUpdate


onCompute()?

optional onCompute(view?, command?): any

Defined in: src/components/ComponentBase.ts:169

Parameters

view?

View3D

command?

GPUCommandEncoder

Returns

any

Inherited from

ComponentBase.onCompute


onGraphic()?

optional onGraphic(view?): any

Defined in: src/components/ComponentBase.ts:170

Parameters

view?

View3D

Returns

any

Inherited from

ComponentBase.onGraphic


onParentChange()?

optional onParentChange(lastParent?, currentParent?): any

Defined in: src/components/ComponentBase.ts:171

Parameters

lastParent?

Object3D

currentParent?

Object3D

Returns

any

Inherited from

ComponentBase.onParentChange


onAddChild()?

optional onAddChild(child): any

Defined in: src/components/ComponentBase.ts:172

Parameters

child

Object3D

Returns

any

Inherited from

ComponentBase.onAddChild


onRemoveChild()?

optional onRemoveChild(child): any

Defined in: src/components/ComponentBase.ts:173

Parameters

child

Object3D

Returns

any

Inherited from

ComponentBase.onRemoveChild


copyComponent()

copyComponent(from): this

Defined in: src/components/ComponentBase.ts:182

Parameters

from

this

Returns

this

Inherited from

ComponentBase.copyComponent


beforeDestroy()

beforeDestroy(force?): void

Defined in: src/components/ComponentBase.ts:249

before release this component, object refrences are not be set null now.

Parameters

force?

boolean

Returns

void

Inherited from

ComponentBase.beforeDestroy


destroy()

destroy(force?): void

Defined in: src/components/ComponentBase.ts:256

release this component

Parameters

force?

boolean

Returns

void

Inherited from

ComponentBase.destroy


init()

init(param?): void

Defined in: src/components/anim/AnimatorComponent.ts:64

Collect skinned/morph renderers in the hierarchy and prepare caches.

Parameters

param?

any

Returns

void

Overrides

ComponentBase.init


start()

start(): void

Defined in: src/components/anim/AnimatorComponent.ts:86

Re-parent the skeleton root once the (possibly cloned) hierarchy is wired.

Returns

void

Overrides

ComponentBase.start


playAnim()

playAnim(anim, time?, speed?): void

Defined in: src/components/anim/AnimatorComponent.ts:121

Play a skeleton animation clip immediately.

Parameters

anim

string

clip name

time?

number = 0

start time in seconds

speed?

number = 1

playback speed multiplier

Returns

void


crossFade()

crossFade(anim, crossTime): void

Defined in: src/components/anim/AnimatorComponent.ts:142

Cross-fade from the current clip to another over crossTime seconds.

Parameters

anim

string

destination clip name

crossTime

number

fade duration in seconds

Returns

void


playBlendShape()

playBlendShape(shapeName, time?, speed?): void

Defined in: src/components/anim/AnimatorComponent.ts:182

Play a blend-shape (morph) animation clip.

Parameters

shapeName

string

blend-shape clip name

time?

number = 0

start time in seconds

speed?

number = 1

playback speed multiplier

Returns

void


retargetTo()

retargetTo(target, cfg?): void

Defined in: src/components/anim/AnimatorComponent.ts:199

Drive another animator's skeleton from this one via retargeting. Pass null to stop retargeting.

Parameters

target

AnimatorComponent

the animator to drive, or null to clear

cfg?

RetargeterConfig

optional retargeting configuration

Returns

void


getJointIndexTable()

getJointIndexTable(skinJointsName): number[]

Defined in: src/components/anim/AnimatorComponent.ts:240

Map a list of skin joint names to their avatar bone IDs (-1 if absent).

Parameters

skinJointsName

string[]

joint names in skin order

Returns

number[]


cloneTo()

cloneTo(obj): void

Defined in: src/components/anim/AnimatorComponent.ts:387

Clone this animator (avatar + clips) onto another object.

Parameters

obj

Object3D

Returns

void

Overrides

ComponentBase.cloneTo


onUpdate()

onUpdate(view?): void

Defined in: src/components/anim/AnimatorComponent.ts:420

Per-frame update: advance time, sample clips, apply layers, IK and morphs.

Parameters

view?

View3D

Returns

void

Overrides

ComponentBase.onUpdate


updateBlendShape()

updateBlendShape(attributes, key, value): void

Defined in: src/components/anim/AnimatorComponent.ts:526

Apply a blend-shape influence to all renderers, caching the resolved setter per renderer to avoid per-frame property reflection.

Parameters

attributes

string[]

property path to the setter

key

string

morph target name (cache key)

value

number

influence value in [0,1]

Returns

void


getAnimationClipState()

getAnimationClipState(name): PropertyAnimationClipState

Defined in: src/components/anim/AnimatorComponent.ts:646

Gets the animation clip data object with the specified name

Parameters

name

string

Name of animation

Returns

PropertyAnimationClipState

Animation clip data object


cloneMorphRenderers()

cloneMorphRenderers(): object

Defined in: src/components/anim/AnimatorComponent.ts:656

Group the morph renderers by morph-target key.

Returns

object


getLayer()

getLayer(name): AnimationLayer

Defined in: src/components/anim/AnimatorComponent.ts:673

Get a stacked animation layer by name, or null if absent.

Parameters

name

string

Returns

AnimationLayer


addLayer()

addLayer(layer): AnimationLayer

Defined in: src/components/anim/AnimatorComponent.ts:680

Add a stacked animation layer (ignored if a layer with that name exists).

Parameters

layer

AnimationLayer

Returns

AnimationLayer


removeLayer()

removeLayer(name): void

Defined in: src/components/anim/AnimatorComponent.ts:690

Remove a stacked animation layer by name.

Parameters

name

string

Returns

void


setLayerWeight()

setLayerWeight(name, weight): void

Defined in: src/components/anim/AnimatorComponent.ts:696

Set the blend weight of a named layer.

Parameters

name

string

weight

number

Returns

void


setLayerClip()

setLayerClip(name, clipName, time?, timeScale?): void

Defined in: src/components/anim/AnimatorComponent.ts:708

Set (and start) the clip playing on a named layer.

Parameters

name

string

layer name

clipName

string

clip to play on the layer

time?

number = 0

start time in seconds

timeScale?

number = 1.0

layer-local time scale

Returns

void


setStateMachine()

setStateMachine(fsm): void

Defined in: src/components/anim/AnimatorComponent.ts:896

Attach (or clear) a state machine evaluated each frame before sampling.

Parameters

fsm
evaluate

Returns

void


getStateMachine()

getStateMachine(): object

Defined in: src/components/anim/AnimatorComponent.ts:900

The currently attached state machine, or null.

Returns

object

evaluate()

evaluate(animator, dt): void

Parameters
animator

AnimatorComponent

dt

number

Returns

void


addIK()

addIK(solver): void

Defined in: src/components/anim/AnimatorComponent.ts:909

Register an IK solver, run after layer mixing each frame.

Parameters

solver
solve

Returns

void


removeIK()

removeIK(solver): void

Defined in: src/components/anim/AnimatorComponent.ts:913

Unregister a previously added IK solver.

Parameters

solver
solve

Returns

void


getJointObject()

getJointObject(boneName): Object3D

Defined in: src/components/anim/AnimatorComponent.ts:919

Live joint Object3D by bone name. Used by IK solvers + retargeting.

Parameters

boneName

string

Returns

Object3D


getRestJointObject()

getRestJointObject(bonePath): Object3D

Defined in: src/components/anim/AnimatorComponent.ts:923

Rest-pose (T-pose) joint Object3D by bone path.

Parameters

bonePath

string

Returns

Object3D


getAvatar()

getAvatar(): PrefabAvatarData

Defined in: src/components/anim/AnimatorComponent.ts:927

The current avatar (skeleton) data, or null.

Returns

PrefabAvatarData