How to use the framesync.currentFrameTime function in framesync

To help you get started, we’ve selected a few framesync examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Popmotion / popmotion / packages / popmotion / src / observers / animated-value.ts View on Github external
update: (v: number) => {
      prev = current;
      current = v;
      lastUpdateTimestamp = currentFrameTime();
      observer.update(v);
    }
  };
github Popmotion / popmotion / packages / popmotion / src / observers / animated-value.ts View on Github external
getVelocity: () => {
      const frame = currentFrameTime();
      const frameDelta = timeSinceLastFrame();
      return (frame - lastUpdateTimestamp <= frameDelta)
        ? speedPerSecond(current - prev, frameDelta)
        : 0;
    },
    update: (v: number) => {