|
@@ -12115,6 +12115,20 @@ var BABYLON;
|
|
enumerable: true,
|
|
enumerable: true,
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
|
|
+ Object.defineProperty(Engine.prototype, "doNotHandleContextLost", {
|
|
|
|
+ /**
|
|
|
|
+ * Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events
|
|
|
|
+ * @see http://doc.babylonjs.com/how_to/optimizing_your_scene#handling-webgl-context-lost
|
|
|
|
+ */
|
|
|
|
+ get: function () {
|
|
|
|
+ return this._doNotHandleContextLost;
|
|
|
|
+ },
|
|
|
|
+ set: function (value) {
|
|
|
|
+ this._doNotHandleContextLost = value;
|
|
|
|
+ },
|
|
|
|
+ enumerable: true,
|
|
|
|
+ configurable: true
|
|
|
|
+ });
|
|
Object.defineProperty(Engine.prototype, "performanceMonitor", {
|
|
Object.defineProperty(Engine.prototype, "performanceMonitor", {
|
|
/**
|
|
/**
|
|
* Gets the performance monitor attached to this engine
|
|
* Gets the performance monitor attached to this engine
|
|
@@ -28281,6 +28295,25 @@ var BABYLON;
|
|
this.soundTracks[scIndex].dispose();
|
|
this.soundTracks[scIndex].dispose();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+ /**
|
|
|
|
+ * Call this function to reduce memory footprint of the scene.
|
|
|
|
+ * Vertex buffers will not store CPU data anymore (this will prevent picking, collisions or physics to work correctly)
|
|
|
|
+ */
|
|
|
|
+ Scene.prototype.clearCachedVertexData = function () {
|
|
|
|
+ for (var meshIndex = 0; meshIndex < this.meshes.length; meshIndex++) {
|
|
|
|
+ var mesh = this.meshes[meshIndex];
|
|
|
|
+ var geometry = mesh.geometry;
|
|
|
|
+ if (geometry) {
|
|
|
|
+ geometry._indices = [];
|
|
|
|
+ for (var vbName in geometry._vertexBuffers) {
|
|
|
|
+ if (!geometry._vertexBuffers.hasOwnProperty(vbName)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ geometry._vertexBuffers[vbName]._buffer._data = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ };
|
|
// Octrees
|
|
// Octrees
|
|
/**
|
|
/**
|
|
* Get the world extend vectors with an optional filter
|
|
* Get the world extend vectors with an optional filter
|
|
@@ -39468,11 +39501,11 @@ var BABYLON;
|
|
Geometry.prototype._generatePointsArray = function () {
|
|
Geometry.prototype._generatePointsArray = function () {
|
|
if (this._positions)
|
|
if (this._positions)
|
|
return true;
|
|
return true;
|
|
- this._positions = [];
|
|
|
|
var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
|
|
var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
|
|
- if (!data) {
|
|
|
|
|
|
+ if (!data || data.length === 0) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+ this._positions = [];
|
|
for (var index = 0; index < data.length; index += 3) {
|
|
for (var index = 0; index < data.length; index += 3) {
|
|
this._positions.push(BABYLON.Vector3.FromArray(data, index));
|
|
this._positions.push(BABYLON.Vector3.FromArray(data, index));
|
|
}
|
|
}
|