mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-06-27 16:10:34 +08:00
Progress: Interpolation
This commit is contained in:
@@ -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