浏览代码

Merge branch 'master' into vrHelperDisableColor

Trevor Baron 6 年之前
父节点
当前提交
9618ce8aab
共有 36 个文件被更改,包括 12249 次插入11998 次删除
  1. 5650 5626
      Playground/babylon.d.txt
  2. 5552 5538
      dist/preview release/babylon.d.ts
  3. 1 1
      dist/preview release/babylon.js
  4. 44 9
      dist/preview release/babylon.max.js
  5. 44 9
      dist/preview release/babylon.no-module.max.js
  6. 1 1
      dist/preview release/babylon.worker.js
  7. 44 9
      dist/preview release/es6.js
  8. 1 1
      dist/preview release/glTF2Interface/package.json
  9. 133 122
      dist/preview release/gui/babylon.gui.d.ts
  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. 269 246
      dist/preview release/gui/babylon.gui.module.d.ts
  14. 2 2
      dist/preview release/gui/package.json
  15. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.js.map
  16. 9 7
      dist/preview release/inspector/babylon.inspector.d.ts
  17. 20 16
      dist/preview release/inspector/babylon.inspector.module.d.ts
  18. 5 5
      dist/preview release/inspector/package.json
  19. 3 3
      dist/preview release/loaders/package.json
  20. 2 2
      dist/preview release/materialsLibrary/package.json
  21. 2 2
      dist/preview release/postProcessesLibrary/package.json
  22. 2 2
      dist/preview release/proceduralTexturesLibrary/package.json
  23. 3 3
      dist/preview release/serializers/package.json
  24. 2 2
      dist/preview release/viewer/babylon.viewer.js
  25. 4 4
      dist/preview release/viewer/babylon.viewer.max.js
  26. 2 1
      dist/preview release/what's new.md
  27. 280 280
      gui/src/2D/advancedDynamicTexture.ts
  28. 4 4
      gui/src/2D/controls/control.ts
  29. 1 1
      package.json
  30. 8 1
      src/Behaviors/Mesh/babylon.pointerDragBehavior.ts
  31. 11 0
      src/Culling/Octrees/babylon.octree.ts
  32. 20 0
      src/Culling/Octrees/babylon.octreeBlock.ts
  33. 1 1
      src/Engine/babylon.engine.ts
  34. 9 7
      src/Loading/babylon.sceneLoader.ts
  35. 116 89
      tests/nullEngine/app.js
  36. 二进制
      tests/validation/ReferenceImages/advancedShadows.png

文件差异内容过多而无法显示
+ 5650 - 5626
Playground/babylon.d.txt


文件差异内容过多而无法显示
+ 5552 - 5538
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.js


+ 44 - 9
dist/preview release/babylon.max.js

@@ -12985,7 +12985,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.14";
+                return "4.0.0-alpha.15";
             },
             enumerable: true,
             configurable: true
@@ -79104,18 +79104,20 @@ var BABYLON;
                 name = BABYLON.Tools.GetFilename(rootUrl);
                 rootUrl = BABYLON.Tools.GetFolderPath(rootUrl);
             }
-            else if (sceneFilename instanceof File) {
-                url = rootUrl + sceneFilename.name;
-                name = sceneFilename.name;
-                file = sceneFilename;
+            else if (sceneFilename.lastModified) {
+                var sceneFile = sceneFilename;
+                url = rootUrl + sceneFile.name;
+                name = sceneFile.name;
+                file = sceneFile;
             }
             else {
-                if (sceneFilename.substr(0, 1) === "/") {
+                var filename = sceneFilename;
+                if (filename.substr(0, 1) === "/") {
                     BABYLON.Tools.Error("Wrong sceneFilename parameter");
                     return null;
                 }
-                url = rootUrl + sceneFilename;
-                name = sceneFilename;
+                url = rootUrl + filename;
+                name = filename;
             }
             return {
                 url: url,
@@ -103478,6 +103480,10 @@ var BABYLON;
              * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
              */
             this.useObjectOrienationForDragging = true;
+            /**
+             * Predicate to determine if it is valid to move the object to a new position when it is moved
+             */
+            this.validateDrag = function (targetPosition) { return true; };
             this._tmpVector = new BABYLON.Vector3(0, 0, 0);
             this._alternatePickedPoint = new BABYLON.Vector3(0, 0, 0);
             this._worldDragAxis = new BABYLON.Vector3(0, 0, 0);
@@ -103593,7 +103599,9 @@ var BABYLON;
                     _this._targetPosition.subtractToRef((_this._attachedNode).absolutePosition, _this._tmpVector);
                     _this._tmpVector.scaleInPlace(_this.dragDeltaRatio);
                     (_this._attachedNode).getAbsolutePosition().addToRef(_this._tmpVector, _this._tmpVector);
-                    (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    if (_this.validateDrag(_this._tmpVector)) {
+                        (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    }
                     BABYLON.BoundingBoxGizmo._RestorePivotPoint(_this._attachedNode);
                 }
             });
@@ -106646,6 +106654,16 @@ var BABYLON;
             }
         };
         /**
+         * Remove an element from the octree
+         * @param entry defines the element to remove
+         */
+        Octree.prototype.removeMesh = function (entry) {
+            for (var index = 0; index < this.blocks.length; index++) {
+                var block = this.blocks[index];
+                block.removeEntry(entry);
+            }
+        };
+        /**
          * Selects an array of meshes within the frustum
          * @param frustumPlanes The frustum planes to use which will select all meshes within it
          * @param allowDuplicate If duplicate objects are allowed in the resulting object array
@@ -106837,6 +106855,23 @@ var BABYLON;
             }
         };
         /**
+         * Remove an element from this block
+         * @param entry defines the element to remove
+         */
+        OctreeBlock.prototype.removeEntry = function (entry) {
+            if (this.blocks) {
+                for (var index = 0; index < this.blocks.length; index++) {
+                    var block = this.blocks[index];
+                    block.removeEntry(entry);
+                }
+                return;
+            }
+            var entryIndex = this.entries.indexOf(entry);
+            if (entryIndex > -1) {
+                this.entries.splice(entryIndex, 1);
+            }
+        };
+        /**
          * Add an array of elements to this block
          * @param entries defines the array of elements to add
          */

+ 44 - 9
dist/preview release/babylon.no-module.max.js

@@ -12952,7 +12952,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.14";
+                return "4.0.0-alpha.15";
             },
             enumerable: true,
             configurable: true
@@ -79071,18 +79071,20 @@ var BABYLON;
                 name = BABYLON.Tools.GetFilename(rootUrl);
                 rootUrl = BABYLON.Tools.GetFolderPath(rootUrl);
             }
-            else if (sceneFilename instanceof File) {
-                url = rootUrl + sceneFilename.name;
-                name = sceneFilename.name;
-                file = sceneFilename;
+            else if (sceneFilename.lastModified) {
+                var sceneFile = sceneFilename;
+                url = rootUrl + sceneFile.name;
+                name = sceneFile.name;
+                file = sceneFile;
             }
             else {
-                if (sceneFilename.substr(0, 1) === "/") {
+                var filename = sceneFilename;
+                if (filename.substr(0, 1) === "/") {
                     BABYLON.Tools.Error("Wrong sceneFilename parameter");
                     return null;
                 }
-                url = rootUrl + sceneFilename;
-                name = sceneFilename;
+                url = rootUrl + filename;
+                name = filename;
             }
             return {
                 url: url,
@@ -103445,6 +103447,10 @@ var BABYLON;
              * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
              */
             this.useObjectOrienationForDragging = true;
+            /**
+             * Predicate to determine if it is valid to move the object to a new position when it is moved
+             */
+            this.validateDrag = function (targetPosition) { return true; };
             this._tmpVector = new BABYLON.Vector3(0, 0, 0);
             this._alternatePickedPoint = new BABYLON.Vector3(0, 0, 0);
             this._worldDragAxis = new BABYLON.Vector3(0, 0, 0);
@@ -103560,7 +103566,9 @@ var BABYLON;
                     _this._targetPosition.subtractToRef((_this._attachedNode).absolutePosition, _this._tmpVector);
                     _this._tmpVector.scaleInPlace(_this.dragDeltaRatio);
                     (_this._attachedNode).getAbsolutePosition().addToRef(_this._tmpVector, _this._tmpVector);
-                    (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    if (_this.validateDrag(_this._tmpVector)) {
+                        (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    }
                     BABYLON.BoundingBoxGizmo._RestorePivotPoint(_this._attachedNode);
                 }
             });
@@ -106613,6 +106621,16 @@ var BABYLON;
             }
         };
         /**
+         * Remove an element from the octree
+         * @param entry defines the element to remove
+         */
+        Octree.prototype.removeMesh = function (entry) {
+            for (var index = 0; index < this.blocks.length; index++) {
+                var block = this.blocks[index];
+                block.removeEntry(entry);
+            }
+        };
+        /**
          * Selects an array of meshes within the frustum
          * @param frustumPlanes The frustum planes to use which will select all meshes within it
          * @param allowDuplicate If duplicate objects are allowed in the resulting object array
@@ -106804,6 +106822,23 @@ var BABYLON;
             }
         };
         /**
+         * Remove an element from this block
+         * @param entry defines the element to remove
+         */
+        OctreeBlock.prototype.removeEntry = function (entry) {
+            if (this.blocks) {
+                for (var index = 0; index < this.blocks.length; index++) {
+                    var block = this.blocks[index];
+                    block.removeEntry(entry);
+                }
+                return;
+            }
+            var entryIndex = this.entries.indexOf(entry);
+            if (entryIndex > -1) {
+                this.entries.splice(entryIndex, 1);
+            }
+        };
+        /**
          * Add an array of elements to this block
          * @param entries defines the array of elements to add
          */

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.worker.js


+ 44 - 9
dist/preview release/es6.js

@@ -12952,7 +12952,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "4.0.0-alpha.14";
+                return "4.0.0-alpha.15";
             },
             enumerable: true,
             configurable: true
@@ -79071,18 +79071,20 @@ var BABYLON;
                 name = BABYLON.Tools.GetFilename(rootUrl);
                 rootUrl = BABYLON.Tools.GetFolderPath(rootUrl);
             }
-            else if (sceneFilename instanceof File) {
-                url = rootUrl + sceneFilename.name;
-                name = sceneFilename.name;
-                file = sceneFilename;
+            else if (sceneFilename.lastModified) {
+                var sceneFile = sceneFilename;
+                url = rootUrl + sceneFile.name;
+                name = sceneFile.name;
+                file = sceneFile;
             }
             else {
-                if (sceneFilename.substr(0, 1) === "/") {
+                var filename = sceneFilename;
+                if (filename.substr(0, 1) === "/") {
                     BABYLON.Tools.Error("Wrong sceneFilename parameter");
                     return null;
                 }
-                url = rootUrl + sceneFilename;
-                name = sceneFilename;
+                url = rootUrl + filename;
+                name = filename;
             }
             return {
                 url: url,
@@ -103445,6 +103447,10 @@ var BABYLON;
              * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
              */
             this.useObjectOrienationForDragging = true;
+            /**
+             * Predicate to determine if it is valid to move the object to a new position when it is moved
+             */
+            this.validateDrag = function (targetPosition) { return true; };
             this._tmpVector = new BABYLON.Vector3(0, 0, 0);
             this._alternatePickedPoint = new BABYLON.Vector3(0, 0, 0);
             this._worldDragAxis = new BABYLON.Vector3(0, 0, 0);
@@ -103560,7 +103566,9 @@ var BABYLON;
                     _this._targetPosition.subtractToRef((_this._attachedNode).absolutePosition, _this._tmpVector);
                     _this._tmpVector.scaleInPlace(_this.dragDeltaRatio);
                     (_this._attachedNode).getAbsolutePosition().addToRef(_this._tmpVector, _this._tmpVector);
-                    (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    if (_this.validateDrag(_this._tmpVector)) {
+                        (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    }
                     BABYLON.BoundingBoxGizmo._RestorePivotPoint(_this._attachedNode);
                 }
             });
@@ -106613,6 +106621,16 @@ var BABYLON;
             }
         };
         /**
+         * Remove an element from the octree
+         * @param entry defines the element to remove
+         */
+        Octree.prototype.removeMesh = function (entry) {
+            for (var index = 0; index < this.blocks.length; index++) {
+                var block = this.blocks[index];
+                block.removeEntry(entry);
+            }
+        };
+        /**
          * Selects an array of meshes within the frustum
          * @param frustumPlanes The frustum planes to use which will select all meshes within it
          * @param allowDuplicate If duplicate objects are allowed in the resulting object array
@@ -106804,6 +106822,23 @@ var BABYLON;
             }
         };
         /**
+         * Remove an element from this block
+         * @param entry defines the element to remove
+         */
+        OctreeBlock.prototype.removeEntry = function (entry) {
+            if (this.blocks) {
+                for (var index = 0; index < this.blocks.length; index++) {
+                    var block = this.blocks[index];
+                    block.removeEntry(entry);
+                }
+                return;
+            }
+            var entryIndex = this.entries.indexOf(entry);
+            if (entryIndex > -1) {
+                this.entries.splice(entryIndex, 1);
+            }
+        };
+        /**
          * Add an array of elements to this block
          * @param entries defines the array of elements to add
          */

+ 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.14",
+    "version": "4.0.0-alpha.15",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 133 - 122
dist/preview release/gui/babylon.gui.d.ts

@@ -1,7 +1,6 @@
 /*Babylon.js GUI*/
 // Dependencies for this module:
 //   ../../../../Tools/Gulp/babylonjs
-//   ../../../../Tools/Gulp/2D
 declare module BABYLON.GUI {
 }
 declare module BABYLON.GUI {
@@ -12,8 +11,8 @@ declare module BABYLON.GUI {
 }
 declare module BABYLON.GUI {
     /**
-        * Interface used to define a control that can receive focus
-        */
+     * Interface used to define a control that can receive focus
+     */
     export interface IFocusableControl {
             /**
                 * Function called when the control receives the focus
@@ -29,15 +28,15 @@ declare module BABYLON.GUI {
                 */
             processKeyboard(evt: KeyboardEvent): void;
             /**
-                * Function called to get the list of controls that should not steal the focus from this control
-                * @returns an array of controls
-                */
+             * Function called to get the list of controls that should not steal the focus from this control
+             * @returns an array of controls
+             */
             keepsFocusWith(): BABYLON.Nullable<Control[]>;
     }
     /**
-        * Class used to create texture to support 2D GUI elements
-        * @see http://doc.babylonjs.com/how_to/gui
-        */
+     * Class used to create texture to support 2D GUI elements
+     * @see http://doc.babylonjs.com/how_to/gui
+     */
     export class AdvancedDynamicTexture extends BABYLON.DynamicTexture {
             /** @hidden */
             _rootContainer: Container;
@@ -62,150 +61,158 @@ declare module BABYLON.GUI {
             /** @hidden */
             _linkedControls: Control[];
             /**
-                * BABYLON.Observable event triggered each time an clipboard event is received from the rendering canvas
-                */
+             * BABYLON.Observable event triggered each time an clipboard event is received from the rendering canvas
+             */
             onClipboardObservable: BABYLON.Observable<BABYLON.ClipboardInfo>;
             /**
-                * BABYLON.Observable event triggered each time a pointer down is intercepted by a control
-                */
+             * BABYLON.Observable event triggered each time a pointer down is intercepted by a control
+             */
             onControlPickedObservable: BABYLON.Observable<Control>;
             /**
-                * BABYLON.Observable event triggered before layout is evaluated
-                */
+             * BABYLON.Observable event triggered before layout is evaluated
+             */
             onBeginLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
             /**
-                * BABYLON.Observable event triggered after the layout was evaluated
-                */
+             * BABYLON.Observable event triggered after the layout was evaluated
+             */
             onEndLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
             /**
-                * BABYLON.Observable event triggered before the texture is rendered
-                */
+             * BABYLON.Observable event triggered before the texture is rendered
+             */
             onBeginRenderObservable: BABYLON.Observable<AdvancedDynamicTexture>;
             /**
-                * BABYLON.Observable event triggered after the texture was rendered
-                */
+             * BABYLON.Observable event triggered after the texture was rendered
+             */
             onEndRenderObservable: BABYLON.Observable<AdvancedDynamicTexture>;
             /**
-                * Gets or sets a boolean defining if alpha is stored as premultiplied
-                */
+             * Gets or sets a boolean defining if alpha is stored as premultiplied
+             */
             premulAlpha: boolean;
             /**
-                * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
-                * Useful when you want more antialiasing
-                */
+             * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
+             * Useful when you want more antialiasing
+             */
             renderScale: number;
             /** Gets or sets the background color */
             background: string;
             /**
-                * Gets or sets the ideal width used to design controls.
-                * The GUI will then rescale everything accordingly
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets the ideal width used to design controls.
+             * The GUI will then rescale everything accordingly
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             idealWidth: number;
             /**
-                * Gets or sets the ideal height used to design controls.
-                * The GUI will then rescale everything accordingly
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets the ideal height used to design controls.
+             * The GUI will then rescale everything accordingly
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             idealHeight: number;
             /**
-                * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             useSmallestIdeal: boolean;
             /**
-                * Gets or sets a boolean indicating if adaptive scaling must be used
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets a boolean indicating if adaptive scaling must be used
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             renderAtIdealSize: boolean;
             /**
-                * Gets the underlying layer used to render the texture when in fullscreen mode
-                */
+             * Gets the underlying layer used to render the texture when in fullscreen mode
+             */
             readonly layer: BABYLON.Nullable<BABYLON.Layer>;
             /**
-                * Gets the root container control
-                */
+             * Gets the root container control
+             */
             readonly rootContainer: Container;
             /**
-                * Returns an array containing the root container.
-                * This is mostly used to let the Inspector introspects the ADT
-                * @returns an array containing the rootContainer
-                */
+             * Returns an array containing the root container.
+             * This is mostly used to let the Inspector introspects the ADT
+             * @returns an array containing the rootContainer
+             */
             getChildren(): Array<Container>;
             /**
-                * Will return all controls that are inside this texture
-                * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
-                * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
-                * @return all child controls
-                */
+             * Will return all controls that are inside this texture
+             * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
+             * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
+             * @return all child controls
+             */
             getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
             /**
-                * Gets or sets the current focused control
-                */
+             * Gets or sets the current focused control
+             */
             focusedControl: BABYLON.Nullable<IFocusableControl>;
             /**
-                * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
-                */
+             * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
+             */
             isForeground: boolean;
             /**
-                * Gets or set information about clipboardData
-                */
+             * Gets or set information about clipboardData
+             */
             clipboardData: string;
             /**
-             * Creates a new AdvancedDynamicTexture
-             * @param name defines the name of the texture
-             * @param width defines the width of the texture
-             * @param height defines the height of the texture
-             * @param scene defines the hosting scene
-             * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
-             * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
-             */
+            * Creates a new AdvancedDynamicTexture
+            * @param name defines the name of the texture
+            * @param width defines the width of the texture
+            * @param height defines the height of the texture
+            * @param scene defines the hosting scene
+            * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
+            * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
+            */
             constructor(name: string, width: number | undefined, height: number | undefined, scene: BABYLON.Nullable<BABYLON.Scene>, generateMipMaps?: boolean, samplingMode?: number);
             /**
-                * Get the current class name of the texture useful for serialization or dynamic coding.
-                * @returns "AdvancedDynamicTexture"
-                */
+             * Get the current class name of the texture useful for serialization or dynamic coding.
+             * @returns "AdvancedDynamicTexture"
+             */
             getClassName(): string;
             /**
-                * Function used to execute a function on all controls
-                * @param func defines the function to execute
-                * @param container defines the container where controls belong. If null the root container will be used
-                */
+             * Function used to execute a function on all controls
+             * @param func defines the function to execute
+             * @param container defines the container where controls belong. If null the root container will be used
+             */
             executeOnAllControls(func: (control: Control) => void, container?: Container): void;
             /**
-                * Marks the texture as dirty forcing a complete update
+                * Invalidates a rectangle area on the gui texture
+                * @param minX left most position of the rectangle to invalidate in pixels
+                * @param minY top most position of the rectangle to invalidate in pixels
+                * @param maxX right most position of the rectangle to invalidate in pixels
+                * @param maxY bottom most position of the rectangle to invalidate in pixels
                 */
+            invalidateRect(minX: number, minY: number, maxX: number, maxY: number): void;
+            /**
+             * Marks the texture as dirty forcing a complete update
+             */
             markAsDirty(): void;
             /**
-                * Helper function used to create a new style
-                * @returns a new style
-                * @see http://doc.babylonjs.com/how_to/gui#styles
-                */
+             * Helper function used to create a new style
+             * @returns a new style
+             * @see http://doc.babylonjs.com/how_to/gui#styles
+             */
             createStyle(): Style;
             /**
-                * Adds a new control to the root container
-                * @param control defines the control to add
-                * @returns the current texture
-                */
+             * Adds a new control to the root container
+             * @param control defines the control to add
+             * @returns the current texture
+             */
             addControl(control: Control): AdvancedDynamicTexture;
             /**
-                * Removes a control from the root container
-                * @param control defines the control to remove
-                * @returns the current texture
-                */
+             * Removes a control from the root container
+             * @param control defines the control to remove
+             * @returns the current texture
+             */
             removeControl(control: Control): AdvancedDynamicTexture;
             /**
-                * Release all resources
-                */
+             * Release all resources
+             */
             dispose(): void;
             /** @hidden */
             _getGlobalViewport(scene: BABYLON.Scene): BABYLON.Viewport;
             /**
-                * Get screen coordinates for a vector3
-                * @param position defines the position to project
-                * @param worldMatrix defines the world matrix to use
-                * @returns the projected position
-                */
+             * Get screen coordinates for a vector3
+             * @param position defines the position to project
+             * @param worldMatrix defines the world matrix to use
+             * @returns the projected position
+             */
             getProjectedPosition(position: BABYLON.Vector3, worldMatrix: BABYLON.Matrix): BABYLON.Vector2;
             /** @hidden */
             _changeCursor(cursor: string): void;
@@ -220,23 +227,23 @@ declare module BABYLON.GUI {
             /** Attach to all scene events required to support pointer events */
             attach(): void;
             /**
-                * Register the clipboard Events onto the canvas
-                */
+             * Register the clipboard Events onto the canvas
+             */
             registerClipboardEvents(): void;
             /**
                 * Unregister the clipboard Events from the canvas
                 */
             unRegisterClipboardEvents(): void;
             /**
-                * Connect the texture to a hosting mesh to enable interactions
-                * @param mesh defines the mesh to attach to
-                * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
-                */
+             * Connect the texture to a hosting mesh to enable interactions
+             * @param mesh defines the mesh to attach to
+             * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
+             */
             attachToMesh(mesh: BABYLON.AbstractMesh, supportPointerMove?: boolean): void;
             /**
-                * Move the focus to a specific control
-                * @param control defines the control which will receive the focus
-                */
+             * Move the focus to a specific control
+             * @param control defines the control which will receive the focus
+             */
             moveFocusToControl(control: IFocusableControl): void;
             /**
                 * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
@@ -249,17 +256,17 @@ declare module BABYLON.GUI {
                 */
             static CreateForMesh(mesh: BABYLON.AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean): AdvancedDynamicTexture;
             /**
-                * Creates a new AdvancedDynamicTexture in fullscreen mode.
-                * In this mode the texture will rely on a layer for its rendering.
-                * This allows it to be treated like any other layer.
-                * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
-                * LayerMask is set through advancedTexture.layer.layerMask
-                * @param name defines name for the texture
-                * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
-                * @param scene defines the hsoting scene
-                * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
-                * @returns a new AdvancedDynamicTexture
-                */
+             * Creates a new AdvancedDynamicTexture in fullscreen mode.
+             * In this mode the texture will rely on a layer for its rendering.
+             * This allows it to be treated like any other layer.
+             * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
+             * LayerMask is set through advancedTexture.layer.layerMask
+             * @param name defines name for the texture
+             * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
+             * @param scene defines the hsoting scene
+             * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
+             * @returns a new AdvancedDynamicTexture
+             */
             static CreateFullscreenUI(name: string, foreground?: boolean, scene?: BABYLON.Nullable<BABYLON.Scene>, sampling?: number): AdvancedDynamicTexture;
     }
 }
@@ -910,16 +917,16 @@ declare module BABYLON.GUI {
             /** @hidden */
             _markAllAsDirty(): void;
             /** @hidden */
-            protected _localDraw(context: CanvasRenderingContext2D): void;
+            protected _localDraw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             /** @hidden */
             _link(host: AdvancedDynamicTexture): void;
             /** @hidden */
             protected _beforeLayout(): void;
             /** @hidden */
-            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
+            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D, invalidatedRectangle?: BABYLON.Nullable<Measure>): boolean;
             protected _postMeasure(): void;
             /** @hidden */
-            _draw(context: CanvasRenderingContext2D): void;
+            _draw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             /** @hidden */
             _getDescendants(results: Control[], directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): void;
             /** @hidden */
@@ -1324,13 +1331,17 @@ declare module BABYLON.GUI {
             /** @hidden */
             _flagDescendantsAsMatrixDirty(): void;
             /** @hidden */
+            _intersectsRect(rect: Measure): boolean;
+            /** @hidden */
+            protected invalidateRect(): void;
+            /** @hidden */
             _markAsDirty(force?: boolean): void;
             /** @hidden */
             _markAllAsDirty(): void;
             /** @hidden */
             _link(host: AdvancedDynamicTexture): void;
             /** @hidden */
-            protected _transform(context: CanvasRenderingContext2D): void;
+            protected _transform(context?: CanvasRenderingContext2D): void;
             /** @hidden */
             _renderHighlight(context: CanvasRenderingContext2D): void;
             /** @hidden */
@@ -1338,7 +1349,7 @@ declare module BABYLON.GUI {
             /** @hidden */
             protected _applyStates(context: CanvasRenderingContext2D): void;
             /** @hidden */
-            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
+            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D, invalidatedRectangle?: BABYLON.Nullable<Measure>): boolean;
             /** @hidden */
             protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
             /** @hidden */
@@ -1352,9 +1363,9 @@ declare module BABYLON.GUI {
             /** @hidden */
             protected _clipForChildren(context: CanvasRenderingContext2D): void;
             /** @hidden */
-            _render(context: CanvasRenderingContext2D): boolean;
+            _render(context: CanvasRenderingContext2D, invalidatedRectangle?: BABYLON.Nullable<Measure>): boolean;
             /** @hidden */
-            _draw(context: CanvasRenderingContext2D): void;
+            _draw(context: CanvasRenderingContext2D, invalidatedRectangle?: BABYLON.Nullable<Measure>): void;
             /**
                 * Tests if a given coordinates belong to the current control
                 * @param x defines x coordinate to test
@@ -2362,7 +2373,7 @@ declare module BABYLON.GUI {
                 */
             constructor(name?: string | undefined);
             protected _getTypeName(): string;
-            protected _localDraw(context: CanvasRenderingContext2D): void;
+            protected _localDraw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
             protected _clipForChildren(context: CanvasRenderingContext2D): void;
     }

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


+ 269 - 246
dist/preview release/gui/babylon.gui.module.d.ts

@@ -1,7 +1,6 @@
 /*Babylon.js GUI*/
 // Dependencies for this module:
 //   ../../../../Tools/Gulp/babylonjs
-//   ../../../../Tools/Gulp/2D
 
 declare module 'babylonjs-gui' {
     export * from "babylonjs-gui/2D";
@@ -59,8 +58,8 @@ declare module 'babylonjs-gui/2D/advancedDynamicTexture' {
     import { Control } from "babylonjs-gui/2D/controls/control";
     import { Style } from "babylonjs-gui/2D/style";
     /**
-        * Interface used to define a control that can receive focus
-        */
+     * Interface used to define a control that can receive focus
+     */
     export interface IFocusableControl {
             /**
                 * Function called when the control receives the focus
@@ -76,15 +75,15 @@ declare module 'babylonjs-gui/2D/advancedDynamicTexture' {
                 */
             processKeyboard(evt: KeyboardEvent): void;
             /**
-                * Function called to get the list of controls that should not steal the focus from this control
-                * @returns an array of controls
-                */
+             * Function called to get the list of controls that should not steal the focus from this control
+             * @returns an array of controls
+             */
             keepsFocusWith(): Nullable<Control[]>;
     }
     /**
-        * Class used to create texture to support 2D GUI elements
-        * @see http://doc.babylonjs.com/how_to/gui
-        */
+     * Class used to create texture to support 2D GUI elements
+     * @see http://doc.babylonjs.com/how_to/gui
+     */
     export class AdvancedDynamicTexture extends DynamicTexture {
             /** @hidden */
             _rootContainer: Container;
@@ -109,150 +108,158 @@ declare module 'babylonjs-gui/2D/advancedDynamicTexture' {
             /** @hidden */
             _linkedControls: Control[];
             /**
-                * Observable event triggered each time an clipboard event is received from the rendering canvas
-                */
+             * Observable event triggered each time an clipboard event is received from the rendering canvas
+             */
             onClipboardObservable: Observable<ClipboardInfo>;
             /**
-                * Observable event triggered each time a pointer down is intercepted by a control
-                */
+             * Observable event triggered each time a pointer down is intercepted by a control
+             */
             onControlPickedObservable: Observable<Control>;
             /**
-                * Observable event triggered before layout is evaluated
-                */
+             * Observable event triggered before layout is evaluated
+             */
             onBeginLayoutObservable: Observable<AdvancedDynamicTexture>;
             /**
-                * Observable event triggered after the layout was evaluated
-                */
+             * Observable event triggered after the layout was evaluated
+             */
             onEndLayoutObservable: Observable<AdvancedDynamicTexture>;
             /**
-                * Observable event triggered before the texture is rendered
-                */
+             * Observable event triggered before the texture is rendered
+             */
             onBeginRenderObservable: Observable<AdvancedDynamicTexture>;
             /**
-                * Observable event triggered after the texture was rendered
-                */
+             * Observable event triggered after the texture was rendered
+             */
             onEndRenderObservable: Observable<AdvancedDynamicTexture>;
             /**
-                * Gets or sets a boolean defining if alpha is stored as premultiplied
-                */
+             * Gets or sets a boolean defining if alpha is stored as premultiplied
+             */
             premulAlpha: boolean;
             /**
-                * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
-                * Useful when you want more antialiasing
-                */
+             * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
+             * Useful when you want more antialiasing
+             */
             renderScale: number;
             /** Gets or sets the background color */
             background: string;
             /**
-                * Gets or sets the ideal width used to design controls.
-                * The GUI will then rescale everything accordingly
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets the ideal width used to design controls.
+             * The GUI will then rescale everything accordingly
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             idealWidth: number;
             /**
-                * Gets or sets the ideal height used to design controls.
-                * The GUI will then rescale everything accordingly
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets the ideal height used to design controls.
+             * The GUI will then rescale everything accordingly
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             idealHeight: number;
             /**
-                * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             useSmallestIdeal: boolean;
             /**
-                * Gets or sets a boolean indicating if adaptive scaling must be used
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets a boolean indicating if adaptive scaling must be used
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             renderAtIdealSize: boolean;
             /**
-                * Gets the underlying layer used to render the texture when in fullscreen mode
-                */
+             * Gets the underlying layer used to render the texture when in fullscreen mode
+             */
             readonly layer: Nullable<Layer>;
             /**
-                * Gets the root container control
-                */
+             * Gets the root container control
+             */
             readonly rootContainer: Container;
             /**
-                * Returns an array containing the root container.
-                * This is mostly used to let the Inspector introspects the ADT
-                * @returns an array containing the rootContainer
-                */
+             * Returns an array containing the root container.
+             * This is mostly used to let the Inspector introspects the ADT
+             * @returns an array containing the rootContainer
+             */
             getChildren(): Array<Container>;
             /**
-                * Will return all controls that are inside this texture
-                * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
-                * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
-                * @return all child controls
-                */
+             * Will return all controls that are inside this texture
+             * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
+             * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
+             * @return all child controls
+             */
             getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
             /**
-                * Gets or sets the current focused control
-                */
+             * Gets or sets the current focused control
+             */
             focusedControl: Nullable<IFocusableControl>;
             /**
-                * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
-                */
+             * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
+             */
             isForeground: boolean;
             /**
-                * Gets or set information about clipboardData
-                */
+             * Gets or set information about clipboardData
+             */
             clipboardData: string;
             /**
-             * Creates a new AdvancedDynamicTexture
-             * @param name defines the name of the texture
-             * @param width defines the width of the texture
-             * @param height defines the height of the texture
-             * @param scene defines the hosting scene
-             * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
-             * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
-             */
+            * Creates a new AdvancedDynamicTexture
+            * @param name defines the name of the texture
+            * @param width defines the width of the texture
+            * @param height defines the height of the texture
+            * @param scene defines the hosting scene
+            * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
+            * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
+            */
             constructor(name: string, width: number | undefined, height: number | undefined, scene: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number);
             /**
-                * Get the current class name of the texture useful for serialization or dynamic coding.
-                * @returns "AdvancedDynamicTexture"
-                */
+             * Get the current class name of the texture useful for serialization or dynamic coding.
+             * @returns "AdvancedDynamicTexture"
+             */
             getClassName(): string;
             /**
-                * Function used to execute a function on all controls
-                * @param func defines the function to execute
-                * @param container defines the container where controls belong. If null the root container will be used
-                */
+             * Function used to execute a function on all controls
+             * @param func defines the function to execute
+             * @param container defines the container where controls belong. If null the root container will be used
+             */
             executeOnAllControls(func: (control: Control) => void, container?: Container): void;
             /**
-                * Marks the texture as dirty forcing a complete update
+                * Invalidates a rectangle area on the gui texture
+                * @param minX left most position of the rectangle to invalidate in pixels
+                * @param minY top most position of the rectangle to invalidate in pixels
+                * @param maxX right most position of the rectangle to invalidate in pixels
+                * @param maxY bottom most position of the rectangle to invalidate in pixels
                 */
+            invalidateRect(minX: number, minY: number, maxX: number, maxY: number): void;
+            /**
+             * Marks the texture as dirty forcing a complete update
+             */
             markAsDirty(): void;
             /**
-                * Helper function used to create a new style
-                * @returns a new style
-                * @see http://doc.babylonjs.com/how_to/gui#styles
-                */
+             * Helper function used to create a new style
+             * @returns a new style
+             * @see http://doc.babylonjs.com/how_to/gui#styles
+             */
             createStyle(): Style;
             /**
-                * Adds a new control to the root container
-                * @param control defines the control to add
-                * @returns the current texture
-                */
+             * Adds a new control to the root container
+             * @param control defines the control to add
+             * @returns the current texture
+             */
             addControl(control: Control): AdvancedDynamicTexture;
             /**
-                * Removes a control from the root container
-                * @param control defines the control to remove
-                * @returns the current texture
-                */
+             * Removes a control from the root container
+             * @param control defines the control to remove
+             * @returns the current texture
+             */
             removeControl(control: Control): AdvancedDynamicTexture;
             /**
-                * Release all resources
-                */
+             * Release all resources
+             */
             dispose(): void;
             /** @hidden */
             _getGlobalViewport(scene: Scene): Viewport;
             /**
-                * Get screen coordinates for a vector3
-                * @param position defines the position to project
-                * @param worldMatrix defines the world matrix to use
-                * @returns the projected position
-                */
+             * Get screen coordinates for a vector3
+             * @param position defines the position to project
+             * @param worldMatrix defines the world matrix to use
+             * @returns the projected position
+             */
             getProjectedPosition(position: Vector3, worldMatrix: Matrix): Vector2;
             /** @hidden */
             _changeCursor(cursor: string): void;
@@ -267,23 +274,23 @@ declare module 'babylonjs-gui/2D/advancedDynamicTexture' {
             /** Attach to all scene events required to support pointer events */
             attach(): void;
             /**
-                * Register the clipboard Events onto the canvas
-                */
+             * Register the clipboard Events onto the canvas
+             */
             registerClipboardEvents(): void;
             /**
                 * Unregister the clipboard Events from the canvas
                 */
             unRegisterClipboardEvents(): void;
             /**
-                * Connect the texture to a hosting mesh to enable interactions
-                * @param mesh defines the mesh to attach to
-                * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
-                */
+             * Connect the texture to a hosting mesh to enable interactions
+             * @param mesh defines the mesh to attach to
+             * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
+             */
             attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
             /**
-                * Move the focus to a specific control
-                * @param control defines the control which will receive the focus
-                */
+             * Move the focus to a specific control
+             * @param control defines the control which will receive the focus
+             */
             moveFocusToControl(control: IFocusableControl): void;
             /**
                 * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
@@ -296,17 +303,17 @@ declare module 'babylonjs-gui/2D/advancedDynamicTexture' {
                 */
             static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean): AdvancedDynamicTexture;
             /**
-                * Creates a new AdvancedDynamicTexture in fullscreen mode.
-                * In this mode the texture will rely on a layer for its rendering.
-                * This allows it to be treated like any other layer.
-                * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
-                * LayerMask is set through advancedTexture.layer.layerMask
-                * @param name defines name for the texture
-                * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
-                * @param scene defines the hsoting scene
-                * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
-                * @returns a new AdvancedDynamicTexture
-                */
+             * Creates a new AdvancedDynamicTexture in fullscreen mode.
+             * In this mode the texture will rely on a layer for its rendering.
+             * This allows it to be treated like any other layer.
+             * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
+             * LayerMask is set through advancedTexture.layer.layerMask
+             * @param name defines name for the texture
+             * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
+             * @param scene defines the hsoting scene
+             * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
+             * @returns a new AdvancedDynamicTexture
+             */
             static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number): AdvancedDynamicTexture;
     }
 }
@@ -1013,16 +1020,16 @@ declare module 'babylonjs-gui/2D/controls/container' {
             /** @hidden */
             _markAllAsDirty(): void;
             /** @hidden */
-            protected _localDraw(context: CanvasRenderingContext2D): void;
+            protected _localDraw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             /** @hidden */
             _link(host: AdvancedDynamicTexture): void;
             /** @hidden */
             protected _beforeLayout(): void;
             /** @hidden */
-            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
+            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D, invalidatedRectangle?: Nullable<Measure>): boolean;
             protected _postMeasure(): void;
             /** @hidden */
-            _draw(context: CanvasRenderingContext2D): void;
+            _draw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             /** @hidden */
             _getDescendants(results: Control[], directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): void;
             /** @hidden */
@@ -1435,13 +1442,17 @@ declare module 'babylonjs-gui/2D/controls/control' {
             /** @hidden */
             _flagDescendantsAsMatrixDirty(): void;
             /** @hidden */
+            _intersectsRect(rect: Measure): boolean;
+            /** @hidden */
+            protected invalidateRect(): void;
+            /** @hidden */
             _markAsDirty(force?: boolean): void;
             /** @hidden */
             _markAllAsDirty(): void;
             /** @hidden */
             _link(host: AdvancedDynamicTexture): void;
             /** @hidden */
-            protected _transform(context: CanvasRenderingContext2D): void;
+            protected _transform(context?: CanvasRenderingContext2D): void;
             /** @hidden */
             _renderHighlight(context: CanvasRenderingContext2D): void;
             /** @hidden */
@@ -1449,7 +1460,7 @@ declare module 'babylonjs-gui/2D/controls/control' {
             /** @hidden */
             protected _applyStates(context: CanvasRenderingContext2D): void;
             /** @hidden */
-            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
+            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D, invalidatedRectangle?: Nullable<Measure>): boolean;
             /** @hidden */
             protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
             /** @hidden */
@@ -1463,9 +1474,9 @@ declare module 'babylonjs-gui/2D/controls/control' {
             /** @hidden */
             protected _clipForChildren(context: CanvasRenderingContext2D): void;
             /** @hidden */
-            _render(context: CanvasRenderingContext2D): boolean;
+            _render(context: CanvasRenderingContext2D, invalidatedRectangle?: Nullable<Measure>): boolean;
             /** @hidden */
-            _draw(context: CanvasRenderingContext2D): void;
+            _draw(context: CanvasRenderingContext2D, invalidatedRectangle?: Nullable<Measure>): void;
             /**
                 * Tests if a given coordinates belong to the current control
                 * @param x defines x coordinate to test
@@ -1668,7 +1679,7 @@ declare module 'babylonjs-gui/2D/controls/grid' {
 declare module 'babylonjs-gui/2D/controls/image' {
     import { Control } from "babylonjs-gui/2D/controls/control";
     import { Nullable, Observable } from "babylonjs";
-    import { Measure } from "2D";
+    import { Measure } from "babylonjs-gui/2D/measure";
     /**
         * Class used to create 2D images
         */
@@ -2262,7 +2273,8 @@ declare module 'babylonjs-gui/2D/controls/scrollViewers/scrollViewer' {
     import { Control } from "babylonjs-gui/2D/controls/control";
     import { Container } from "babylonjs-gui/2D/controls/container";
     import { Nullable } from "babylonjs";
-    import { AdvancedDynamicTexture, Measure } from "2D";
+    import { Measure } from "babylonjs-gui/2D/measure";
+    import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture";
     import { ScrollBar } from "babylonjs-gui/2D/controls/sliders/scrollBar";
     /**
         * Class used to hold a viewer window and sliders in a grid
@@ -2530,7 +2542,7 @@ declare module 'babylonjs-gui/2D/controls/rectangle' {
                 */
             constructor(name?: string | undefined);
             protected _getTypeName(): string;
-            protected _localDraw(context: CanvasRenderingContext2D): void;
+            protected _localDraw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
             protected _clipForChildren(context: CanvasRenderingContext2D): void;
     }
@@ -3300,7 +3312,6 @@ declare module 'babylonjs-gui/2D/controls/sliders/scrollBar' {
 /*Babylon.js GUI*/
 // Dependencies for this module:
 //   ../../../../Tools/Gulp/babylonjs
-//   ../../../../Tools/Gulp/2D
 declare module BABYLON.GUI {
 }
 declare module BABYLON.GUI {
@@ -3311,8 +3322,8 @@ declare module BABYLON.GUI {
 }
 declare module BABYLON.GUI {
     /**
-        * Interface used to define a control that can receive focus
-        */
+     * Interface used to define a control that can receive focus
+     */
     export interface IFocusableControl {
             /**
                 * Function called when the control receives the focus
@@ -3328,15 +3339,15 @@ declare module BABYLON.GUI {
                 */
             processKeyboard(evt: KeyboardEvent): void;
             /**
-                * Function called to get the list of controls that should not steal the focus from this control
-                * @returns an array of controls
-                */
+             * Function called to get the list of controls that should not steal the focus from this control
+             * @returns an array of controls
+             */
             keepsFocusWith(): BABYLON.Nullable<Control[]>;
     }
     /**
-        * Class used to create texture to support 2D GUI elements
-        * @see http://doc.babylonjs.com/how_to/gui
-        */
+     * Class used to create texture to support 2D GUI elements
+     * @see http://doc.babylonjs.com/how_to/gui
+     */
     export class AdvancedDynamicTexture extends BABYLON.DynamicTexture {
             /** @hidden */
             _rootContainer: Container;
@@ -3361,150 +3372,158 @@ declare module BABYLON.GUI {
             /** @hidden */
             _linkedControls: Control[];
             /**
-                * BABYLON.Observable event triggered each time an clipboard event is received from the rendering canvas
-                */
+             * BABYLON.Observable event triggered each time an clipboard event is received from the rendering canvas
+             */
             onClipboardObservable: BABYLON.Observable<BABYLON.ClipboardInfo>;
             /**
-                * BABYLON.Observable event triggered each time a pointer down is intercepted by a control
-                */
+             * BABYLON.Observable event triggered each time a pointer down is intercepted by a control
+             */
             onControlPickedObservable: BABYLON.Observable<Control>;
             /**
-                * BABYLON.Observable event triggered before layout is evaluated
-                */
+             * BABYLON.Observable event triggered before layout is evaluated
+             */
             onBeginLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
             /**
-                * BABYLON.Observable event triggered after the layout was evaluated
-                */
+             * BABYLON.Observable event triggered after the layout was evaluated
+             */
             onEndLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
             /**
-                * BABYLON.Observable event triggered before the texture is rendered
-                */
+             * BABYLON.Observable event triggered before the texture is rendered
+             */
             onBeginRenderObservable: BABYLON.Observable<AdvancedDynamicTexture>;
             /**
-                * BABYLON.Observable event triggered after the texture was rendered
-                */
+             * BABYLON.Observable event triggered after the texture was rendered
+             */
             onEndRenderObservable: BABYLON.Observable<AdvancedDynamicTexture>;
             /**
-                * Gets or sets a boolean defining if alpha is stored as premultiplied
-                */
+             * Gets or sets a boolean defining if alpha is stored as premultiplied
+             */
             premulAlpha: boolean;
             /**
-                * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
-                * Useful when you want more antialiasing
-                */
+             * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
+             * Useful when you want more antialiasing
+             */
             renderScale: number;
             /** Gets or sets the background color */
             background: string;
             /**
-                * Gets or sets the ideal width used to design controls.
-                * The GUI will then rescale everything accordingly
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets the ideal width used to design controls.
+             * The GUI will then rescale everything accordingly
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             idealWidth: number;
             /**
-                * Gets or sets the ideal height used to design controls.
-                * The GUI will then rescale everything accordingly
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets the ideal height used to design controls.
+             * The GUI will then rescale everything accordingly
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             idealHeight: number;
             /**
-                * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             useSmallestIdeal: boolean;
             /**
-                * Gets or sets a boolean indicating if adaptive scaling must be used
-                * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
-                */
+             * Gets or sets a boolean indicating if adaptive scaling must be used
+             * @see http://doc.babylonjs.com/how_to/gui#adaptive-scaling
+             */
             renderAtIdealSize: boolean;
             /**
-                * Gets the underlying layer used to render the texture when in fullscreen mode
-                */
+             * Gets the underlying layer used to render the texture when in fullscreen mode
+             */
             readonly layer: BABYLON.Nullable<BABYLON.Layer>;
             /**
-                * Gets the root container control
-                */
+             * Gets the root container control
+             */
             readonly rootContainer: Container;
             /**
-                * Returns an array containing the root container.
-                * This is mostly used to let the Inspector introspects the ADT
-                * @returns an array containing the rootContainer
-                */
+             * Returns an array containing the root container.
+             * This is mostly used to let the Inspector introspects the ADT
+             * @returns an array containing the rootContainer
+             */
             getChildren(): Array<Container>;
             /**
-                * Will return all controls that are inside this texture
-                * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
-                * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
-                * @return all child controls
-                */
+             * Will return all controls that are inside this texture
+             * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
+             * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
+             * @return all child controls
+             */
             getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[];
             /**
-                * Gets or sets the current focused control
-                */
+             * Gets or sets the current focused control
+             */
             focusedControl: BABYLON.Nullable<IFocusableControl>;
             /**
-                * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
-                */
+             * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
+             */
             isForeground: boolean;
             /**
-                * Gets or set information about clipboardData
-                */
+             * Gets or set information about clipboardData
+             */
             clipboardData: string;
             /**
-             * Creates a new AdvancedDynamicTexture
-             * @param name defines the name of the texture
-             * @param width defines the width of the texture
-             * @param height defines the height of the texture
-             * @param scene defines the hosting scene
-             * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
-             * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
-             */
+            * Creates a new AdvancedDynamicTexture
+            * @param name defines the name of the texture
+            * @param width defines the width of the texture
+            * @param height defines the height of the texture
+            * @param scene defines the hosting scene
+            * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
+            * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
+            */
             constructor(name: string, width: number | undefined, height: number | undefined, scene: BABYLON.Nullable<BABYLON.Scene>, generateMipMaps?: boolean, samplingMode?: number);
             /**
-                * Get the current class name of the texture useful for serialization or dynamic coding.
-                * @returns "AdvancedDynamicTexture"
-                */
+             * Get the current class name of the texture useful for serialization or dynamic coding.
+             * @returns "AdvancedDynamicTexture"
+             */
             getClassName(): string;
             /**
-                * Function used to execute a function on all controls
-                * @param func defines the function to execute
-                * @param container defines the container where controls belong. If null the root container will be used
-                */
+             * Function used to execute a function on all controls
+             * @param func defines the function to execute
+             * @param container defines the container where controls belong. If null the root container will be used
+             */
             executeOnAllControls(func: (control: Control) => void, container?: Container): void;
             /**
-                * Marks the texture as dirty forcing a complete update
+                * Invalidates a rectangle area on the gui texture
+                * @param minX left most position of the rectangle to invalidate in pixels
+                * @param minY top most position of the rectangle to invalidate in pixels
+                * @param maxX right most position of the rectangle to invalidate in pixels
+                * @param maxY bottom most position of the rectangle to invalidate in pixels
                 */
+            invalidateRect(minX: number, minY: number, maxX: number, maxY: number): void;
+            /**
+             * Marks the texture as dirty forcing a complete update
+             */
             markAsDirty(): void;
             /**
-                * Helper function used to create a new style
-                * @returns a new style
-                * @see http://doc.babylonjs.com/how_to/gui#styles
-                */
+             * Helper function used to create a new style
+             * @returns a new style
+             * @see http://doc.babylonjs.com/how_to/gui#styles
+             */
             createStyle(): Style;
             /**
-                * Adds a new control to the root container
-                * @param control defines the control to add
-                * @returns the current texture
-                */
+             * Adds a new control to the root container
+             * @param control defines the control to add
+             * @returns the current texture
+             */
             addControl(control: Control): AdvancedDynamicTexture;
             /**
-                * Removes a control from the root container
-                * @param control defines the control to remove
-                * @returns the current texture
-                */
+             * Removes a control from the root container
+             * @param control defines the control to remove
+             * @returns the current texture
+             */
             removeControl(control: Control): AdvancedDynamicTexture;
             /**
-                * Release all resources
-                */
+             * Release all resources
+             */
             dispose(): void;
             /** @hidden */
             _getGlobalViewport(scene: BABYLON.Scene): BABYLON.Viewport;
             /**
-                * Get screen coordinates for a vector3
-                * @param position defines the position to project
-                * @param worldMatrix defines the world matrix to use
-                * @returns the projected position
-                */
+             * Get screen coordinates for a vector3
+             * @param position defines the position to project
+             * @param worldMatrix defines the world matrix to use
+             * @returns the projected position
+             */
             getProjectedPosition(position: BABYLON.Vector3, worldMatrix: BABYLON.Matrix): BABYLON.Vector2;
             /** @hidden */
             _changeCursor(cursor: string): void;
@@ -3519,23 +3538,23 @@ declare module BABYLON.GUI {
             /** Attach to all scene events required to support pointer events */
             attach(): void;
             /**
-                * Register the clipboard Events onto the canvas
-                */
+             * Register the clipboard Events onto the canvas
+             */
             registerClipboardEvents(): void;
             /**
                 * Unregister the clipboard Events from the canvas
                 */
             unRegisterClipboardEvents(): void;
             /**
-                * Connect the texture to a hosting mesh to enable interactions
-                * @param mesh defines the mesh to attach to
-                * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
-                */
+             * Connect the texture to a hosting mesh to enable interactions
+             * @param mesh defines the mesh to attach to
+             * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
+             */
             attachToMesh(mesh: BABYLON.AbstractMesh, supportPointerMove?: boolean): void;
             /**
-                * Move the focus to a specific control
-                * @param control defines the control which will receive the focus
-                */
+             * Move the focus to a specific control
+             * @param control defines the control which will receive the focus
+             */
             moveFocusToControl(control: IFocusableControl): void;
             /**
                 * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
@@ -3548,17 +3567,17 @@ declare module BABYLON.GUI {
                 */
             static CreateForMesh(mesh: BABYLON.AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean): AdvancedDynamicTexture;
             /**
-                * Creates a new AdvancedDynamicTexture in fullscreen mode.
-                * In this mode the texture will rely on a layer for its rendering.
-                * This allows it to be treated like any other layer.
-                * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
-                * LayerMask is set through advancedTexture.layer.layerMask
-                * @param name defines name for the texture
-                * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
-                * @param scene defines the hsoting scene
-                * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
-                * @returns a new AdvancedDynamicTexture
-                */
+             * Creates a new AdvancedDynamicTexture in fullscreen mode.
+             * In this mode the texture will rely on a layer for its rendering.
+             * This allows it to be treated like any other layer.
+             * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
+             * LayerMask is set through advancedTexture.layer.layerMask
+             * @param name defines name for the texture
+             * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
+             * @param scene defines the hsoting scene
+             * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
+             * @returns a new AdvancedDynamicTexture
+             */
             static CreateFullscreenUI(name: string, foreground?: boolean, scene?: BABYLON.Nullable<BABYLON.Scene>, sampling?: number): AdvancedDynamicTexture;
     }
 }
@@ -4209,16 +4228,16 @@ declare module BABYLON.GUI {
             /** @hidden */
             _markAllAsDirty(): void;
             /** @hidden */
-            protected _localDraw(context: CanvasRenderingContext2D): void;
+            protected _localDraw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             /** @hidden */
             _link(host: AdvancedDynamicTexture): void;
             /** @hidden */
             protected _beforeLayout(): void;
             /** @hidden */
-            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
+            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D, invalidatedRectangle?: BABYLON.Nullable<Measure>): boolean;
             protected _postMeasure(): void;
             /** @hidden */
-            _draw(context: CanvasRenderingContext2D): void;
+            _draw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             /** @hidden */
             _getDescendants(results: Control[], directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): void;
             /** @hidden */
@@ -4623,13 +4642,17 @@ declare module BABYLON.GUI {
             /** @hidden */
             _flagDescendantsAsMatrixDirty(): void;
             /** @hidden */
+            _intersectsRect(rect: Measure): boolean;
+            /** @hidden */
+            protected invalidateRect(): void;
+            /** @hidden */
             _markAsDirty(force?: boolean): void;
             /** @hidden */
             _markAllAsDirty(): void;
             /** @hidden */
             _link(host: AdvancedDynamicTexture): void;
             /** @hidden */
-            protected _transform(context: CanvasRenderingContext2D): void;
+            protected _transform(context?: CanvasRenderingContext2D): void;
             /** @hidden */
             _renderHighlight(context: CanvasRenderingContext2D): void;
             /** @hidden */
@@ -4637,7 +4660,7 @@ declare module BABYLON.GUI {
             /** @hidden */
             protected _applyStates(context: CanvasRenderingContext2D): void;
             /** @hidden */
-            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
+            _layout(parentMeasure: Measure, context: CanvasRenderingContext2D, invalidatedRectangle?: BABYLON.Nullable<Measure>): boolean;
             /** @hidden */
             protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
             /** @hidden */
@@ -4651,9 +4674,9 @@ declare module BABYLON.GUI {
             /** @hidden */
             protected _clipForChildren(context: CanvasRenderingContext2D): void;
             /** @hidden */
-            _render(context: CanvasRenderingContext2D): boolean;
+            _render(context: CanvasRenderingContext2D, invalidatedRectangle?: BABYLON.Nullable<Measure>): boolean;
             /** @hidden */
-            _draw(context: CanvasRenderingContext2D): void;
+            _draw(context: CanvasRenderingContext2D, invalidatedRectangle?: BABYLON.Nullable<Measure>): void;
             /**
                 * Tests if a given coordinates belong to the current control
                 * @param x defines x coordinate to test
@@ -5661,7 +5684,7 @@ declare module BABYLON.GUI {
                 */
             constructor(name?: string | undefined);
             protected _getTypeName(): string;
-            protected _localDraw(context: CanvasRenderingContext2D): void;
+            protected _localDraw(context: CanvasRenderingContext2D, invalidatedRectangle?: Measure): void;
             protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
             protected _clipForChildren(context: CanvasRenderingContext2D): void;
     }

+ 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.14",
+    "version": "4.0.0-alpha.15",
     "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.14"
+        "babylonjs": "4.0.0-alpha.15"
     },
     "engines": {
         "node": "*"

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js.map


+ 9 - 7
dist/preview release/inspector/babylon.inspector.d.ts

@@ -3,13 +3,15 @@
 //   ../../../../Tools/Gulp/babylonjs
 declare module INSPECTOR {
 }
-export declare class Inspector {
-    static OnSelectionChangeObservable: BABYLON.Observable<string>;
-    static OnPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
-    static readonly IsVisible: boolean;
-    static EarlyAttachToLoader(): void;
-    static Show(scene: BABYLON.Scene, userOptions: Partial<BABYLON.IInspectorOptions>): void;
-    static Hide(): void;
+declare module INSPECTOR {
+    export class Inspector {
+        static OnSelectionChangeObservable: BABYLON.Observable<string>;
+        static OnPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
+        static readonly IsVisible: boolean;
+        static EarlyAttachToLoader(): void;
+        static Show(scene: BABYLON.Scene, userOptions: Partial<BABYLON.IInspectorOptions>): void;
+        static Hide(): void;
+    }
 }
 declare module INSPECTOR {
     export class PropertyChangedEvent {

+ 20 - 16
dist/preview release/inspector/babylon.inspector.module.d.ts

@@ -6,15 +6,17 @@ declare module 'babylonjs-inspector' {
     export * from "babylonjs-inspector/inspector";
 }
 
-import { Scene, Observable, IInspectorOptions } from "babylonjs";
-import { PropertyChangedEvent } from "babylonjs-inspector/components/propertyChangedEvent";
-export declare class Inspector {
-    static OnSelectionChangeObservable: Observable<string>;
-    static OnPropertyChangedObservable: Observable<PropertyChangedEvent>;
-    static readonly IsVisible: boolean;
-    static EarlyAttachToLoader(): void;
-    static Show(scene: Scene, userOptions: Partial<IInspectorOptions>): void;
-    static Hide(): void;
+declare module 'babylonjs-inspector/inspector' {
+    import { Scene, Observable, IInspectorOptions } from "babylonjs";
+    import { PropertyChangedEvent } from "babylonjs-inspector/components/propertyChangedEvent";
+    export class Inspector {
+        static OnSelectionChangeObservable: Observable<string>;
+        static OnPropertyChangedObservable: Observable<PropertyChangedEvent>;
+        static readonly IsVisible: boolean;
+        static EarlyAttachToLoader(): void;
+        static Show(scene: Scene, userOptions: Partial<IInspectorOptions>): void;
+        static Hide(): void;
+    }
 }
 
 declare module 'babylonjs-inspector/components/propertyChangedEvent' {
@@ -32,13 +34,15 @@ declare module 'babylonjs-inspector/components/propertyChangedEvent' {
 //   ../../../../Tools/Gulp/babylonjs
 declare module INSPECTOR {
 }
-export declare class Inspector {
-    static OnSelectionChangeObservable: BABYLON.Observable<string>;
-    static OnPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
-    static readonly IsVisible: boolean;
-    static EarlyAttachToLoader(): void;
-    static Show(scene: BABYLON.Scene, userOptions: Partial<BABYLON.IInspectorOptions>): void;
-    static Hide(): void;
+declare module INSPECTOR {
+    export class Inspector {
+        static OnSelectionChangeObservable: BABYLON.Observable<string>;
+        static OnPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
+        static readonly IsVisible: boolean;
+        static EarlyAttachToLoader(): void;
+        static Show(scene: BABYLON.Scene, userOptions: Partial<BABYLON.IInspectorOptions>): void;
+        static Hide(): void;
+    }
 }
 declare module INSPECTOR {
     export class PropertyChangedEvent {

+ 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.14",
+    "version": "4.0.0-alpha.15",
     "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.14",
-        "babylonjs-gui": "4.0.0-alpha.14",
-        "babylonjs-loaders": "4.0.0-alpha.14",
-        "babylonjs-serializers": "4.0.0-alpha.14"
+        "babylonjs": "4.0.0-alpha.15",
+        "babylonjs-gui": "4.0.0-alpha.15",
+        "babylonjs-loaders": "4.0.0-alpha.15",
+        "babylonjs-serializers": "4.0.0-alpha.15"
     },
     "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.14",
+    "version": "4.0.0-alpha.15",
     "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.14",
-        "babylonjs": "4.0.0-alpha.14"
+        "babylonjs-gltf2interface": "4.0.0-alpha.15",
+        "babylonjs": "4.0.0-alpha.15"
     },
     "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.14",
+    "version": "4.0.0-alpha.15",
     "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.14"
+        "babylonjs": "4.0.0-alpha.15"
     },
     "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.14",
+    "version": "4.0.0-alpha.15",
     "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.14"
+        "babylonjs": "4.0.0-alpha.15"
     },
     "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.14",
+    "version": "4.0.0-alpha.15",
     "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.14"
+        "babylonjs": "4.0.0-alpha.15"
     },
     "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.14",
+    "version": "4.0.0-alpha.15",
     "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.14",
-        "babylonjs-gltf2interface": "4.0.0-alpha.14"
+        "babylonjs": "4.0.0-alpha.15",
+        "babylonjs-gltf2interface": "4.0.0-alpha.15"
     },
     "engines": {
         "node": "*"

文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/viewer/babylon.viewer.js


文件差异内容过多而无法显示
+ 4 - 4
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -23,6 +23,7 @@
   - Added new [ScrollViewer](https://doc.babylonjs.com/how_to/scrollviewer) with mouse wheel scrolling for larger containers to be viewed using Sliders ([JohnK](https://github.com/BabylonJSGuide/) / [Deltakosh](https://github.com/deltakosh))
   - Moved to a measure / draw mechanism ([Deltakosh](https://github.com/deltakosh))
   - Added support for [nine patch stretch](https://www.babylonjs-playground.com/#G5H9IN#2) mode for images. ([Deltakosh](https://github.com/deltakosh))
+  - InvalidateRect added to AdvancedDynamicTexture to improve perf for highly populated GUIs ([TrevorDev](https://github.com/TrevorDev))
 
 ## Updates
 
@@ -85,7 +86,6 @@
 - Add support for setting renderingGroupId and creating instances to `AxesViewer` ([bghgary](https://github.com/bghgary))
 - Invert vScale of compressed ktx textures as they are inverted in the file and UNPACK_FLIP_Y_WEBGL is not supported by ktx ([TrevorDev](https://github.com/TrevorDev))
 - Enable dragging in boundingBoxGizmo without needing a parent ([TrevorDev](https://github.com/TrevorDev))
-- InvalidateRect added to AdvancedDynamicTexture to improve perf for highly populated GUIs ([TrevorDev](https://github.com/TrevorDev))
 - Added per mesh culling strategy ([jerome](https://github.com/jbousquie))
 
 ### glTF Loader
@@ -151,6 +151,7 @@
 - Fixed Inspector resolution with AMD loader ([Sebavan](https://github.com/Sebavan))
 - Fix a bug when a call to `updateIndices` leads to changing the size of the index buffer by recreating the subMeshes in that case ([barroij](https://github.com/barroij))
 - Add option to disable gazeTracker color changes in vrExperienceHelper ([TrevorDev](https://github.com/TrevorDev))
+- PointerDragBehavior validateDrag predicate to stop dragging to specific points ([TrevorDev](https://github.com/TrevorDev))
 
 ### Viewer
 

文件差异内容过多而无法显示
+ 280 - 280
gui/src/2D/advancedDynamicTexture.ts


+ 4 - 4
gui/src/2D/controls/control.ts

@@ -1075,10 +1075,10 @@ export class Control {
 
     /** @hidden */
     public _intersectsRect(rect: Measure) {
-        var hit = ! (this._currentMeasure.left > rect.left + rect.width ||
-             this._currentMeasure.left + this._currentMeasure.width < rect.left ||
-             this._currentMeasure.top > rect.top + rect.height ||
-             this._currentMeasure.top + this._currentMeasure.height < rect.top
+        var hit = !(this._currentMeasure.left > rect.left + rect.width ||
+            this._currentMeasure.left + this._currentMeasure.width < rect.left ||
+            this._currentMeasure.top > rect.top + rect.height ||
+            this._currentMeasure.top + this._currentMeasure.height < rect.top
         );
         return hit;
     }

+ 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.14",
+    "version": "4.0.0-alpha.15",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 8 - 1
src/Behaviors/Mesh/babylon.pointerDragBehavior.ts

@@ -97,6 +97,11 @@ module BABYLON {
         }
 
         /**
+         * Predicate to determine if it is valid to move the object to a new position when it is moved
+         */
+        public validateDrag = (targetPosition: Vector3) => {return true; };
+
+        /**
          *  The name of the behavior
          */
         public get name(): string {
@@ -192,7 +197,9 @@ module BABYLON {
                     this._targetPosition.subtractToRef((this._attachedNode).absolutePosition, this._tmpVector);
                     this._tmpVector.scaleInPlace(this.dragDeltaRatio);
                     (this._attachedNode).getAbsolutePosition().addToRef(this._tmpVector, this._tmpVector);
-                    (this._attachedNode).setAbsolutePosition(this._tmpVector);
+                    if (this.validateDrag(this._tmpVector)) {
+                        (this._attachedNode).setAbsolutePosition(this._tmpVector);
+                    }
                     BoundingBoxGizmo._RestorePivotPoint(this._attachedNode);
                 }
             });

+ 11 - 0
src/Culling/Octrees/babylon.octree.ts

@@ -69,6 +69,17 @@ module BABYLON {
         }
 
         /**
+         * Remove an element from the octree
+         * @param entry defines the element to remove
+         */
+        public removeMesh(entry: T): void {
+            for (var index = 0; index < this.blocks.length; index++) {
+                var block = this.blocks[index];
+                block.removeEntry(entry);
+            }
+        }
+
+        /**
          * Selects an array of meshes within the frustum
          * @param frustumPlanes The frustum planes to use which will select all meshes within it
          * @param allowDuplicate If duplicate objects are allowed in the resulting object array

+ 20 - 0
src/Culling/Octrees/babylon.octreeBlock.ts

@@ -108,6 +108,26 @@ module BABYLON {
         }
 
         /**
+         * Remove an element from this block
+         * @param entry defines the element to remove
+         */
+        public removeEntry(entry: T): void {
+            if (this.blocks) {
+                for (var index = 0; index < this.blocks.length; index++) {
+                    var block = this.blocks[index];
+                    block.removeEntry(entry);
+                }
+                return;
+            }
+
+            const entryIndex = this.entries.indexOf(entry);
+
+            if (entryIndex > -1) {
+                this.entries.splice(entryIndex, 1);
+            }
+        }
+
+        /**
          * Add an array of elements to this block
          * @param entries defines the array of elements to add
          */

+ 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.14";
+            return "4.0.0-alpha.15";
         }
 
         /**

+ 9 - 7
src/Loading/babylon.sceneLoader.ts

@@ -454,19 +454,21 @@ module BABYLON {
                 name = Tools.GetFilename(rootUrl);
                 rootUrl = Tools.GetFolderPath(rootUrl);
             }
-            else if (sceneFilename instanceof File) {
-                url = rootUrl + sceneFilename.name;
-                name = sceneFilename.name;
-                file = sceneFilename;
+            else if ((sceneFilename as File).lastModified) {
+                const sceneFile = sceneFilename as File;
+                url = rootUrl + sceneFile.name;
+                name = sceneFile.name;
+                file = sceneFile;
             }
             else {
-                if (sceneFilename.substr(0, 1) === "/") {
+                const filename = sceneFilename as string;
+                if (filename.substr(0, 1) === "/") {
                     Tools.Error("Wrong sceneFilename parameter");
                     return null;
                 }
 
-                url = rootUrl + sceneFilename;
-                name = sceneFilename;
+                url = rootUrl + filename;
+                name = filename;
             }
 
             return {

+ 116 - 89
tests/nullEngine/app.js

@@ -1,5 +1,5 @@
 var BABYLON = require("../../dist/preview release/babylon.max");
-// var LOADERS = require("../../dist/preview release/loaders/babylonjs.loaders");
+var LOADERS = require("../../dist/preview release/loaders/babylonjs.loaders");
 global.XMLHttpRequest = require('xhr2').XMLHttpRequest;
 
 var engine = new BABYLON.NullEngine();
@@ -32,7 +32,7 @@ var engine = new BABYLON.NullEngine();
 //         scene.render();
 //     })
 // });
-    
+
 // Setup environment
 // var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 90, BABYLON.Vector3.Zero(), scene);
 // camera.lowerBetaLimit = 0.1;
@@ -100,29 +100,29 @@ var engine = new BABYLON.NullEngine();
 // });
 // 	//Adding a light
 // 	var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 20, 100), scene);
-    
+
 //         //Adding an Arc Rotate Camera
 //         var camera = new BABYLON.ArcRotateCamera("Camera", -0.5, 2.2, 100, BABYLON.Vector3.Zero(), scene);
-    
+
 //         // The first parameter can be used to specify which mesh to import. Here we import all meshes
 //         BABYLON.SceneLoader.ImportMesh("", "https://www.babylonjs-playground.com/scenes/", "skull.babylon", scene, function (newMeshes) {
 //             // Set the target of the camera to the first imported mesh
 //             camera.target = newMeshes[0];
-    
+
 //             newMeshes[0].material = new BABYLON.StandardMaterial("skull", scene);
 //             newMeshes[0].material.emissiveColor = new BABYLON.Color3(0.2, 0.2, 0.2);
 //         });
-    
+
 //         // Create the "God Rays" effect (volumetric light scattering)
 //         var godrays = new BABYLON.VolumetricLightScatteringPostProcess('godrays', 1.0, camera, null, 100, BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine, false);
-    
+
 //         // By default it uses a billboard to render the sun, just apply the desired texture
 //         // position and scale
 //         godrays.mesh.material.diffuseTexture = new BABYLON.Texture('https://www.babylonjs-playground.com/textures/sun.png', scene, true, false, BABYLON.Texture.BILINEAR_SAMPLINGMODE);
 //         godrays.mesh.material.diffuseTexture.hasAlpha = true;
 //         godrays.mesh.position = new BABYLON.Vector3(-150, 150, 150);
 //         godrays.mesh.scaling = new BABYLON.Vector3(350, 350, 350);
-    
+
 //         light.position = godrays.mesh.position;
 
 // engine.runRenderLoop(function() {
@@ -140,7 +140,7 @@ var engine = new BABYLON.NullEngine();
 //    // engine.runRenderLoop(function() {
 //      //   scene.render();
 //     //});
-  
+
 //   }, progress => {}, (scene, err) => console.error('error:', err));
 // var scene = new BABYLON.Scene(engine);
 // var camera = new BABYLON.ArcRotateCamera("camera", 0, 0, 0, BABYLON.Vector3.Zero(), scene);
@@ -222,95 +222,122 @@ var engine = new BABYLON.NullEngine();
 
 // assetsManager.load();
 
-var scene = new BABYLON.Scene(engine);
-var camera = new BABYLON.ArcRotateCamera("Camera", -Math.PI / 1,  Math.PI / 1, 5, BABYLON.Vector3.Zero(), scene);
-camera.setPosition(new BABYLON.Vector3(-800,1200,-2000));
-camera.setTarget(BABYLON.Vector3.Zero());
-var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
-light.intensity = 1;
+// var scene = new BABYLON.Scene(engine);
+// var camera = new BABYLON.ArcRotateCamera("Camera", -Math.PI / 1,  Math.PI / 1, 5, BABYLON.Vector3.Zero(), scene);
+// camera.setPosition(new BABYLON.Vector3(-800,1200,-2000));
+// camera.setTarget(BABYLON.Vector3.Zero());
+// var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
+// light.intensity = 1;
 
 
-function createPart(name,opt,parent){
+// function createPart(name,opt,parent){
 
-    var part = BABYLON.MeshBuilder.CreateBox(name, opt.size, scene);
-    part.position = new BABYLON.Vector3(opt.pos.x, opt.pos.y, opt.pos.z);
+//     var part = BABYLON.MeshBuilder.CreateBox(name, opt.size, scene);
+//     part.position = new BABYLON.Vector3(opt.pos.x, opt.pos.y, opt.pos.z);
 
-    let mate = new BABYLON.StandardMaterial('mat-'+name, scene);
+//     let mate = new BABYLON.StandardMaterial('mat-'+name, scene);
 
-    if(parent) {
-        mate.specularPower = 200;
-        mate.specularColor = new BABYLON.Color3(0.5, 0.5, 0.5);
-        mate.diffuseTexture = new BABYLON.Texture(opt.mat.url,scene);
-        mate.diffuseTexture.wAng = opt.mat.grain*Math.PI/180;
-        part.parent = parent;
-    }else{
-        mate.alpha = 0;
-    }
+//     if(parent) {
+//         mate.specularPower = 200;
+//         mate.specularColor = new BABYLON.Color3(0.5, 0.5, 0.5);
+//         mate.diffuseTexture = new BABYLON.Texture(opt.mat.url,scene);
+//         mate.diffuseTexture.wAng = opt.mat.grain*Math.PI/180;
+//         part.parent = parent;
+//     }else{
+//         mate.alpha = 0;
+//     }
 
-    part.material = mate;
-
-    return part;
-}
-
-
-
-var parent;
-
-function createUnit(x,y,z,b){
-
-    var item = {
-        size:{width:x,depth:y,height:z},
-        pos:{x:0,y:0,z:0},
-        mat:{url:false,grain:0},
-        child:{
-            left:{
-                size:{width:b,depth:y,height:z},
-                pos:{x:-(x-b)/2,y:0,z:0},
-                mat:{url:"/playground/textures/crate.png",grain:90}
-            },
-            right:{
-                size:{width:b,depth:y,height:z},
-                pos:{x:(x-b)/2,y:0,z:0},
-                mat:{url:"/playground/textures/crate.png",grain:90}
-            },
-            top:{
-                size:{width:x-(b*2),depth:y,height:b},
-                pos:{x:0,y:(z-b-1)/2,z:0},
-                mat:{url:"/playground/textures/albedo.png",grain:0}
-            },
-            bottom:{
-                size:{width:x-(b*2),depth:y,height:b},
-                pos:{x:0,y:-(z-b-1)/2,z:0},
-                mat:{url:"/playground/textures/albedo.png",grain:0}
-            },
-            back:{
-                size:{width:x-(b*2),depth:b,height:z-(b*2)-1},
-                pos:{x:0,y:0,z:(y-b)/2-20},
-                mat:{url:"/playground/textures/albedo.png",grain:0}
-            },
-            shelf:{
-                size:{width:x-(b*2)-1,depth:y-b-30,height:b},
-                pos:{x:0,y:0,z:-((b+20)/2)+5},
-                mat:{url:"textures/crate.png",grain:45}
-            }
-        }
-    };
+//     part.material = mate;
+
+//     return part;
+// }
+
+
+
+// var parent;
+
+// function createUnit(x,y,z,b){
+
+//     var item = {
+//         size:{width:x,depth:y,height:z},
+//         pos:{x:0,y:0,z:0},
+//         mat:{url:false,grain:0},
+//         child:{
+//             left:{
+//                 size:{width:b,depth:y,height:z},
+//                 pos:{x:-(x-b)/2,y:0,z:0},
+//                 mat:{url:"/playground/textures/crate.png",grain:90}
+//             },
+//             right:{
+//                 size:{width:b,depth:y,height:z},
+//                 pos:{x:(x-b)/2,y:0,z:0},
+//                 mat:{url:"/playground/textures/crate.png",grain:90}
+//             },
+//             top:{
+//                 size:{width:x-(b*2),depth:y,height:b},
+//                 pos:{x:0,y:(z-b-1)/2,z:0},
+//                 mat:{url:"/playground/textures/albedo.png",grain:0}
+//             },
+//             bottom:{
+//                 size:{width:x-(b*2),depth:y,height:b},
+//                 pos:{x:0,y:-(z-b-1)/2,z:0},
+//                 mat:{url:"/playground/textures/albedo.png",grain:0}
+//             },
+//             back:{
+//                 size:{width:x-(b*2),depth:b,height:z-(b*2)-1},
+//                 pos:{x:0,y:0,z:(y-b)/2-20},
+//                 mat:{url:"/playground/textures/albedo.png",grain:0}
+//             },
+//             shelf:{
+//                 size:{width:x-(b*2)-1,depth:y-b-30,height:b},
+//                 pos:{x:0,y:0,z:-((b+20)/2)+5},
+//                 mat:{url:"textures/crate.png",grain:45}
+//             }
+//         }
+//     };
 
-    if(parent){
-        parent.dispose();
-    }
-    
-    parent = createPart("Unit",item,false);
+//     if(parent){
+//         parent.dispose();
+//     }
 
-    Object.keys(item.child).forEach(function(key) {
-        createPart(key,item.child[key],parent);
-    });
+//     parent = createPart("Unit",item,false);
+
+//     Object.keys(item.child).forEach(function(key) {
+//         createPart(key,item.child[key],parent);
+//     });
 
-    return item;
-}
+//     return item;
+// }
 
-createUnit(600,300,900,18);
+// createUnit(600,300,900,18);
+
+
+// var serialized = BABYLON.SceneSerializer.SerializeMesh(parent, true, true);
+// console.log(serialized);
+
+var scene = new BABYLON.Scene(engine);
 
+var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 20, 100), scene);
+
+var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene);
+
+BABYLON.SceneLoader.ImportMesh("", "https://playground.babylonjs.com/scenes/", "skull.babylon", scene, function(newMeshes) {
+    camera.target = newMeshes[0];
+
+    console.log("Meshes loaded from babylon file: " + newMeshes.length);
+    for (var index = 0; index < newMeshes.length; index++) {
+        console.log(newMeshes[index].toString());
+    }
+
+    BABYLON.SceneLoader.ImportMesh("", "https://www.babylonjs.com/Assets/DamagedHelmet/glTF/", "DamagedHelmet.gltf", scene, function(meshes) {
+        console.log("Meshes loaded from gltf file: " + meshes.length);
+        for (var index = 0; index < meshes.length; index++) {
+            console.log(meshes[index].toString());
+        }
+    });
 
-var serialized = BABYLON.SceneSerializer.SerializeMesh(parent, true, true);
-console.log(serialized);
+    console.log("render started")
+    engine.runRenderLoop(function() {
+        scene.render();
+    })
+});

二进制
tests/validation/ReferenceImages/advancedShadows.png