Procházet zdrojové kódy

freeze static objects

menduz před 7 roky
rodič
revize
62e3667134
1 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. 5 5
      src/Animations/babylon.runtimeAnimation.ts

+ 5 - 5
src/Animations/babylon.runtimeAnimation.ts

@@ -3,19 +3,19 @@
     // Static values to help the garbage collector
     // Static values to help the garbage collector
 
 
     // Quaternion
     // Quaternion
-    const _staticOffsetValueQuaternion: Readonly<Quaternion> = new Quaternion(0, 0, 0, 0);
+    const _staticOffsetValueQuaternion: Readonly<Quaternion> = Object.freeze(new Quaternion(0, 0, 0, 0));
 
 
     // Vector3
     // Vector3
-    const _staticOffsetValueVector3: Readonly<Vector3> = Vector3.Zero();
+    const _staticOffsetValueVector3: Readonly<Vector3> = Object.freeze(Vector3.Zero());
 
 
     // Vector2
     // Vector2
-    const _staticOffsetValueVector2: Readonly<Vector2> = Vector2.Zero();
+    const _staticOffsetValueVector2: Readonly<Vector2> = Object.freeze(Vector2.Zero());
 
 
     // Size
     // Size
-    const _staticOffsetValueSize: Readonly<Size> = Size.Zero();
+    const _staticOffsetValueSize: Readonly<Size> = Object.freeze(Size.Zero());
 
 
     // Color3
     // Color3
-    const _staticOffsetValueColor3: Readonly<Color3> = Color3.Black();
+    const _staticOffsetValueColor3: Readonly<Color3> = Object.freeze(Color3.Black());
 
 
     /**
     /**
      * Defines a runtime animation
      * Defines a runtime animation