BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
23.19k stars 3.42k forks source link

Modify Calculation of Inertia to Scale Based on Frame Rate #12820

Open PolygonalSun opened 2 years ago

PolygonalSun commented 2 years ago

Currently, we calculate inertial drop-off of camera movements per render frame. What we will need to do to ensure a more uniform rate of movement is to scale our inertial drop-off. The idea would be take our frame rate/animation ratio and use that as our scaling factor.

Potential Issues/Things to look out for: Because some of our cameras have their own ways of handling inertial movement, whatever scaling solution we come up with may need to used with multiple other calculations.

abolog commented 1 year ago

updates?

It would really help to have consistent smooth camera movements across various refresh rate screens.

sebavan commented 1 year ago

cc @PolygonalSun

PolygonalSun commented 12 months ago

Currently in progress (testing changes). Will update when PR is live.

PolygonalSun commented 12 months ago

PR: https://github.com/BabylonJS/Babylon.js/pull/14482

abolog commented 12 months ago

Works perfectly. Just tried it on a 360hz screen, and it's as smooth and consistent as 60hz. Same on touch mobile 120hz. Well done, you're the best ^_^

PolygonalSun commented 11 months ago

PR has been merged.

github-actions[bot] commented 7 months ago

This issue has been automatically staled because it has been inactive for more than 14 days. Please update to "unstale".