Parcourir la source

optimize Vector3.reflect, unit tests still pass.

Ben Houston il y a 13 ans
Parent
commit
f864ba1fd3
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/math/Vector3.js

+ 2 - 2
src/math/Vector3.js

@@ -548,9 +548,9 @@ THREE.extend( THREE.Vector3.prototype, {
 
 
 		return function ( normal ) {
 		return function ( normal ) {
 
 
-		    v1.copy( this ).ortho( normal ).multiplyScalar( -2 );
+		    v1.copy( this ).project( normal ).multiplyScalar( 2 );
 
 
-		    return this.add( v1 );
+		    return this.subVectors( v1, this );
 
 
 		}
 		}
 
 

粤ICP备19079148号