Selaa lähdekoodia

Better WM management when there is a parent

David Catuhe 7 vuotta sitten
vanhempi
commit
8daedfa593

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4429 - 4268
Playground/babylon.d.txt


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 8194 - 8193
dist/preview release/babylon.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 15 - 15
dist/preview release/babylon.js


+ 5 - 2
dist/preview release/babylon.max.js

@@ -15709,6 +15709,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._childRenderId = -1;
             this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
@@ -15912,7 +15913,7 @@ var BABYLON;
         /** @ignore */
         Node.prototype._markSyncedWithParent = function () {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         };
         /** @ignore */
@@ -15920,7 +15921,7 @@ var BABYLON;
             if (!this.parent) {
                 return true;
             }
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
             return this.parent.isSynchronized();
@@ -17228,6 +17229,7 @@ var BABYLON;
                 return this._worldMatrix;
             }
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
             this._cache.position.copyFrom(this.position);
@@ -17235,6 +17237,7 @@ var BABYLON;
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
             // Scaling
             BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 15 - 15
dist/preview release/babylon.worker.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 6926 - 6925
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 15 - 15
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 5 - 2
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -15709,6 +15709,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._childRenderId = -1;
             this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
@@ -15912,7 +15913,7 @@ var BABYLON;
         /** @ignore */
         Node.prototype._markSyncedWithParent = function () {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         };
         /** @ignore */
@@ -15920,7 +15921,7 @@ var BABYLON;
             if (!this.parent) {
                 return true;
             }
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
             return this.parent.isSynchronized();
@@ -17228,6 +17229,7 @@ var BABYLON;
                 return this._worldMatrix;
             }
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
             this._cache.position.copyFrom(this.position);
@@ -17235,6 +17237,7 @@ var BABYLON;
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
             // Scaling
             BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);

+ 5 - 2
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -15681,6 +15681,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._childRenderId = -1;
             this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
@@ -15884,7 +15885,7 @@ var BABYLON;
         /** @ignore */
         Node.prototype._markSyncedWithParent = function () {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         };
         /** @ignore */
@@ -15892,7 +15893,7 @@ var BABYLON;
             if (!this.parent) {
                 return true;
             }
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
             return this.parent.isSynchronized();
@@ -17200,6 +17201,7 @@ var BABYLON;
                 return this._worldMatrix;
             }
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
             this._cache.position.copyFrom(this.position);
@@ -17207,6 +17209,7 @@ var BABYLON;
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
             // Scaling
             BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);

+ 5 - 2
dist/preview release/es6.js

@@ -15681,6 +15681,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._childRenderId = -1;
             this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
@@ -15884,7 +15885,7 @@ var BABYLON;
         /** @ignore */
         Node.prototype._markSyncedWithParent = function () {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         };
         /** @ignore */
@@ -15892,7 +15893,7 @@ var BABYLON;
             if (!this.parent) {
                 return true;
             }
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
             return this.parent.isSynchronized();
@@ -17200,6 +17201,7 @@ var BABYLON;
                 return this._worldMatrix;
             }
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
             this._cache.position.copyFrom(this.position);
@@ -17207,6 +17209,7 @@ var BABYLON;
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
             // Scaling
             BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 43 - 43
dist/preview release/viewer/babylon.viewer.js


+ 5 - 2
dist/preview release/viewer/babylon.viewer.max.js

@@ -15797,6 +15797,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._childRenderId = -1;
             this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
@@ -16000,7 +16001,7 @@ var BABYLON;
         /** @ignore */
         Node.prototype._markSyncedWithParent = function () {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         };
         /** @ignore */
@@ -16008,7 +16009,7 @@ var BABYLON;
             if (!this.parent) {
                 return true;
             }
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }
             return this.parent.isSynchronized();
@@ -17316,6 +17317,7 @@ var BABYLON;
                 return this._worldMatrix;
             }
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
             this._cache.position.copyFrom(this.position);
@@ -17323,6 +17325,7 @@ var BABYLON;
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
             // Scaling
             BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);

+ 2 - 0
src/Mesh/babylon.transformNode.ts

@@ -705,6 +705,7 @@ module BABYLON {
             }
 
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
 
@@ -713,6 +714,7 @@ module BABYLON {
             this._cache.pivotMatrixUpdated = false;
             this._cache.billboardMode = this.billboardMode;
             this._currentRenderId = this.getScene().getRenderId();
+            this._childRenderId = this.getScene().getRenderId();
             this._isDirty = false;
 
             // Scaling

+ 3 - 2
src/babylon.node.ts

@@ -58,6 +58,7 @@
         /** @ignore */
         public _currentRenderId = -1;
         private _parentRenderId = -1;
+        protected _childRenderId = -1;
 
         /** @ignore */
         public _waitingParentId: Nullable<string>;
@@ -295,7 +296,7 @@
         /** @ignore */
         public _markSyncedWithParent() {
             if (this.parent) {
-                this._parentRenderId = this.parent._currentRenderId;
+                this._parentRenderId = this.parent._childRenderId;
             }
         }
 
@@ -305,7 +306,7 @@
                 return true;
             }
 
-            if (this._parentRenderId !== this.parent._currentRenderId) {
+            if (this._parentRenderId !== this.parent._childRenderId) {
                 return false;
             }