Skip to content

Commit

Permalink
Merge pull request #11457 from 06wj/patch-ray
Browse files Browse the repository at this point in the history
Optimize Ray.applyMatrix4 performance
  • Loading branch information
mrdoob authored Jun 7, 2017
2 parents cd1f9ec + 8743685 commit f68d7f1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/math/Ray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f68d7f1

Please sign in to comment.