diff options
| author | navewindre <boneyaard@gmail.com> | 2025-10-02 06:13:17 +0200 |
|---|---|---|
| committer | navewindre <boneyaard@gmail.com> | 2025-10-02 06:13:17 +0200 |
| commit | db702f3197fadf8529789303a472f503100c715c (patch) | |
| tree | 07d8429a42dc6c74b20a035295d34a8f6a16e92e /src | |
| parent | 0db9c91742a6ab17c3d8a8b86a34392c1797740b (diff) | |
fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/world/trace.cpp | 4 | ||||
| -rw-r--r-- | src/util/aabb.h | 1 |
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 ); |
