diff options
| -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; } |
