diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-06 21:07:11 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-06 21:07:11 +0000 |
commit | 91d3a0352088611d3b78d3344b7a2bf2d4955a0a (patch) | |
tree | 74c0a6adf15ae15aa144f66f20272c1fd58a7db3 /src/client/input.cc | |
parent | 8fefc1d995083f0d4a9873f216ccc6e15688d0a9 (diff) |
client-side frame interpolation: frames and timers
Diffstat (limited to 'src/client/input.cc')
-rw-r--r-- | src/client/input.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/input.cc b/src/client/input.cc index 17ca724..fa23c1a 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -12,6 +12,7 @@ #include "client/camera.h" #include "client/keyboard.h" #include "client/video.h" +#include "math/functions.h" #include "render/text.h" #include "SDL/SDL.h" @@ -231,7 +232,7 @@ void frame(float seconds) break; case SDL_KEYDOWN: if (event.key.keysym.sym == '`' || event.key.keysym.sym == '~') { - last_control = 0; + //last_control = 0; console::toggle(); if (console::visible() && chat::visible()) @@ -298,8 +299,9 @@ void frame(float seconds) local_direction = mouse_direction; local_pitch = mouse_pitch; } else if (camera::mode == camera::Free) { - camera::set_direction(-mouse_direction); - camera::set_pitch(-mouse_pitch); + // squared values to smoothen camera movement + camera::set_direction( -mouse_direction * math::absf(mouse_direction)); + camera::set_pitch(-mouse_pitch * math::absf(mouse_pitch)); } } else { |