FrameTiming.module
README.md
FrameTiming (module)
The runtime and API of frameTiming: animation held "on ones, twos, threes" per object while the game underneath keeps running at full rate. Games and other packages call it; the HeldFrames and HeldFramesScene components call register / applyDefault for you.
FrameTiming.set(entity, timing)/clear(entity): put an object on a timing (a number of frames, a preset name such as"twos","threes","mixedAction", or{ onFrames, baseRate, fastOnFrames, fastSpeed }) by adding or updating its syncedHeldFramescomponent.FrameTiming.setDefault(timing, { allSkeletons }): the scene-wide timing (a syncedHeldFramesSceneon an entity namedFrameTiming).FrameTiming.holdPose(entity, seconds)/isHolding(entity): a held hit pose, the character's drawing frozen on the frame of a hit while its clips, movement and physics run on (impactFrames'holdPosestyle uses it).FrameTiming.now(),drawing(onFrames, baseRate): the shared animation clock every player steps from.FrameTiming.stats(),timingOf(entity),presets(),afterHold(fn),setActiveInEdit(on): what is held, what it costs, and hooks for tests.
How it holds: a skinned skeleton's AnimGraph keeps ticking every frame but hands its pose to the armature only on a step; a drawn subtree (children with no collider, body, camera or listener) is kept in place in its parent's space by math on the parent's current pose; a mesh on the gameplay entity itself is drawn by a local proxy moved only on steps. Colliders, bodies, scripts and cameras are never touched.