Change player position to be at the feet, rather than the head

Note: This breaks the visualization of the other players (PlayerBox).
This commit is contained in:
Pedro Gimeno 2020-02-26 20:30:05 +01:00
parent 101df11c14
commit 89a1520d7c
3 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ ClientPlayer::ClientPlayer(gk::Camera &camera) : m_camera(camera) {
// FIXME: Warning: Duplicated in ServerCommandHandler.hpp
m_x = 14;
m_y = 14;
m_z = 20;
m_z = 18;
m_viewAngleH = -90.;
m_viewAngleV = 0.01;
@ -118,7 +118,7 @@ void ClientPlayer::processInputs() {
}
void ClientPlayer::updatePosition(const ClientWorld &world) {
ClientChunk *chunk = (ClientChunk *)world.getChunkAtBlockPos(m_x, m_y, m_z - 0.2);
ClientChunk *chunk = (ClientChunk *)world.getChunkAtBlockPos(m_x, m_y, m_z);
if (!Config::isFlyModeEnabled && chunk && chunk->isInitialized()) {
m_velocity.z -= m_gravity; // Gravity

View File

@ -28,7 +28,7 @@
#include "Player.hpp"
Player::Player() {
m_hitbox = gk::FloatBox{-0.2, -0.2, -1.8, 0.4, 0.4, 1.8};
m_hitbox = gk::FloatBox{-0.3125, -0.3125, 0, 0.625, 0.625, 1.75};
}
void Player::serialize(sf::Packet &packet) const {

View File

@ -65,7 +65,7 @@ class ServerCommandHandler {
Registry &m_registry;
// FIXME: Warning: Duplicated in ClientPlayer.cpp
gk::Vector3<s32> m_spawnPosition{14, 14, 20};
gk::Vector3<s32> m_spawnPosition{14, 14, 18};
};
#endif // SERVERCOMMANDHANDLER_HPP_