dromara / newcar

🪢A modern animation engine for JavaScript ecosystem based on Skia (canvaskit-wasm)
https://newcarjs.org
Apache License 2.0
685 stars 34 forks source link

Consider add `fps` again #45

Closed wgxh-cli closed 4 months ago

wgxh-cli commented 4 months ago

Unit system cannot hold without a precise definition of fps, otherwise, one shall be confused with how many frames to advance within a so-called "unit".

wgxh-cli commented 4 months ago

In addition, unit system lies on Scene rather than App, because animations are defined on Scene rather than App and therefore the unit they used should be determined that time, with respect to this issue.

sheepbox8646 commented 4 months ago

You should do this under the rule that don't make breaking change! Please add back unit

wgxh-cli commented 4 months ago

Breaking changes should be allowed when needed

Generally speaking, When playing animations, elapsed should be advanced by 1 each time called update, rather than set directly by physical time elapsed.

Current implementation take the fps as default as 1000 per second, that is 1 per millisecond, but actually not every frame take time exactly as 1 milisecond