Browse Source

Suggested memory tweak for Plane.applyMatrix4

Greg Tatum 11 years ago
parent
commit
49fa467533
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/math/Plane.js

+ 2 - 1
src/math/Plane.js

@@ -180,12 +180,13 @@ THREE.Plane.prototype = {
 
 		var v1 = new THREE.Vector3();
 		var v2 = new THREE.Vector3();
+		var m1 = new THREE.Matrix3()
 
 		return function ( matrix, optionalNormalMatrix ) {
 
 			// compute new normal based on theory here:
 			// http://www.songho.ca/opengl/gl_normaltransform.html
-			optionalNormalMatrix = optionalNormalMatrix || new THREE.Matrix3().getNormalMatrix( matrix );
+			optionalNormalMatrix = optionalNormalMatrix || m1.getNormalMatrix( matrix );
 			var newNormal = v1.copy( this.normal ).applyMatrix3( optionalNormalMatrix );
 
 			var newCoplanarPoint = this.coplanarPoint( v2 );