diff options
| author | aura <nw@moneybot.cc> | 2026-03-04 00:36:03 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-03-04 00:36:03 +0100 |
| commit | 88f960570aed4e12046d8a3c0924129d4fbd96a8 (patch) | |
| tree | f68e7fa2d28577bb9e0a939d70cc7ec029003bfd | |
| parent | 333b457d30966fceb50fd420a559ae7d0aa3dad6 (diff) | |
minor fix pt2
| -rw-r--r-- | src/game/world/trace.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/game/world/trace.cpp b/src/game/world/trace.cpp index 56d0a4b..3207a3e 100644 --- a/src/game/world/trace.cpp +++ b/src/game/world/trace.cpp @@ -203,17 +203,9 @@ inline U8 point_in_inflated_poly( if( dist < -( expand - BSP_EDGE_TOLERANCE ) ) return 0; - U8 isaxis = 0; - for( U32 i = 0; i < 3; ++i ) { - if( norm == vec3_axis[i] || norm == (vec3_axis[i] * -1.f) ) { - isaxis = 1; break; - } - } - - // for non-axis-aligned faces the point of contact is infinitely thin - // todo : this isnt foolproof, check for hit direction if it comes from up/down - // just ignore this, only apply to walls - if( !isaxis ) { + // check if plane is aligned to any hull edge in x/y plane + if( fabsf( norm.x ) >= BSP_TRACE_EPSILON && fabsf( norm.y ) >= BSP_TRACE_EPSILON ) { + // for non-axis-aligned faces the point of contact is infinitely thin if( dist < BSP_EDGE_TOLERANCE ) return 0; } |
