mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user