From 8bcbd2729388edc63c82d77d314b583af1447c49 Mon Sep 17 00:00:00 2001 From: untodesu Date: Sun, 14 Sep 2025 19:16:44 +0500 Subject: Cleanup math with qfengine ports again --- game/shared/entity/collision.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'game/shared/entity') diff --git a/game/shared/entity/collision.cc b/game/shared/entity/collision.cc index 6b9f063..d2bc0a9 100644 --- a/game/shared/entity/collision.cc +++ b/game/shared/entity/collision.cc @@ -29,14 +29,14 @@ static int vgrid_collide(const world::Dimension* dimension, int d, entity::Colli next_aabb.max[d] += move; local_pos lpos_min; - lpos_min.x = math::floor(next_aabb.min.x); - lpos_min.y = math::floor(next_aabb.min.y); - lpos_min.z = math::floor(next_aabb.min.z); + lpos_min.x = static_cast(glm::floor(next_aabb.min.x)); + lpos_min.y = static_cast(glm::floor(next_aabb.min.y)); + lpos_min.z = static_cast(glm::floor(next_aabb.min.z)); local_pos lpos_max; - lpos_max.x = math::ceil(next_aabb.max.x); - lpos_max.y = math::ceil(next_aabb.max.y); - lpos_max.z = math::ceil(next_aabb.max.z); + lpos_max.x = static_cast(glm::ceil(next_aabb.max.x)); + lpos_max.y = static_cast(glm::ceil(next_aabb.max.y)); + lpos_max.z = static_cast(glm::ceil(next_aabb.max.z)); // Other axes const int u = (d + 1) % 3; @@ -110,7 +110,7 @@ static int vgrid_collide(const world::Dimension* dimension, int d, entity::Colli if(latch_touch != world::VTOUCH_NONE) { if(latch_touch == world::VTOUCH_BOUNCE) { - const auto move_distance = math::abs(current_aabb.min[d] - next_aabb.min[d]); + const auto move_distance = glm::abs(current_aabb.min[d] - next_aabb.min[d]); const auto threshold = 2.0f * globals::fixed_frametime; if(move_distance > threshold) { -- cgit