sync clean up
[vg.git] / vg_m.h
diff --git a/vg_m.h b/vg_m.h
index 7403320df29eb5d3ba2d8a0c5f778172d43c4a2c..703c5e5823b4bc0c459c445a06b069f6ada1dceb 100644 (file)
--- a/vg_m.h
+++ b/vg_m.h
@@ -880,6 +880,21 @@ static inline int box_overlap( boxf a, boxf b )
    ;
 }
 
+static int box_within( boxf greater, boxf lesser )
+{
+   v3f a, b;
+   v3_sub( lesser[0], greater[0], a );
+   v3_sub( lesser[1], greater[1], b );
+
+   if( (a[0] >= 0.0f) && (a[1] >= 0.0f) && (a[2] >= 0.0f) &&
+       (b[0] <= 0.0f) && (b[1] <= 0.0f) && (b[2] <= 0.0f) )
+   {
+      return 1;
+   }
+
+   return 0;
+}
+
 static inline void box_init_inf( boxf box )
 {
    v3_fill( box[0],  INFINITY );