LiteAnimator beta
Class of @v12-engine/client/lite-views
export declare class AnimatorPlays the animations of one unit: a loop for what it keeps doing, like standing or walking, and on top of that what it does once, like a swing, after which it goes back to the loop.
Members
constructor
constructor(model: ModelDef,
lazy: LazyClips);Constructs a new instance of the Animator class
acting
get acting(): boolean;Whether it plays something once now (a swing, a cast, a clip of the game's) or holds a clip over the whole body
cancelAttack
cancelAttack(): void;Its swing was called off (attackCancelled): the attack cut at once, back to what it keeps doing, blended
clips
get clips(): string[];The names of the clips of the model, for playClip
fall
fall(): void;Knocked down: it falls the way it dies, and lies there until it gets up
find
find(name: string): AnimationGroup | undefined;A clip by what it is asked for as: its name in the file (a name wins, also one that is a kind's word), else a kind ('attack': what the model maps it to, or the usual one), else the end of a name after | (a file that prefixes its clips)
finishWith
finishWith(clip: string): boolean;The swing under way goes on as another clip, from that clip's own blow (its hit mark, ClipDef.marks): a critical strike's flourish (AttackLook.crit). Its blow still lands when the swing's would, and the rest is fitted to what is left of the swing. Whether it did: not while it plays no attack, nor where the model has no such clip
hold
hold(seconds: number): void;Holds it still for seconds, on the screen alone (a hit-stop: the attacker and the struck pause a few frames on a critical strike or a kill); what it plays goes on from there after. The simulation goes on meanwhile: what it does once ends that much later. Another clip played lets it go at once
holding
get holding(): boolean;Whether it is held still now (hold)
keep
keep(kind: Loop, speed?: number, clip?: string): void;Keeps a loop going: of a kind, or a clip by its name (clip) where the model has it. Walking (speed over 0) cuts an attack short at once: before its blow, the swing was called off; after it, its recovery is walked out of
layered
get layered(): boolean;Whether a clip plays on a part of the body now (ClipMask), the loop going on under it
marking
marking(name: string): boolean;Whether a mark of that name is still to come in what it plays once: the blow of the swing under way (what is told of it by onMark, so that it is not told another way as well)
onMark
onMark?: (mark: string, clip: string) => void;Told each mark of the clip being played as it is reached, with its clip: hit when the blow lands, foot when a foot comes down, fx:<name> and the model's own (ClipDef.marks). Loops are told only while the unit is in view
pendingMarks
pendingMarks(): Record<string, number>;Seconds from now to each mark still to come in what it plays once, by name (the first of a name): an effect played on the unit starts its parts that wait for a mark (PartTiming.mark) by them. None while it plays nothing once
play
play(kind: Action, seconds?: number, hit?: number, clip?: string, options?: ActionOptions): void;Plays something once. seconds is how long it may take at most, hit when the moment that matters (the blow landing, the spell going off) comes, in seconds from now: the clip is timed about it (ModelDef.hitAt), its part before fitted to hit, its part after to options.recovery or what is left of seconds. clip names an animation of the file to play instead of the usual one for that kind
playClip
playClip(clip: string, options?: ClipOptions): boolean;Plays a clip of the model by its name, whatever the unit is doing: a cheer, a pose, a gesture in a cutscene. Once, and back to what it keeps doing after; or over and over with loop, until release. Whether the model has such a clip
playingClip
get playingClip(): boolean;Whether it plays a clip on demand now (playClip): once, or over and over
release
release(): void;Lets go of a clip played over and over: back to what the unit keeps doing. One played once goes on (stopClip stops either)
rise
rise(seconds: number): void;Gets up again, the way it fell the other way round, over seconds, and goes on with what it keeps doing
seconds
seconds(clip: string): number | undefined;Seconds a clip takes at normal speed, by its name or kind (as playClip finds it); nothing when the model has none such
setVisible
setVisible(visible: boolean): void;Whether the unit is in view. What cannot be seen is not animated, which is most of the time animations take on a big map; it goes on from where it was once it comes back into view
stand
stand(kind: Loop, clip?: string): void;Stands still in the first frame of the loop keep would play, at once and not blended in: the frame a copy of its crowd stands in (BakedAnimator.stand), so it looks the same at any distance. What it does once still plays, and it stands again after; keep plays the loop again
state
state(): PlayState;Where it is, for a copy of its crowd to go on from (PlayState): what it keeps doing and what it does once, on the whole body. Nothing shows where it plays on a part of the body or holds a clip: a copy cannot
stopClip
stopClip(): boolean;Stops the clip played on demand (playClip), once or over and over, where it is: back to what the unit keeps doing, blended into it, and its onEnd told 'stopped'. What the game plays (a swing, a cast, a death) is not stopped. Whether there was one to stop
swinging
get swinging(): boolean;Whether it is playing an attack now: walking cuts it short
takeOver
takeOver(other: Animator): void;Goes on from where another left off, on another model of the same skeleton (the unit drawn at another level of detail): what it keeps doing, what it does once and how far into it, a clip held, lying, dead. The other is stopped
update
update(dt: number): void;Moves the playing clip on by dt seconds, with the marks it passes and the ending of the clip