Browse Source

Merge pull request #11457 from 06wj/patch-ray

Optimize Ray.applyMatrix4 performance
Mr.doob 8 years ago
parent
commit
f68d7f1ca9
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/math/Ray.js

+ 1 - 3
src/math/Ray.js

@@ -515,10 +515,8 @@ Object.assign( Ray.prototype, {
 
 	applyMatrix4: function ( matrix4 ) {
 
-		this.direction.add( this.origin ).applyMatrix4( matrix4 );
 		this.origin.applyMatrix4( matrix4 );
-		this.direction.sub( this.origin );
-		this.direction.normalize();
+		this.direction.transformDirection( matrix4 );
 
 		return this;