This website works better with JavaScript.
Home
Explore
Help
Sign In
kornerr
/
mjs
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
delta<1
master
Михаил Капелько
3 years ago
parent
e83250e402
commit
f934a4f86c
1 changed files
with
5 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+5
-0
340.слежение.js
+ 5
- 0
340.слежение.js
View File
@@ -118,6 +118,11 @@
}
// Плавно.
function lerp(v0, v1, t) {
// Убираем мельтешение.
var delta = Math.abs(v0 - v1);
if (delta < 1) {
return v0;
}
return v0 * (1 - t) + v1 * t;
}
var x = lerp(x0, x1, скорость);
Write
Preview
Loading…
Cancel
Save