Browse Source

Merge pull request #11819 from casawa/patch-1

Fix sphere's intersectsPlane method
Mr.doob 8 years ago
parent
commit
da2ae7c7df
1 changed files with 1 additions and 9 deletions
  1. 1 9
      src/math/Sphere.js

+ 1 - 9
src/math/Sphere.js

@@ -107,15 +107,7 @@ Object.assign( Sphere.prototype, {
 
 
 	intersectsPlane: function ( plane ) {
 	intersectsPlane: function ( plane ) {
 
 
-		// We use the following equation to compute the signed distance from
-		// the center of the sphere to the plane.
-		//
-		// distance = q * n - d
-		//
-		// If this distance is greater than the radius of the sphere,
-		// then there is no intersection.
-
-		return Math.abs( this.center.dot( plane.normal ) - plane.constant ) <= this.radius;
+		return Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius;
 
 
 	},
 	},