Browse Source

Merge pull request #5541 from sebavan/master

Nightly + Inspector Fix
sebavan 6 năm trước cách đây
mục cha
commit
9640c2e5e2

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 5560 - 5558
Playground/babylon.d.txt


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 5569 - 5567
dist/preview release/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/babylon.js


+ 15 - 13
dist/preview release/babylon.max.js

@@ -66605,6 +66605,8 @@ var BABYLON;
              */
             function AxesViewer(scene, scaleLines) {
                 if (scaleLines === void 0) { scaleLines = 1; }
+                this._tmpVector = new BABYLON.Vector3();
+                this._scaleLinesFactor = 4;
                 /**
                  * Gets or sets a number used to scale line length
                  */
@@ -66623,11 +66625,11 @@ var BABYLON;
                 this._ymesh = BABYLON.AxisDragGizmo._CreateArrow(scene, greenColoredMaterial);
                 this._zmesh = BABYLON.AxisDragGizmo._CreateArrow(scene, blueColoredMaterial);
                 this._xmesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._xmesh.scaling.scaleInPlace(4);
+                this._xmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 this._ymesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._ymesh.scaling.scaleInPlace(4);
+                this._ymesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 this._zmesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._zmesh.scaling.scaleInPlace(4);
+                this._zmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 AxesViewer._recursiveChangeRenderingGroupId(this._xmesh, 2);
                 AxesViewer._recursiveChangeRenderingGroupId(this._ymesh, 2);
                 AxesViewer._recursiveChangeRenderingGroupId(this._zmesh, 2);
@@ -66674,21 +66676,21 @@ var BABYLON;
             AxesViewer.prototype.update = function (position, xaxis, yaxis, zaxis) {
                 if (this._xmesh) {
                     this._xmesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), xaxis);
-                    this._xmesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), xaxis));
-                    this._xmesh.rotationQuaternion.normalize();
+                    xaxis.scaleToRef(-1, this._tmpVector);
+                    this._xmesh.setDirection(this._tmpVector);
+                    this._xmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
                 if (this._ymesh) {
                     this._ymesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), yaxis);
-                    this._ymesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), yaxis));
-                    this._ymesh.rotationQuaternion.normalize();
+                    yaxis.scaleToRef(-1, this._tmpVector);
+                    this._ymesh.setDirection(this._tmpVector);
+                    this._ymesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
                 if (this._zmesh) {
                     this._zmesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), zaxis);
-                    this._zmesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), zaxis));
-                    this._zmesh.rotationQuaternion.normalize();
+                    zaxis.scaleToRef(-1, this._tmpVector);
+                    this._zmesh.setDirection(this._tmpVector);
+                    this._zmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
             };
             /** Releases resources */
@@ -67002,7 +67004,7 @@ var BABYLON;
          * @returns true if visible otherwise, false
          */
         DebugLayer.prototype.isVisible = function () {
-            return this.BJSINSPECTOR.Inspector.IsVisible;
+            return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;
         };
         /**
          * Hide the inspector and close its window.

+ 15 - 13
dist/preview release/babylon.no-module.max.js

@@ -66572,6 +66572,8 @@ var BABYLON;
              */
             function AxesViewer(scene, scaleLines) {
                 if (scaleLines === void 0) { scaleLines = 1; }
+                this._tmpVector = new BABYLON.Vector3();
+                this._scaleLinesFactor = 4;
                 /**
                  * Gets or sets a number used to scale line length
                  */
@@ -66590,11 +66592,11 @@ var BABYLON;
                 this._ymesh = BABYLON.AxisDragGizmo._CreateArrow(scene, greenColoredMaterial);
                 this._zmesh = BABYLON.AxisDragGizmo._CreateArrow(scene, blueColoredMaterial);
                 this._xmesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._xmesh.scaling.scaleInPlace(4);
+                this._xmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 this._ymesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._ymesh.scaling.scaleInPlace(4);
+                this._ymesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 this._zmesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._zmesh.scaling.scaleInPlace(4);
+                this._zmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 AxesViewer._recursiveChangeRenderingGroupId(this._xmesh, 2);
                 AxesViewer._recursiveChangeRenderingGroupId(this._ymesh, 2);
                 AxesViewer._recursiveChangeRenderingGroupId(this._zmesh, 2);
@@ -66641,21 +66643,21 @@ var BABYLON;
             AxesViewer.prototype.update = function (position, xaxis, yaxis, zaxis) {
                 if (this._xmesh) {
                     this._xmesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), xaxis);
-                    this._xmesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), xaxis));
-                    this._xmesh.rotationQuaternion.normalize();
+                    xaxis.scaleToRef(-1, this._tmpVector);
+                    this._xmesh.setDirection(this._tmpVector);
+                    this._xmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
                 if (this._ymesh) {
                     this._ymesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), yaxis);
-                    this._ymesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), yaxis));
-                    this._ymesh.rotationQuaternion.normalize();
+                    yaxis.scaleToRef(-1, this._tmpVector);
+                    this._ymesh.setDirection(this._tmpVector);
+                    this._ymesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
                 if (this._zmesh) {
                     this._zmesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), zaxis);
-                    this._zmesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), zaxis));
-                    this._zmesh.rotationQuaternion.normalize();
+                    zaxis.scaleToRef(-1, this._tmpVector);
+                    this._zmesh.setDirection(this._tmpVector);
+                    this._zmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
             };
             /** Releases resources */
@@ -66969,7 +66971,7 @@ var BABYLON;
          * @returns true if visible otherwise, false
          */
         DebugLayer.prototype.isVisible = function () {
-            return this.BJSINSPECTOR.Inspector.IsVisible;
+            return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;
         };
         /**
          * Hide the inspector and close its window.

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/babylon.worker.js


+ 15 - 13
dist/preview release/es6.js

@@ -66572,6 +66572,8 @@ var BABYLON;
              */
             function AxesViewer(scene, scaleLines) {
                 if (scaleLines === void 0) { scaleLines = 1; }
+                this._tmpVector = new BABYLON.Vector3();
+                this._scaleLinesFactor = 4;
                 /**
                  * Gets or sets a number used to scale line length
                  */
@@ -66590,11 +66592,11 @@ var BABYLON;
                 this._ymesh = BABYLON.AxisDragGizmo._CreateArrow(scene, greenColoredMaterial);
                 this._zmesh = BABYLON.AxisDragGizmo._CreateArrow(scene, blueColoredMaterial);
                 this._xmesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._xmesh.scaling.scaleInPlace(4);
+                this._xmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 this._ymesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._ymesh.scaling.scaleInPlace(4);
+                this._ymesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 this._zmesh.rotationQuaternion = new BABYLON.Quaternion();
-                this._zmesh.scaling.scaleInPlace(4);
+                this._zmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 AxesViewer._recursiveChangeRenderingGroupId(this._xmesh, 2);
                 AxesViewer._recursiveChangeRenderingGroupId(this._ymesh, 2);
                 AxesViewer._recursiveChangeRenderingGroupId(this._zmesh, 2);
@@ -66641,21 +66643,21 @@ var BABYLON;
             AxesViewer.prototype.update = function (position, xaxis, yaxis, zaxis) {
                 if (this._xmesh) {
                     this._xmesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), xaxis);
-                    this._xmesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), xaxis));
-                    this._xmesh.rotationQuaternion.normalize();
+                    xaxis.scaleToRef(-1, this._tmpVector);
+                    this._xmesh.setDirection(this._tmpVector);
+                    this._xmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
                 if (this._ymesh) {
                     this._ymesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), yaxis);
-                    this._ymesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), yaxis));
-                    this._ymesh.rotationQuaternion.normalize();
+                    yaxis.scaleToRef(-1, this._tmpVector);
+                    this._ymesh.setDirection(this._tmpVector);
+                    this._ymesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
                 if (this._zmesh) {
                     this._zmesh.position.copyFrom(position);
-                    var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), zaxis);
-                    this._zmesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), zaxis));
-                    this._zmesh.rotationQuaternion.normalize();
+                    zaxis.scaleToRef(-1, this._tmpVector);
+                    this._zmesh.setDirection(this._tmpVector);
+                    this._zmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
                 }
             };
             /** Releases resources */
@@ -66969,7 +66971,7 @@ var BABYLON;
          * @returns true if visible otherwise, false
          */
         DebugLayer.prototype.isVisible = function () {
-            return this.BJSINSPECTOR.Inspector.IsVisible;
+            return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;
         };
         /**
          * Hide the inspector and close its window.

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


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

@@ -116,6 +116,7 @@
 - Added a `DeepImmutable<T>` type to specifiy that a referenced object should be considered recursively immutable, meaning that all its properties are `readonly` and that if a property is a reference to an object, this object is also recursively immutable. ([barroij](https://github.com/barroij))
 - Fixed `VideoTexture` poster property when autoplay is turned off.
 - Fixed position and rotation of plane mesh created by MeshBuilder.CreatePlane when specifying a source plane ([sable](https://github.com/thscott), [bghgary](https://github.com/bghgary))
+- Fixed inspector dynamic loading ([Sebavan](https://github.com/Sebavan))
 
 ### Viewer
 

+ 1 - 1
src/Debug/babylon.debugLayer.ts

@@ -164,7 +164,7 @@ module BABYLON {
          * @returns true if visible otherwise, false
          */
         public isVisible(): boolean {
-            return this.BJSINSPECTOR.Inspector.IsVisible;
+            return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;
         }
 
         /**