Last active
October 29, 2025 04:51
-
-
Save idettman/bc793561247c8435f6fbe46bcc8a98b8 to your computer and use it in GitHub Desktop.
Smooth mouse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| distance you are computing is NOT used. (in fact only to see if we get less than a distance of 1, which can be done much easier/faster). | |
| The value (v) that we want to become target value (tv) Choose k, the proportion ( within [ 0 ; 1.0 ] ) of the actual value you want to keep, the rest you will update. | |
| For example if you choose keep 90% and you change 10% for each movement, then in 10 frames you reached goal. | |
| v = k * v + (1 - k ) * tv; | |
| expl : v = 0.9 * v + 0.1 * tv; | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment