Skip to content

@modoki/engine / index / applyClipAtTime

Function: applyClipAtTime() ​

applyClipAtTime(world, rootId, clip, time, index?): number

Sample every track of clip at time and write the values onto the bound entities under rootId. Pass a prebuilt index (from buildEntityIndex) when posing many animators in one frame to avoid rebuilding it per call. Returns the number of tracks applied (useful for tests / "clip not loaded yet" diagnostics). NOTE: not re-entrant — uses a shared module-scope batch map drained before return.

Parameters ​

world ​

World

rootId ​

number

clip ​

AnimationClipDef

time ​

number

index? ​

EntityIndex

Returns ​

number

Built with Modoki.