Class: EntityAnimationPlayer
Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:37
Poses part groups from keyframe animations: every update restores the default pose of each animated part, then adds weighted sampled offsets to its position, Euler angles and scale. It owns no timer; the owner advances it.
Constructors
Constructor
new EntityAnimationPlayer(): EntityAnimationPlayer;Returns
EntityAnimationPlayer
Accessors
animation
Get Signature
get animation(): EntityAnimation | undefined;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:46
Returns
EntityAnimation | undefined
animations
Get Signature
get animations(): readonly EntityAnimation[];Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:50
Returns
readonly EntityAnimation[]
time
Get Signature
get time(): number;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:58
Returns
number
weights
Get Signature
get weights(): readonly number[];Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:54
Returns
readonly number[]
Methods
advance()
advance(deltaSeconds): boolean;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:140
Advances playback by elapsed seconds multiplied by the speed passed to play.
Parameters
| Parameter | Type |
|---|---|
deltaSeconds | number |
Returns
boolean
clear()
clear(): void;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:123
Forgets the animation without touching the parts, for parts that no longer exist.
Returns
void
play()
play(
layers,
animation,
options?,
poses?
): void;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:66
Starts an animation on matching named parts. Supplied baked poses are the baseline for offsets; without them, the current pose is used. Stopping restores the pose from before playback.
Parameters
| Parameter | Type |
|---|---|
layers | Object3D<Object3DEventMap>[] |
animation | EntityAnimation |
options | EntityAnimationOptions |
poses? | ReadonlyMap<Object3D<Object3DEventMap>, { offset: [number, number, number]; rotation: [number, number, number]; scale?: [number, number, number]; }> |
Returns
void
playAnimations()
playAnimations(
layers,
animations,
options?,
poses?
): void;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:75
Starts clips on matching parts with a shared clock. Weighted offsets add to the supplied baked poses or, without poses, to each animated part's pose when playback starts.
Parameters
| Parameter | Type |
|---|---|
layers | Object3D<Object3DEventMap>[] |
animations | readonly EntityAnimation[] |
options | EntityAnimationOptions |
poses? | ReadonlyMap<Object3D<Object3DEventMap>, { offset: [number, number, number]; rotation: [number, number, number]; scale?: [number, number, number]; }> |
Returns
void
setTime()
setTime(seconds): boolean;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:132
Applies the pose at an absolute playback time. Returns false when no clip is active.
Parameters
| Parameter | Type |
|---|---|
seconds | number |
Returns
boolean
setWeights()
setWeights(weights): boolean;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:145
Changes weights in clip order and reapplies the current time without restarting playback.
Parameters
| Parameter | Type |
|---|---|
weights | readonly number[] |
Returns
boolean
stop()
stop(): boolean;Defined in: packages/minerender/src/entity/scene/EntityAnimationPlayer.ts:111
Restores the poses from before playback. Returns whether an animation was active.
Returns
boolean