mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-10-01 11:40:44 +08:00
Progress: Interpolation
This commit is contained in:
1 parent
3d8fe0790f
commit
536238e902
4 files changed
+119
-21
No files matched your search
@@ -21,6 +21,14 @@ $(function () {
|
||||
}
|
||||
}
|
||||
return state;
|
||||
},
|
||||
onInterpolation: function (previousState, targetState, amount) {
|
||||
var newState = {};
|
||||
|
||||
newState.x = (previousState.x + amount * (targetState.x - previousState.x));
|
||||
newState.y = (previousState.y + amount * (targetState.y - previousState.y));
|
||||
|
||||
return newState;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user