From 421fc71813f08bfe359f9ac7596933a7e4cea6e0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 7 May 2008 18:56:00 +0000 Subject: client-side frame interpolation: network updates, interpolation of position --- src/client/camera.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/client') 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()) -- cgit v1.2.3