|
@@ -12948,10 +12948,10 @@ var BABYLON;
|
|
if (!mesh) {
|
|
if (!mesh) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
- if (this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) {
|
|
|
|
|
|
+ if (this.includedOnlyMeshes && this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(mesh) === -1) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- if (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) {
|
|
|
|
|
|
+ if (this.excludedMeshes && this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
if (this.includeOnlyWithLayerMask !== 0 && (this.includeOnlyWithLayerMask & mesh.layerMask) === 0) {
|
|
if (this.includeOnlyWithLayerMask !== 0 && (this.includeOnlyWithLayerMask & mesh.layerMask) === 0) {
|
|
@@ -13109,6 +13109,10 @@ var BABYLON;
|
|
}
|
|
}
|
|
return deleted;
|
|
return deleted;
|
|
};
|
|
};
|
|
|
|
+ for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
|
|
|
|
+ var item = array_1[_i];
|
|
|
|
+ item._resyncLighSource(this);
|
|
|
|
+ }
|
|
};
|
|
};
|
|
Light.prototype._hookArrayForIncludedOnly = function (array) {
|
|
Light.prototype._hookArrayForIncludedOnly = function (array) {
|
|
var _this = this;
|
|
var _this = this;
|
|
@@ -13128,6 +13132,7 @@ var BABYLON;
|
|
_this._resyncMeshes();
|
|
_this._resyncMeshes();
|
|
return deleted;
|
|
return deleted;
|
|
};
|
|
};
|
|
|
|
+ this._resyncMeshes();
|
|
};
|
|
};
|
|
Light.prototype._resyncMeshes = function () {
|
|
Light.prototype._resyncMeshes = function () {
|
|
for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) {
|
|
for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) {
|
|
@@ -23273,11 +23278,11 @@ var BABYLON;
|
|
Material._PointFillMode = 2;
|
|
Material._PointFillMode = 2;
|
|
Material._ClockWiseSideOrientation = 0;
|
|
Material._ClockWiseSideOrientation = 0;
|
|
Material._CounterClockWiseSideOrientation = 1;
|
|
Material._CounterClockWiseSideOrientation = 1;
|
|
- Material._TextureDirtyFlag = 0;
|
|
|
|
- Material._LightDirtyFlag = 1;
|
|
|
|
- Material._FresnelDirtyFlag = 2;
|
|
|
|
- Material._AttributesDirtyFlag = 4;
|
|
|
|
- Material._MiscDirtyFlag = 8;
|
|
|
|
|
|
+ Material._TextureDirtyFlag = 1;
|
|
|
|
+ Material._LightDirtyFlag = 2;
|
|
|
|
+ Material._FresnelDirtyFlag = 4;
|
|
|
|
+ Material._AttributesDirtyFlag = 8;
|
|
|
|
+ Material._MiscDirtyFlag = 16;
|
|
__decorate([
|
|
__decorate([
|
|
BABYLON.serialize()
|
|
BABYLON.serialize()
|
|
], Material.prototype, "id", void 0);
|
|
], Material.prototype, "id", void 0);
|
|
@@ -26494,76 +26499,84 @@ var BABYLON;
|
|
}
|
|
}
|
|
return serializationObject;
|
|
return serializationObject;
|
|
};
|
|
};
|
|
|
|
+ Geometry.prototype.toNumberArray = function (origin) {
|
|
|
|
+ if (Array.isArray(origin)) {
|
|
|
|
+ return origin;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ return Array.prototype.slice.call(origin);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
Geometry.prototype.serializeVerticeData = function () {
|
|
Geometry.prototype.serializeVerticeData = function () {
|
|
var serializationObject = this.serialize();
|
|
var serializationObject = this.serialize();
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.PositionKind)) {
|
|
- serializationObject.positions = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
|
|
|
|
|
|
+ serializationObject.positions = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.PositionKind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.PositionKind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.PositionKind).isUpdatable) {
|
|
serializationObject.positions._updatable = true;
|
|
serializationObject.positions._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
|
|
- serializationObject.normals = this.getVerticesData(BABYLON.VertexBuffer.NormalKind);
|
|
|
|
|
|
+ serializationObject.normals = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.NormalKind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.NormalKind).isUpdatable) {
|
|
serializationObject.normals._updatable = true;
|
|
serializationObject.normals._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UVKind)) {
|
|
- serializationObject.uvs = this.getVerticesData(BABYLON.VertexBuffer.UVKind);
|
|
|
|
|
|
+ serializationObject.uvs = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UVKind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UVKind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UVKind).isUpdatable) {
|
|
serializationObject.uvs._updatable = true;
|
|
serializationObject.uvs._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) {
|
|
- serializationObject.uv2s = this.getVerticesData(BABYLON.VertexBuffer.UV2Kind);
|
|
|
|
|
|
+ serializationObject.uv2s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV2Kind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV2Kind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV2Kind).isUpdatable) {
|
|
serializationObject.uv2s._updatable = true;
|
|
serializationObject.uv2s._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) {
|
|
- serializationObject.uv3s = this.getVerticesData(BABYLON.VertexBuffer.UV3Kind);
|
|
|
|
|
|
+ serializationObject.uv3s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV3Kind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV3Kind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV3Kind).isUpdatable) {
|
|
serializationObject.uv3s._updatable = true;
|
|
serializationObject.uv3s._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) {
|
|
- serializationObject.uv4s = this.getVerticesData(BABYLON.VertexBuffer.UV4Kind);
|
|
|
|
|
|
+ serializationObject.uv4s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV4Kind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV4Kind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV4Kind).isUpdatable) {
|
|
serializationObject.uv4s._updatable = true;
|
|
serializationObject.uv4s._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) {
|
|
- serializationObject.uv5s = this.getVerticesData(BABYLON.VertexBuffer.UV5Kind);
|
|
|
|
|
|
+ serializationObject.uv5s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV5Kind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV5Kind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV5Kind).isUpdatable) {
|
|
serializationObject.uv5s._updatable = true;
|
|
serializationObject.uv5s._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) {
|
|
- serializationObject.uv6s = this.getVerticesData(BABYLON.VertexBuffer.UV6Kind);
|
|
|
|
|
|
+ serializationObject.uv6s = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.UV6Kind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV6Kind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.UV6Kind).isUpdatable) {
|
|
serializationObject.uv6s._updatable = true;
|
|
serializationObject.uv6s._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) {
|
|
- serializationObject.colors = this.getVerticesData(BABYLON.VertexBuffer.ColorKind);
|
|
|
|
|
|
+ serializationObject.colors = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.ColorKind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.ColorKind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.ColorKind).isUpdatable) {
|
|
serializationObject.colors._updatable = true;
|
|
serializationObject.colors._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind)) {
|
|
- serializationObject.matricesIndices = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind);
|
|
|
|
|
|
+ serializationObject.matricesIndices = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind));
|
|
serializationObject.matricesIndices._isExpanded = true;
|
|
serializationObject.matricesIndices._isExpanded = true;
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.MatricesIndicesKind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.MatricesIndicesKind).isUpdatable) {
|
|
serializationObject.matricesIndices._updatable = true;
|
|
serializationObject.matricesIndices._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) {
|
|
if (this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind)) {
|
|
- serializationObject.matricesWeights = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind);
|
|
|
|
|
|
+ serializationObject.matricesWeights = this.toNumberArray(this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind));
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.MatricesWeightsKind).isUpdatable) {
|
|
if (this.getVertexBuffer(BABYLON.VertexBuffer.MatricesWeightsKind).isUpdatable) {
|
|
serializationObject.matricesWeights._updatable = true;
|
|
serializationObject.matricesWeights._updatable = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- serializationObject.indices = this.getIndices();
|
|
|
|
|
|
+ serializationObject.indices = this.toNumberArray(this.getIndices());
|
|
return serializationObject;
|
|
return serializationObject;
|
|
};
|
|
};
|
|
// Statics
|
|
// Statics
|
|
@@ -27434,10 +27447,10 @@ var BABYLON;
|
|
_this._globalAmbientColor = new BABYLON.Color3(0, 0, 0);
|
|
_this._globalAmbientColor = new BABYLON.Color3(0, 0, 0);
|
|
_this.getRenderTargetTextures = function () {
|
|
_this.getRenderTargetTextures = function () {
|
|
_this._renderTargets.reset();
|
|
_this._renderTargets.reset();
|
|
- if (_this._reflectionTexture && _this._reflectionTexture.isRenderTarget) {
|
|
|
|
|
|
+ if (StandardMaterial.ReflectionTextureEnabled && _this._reflectionTexture && _this._reflectionTexture.isRenderTarget) {
|
|
_this._renderTargets.push(_this._reflectionTexture);
|
|
_this._renderTargets.push(_this._reflectionTexture);
|
|
}
|
|
}
|
|
- if (_this._refractionTexture && _this._refractionTexture.isRenderTarget) {
|
|
|
|
|
|
+ if (StandardMaterial.RefractionTextureEnabled && _this._refractionTexture && _this._refractionTexture.isRenderTarget) {
|
|
_this._renderTargets.push(_this._refractionTexture);
|
|
_this._renderTargets.push(_this._refractionTexture);
|
|
}
|
|
}
|
|
return _this._renderTargets;
|
|
return _this._renderTargets;
|
|
@@ -28887,10 +28900,10 @@ var BABYLON;
|
|
_this._cachedDefines.BonesPerMesh = -1;
|
|
_this._cachedDefines.BonesPerMesh = -1;
|
|
_this.getRenderTargetTextures = function () {
|
|
_this.getRenderTargetTextures = function () {
|
|
_this._renderTargets.reset();
|
|
_this._renderTargets.reset();
|
|
- if (_this.reflectionTexture && _this.reflectionTexture.isRenderTarget) {
|
|
|
|
|
|
+ if (BABYLON.StandardMaterial.ReflectionTextureEnabled && _this.reflectionTexture && _this.reflectionTexture.isRenderTarget) {
|
|
_this._renderTargets.push(_this.reflectionTexture);
|
|
_this._renderTargets.push(_this.reflectionTexture);
|
|
}
|
|
}
|
|
- if (_this.refractionTexture && _this.refractionTexture.isRenderTarget) {
|
|
|
|
|
|
+ if (BABYLON.StandardMaterial.RefractionTextureEnabled && _this.refractionTexture && _this.refractionTexture.isRenderTarget) {
|
|
_this._renderTargets.push(_this.refractionTexture);
|
|
_this._renderTargets.push(_this.refractionTexture);
|
|
}
|
|
}
|
|
return _this._renderTargets;
|
|
return _this._renderTargets;
|
|
@@ -31249,8 +31262,6 @@ var BABYLON;
|
|
element.addEventListener("mousemove", this._onMouseMove, false);
|
|
element.addEventListener("mousemove", this._onMouseMove, false);
|
|
element.addEventListener("MSPointerDown", this._onGestureStart, false);
|
|
element.addEventListener("MSPointerDown", this._onGestureStart, false);
|
|
element.addEventListener("MSGestureChange", this._onGesture, false);
|
|
element.addEventListener("MSGestureChange", this._onGesture, false);
|
|
- element.addEventListener("keydown", this._onKeyDown, false);
|
|
|
|
- element.addEventListener("keyup", this._onKeyUp, false);
|
|
|
|
BABYLON.Tools.RegisterTopRootEvents([
|
|
BABYLON.Tools.RegisterTopRootEvents([
|
|
{ name: "blur", handler: this._onLostFocus }
|
|
{ name: "blur", handler: this._onLostFocus }
|
|
]);
|
|
]);
|
|
@@ -31263,12 +31274,8 @@ var BABYLON;
|
|
element.removeEventListener("mousemove", this._onMouseMove);
|
|
element.removeEventListener("mousemove", this._onMouseMove);
|
|
element.removeEventListener("MSPointerDown", this._onGestureStart);
|
|
element.removeEventListener("MSPointerDown", this._onGestureStart);
|
|
element.removeEventListener("MSGestureChange", this._onGesture);
|
|
element.removeEventListener("MSGestureChange", this._onGesture);
|
|
- element.removeEventListener("keydown", this._onKeyDown);
|
|
|
|
- element.removeEventListener("keyup", this._onKeyUp);
|
|
|
|
this._isPanClick = false;
|
|
this._isPanClick = false;
|
|
this.pinchInwards = true;
|
|
this.pinchInwards = true;
|
|
- this._onKeyDown = null;
|
|
|
|
- this._onKeyUp = null;
|
|
|
|
this._onMouseMove = null;
|
|
this._onMouseMove = null;
|
|
this._onGestureStart = null;
|
|
this._onGestureStart = null;
|
|
this._onGesture = null;
|
|
this._onGesture = null;
|
|
@@ -40145,11 +40152,21 @@ var BABYLON;
|
|
this.canUseWebAudio = true;
|
|
this.canUseWebAudio = true;
|
|
}
|
|
}
|
|
var audioElem = document.createElement('audio');
|
|
var audioElem = document.createElement('audio');
|
|
- if (audioElem && !!audioElem.canPlayType && audioElem.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/, '')) {
|
|
|
|
- this.isMP3supported = true;
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (audioElem && !!audioElem.canPlayType && audioElem.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/, '')) {
|
|
|
|
+ this.isMP3supported = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- if (audioElem && !!audioElem.canPlayType && audioElem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) {
|
|
|
|
- this.isOGGsupported = true;
|
|
|
|
|
|
+ catch (e) {
|
|
|
|
+ // protect error during capability check.
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ if (audioElem && !!audioElem.canPlayType && audioElem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) {
|
|
|
|
+ this.isOGGsupported = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (e) {
|
|
|
|
+ // protect error during capability check.
|
|
}
|
|
}
|
|
if (/iPad|iPhone|iPod/.test(navigator.platform)) {
|
|
if (/iPad|iPhone|iPod/.test(navigator.platform)) {
|
|
this._unlockiOSaudio();
|
|
this._unlockiOSaudio();
|