Browse Source

fixed inFrustum

ncannasse 9 năm trước cách đây
mục cha
commit
49f485909b
1 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 6 6
      h3d/col/Sphere.hx

+ 6 - 6
h3d/col/Sphere.hx

@@ -42,27 +42,27 @@ class Sphere implements RayCollider {
 		var p = getCenter();
 		var pl = Plane.frustumLeft(mvp);
 		pl.normalize();
-		if( pl.distance(p) > r )
+		if( pl.distance(p) < -r )
 			return false;
 		pl = Plane.frustumRight(mvp);
 		pl.normalize();
-		if( pl.distance(p) > r )
+		if( pl.distance(p) < -r )
 			return false;
 		pl = Plane.frustumBottom(mvp);
 		pl.normalize();
-		if( pl.distance(p) > r )
+		if( pl.distance(p) < -r )
 			return false;
 		pl = Plane.frustumTop(mvp);
 		pl.normalize();
-		if( pl.distance(p) > r )
+		if( pl.distance(p) < -r )
 			return false;
 		pl = Plane.frustumNear(mvp);
 		pl.normalize();
-		if( pl.distance(p) > r )
+		if( pl.distance(p) < -r )
 			return false;
 		pl = Plane.frustumNear(mvp);
 		pl.normalize();
-		if( pl.distance(p) > r )
+		if( pl.distance(p) < -r )
 			return false;
 		return true;
 	}