Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-07 18:56:00 +0000
committerStijn Buys <ingar@osirion.org>2008-05-07 18:56:00 +0000
commit421fc71813f08bfe359f9ac7596933a7e4cea6e0 (patch)
tree15b3630488281280d6634804b4a1a41fc402ab0a /src/client/camera.cc
parent91d3a0352088611d3b78d3344b7a2bf2d4955a0a (diff)
client-side frame interpolation: network updates, interpolation of position
Diffstat (limited to 'src/client/camera.cc')
-rw-r--r--src/client/camera.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/camera.cc b/src/client/camera.cc
index 808ff7e..573194a 100644
--- a/src/client/camera.cc
+++ b/src/client/camera.cc
@@ -169,7 +169,13 @@ void draw(float seconds)
if (mode == Overview)
set_mode(Track);
- target.assign(core::localcontrol()->location());
+ if (core::localcontrol()->state()) {
+ // client prediction has not been run yet
+ target = core::localcontrol()->state()->previouslocation()
+ + (core::localcontrol()->location() - core::localcontrol()->state()->previouslocation()) * core::game()->timeoffset();
+ }
+ else
+ target = core::localcontrol()->location();
if (mode == Track) {
if (core::localcontrol()->model())