Prechádzať zdrojové kódy

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js into effect-error

Popov72 5 rokov pred
rodič
commit
e8496958a3
3 zmenil súbory, kde vykonal 17 pridanie a 9 odobranie
  1. 7 7
      src/Meshes/mesh.ts
  2. 3 1
      src/Misc/deepCopier.ts
  3. 7 1
      src/Misc/tools.ts

+ 7 - 7
src/Meshes/mesh.ts

@@ -407,13 +407,13 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
             }
 
             // Deep copy
-            DeepCopier.DeepCopy(source, this, ["name", "material", "skeleton", "instances", "parent", "uniqueId",
-                "source", "metadata", "hasLODLevels", "geometry", "isBlocked", "areNormalsFrozen",
-                "onBeforeDrawObservable", "onBeforeRenderObservable", "onAfterRenderObservable", "onBeforeDraw",
-                "onAfterWorldMatrixUpdateObservable", "onCollideObservable", "onCollisionPositionChangeObservable", "onRebuildObservable",
-                "onDisposeObservable", "lightSources", "morphTargetManager"
-            ],
-                ["_poseMatrix"]);
+            DeepCopier.DeepCopy(source, this, [
+                "name", "material", "skeleton", "instances", "parent", "uniqueId", "source", "metadata", "morphTargetManager",
+                "hasInstances", "source", "worldMatrixInstancedBuffer", "hasLODLevels", "geometry", "isBlocked", "areNormalsFrozen",
+                "facetNb", "isFacetDataEnabled", "lightSources", "useBones", "isAnInstance", "collider", "edgesRenderer", "forward",
+                "up", "right", "absolutePosition", "absoluteScaling", "absoluteRotationQuaternion", "isWorldMatrixFrozen",
+                "nonUniformScaling", "behaviors", "worldMatrixFromCache"
+            ], ["_poseMatrix"]);
 
             // Source mesh
             this._internalMeshDataInfo._source = source;

+ 3 - 1
src/Misc/deepCopier.ts

@@ -1,4 +1,5 @@
 import { StringTools } from './stringTools';
+import { Logger } from './logger';
 
 var cloneValue = (source: any, destinationObject: any) => {
     if (!source) {
@@ -76,7 +77,8 @@ export class DeepCopier {
                 }
             }
             catch (e) {
-                // Just ignore error (it could be because of a read-only property)
+                // Log a warning (it could be because of a read-only property)
+                Logger.Warn(e.message);
             }
         }
     }

+ 7 - 1
src/Misc/tools.ts

@@ -71,7 +71,13 @@ export class Tools {
      * It can be a string if the expected behavior is identical in the entire app.
      * Or a callback to be able to set it per url or on a group of them (in case of Video source for instance)
      */
-    public static CorsBehavior: string | ((url: string | string[]) => string) = "anonymous";
+    public static get CorsBehavior(): string | ((url: string | string[]) => string) {
+        return FileTools.CorsBehavior;
+    }
+
+    public static set CorsBehavior(value: string | ((url: string | string[]) => string)) {
+        FileTools.CorsBehavior = value;
+    }
 
     /**
      * Gets or sets a global variable indicating if fallback texture must be used when a texture cannot be loaded