Selaa lähdekoodia

fix Vector2 normalize() wrong multiplication

jbousquie 9 vuotta sitten
vanhempi
commit
dba9330079
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      src/Math/babylon.math.ts

+ 3 - 3
src/Math/babylon.math.ts

@@ -472,8 +472,8 @@
 
             var num = 1.0 / len;
 
-            this.x *= len;
-            this.y *= len;
+            this.x *= num;
+            this.y *= num;
 
             return this;
         }
@@ -786,7 +786,7 @@
                 return this;
 
             var num = 1.0 / len;
-            
+
             this.x *= num;
             this.y *= num;
             this.z *= num;