lerp javascript
function lerp(a, b, t) {
return (1 - t) * a + t * b;
}
lerp javascript
function lerp(a, b, t) {
return (1 - t) * a + t * b;
}
javascript lerp
export function lerp(v0, v1, amt, maxMove = 0, minDiff = 0.0001) {
let diff = v1 - v0;
if (maxMove > 0) {
diff = Math.min(diff, maxMove);
diff = Math.max(diff, -maxMove);
}
if (Math.abs(diff) < minDiff) {
return v1;
}
return v0 + diff * amt;
};
export default lerp;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us