diff options
Diffstat (limited to 'src/game/world/trace.cpp')
| -rw-r--r-- | src/game/world/trace.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/world/trace.cpp b/src/game/world/trace.cpp index 2cf2a81..297ca16 100644 --- a/src/game/world/trace.cpp +++ b/src/game/world/trace.cpp @@ -331,13 +331,15 @@ U8 bsp_trace_sweep_aabb_to_leaf_edges( VEC3 n = e->plane.normal; F32 d = e->plane.dist; F32 r = aabb_support_radius( hull, n ); + if( n.z < 0.7f ) // this seems not necessary for ground for some reason lol + r += BSP_EDGE_TOLERANCE; VEC3 dir = trace->in_end - trace->in_start; F32 s0 = vec_dot( n, trace->in_start ) - d; F32 ndir = vec_dot( n, dir ); if( ndir > 0.f ) continue; - if( s0 <= -(r + BSP_TRACE_EPSILON) ) continue; + if( s0 <= -(r) ) continue; F32 t_enter = ( r - s0) / ndir; F32 t_exit = (-r - s0) / ndir; @@ -431,6 +433,7 @@ U8 bsp_trace_sweep_aabb_to_leaf( best = FLT_MAX; U8 ehit = bsp_trace_sweep_aabb_to_leaf_edges( bsp, &edgehit, hull, leaf_idx, &best ); + if( hit || ehit ) { if( ehit && !hit ) *trace = edgehit; |
