Prechádzať zdrojové kódy

Merge branch 'master' into disableMetaKeyCameraMac

David Catuhe 6 rokov pred
rodič
commit
e59e037eb8
29 zmenil súbory, kde vykonal 31206 pridanie a 31202 odobranie
  1. 9331 9331
      Playground/babylon.d.txt
  2. 7 3
      Viewer/src/model/viewerModel.ts
  3. 21754 21754
      dist/preview release/babylon.d.ts
  4. 1 1
      dist/preview release/babylon.js
  5. 25 16
      dist/preview release/babylon.max.js
  6. 25 16
      dist/preview release/babylon.no-module.max.js
  7. 1 1
      dist/preview release/babylon.worker.js
  8. 25 16
      dist/preview release/es6.js
  9. 1 1
      dist/preview release/glTF2Interface/package.json
  10. 1 1
      dist/preview release/gui/babylon.gui.js
  11. 1 1
      dist/preview release/gui/babylon.gui.min.js
  12. 1 1
      dist/preview release/gui/babylon.gui.min.js.map
  13. 2 2
      dist/preview release/gui/package.json
  14. 5 5
      dist/preview release/inspector/package.json
  15. 3 3
      dist/preview release/loaders/package.json
  16. 2 2
      dist/preview release/materialsLibrary/package.json
  17. 2 2
      dist/preview release/postProcessesLibrary/package.json
  18. 2 2
      dist/preview release/proceduralTexturesLibrary/package.json
  19. 3 3
      dist/preview release/serializers/package.json
  20. 1 15
      dist/preview release/viewer/babylon.viewer.d.ts
  21. 1 1
      dist/preview release/viewer/babylon.viewer.js
  22. 2 2
      dist/preview release/viewer/babylon.viewer.max.js
  23. 1 18
      dist/preview release/viewer/babylon.viewer.module.d.ts
  24. 2 0
      dist/preview release/what's new.md
  25. 2 2
      gui/src/2D/controls/container.ts
  26. 2 0
      gui/src/2D/controls/grid.ts
  27. 1 1
      package.json
  28. 1 1
      src/Engine/babylon.engine.ts
  29. 1 1
      src/Mesh/babylon.geometry.ts

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 9331 - 9331
Playground/babylon.d.txt


+ 7 - 3
Viewer/src/model/viewerModel.ts

@@ -196,7 +196,11 @@ export class ViewerModel implements IDisposable {
         if (!mesh.parent) {
             mesh.parent = this._pivotMesh;
         }
-        mesh.receiveShadows = !!this.configuration.receiveShadows;
+
+        if (mesh.getClassName() !== "InstancedMesh") {
+            mesh.receiveShadows = !!this.configuration.receiveShadows;
+        }
+
         this._meshes.push(mesh);
         if (triggerLoaded) {
             return this.onLoadedObservable.notifyObserversWithPromise(this);
@@ -557,7 +561,7 @@ export class ViewerModel implements IDisposable {
                 material.disableLighting = !this._modelConfiguration.material.directEnabled;
             }
             if (this._configurationContainer && this._configurationContainer.reflectionColor) {
-                material.reflectionColor = this._configurationContainer.reflectionColor;
+                material.reflectionColor = this._configurationContainer.reflectionColor.clone();
             }
         }
         else if (material instanceof MultiMaterial) {
@@ -762,4 +766,4 @@ export class ViewerModel implements IDisposable {
         this._animations.length = 0;
         this.rootMesh.dispose(false, true);
     }
-}
+}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 21754 - 21754
dist/preview release/babylon.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/babylon.js


+ 25 - 16
dist/preview release/babylon.max.js

@@ -12974,7 +12974,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.12";
+                return "4.0.0-alpha.14";
             },
             enumerable: true,
             configurable: true
@@ -41687,7 +41687,15 @@ var BABYLON;
                 this.setIndices(indices, null, true);
             }
             else {
+                var needToUpdateSubMeshes = indices.length !== this._indices.length;
+                this._indices = indices;
                 this._engine.updateDynamicIndexBuffer(this._indexBuffer, indices, offset);
+                if (needToUpdateSubMeshes) {
+                    for (var _i = 0, _a = this._meshes; _i < _a.length; _i++) {
+                        var mesh = _a[_i];
+                        mesh._createGlobalSubMesh(true);
+                    }
+                }
             }
         };
         /**
@@ -41711,10 +41719,9 @@ var BABYLON;
             if (totalVertices != undefined) { // including null and undefined
                 this._totalVertices = totalVertices;
             }
-            var meshes = this._meshes;
-            var numOfMeshes = meshes.length;
-            for (var index = 0; index < numOfMeshes; index++) {
-                meshes[index]._createGlobalSubMesh(true);
+            for (var _i = 0, _a = this._meshes; _i < _a.length; _i++) {
+                var mesh = _a[_i];
+                mesh._createGlobalSubMesh(true);
             }
             this.notifyUpdate();
         };
@@ -42020,17 +42027,19 @@ var BABYLON;
             for (kind in this._vertexBuffers) {
                 // using slice() to make a copy of the array and not just reference it
                 var data = this.getVerticesData(kind);
-                if (data instanceof Float32Array) {
-                    vertexData.set(new Float32Array(data), kind);
-                }
-                else {
-                    vertexData.set(data.slice(0), kind);
-                }
-                if (!stopChecking) {
-                    var vb = this.getVertexBuffer(kind);
-                    if (vb) {
-                        updatable = vb.isUpdatable();
-                        stopChecking = !updatable;
+                if (data) {
+                    if (data instanceof Float32Array) {
+                        vertexData.set(new Float32Array(data), kind);
+                    }
+                    else {
+                        vertexData.set(data.slice(0), kind);
+                    }
+                    if (!stopChecking) {
+                        var vb = this.getVertexBuffer(kind);
+                        if (vb) {
+                            updatable = vb.isUpdatable();
+                            stopChecking = !updatable;
+                        }
                     }
                 }
             }

+ 25 - 16
dist/preview release/babylon.no-module.max.js

@@ -12941,7 +12941,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.12";
+                return "4.0.0-alpha.14";
             },
             enumerable: true,
             configurable: true
@@ -41654,7 +41654,15 @@ var BABYLON;
                 this.setIndices(indices, null, true);
             }
             else {
+                var needToUpdateSubMeshes = indices.length !== this._indices.length;
+                this._indices = indices;
                 this._engine.updateDynamicIndexBuffer(this._indexBuffer, indices, offset);
+                if (needToUpdateSubMeshes) {
+                    for (var _i = 0, _a = this._meshes; _i < _a.length; _i++) {
+                        var mesh = _a[_i];
+                        mesh._createGlobalSubMesh(true);
+                    }
+                }
             }
         };
         /**
@@ -41678,10 +41686,9 @@ var BABYLON;
             if (totalVertices != undefined) { // including null and undefined
                 this._totalVertices = totalVertices;
             }
-            var meshes = this._meshes;
-            var numOfMeshes = meshes.length;
-            for (var index = 0; index < numOfMeshes; index++) {
-                meshes[index]._createGlobalSubMesh(true);
+            for (var _i = 0, _a = this._meshes; _i < _a.length; _i++) {
+                var mesh = _a[_i];
+                mesh._createGlobalSubMesh(true);
             }
             this.notifyUpdate();
         };
@@ -41987,17 +41994,19 @@ var BABYLON;
             for (kind in this._vertexBuffers) {
                 // using slice() to make a copy of the array and not just reference it
                 var data = this.getVerticesData(kind);
-                if (data instanceof Float32Array) {
-                    vertexData.set(new Float32Array(data), kind);
-                }
-                else {
-                    vertexData.set(data.slice(0), kind);
-                }
-                if (!stopChecking) {
-                    var vb = this.getVertexBuffer(kind);
-                    if (vb) {
-                        updatable = vb.isUpdatable();
-                        stopChecking = !updatable;
+                if (data) {
+                    if (data instanceof Float32Array) {
+                        vertexData.set(new Float32Array(data), kind);
+                    }
+                    else {
+                        vertexData.set(data.slice(0), kind);
+                    }
+                    if (!stopChecking) {
+                        var vb = this.getVertexBuffer(kind);
+                        if (vb) {
+                            updatable = vb.isUpdatable();
+                            stopChecking = !updatable;
+                        }
                     }
                 }
             }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/babylon.worker.js


+ 25 - 16
dist/preview release/es6.js

@@ -12941,7 +12941,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.12";
+                return "4.0.0-alpha.14";
             },
             enumerable: true,
             configurable: true
@@ -41654,7 +41654,15 @@ var BABYLON;
                 this.setIndices(indices, null, true);
             }
             else {
+                var needToUpdateSubMeshes = indices.length !== this._indices.length;
+                this._indices = indices;
                 this._engine.updateDynamicIndexBuffer(this._indexBuffer, indices, offset);
+                if (needToUpdateSubMeshes) {
+                    for (var _i = 0, _a = this._meshes; _i < _a.length; _i++) {
+                        var mesh = _a[_i];
+                        mesh._createGlobalSubMesh(true);
+                    }
+                }
             }
         };
         /**
@@ -41678,10 +41686,9 @@ var BABYLON;
             if (totalVertices != undefined) { // including null and undefined
                 this._totalVertices = totalVertices;
             }
-            var meshes = this._meshes;
-            var numOfMeshes = meshes.length;
-            for (var index = 0; index < numOfMeshes; index++) {
-                meshes[index]._createGlobalSubMesh(true);
+            for (var _i = 0, _a = this._meshes; _i < _a.length; _i++) {
+                var mesh = _a[_i];
+                mesh._createGlobalSubMesh(true);
             }
             this.notifyUpdate();
         };
@@ -41987,17 +41994,19 @@ var BABYLON;
             for (kind in this._vertexBuffers) {
                 // using slice() to make a copy of the array and not just reference it
                 var data = this.getVerticesData(kind);
-                if (data instanceof Float32Array) {
-                    vertexData.set(new Float32Array(data), kind);
-                }
-                else {
-                    vertexData.set(data.slice(0), kind);
-                }
-                if (!stopChecking) {
-                    var vb = this.getVertexBuffer(kind);
-                    if (vb) {
-                        updatable = vb.isUpdatable();
-                        stopChecking = !updatable;
+                if (data) {
+                    if (data instanceof Float32Array) {
+                        vertexData.set(new Float32Array(data), kind);
+                    }
+                    else {
+                        vertexData.set(data.slice(0), kind);
+                    }
+                    if (!stopChecking) {
+                        var vb = this.getVertexBuffer(kind);
+                        if (vb) {
+                            updatable = vb.isUpdatable();
+                            stopChecking = !updatable;
+                        }
                     }
                 }
             }

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/gui/babylon.gui.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 5 - 5
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,10 +28,10 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12",
-        "babylonjs-gui": "4.0.0-alpha.12",
-        "babylonjs-loaders": "4.0.0-alpha.12",
-        "babylonjs-serializers": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14",
+        "babylonjs-gui": "4.0.0-alpha.14",
+        "babylonjs-loaders": "4.0.0-alpha.14",
+        "babylonjs-serializers": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,8 +27,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "4.0.0-alpha.12",
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs-gltf2interface": "4.0.0-alpha.14",
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,8 +27,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.12",
-        "babylonjs-gltf2interface": "4.0.0-alpha.12"
+        "babylonjs": "4.0.0-alpha.14",
+        "babylonjs-gltf2interface": "4.0.0-alpha.14"
     },
     "engines": {
         "node": "*"

+ 1 - 15
dist/preview release/viewer/babylon.viewer.d.ts

@@ -924,7 +924,7 @@ declare module BabylonViewer {
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 declare module BabylonViewer {
@@ -1558,20 +1558,6 @@ declare module BabylonViewer {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 declare module BabylonViewer {
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-declare module BabylonViewer {
 }
 declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 18
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -985,14 +985,13 @@ declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
 }
 
 declare module 'babylonjs-viewer/optimizer/custom' {
-    import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
     import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
     /**
       *
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 
@@ -1663,22 +1662,6 @@ declare module 'babylonjs-viewer/loader/plugins' {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 
-declare module 'babylonjs-viewer/optimizer/custom/extended' {
-    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';

+ 2 - 0
dist/preview release/what's new.md

@@ -2,6 +2,7 @@
 
 ## Major updates
 
+- New [fancy forum](https://forum.babylonjs.com)!! ([Deltakosh](https://github.com/deltakosh))
 - [Inspector v2.0](https://doc.babylonjs.com/features/playground_debuglayer). [Dev log](https://medium.com/@babylonjs/dev-log-creating-the-new-inspector-b15c50900205) ([Deltakosh](https://github.com/deltakosh))
 - Added support for [parallel shader compilation](https://www.khronos.org/registry/webgl/extensions/KHR_parallel_shader_compile/) ([Deltakosh](https://github.com/deltakosh))
 - Added [Object Based Motion Blur](http://doc.babylonjs.com/how_to/using_motionblurpostprocess) post-process ([julien-moreau](https://github.com/julien-moreau))
@@ -127,6 +128,7 @@
 - Deactivate webvr lasers when not in vr ([TrevorDev](https://github.com/TrevorDev))
 - Update physics position using absolutePosition instead of pivotPosition ([TrevorDev](https://github.com/TrevorDev))
 - Disable camera arrow key controls when the Command key is selected on Mac OS ([kcoley](https://github.com/kcoley))
+- Viewer should not set receiveShadows on an instanced mesh ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

+ 2 - 2
gui/src/2D/controls/container.ts

@@ -414,8 +414,8 @@ export class Container extends Control {
     public dispose() {
         super.dispose();
 
-        for (var control of this._children) {
-            control.dispose();
+        for (var index = this.children.length - 1; index >= 0; index--) {
+            this.children[index].dispose();
         }
     }
 }

+ 2 - 0
gui/src/2D/controls/grid.ts

@@ -467,5 +467,7 @@ export class Grid extends Container {
         for (var control of this._childControls) {
             control.dispose();
         }
+
+        this._childControls = [];
     }
 }

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.0.0-alpha.12",
+    "version": "4.0.0-alpha.14",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -481,7 +481,7 @@ module BABYLON {
          * Returns the current version of the framework
          */
         public static get Version(): string {
-            return "4.0.0-alpha.12";
+            return "4.0.0-alpha.14";
         }
 
         /**

+ 1 - 1
src/Mesh/babylon.geometry.ts

@@ -918,7 +918,7 @@ module BABYLON {
             for (kind in this._vertexBuffers) {
                 // using slice() to make a copy of the array and not just reference it
                 var data = this.getVerticesData(kind);
-                
+
                 if (data) {
                     if (data instanceof Float32Array) {
                         vertexData.set(new Float32Array(<Float32Array>data), kind);