David Catuhe 7 سال پیش
والد
کامیت
c2925f2562

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 6911 - 6897
Playground/babylon.d.txt


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 13243 - 13227
dist/preview release/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
dist/preview release/babylon.js


+ 90 - 73
dist/preview release/babylon.max.js

@@ -19853,18 +19853,6 @@ var BABYLON;
 var BABYLON;
 (function (BABYLON) {
     /** @hidden */
-    var _OcclusionDataStorage = /** @class */ (function () {
-        function _OcclusionDataStorage() {
-            /** @hidden */
-            this.occlusionInternalRetryCounter = 0;
-            /** @hidden */
-            this.isOccluded = false;
-            /** @hidden */
-            this.isOcclusionQueryInProgress = false;
-        }
-        return _OcclusionDataStorage;
-    }());
-    /** @hidden */
     var _FacetDataStorage = /** @class */ (function () {
         function _FacetDataStorage() {
             this.facetNb = 0; // facet number
@@ -19919,27 +19907,6 @@ var BABYLON;
              * Gets or sets the orientation for POV movement & rotation
              */
             _this.definedFacingForward = true;
-            /**
-            * This property determines the type of occlusion query algorithm to run in WebGl, you can use:
-            * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE which is mapped to GL_ANY_SAMPLES_PASSED.
-            * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE (Default Value) which is mapped to GL_ANY_SAMPLES_PASSED_CONSERVATIVE which is a false positive algorithm that is faster than GL_ANY_SAMPLES_PASSED but less accurate.
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            _this.occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
-            /**
-             * This property is responsible for starting the occlusion query within the Mesh or not, this property is also used to determine what should happen when the occlusionRetryCount is reached. It has supports 3 values:
-             * * OCCLUSION_TYPE_NONE (Default Value): this option means no occlusion query whith the Mesh.
-             * * OCCLUSION_TYPE_OPTIMISTIC: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken show the mesh.
-             * * OCCLUSION_TYPE_STRICT: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken restore the last state of the mesh occlusion if the mesh was visible then show the mesh if was hidden then hide don't show.
-             * @see http://doc.babylonjs.com/features/occlusionquery
-             */
-            _this.occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;
-            /**
-            * This number indicates the number of allowed retries before stop the occlusion query, this is useful if the occlusion query is taking long time before to the query result is retireved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decideds to show or hide the object.
-            * The default value is -1 which means don't break the query and wait till the result
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            _this.occlusionRetryCount = -1;
             _this._visibility = 1.0;
             /** Gets or sets the alpha index used to sort transparent meshes
              * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#alpha-index
@@ -20213,31 +20180,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(AbstractMesh.prototype, "isOccluded", {
-            /**
-            * Gets or sets whether the mesh is occluded or not, it is used also to set the intial state of the mesh to be occluded or not
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            get: function () {
-                return this._occlusionDataStorage.isOccluded;
-            },
-            set: function (value) {
-                this._occlusionDataStorage.isOccluded = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(AbstractMesh.prototype, "isOcclusionQueryInProgress", {
-            /**
-             * Flag to check the progress status of the query
-             * @see http://doc.babylonjs.com/features/occlusionquery
-             */
-            get: function () {
-                return this._occlusionDataStorage.isOcclusionQueryInProgress;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(AbstractMesh.prototype, "visibility", {
             /**
              * Gets or sets mesh visibility between 0 and 1 (default is 1)
@@ -21217,7 +21159,7 @@ var BABYLON;
             // Query
             var engine = this.getScene().getEngine();
             if (this._occlusionQuery) {
-                this._occlusionDataStorage.isOcclusionQueryInProgress = false;
+                this.isOcclusionQueryInProgress = false;
                 engine.deleteQuery(this._occlusionQuery);
                 this._occlusionQuery = null;
             }
@@ -21657,7 +21599,7 @@ var BABYLON;
         };
         /** @hidden */
         AbstractMesh.prototype._checkOcclusionQuery = function () {
-            this._occlusionDataStorage.isOccluded = false;
+            return false;
         };
         /** No occlusion */
         AbstractMesh.OCCLUSION_TYPE_NONE = 0;
@@ -32367,8 +32309,7 @@ var BABYLON;
          * @returns the current mesh
          */
         Mesh.prototype.render = function (subMesh, enableAlphaMode) {
-            this._checkOcclusionQuery();
-            if (this._occlusionDataStorage.isOccluded) {
+            if (this._checkOcclusionQuery()) {
                 return this;
             }
             var scene = this.getScene();
@@ -62157,7 +62098,7 @@ var BABYLON;
             _this._intersectionThreshold = 0.1;
             var defines = [];
             var options = {
-                attributes: [BABYLON.VertexBuffer.PositionKind],
+                attributes: [BABYLON.VertexBuffer.PositionKind, "world0", "world1", "world2", "world3"],
                 uniforms: ["world", "viewProjection"],
                 needAlphaBlending: true,
                 defines: defines
@@ -62254,7 +62195,7 @@ var BABYLON;
             }
             var engine = this.getScene().getEngine();
             // Draw order
-            engine.drawElementsType(BABYLON.Material.LineListDrawMode, subMesh.indexStart, subMesh.indexCount);
+            engine.drawElementsType(BABYLON.Material.LineListDrawMode, subMesh.indexStart, subMesh.indexCount, instancesCount);
             return this;
         };
         LinesMesh.prototype.dispose = function (doNotRecurse) {
@@ -113340,6 +113281,24 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /** @hidden */
+    var _OcclusionDataStorage = /** @class */ (function () {
+        function _OcclusionDataStorage() {
+            /** @hidden */
+            this.occlusionInternalRetryCounter = 0;
+            /** @hidden */
+            this.isOcclusionQueryInProgress = false;
+            /** @hidden */
+            this.isOccluded = false;
+            /** @hidden */
+            this.occlusionRetryCount = -1;
+            /** @hidden */
+            this.occlusionType = BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE;
+            /** @hidden */
+            this.occlusionQueryAlgorithmType = BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
+        }
+        return _OcclusionDataStorage;
+    }());
     BABYLON.Engine.prototype.createQuery = function () {
         return this._gl.createQuery();
     };
@@ -113485,21 +113444,78 @@ var BABYLON;
     BABYLON.Engine.prototype._getGlAlgorithmType = function (algorithmType) {
         return algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
     };
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "isOcclusionQueryInProgress", {
+        get: function () {
+            return this._occlusionDataStorage.isOcclusionQueryInProgress;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "_occlusionDataStorage", {
+        get: function () {
+            if (!this.__occlusionDataStorage) {
+                this.__occlusionDataStorage = new _OcclusionDataStorage();
+            }
+            return this.__occlusionDataStorage;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "isOccluded", {
+        get: function () {
+            return this._occlusionDataStorage.isOccluded;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.isOccluded = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionQueryAlgorithmType", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionQueryAlgorithmType;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionQueryAlgorithmType = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionType", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionType;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionType = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionRetryCount", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionRetryCount;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionRetryCount = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
     // We also need to update AbstractMesh as there is a portion of the code there
     BABYLON.AbstractMesh.prototype._checkOcclusionQuery = function () {
         var dataStorage = this._occlusionDataStorage;
-        if (this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
+        if (dataStorage.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         var engine = this.getEngine();
         if (engine.webGLVersion < 2) {
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         if (!engine.isQueryResultAvailable) { // Occlusion query where not referenced
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
             var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
@@ -113511,15 +113527,15 @@ var BABYLON;
             }
             else {
                 dataStorage.occlusionInternalRetryCounter++;
-                if (this.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > this.occlusionRetryCount) {
+                if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {
                     dataStorage.isOcclusionQueryInProgress = false;
                     dataStorage.occlusionInternalRetryCounter = 0;
                     // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
                     // if strict continue the last state of the object.
-                    dataStorage.isOccluded = this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
+                    dataStorage.isOccluded = dataStorage.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
                 }
                 else {
-                    return;
+                    return false;
                 }
             }
         }
@@ -113529,11 +113545,12 @@ var BABYLON;
             if (!this._occlusionQuery) {
                 this._occlusionQuery = engine.createQuery();
             }
-            engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
+            engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery);
             occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
-            engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
+            engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);
             this._occlusionDataStorage.isOcclusionQueryInProgress = true;
         }
+        return dataStorage.isOccluded;
     };
 })(BABYLON || (BABYLON = {}));
 

+ 90 - 73
dist/preview release/babylon.no-module.max.js

@@ -19820,18 +19820,6 @@ var BABYLON;
 var BABYLON;
 (function (BABYLON) {
     /** @hidden */
-    var _OcclusionDataStorage = /** @class */ (function () {
-        function _OcclusionDataStorage() {
-            /** @hidden */
-            this.occlusionInternalRetryCounter = 0;
-            /** @hidden */
-            this.isOccluded = false;
-            /** @hidden */
-            this.isOcclusionQueryInProgress = false;
-        }
-        return _OcclusionDataStorage;
-    }());
-    /** @hidden */
     var _FacetDataStorage = /** @class */ (function () {
         function _FacetDataStorage() {
             this.facetNb = 0; // facet number
@@ -19886,27 +19874,6 @@ var BABYLON;
              * Gets or sets the orientation for POV movement & rotation
              */
             _this.definedFacingForward = true;
-            /**
-            * This property determines the type of occlusion query algorithm to run in WebGl, you can use:
-            * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE which is mapped to GL_ANY_SAMPLES_PASSED.
-            * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE (Default Value) which is mapped to GL_ANY_SAMPLES_PASSED_CONSERVATIVE which is a false positive algorithm that is faster than GL_ANY_SAMPLES_PASSED but less accurate.
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            _this.occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
-            /**
-             * This property is responsible for starting the occlusion query within the Mesh or not, this property is also used to determine what should happen when the occlusionRetryCount is reached. It has supports 3 values:
-             * * OCCLUSION_TYPE_NONE (Default Value): this option means no occlusion query whith the Mesh.
-             * * OCCLUSION_TYPE_OPTIMISTIC: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken show the mesh.
-             * * OCCLUSION_TYPE_STRICT: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken restore the last state of the mesh occlusion if the mesh was visible then show the mesh if was hidden then hide don't show.
-             * @see http://doc.babylonjs.com/features/occlusionquery
-             */
-            _this.occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;
-            /**
-            * This number indicates the number of allowed retries before stop the occlusion query, this is useful if the occlusion query is taking long time before to the query result is retireved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decideds to show or hide the object.
-            * The default value is -1 which means don't break the query and wait till the result
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            _this.occlusionRetryCount = -1;
             _this._visibility = 1.0;
             /** Gets or sets the alpha index used to sort transparent meshes
              * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#alpha-index
@@ -20180,31 +20147,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(AbstractMesh.prototype, "isOccluded", {
-            /**
-            * Gets or sets whether the mesh is occluded or not, it is used also to set the intial state of the mesh to be occluded or not
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            get: function () {
-                return this._occlusionDataStorage.isOccluded;
-            },
-            set: function (value) {
-                this._occlusionDataStorage.isOccluded = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(AbstractMesh.prototype, "isOcclusionQueryInProgress", {
-            /**
-             * Flag to check the progress status of the query
-             * @see http://doc.babylonjs.com/features/occlusionquery
-             */
-            get: function () {
-                return this._occlusionDataStorage.isOcclusionQueryInProgress;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(AbstractMesh.prototype, "visibility", {
             /**
              * Gets or sets mesh visibility between 0 and 1 (default is 1)
@@ -21184,7 +21126,7 @@ var BABYLON;
             // Query
             var engine = this.getScene().getEngine();
             if (this._occlusionQuery) {
-                this._occlusionDataStorage.isOcclusionQueryInProgress = false;
+                this.isOcclusionQueryInProgress = false;
                 engine.deleteQuery(this._occlusionQuery);
                 this._occlusionQuery = null;
             }
@@ -21624,7 +21566,7 @@ var BABYLON;
         };
         /** @hidden */
         AbstractMesh.prototype._checkOcclusionQuery = function () {
-            this._occlusionDataStorage.isOccluded = false;
+            return false;
         };
         /** No occlusion */
         AbstractMesh.OCCLUSION_TYPE_NONE = 0;
@@ -32334,8 +32276,7 @@ var BABYLON;
          * @returns the current mesh
          */
         Mesh.prototype.render = function (subMesh, enableAlphaMode) {
-            this._checkOcclusionQuery();
-            if (this._occlusionDataStorage.isOccluded) {
+            if (this._checkOcclusionQuery()) {
                 return this;
             }
             var scene = this.getScene();
@@ -62124,7 +62065,7 @@ var BABYLON;
             _this._intersectionThreshold = 0.1;
             var defines = [];
             var options = {
-                attributes: [BABYLON.VertexBuffer.PositionKind],
+                attributes: [BABYLON.VertexBuffer.PositionKind, "world0", "world1", "world2", "world3"],
                 uniforms: ["world", "viewProjection"],
                 needAlphaBlending: true,
                 defines: defines
@@ -62221,7 +62162,7 @@ var BABYLON;
             }
             var engine = this.getScene().getEngine();
             // Draw order
-            engine.drawElementsType(BABYLON.Material.LineListDrawMode, subMesh.indexStart, subMesh.indexCount);
+            engine.drawElementsType(BABYLON.Material.LineListDrawMode, subMesh.indexStart, subMesh.indexCount, instancesCount);
             return this;
         };
         LinesMesh.prototype.dispose = function (doNotRecurse) {
@@ -113307,6 +113248,24 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /** @hidden */
+    var _OcclusionDataStorage = /** @class */ (function () {
+        function _OcclusionDataStorage() {
+            /** @hidden */
+            this.occlusionInternalRetryCounter = 0;
+            /** @hidden */
+            this.isOcclusionQueryInProgress = false;
+            /** @hidden */
+            this.isOccluded = false;
+            /** @hidden */
+            this.occlusionRetryCount = -1;
+            /** @hidden */
+            this.occlusionType = BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE;
+            /** @hidden */
+            this.occlusionQueryAlgorithmType = BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
+        }
+        return _OcclusionDataStorage;
+    }());
     BABYLON.Engine.prototype.createQuery = function () {
         return this._gl.createQuery();
     };
@@ -113452,21 +113411,78 @@ var BABYLON;
     BABYLON.Engine.prototype._getGlAlgorithmType = function (algorithmType) {
         return algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
     };
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "isOcclusionQueryInProgress", {
+        get: function () {
+            return this._occlusionDataStorage.isOcclusionQueryInProgress;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "_occlusionDataStorage", {
+        get: function () {
+            if (!this.__occlusionDataStorage) {
+                this.__occlusionDataStorage = new _OcclusionDataStorage();
+            }
+            return this.__occlusionDataStorage;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "isOccluded", {
+        get: function () {
+            return this._occlusionDataStorage.isOccluded;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.isOccluded = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionQueryAlgorithmType", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionQueryAlgorithmType;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionQueryAlgorithmType = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionType", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionType;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionType = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionRetryCount", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionRetryCount;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionRetryCount = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
     // We also need to update AbstractMesh as there is a portion of the code there
     BABYLON.AbstractMesh.prototype._checkOcclusionQuery = function () {
         var dataStorage = this._occlusionDataStorage;
-        if (this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
+        if (dataStorage.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         var engine = this.getEngine();
         if (engine.webGLVersion < 2) {
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         if (!engine.isQueryResultAvailable) { // Occlusion query where not referenced
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
             var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
@@ -113478,15 +113494,15 @@ var BABYLON;
             }
             else {
                 dataStorage.occlusionInternalRetryCounter++;
-                if (this.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > this.occlusionRetryCount) {
+                if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {
                     dataStorage.isOcclusionQueryInProgress = false;
                     dataStorage.occlusionInternalRetryCounter = 0;
                     // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
                     // if strict continue the last state of the object.
-                    dataStorage.isOccluded = this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
+                    dataStorage.isOccluded = dataStorage.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
                 }
                 else {
-                    return;
+                    return false;
                 }
             }
         }
@@ -113496,11 +113512,12 @@ var BABYLON;
             if (!this._occlusionQuery) {
                 this._occlusionQuery = engine.createQuery();
             }
-            engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
+            engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery);
             occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
-            engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
+            engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);
             this._occlusionDataStorage.isOcclusionQueryInProgress = true;
         }
+        return dataStorage.isOccluded;
     };
 })(BABYLON || (BABYLON = {}));
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
dist/preview release/babylon.worker.js


+ 90 - 73
dist/preview release/es6.js

@@ -19820,18 +19820,6 @@ var BABYLON;
 var BABYLON;
 (function (BABYLON) {
     /** @hidden */
-    var _OcclusionDataStorage = /** @class */ (function () {
-        function _OcclusionDataStorage() {
-            /** @hidden */
-            this.occlusionInternalRetryCounter = 0;
-            /** @hidden */
-            this.isOccluded = false;
-            /** @hidden */
-            this.isOcclusionQueryInProgress = false;
-        }
-        return _OcclusionDataStorage;
-    }());
-    /** @hidden */
     var _FacetDataStorage = /** @class */ (function () {
         function _FacetDataStorage() {
             this.facetNb = 0; // facet number
@@ -19886,27 +19874,6 @@ var BABYLON;
              * Gets or sets the orientation for POV movement & rotation
              */
             _this.definedFacingForward = true;
-            /**
-            * This property determines the type of occlusion query algorithm to run in WebGl, you can use:
-            * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE which is mapped to GL_ANY_SAMPLES_PASSED.
-            * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE (Default Value) which is mapped to GL_ANY_SAMPLES_PASSED_CONSERVATIVE which is a false positive algorithm that is faster than GL_ANY_SAMPLES_PASSED but less accurate.
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            _this.occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
-            /**
-             * This property is responsible for starting the occlusion query within the Mesh or not, this property is also used to determine what should happen when the occlusionRetryCount is reached. It has supports 3 values:
-             * * OCCLUSION_TYPE_NONE (Default Value): this option means no occlusion query whith the Mesh.
-             * * OCCLUSION_TYPE_OPTIMISTIC: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken show the mesh.
-             * * OCCLUSION_TYPE_STRICT: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken restore the last state of the mesh occlusion if the mesh was visible then show the mesh if was hidden then hide don't show.
-             * @see http://doc.babylonjs.com/features/occlusionquery
-             */
-            _this.occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;
-            /**
-            * This number indicates the number of allowed retries before stop the occlusion query, this is useful if the occlusion query is taking long time before to the query result is retireved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decideds to show or hide the object.
-            * The default value is -1 which means don't break the query and wait till the result
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            _this.occlusionRetryCount = -1;
             _this._visibility = 1.0;
             /** Gets or sets the alpha index used to sort transparent meshes
              * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#alpha-index
@@ -20180,31 +20147,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(AbstractMesh.prototype, "isOccluded", {
-            /**
-            * Gets or sets whether the mesh is occluded or not, it is used also to set the intial state of the mesh to be occluded or not
-            * @see http://doc.babylonjs.com/features/occlusionquery
-            */
-            get: function () {
-                return this._occlusionDataStorage.isOccluded;
-            },
-            set: function (value) {
-                this._occlusionDataStorage.isOccluded = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(AbstractMesh.prototype, "isOcclusionQueryInProgress", {
-            /**
-             * Flag to check the progress status of the query
-             * @see http://doc.babylonjs.com/features/occlusionquery
-             */
-            get: function () {
-                return this._occlusionDataStorage.isOcclusionQueryInProgress;
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(AbstractMesh.prototype, "visibility", {
             /**
              * Gets or sets mesh visibility between 0 and 1 (default is 1)
@@ -21184,7 +21126,7 @@ var BABYLON;
             // Query
             var engine = this.getScene().getEngine();
             if (this._occlusionQuery) {
-                this._occlusionDataStorage.isOcclusionQueryInProgress = false;
+                this.isOcclusionQueryInProgress = false;
                 engine.deleteQuery(this._occlusionQuery);
                 this._occlusionQuery = null;
             }
@@ -21624,7 +21566,7 @@ var BABYLON;
         };
         /** @hidden */
         AbstractMesh.prototype._checkOcclusionQuery = function () {
-            this._occlusionDataStorage.isOccluded = false;
+            return false;
         };
         /** No occlusion */
         AbstractMesh.OCCLUSION_TYPE_NONE = 0;
@@ -32334,8 +32276,7 @@ var BABYLON;
          * @returns the current mesh
          */
         Mesh.prototype.render = function (subMesh, enableAlphaMode) {
-            this._checkOcclusionQuery();
-            if (this._occlusionDataStorage.isOccluded) {
+            if (this._checkOcclusionQuery()) {
                 return this;
             }
             var scene = this.getScene();
@@ -62124,7 +62065,7 @@ var BABYLON;
             _this._intersectionThreshold = 0.1;
             var defines = [];
             var options = {
-                attributes: [BABYLON.VertexBuffer.PositionKind],
+                attributes: [BABYLON.VertexBuffer.PositionKind, "world0", "world1", "world2", "world3"],
                 uniforms: ["world", "viewProjection"],
                 needAlphaBlending: true,
                 defines: defines
@@ -62221,7 +62162,7 @@ var BABYLON;
             }
             var engine = this.getScene().getEngine();
             // Draw order
-            engine.drawElementsType(BABYLON.Material.LineListDrawMode, subMesh.indexStart, subMesh.indexCount);
+            engine.drawElementsType(BABYLON.Material.LineListDrawMode, subMesh.indexStart, subMesh.indexCount, instancesCount);
             return this;
         };
         LinesMesh.prototype.dispose = function (doNotRecurse) {
@@ -113307,6 +113248,24 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /** @hidden */
+    var _OcclusionDataStorage = /** @class */ (function () {
+        function _OcclusionDataStorage() {
+            /** @hidden */
+            this.occlusionInternalRetryCounter = 0;
+            /** @hidden */
+            this.isOcclusionQueryInProgress = false;
+            /** @hidden */
+            this.isOccluded = false;
+            /** @hidden */
+            this.occlusionRetryCount = -1;
+            /** @hidden */
+            this.occlusionType = BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE;
+            /** @hidden */
+            this.occlusionQueryAlgorithmType = BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
+        }
+        return _OcclusionDataStorage;
+    }());
     BABYLON.Engine.prototype.createQuery = function () {
         return this._gl.createQuery();
     };
@@ -113452,21 +113411,78 @@ var BABYLON;
     BABYLON.Engine.prototype._getGlAlgorithmType = function (algorithmType) {
         return algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
     };
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "isOcclusionQueryInProgress", {
+        get: function () {
+            return this._occlusionDataStorage.isOcclusionQueryInProgress;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "_occlusionDataStorage", {
+        get: function () {
+            if (!this.__occlusionDataStorage) {
+                this.__occlusionDataStorage = new _OcclusionDataStorage();
+            }
+            return this.__occlusionDataStorage;
+        },
+        enumerable: false,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "isOccluded", {
+        get: function () {
+            return this._occlusionDataStorage.isOccluded;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.isOccluded = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionQueryAlgorithmType", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionQueryAlgorithmType;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionQueryAlgorithmType = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionType", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionType;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionType = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "occlusionRetryCount", {
+        get: function () {
+            return this._occlusionDataStorage.occlusionRetryCount;
+        },
+        set: function (value) {
+            this._occlusionDataStorage.occlusionRetryCount = value;
+        },
+        enumerable: true,
+        configurable: true
+    });
     // We also need to update AbstractMesh as there is a portion of the code there
     BABYLON.AbstractMesh.prototype._checkOcclusionQuery = function () {
         var dataStorage = this._occlusionDataStorage;
-        if (this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
+        if (dataStorage.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         var engine = this.getEngine();
         if (engine.webGLVersion < 2) {
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         if (!engine.isQueryResultAvailable) { // Occlusion query where not referenced
             dataStorage.isOccluded = false;
-            return;
+            return false;
         }
         if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
             var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
@@ -113478,15 +113494,15 @@ var BABYLON;
             }
             else {
                 dataStorage.occlusionInternalRetryCounter++;
-                if (this.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > this.occlusionRetryCount) {
+                if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {
                     dataStorage.isOcclusionQueryInProgress = false;
                     dataStorage.occlusionInternalRetryCounter = 0;
                     // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
                     // if strict continue the last state of the object.
-                    dataStorage.isOccluded = this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
+                    dataStorage.isOccluded = dataStorage.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
                 }
                 else {
-                    return;
+                    return false;
                 }
             }
         }
@@ -113496,11 +113512,12 @@ var BABYLON;
             if (!this._occlusionQuery) {
                 this._occlusionQuery = engine.createQuery();
             }
-            engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
+            engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery);
             occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
-            engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
+            engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);
             this._occlusionDataStorage.isOcclusionQueryInProgress = true;
         }
+        return dataStorage.isOccluded;
     };
 })(BABYLON || (BABYLON = {}));
 

+ 32 - 15
dist/preview release/viewer/babylon.viewer.d.ts

@@ -924,7 +924,7 @@ declare module BabylonViewer {
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 declare module BabylonViewer {
@@ -1558,20 +1558,6 @@ declare module BabylonViewer {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 declare module BabylonViewer {
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-declare module BabylonViewer {
 }
 declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {
@@ -1598,6 +1584,37 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * The EventManager is in charge of registering user interctions with the viewer.
+        * It is used in the TemplateManager
+        */
+    export class EventManager {
+            constructor(_templateManager: TemplateManager);
+            /**
+                * Register a new callback to a specific template.
+                * The best example for the usage can be found in the DefaultViewer
+                *
+                * @param templateName the templateName to register the event to
+                * @param callback The callback to be executed
+                * @param eventType the type of event to register
+                * @param selector an optional selector. if not defined the parent object in the template will be selected
+                */
+            registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * This will remove a registered event from the defined template.
+                * Each one of the variables apart from the template name are optional, but one must be provided.
+                *
+                * @param templateName the templateName
+                * @param callback the callback to remove (optional)
+                * @param eventType the event type to remove (optional)
+                * @param selector the selector from which to remove the event (optional)
+                */
+            unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * Dispose the event manager
+                */
+            dispose(): void;
+    }
 }
 declare module BabylonViewer {
     /**

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 2
dist/preview release/viewer/babylon.viewer.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js


+ 33 - 19
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -985,14 +985,13 @@ declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
 }
 
 declare module 'babylonjs-viewer/optimizer/custom' {
-    import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
     import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
     /**
       *
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 
@@ -1663,22 +1662,6 @@ declare module 'babylonjs-viewer/loader/plugins' {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 
-declare module 'babylonjs-viewer/optimizer/custom/extended' {
-    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';
@@ -1723,7 +1706,38 @@ declare module 'babylonjs-viewer/configuration/interfaces/environmentMapConfigur
 }
 
 declare module 'babylonjs-viewer/templating/eventManager' {
-    
+    import { EventCallback, TemplateManager } from "babylonjs-viewer/templating/templateManager";
+    /**
+        * The EventManager is in charge of registering user interctions with the viewer.
+        * It is used in the TemplateManager
+        */
+    export class EventManager {
+            constructor(_templateManager: TemplateManager);
+            /**
+                * Register a new callback to a specific template.
+                * The best example for the usage can be found in the DefaultViewer
+                *
+                * @param templateName the templateName to register the event to
+                * @param callback The callback to be executed
+                * @param eventType the type of event to register
+                * @param selector an optional selector. if not defined the parent object in the template will be selected
+                */
+            registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * This will remove a registered event from the defined template.
+                * Each one of the variables apart from the template name are optional, but one must be provided.
+                *
+                * @param templateName the templateName
+                * @param callback the callback to remove (optional)
+                * @param eventType the event type to remove (optional)
+                * @param selector the selector from which to remove the event (optional)
+                */
+            unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * Dispose the event manager
+                */
+            dispose(): void;
+    }
 }
 
 declare module 'babylonjs-viewer/labs/viewerLabs' {

+ 2 - 2
src/Mesh/babylon.linesMesh.ts

@@ -46,7 +46,7 @@
 
             var defines: String[] = [];
             var options = {
-                attributes: [VertexBuffer.PositionKind],
+                attributes: [VertexBuffer.PositionKind, "world0", "world1", "world2", "world3"],
                 uniforms: ["world", "viewProjection"],
                 needAlphaBlending: true,
                 defines: defines
@@ -119,7 +119,7 @@
             var engine = this.getScene().getEngine();
 
             // Draw order
-            engine.drawElementsType(Material.LineListDrawMode, subMesh.indexStart, subMesh.indexCount);
+            engine.drawElementsType(Material.LineListDrawMode, subMesh.indexStart, subMesh.indexCount, instancesCount);
             return this;
         }