From f864ba1fd399b1a48d2ec474873c5351f3fd23e4 Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Sat, 2 Feb 2013 13:39:18 -0500 Subject: [PATCH] optimize Vector3.reflect, unit tests still pass. --- src/math/Vector3.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/Vector3.js b/src/math/Vector3.js index 607abf000d..853bb32433 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -548,9 +548,9 @@ THREE.extend( THREE.Vector3.prototype, { 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 ); } -- GitLab