You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Animation duration is stretched when using pixijs Ticker (update loop) as driver.
How to reproduce
Create a driver that adds the update method to the ticker on start and removes it to stop.
The ticker will call the update method with delta time. The ticker also uses Performance.now() timer
The text was updated successfully, but these errors were encountered:
farhat-h
changed the title
Popmotion: Weird behavior when using pixi.js Ticker as animation driver
Popmotion: Animation duration stretched when using pixi.js Ticker as animation driver
Dec 12, 2021
I now that this is an old issue and it shouldn't be one to you at this time. But i took a look at your sandbox and played with it. I will leave here a comment for anyone who may stumble upon it later since this is still open.
I am not sure what you meant by "stretched ", but your animation had a little bug which made the animation be inconsistent because the update callback is calculating the circle.x value using the whole window width.
By the way, i didn't know that nice trick with the modulo to achieve that type of animation. It is so logical for this type of situation, once one see it. This really shows how much animation i have made (or not) along the years 😎 Thanks for the tip.
Problem isn't related to popmotion. popmotion's update expects delta time in ms, but pixi's ticker passes to its update something different (meaningless deltaTime measured in frames related to 60fps). Proper delta time hidden in ticker.elapsedMS. See.
Describe the bug
Animation duration is stretched when using pixijs Ticker (update loop) as driver.
How to reproduce
Create a driver that adds the update method to the ticker on start and removes it to stop.
The ticker will call the update method with delta time. The ticker also uses
Performance.now()
timerExpected behaviour
Duration is not stretched.
Link to CodePen example (or similar)
CodeSandbox: https://codesandbox.io/s/ecstatic-fog-6j7xg?file=/src/index.ts:485-630
Device information
In which environment are you reproducing the bug?
Additional context
Permalink to Ticker update method
At first I thought it was a timer resolution issue because multiplying
dt
by 10 and passing it to update made it the issue go away (kinda)but both use
performance.now
i believeThe text was updated successfully, but these errors were encountered: