diff options
Diffstat (limited to 'src/game/world/bsp.h')
| -rw-r--r-- | src/game/world/bsp.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/game/world/bsp.h b/src/game/world/bsp.h index 8892108..3b84e07 100644 --- a/src/game/world/bsp.h +++ b/src/game/world/bsp.h @@ -125,6 +125,16 @@ inline VEC3 bsp_face_get_normal( BSP_FACE* f ){ return vec_normalize( vec_cross( v1 - v0, v2 - v0 ) ); } +inline U8 bsp_face_is_axis_aligned( BSP_FACE* f ) { + VEC3 n = bsp_face_get_normal( f ); + for( U32 i = 0; i < 3; ++i ) { + if( n[i] && fabsf( n[i] ) != 1.f ) + return 0; + } + + return 1; +} + inline void bsp_face_calc_extents( BSP_FACE* f ) { VEC3 mins{ +INFINITY, +INFINITY, +INFINITY }, maxs{ -INFINITY, -INFINITY, -INFINITY }; for( U32 i = 0; i < f->verts.size; ++i ) { |
