diff --git a/include/world/Player.hpp b/include/world/Player.hpp index 9c3b95f5..80b733d1 100644 --- a/include/world/Player.hpp +++ b/include/world/Player.hpp @@ -77,7 +77,7 @@ class Player { bool m_isJumping = false; const float m_gravity = 0.001; - const float m_jumpSpeed = 0.07f; + const float m_jumpSpeed = 0.06f; Inventory m_inventory{9, 4}; }; diff --git a/source/world/Player.cpp b/source/world/Player.cpp index bdca08ca..982aff0a 100644 --- a/source/world/Player.cpp +++ b/source/world/Player.cpp @@ -118,16 +118,16 @@ glm::mat4 Player::updatePosition(const World &world) { // FIXME: Use AABB for more precision void Player::checkCollisions(const World &world) { const float PLAYER_HEIGHT = 1.8; - float m_eyeheight = m_y + PLAYER_HEIGHT - 1; + float eyeheight = m_y + PLAYER_HEIGHT - 1.4; // testPoint(world, glm::vec3(m_x, m_y, m_z), m_velocity); - testPoint(world, glm::vec3(m_x - 0.2, m_eyeheight - PLAYER_HEIGHT - 0.4, m_z - 0.2), m_velocity); - testPoint(world, glm::vec3(m_x + 0.2, m_eyeheight - PLAYER_HEIGHT - 0.4, m_z - 0.2), m_velocity); - testPoint(world, glm::vec3(m_x - 0.2, m_eyeheight - PLAYER_HEIGHT - 0.4, m_z + 0.2), m_velocity); - testPoint(world, glm::vec3(m_x + 0.2, m_eyeheight - PLAYER_HEIGHT - 0.4, m_z + 0.2), m_velocity); - testPoint(world, glm::vec3(m_x - 0.2, m_eyeheight - 0.4, m_z - 0.2), m_velocity); - testPoint(world, glm::vec3(m_x + 0.2, m_eyeheight - 0.4, m_z - 0.2), m_velocity); - testPoint(world, glm::vec3(m_x - 0.2, m_eyeheight - 0.4, m_z + 0.2), m_velocity); - testPoint(world, glm::vec3(m_x + 0.2, m_eyeheight - 0.4, m_z + 0.2), m_velocity); + testPoint(world, glm::vec3(m_x - 0.2, eyeheight - PLAYER_HEIGHT - 0.4, m_z - 0.2), m_velocity); + testPoint(world, glm::vec3(m_x + 0.2, eyeheight - PLAYER_HEIGHT - 0.4, m_z - 0.2), m_velocity); + testPoint(world, glm::vec3(m_x - 0.2, eyeheight - PLAYER_HEIGHT - 0.4, m_z + 0.2), m_velocity); + testPoint(world, glm::vec3(m_x + 0.2, eyeheight - PLAYER_HEIGHT - 0.4, m_z + 0.2), m_velocity); + testPoint(world, glm::vec3(m_x - 0.2, eyeheight - 0.4, m_z - 0.2), m_velocity); + testPoint(world, glm::vec3(m_x + 0.2, eyeheight - 0.4, m_z - 0.2), m_velocity); + testPoint(world, glm::vec3(m_x - 0.2, eyeheight - 0.4, m_z + 0.2), m_velocity); + testPoint(world, glm::vec3(m_x + 0.2, eyeheight - 0.4, m_z + 0.2), m_velocity); } bool passable(const World &world, float x, float y, float z) {