Просмотр исходного кода

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

Borut 7 лет назад
Родитель
Сommit
dfbf332a5f

Разница между файлами не показана из-за своего большого размера
+ 13636 - 13475
Playground/babylon.d.txt


Разница между файлами не показана из-за своего большого размера
+ 9662 - 9661
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 23 - 23
dist/preview release/babylon.js


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

@@ -11262,7 +11262,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.1";
+                return "3.2.0-beta.2";
             },
             enumerable: true,
             configurable: true
@@ -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]);
@@ -78586,15 +78589,14 @@ var BABYLON;
             if (!this._intersectsWithSphere(impostor, origin, radius)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var direction = impostorObjectCenter.subtract(origin);
             var ray = new BABYLON.Ray(origin, direction, radius);
             this._rays.push(ray);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -78890,15 +78892,14 @@ var BABYLON;
             if (!this._intersectsWithCylinder(impostor)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
             var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
             var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;

Разница между файлами не показана из-за своего большого размера
+ 23 - 23
dist/preview release/babylon.worker.js


Разница между файлами не показана из-за своего большого размера
+ 10159 - 10158
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 23 - 23
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 10 - 9
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -11262,7 +11262,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.1";
+                return "3.2.0-beta.2";
             },
             enumerable: true,
             configurable: true
@@ -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]);
@@ -77871,15 +77874,14 @@ var BABYLON;
             if (!this._intersectsWithSphere(impostor, origin, radius)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var direction = impostorObjectCenter.subtract(origin);
             var ray = new BABYLON.Ray(origin, direction, radius);
             this._rays.push(ray);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -78175,15 +78177,14 @@ var BABYLON;
             if (!this._intersectsWithCylinder(impostor)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
             var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
             var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;

+ 10 - 9
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -11234,7 +11234,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.1";
+                return "3.2.0-beta.2";
             },
             enumerable: true,
             configurable: true
@@ -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]);
@@ -77843,15 +77846,14 @@ var BABYLON;
             if (!this._intersectsWithSphere(impostor, origin, radius)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var direction = impostorObjectCenter.subtract(origin);
             var ray = new BABYLON.Ray(origin, direction, radius);
             this._rays.push(ray);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -78147,15 +78149,14 @@ var BABYLON;
             if (!this._intersectsWithCylinder(impostor)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
             var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
             var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;

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

@@ -11234,7 +11234,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.1";
+                return "3.2.0-beta.2";
             },
             enumerable: true,
             configurable: true
@@ -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]);
@@ -78558,15 +78561,14 @@ var BABYLON;
             if (!this._intersectsWithSphere(impostor, origin, radius)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var direction = impostorObjectCenter.subtract(origin);
             var ray = new BABYLON.Ray(origin, direction, radius);
             this._rays.push(ray);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -78862,15 +78864,14 @@ var BABYLON;
             if (!this._intersectsWithCylinder(impostor)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
             var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
             var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;

Разница между файлами не показана из-за своего большого размера
+ 44 - 44
dist/preview release/viewer/babylon.viewer.js


+ 10 - 9
dist/preview release/viewer/babylon.viewer.max.js

@@ -11350,7 +11350,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.1";
+                return "3.2.0-beta.2";
             },
             enumerable: true,
             configurable: true
@@ -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]);
@@ -78674,15 +78677,14 @@ var BABYLON;
             if (!this._intersectsWithSphere(impostor, origin, radius)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var direction = impostorObjectCenter.subtract(origin);
             var ray = new BABYLON.Ray(origin, direction, radius);
             this._rays.push(ray);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;
@@ -78978,15 +78980,14 @@ var BABYLON;
             if (!this._intersectsWithCylinder(impostor)) {
                 return null;
             }
-            if (impostor.object.getClassName() !== 'Mesh') {
+            if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
                 return null;
             }
-            var impostorObject = impostor.object;
             var impostorObjectCenter = impostor.getObjectCenter();
             var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
             var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
             var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
-            var hit = ray.intersectsMesh(impostorObject);
+            var hit = ray.intersectsMesh(impostor.object);
             var contactPoint = hit.pickedPoint;
             if (!contactPoint) {
                 return null;

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -597,7 +597,7 @@
         }
 
         public static get Version(): string {
-            return "3.2.0-beta.1";
+            return "3.2.0-beta.2";
         }
 
         // Updatable statics so stick with vars here

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

@@ -740,6 +740,7 @@ module BABYLON {
             }
 
             if (!force && this.isSynchronized(true)) {
+                this._currentRenderId = this.getScene().getRenderId();
                 return this._worldMatrix;
             }
 
@@ -748,6 +749,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;
             }