|
@@ -16723,6 +16723,7 @@ var BABYLON;
|
|
this._transformMatrix = BABYLON.Matrix.Zero();
|
|
this._transformMatrix = BABYLON.Matrix.Zero();
|
|
this.requireLightSorting = false;
|
|
this.requireLightSorting = false;
|
|
this._uniqueIdCounter = 0;
|
|
this._uniqueIdCounter = 0;
|
|
|
|
+ this._activeMeshesFrozen = false;
|
|
this._engine = engine || BABYLON.Engine.LastCreatedEngine;
|
|
this._engine = engine || BABYLON.Engine.LastCreatedEngine;
|
|
this._engine.scenes.push(this);
|
|
this._engine.scenes.push(this);
|
|
this._uid = null;
|
|
this._uid = null;
|
|
@@ -18614,7 +18615,25 @@ var BABYLON;
|
|
Scene.prototype._isInIntermediateRendering = function () {
|
|
Scene.prototype._isInIntermediateRendering = function () {
|
|
return this._intermediateRendering;
|
|
return this._intermediateRendering;
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Use this function to stop evaluating active meshes. The current list will be keep alive between frames
|
|
|
|
+ */
|
|
|
|
+ Scene.prototype.freezeActiveMeshes = function () {
|
|
|
|
+ this._evaluateActiveMeshes();
|
|
|
|
+ this._activeMeshesFrozen = true;
|
|
|
|
+ return this;
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Use this function to restart evaluating active meshes on every frame
|
|
|
|
+ */
|
|
|
|
+ Scene.prototype.unfreezeActiveMeshes = function () {
|
|
|
|
+ this._activeMeshesFrozen = false;
|
|
|
|
+ return this;
|
|
|
|
+ };
|
|
Scene.prototype._evaluateActiveMeshes = function () {
|
|
Scene.prototype._evaluateActiveMeshes = function () {
|
|
|
|
+ if (this._activeMeshesFrozen && this._activeMeshes.length) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.activeCamera._activeMeshes.reset();
|
|
this.activeCamera._activeMeshes.reset();
|
|
this._activeMeshes.reset();
|
|
this._activeMeshes.reset();
|
|
this._renderingManager.reset();
|
|
this._renderingManager.reset();
|
|
@@ -18972,9 +18991,6 @@ var BABYLON;
|
|
this.onAfterStepObservable.notifyObservers(this);
|
|
this.onAfterStepObservable.notifyObservers(this);
|
|
this._currentStepId++;
|
|
this._currentStepId++;
|
|
if ((internalSteps > 1) && (this._currentInternalStep != internalSteps - 1)) {
|
|
if ((internalSteps > 1) && (this._currentInternalStep != internalSteps - 1)) {
|
|
- // Q: can this be optimized by putting some code in the afterStep callback?
|
|
|
|
- // I had to put this code here, otherwise mesh attached to bones of another mesh skeleton,
|
|
|
|
- // would return incorrect positions for internal stepIds (non-rendered steps)
|
|
|
|
this._evaluateActiveMeshes();
|
|
this._evaluateActiveMeshes();
|
|
}
|
|
}
|
|
}
|
|
}
|