@huukhanhnguyen/model / lanes/animations/animation
lanes/animations/animation
AnimationPlayer
Constructors
Constructor
new AnimationPlayer(
model):AnimationPlayer
Parameters
model
Returns
model
readonlymodel:PlayerModel
onStateChange
onStateChange: (() =>
void) |null=null
UI hook — fired whenever playing flips (including self-finish).
playing
playing:
boolean=false
Accessors
hasAnimation
Get Signature
get hasAnimation():
boolean
Returns
boolean
Methods
seek()
seek(
time):void
Scrub to time seconds. Deterministic.
Parameters
time
number
Returns
void
stop()
stop():
void
Returns
void
toggleAll()
toggleAll():
void
Global Play button — every animated parameter on the shared clock.
Returns
void
toggleParameters()
toggleParameters(
nodes):void
Interact-tool click — just the picked parameters, same shared clock.
Parameters
nodes
Returns
void
animatedParameters()
animatedParameters(
model):ParameterNode[]
Recursively collect animated parameters (header containers are display grouping).
Parameters
model
Returns
animatedParametersFor()
animatedParametersFor(
model,nodeKey):ParameterNode[]
Interact-tool click resolution: the animated parameters referenced by any expression inside the subtree of the node keyed nodeKey — click the door, only the door's openAngle runs. A model with a single animated parameter resolves to it regardless of what was clicked.
Parameters
model
nodeKey
string
Returns
groupDuration()
groupDuration(
tracks):number
How long a GROUP of tracks runs — the longest member. One fold, not reimplemented at each call site: AnimationPlayer.run below uses it for whichever tracks are playing this tick, and a clip's length is this over its members (which is exactly why a clip stores no length of its own).
Parameters
tracks
Track[]
Returns
number
trackDuration()
trackDuration(
track):number
Where a track's own domain ends — its last keyframe time. Not a stored field: the samples say it (see evaluate/animation.ts's header).
Parameters
track
Returns
number
trackValueAt()
trackValueAt(
track,time):number
Parameters
track
time
number
Returns
number