sebavan 6 年之前
父节点
当前提交
e528555d3b

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


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


+ 88 - 0
dist/preview release/gui/babylon.gui.d.ts

@@ -70,6 +70,22 @@ declare module BABYLON.GUI {
                 */
                 */
             onControlPickedObservable: BABYLON.Observable<Control>;
             onControlPickedObservable: BABYLON.Observable<Control>;
             /**
             /**
+                * BABYLON.Observable event triggered before layout is evaluated
+                */
+            onBeginLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
+            /**
+                * BABYLON.Observable event triggered after the layout was evaluated
+                */
+            onEndLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
+            /**
+                * BABYLON.Observable event triggered before the texture is rendered
+                */
+            onBeginRenderObservable: BABYLON.Observable<AdvancedDynamicTexture>;
+            /**
+                * 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;
             premulAlpha: boolean;
@@ -249,6 +265,47 @@ declare module BABYLON.GUI {
 }
 }
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     /**
     /**
+        * This class can be used to get instrumentation data from a AdvancedDynamicTexture object
+        */
+    export class AdvancedDynamicTextureInstrumentation implements BABYLON.IDisposable {
+            /**
+                * Define the instrumented AdvancedDynamicTexture.
+                */
+            texture: AdvancedDynamicTexture;
+            /**
+                * Gets the perf counter used to capture render time
+                */
+            readonly renderTimeCounter: BABYLON.PerfCounter;
+            /**
+                * Gets the perf counter used to capture layout time
+                */
+            readonly layoutTimeCounter: BABYLON.PerfCounter;
+            /**
+                * Enable or disable the render time capture
+                */
+            captureRenderTime: boolean;
+            /**
+                * Enable or disable the layout time capture
+                */
+            captureLayoutTime: boolean;
+            /**
+                * Instantiates a new advanced dynamic texture instrumentation.
+                * This class can be used to get instrumentation data from an AdvancedDynamicTexture object
+                * @param texture Defines the AdvancedDynamicTexture to instrument
+                */
+            constructor(
+            /**
+                * Define the instrumented AdvancedDynamicTexture.
+                */
+            texture: AdvancedDynamicTexture);
+            /**
+                * Dispose and release associated resources.
+                */
+            dispose(): void;
+    }
+}
+declare module BABYLON.GUI {
+    /**
         * Class used to transport BABYLON.Vector2 information for pointer events
         * Class used to transport BABYLON.Vector2 information for pointer events
         */
         */
     export class Vector2WithInfo extends BABYLON.Vector2 {
     export class Vector2WithInfo extends BABYLON.Vector2 {
@@ -2055,6 +2112,14 @@ declare module BABYLON.GUI {
      */
      */
     export class ScrollViewer extends Rectangle {
     export class ScrollViewer extends Rectangle {
             /**
             /**
+                * Gets the horizontal scrollbar
+                */
+            readonly horizontalBar: ScrollBar;
+            /**
+                * Gets the vertical scrollbar
+                */
+            readonly verticalBar: ScrollBar;
+            /**
                 * Adds a new control to the current container
                 * Adds a new control to the current container
                 * @param control defines the control to add
                 * @param control defines the control to add
                 * @returns the current container
                 * @returns the current container
@@ -2973,4 +3038,27 @@ declare module BABYLON.GUI {
             getClassName(): string;
             getClassName(): string;
             static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FluentMaterial;
             static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FluentMaterial;
     }
     }
+}
+declare module BABYLON.GUI {
+    /**
+        * Class used to create slider controls
+        */
+    export class ScrollBar extends BaseSlider {
+            name?: string | undefined;
+            /** Gets or sets border color */
+            borderColor: string;
+            /** Gets or sets background color */
+            background: string;
+            /**
+                * Creates a new Slider
+                * @param name defines the control name
+                */
+            constructor(name?: string | undefined);
+            protected _getTypeName(): string;
+            protected _getThumbThickness(): number;
+            _draw(context: CanvasRenderingContext2D): void;
+            /** @hidden */
+            protected _updateValueFromPointer(x: number, y: number): void;
+            _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
+    }
 }
 }

文件差异内容过多而无法显示
+ 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


+ 185 - 0
dist/preview release/gui/babylon.gui.module.d.ts

@@ -11,6 +11,7 @@ declare module 'babylonjs-gui' {
 declare module 'babylonjs-gui/2D' {
 declare module 'babylonjs-gui/2D' {
     export * from "babylonjs-gui/2D/controls";
     export * from "babylonjs-gui/2D/controls";
     export * from "babylonjs-gui/2D/advancedDynamicTexture";
     export * from "babylonjs-gui/2D/advancedDynamicTexture";
+    export * from "babylonjs-gui/2D/adtInstrumentation";
     export * from "babylonjs-gui/2D/math2D";
     export * from "babylonjs-gui/2D/math2D";
     export * from "babylonjs-gui/2D/measure";
     export * from "babylonjs-gui/2D/measure";
     export * from "babylonjs-gui/2D/multiLinePoint";
     export * from "babylonjs-gui/2D/multiLinePoint";
@@ -116,6 +117,22 @@ declare module 'babylonjs-gui/2D/advancedDynamicTexture' {
                 */
                 */
             onControlPickedObservable: Observable<Control>;
             onControlPickedObservable: Observable<Control>;
             /**
             /**
+                * Observable event triggered before layout is evaluated
+                */
+            onBeginLayoutObservable: Observable<AdvancedDynamicTexture>;
+            /**
+                * Observable event triggered after the layout was evaluated
+                */
+            onEndLayoutObservable: Observable<AdvancedDynamicTexture>;
+            /**
+                * Observable event triggered before the texture is rendered
+                */
+            onBeginRenderObservable: Observable<AdvancedDynamicTexture>;
+            /**
+                * 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;
             premulAlpha: boolean;
@@ -294,6 +311,50 @@ declare module 'babylonjs-gui/2D/advancedDynamicTexture' {
     }
     }
 }
 }
 
 
+declare module 'babylonjs-gui/2D/adtInstrumentation' {
+    import { IDisposable, PerfCounter } from "babylonjs";
+    import { AdvancedDynamicTexture } from "babylonjs-gui/2D/advancedDynamicTexture";
+    /**
+        * This class can be used to get instrumentation data from a AdvancedDynamicTexture object
+        */
+    export class AdvancedDynamicTextureInstrumentation implements IDisposable {
+            /**
+                * Define the instrumented AdvancedDynamicTexture.
+                */
+            texture: AdvancedDynamicTexture;
+            /**
+                * Gets the perf counter used to capture render time
+                */
+            readonly renderTimeCounter: PerfCounter;
+            /**
+                * Gets the perf counter used to capture layout time
+                */
+            readonly layoutTimeCounter: PerfCounter;
+            /**
+                * Enable or disable the render time capture
+                */
+            captureRenderTime: boolean;
+            /**
+                * Enable or disable the layout time capture
+                */
+            captureLayoutTime: boolean;
+            /**
+                * Instantiates a new advanced dynamic texture instrumentation.
+                * This class can be used to get instrumentation data from an AdvancedDynamicTexture object
+                * @param texture Defines the AdvancedDynamicTexture to instrument
+                */
+            constructor(
+            /**
+                * Define the instrumented AdvancedDynamicTexture.
+                */
+            texture: AdvancedDynamicTexture);
+            /**
+                * Dispose and release associated resources.
+                */
+            dispose(): void;
+    }
+}
+
 declare module 'babylonjs-gui/2D/math2D' {
 declare module 'babylonjs-gui/2D/math2D' {
     import { Vector2, Nullable } from "babylonjs";
     import { Vector2, Nullable } from "babylonjs";
     /**
     /**
@@ -2202,11 +2263,20 @@ declare module 'babylonjs-gui/2D/controls/scrollViewers/scrollViewer' {
     import { Container } from "babylonjs-gui/2D/controls/container";
     import { Container } from "babylonjs-gui/2D/controls/container";
     import { Nullable } from "babylonjs";
     import { Nullable } from "babylonjs";
     import { AdvancedDynamicTexture, Measure } from "2D";
     import { AdvancedDynamicTexture, Measure } from "2D";
+    import { ScrollBar } from "babylonjs-gui/2D/controls/sliders/scrollBar";
     /**
     /**
         * Class used to hold a viewer window and sliders in a grid
         * Class used to hold a viewer window and sliders in a grid
      */
      */
     export class ScrollViewer extends Rectangle {
     export class ScrollViewer extends Rectangle {
             /**
             /**
+                * Gets the horizontal scrollbar
+                */
+            readonly horizontalBar: ScrollBar;
+            /**
+                * Gets the vertical scrollbar
+                */
+            readonly verticalBar: ScrollBar;
+            /**
                 * Adds a new control to the current container
                 * Adds a new control to the current container
                 * @param control defines the control to add
                 * @param control defines the control to add
                 * @returns the current container
                 * @returns the current container
@@ -3199,6 +3269,33 @@ declare module 'babylonjs-gui/3D/materials/fluentMaterial' {
     }
     }
 }
 }
 
 
+declare module 'babylonjs-gui/2D/controls/sliders/scrollBar' {
+    import { BaseSlider } from "babylonjs-gui/2D/controls/sliders/baseSlider";
+    import { Control } from "babylonjs-gui/2D/controls";
+    import { Vector2 } from "babylonjs";
+    /**
+        * Class used to create slider controls
+        */
+    export class ScrollBar extends BaseSlider {
+            name?: string | undefined;
+            /** Gets or sets border color */
+            borderColor: string;
+            /** Gets or sets background color */
+            background: string;
+            /**
+                * Creates a new Slider
+                * @param name defines the control name
+                */
+            constructor(name?: string | undefined);
+            protected _getTypeName(): string;
+            protected _getThumbThickness(): number;
+            _draw(context: CanvasRenderingContext2D): void;
+            /** @hidden */
+            protected _updateValueFromPointer(x: number, y: number): void;
+            _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
+    }
+}
+
 
 
 /*Babylon.js GUI*/
 /*Babylon.js GUI*/
 // Dependencies for this module:
 // Dependencies for this module:
@@ -3272,6 +3369,22 @@ declare module BABYLON.GUI {
                 */
                 */
             onControlPickedObservable: BABYLON.Observable<Control>;
             onControlPickedObservable: BABYLON.Observable<Control>;
             /**
             /**
+                * BABYLON.Observable event triggered before layout is evaluated
+                */
+            onBeginLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
+            /**
+                * BABYLON.Observable event triggered after the layout was evaluated
+                */
+            onEndLayoutObservable: BABYLON.Observable<AdvancedDynamicTexture>;
+            /**
+                * BABYLON.Observable event triggered before the texture is rendered
+                */
+            onBeginRenderObservable: BABYLON.Observable<AdvancedDynamicTexture>;
+            /**
+                * 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;
             premulAlpha: boolean;
@@ -3451,6 +3564,47 @@ declare module BABYLON.GUI {
 }
 }
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     /**
     /**
+        * This class can be used to get instrumentation data from a AdvancedDynamicTexture object
+        */
+    export class AdvancedDynamicTextureInstrumentation implements BABYLON.IDisposable {
+            /**
+                * Define the instrumented AdvancedDynamicTexture.
+                */
+            texture: AdvancedDynamicTexture;
+            /**
+                * Gets the perf counter used to capture render time
+                */
+            readonly renderTimeCounter: BABYLON.PerfCounter;
+            /**
+                * Gets the perf counter used to capture layout time
+                */
+            readonly layoutTimeCounter: BABYLON.PerfCounter;
+            /**
+                * Enable or disable the render time capture
+                */
+            captureRenderTime: boolean;
+            /**
+                * Enable or disable the layout time capture
+                */
+            captureLayoutTime: boolean;
+            /**
+                * Instantiates a new advanced dynamic texture instrumentation.
+                * This class can be used to get instrumentation data from an AdvancedDynamicTexture object
+                * @param texture Defines the AdvancedDynamicTexture to instrument
+                */
+            constructor(
+            /**
+                * Define the instrumented AdvancedDynamicTexture.
+                */
+            texture: AdvancedDynamicTexture);
+            /**
+                * Dispose and release associated resources.
+                */
+            dispose(): void;
+    }
+}
+declare module BABYLON.GUI {
+    /**
         * Class used to transport BABYLON.Vector2 information for pointer events
         * Class used to transport BABYLON.Vector2 information for pointer events
         */
         */
     export class Vector2WithInfo extends BABYLON.Vector2 {
     export class Vector2WithInfo extends BABYLON.Vector2 {
@@ -5257,6 +5411,14 @@ declare module BABYLON.GUI {
      */
      */
     export class ScrollViewer extends Rectangle {
     export class ScrollViewer extends Rectangle {
             /**
             /**
+                * Gets the horizontal scrollbar
+                */
+            readonly horizontalBar: ScrollBar;
+            /**
+                * Gets the vertical scrollbar
+                */
+            readonly verticalBar: ScrollBar;
+            /**
                 * Adds a new control to the current container
                 * Adds a new control to the current container
                 * @param control defines the control to add
                 * @param control defines the control to add
                 * @returns the current container
                 * @returns the current container
@@ -6175,4 +6337,27 @@ declare module BABYLON.GUI {
             getClassName(): string;
             getClassName(): string;
             static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FluentMaterial;
             static Parse(source: any, scene: BABYLON.Scene, rootUrl: string): FluentMaterial;
     }
     }
+}
+declare module BABYLON.GUI {
+    /**
+        * Class used to create slider controls
+        */
+    export class ScrollBar extends BaseSlider {
+            name?: string | undefined;
+            /** Gets or sets border color */
+            borderColor: string;
+            /** Gets or sets background color */
+            background: string;
+            /**
+                * Creates a new Slider
+                * @param name defines the control name
+                */
+            constructor(name?: string | undefined);
+            protected _getTypeName(): string;
+            protected _getThumbThickness(): number;
+            _draw(context: CanvasRenderingContext2D): void;
+            /** @hidden */
+            protected _updateValueFromPointer(x: number, y: number): void;
+            _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
+    }
 }
 }

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


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


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

@@ -140,6 +140,7 @@
 - Fixed infiniteDistance not working anymore ([Sebavan](https://github.com/Sebavan))
 - Fixed infiniteDistance not working anymore ([Sebavan](https://github.com/Sebavan))
 - Fixed bug in SolidParticle BoundingSphere update within the SolidParticleSystem ([barroij](https://github.com/barroij))
 - Fixed bug in SolidParticle BoundingSphere update within the SolidParticleSystem ([barroij](https://github.com/barroij))
 - Update Picking so that when the picked Mesh is a LinesMesh, the index of the picked line is returned in the `faceId` property of the `PickingInfo`, as we do with face index the picked Mesh is made of triangle faces ([barroij](https://github.com/barroij))
 - Update Picking so that when the picked Mesh is a LinesMesh, the index of the picked line is returned in the `faceId` property of the `PickingInfo`, as we do with face index the picked Mesh is made of triangle faces ([barroij](https://github.com/barroij))
+- Do not clone mesh observables ([Sebavan](https://github.com/Sebavan))
 
 
 ### Viewer
 ### Viewer
 
 

+ 122 - 0
gui/src/2D/adtInstrumentation.ts

@@ -0,0 +1,122 @@
+import { IDisposable, PerfCounter, Nullable, Observer } from "babylonjs";
+import { AdvancedDynamicTexture } from "./advancedDynamicTexture";
+
+/**
+ * This class can be used to get instrumentation data from a AdvancedDynamicTexture object
+ */
+export class AdvancedDynamicTextureInstrumentation implements IDisposable {
+    private _captureRenderTime = false;
+    private _renderTime = new PerfCounter();
+
+    private _captureLayoutTime = false;
+    private _layoutTime = new PerfCounter();
+
+    // Observers
+    private _onBeginRenderObserver: Nullable<Observer<AdvancedDynamicTexture>> = null;
+    private _onEndRenderObserver: Nullable<Observer<AdvancedDynamicTexture>> = null;
+    private _onBeginLayoutObserver: Nullable<Observer<AdvancedDynamicTexture>> = null;
+    private _onEndLayoutObserver: Nullable<Observer<AdvancedDynamicTexture>> = null;
+
+    // Properties
+
+    /**
+     * Gets the perf counter used to capture render time
+     */
+    public get renderTimeCounter(): PerfCounter {
+        return this._renderTime;
+    }
+
+    /**
+     * Gets the perf counter used to capture layout time
+     */
+    public get layoutTimeCounter(): PerfCounter {
+        return this._layoutTime;
+    }
+
+    /**
+     * Enable or disable the render time capture
+     */
+    public get captureRenderTime(): boolean {
+        return this._captureRenderTime;
+    }
+
+    public set captureRenderTime(value: boolean) {
+        if (value === this._captureRenderTime) {
+            return;
+        }
+
+        this._captureRenderTime = value;
+
+        if (value) {
+            this._onBeginRenderObserver = this.texture.onBeginRenderObservable.add(() => {
+                this._renderTime.beginMonitoring();
+            });
+
+            this._onEndRenderObserver = this.texture.onEndRenderObservable.add(() => {
+                this._renderTime.endMonitoring(true);
+            });
+        } else {
+            this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver);
+            this._onBeginRenderObserver = null;
+            this.texture.onEndRenderObservable.remove(this._onEndRenderObserver);
+            this._onEndRenderObserver = null;
+        }
+    }
+
+    /**
+     * Enable or disable the layout time capture
+     */
+    public get captureLayoutTime(): boolean {
+        return this._captureLayoutTime;
+    }
+
+    public set captureLayoutTime(value: boolean) {
+        if (value === this._captureLayoutTime) {
+            return;
+        }
+
+        this._captureLayoutTime = value;
+
+        if (value) {
+            this._onBeginLayoutObserver = this.texture.onBeginLayoutObservable.add(() => {
+                this._layoutTime.beginMonitoring();
+            });
+
+            this._onEndLayoutObserver = this.texture.onEndLayoutObservable.add(() => {
+                this._layoutTime.endMonitoring(true);
+            });
+        } else {
+            this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver);
+            this._onBeginLayoutObserver = null;
+            this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver);
+            this._onEndLayoutObserver = null;
+        }
+    }
+    /**
+     * Instantiates a new advanced dynamic texture instrumentation.
+     * This class can be used to get instrumentation data from an AdvancedDynamicTexture object
+     * @param texture Defines the AdvancedDynamicTexture to instrument
+     */
+    public constructor(
+        /**
+         * Define the instrumented AdvancedDynamicTexture.
+         */
+        public texture: AdvancedDynamicTexture) {
+    }
+
+    /**
+     * Dispose and release associated resources.
+     */
+    public dispose() {
+        this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver);
+        this._onBeginRenderObserver = null;
+        this.texture.onEndRenderObservable.remove(this._onEndRenderObserver);
+        this._onEndRenderObserver = null;
+        this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver);
+        this._onBeginLayoutObserver = null;
+        this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver);
+        this._onEndLayoutObserver = null;
+
+        (<any>this.texture) = null;
+    }
+}

+ 30 - 0
gui/src/2D/advancedDynamicTexture.ts

@@ -86,6 +86,26 @@ export class AdvancedDynamicTexture extends DynamicTexture {
     public onControlPickedObservable = new Observable<Control>();
     public onControlPickedObservable = new Observable<Control>();
 
 
     /**
     /**
+     * Observable event triggered before layout is evaluated
+     */
+    public onBeginLayoutObservable = new Observable<AdvancedDynamicTexture>();
+
+    /**
+     * Observable event triggered after the layout was evaluated
+     */
+    public onEndLayoutObservable = new Observable<AdvancedDynamicTexture>();
+
+    /**
+     * Observable event triggered before the texture is rendered
+     */
+    public onBeginRenderObservable = new Observable<AdvancedDynamicTexture>();
+
+    /**
+     * Observable event triggered after the texture was rendered
+     */
+    public onEndRenderObservable = new 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
      */
      */
     public premulAlpha = false;
     public premulAlpha = false;
@@ -435,6 +455,10 @@ export class AdvancedDynamicTexture extends DynamicTexture {
         this._rootContainer.dispose();
         this._rootContainer.dispose();
         this.onClipboardObservable.clear();
         this.onClipboardObservable.clear();
         this.onControlPickedObservable.clear();
         this.onControlPickedObservable.clear();
+        this.onBeginRenderObservable.clear();
+        this.onEndRenderObservable.clear();
+        this.onBeginLayoutObservable.clear();
+        this.onEndLayoutObservable.clear();
 
 
         super.dispose();
         super.dispose();
     }
     }
@@ -572,11 +596,17 @@ export class AdvancedDynamicTexture extends DynamicTexture {
         // Render
         // Render
         context.font = "18px Arial";
         context.font = "18px Arial";
         context.strokeStyle = "white";
         context.strokeStyle = "white";
+
+        this.onBeginLayoutObservable.notifyObservers(this);
         var measure = new Measure(0, 0, renderWidth, renderHeight);
         var measure = new Measure(0, 0, renderWidth, renderHeight);
         this._rootContainer._layout(measure, context);
         this._rootContainer._layout(measure, context);
+        this.onEndLayoutObservable.notifyObservers(this);
+
         this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing
         this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing
 
 
+        this.onBeginRenderObservable.notifyObservers(this);
         this._rootContainer._render(context);
         this._rootContainer._render(context);
+        this.onEndRenderObservable.notifyObservers(this);
     }
     }
 
 
     /** @hidden */
     /** @hidden */

+ 27 - 0
gui/src/2D/controls/scrollViewers/scrollViewer.ts

@@ -30,6 +30,20 @@ export class ScrollViewer extends Rectangle {
     private _clientHeight: number;
     private _clientHeight: number;
 
 
     /**
     /**
+     * Gets the horizontal scrollbar
+     */
+    public get horizontalBar(): ScrollBar {
+        return this._horizontalBar;
+    }
+
+    /**
+     * Gets the vertical scrollbar
+     */
+    public get verticalBar(): ScrollBar {
+        return this._verticalBar;
+    }
+
+    /**
      * Adds a new control to the current container
      * Adds a new control to the current container
      * @param control defines the control to add
      * @param control defines the control to add
      * @returns the current container
      * @returns the current container
@@ -294,6 +308,19 @@ export class ScrollViewer extends Rectangle {
         this._endLeft = this._clientWidth - windowContentsWidth;
         this._endLeft = this._clientWidth - windowContentsWidth;
         this._endTop = this._clientHeight - windowContentsHeight;
         this._endTop = this._clientHeight - windowContentsHeight;
 
 
+        const newLeft = this._horizontalBar.value * this._endLeft + "px";
+        const newTop = this._verticalBar.value * this._endTop + "px";
+
+        if (newLeft !== this._window.left) {
+            this._window.left = newLeft;
+            this._rebuildLayout = true;
+        }
+
+        if (newTop !== this._window.top) {
+            this._window.top = newTop;
+            this._rebuildLayout = true;
+        }
+
         let horizontalMultiplicator = this._clientWidth / windowContentsWidth;
         let horizontalMultiplicator = this._clientWidth / windowContentsWidth;
         let verticalMultiplicator = this._clientHeight / windowContentsHeight;
         let verticalMultiplicator = this._clientHeight / windowContentsHeight;
 
 

+ 1 - 0
gui/src/2D/index.ts

@@ -1,6 +1,7 @@
 export * from "./controls";
 export * from "./controls";
 
 
 export * from "./advancedDynamicTexture";
 export * from "./advancedDynamicTexture";
+export * from "./adtInstrumentation";
 export * from "./math2D";
 export * from "./math2D";
 export * from "./measure";
 export * from "./measure";
 export * from "./multiLinePoint";
 export * from "./multiLinePoint";

+ 28 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/materials/texturePropertyGridComponent.tsx

@@ -1,5 +1,5 @@
 import * as React from "react";
 import * as React from "react";
-import { Texture, BaseTexture, CubeTexture, Observable, Tools } from "babylonjs";
+import { Texture, BaseTexture, CubeTexture, Observable, Nullable } from "babylonjs";
 import { PropertyChangedEvent } from "../../../../propertyChangedEvent";
 import { PropertyChangedEvent } from "../../../../propertyChangedEvent";
 import { LineContainerComponent } from "../../../lineContainerComponent";
 import { LineContainerComponent } from "../../../lineContainerComponent";
 import { SliderLineComponent } from "../../../lines/sliderLineComponent";
 import { SliderLineComponent } from "../../../lines/sliderLineComponent";
@@ -10,6 +10,7 @@ import { FloatLineComponent } from "../../../lines/floatLineComponent";
 import { OptionsLineComponent } from "../../../lines/optionsLineComponent";
 import { OptionsLineComponent } from "../../../lines/optionsLineComponent";
 import { FileButtonLineComponent } from "../../../lines/fileButtonLineComponent";
 import { FileButtonLineComponent } from "../../../lines/fileButtonLineComponent";
 import { LockObject } from "../lockObject";
 import { LockObject } from "../lockObject";
+import { ValueLineComponent } from "../../../lines/valueLineComponent";
 
 
 interface ITexturePropertyGridComponentProps {
 interface ITexturePropertyGridComponentProps {
     texture: BaseTexture;
     texture: BaseTexture;
@@ -18,10 +19,34 @@ interface ITexturePropertyGridComponentProps {
 }
 }
 
 
 export class TexturePropertyGridComponent extends React.Component<ITexturePropertyGridComponentProps> {
 export class TexturePropertyGridComponent extends React.Component<ITexturePropertyGridComponentProps> {
+
+    private _adtInstrumentation: Nullable<BABYLON.GUI.AdvancedDynamicTextureInstrumentation>;
+
     constructor(props: ITexturePropertyGridComponentProps) {
     constructor(props: ITexturePropertyGridComponentProps) {
         super(props);
         super(props);
     }
     }
 
 
+    componentWillMount() {
+        const texture = this.props.texture
+
+        if (!texture || !(texture as any).rootContainer) {
+            return;
+        }
+
+        const adt = texture as BABYLON.GUI.AdvancedDynamicTexture;
+
+        this._adtInstrumentation = new BABYLON.GUI.AdvancedDynamicTextureInstrumentation(adt);
+        this._adtInstrumentation.captureRenderTime = true;
+        this._adtInstrumentation.captureLayoutTime = true;
+    }
+
+    componentWillUnmount() {
+        if (this._adtInstrumentation) {
+            this._adtInstrumentation.dispose();
+            this._adtInstrumentation = null;
+        }
+    }
+
     updateTexture(file: File) {
     updateTexture(file: File) {
         const texture = this.props.texture;
         const texture = this.props.texture;
         Tools.ReadFile(file, (data) => {
         Tools.ReadFile(file, (data) => {
@@ -76,6 +101,8 @@ export class TexturePropertyGridComponent extends React.Component<ITextureProper
                 {
                 {
                     (texture as any).rootContainer &&
                     (texture as any).rootContainer &&
                     <LineContainerComponent title="ADVANCED TEXTURE PROPERTIES">
                     <LineContainerComponent title="ADVANCED TEXTURE PROPERTIES">
+                        <ValueLineComponent label="Last layout time" value={this._adtInstrumentation!.renderTimeCounter.current} units="ms" />
+                        <ValueLineComponent label="Last render time" value={this._adtInstrumentation!.layoutTimeCounter.current} units="ms" />
                         <SliderLineComponent label="Render scale" minimum={0.1} maximum={5} step={0.1} target={texture} propertyName="renderScale" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                         <SliderLineComponent label="Render scale" minimum={0.1} maximum={5} step={0.1} target={texture} propertyName="renderScale" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                         <CheckBoxLineComponent label="Premultiply alpha" target={texture} propertyName="premulAlpha" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                         <CheckBoxLineComponent label="Premultiply alpha" target={texture} propertyName="premulAlpha" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                         <FloatLineComponent lockObject={this.props.lockObject} label="Ideal width" target={texture} propertyName="idealWidth" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
                         <FloatLineComponent lockObject={this.props.lockObject} label="Ideal width" target={texture} propertyName="idealWidth" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />

+ 30 - 6
src/Materials/Textures/baseTexture.ts

@@ -162,13 +162,41 @@ declare type Animation = import("Animations/animation").Animation;
          * Define if the texture is a cube texture or if false a 2d texture.
          * Define if the texture is a cube texture or if false a 2d texture.
          */
          */
         @serialize()
         @serialize()
-        public isCube = false;
+        public get isCube(): boolean {
+            if (!this._texture) {
+                return false;
+            }
+
+            return this._texture.isCube;
+        }
+
+        public set isCube(value: boolean) {
+            if (!this._texture) {
+                return;
+            }
+
+            this._texture.isCube = value;
+        }
 
 
         /**
         /**
          * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
          * Define if the texture is a 3d texture (webgl 2) or if false a 2d texture.
          */
          */
         @serialize()
         @serialize()
-        public is3D = false;
+        public get is3D(): boolean {
+            if (!this._texture) {
+                return false;
+            }
+
+            return this._texture.is3D;
+        }
+
+        public set is3D(value: boolean) {
+            if (!this._texture) {
+                return;
+            }
+
+            this._texture.is3D = value;
+        }
 
 
         /**
         /**
          * Define if the texture contains data in gamma space (most of the png/jpg aside bump).
          * Define if the texture contains data in gamma space (most of the png/jpg aside bump).
@@ -292,9 +320,6 @@ declare type Animation = import("Animations/animation").Animation;
         private _scene: Nullable<Scene>;
         private _scene: Nullable<Scene>;
 
 
         /** @hidden */
         /** @hidden */
-        public _samplingMode: number;
-
-        /** @hidden */
         public _texture: Nullable<InternalTexture>;
         public _texture: Nullable<InternalTexture>;
         private _uid: Nullable<string>;
         private _uid: Nullable<string>;
 
 
@@ -454,7 +479,6 @@ declare type Animation = import("Animations/animation").Animation;
                 return;
                 return;
             }
             }
 
 
-            this._samplingMode = samplingMode;
             scene.getEngine().updateTextureSamplingMode(samplingMode, this._texture);
             scene.getEngine().updateTextureSamplingMode(samplingMode, this._texture);
         }
         }
 
 

+ 1 - 1
src/Materials/Textures/dynamicTexture.ts

@@ -78,7 +78,7 @@ import { Constants } from "Engines/constants";
 
 
             this.releaseInternalTexture();
             this.releaseInternalTexture();
 
 
-            this._texture = this._engine.createDynamicTexture(textureSize.width, textureSize.height, this._generateMipMaps, this._samplingMode);
+            this._texture = this._engine.createDynamicTexture(textureSize.width, textureSize.height, this._generateMipMaps, this.samplingMode);
         }
         }
 
 
         /**
         /**

+ 15 - 8
src/Materials/Textures/texture.ts

@@ -203,6 +203,9 @@ declare type RenderTargetTexture = import ("Materials/Textures/renderTargetTextu
         private _cachedCoordinatesMode: number;
         private _cachedCoordinatesMode: number;
 
 
         /** @hidden */
         /** @hidden */
+        protected _initialSamplingMode = Texture.BILINEAR_SAMPLINGMODE;
+
+        /** @hidden */
         public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>;
         public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>;
         private _deleteBuffer: boolean;
         private _deleteBuffer: boolean;
         protected _format: Nullable<number>;
         protected _format: Nullable<number>;
@@ -231,7 +234,11 @@ declare type RenderTargetTexture = import ("Materials/Textures/renderTargetTextu
          * Get the current sampling mode associated with the texture.
          * Get the current sampling mode associated with the texture.
          */
          */
         public get samplingMode(): number {
         public get samplingMode(): number {
-            return this._samplingMode;
+            if (!this._texture) {
+                return this._initialSamplingMode;
+            }
+
+            return this._texture.samplingMode;
         }
         }
 
 
         /**
         /**
@@ -263,7 +270,7 @@ declare type RenderTargetTexture = import ("Materials/Textures/renderTargetTextu
             this.url = url;
             this.url = url;
             this._noMipmap = noMipmap;
             this._noMipmap = noMipmap;
             this._invertY = invertY;
             this._invertY = invertY;
-            this._samplingMode = samplingMode;
+            this._initialSamplingMode = samplingMode;
             this._buffer = buffer;
             this._buffer = buffer;
             this._deleteBuffer = deleteBuffer;
             this._deleteBuffer = deleteBuffer;
             if (format) {
             if (format) {
@@ -303,7 +310,7 @@ declare type RenderTargetTexture = import ("Materials/Textures/renderTargetTextu
 
 
             if (!this._texture) {
             if (!this._texture) {
                 if (!scene.useDelayedTextureLoading) {
                 if (!scene.useDelayedTextureLoading) {
-                    this._texture = scene.getEngine().createTexture(this.url, noMipmap, invertY, scene, this._samplingMode, load, onError, this._buffer, undefined, this._format);
+                    this._texture = scene.getEngine().createTexture(this.url, noMipmap, invertY, scene, samplingMode, load, onError, this._buffer, undefined, this._format);
                     if (deleteBuffer) {
                     if (deleteBuffer) {
                         delete this._buffer;
                         delete this._buffer;
                     }
                     }
@@ -359,11 +366,11 @@ declare type RenderTargetTexture = import ("Materials/Textures/renderTargetTextu
                 return;
                 return;
             }
             }
 
 
-            this.delayLoadState = Constants.DELAYLOADSTATE_LOADED;
-            this._texture = this._getFromCache(this.url, this._noMipmap, this._samplingMode);
+            this.delayLoadState = Engine.DELAYLOADSTATE_LOADED;
+            this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode);
 
 
             if (!this._texture) {
             if (!this._texture) {
-                this._texture = scene.getEngine().createTexture(this.url, this._noMipmap, this._invertY, scene, this._samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format);
+                this._texture = scene.getEngine().createTexture(this.url, this._noMipmap, this._invertY, scene, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format);
                 if (this._deleteBuffer) {
                 if (this._deleteBuffer) {
                     delete this._buffer;
                     delete this._buffer;
                 }
                 }
@@ -537,7 +544,7 @@ declare type RenderTargetTexture = import ("Materials/Textures/renderTargetTextu
          */
          */
         public clone(): Texture {
         public clone(): Texture {
             return SerializationHelper.Clone(() => {
             return SerializationHelper.Clone(() => {
-                return new Texture(this._texture ? this._texture.url : null, this.getScene(), this._noMipmap, this._invertY, this._samplingMode);
+                return new Texture(this._texture ? this._texture.url : null, this.getScene(), this._noMipmap, this._invertY, this.samplingMode);
             }, this);
             }, this);
         }
         }
 
 
@@ -656,7 +663,7 @@ declare type RenderTargetTexture = import ("Materials/Textures/renderTargetTextu
             // Update Sampling Mode
             // Update Sampling Mode
             if (parsedTexture.samplingMode) {
             if (parsedTexture.samplingMode) {
                 var sampling: number = parsedTexture.samplingMode;
                 var sampling: number = parsedTexture.samplingMode;
-                if (texture && texture._samplingMode !== sampling) {
+                if (texture && texture.samplingMode !== sampling) {
                     texture.updateSamplingMode(sampling);
                     texture.updateSamplingMode(sampling);
                 }
                 }
             }
             }

+ 2 - 2
src/Materials/Textures/videoTexture.ts

@@ -96,7 +96,7 @@ import { Texture } from "Materials/Textures/texture";
 
 
             this._engine = this.getScene()!.getEngine();
             this._engine = this.getScene()!.getEngine();
             this._generateMipMaps = generateMipMaps;
             this._generateMipMaps = generateMipMaps;
-            this._samplingMode = samplingMode;
+            this._initialSamplingMode = samplingMode;
             this.autoUpdateTexture = settings.autoUpdateTexture;
             this.autoUpdateTexture = settings.autoUpdateTexture;
 
 
             this.name = name || this._getName(src);
             this.name = name || this._getName(src);
@@ -190,7 +190,7 @@ import { Texture } from "Materials/Textures/texture";
                 this.video.videoWidth,
                 this.video.videoWidth,
                 this.video.videoHeight,
                 this.video.videoHeight,
                 this._generateMipMaps,
                 this._generateMipMaps,
-                this._samplingMode
+                this.samplingMode
             );
             );
 
 
             if (!this.video.autoplay && !this._settings.poster) {
             if (!this.video.autoplay && !this._settings.poster) {

+ 3 - 1
src/Meshes/mesh.ts

@@ -312,7 +312,9 @@ declare type GroundMesh = import("./groundMesh").GroundMesh;
                 // Deep copy
                 // Deep copy
                 Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances", "parent", "uniqueId",
                 Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances", "parent", "uniqueId",
                     "source", "metadata", "hasLODLevels", "geometry", "isBlocked", "areNormalsFrozen",
                     "source", "metadata", "hasLODLevels", "geometry", "isBlocked", "areNormalsFrozen",
-                    "onBeforeDrawObservable", "onBeforeRenderObservable", "onAfterRenderObservable", "onBeforeDraw"
+                    "onBeforeDrawObservable", "onBeforeRenderObservable", "onAfterRenderObservable", "onBeforeDraw",
+                    "onAfterWorldMatrixUpdateObservable", "onCollideObservable", "onCollisionPositionChangeObservable", "onRebuildObservable",
+                    "onDisposeObservable"
                 ],
                 ],
                     ["_poseMatrix"]);
                     ["_poseMatrix"]);
 
 

+ 16 - 16
src/Meshes/meshBuilder.ts

@@ -284,7 +284,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
      * Class containing static functions to help procedurally build meshes
      * Class containing static functions to help procedurally build meshes
      */
      */
     export class MeshBuilder {
     export class MeshBuilder {
-        private static updateSideOrientation(orientation?: number): number {
+        private static _UpdateSideOrientation(orientation?: number): number {
             if (orientation == Mesh.DOUBLESIDE) {
             if (orientation == Mesh.DOUBLESIDE) {
                 return Mesh.DOUBLESIDE;
                 return Mesh.DOUBLESIDE;
             }
             }
@@ -314,7 +314,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreateBox(name: string, options: { size?: number, width?: number, height?: number, depth?: number, faceUV?: Vector4[], faceColors?: Color4[], sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, updatable?: boolean }, scene: Nullable<Scene> = null): Mesh {
         public static CreateBox(name: string, options: { size?: number, width?: number, height?: number, depth?: number, faceUV?: Vector4[], faceColors?: Color4[], sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, updatable?: boolean }, scene: Nullable<Scene> = null): Mesh {
             var box = new Mesh(name, scene);
             var box = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             box._originalBuilderSideOrientation = options.sideOrientation;
             box._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreateBox(options);
             var vertexData = VertexData.CreateBox(options);
@@ -343,7 +343,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreateSphere(name: string, options: { segments?: number, diameter?: number, diameterX?: number, diameterY?: number, diameterZ?: number, arc?: number, slice?: number, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, updatable?: boolean }, scene: any): Mesh {
         public static CreateSphere(name: string, options: { segments?: number, diameter?: number, diameterX?: number, diameterY?: number, diameterZ?: number, arc?: number, slice?: number, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, updatable?: boolean }, scene: any): Mesh {
             var sphere = new Mesh(name, scene);
             var sphere = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             sphere._originalBuilderSideOrientation = options.sideOrientation;
             sphere._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreateSphere(options);
             var vertexData = VertexData.CreateSphere(options);
@@ -370,7 +370,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreateDisc(name: string, options: { radius?: number, tessellation?: number, arc?: number, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: Nullable<Scene> = null): Mesh {
         public static CreateDisc(name: string, options: { radius?: number, tessellation?: number, arc?: number, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: Nullable<Scene> = null): Mesh {
             var disc = new Mesh(name, scene);
             var disc = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             disc._originalBuilderSideOrientation = options.sideOrientation;
             disc._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreateDisc(options);
             var vertexData = VertexData.CreateDisc(options);
@@ -398,7 +398,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreateIcoSphere(name: string, options: { radius?: number, radiusX?: number, radiusY?: number, radiusZ?: number, flat?: boolean, subdivisions?: number, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, updatable?: boolean }, scene: Scene): Mesh {
         public static CreateIcoSphere(name: string, options: { radius?: number, radiusX?: number, radiusY?: number, radiusZ?: number, flat?: boolean, subdivisions?: number, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, updatable?: boolean }, scene: Scene): Mesh {
             var sphere = new Mesh(name, scene);
             var sphere = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             sphere._originalBuilderSideOrientation = options.sideOrientation;
             sphere._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreateIcoSphere(options);
             var vertexData = VertexData.CreateIcoSphere(options);
@@ -435,7 +435,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
             var pathArray = options.pathArray;
             var pathArray = options.pathArray;
             var closeArray = options.closeArray;
             var closeArray = options.closeArray;
             var closePath = options.closePath;
             var closePath = options.closePath;
-            var sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            var sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             var instance = options.instance;
             var instance = options.instance;
             var updatable = options.updatable;
             var updatable = options.updatable;
 
 
@@ -582,7 +582,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreateCylinder(name: string, options: { height?: number, diameterTop?: number, diameterBottom?: number, diameter?: number, tessellation?: number, subdivisions?: number, arc?: number, faceColors?: Color4[], faceUV?: Vector4[], updatable?: boolean, hasRings?: boolean, enclose?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: any): Mesh {
         public static CreateCylinder(name: string, options: { height?: number, diameterTop?: number, diameterBottom?: number, diameter?: number, tessellation?: number, subdivisions?: number, arc?: number, faceColors?: Color4[], faceUV?: Vector4[], updatable?: boolean, hasRings?: boolean, enclose?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: any): Mesh {
             var cylinder = new Mesh(name, scene);
             var cylinder = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             cylinder._originalBuilderSideOrientation = options.sideOrientation;
             cylinder._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreateCylinder(options);
             var vertexData = VertexData.CreateCylinder(options);
@@ -609,7 +609,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreateTorus(name: string, options: { diameter?: number, thickness?: number, tessellation?: number, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: any): Mesh {
         public static CreateTorus(name: string, options: { diameter?: number, thickness?: number, tessellation?: number, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: any): Mesh {
             var torus = new Mesh(name, scene);
             var torus = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             torus._originalBuilderSideOrientation = options.sideOrientation;
             torus._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreateTorus(options);
             var vertexData = VertexData.CreateTorus(options);
@@ -637,7 +637,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreateTorusKnot(name: string, options: { radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, p?: number, q?: number, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: any): Mesh {
         public static CreateTorusKnot(name: string, options: { radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, p?: number, q?: number, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: any): Mesh {
             var torusKnot = new Mesh(name, scene);
             var torusKnot = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             torusKnot._originalBuilderSideOrientation = options.sideOrientation;
             torusKnot._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreateTorusKnot(options);
             var vertexData = VertexData.CreateTorusKnot(options);
@@ -840,7 +840,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
             var rotation = options.rotation || 0;
             var rotation = options.rotation || 0;
             var cap = (options.cap === 0) ? 0 : options.cap || Mesh.NO_CAP;
             var cap = (options.cap === 0) ? 0 : options.cap || Mesh.NO_CAP;
             var updatable = options.updatable;
             var updatable = options.updatable;
-            var sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            var sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             var instance = options.instance || null;
             var instance = options.instance || null;
             var invertUV = options.invertUV || false;
             var invertUV = options.invertUV || false;
 
 
@@ -882,7 +882,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
             var ribbonClosePath = options.ribbonClosePath || false;
             var ribbonClosePath = options.ribbonClosePath || false;
             var cap = (options.cap === 0) ? 0 : options.cap || Mesh.NO_CAP;
             var cap = (options.cap === 0) ? 0 : options.cap || Mesh.NO_CAP;
             var updatable = options.updatable;
             var updatable = options.updatable;
-            var sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            var sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             var instance = options.instance;
             var instance = options.instance;
             var invertUV = options.invertUV || false;
             var invertUV = options.invertUV || false;
             return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene, updatable ? true : false, sideOrientation, instance || null, invertUV, options.frontUVs || null, options.backUVs || null);
             return MeshBuilder._ExtrudeShapeGeneric(name, shape, path, null, null, scaleFunction, rotationFunction, ribbonCloseArray, ribbonClosePath, cap, true, scene, updatable ? true : false, sideOrientation, instance || null, invertUV, options.frontUVs || null, options.backUVs || null);
@@ -916,7 +916,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
             var tessellation = options.tessellation || 64;
             var tessellation = options.tessellation || 64;
             var clip = options.clip || 0;
             var clip = options.clip || 0;
             var updatable = options.updatable;
             var updatable = options.updatable;
-            var sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            var sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             var cap = options.cap || Mesh.NO_CAP;
             var cap = options.cap || Mesh.NO_CAP;
             var pi2 = Math.PI * 2;
             var pi2 = Math.PI * 2;
             var paths = new Array();
             var paths = new Array();
@@ -966,7 +966,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreatePlane(name: string, options: { size?: number, width?: number, height?: number, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, updatable?: boolean, sourcePlane?: Plane }, scene: Scene): Mesh {
         public static CreatePlane(name: string, options: { size?: number, width?: number, height?: number, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4, updatable?: boolean, sourcePlane?: Plane }, scene: Scene): Mesh {
             var plane = new Mesh(name, scene);
             var plane = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             plane._originalBuilderSideOrientation = options.sideOrientation;
             plane._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreatePlane(options);
             var vertexData = VertexData.CreatePlane(options);
@@ -1138,7 +1138,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
          * @returns the polygon mesh
          * @returns the polygon mesh
          */
          */
         public static CreatePolygon(name: string, options: { shape: Vector3[], holes?: Vector3[][], depth?: number, faceUV?: Vector4[], faceColors?: Color4[], updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: Scene): Mesh {
         public static CreatePolygon(name: string, options: { shape: Vector3[], holes?: Vector3[][], depth?: number, faceUV?: Vector4[], faceColors?: Color4[], updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: Scene): Mesh {
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             var shape = options.shape;
             var shape = options.shape;
             var holes = options.holes || [];
             var holes = options.holes || [];
             var depth = options.depth || 0;
             var depth = options.depth || 0;
@@ -1220,7 +1220,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
             var cap = options.cap || Mesh.NO_CAP;
             var cap = options.cap || Mesh.NO_CAP;
             var invertUV = options.invertUV || false;
             var invertUV = options.invertUV || false;
             var updatable = options.updatable;
             var updatable = options.updatable;
-            var sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            var sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             options.arc = options.arc && (options.arc <= 0.0 || options.arc > 1.0) ? 1.0 : options.arc || 1.0;
             options.arc = options.arc && (options.arc <= 0.0 || options.arc > 1.0) ? 1.0 : options.arc || 1.0;
 
 
             // tube geometry
             // tube geometry
@@ -1340,7 +1340,7 @@ Mesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, n
         public static CreatePolyhedron(name: string, options: { type?: number, size?: number, sizeX?: number, sizeY?: number, sizeZ?: number, custom?: any, faceUV?: Vector4[], faceColors?: Color4[], flat?: boolean, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: Scene): Mesh {
         public static CreatePolyhedron(name: string, options: { type?: number, size?: number, sizeX?: number, sizeY?: number, sizeZ?: number, custom?: any, faceUV?: Vector4[], faceColors?: Color4[], flat?: boolean, updatable?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }, scene: Scene): Mesh {
             var polyhedron = new Mesh(name, scene);
             var polyhedron = new Mesh(name, scene);
 
 
-            options.sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation);
+            options.sideOrientation = MeshBuilder._UpdateSideOrientation(options.sideOrientation);
             polyhedron._originalBuilderSideOrientation = options.sideOrientation;
             polyhedron._originalBuilderSideOrientation = options.sideOrientation;
 
 
             var vertexData = VertexData.CreatePolyhedron(options);
             var vertexData = VertexData.CreatePolyhedron(options);

+ 1 - 1
src/Misc/textureTools.ts

@@ -31,7 +31,7 @@ import { Scene } from "scene";
                 true,
                 true,
                 (<InternalTexture>texture._texture).type,
                 (<InternalTexture>texture._texture).type,
                 false,
                 false,
-                texture._samplingMode,
+                texture.samplingMode,
                 false
                 false
             );
             );