Forráskód Böngészése

temp fix for sandbox

David Catuhe 7 éve
szülő
commit
e2f3ad254c
2 módosított fájl, 16 hozzáadás és 16 törlés
  1. 13 13
      loaders/src/glTF/2.0/babylon.glTFLoader.ts
  2. 3 3
      sandbox/index.js

+ 13 - 13
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -85,7 +85,7 @@ module BABYLON.GLTF2 {
 
         // IE 11 Compatibility.
         private static _progressEventFactory: (name: string, data: IProgressEventData) => ProgressEvent;
-        
+
         private static _createProgressEventByConstructor(name: string, data: IProgressEventData): ProgressEvent {
             return new ProgressEvent(name, data);
         }
@@ -320,8 +320,8 @@ module BABYLON.GLTF2 {
             switch (this._parent.coordinateSystemMode) {
                 case GLTFLoaderCoordinateSystemMode.AUTO: {
                     if (!this._babylonScene.useRightHandedSystem) {
-                        this._rootNode.rotation = [ 0, 1, 0, 0 ];
-                        this._rootNode.scale = [ 1, 1, -1 ];
+                        this._rootNode.rotation = [0, 1, 0, 0];
+                        this._rootNode.scale = [1, 1, -1];
                         this._loadTransform(this._rootNode);
                     }
                     break;
@@ -474,7 +474,7 @@ module BABYLON.GLTF2 {
                 };
             });
 
-            if (primitives.length === 1) {  
+            if (primitives.length === 1) {
                 const primitive = primitives[0];
                 if (primitive.material == null) {
                     node.babylonMesh.material = this._getDefaultMaterial();
@@ -484,14 +484,14 @@ module BABYLON.GLTF2 {
                     if (!material) {
                         throw new Error(context + ": Failed to find material " + primitive.material);
                     }
-    
+
                     this._loadMaterial("#/materials/" + material.index, material, (babylonMaterial, isNew) => {
                         if (isNew && this._parent.onMaterialLoaded) {
                             this._parent.onMaterialLoaded(babylonMaterial);
                         }
                         node.babylonMesh.material = babylonMaterial;
-                    }); 
-                } 
+                    });
+                }
             }
             else {
                 const multiMaterial = new MultiMaterial(node.babylonMesh.name, this._babylonScene);
@@ -499,7 +499,7 @@ module BABYLON.GLTF2 {
                 const subMaterials = multiMaterial.subMaterials;
                 for (let index = 0; index < primitives.length; index++) {
                     const primitive = primitives[index];
-    
+
                     if (primitive.material == null) {
                         subMaterials[index] = this._getDefaultMaterial();
                     }
@@ -508,12 +508,12 @@ module BABYLON.GLTF2 {
                         if (!material) {
                             throw new Error(context + ": Failed to find material " + primitive.material);
                         }
-    
+
                         this._loadMaterial("#/materials/" + material.index, material, (babylonMaterial, isNew) => {
                             if (isNew && this._parent.onMaterialLoaded) {
                                 this._parent.onMaterialLoaded(babylonMaterial);
                             }
-    
+
                             subMaterials[index] = babylonMaterial;
                         });
                     }
@@ -806,7 +806,7 @@ module BABYLON.GLTF2 {
                             // Tangent data for morph targets is stored as xyz delta.
                             // The vertexData.tangent is stored as xyzw.
                             // So we need to skip every fourth vertexData.tangent.
-                            for (let i = 0, j = 0; i < values.length; i++, j++) {
+                            for (let i = 0, j = 0; i < values.length; i++ , j++) {
                                 values[i] += vertexData.tangents![j];
                                 if ((i + 1) % 3 == 0) {
                                     j++;
@@ -1349,7 +1349,7 @@ module BABYLON.GLTF2 {
             this._loaderTrackers.push(tracker);
 
             this._addLoaderPendingData(tracker);
-            
+
             action();
 
             this._removeLoaderPendingData(tracker);
@@ -1653,7 +1653,7 @@ module BABYLON.GLTF2 {
             }
         }
 
-        private static _AssignIndices(array?: Array<{index: number}>): void {
+        private static _AssignIndices(array?: Array<{ index: number }>): void {
             if (array) {
                 for (let index = 0; index < array.length; index++) {
                     array[index].index = index;

+ 3 - 3
sandbox/index.js

@@ -39,7 +39,7 @@ if (BABYLON.Engine.isSupported()) {
 
         if (plugin.name === "gltf" && plugin instanceof BABYLON.GLTFFileLoader) {
             plugin.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.ALL;
-            plugin.compileMaterials = true;
+            //  plugin.compileMaterials = true;
         }
     });
 
@@ -100,7 +100,7 @@ if (BABYLON.Engine.isSupported()) {
             currentScene.activeCamera.pinchDeltaPercentage = 0.01;
         }
 
-        currentScene.activeCamera.attachControl(canvas); 
+        currentScene.activeCamera.attachControl(canvas);
 
         // Environment
         if (currentPluginName === "gltf") {
@@ -236,7 +236,7 @@ if (BABYLON.Engine.isSupported()) {
     }
 }
 
-function sizeScene () {
+function sizeScene() {
     let divInspWrapper = document.getElementsByClassName('insp-wrapper')[0];
     if (divInspWrapper) {
         let divFooter = document.getElementsByClassName('footer')[0];