diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/camera.cc | 4 | ||||
-rw-r--r-- | src/core/gameinterface.cc | 2 | ||||
-rw-r--r-- | src/core/gameserver.cc | 3 | ||||
-rw-r--r-- | src/game/ship.cc | 12 |
4 files changed, 7 insertions, 14 deletions
diff --git a/src/client/camera.cc b/src/client/camera.cc index c4a60b0..29310fc 100644 --- a/src/client/camera.cc +++ b/src/client/camera.cc @@ -179,7 +179,7 @@ void draw(float seconds) if (mode == Track) { if (core::localcontrol()->state() && core::localcontrol()->model()) { - target -= (core::localcontrol()->model()->maxbbox().x + 0.1f) * core::localcontrol()->state()->axis().forward(); + target -= (core::localcontrol()->model()->maxbbox().x + 0.15f) * core::localcontrol()->state()->axis().forward(); target += (core::localcontrol()->model()->maxbbox().z + 0.3f ) * core::localcontrol()->state()->axis().up(); @@ -208,7 +208,7 @@ void draw(float seconds) } else if (mode == Cockpit) { if (core::localcontrol()->state() && core::localcontrol()->model()) - target += core::localcontrol()->model()->maxbbox().x * + target += (core::localcontrol()->model()->maxbbox().x+0.05) * core::localcontrol()->state()->axis().forward(); distance = 0.0f; diff --git a/src/core/gameinterface.cc b/src/core/gameinterface.cc index 5e2d428..1f4a5cd 100644 --- a/src/core/gameinterface.cc +++ b/src/core/gameinterface.cc @@ -186,7 +186,7 @@ void GameInterface::update_clientstate(float seconds) if (fabs(side) > 0.00005f) { cosangle = math::dotproduct(p, entity->state()->axis().forward()); - if (fabs(cosangle) < 0.99995f) { + if (fabs(cosangle) < 0.99995f) { angle = acos(cosangle) * 180.0f / M_PI; angle = math::sgnf(side) * angle * seconds / (core::game()->serverframetime() - core::game()->clientframetime()); diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index 3e5241e..5064ccd 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -245,6 +245,7 @@ void GameServer::frame(float seconds) return; server_time += seconds; + server_frametime += seconds; // process incoming network messages if (server_network) { @@ -263,8 +264,6 @@ void GameServer::frame(float seconds) update_clientstate(seconds); } - server_frametime += seconds; - if ((Cvar::sv_dedicated->value() || Cvar::sv_private->value())) { if (core::Cvar::sv_framerate->value()) { float f = 1.0f / core::Cvar::sv_framerate->value(); diff --git a/src/game/ship.cc b/src/game/ship.cc index 5c36205..e864aba 100644 --- a/src/game/ship.cc +++ b/src/game/ship.cc @@ -57,9 +57,7 @@ void Ship::frame(float seconds) current_target_pitch = target_pitch; } - if (fabs(seconds*current_target_pitch) < 0.00005f) { - current_target_pitch = 0.0f; - } else { + if (fabs(seconds*current_target_pitch) > 0.0f) { math::clamp(current_target_pitch, -1.0f, 1.0f); float pitch_offset = seconds * current_target_pitch; entity_axis.change_pitch(360.0f * ship_shipmodel->turnspeed() * pitch_offset); @@ -78,9 +76,7 @@ void Ship::frame(float seconds) current_target_direction = target_direction; } } - if (fabs(seconds*current_target_direction) < 0.00005f) { - current_target_direction = 0.0f; - } else { + if (fabs(seconds*current_target_direction) > 0.0f ) { math::clamp(current_target_direction, -1.0f, 1.0f); float direction_offset = seconds * current_target_direction; entity_axis.change_direction(360.0f * ship_shipmodel->turnspeed() * direction_offset); @@ -97,9 +93,7 @@ void Ship::frame(float seconds) if (current_target_roll < target_roll) current_target_roll = target_roll; } - if (fabs(current_target_roll) < 0.00005f) { - current_target_roll = 0.0f; - } else { + if (fabs(current_target_roll) > 0.0f) { math::clamp(current_target_roll, -1.0f, 1.0f); float roll_offset = seconds * current_target_roll; entity_axis.change_roll(360.0f * ship_shipmodel->turnspeed() * roll_offset); |