Browse Source

Adding checkNearFar on Frustum.hx hasBounds.

clementlandrin 1 year ago
parent
commit
872fe69862
1 changed files with 6 additions and 4 deletions
  1. 6 4
      h3d/col/Frustum.hx

+ 6 - 4
h3d/col/Frustum.hx

@@ -122,10 +122,12 @@ class Frustum {
 			return false;
 		if( b.testPlane(pbottom) < 0 )
 			return false;
-		if( b.testPlane(pnear) < 0 )
-			return false;
-		if( b.testPlane(pfar) < 0 )
-			return false;
+		if ( checkNearFar ) {
+			if( b.testPlane(pnear) < 0 )
+				return false;
+			if( b.testPlane(pfar) < 0 )
+				return false;
+		}
 		return true;
 	}