diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-10 08:06:30 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-11 15:22:35 +0200 |
commit | b318e82356c185b54ef4cd404704422ea24fa277 (patch) | |
tree | 08ef9ba8115ebb97ffebbb035b75e3c3feb42a04 /src/game.cpp | |
parent | 98fa00db12b4658f6bce61f0a2c03c69b963f8f2 (diff) | |
download | minetest-b318e82356c185b54ef4cd404704422ea24fa277.tar.gz minetest-b318e82356c185b54ef4cd404704422ea24fa277.tar.bz2 minetest-b318e82356c185b54ef4cd404704422ea24fa277.zip |
Refactor player's eye position coding
Collect the player's eye position coding in a Player method, and
use it in client to pass the eye position information to the game.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/game.cpp b/src/game.cpp index c4a9aba00..65f160f7b 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1521,7 +1521,8 @@ void the_game( } // Get player position - v3f player_position = client.getPlayerPosition(); + v3f camera_position; + v3f player_position = client.getPlayerPosition(&camera_position); //TimeTaker //timer2("//timer2"); @@ -1581,11 +1582,6 @@ void the_game( v3f camera_direction = v3f(0,0,1); camera_direction.rotateYZBy(camera_pitch); camera_direction.rotateXZBy(camera_yaw); - - // This is at the height of the eyes of the current figure - //v3f camera_position = player_position + v3f(0, BS+BS/2, 0); - // This is more like in minecraft - v3f camera_position = player_position + v3f(0, BS+BS*0.625, 0); camera->setPosition(camera_position); // *100.0 helps in large map coordinates |