File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -341,15 +341,15 @@ THREE.Matrix4.prototype = {
341
341
342
342
z . subVectors ( eye , target ) . normalize ( ) ;
343
343
344
- if ( z . length ( ) === 0 ) {
344
+ if ( z . lengthSq ( ) === 0 ) {
345
345
346
346
z . z = 1 ;
347
347
348
348
}
349
349
350
350
x . crossVectors ( up , z ) . normalize ( ) ;
351
351
352
- if ( x . length ( ) === 0 ) {
352
+ if ( x . lengthSq ( ) === 0 ) {
353
353
354
354
z . x += 0.0001 ;
355
355
x . crossVectors ( up , z ) . normalize ( ) ;
Original file line number Diff line number Diff line change @@ -701,7 +701,7 @@ THREE.Vector3.prototype = {
701
701
702
702
angleTo : function ( v ) {
703
703
704
- var theta = this . dot ( v ) / ( this . length ( ) * v . length ( ) ) ;
704
+ var theta = this . dot ( v ) / ( Math . sqrt ( this . lengthSq ( ) * v . lengthSq ( ) ) ) ;
705
705
706
706
// clamp, to handle numerical problems
707
707
You can’t perform that action at this time.
0 commit comments