Procházet zdrojové kódy

Merge pull request #6221 from BabylonJS/master

Nightly
David Catuhe před 6 roky
rodič
revize
bc5171287c
61 změnil soubory, kde provedl 1882 přidání a 2482 odebrání
  1. 20 8
      Playground/babylon.d.txt
  2. binární
      Playground/scenes/Trees/BroadleafBark.jpg
  3. binární
      Playground/scenes/Trees/BroadleafBark_Normal.png
  4. binární
      Playground/scenes/Trees/Broadleaf_Desktop_Atlas.png
  5. binární
      Playground/scenes/Trees/Broadleaf_Desktop_Atlas_Billboards.png
  6. binární
      Playground/scenes/Trees/Broadleaf_Desktop_Atlas_Billboards_Normal.png
  7. binární
      Playground/scenes/Trees/Broadleaf_Desktop_Atlas_Normal.png
  8. 1 0
      Playground/scenes/Trees/rawtrees.babylon
  9. 15 3
      dist/preview release/babylon.d.ts
  10. 1 1
      dist/preview release/babylon.js
  11. 159 69
      dist/preview release/babylon.max.js
  12. 1 1
      dist/preview release/babylon.max.js.map
  13. 30 6
      dist/preview release/babylon.module.d.ts
  14. 6 4
      dist/preview release/gui/babylon.gui.d.ts
  15. 22 10
      dist/preview release/gui/babylon.gui.js
  16. 1 1
      dist/preview release/gui/babylon.gui.js.map
  17. 1 1
      dist/preview release/gui/babylon.gui.min.js
  18. 12 8
      dist/preview release/gui/babylon.gui.module.d.ts
  19. 7 7
      dist/preview release/inspector/babylon.inspector.bundle.js
  20. 299 1182
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  21. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  22. 4 0
      dist/preview release/inspector/babylon.inspector.d.ts
  23. 8 0
      dist/preview release/inspector/babylon.inspector.module.d.ts
  24. 3 10
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  25. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js.map
  26. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  27. 3 10
      dist/preview release/loaders/babylon.glTFFileLoader.js
  28. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.js.map
  29. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  30. 1 2
      dist/preview release/loaders/babylonjs.loaders.d.ts
  31. 3 10
      dist/preview release/loaders/babylonjs.loaders.js
  32. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  33. 2 2
      dist/preview release/loaders/babylonjs.loaders.min.js
  34. 2 4
      dist/preview release/loaders/babylonjs.loaders.module.d.ts
  35. 1 1
      dist/preview release/packagesSizeBaseLine.json
  36. 30 6
      dist/preview release/viewer/babylon.module.d.ts
  37. 317 317
      dist/preview release/viewer/babylon.viewer.js
  38. 4 4
      dist/preview release/viewer/babylon.viewer.max.js
  39. 2 4
      dist/preview release/viewer/babylonjs.loaders.module.d.ts
  40. 4 1
      dist/preview release/what's new.md
  41. 1 1
      gui/src/2D/advancedDynamicTexture.ts
  42. 9 3
      gui/src/2D/controls/colorpicker.ts
  43. 3 3
      gui/src/2D/controls/control.ts
  44. 2 2
      gui/src/2D/controls/inputText.ts
  45. 10 3
      gui/src/2D/controls/sliders/baseSlider.ts
  46. 8 2
      inspector/src/components/actionTabs/lines/vector2LineComponent.tsx
  47. 1 1
      inspector/src/components/actionTabs/lines/vector3LineComponent.tsx
  48. 4 13
      loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts
  49. 2 2
      src/Audio/sound.ts
  50. 22 5
      src/Cameras/Inputs/arcRotateCameraMouseWheelInput.ts
  51. 6 0
      src/Cameras/VR/vrExperienceHelper.ts
  52. 51 9
      src/Loading/Plugins/babylonFileLoader.ts
  53. 1 1
      src/Materials/PBR/pbrBaseMaterial.ts
  54. 1 1
      src/Materials/uniformBuffer.ts
  55. 14 6
      src/Meshes/Compression/dracoCompression.ts
  56. 15 4
      src/Meshes/abstractMesh.ts
  57. 7 4
      src/Meshes/instancedMesh.ts
  58. 11 2
      src/Meshes/mesh.ts
  59. 2 0
      src/scene.ts
  60. binární
      tests/validation/ReferenceImages/lodbillboardinstances.png
  61. 746 741
      tests/validation/config.json

+ 20 - 8
Playground/babylon.d.txt

@@ -16601,6 +16601,7 @@ declare module BABYLON {
         refreshBoundingInfo(applySkeleton?: boolean): InstancedMesh;
         /** @hidden */
preActivate(): InstancedMesh;
         /** @hidden */
activate(renderId: number): boolean;
+        /** @hidden */
postActivate(): void;
         getWorldMatrix(): Matrix;
         readonly isAnInstance: boolean;
         /**
@@ -24097,8 +24098,11 @@ declare module BABYLON {
         /** Gets the list of lights affecting that mesh */
         readonly lightSources: Light[];
         /** @hidden */
protected readonly _positions: Nullable<Vector3[]>;
-        /** @hidden */
waitingActions: Nullable<any>;
-        /** @hidden */
waitingFreezeWorldMatrix: Nullable<boolean>;
+        /** @hidden */
waitingData: {
+            lods: Nullable<any>;
+            actions: Nullable<any>;
+            freezeWorldMatrix: Nullable<boolean>;
+        };
         private _skeleton;
         /** @hidden */
bonesTransformMatrices: Nullable<Float32Array>;
         /**
@@ -24259,6 +24263,7 @@ declare module BABYLON {
         /** @hidden */
preActivate(): void;
         /** @hidden */
preActivateForIntermediateRendering(renderId: number): void;
         /** @hidden */
activate(renderId: number): boolean;
+        /** @hidden */
postActivate(): void;
         /** @hidden */
freeze(): void;
         /** @hidden */
unFreeze(): void;
         /**
@@ -34405,6 +34410,7 @@ declare module BABYLON {
         wheelDeltaPercentage: number;
         private _wheel;
         private _observer;
+        private computeDeltaFromMouseWheelLegacyEvent;
         /**
          * Attach the input controls to a specific dom element to get the input from.
          * @param element Defines the element the controls should be listened from
@@ -49044,6 +49050,11 @@ declare module BABYLON {
          */
         static DefaultNumWorkers: number;
         private static GetDefaultNumWorkers;
+        private static _Default;
+        /**
+         * Default instance for the draco compression object.
+         */
+        static readonly Default: DracoCompression;
         /**
          * Constructor
          * @param numWorkers The number of workers for async operations
@@ -57305,7 +57316,7 @@ declare module BABYLON.GUI {
          */
         contains(x: number, y: number): boolean;
         /** @hidden */
processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
-        /** @hidden */
onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        /** @hidden */
onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         /** @hidden */
onPointerEnter(target: Control): boolean;
         /** @hidden */
onPointerOut(target: Control, force?: boolean): void;
         /** @hidden */
onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
@@ -58115,7 +58126,7 @@ declare module BABYLON.GUI {
         /** @hidden */
         private _onCutText;
         /** @hidden */
-        private _onPasteText;
draw(context: CanvasRenderingContext2D): void;
onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
+        private _onPasteText;
draw(context: CanvasRenderingContext2D): void;
onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         protected _beforeRenderText(text: string): string;
         dispose(): void;
     }
@@ -58251,6 +58262,7 @@ declare module BABYLON.GUI {
         private _h;
         private _s;
         private _v;
+        private _lastPointerDownID;
         /**
          * BABYLON.Observable raised when the value changes
          */
@@ -58288,7 +58300,7 @@ declare module BABYLON.GUI {
         private _pointerIsDown;
         private _updateValueFromPointer;
         private _isPointOnSquare;
-        private _isPointOnWheel;
onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
+        private _isPointOnWheel;
onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         /**
          * This function expands the color picker by creating a color picker dialog with manual
          * color value input and the ability to save colors into an array to be used later in
@@ -58552,6 +58564,7 @@ declare module BABYLON.GUI {
         private _isThumbClamped;
         protected _displayThumb: boolean;
         private _step;
+        private _lastPointerDownID;
         protected _effectiveBarOffset: number;
         protected _renderLeft: number;
         protected _renderTop: number;
@@ -58595,7 +58608,7 @@ declare module BABYLON.GUI {
         protected _prepareRenderingData(type: string): void;
         private _pointerIsDown;
         /** @hidden */
-        protected _updateValueFromPointer(x: number, y: number): void;
onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
+        protected _updateValueFromPointer(x: number, y: number): void;
onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
     }
 }
 declare module BABYLON.GUI {
@@ -61270,12 +61283,11 @@ declare module BABYLON.GLTF2.Loader.Extensions {
     export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
         /** The name of this extension. */
         readonly name: string;
-        /** The draco compression used to decode vertex data. */
+        /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
         dracoCompression?: DracoCompression;
         /** Defines whether this extension is enabled. */
         enabled: boolean;
         private _loader;
-        private _dracoCompressionOwned;
         /** @hidden */
         constructor(loader: GLTFLoader);
         /** @hidden */

binární
Playground/scenes/Trees/BroadleafBark.jpg


binární
Playground/scenes/Trees/BroadleafBark_Normal.png


binární
Playground/scenes/Trees/Broadleaf_Desktop_Atlas.png


binární
Playground/scenes/Trees/Broadleaf_Desktop_Atlas_Billboards.png


binární
Playground/scenes/Trees/Broadleaf_Desktop_Atlas_Billboards_Normal.png


binární
Playground/scenes/Trees/Broadleaf_Desktop_Atlas_Normal.png


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
Playground/scenes/Trees/rawtrees.babylon


+ 15 - 3
dist/preview release/babylon.d.ts

@@ -16879,6 +16879,8 @@ declare module BABYLON {
         _preActivate(): InstancedMesh;
         /** @hidden */
         _activate(renderId: number): boolean;
+        /** @hidden */
+        _postActivate(): void;
         getWorldMatrix(): Matrix;
         readonly isAnInstance: boolean;
         /**
@@ -24513,9 +24515,11 @@ declare module BABYLON {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: Nullable<any>;
-        /** @hidden */
-        _waitingFreezeWorldMatrix: Nullable<boolean>;
+        _waitingData: {
+            lods: Nullable<any>;
+            actions: Nullable<any>;
+            freezeWorldMatrix: Nullable<boolean>;
+        };
         private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
@@ -24690,6 +24694,8 @@ declare module BABYLON {
         /** @hidden */
         _activate(renderId: number): boolean;
         /** @hidden */
+        _postActivate(): void;
+        /** @hidden */
         _freeze(): void;
         /** @hidden */
         _unFreeze(): void;
@@ -35052,6 +35058,7 @@ declare module BABYLON {
         wheelDeltaPercentage: number;
         private _wheel;
         private _observer;
+        private computeDeltaFromMouseWheelLegacyEvent;
         /**
          * Attach the input controls to a specific dom element to get the input from.
          * @param element Defines the element the controls should be listened from
@@ -49787,6 +49794,11 @@ declare module BABYLON {
          */
         static DefaultNumWorkers: number;
         private static GetDefaultNumWorkers;
+        private static _Default;
+        /**
+         * Default instance for the draco compression object.
+         */
+        static readonly Default: DracoCompression;
         /**
          * Constructor
          * @param numWorkers The number of workers for async operations

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/babylon.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 159 - 69
dist/preview release/babylon.max.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 30 - 6
dist/preview release/babylon.module.d.ts

@@ -17298,6 +17298,8 @@ declare module "babylonjs/Meshes/instancedMesh" {
         _preActivate(): InstancedMesh;
         /** @hidden */
         _activate(renderId: number): boolean;
+        /** @hidden */
+        _postActivate(): void;
         getWorldMatrix(): Matrix;
         readonly isAnInstance: boolean;
         /**
@@ -25186,9 +25188,11 @@ declare module "babylonjs/Meshes/abstractMesh" {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: Nullable<any>;
-        /** @hidden */
-        _waitingFreezeWorldMatrix: Nullable<boolean>;
+        _waitingData: {
+            lods: Nullable<any>;
+            actions: Nullable<any>;
+            freezeWorldMatrix: Nullable<boolean>;
+        };
         private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
@@ -25363,6 +25367,8 @@ declare module "babylonjs/Meshes/abstractMesh" {
         /** @hidden */
         _activate(renderId: number): boolean;
         /** @hidden */
+        _postActivate(): void;
+        /** @hidden */
         _freeze(): void;
         /** @hidden */
         _unFreeze(): void;
@@ -36016,6 +36022,7 @@ declare module "babylonjs/Cameras/Inputs/arcRotateCameraMouseWheelInput" {
         wheelDeltaPercentage: number;
         private _wheel;
         private _observer;
+        private computeDeltaFromMouseWheelLegacyEvent;
         /**
          * Attach the input controls to a specific dom element to get the input from.
          * @param element Defines the element the controls should be listened from
@@ -52017,6 +52024,11 @@ declare module "babylonjs/Meshes/Compression/dracoCompression" {
          */
         static DefaultNumWorkers: number;
         private static GetDefaultNumWorkers;
+        private static _Default;
+        /**
+         * Default instance for the draco compression object.
+         */
+        static readonly Default: DracoCompression;
         /**
          * Constructor
          * @param numWorkers The number of workers for async operations
@@ -76862,6 +76874,8 @@ declare module BABYLON {
         _preActivate(): InstancedMesh;
         /** @hidden */
         _activate(renderId: number): boolean;
+        /** @hidden */
+        _postActivate(): void;
         getWorldMatrix(): Matrix;
         readonly isAnInstance: boolean;
         /**
@@ -84496,9 +84510,11 @@ declare module BABYLON {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: Nullable<any>;
-        /** @hidden */
-        _waitingFreezeWorldMatrix: Nullable<boolean>;
+        _waitingData: {
+            lods: Nullable<any>;
+            actions: Nullable<any>;
+            freezeWorldMatrix: Nullable<boolean>;
+        };
         private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
@@ -84673,6 +84689,8 @@ declare module BABYLON {
         /** @hidden */
         _activate(renderId: number): boolean;
         /** @hidden */
+        _postActivate(): void;
+        /** @hidden */
         _freeze(): void;
         /** @hidden */
         _unFreeze(): void;
@@ -95035,6 +95053,7 @@ declare module BABYLON {
         wheelDeltaPercentage: number;
         private _wheel;
         private _observer;
+        private computeDeltaFromMouseWheelLegacyEvent;
         /**
          * Attach the input controls to a specific dom element to get the input from.
          * @param element Defines the element the controls should be listened from
@@ -109770,6 +109789,11 @@ declare module BABYLON {
          */
         static DefaultNumWorkers: number;
         private static GetDefaultNumWorkers;
+        private static _Default;
+        /**
+         * Default instance for the draco compression object.
+         */
+        static readonly Default: DracoCompression;
         /**
          * Constructor
          * @param numWorkers The number of workers for async operations

+ 6 - 4
dist/preview release/gui/babylon.gui.d.ts

@@ -1083,7 +1083,7 @@ declare module BABYLON.GUI {
         /** @hidden */
         _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
         /** @hidden */
-        _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        _onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         /** @hidden */
         _onPointerEnter(target: Control): boolean;
         /** @hidden */
@@ -1923,7 +1923,7 @@ declare module BABYLON.GUI {
         private _onPasteText;
         _draw(context: CanvasRenderingContext2D): void;
         _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        _onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         protected _beforeRenderText(text: string): string;
         dispose(): void;
@@ -2062,6 +2062,7 @@ declare module BABYLON.GUI {
         private _h;
         private _s;
         private _v;
+        private _lastPointerDownID;
         /**
          * BABYLON.Observable raised when the value changes
          */
@@ -2102,7 +2103,7 @@ declare module BABYLON.GUI {
         private _isPointOnSquare;
         private _isPointOnWheel;
         _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        _onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         /**
          * This function expands the color picker by creating a color picker dialog with manual
@@ -2375,6 +2376,7 @@ declare module BABYLON.GUI {
         private _isThumbClamped;
         protected _displayThumb: boolean;
         private _step;
+        private _lastPointerDownID;
         protected _effectiveBarOffset: number;
         protected _renderLeft: number;
         protected _renderTop: number;
@@ -2420,7 +2422,7 @@ declare module BABYLON.GUI {
         /** @hidden */
         protected _updateValueFromPointer(x: number, y: number): void;
         _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        _onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
     }
 }

+ 22 - 10
dist/preview release/gui/babylon.gui.js

@@ -1053,7 +1053,7 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
                     });
                     continue;
                 }
-                var position = mesh.getBoundingInfo().boundingSphere.center;
+                var position = mesh.getBoundingInfo ? mesh.getBoundingInfo().boundingSphere.center : mesh.getAbsolutePosition();
                 var projectedPosition = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Project(position, mesh.getWorldMatrix(), scene.getTransformMatrix(), globalViewport);
                 if (projectedPosition.z < 0 || projectedPosition.z > 1) {
                     control.notRenderable = true;
@@ -1837,6 +1837,7 @@ var ColorPicker = /** @class */ (function (_super) {
         _this._h = 360;
         _this._s = 1;
         _this._v = 1;
+        _this._lastPointerDownID = -1;
         /**
          * Observable raised when the value changes
          */
@@ -2205,9 +2206,14 @@ var ColorPicker = /** @class */ (function (_super) {
         }
         this._updateValueFromPointer(x, y);
         this._host._capturingControl[pointerId] = this;
+        this._lastPointerDownID = pointerId;
         return true;
     };
-    ColorPicker.prototype._onPointerMove = function (target, coordinates) {
+    ColorPicker.prototype._onPointerMove = function (target, coordinates, pointerId) {
+        // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)
+        if (pointerId != this._lastPointerDownID) {
+            return;
+        }
         // Invert transform
         this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);
         var x = this._transformedPosition.x;
@@ -2215,7 +2221,7 @@ var ColorPicker = /** @class */ (function (_super) {
         if (this._pointerIsDown) {
             this._updateValueFromPointer(x, y);
         }
-        _super.prototype._onPointerMove.call(this, target, coordinates);
+        _super.prototype._onPointerMove.call(this, target, coordinates, pointerId);
     };
     ColorPicker.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
         this._pointerIsDown = false;
@@ -5164,10 +5170,10 @@ var Control = /** @class */ (function () {
         return true;
     };
     /** @hidden */
-    Control.prototype._onPointerMove = function (target, coordinates) {
+    Control.prototype._onPointerMove = function (target, coordinates, pointerId) {
         var canNotify = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this);
         if (canNotify && this.parent != null) {
-            this.parent._onPointerMove(target, coordinates);
+            this.parent._onPointerMove(target, coordinates, pointerId);
         }
     };
     /** @hidden */
@@ -5254,7 +5260,7 @@ var Control = /** @class */ (function () {
         }
         this._dummyVector2.copyFromFloats(x, y);
         if (type === babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["PointerEventTypes"].POINTERMOVE) {
-            this._onPointerMove(this, this._dummyVector2);
+            this._onPointerMove(this, this._dummyVector2, pointerId);
             var previousControlOver = this._host._lastControlOver[pointerId];
             if (previousControlOver && previousControlOver !== this) {
                 previousControlOver._onPointerOut(this);
@@ -7951,13 +7957,13 @@ var InputText = /** @class */ (function (_super) {
         this._host.focusedControl = this;
         return true;
     };
-    InputText.prototype._onPointerMove = function (target, coordinates) {
+    InputText.prototype._onPointerMove = function (target, coordinates, pointerId) {
         if (this._host.focusedControl === this && this._isPointerDown) {
             this._clickedCoordinate = coordinates.x;
             this._markAsDirty();
             this._updateValueFromCursorIndex(this._cursorOffset);
         }
-        _super.prototype._onPointerMove.call(this, target, coordinates);
+        _super.prototype._onPointerMove.call(this, target, coordinates, pointerId);
     };
     InputText.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
         this._isPointerDown = false;
@@ -9996,6 +10002,7 @@ var BaseSlider = /** @class */ (function (_super) {
         _this._isThumbClamped = false;
         _this._displayThumb = true;
         _this._step = 0;
+        _this._lastPointerDownID = -1;
         // Shared rendering info
         _this._effectiveBarOffset = 0;
         /** Observable raised when the sldier value changes */
@@ -10258,13 +10265,18 @@ var BaseSlider = /** @class */ (function (_super) {
         this._pointerIsDown = true;
         this._updateValueFromPointer(coordinates.x, coordinates.y);
         this._host._capturingControl[pointerId] = this;
+        this._lastPointerDownID = pointerId;
         return true;
     };
-    BaseSlider.prototype._onPointerMove = function (target, coordinates) {
+    BaseSlider.prototype._onPointerMove = function (target, coordinates, pointerId) {
+        // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)
+        if (pointerId != this._lastPointerDownID) {
+            return;
+        }
         if (this._pointerIsDown) {
             this._updateValueFromPointer(coordinates.x, coordinates.y);
         }
-        _super.prototype._onPointerMove.call(this, target, coordinates);
+        _super.prototype._onPointerMove.call(this, target, coordinates, pointerId);
     };
     BaseSlider.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
         this._pointerIsDown = false;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/gui/babylon.gui.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


+ 12 - 8
dist/preview release/gui/babylon.gui.module.d.ts

@@ -1113,7 +1113,7 @@ declare module "babylonjs-gui/2D/controls/control" {
         /** @hidden */
         _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
         /** @hidden */
-        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerMove(target: Control, coordinates: Vector2, pointerId: number): void;
         /** @hidden */
         _onPointerEnter(target: Control): boolean;
         /** @hidden */
@@ -1988,7 +1988,7 @@ declare module "babylonjs-gui/2D/controls/inputText" {
         private _onPasteText;
         _draw(context: CanvasRenderingContext2D): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerMove(target: Control, coordinates: Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         protected _beforeRenderText(text: string): string;
         dispose(): void;
@@ -2137,6 +2137,7 @@ declare module "babylonjs-gui/2D/controls/colorpicker" {
         private _h;
         private _s;
         private _v;
+        private _lastPointerDownID;
         /**
          * Observable raised when the value changes
          */
@@ -2177,7 +2178,7 @@ declare module "babylonjs-gui/2D/controls/colorpicker" {
         private _isPointOnSquare;
         private _isPointOnWheel;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerMove(target: Control, coordinates: Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         /**
          * This function expands the color picker by creating a color picker dialog with manual
@@ -2474,6 +2475,7 @@ declare module "babylonjs-gui/2D/controls/sliders/baseSlider" {
         private _isThumbClamped;
         protected _displayThumb: boolean;
         private _step;
+        private _lastPointerDownID;
         protected _effectiveBarOffset: number;
         protected _renderLeft: number;
         protected _renderTop: number;
@@ -2519,7 +2521,7 @@ declare module "babylonjs-gui/2D/controls/sliders/baseSlider" {
         /** @hidden */
         protected _updateValueFromPointer(x: number, y: number): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerMove(target: Control, coordinates: Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
     }
 }
@@ -4929,7 +4931,7 @@ declare module BABYLON.GUI {
         /** @hidden */
         _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean;
         /** @hidden */
-        _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        _onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         /** @hidden */
         _onPointerEnter(target: Control): boolean;
         /** @hidden */
@@ -5769,7 +5771,7 @@ declare module BABYLON.GUI {
         private _onPasteText;
         _draw(context: CanvasRenderingContext2D): void;
         _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        _onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         protected _beforeRenderText(text: string): string;
         dispose(): void;
@@ -5908,6 +5910,7 @@ declare module BABYLON.GUI {
         private _h;
         private _s;
         private _v;
+        private _lastPointerDownID;
         /**
          * BABYLON.Observable raised when the value changes
          */
@@ -5948,7 +5951,7 @@ declare module BABYLON.GUI {
         private _isPointOnSquare;
         private _isPointOnWheel;
         _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        _onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         /**
          * This function expands the color picker by creating a color picker dialog with manual
@@ -6221,6 +6224,7 @@ declare module BABYLON.GUI {
         private _isThumbClamped;
         protected _displayThumb: boolean;
         private _step;
+        private _lastPointerDownID;
         protected _effectiveBarOffset: number;
         protected _renderLeft: number;
         protected _renderTop: number;
@@ -6266,7 +6270,7 @@ declare module BABYLON.GUI {
         /** @hidden */
         protected _updateValueFromPointer(x: number, y: number): void;
         _onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number): boolean;
-        _onPointerMove(target: Control, coordinates: BABYLON.Vector2): void;
+        _onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number): void;
         _onPointerUp(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
     }
 }

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 7 - 7
dist/preview release/inspector/babylon.inspector.bundle.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 299 - 1182
dist/preview release/inspector/babylon.inspector.bundle.max.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 4 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -523,6 +523,7 @@ declare module INSPECTOR {
         label: string;
         target: any;
         propertyName: string;
+        step?: number;
         onChange?: (newvalue: BABYLON.Vector2) => void;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
     }
@@ -530,6 +531,9 @@ declare module INSPECTOR {
         isExpanded: boolean;
         value: BABYLON.Vector2;
     }> {
+        static defaultProps: {
+            step: number;
+        };
         private _localChange;
         constructor(props: IVector2LineComponentProps);
         shouldComponentUpdate(nextProps: IVector2LineComponentProps, nextState: {

+ 8 - 0
dist/preview release/inspector/babylon.inspector.module.d.ts

@@ -619,6 +619,7 @@ declare module "babylonjs-inspector/components/actionTabs/lines/vector2LineCompo
         label: string;
         target: any;
         propertyName: string;
+        step?: number;
         onChange?: (newvalue: Vector2) => void;
         onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
     }
@@ -626,6 +627,9 @@ declare module "babylonjs-inspector/components/actionTabs/lines/vector2LineCompo
         isExpanded: boolean;
         value: Vector2;
     }> {
+        static defaultProps: {
+            step: number;
+        };
         private _localChange;
         constructor(props: IVector2LineComponentProps);
         shouldComponentUpdate(nextProps: IVector2LineComponentProps, nextState: {
@@ -2709,6 +2713,7 @@ declare module INSPECTOR {
         label: string;
         target: any;
         propertyName: string;
+        step?: number;
         onChange?: (newvalue: BABYLON.Vector2) => void;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
     }
@@ -2716,6 +2721,9 @@ declare module INSPECTOR {
         isExpanded: boolean;
         value: BABYLON.Vector2;
     }> {
+        static defaultProps: {
+            step: number;
+        };
         private _localChange;
         constructor(props: IVector2LineComponentProps);
         shouldComponentUpdate(nextProps: IVector2LineComponentProps, nextState: {

+ 3 - 10
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -277,15 +277,11 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
         this.name = NAME;
         /** Defines whether this extension is enabled. */
         this.enabled = babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"].DecoderAvailable;
-        this._dracoCompressionOwned = false;
         this._loader = loader;
     }
     /** @hidden */
     KHR_draco_mesh_compression.prototype.dispose = function () {
-        if (this.dracoCompression && this._dracoCompressionOwned) {
-            this.dracoCompression.dispose();
-            delete this.dracoCompression;
-        }
+        delete this.dracoCompression;
         delete this._loader;
     };
     /** @hidden */
@@ -325,11 +321,8 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
             var bufferView = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["ArrayItem"].Get(extensionContext, _this._loader.gltf.bufferViews, extension.bufferView);
             if (!bufferView._dracoBabylonGeometry) {
                 bufferView._dracoBabylonGeometry = _this._loader.loadBufferViewAsync("#/bufferViews/" + bufferView.index, bufferView).then(function (data) {
-                    if (!_this.dracoCompression) {
-                        _this.dracoCompression = new babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"]();
-                        _this._dracoCompressionOwned = true;
-                    }
-                    return _this.dracoCompression.decodeMeshAsync(data, attributes).then(function (babylonVertexData) {
+                    var dracoCompression = _this.dracoCompression || babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"].Default;
+                    return dracoCompression.decodeMeshAsync(data, attributes).then(function (babylonVertexData) {
                         var babylonGeometry = new babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, _this._loader.babylonScene);
                         babylonVertexData.applyToGeometry(babylonGeometry);
                         return babylonGeometry;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 3 - 10
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -2826,15 +2826,11 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
         this.name = NAME;
         /** Defines whether this extension is enabled. */
         this.enabled = babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"].DecoderAvailable;
-        this._dracoCompressionOwned = false;
         this._loader = loader;
     }
     /** @hidden */
     KHR_draco_mesh_compression.prototype.dispose = function () {
-        if (this.dracoCompression && this._dracoCompressionOwned) {
-            this.dracoCompression.dispose();
-            delete this.dracoCompression;
-        }
+        delete this.dracoCompression;
         delete this._loader;
     };
     /** @hidden */
@@ -2874,11 +2870,8 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
             var bufferView = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["ArrayItem"].Get(extensionContext, _this._loader.gltf.bufferViews, extension.bufferView);
             if (!bufferView._dracoBabylonGeometry) {
                 bufferView._dracoBabylonGeometry = _this._loader.loadBufferViewAsync("#/bufferViews/" + bufferView.index, bufferView).then(function (data) {
-                    if (!_this.dracoCompression) {
-                        _this.dracoCompression = new babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"]();
-                        _this._dracoCompressionOwned = true;
-                    }
-                    return _this.dracoCompression.decodeMeshAsync(data, attributes).then(function (babylonVertexData) {
+                    var dracoCompression = _this.dracoCompression || babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"].Default;
+                    return dracoCompression.decodeMeshAsync(data, attributes).then(function (babylonVertexData) {
                         var babylonGeometry = new babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, _this._loader.babylonScene);
                         babylonVertexData.applyToGeometry(babylonGeometry);
                         return babylonGeometry;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 1 - 2
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -1586,12 +1586,11 @@ declare module BABYLON.GLTF2.Loader.Extensions {
     export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
         /** The name of this extension. */
         readonly name: string;
-        /** The draco compression used to decode vertex data. */
+        /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
         dracoCompression?: DracoCompression;
         /** Defines whether this extension is enabled. */
         enabled: boolean;
         private _loader;
-        private _dracoCompressionOwned;
         /** @hidden */
         constructor(loader: GLTFLoader);
         /** @hidden */

+ 3 - 10
dist/preview release/loaders/babylonjs.loaders.js

@@ -4168,15 +4168,11 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
         this.name = NAME;
         /** Defines whether this extension is enabled. */
         this.enabled = babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"].DecoderAvailable;
-        this._dracoCompressionOwned = false;
         this._loader = loader;
     }
     /** @hidden */
     KHR_draco_mesh_compression.prototype.dispose = function () {
-        if (this.dracoCompression && this._dracoCompressionOwned) {
-            this.dracoCompression.dispose();
-            delete this.dracoCompression;
-        }
+        delete this.dracoCompression;
         delete this._loader;
     };
     /** @hidden */
@@ -4216,11 +4212,8 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
             var bufferView = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__["ArrayItem"].Get(extensionContext, _this._loader.gltf.bufferViews, extension.bufferView);
             if (!bufferView._dracoBabylonGeometry) {
                 bufferView._dracoBabylonGeometry = _this._loader.loadBufferViewAsync("#/bufferViews/" + bufferView.index, bufferView).then(function (data) {
-                    if (!_this.dracoCompression) {
-                        _this.dracoCompression = new babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"]();
-                        _this._dracoCompressionOwned = true;
-                    }
-                    return _this.dracoCompression.decodeMeshAsync(data, attributes).then(function (babylonVertexData) {
+                    var dracoCompression = _this.dracoCompression || babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["DracoCompression"].Default;
+                    return dracoCompression.decodeMeshAsync(data, attributes).then(function (babylonVertexData) {
                         var babylonGeometry = new babylonjs_Meshes_Compression_dracoCompression__WEBPACK_IMPORTED_MODULE_0__["Geometry"](babylonMesh.name, _this._loader.babylonScene);
                         babylonVertexData.applyToGeometry(babylonGeometry);
                         return babylonGeometry;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 2
dist/preview release/loaders/babylonjs.loaders.min.js


+ 2 - 4
dist/preview release/loaders/babylonjs.loaders.module.d.ts

@@ -1684,12 +1684,11 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression
     export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
         /** The name of this extension. */
         readonly name: string;
-        /** The draco compression used to decode vertex data. */
+        /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
         dracoCompression?: DracoCompression;
         /** Defines whether this extension is enabled. */
         enabled: boolean;
         private _loader;
-        private _dracoCompressionOwned;
         /** @hidden */
         constructor(loader: GLTFLoader);
         /** @hidden */
@@ -3888,12 +3887,11 @@ declare module BABYLON.GLTF2.Loader.Extensions {
     export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
         /** The name of this extension. */
         readonly name: string;
-        /** The draco compression used to decode vertex data. */
+        /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
         dracoCompression?: DracoCompression;
         /** Defines whether this extension is enabled. */
         enabled: boolean;
         private _loader;
-        private _dracoCompressionOwned;
         /** @hidden */
         constructor(loader: GLTFLoader);
         /** @hidden */

+ 1 - 1
dist/preview release/packagesSizeBaseLine.json

@@ -1 +1 @@
-{"engineOnly":289083,"sceneOnly":495792,"minGridMaterial":620867,"minStandardMaterial":745413}
+{"engineOnly":289102,"sceneOnly":495880,"minGridMaterial":621110,"minStandardMaterial":745656}

+ 30 - 6
dist/preview release/viewer/babylon.module.d.ts

@@ -17298,6 +17298,8 @@ declare module "babylonjs/Meshes/instancedMesh" {
         _preActivate(): InstancedMesh;
         /** @hidden */
         _activate(renderId: number): boolean;
+        /** @hidden */
+        _postActivate(): void;
         getWorldMatrix(): Matrix;
         readonly isAnInstance: boolean;
         /**
@@ -25186,9 +25188,11 @@ declare module "babylonjs/Meshes/abstractMesh" {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: Nullable<any>;
-        /** @hidden */
-        _waitingFreezeWorldMatrix: Nullable<boolean>;
+        _waitingData: {
+            lods: Nullable<any>;
+            actions: Nullable<any>;
+            freezeWorldMatrix: Nullable<boolean>;
+        };
         private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
@@ -25363,6 +25367,8 @@ declare module "babylonjs/Meshes/abstractMesh" {
         /** @hidden */
         _activate(renderId: number): boolean;
         /** @hidden */
+        _postActivate(): void;
+        /** @hidden */
         _freeze(): void;
         /** @hidden */
         _unFreeze(): void;
@@ -36016,6 +36022,7 @@ declare module "babylonjs/Cameras/Inputs/arcRotateCameraMouseWheelInput" {
         wheelDeltaPercentage: number;
         private _wheel;
         private _observer;
+        private computeDeltaFromMouseWheelLegacyEvent;
         /**
          * Attach the input controls to a specific dom element to get the input from.
          * @param element Defines the element the controls should be listened from
@@ -52017,6 +52024,11 @@ declare module "babylonjs/Meshes/Compression/dracoCompression" {
          */
         static DefaultNumWorkers: number;
         private static GetDefaultNumWorkers;
+        private static _Default;
+        /**
+         * Default instance for the draco compression object.
+         */
+        static readonly Default: DracoCompression;
         /**
          * Constructor
          * @param numWorkers The number of workers for async operations
@@ -76862,6 +76874,8 @@ declare module BABYLON {
         _preActivate(): InstancedMesh;
         /** @hidden */
         _activate(renderId: number): boolean;
+        /** @hidden */
+        _postActivate(): void;
         getWorldMatrix(): Matrix;
         readonly isAnInstance: boolean;
         /**
@@ -84496,9 +84510,11 @@ declare module BABYLON {
         /** @hidden */
         readonly _positions: Nullable<Vector3[]>;
         /** @hidden */
-        _waitingActions: Nullable<any>;
-        /** @hidden */
-        _waitingFreezeWorldMatrix: Nullable<boolean>;
+        _waitingData: {
+            lods: Nullable<any>;
+            actions: Nullable<any>;
+            freezeWorldMatrix: Nullable<boolean>;
+        };
         private _skeleton;
         /** @hidden */
         _bonesTransformMatrices: Nullable<Float32Array>;
@@ -84673,6 +84689,8 @@ declare module BABYLON {
         /** @hidden */
         _activate(renderId: number): boolean;
         /** @hidden */
+        _postActivate(): void;
+        /** @hidden */
         _freeze(): void;
         /** @hidden */
         _unFreeze(): void;
@@ -95035,6 +95053,7 @@ declare module BABYLON {
         wheelDeltaPercentage: number;
         private _wheel;
         private _observer;
+        private computeDeltaFromMouseWheelLegacyEvent;
         /**
          * Attach the input controls to a specific dom element to get the input from.
          * @param element Defines the element the controls should be listened from
@@ -109770,6 +109789,11 @@ declare module BABYLON {
          */
         static DefaultNumWorkers: number;
         private static GetDefaultNumWorkers;
+        private static _Default;
+        /**
+         * Default instance for the draco compression object.
+         */
+        static readonly Default: DracoCompression;
         /**
          * Constructor
          * @param numWorkers The number of workers for async operations

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 317 - 317
dist/preview release/viewer/babylon.viewer.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 4 - 4
dist/preview release/viewer/babylon.viewer.max.js


+ 2 - 4
dist/preview release/viewer/babylonjs.loaders.module.d.ts

@@ -1684,12 +1684,11 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression
     export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
         /** The name of this extension. */
         readonly name: string;
-        /** The draco compression used to decode vertex data. */
+        /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
         dracoCompression?: DracoCompression;
         /** Defines whether this extension is enabled. */
         enabled: boolean;
         private _loader;
-        private _dracoCompressionOwned;
         /** @hidden */
         constructor(loader: GLTFLoader);
         /** @hidden */
@@ -3888,12 +3887,11 @@ declare module BABYLON.GLTF2.Loader.Extensions {
     export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
         /** The name of this extension. */
         readonly name: string;
-        /** The draco compression used to decode vertex data. */
+        /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
         dracoCompression?: DracoCompression;
         /** Defines whether this extension is enabled. */
         enabled: boolean;
         private _loader;
-        private _dracoCompressionOwned;
         /** @hidden */
         constructor(loader: GLTFLoader);
         /** @hidden */

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

@@ -144,6 +144,7 @@
 - Added `Matrix.RotationAlignToRef` method to obtain rotation matrix from one vector to another ([sable](https://github.com/thscott))
 - ArcRotateCamera will now cache the necessary matrices when modifying its upVector, instead of calculating them each time they're needed ([sable](https://github.com/thscott))
 - Update `DracoCompression` to use web workers ([bghgary](https://github.com/bghgary))
+- Added `LOD Babylon Mesh Entities` to support to babylonFileLoader.ts ([MackeyK24](https://github.com/mackeyk24))
 
 ### OBJ Loader
 - Add color vertex support (not part of standard) ([brianzinn](https://github.com/brianzinn))
@@ -197,7 +198,7 @@
 - Context loss causing unexpected results with dynamic textures, geometries with the same name and reflectionTextures ([TrevorDev](https://github.com/TrevorDev))
 - CreateScreenshotUsingRenderTarget stretches mirror textures when setting both width and height ([TrevorDev](https://github.com/TrevorDev))
 - VR helper only updating vr cameras position when entering vr, rotation was missing, laser distance stopped working ([TrevorDev](https://github.com/TrevorDev))
-- Fix VR controllers after gltfLoader transformNode change ([TrevorDev](https://github.com/TrevorDev))
+- Fix VR controllers after gltfLoader transformNode was changed ([TrevorDev](https://github.com/TrevorDev))
 - Bounding Box fixedDragMeshScreenSize stopped working and allow rotating through bounding box ([TrevorDev](https://github.com/TrevorDev))
 - VR helper would rotate non vr camera while in VR ([TrevorDev](https://github.com/TrevorDev))
 - PointerDragBahavior using Mesh as base type, causing type-checking problems with AbstractMesh ([Poolminer](https://github.com/Poolminer/))
@@ -235,6 +236,7 @@
 - Fix code branch, that does not try to (re)load an `EquiRectangularCubeTexture`/`HDRCubeTexture` when the caching returns an empty or corrupt `InternalTexture` ([Dennis Dervisis](https://github.com/ddervisis))
 - Add error eventlistener (bubbling up the onError callback chain) in case an `EquiRectangularCubeTexture` cannot be loaded, because of a wrong path or IO problems ([Dennis Dervisis](https://github.com/ddervisis))
 - 3D GUI buttons no longer will scale up when pressing with a multitouch device ([TrevorDev](https://github.com/TrevorDev))
+- 2D GUI elements will use the last clicked controller instead of only the right controller when dual VR controllers are interacting with an element ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))
@@ -261,6 +263,7 @@
 - Add hemispheric lighting to gizmos to avoid flat look ([TrevorDev](https://github.com/TrevorDev))
 - Fix a bug causing `WebRequest.open` to crash if `WebRequest.CustomRequestHeaders` are set [#6055](https://github.com/BabylonJS/Babylon.js/issues/6055)([susares](https://github.com/susares))
 - Fix a bug causing `Mesh.clone` to crash if no physicsEngineComponent is used  ([barroij](https://github.com/barroij))
+- Fix zoom inertia making it difficult to zoom out with ArcRotateCamera ([TrevorDev](https://github.com/TrevorDev))
 
 ### Viewer
 

+ 1 - 1
gui/src/2D/advancedDynamicTexture.ts

@@ -515,7 +515,7 @@ export class AdvancedDynamicTexture extends DynamicTexture {
                     });
                     continue;
                 }
-                var position = mesh.getBoundingInfo().boundingSphere.center;
+                var position = mesh.getBoundingInfo ? mesh.getBoundingInfo().boundingSphere.center : mesh.getAbsolutePosition();
                 var projectedPosition = Vector3.Project(position, mesh.getWorldMatrix(), scene.getTransformMatrix(), globalViewport);
                 if (projectedPosition.z < 0 || projectedPosition.z > 1) {
                     control.notRenderable = true;

+ 9 - 3
gui/src/2D/controls/colorpicker.ts

@@ -29,6 +29,8 @@ export class ColorPicker extends Control {
     private _s = 1;
     private _v = 1;
 
+    private _lastPointerDownID = -1;
+
     /**
      * Observable raised when the value changes
      */
@@ -469,11 +471,15 @@ export class ColorPicker extends Control {
 
         this._updateValueFromPointer(x, y);
         this._host._capturingControl[pointerId] = this;
-
+        this._lastPointerDownID = pointerId;
         return true;
     }
 
-    public _onPointerMove(target: Control, coordinates: Vector2): void {
+    public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number): void {
+        // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)
+        if (pointerId != this._lastPointerDownID) {
+            return;
+        }
         // Invert transform
         this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);
 
@@ -484,7 +490,7 @@ export class ColorPicker extends Control {
             this._updateValueFromPointer(x, y);
         }
 
-        super._onPointerMove(target, coordinates);
+        super._onPointerMove(target, coordinates, pointerId);
     }
 
     public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {

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

@@ -1601,10 +1601,10 @@ export class Control {
     }
 
     /** @hidden */
-    public _onPointerMove(target: Control, coordinates: Vector2): void {
+    public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number): void {
         var canNotify: boolean = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this);
 
-        if (canNotify && this.parent != null) { this.parent._onPointerMove(target, coordinates); }
+        if (canNotify && this.parent != null) { this.parent._onPointerMove(target, coordinates, pointerId); }
     }
 
     /** @hidden */
@@ -1703,7 +1703,7 @@ export class Control {
         }
         this._dummyVector2.copyFromFloats(x, y);
         if (type === PointerEventTypes.POINTERMOVE) {
-            this._onPointerMove(this, this._dummyVector2);
+            this._onPointerMove(this, this._dummyVector2, pointerId);
 
             var previousControlOver = this._host._lastControlOver[pointerId];
             if (previousControlOver && previousControlOver !== this) {

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

@@ -993,13 +993,13 @@ export class InputText extends Control implements IFocusableControl {
 
         return true;
     }
-    public _onPointerMove(target: Control, coordinates: Vector2): void {
+    public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number): void {
         if (this._host.focusedControl === this && this._isPointerDown) {
             this._clickedCoordinate = coordinates.x;
             this._markAsDirty();
             this._updateValueFromCursorIndex(this._cursorOffset);
         }
-        super._onPointerMove(target, coordinates);
+        super._onPointerMove(target, coordinates, pointerId);
     }
 
     public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {

+ 10 - 3
gui/src/2D/controls/sliders/baseSlider.ts

@@ -18,6 +18,8 @@ export class BaseSlider extends Control {
     protected _displayThumb = true;
     private _step = 0;
 
+    private _lastPointerDownID = -1;
+
     // Shared rendering info
     protected _effectiveBarOffset = 0;
     protected _renderLeft: number;
@@ -301,16 +303,21 @@ export class BaseSlider extends Control {
 
         this._updateValueFromPointer(coordinates.x, coordinates.y);
         this._host._capturingControl[pointerId] = this;
-
+        this._lastPointerDownID = pointerId;
         return true;
     }
 
-    public _onPointerMove(target: Control, coordinates: Vector2): void {
+    public _onPointerMove(target: Control, coordinates: Vector2, pointerId: number): void {
+        // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)
+        if (pointerId != this._lastPointerDownID) {
+            return;
+        }
+
         if (this._pointerIsDown) {
             this._updateValueFromPointer(coordinates.x, coordinates.y);
         }
 
-        super._onPointerMove(target, coordinates);
+        super._onPointerMove(target, coordinates, pointerId);
     }
 
     public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {

+ 8 - 2
inspector/src/components/actionTabs/lines/vector2LineComponent.tsx

@@ -11,11 +11,17 @@ interface IVector2LineComponentProps {
     label: string;
     target: any;
     propertyName: string;
+    step?: number;
     onChange?: (newvalue: Vector2) => void;
     onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
 }
 
 export class Vector2LineComponent extends React.Component<IVector2LineComponentProps, { isExpanded: boolean, value: Vector2 }> {
+
+    static defaultProps = {
+        step: 0.001, // cm
+    };
+
     private _localChange = false;
 
     constructor(props: IVector2LineComponentProps) {
@@ -98,8 +104,8 @@ export class Vector2LineComponent extends React.Component<IVector2LineComponentP
                 {
                     this.state.isExpanded &&
                     <div className="secondLine">
-                        <NumericInputComponent label="x" value={this.state.value.x} onChange={value => this.updateStateX(value)} />
-                        <NumericInputComponent label="y" value={this.state.value.y} onChange={value => this.updateStateY(value)} />
+                        <NumericInputComponent label="x" step={this.props.step} value={this.state.value.x} onChange={value => this.updateStateX(value)} />
+                        <NumericInputComponent label="y" step={this.props.step} value={this.state.value.y} onChange={value => this.updateStateY(value)} />
                     </div>
                 }
             </div>

+ 1 - 1
inspector/src/components/actionTabs/lines/vector3LineComponent.tsx

@@ -19,7 +19,7 @@ interface IVector3LineComponentProps {
 export class Vector3LineComponent extends React.Component<IVector3LineComponentProps, { isExpanded: boolean, value: Vector3 }> {
 
     static defaultProps = {
-        step: 1,
+        step: 0.001, // cm
     };
 
     private _localChange = false;

+ 4 - 13
loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts

@@ -27,14 +27,13 @@ export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
     /** The name of this extension. */
     public readonly name = NAME;
 
-    /** The draco compression used to decode vertex data. */
+    /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
     public dracoCompression?: DracoCompression;
 
     /** Defines whether this extension is enabled. */
     public enabled = DracoCompression.DecoderAvailable;
 
     private _loader: GLTFLoader;
-    private _dracoCompressionOwned = false;
 
     /** @hidden */
     constructor(loader: GLTFLoader) {
@@ -43,11 +42,7 @@ export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
 
     /** @hidden */
     public dispose(): void {
-        if (this.dracoCompression && this._dracoCompressionOwned) {
-            this.dracoCompression.dispose();
-            delete this.dracoCompression;
-        }
-
+        delete this.dracoCompression;
         delete this._loader;
     }
 
@@ -93,12 +88,8 @@ export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
             var bufferView = ArrayItem.Get(extensionContext, this._loader.gltf.bufferViews, extension.bufferView) as IBufferViewDraco;
             if (!bufferView._dracoBabylonGeometry) {
                 bufferView._dracoBabylonGeometry = this._loader.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then((data) => {
-                    if (!this.dracoCompression) {
-                        this.dracoCompression = new DracoCompression();
-                        this._dracoCompressionOwned = true;
-                    }
-
-                    return this.dracoCompression.decodeMeshAsync(data, attributes).then((babylonVertexData) => {
+                    const dracoCompression = this.dracoCompression || DracoCompression.Default;
+                    return dracoCompression.decodeMeshAsync(data, attributes).then((babylonVertexData) => {
                         const babylonGeometry = new Geometry(babylonMesh.name, this._loader.babylonScene);
                         babylonVertexData.applyToGeometry(babylonGeometry);
                         return babylonGeometry;

+ 2 - 2
src/Audio/sound.ts

@@ -96,7 +96,7 @@ export class Sound {
     private _readyToPlayCallback: Nullable<() => any>;
     private _audioBuffer: Nullable<AudioBuffer>;
     private _soundSource: Nullable<AudioBufferSourceNode>;
-    private _streamingSource: MediaElementAudioSourceNode;
+    private _streamingSource: AudioNode;
     private _soundPanner: Nullable<PannerNode>;
     private _soundGain: Nullable<GainNode>;
     private _inputAudioNode: AudioNode;
@@ -190,7 +190,7 @@ export class Sound {
                         case "MediaStream":
                             this._streaming = true;
                             this._isReadyToPlay = true;
-                            this._streamingSource = Engine.audioEngine.audioContext.createMediaElementSource(urlOrArrayBuffer);
+                            this._streamingSource = Engine.audioEngine.audioContext.createMediaStreamSource(urlOrArrayBuffer);
 
                             if (this.autoplay) {
                                 this.play();

+ 22 - 5
src/Cameras/Inputs/arcRotateCameraMouseWheelInput.ts

@@ -31,6 +31,16 @@ export class ArcRotateCameraMouseWheelInput implements ICameraInput<ArcRotateCam
     private _wheel: Nullable<(p: PointerInfo, s: EventState) => void>;
     private _observer: Nullable<Observer<PointerInfo>>;
 
+    private computeDeltaFromMouseWheelLegacyEvent(mouseWheelLegacyEvent: any, radius: number) {
+        var delta = 0;
+        var wheelDelta = (mouseWheelLegacyEvent.wheelDelta * 0.01 * this.wheelDeltaPercentage) * radius;
+        if (mouseWheelLegacyEvent.wheelDelta > 0) {
+            delta = wheelDelta / (1.0 + this.wheelDeltaPercentage);
+        } else {
+            delta = wheelDelta * (1.0 + this.wheelDeltaPercentage);
+        }
+        return delta;
+    }
     /**
      * Attach the input controls to a specific dom element to get the input from.
      * @param element Defines the element the controls should be listened from
@@ -46,11 +56,18 @@ export class ArcRotateCameraMouseWheelInput implements ICameraInput<ArcRotateCam
             let mouseWheelLegacyEvent = event as any;
             if (mouseWheelLegacyEvent.wheelDelta) {
                 if (this.wheelDeltaPercentage) {
-                    var wheelDelta = (mouseWheelLegacyEvent.wheelDelta * 0.01 * this.wheelDeltaPercentage) * this.camera.radius;
-                    if (mouseWheelLegacyEvent.wheelDelta > 0) {
-                        delta = wheelDelta / (1.0 + this.wheelDeltaPercentage);
-                    } else {
-                        delta = wheelDelta * (1.0 + this.wheelDeltaPercentage);
+                    delta = this.computeDeltaFromMouseWheelLegacyEvent(mouseWheelLegacyEvent, this.camera.radius);
+
+                    // If zooming in, estimate the target radius and use that to compute the delta for inertia
+                    // this will stop multiple scroll events zooming in from adding too much inertia
+                    if (delta > 0) {
+                        var estimatedTargetRadius = this.camera.radius;
+                        var targetInertia = this.camera.inertialRadiusOffset + delta;
+                        for (var i = 0; i < 20 && Math.abs(targetInertia) > 0.001; i++) {
+                            estimatedTargetRadius -= targetInertia;
+                            targetInertia *= this.camera.inertia;
+                        }
+                        delta = this.computeDeltaFromMouseWheelLegacyEvent(mouseWheelLegacyEvent, estimatedTargetRadius);
                     }
                 } else {
                     delta = mouseWheelLegacyEvent.wheelDelta / (this.wheelPrecision * 40);

+ 6 - 0
src/Cameras/VR/vrExperienceHelper.ts

@@ -1114,6 +1114,12 @@ export class VRExperienceHelper {
             });
 
             this._hasEnteredVR = false;
+
+            // Update engine state to re enable non-vr camera input
+            var engine = this._scene.getEngine();
+            if (engine._onVrDisplayPresentChange) {
+                engine._onVrDisplayPresentChange();
+            }
         }
     }
 

+ 51 - 9
src/Loading/Plugins/babylonFileLoader.ts

@@ -61,6 +61,42 @@ var logOperation = (operation: string, producer: { file: string, name: string, v
     return operation + " of " + (producer ? producer.file + " from " + producer.name + " version: " + producer.version + ", exporter version: " + producer.exporter_version : "unknown");
 };
 
+var loadDetailLevels = (scene: Scene, mesh: AbstractMesh) => {
+    const mastermesh: Mesh = mesh as Mesh;
+
+    // Every value specified in the ids array of the lod data points to another mesh which should be used as the lower LOD level.
+    // The distances (or coverages) array values specified are used along with the lod mesh ids as a hint to determine the switching threshold for the various LODs.
+    if (mesh._waitingData.lods) {
+        if (mesh._waitingData.lods.ids && mesh._waitingData.lods.ids.length > 0) {
+            const lodmeshes: string[] = mesh._waitingData.lods.ids;
+            const wasenabled: boolean = mastermesh.isEnabled(false);
+            if (mesh._waitingData.lods.distances) {
+                const distances: number[] = mesh._waitingData.lods.distances;
+                if (distances.length >= lodmeshes.length) {
+                    const culling: number = (distances.length > lodmeshes.length) ? distances[distances.length - 1] : 0;
+                    mastermesh.setEnabled(false);
+                    for (let index = 0; index < lodmeshes.length; index++) {
+                        const lodid: string = lodmeshes[index];
+                        const lodmesh: Mesh = scene.getMeshByID(lodid) as Mesh;
+                        if (lodmesh != null) {
+                            mastermesh.addLODLevel(distances[index], lodmesh);
+                        }
+                    }
+                    if (culling > 0) {
+                        mastermesh.addLODLevel(culling, null);
+                    }
+                    if (wasenabled === true) {
+                        mastermesh.setEnabled(true);
+                    }
+                } else {
+                    Tools.Warn("Invalid level of detail distances for " + mesh.name);
+                }
+            }
+        }
+        mesh._waitingData.lods = null;
+    }
+};
+
 var loadAssetContainer = (scene: Scene, data: string, rootUrl: string, onError?: (message: string, exception?: any) => void, addToScene = false): AssetContainer => {
     var container = new AssetContainer(scene);
 
@@ -290,7 +326,7 @@ var loadAssetContainer = (scene: Scene, data: string, rootUrl: string, onError?:
             }
         }
 
-        // Connect parents & children and parse actions
+        // Connect parents & children and parse actions and lods
         for (index = 0, cache = scene.transformNodes.length; index < cache; index++) {
             var transformNode = scene.transformNodes[index];
             if (transformNode._waitingParentId) {
@@ -304,14 +340,17 @@ var loadAssetContainer = (scene: Scene, data: string, rootUrl: string, onError?:
                 mesh.parent = scene.getLastEntryByID(mesh._waitingParentId);
                 mesh._waitingParentId = null;
             }
+            if (mesh._waitingData.lods) {
+                loadDetailLevels(scene, mesh);
+            }
         }
 
         // freeze world matrix application
         for (index = 0, cache = scene.meshes.length; index < cache; index++) {
             var currentMesh = scene.meshes[index];
-            if (currentMesh._waitingFreezeWorldMatrix) {
+            if (currentMesh._waitingData.freezeWorldMatrix) {
                 currentMesh.freezeWorldMatrix();
-                currentMesh._waitingFreezeWorldMatrix = null;
+                currentMesh._waitingData.freezeWorldMatrix = null;
             } else {
                 currentMesh.computeWorldMatrix(true);
             }
@@ -352,9 +391,9 @@ var loadAssetContainer = (scene: Scene, data: string, rootUrl: string, onError?:
         // Actions (scene) Done last as it can access other objects.
         for (index = 0, cache = scene.meshes.length; index < cache; index++) {
             var mesh = scene.meshes[index];
-            if (mesh._waitingActions) {
-                ActionManager.Parse(mesh._waitingActions, mesh, scene);
-                mesh._waitingActions = null;
+            if (mesh._waitingData.actions) {
+                ActionManager.Parse(mesh._waitingData.actions, mesh, scene);
+                mesh._waitingData.actions = null;
             }
         }
         if (parsedData.actions !== undefined && parsedData.actions !== null) {
@@ -517,7 +556,7 @@ SceneLoader.RegisterPlugin({
                     }
                 }
 
-                // Connecting parents
+                // Connecting parents and lods
                 var currentMesh: AbstractMesh;
                 for (index = 0, cache = scene.meshes.length; index < cache; index++) {
                     currentMesh = scene.meshes[index];
@@ -525,14 +564,17 @@ SceneLoader.RegisterPlugin({
                         currentMesh.parent = scene.getLastEntryByID(currentMesh._waitingParentId);
                         currentMesh._waitingParentId = null;
                     }
+                    if (currentMesh._waitingData.lods) {
+                        loadDetailLevels(scene, currentMesh);
+                    }
                 }
 
                 // freeze and compute world matrix application
                 for (index = 0, cache = scene.meshes.length; index < cache; index++) {
                     currentMesh = scene.meshes[index];
-                    if (currentMesh._waitingFreezeWorldMatrix) {
+                    if (currentMesh._waitingData.freezeWorldMatrix) {
                         currentMesh.freezeWorldMatrix();
-                        currentMesh._waitingFreezeWorldMatrix = null;
+                        currentMesh._waitingData.freezeWorldMatrix = null;
                     } else {
                         currentMesh.computeWorldMatrix(true);
                     }

+ 1 - 1
src/Materials/PBR/pbrBaseMaterial.ts

@@ -1170,7 +1170,7 @@ export abstract class PBRBaseMaterial extends PushMaterial {
             "vLightingIntensity",
             "logarithmicDepthConstant",
             "vSphericalX", "vSphericalY", "vSphericalZ",
-            "vSphericalXX", "vSphericalYY", "vSphericalZZ",
+            "vSphericalXX_ZZ", "vSphericalYY_ZZ", "vSphericalZZ",
             "vSphericalXY", "vSphericalYZ", "vSphericalZX",
             "vSphericalL00",
             "vSphericalL1_1", "vSphericalL10", "vSphericalL11",

+ 1 - 1
src/Materials/uniformBuffer.ts

@@ -383,7 +383,7 @@ export class UniformBuffer {
 
     /** @hidden */
     public _rebuild(): void {
-        if (this._noUBO) {
+        if (this._noUBO || !this._bufferData) {
             return;
         }
 

+ 14 - 6
src/Meshes/Compression/dracoCompression.ts

@@ -117,17 +117,25 @@ export class DracoCompression implements IDisposable {
     public static DefaultNumWorkers = DracoCompression.GetDefaultNumWorkers();
 
     private static GetDefaultNumWorkers(): number {
-        if (typeof navigator === "undefined") {
+        if (typeof navigator === "undefined" || !navigator.hardwareConcurrency) {
             return 1;
         }
 
-        const hardwareConcurrency =  navigator.hardwareConcurrency;
-        if (!hardwareConcurrency) {
-            return 1;
+        // Use 50% of the available logical processors but capped at 4.
+        return Math.min(Math.floor(navigator.hardwareConcurrency * 0.5), 4);
+    }
+
+    private static _Default: Nullable<DracoCompression> = null;
+
+    /**
+     * Default instance for the draco compression object.
+     */
+    public static get Default(): DracoCompression {
+        if (!DracoCompression._Default) {
+            DracoCompression._Default = new DracoCompression();
         }
 
-        // Use 50% of the available logical processors but capped at 4.
-        return Math.min(Math.floor(hardwareConcurrency * 0.5), 4);
+        return DracoCompression._Default;
     }
 
     /**

+ 15 - 4
src/Meshes/abstractMesh.ts

@@ -598,9 +598,15 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
 
     // Loading properties
     /** @hidden */
-    public _waitingActions: Nullable<any> = null;
-    /** @hidden */
-    public _waitingFreezeWorldMatrix: Nullable<boolean> = null;
+    public _waitingData: {
+        lods: Nullable<any>,
+        actions: Nullable<any>
+        freezeWorldMatrix: Nullable<boolean>
+    } = {
+            lods: null,
+            actions: null,
+            freezeWorldMatrix: null
+        };
 
     // Skeleton
     private _skeleton: Nullable<Skeleton> = null;
@@ -674,7 +680,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
         }
         if (fullDetails) {
             ret += ", billboard mode: " + (["NONE", "X", "Y", null, "Z", null, null, "ALL"])[this.billboardMode];
-            ret += ", freeze wrld mat: " + (this._isWorldMatrixFrozen || this._waitingFreezeWorldMatrix ? "YES" : "NO");
+            ret += ", freeze wrld mat: " + (this._isWorldMatrixFrozen || this._waitingData.freezeWorldMatrix ? "YES" : "NO");
         }
         return ret;
     }
@@ -1046,6 +1052,11 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
     }
 
     /** @hidden */
+    public _postActivate(): void {
+        // Do nothing
+    }
+
+    /** @hidden */
     public _freeze() {
         // Do nothing
     }

+ 7 - 4
src/Meshes/instancedMesh.ts

@@ -283,10 +283,6 @@ export class InstancedMesh extends AbstractMesh {
             this._currentLOD._registerInstanceForRenderId(this, renderId);
         }
 
-        if (this._edgesRenderer && this._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup) {
-            this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer);
-        }
-
         if (!this._currentLOD._isActive) {
             this._currentLOD._onlyForInstances = true;
             return true;
@@ -294,6 +290,13 @@ export class InstancedMesh extends AbstractMesh {
         return false;
     }
 
+    /** @hidden */
+    public _postActivate(): void {
+        if (this._edgesRenderer && this._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup) {
+            this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer);
+        }
+    }
+
     public getWorldMatrix(): Matrix {
         if (this._currentLOD && this._currentLOD.billboardMode !== TransformNode.BILLBOARDMODE_NONE && this._currentLOD._masterMesh !== this) {
             let tempMaster = this._currentLOD._masterMesh;

+ 11 - 2
src/Meshes/mesh.ts

@@ -2975,7 +2975,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
         // freezeWorldMatrix
         if (parsedMesh.freezeWorldMatrix) {
-            mesh._waitingFreezeWorldMatrix = parsedMesh.freezeWorldMatrix;
+            mesh._waitingData.freezeWorldMatrix = parsedMesh.freezeWorldMatrix;
         }
 
         // Parent
@@ -2985,7 +2985,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
 
         // Actions
         if (parsedMesh.actions !== undefined) {
-            mesh._waitingActions = parsedMesh.actions;
+            mesh._waitingData.actions = parsedMesh.actions;
         }
 
         // Overlay
@@ -3109,6 +3109,15 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
             Mesh._PhysicsImpostorParser(scene, mesh, parsedMesh);
         }
 
+        // Levels
+        if (parsedMesh.lodMeshIds) {
+            mesh._waitingData.lods = {
+                ids: parsedMesh.lodMeshIds,
+                distances: (parsedMesh.lodDistances) ? parsedMesh.lodDistances : null,
+                coverages: (parsedMesh.lodCoverages) ? parsedMesh.lodCoverages : null
+            };
+        }
+
         // Instances
         if (parsedMesh.instances) {
             for (var index = 0; index < parsedMesh.instances.length; index++) {

+ 2 - 0
src/scene.ts

@@ -3316,6 +3316,8 @@ export class Scene extends AbstractScene implements IAnimatable {
                     meshToRender._isActive = true;
                     this._activeMesh(mesh, meshToRender);
                 }
+
+                mesh._postActivate();
             }
         }
 

binární
tests/validation/ReferenceImages/lodbillboardinstances.png


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 746 - 741
tests/validation/config.json