summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/world/trace.cpp4
-rw-r--r--src/util/aabb.h1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/game/world/trace.cpp b/src/game/world/trace.cpp
index b3a0041..c8ad3be 100644
--- a/src/game/world/trace.cpp
+++ b/src/game/world/trace.cpp
@@ -200,9 +200,7 @@ inline U8 point_in_inflated_poly(
in = in * -1.0f;
F32 dist = vec_dot( point - a, in );
- VEC2 feet = aabb_extend_at_feet( hull, in );
- F32 pos_r = feet.x, neg_r = feet.y;
- F32 expand = norm.z >= 0 ? neg_r : pos_r;
+ F32 expand = aabb_extend_at_feet( hull, in ).x;
if( dist < -expand - BSP_TRACE_EPSILON )
return 0;
}
diff --git a/src/util/aabb.h b/src/util/aabb.h
index f2fd251..4d74c88 100644
--- a/src/util/aabb.h
+++ b/src/util/aabb.h
@@ -14,6 +14,7 @@ inline F32 aabb_support_radius( const AABB& aabb, const VEC3& dir ) {
return fabsf(dir.x) * half.x + fabsf(dir.y) * half.y + fabsf(dir.z) * half.z;
}
+// returns positive radius in X and negative in Y
inline VEC2 aabb_extend_at_feet( const AABB& aabb, const VEC3& dir ) {
VEC3 half = aabb_half( aabb );