From cfa27fd8eed42599195fdff6d7d0e25586e8f18c Mon Sep 17 00:00:00 2001 From: untodesu Date: Thu, 11 Sep 2025 16:00:57 +0500 Subject: Graft header-only math::AABB from qfengine --- game/shared/entity/collision.cc | 6 +++--- game/shared/entity/collision.hh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'game/shared/entity') diff --git a/game/shared/entity/collision.cc b/game/shared/entity/collision.cc index dbe7d30..24f5d49 100644 --- a/game/shared/entity/collision.cc +++ b/game/shared/entity/collision.cc @@ -24,7 +24,7 @@ static int vgrid_collide(const world::Dimension* dimension, int d, entity::Colli const auto& ref_aabb = collision.aabb; const auto current_aabb = ref_aabb.push(transform.local); - auto next_aabb = math::AABB(current_aabb); + auto next_aabb = math::AABBf(current_aabb); next_aabb.min[d] += move; next_aabb.max[d] += move; @@ -60,7 +60,7 @@ static int vgrid_collide(const world::Dimension* dimension, int d, entity::Colli world::voxel_touch latch_touch = world::voxel_touch::NOTHING; glm::fvec3 latch_values = glm::fvec3(0.0f, 0.0f, 0.0f); world::voxel_surface latch_surface = world::voxel_surface::UNKNOWN; - math::AABB latch_vbox; + math::AABBf latch_vbox; for(auto i = dmin; i != dmax; i += ddir) { for(auto j = lpos_min[u]; j < lpos_max[u]; ++j) @@ -79,7 +79,7 @@ static int vgrid_collide(const world::Dimension* dimension, int d, entity::Colli continue; } - math::AABB vbox; + math::AABBf vbox; vbox.min = glm::fvec3(lpos); vbox.max = glm::fvec3(lpos) + 1.0f; diff --git a/game/shared/entity/collision.hh b/game/shared/entity/collision.hh index ca94665..95a9b86 100644 --- a/game/shared/entity/collision.hh +++ b/game/shared/entity/collision.hh @@ -10,7 +10,7 @@ class Dimension; namespace entity { struct Collision final { - math::AABB aabb; + math::AABBf aabb; public: // NOTE: entity::Collision::fixed_update must be called -- cgit