Browse Source

incorporated more feedback from @gero3.

Ben Houston 12 years ago
parent
commit
5d70541b3d
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/core/Plane.js

+ 7 - 4
src/core/Plane.js

@@ -39,8 +39,8 @@ THREE.Plane.prototype = {
 
 	setFromCoplanarPoints: function ( a, b, c ) {
 
-		var normal = new THREE.Vector3().sub( b, a ).cross(
-			new THREE.Vector3().sub( c, a ) );
+		var normal = THREE.Plane3.__v1.sub( b, a ).cross(
+			THREE.Plane3.__v2.sub( c, a ) );
 
 		// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?
 		this.setFromNormalAndCoplanarPoint( normal, a );
@@ -51,7 +51,7 @@ THREE.Plane.prototype = {
 	copy: function ( plane ) {
 
 		this.normal.copy( plane.normal );
-		this.constant = plane.constant.clone();
+		this.constant = new Number( plane.constant );
 
 		return this;
 	},
@@ -118,4 +118,7 @@ THREE.Plane.prototype = {
 		return this;
 	}
 
-};
+};
+
+THREE.Plane.__v1 = new THREE.Vector3();
+THREE.Plane.__v2 = new THREE.Vector3();