File tree Expand file tree Collapse file tree 3 files changed +7
-25
lines changed Expand file tree Collapse file tree 3 files changed +7
-25
lines changed Original file line number Diff line number Diff line change @@ -379,15 +379,9 @@ THREE.Vector2.prototype = {
379
379
380
380
} ,
381
381
382
- setLength : function ( l ) {
382
+ setLength : function ( length ) {
383
383
384
- var oldLength = this . length ( ) ;
385
-
386
- if ( oldLength !== 0 && l !== oldLength ) {
387
-
388
- this . multiplyScalar ( l / oldLength ) ;
389
-
390
- }
384
+ this . multiplyScalar ( length / this . length ( ) ) ;
391
385
392
386
return this ;
393
387
Original file line number Diff line number Diff line change @@ -584,15 +584,9 @@ THREE.Vector3.prototype = {
584
584
585
585
} ,
586
586
587
- setLength : function ( l ) {
587
+ setLength : function ( length ) {
588
588
589
- var oldLength = this . length ( ) ;
590
-
591
- if ( oldLength !== 0 && l !== oldLength ) {
592
-
593
- this . multiplyScalar ( l / oldLength ) ;
594
-
595
- }
589
+ this . multiplyScalar ( length / this . length ( ) ) ;
596
590
597
591
return this ;
598
592
@@ -701,7 +695,7 @@ THREE.Vector3.prototype = {
701
695
702
696
angleTo : function ( v ) {
703
697
704
- var theta = this . dot ( v ) / ( Math . sqrt ( this . lengthSq ( ) * v . lengthSq ( ) ) ) ;
698
+ var theta = this . dot ( v ) / Math . sqrt ( this . lengthSq ( ) * v . lengthSq ( ) ) ;
705
699
706
700
// clamp, to handle numerical problems
707
701
Original file line number Diff line number Diff line change @@ -589,15 +589,9 @@ THREE.Vector4.prototype = {
589
589
590
590
} ,
591
591
592
- setLength : function ( l ) {
592
+ setLength : function ( length ) {
593
593
594
- var oldLength = this . length ( ) ;
595
-
596
- if ( oldLength !== 0 && l !== oldLength ) {
597
-
598
- this . multiplyScalar ( l / oldLength ) ;
599
-
600
- }
594
+ this . multiplyScalar ( length / this . length ( ) ) ;
601
595
602
596
return this ;
603
597
You can’t perform that action at this time.
0 commit comments