From 513bfb8d9cf3c246dd15cf67b8a5ff9c7a6f9afe Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 8 Jun 2008 16:02:52 +0000 Subject: enable client prediction --- src/render/camera.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/render/camera.cc') diff --git a/src/render/camera.cc b/src/render/camera.cc index a879b82..7f1f307 100644 --- a/src/render/camera.cc +++ b/src/render/camera.cc @@ -181,7 +181,7 @@ void Camera::draw(float seconds) camera_target.assign(core::localcontrol()->location()); target_axis.assign(core::localcontrol()->axis()); } - + if (core::localcontrol()->model()) { distance = core::localcontrol()->model()->radius(); } else { @@ -193,7 +193,7 @@ void Camera::draw(float seconds) float angle; float side; float u; - const float cam_speed = seconds; + //const float camspeed = 90.0f * seconds; // 180 degrees per second math::Vector3f n; math::Vector3f p; @@ -215,7 +215,7 @@ void Camera::draw(float seconds) cosangle = math::dotproduct(p, camera_axis.up()); if (fabs(cosangle) + MIN_DELTA < 1 ) { angle = acos(cosangle) * 180.0f / M_PI; - angle = math::sgnf(side) * angle * cam_speed; + angle = math::sgnf(side) * angle * seconds; camera_axis.change_pitch(-angle); } } @@ -237,7 +237,7 @@ void Camera::draw(float seconds) cosangle = math::dotproduct(p, camera_axis.forward()); if (fabs(cosangle) + MIN_DELTA < 1 ) { angle = acos(cosangle) * 180.0f / M_PI; - angle = math::sgnf(side) * angle * cam_speed; + angle = math::sgnf(side) * angle * seconds; camera_axis.change_direction(angle); } } @@ -259,16 +259,16 @@ void Camera::draw(float seconds) cosangle = math::dotproduct(p, camera_axis.up()); if (fabs(cosangle) + MIN_DELTA < 1 ) { angle = acos(cosangle) * 180.0f / M_PI; - angle = math::sgnf(side) * angle * cam_speed; + angle = math::sgnf(side) * angle * seconds; camera_axis.change_roll(angle); } } - if (core::localcontrol()->model()) { +/* if (core::localcontrol()->model()) { camera_target -= (core::localcontrol()->model()->maxbbox().x + 0.1f) * camera_axis.forward(); camera_target += (core::localcontrol()->model()->maxbbox().z + 0.1f ) * camera_axis.up(); } - +*/ } else if (mode() == Free) { camera_axis.assign(target_axis); -- cgit v1.2.3