|
@@ -12017,7 +12017,7 @@ var BABYLON;
|
|
|
* Returns the current version of the framework
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return "3.2.0-rc.2";
|
|
|
+ return "3.2.0-rc.3";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -20386,7 +20386,6 @@ var BABYLON;
|
|
|
*/
|
|
|
AbstractMesh.prototype.isCompletelyInFrustum = function (frustumPlanes) {
|
|
|
return this._boundingInfo !== null && this._boundingInfo.isCompletelyInFrustum(frustumPlanes);
|
|
|
- ;
|
|
|
};
|
|
|
/**
|
|
|
* True if the mesh intersects another mesh or a SolidParticle object
|
|
@@ -29688,7 +29687,7 @@ var BABYLON;
|
|
|
case VertexBuffer.BYTE: {
|
|
|
var value = dataView.getInt8(byteOffset);
|
|
|
if (normalized) {
|
|
|
- value = (value + 0.5) / 127.5;
|
|
|
+ value = Math.max(value / 127, -1);
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
@@ -29702,7 +29701,7 @@ var BABYLON;
|
|
|
case VertexBuffer.SHORT: {
|
|
|
var value = dataView.getInt16(byteOffset, true);
|
|
|
if (normalized) {
|
|
|
- value = (value + 0.5) / 16383.5;
|
|
|
+ value = Math.max(value / 16383, -1);
|
|
|
}
|
|
|
return value;
|
|
|
}
|
|
@@ -35474,7 +35473,6 @@ var BABYLON;
|
|
|
}
|
|
|
var materialType = BABYLON.Tools.Instantiate(parsedMaterial.customType);
|
|
|
return materialType.Parse(parsedMaterial, scene, rootUrl);
|
|
|
- ;
|
|
|
};
|
|
|
// Triangle views
|
|
|
Material._TriangleFillMode = 0;
|
|
@@ -38824,17 +38822,16 @@ var BABYLON;
|
|
|
if (!data) {
|
|
|
return null;
|
|
|
}
|
|
|
- var defaultStride = BABYLON.VertexBuffer.DeduceStride(vertexBuffer.getKind());
|
|
|
- var defaultByteStride = defaultStride * BABYLON.VertexBuffer.GetTypeByteLength(vertexBuffer.type);
|
|
|
- var count = this._totalVertices * defaultStride;
|
|
|
- if (vertexBuffer.type !== BABYLON.VertexBuffer.FLOAT || vertexBuffer.byteStride !== defaultByteStride) {
|
|
|
+ var tightlyPackedByteStride = vertexBuffer.getSize() * BABYLON.VertexBuffer.GetTypeByteLength(vertexBuffer.type);
|
|
|
+ var count = this._totalVertices * vertexBuffer.getSize();
|
|
|
+ if (vertexBuffer.type !== BABYLON.VertexBuffer.FLOAT || vertexBuffer.byteStride !== tightlyPackedByteStride) {
|
|
|
var copy_1 = new Array(count);
|
|
|
vertexBuffer.forEach(count, function (value, index) {
|
|
|
copy_1[index] = value;
|
|
|
});
|
|
|
return copy_1;
|
|
|
}
|
|
|
- if (!(data instanceof Array || data instanceof Float32Array) || vertexBuffer.byteOffset !== 0 || data.length !== count) {
|
|
|
+ if (!((data instanceof Array) || (data instanceof Float32Array)) || vertexBuffer.byteOffset !== 0 || data.length !== count) {
|
|
|
if (data instanceof Array) {
|
|
|
var offset = vertexBuffer.byteOffset / 4;
|
|
|
return BABYLON.Tools.Slice(data, offset, offset + count);
|
|
@@ -42922,23 +42919,6 @@ var BABYLON;
|
|
|
};
|
|
|
return _this;
|
|
|
}
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
- ;
|
|
|
Object.defineProperty(StandardMaterial.prototype, "imageProcessingConfiguration", {
|
|
|
/**
|
|
|
* Gets the image processing configuration used either in this material.
|
|
@@ -50084,7 +50064,6 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
- ;
|
|
|
Object.defineProperty(SpotLight.prototype, "projectionTextureLightNear", {
|
|
|
/**
|
|
|
* Gets the near clip of the Spotlight for texture projection.
|
|
@@ -51553,14 +51532,16 @@ var BABYLON;
|
|
|
/**
|
|
|
* This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame
|
|
|
* It can add constant keys at begin or end
|
|
|
- * @param beginFrame defines the new begin frame for all animations. It can't be bigger than the smallest begin frame of all animations
|
|
|
- * @param endFrame defines the new end frame for all animations. It can't be smaller than the largest end frame of all animations
|
|
|
+ * @param beginFrame defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to 0)
|
|
|
+ * @param endFrame defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)
|
|
|
*/
|
|
|
AnimationGroup.prototype.normalize = function (beginFrame, endFrame) {
|
|
|
- if (beginFrame === void 0) { beginFrame = -Number.MAX_VALUE; }
|
|
|
- if (endFrame === void 0) { endFrame = Number.MAX_VALUE; }
|
|
|
- beginFrame = Math.max(beginFrame, this._from);
|
|
|
- endFrame = Math.min(endFrame, this._to);
|
|
|
+ if (beginFrame === void 0) { beginFrame = 0; }
|
|
|
+ if (endFrame === void 0) { endFrame = null; }
|
|
|
+ if (beginFrame == null)
|
|
|
+ beginFrame = this._from;
|
|
|
+ if (endFrame == null)
|
|
|
+ endFrame = this._to;
|
|
|
for (var index = 0; index < this._targetedAnimations.length; index++) {
|
|
|
var targetedAnimation = this._targetedAnimations[index];
|
|
|
var keys = targetedAnimation.animation.getKeys();
|
|
@@ -51587,6 +51568,8 @@ var BABYLON;
|
|
|
keys.push(newKey);
|
|
|
}
|
|
|
}
|
|
|
+ this._from = beginFrame;
|
|
|
+ this._to = endFrame;
|
|
|
return this;
|
|
|
};
|
|
|
/**
|
|
@@ -51882,8 +51865,13 @@ var BABYLON;
|
|
|
});
|
|
|
/**
|
|
|
* Resets the runtime animation to the beginning
|
|
|
+ * @param restoreOriginal defines whether to restore the target property to the original value
|
|
|
*/
|
|
|
- RuntimeAnimation.prototype.reset = function () {
|
|
|
+ RuntimeAnimation.prototype.reset = function (restoreOriginal) {
|
|
|
+ if (restoreOriginal === void 0) { restoreOriginal = false; }
|
|
|
+ if (restoreOriginal && this._originalValue != null) {
|
|
|
+ this.setValue(this._originalValue, -1);
|
|
|
+ }
|
|
|
this._offsetsCache = {};
|
|
|
this._highLimitsCache = {};
|
|
|
this._currentFrame = 0;
|
|
@@ -51923,9 +51911,9 @@ var BABYLON;
|
|
|
return this._animation._interpolate(currentFrame, repeatCount, this._workValue, loopMode, offsetValue, highLimitValue);
|
|
|
};
|
|
|
/**
|
|
|
- * Affect the interpolated value to the target
|
|
|
+ * Apply the interpolated value to the target
|
|
|
* @param currentValue defines the value computed by the animation
|
|
|
- * @param weight defines the weight to apply to this value
|
|
|
+ * @param weight defines the weight to apply to this value (Defaults to 1.0)
|
|
|
*/
|
|
|
RuntimeAnimation.prototype.setValue = function (currentValue, weight) {
|
|
|
if (weight === void 0) { weight = 1.0; }
|
|
@@ -51939,14 +51927,7 @@ var BABYLON;
|
|
|
this._setValue(this._target, currentValue, weight);
|
|
|
}
|
|
|
};
|
|
|
- /**
|
|
|
- * Sets the value of the runtime animation
|
|
|
- * @param target The target property of the runtime animation
|
|
|
- * @param currentValue The current value to use for the runtime animation
|
|
|
- * @param weight The weight to use for the runtime animation (Defaults to 1.0)
|
|
|
- */
|
|
|
RuntimeAnimation.prototype._setValue = function (target, currentValue, weight) {
|
|
|
- if (weight === void 0) { weight = 1.0; }
|
|
|
// Set value
|
|
|
var path;
|
|
|
var destination;
|
|
@@ -51966,9 +51947,23 @@ var BABYLON;
|
|
|
this._targetPath = path;
|
|
|
this._activeTarget = destination;
|
|
|
this._weight = weight;
|
|
|
+ if (!this._originalValue) {
|
|
|
+ var originalValue = void 0;
|
|
|
+ if (destination.getRestPose && path === "_matrix") { // For bones
|
|
|
+ originalValue = destination.getRestPose();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ originalValue = destination[path];
|
|
|
+ }
|
|
|
+ if (originalValue && originalValue.clone) {
|
|
|
+ this._originalValue = originalValue.clone();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this._originalValue = originalValue;
|
|
|
+ }
|
|
|
+ }
|
|
|
// Blending
|
|
|
var enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
|
|
|
- var blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
|
|
|
if (enableBlending && this._blendingFactor <= 1.0) {
|
|
|
if (!this._originalBlendValue) {
|
|
|
var originalValue = destination[path];
|
|
@@ -51979,25 +51974,6 @@ var BABYLON;
|
|
|
this._originalBlendValue = originalValue;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if (weight !== -1.0) {
|
|
|
- if (!this._originalValue) {
|
|
|
- var originalValue = void 0;
|
|
|
- if (destination.getRestPose && path === "_matrix") { // For bones
|
|
|
- originalValue = destination.getRestPose();
|
|
|
- }
|
|
|
- else {
|
|
|
- originalValue = destination[path];
|
|
|
- }
|
|
|
- if (originalValue.clone) {
|
|
|
- this._originalValue = originalValue.clone();
|
|
|
- }
|
|
|
- else {
|
|
|
- this._originalValue = originalValue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (enableBlending && this._blendingFactor <= 1.0) {
|
|
|
if (this._originalBlendValue.m) { // Matrix
|
|
|
if (BABYLON.Animation.AllowMatrixDecomposeForInterpolation) {
|
|
|
if (this._currentValue) {
|
|
@@ -52031,6 +52007,7 @@ var BABYLON;
|
|
|
this._currentValue = currentValue;
|
|
|
}
|
|
|
}
|
|
|
+ var blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
|
|
|
this._blendingFactor += blendingSpeed;
|
|
|
}
|
|
|
else {
|
|
@@ -52376,12 +52353,7 @@ var BABYLON;
|
|
|
Animatable.prototype.reset = function () {
|
|
|
var runtimeAnimations = this._runtimeAnimations;
|
|
|
for (var index = 0; index < runtimeAnimations.length; index++) {
|
|
|
- runtimeAnimations[index].reset();
|
|
|
- }
|
|
|
- // Reset to original value
|
|
|
- for (index = 0; index < runtimeAnimations.length; index++) {
|
|
|
- var animation = runtimeAnimations[index];
|
|
|
- animation.animate(0, this.fromFrame, this.toFrame, false, this._speedRatio);
|
|
|
+ runtimeAnimations[index].reset(true);
|
|
|
}
|
|
|
this._localDelayOffset = null;
|
|
|
this._pausedDelay = null;
|
|
@@ -56962,13 +56934,9 @@ var BABYLON;
|
|
|
var serializationObject = {};
|
|
|
serializationObject.type = this.getClassName();
|
|
|
serializationObject.direction1 = this.direction1.asArray();
|
|
|
- ;
|
|
|
serializationObject.direction2 = this.direction2.asArray();
|
|
|
- ;
|
|
|
serializationObject.minEmitBox = this.minEmitBox.asArray();
|
|
|
- ;
|
|
|
serializationObject.maxEmitBox = this.maxEmitBox.asArray();
|
|
|
- ;
|
|
|
return serializationObject;
|
|
|
};
|
|
|
/**
|
|
@@ -57336,11 +57304,8 @@ var BABYLON;
|
|
|
*/
|
|
|
SphereDirectedParticleEmitter.prototype.serialize = function () {
|
|
|
var serializationObject = _super.prototype.serialize.call(this);
|
|
|
- ;
|
|
|
serializationObject.direction1 = this.direction1.asArray();
|
|
|
- ;
|
|
|
serializationObject.direction2 = this.direction2.asArray();
|
|
|
- ;
|
|
|
return serializationObject;
|
|
|
};
|
|
|
/**
|
|
@@ -58447,11 +58412,10 @@ var BABYLON;
|
|
|
vertexData.indices = (this._depthSort) ? this._indices : this._indices32;
|
|
|
vertexData.set(this._positions32, BABYLON.VertexBuffer.PositionKind);
|
|
|
vertexData.set(this._normals32, BABYLON.VertexBuffer.NormalKind);
|
|
|
- if (this._uvs32) {
|
|
|
+ if (this._uvs32.length > 0) {
|
|
|
vertexData.set(this._uvs32, BABYLON.VertexBuffer.UVKind);
|
|
|
- ;
|
|
|
}
|
|
|
- if (this._colors32) {
|
|
|
+ if (this._colors32.length > 0) {
|
|
|
vertexData.set(this._colors32, BABYLON.VertexBuffer.ColorKind);
|
|
|
}
|
|
|
var mesh = new BABYLON.Mesh(this.name, this._scene);
|
|
@@ -61324,7 +61288,6 @@ var BABYLON;
|
|
|
var step = pi2 / tessellation * arc;
|
|
|
var rotated;
|
|
|
var path = new Array();
|
|
|
- ;
|
|
|
for (i = 0; i <= tessellation; i++) {
|
|
|
var path = [];
|
|
|
if (cap == BABYLON.Mesh.CAP_START || cap == BABYLON.Mesh.CAP_ALL) {
|
|
@@ -64667,7 +64630,6 @@ var BABYLON;
|
|
|
}
|
|
|
if (y === null || y === undefined) {
|
|
|
var fontSize = parseInt((font.replace(/\D/g, '')));
|
|
|
- ;
|
|
|
y = (size.height / 2) + (fontSize / 3.65);
|
|
|
}
|
|
|
this._context.fillStyle = color;
|
|
@@ -67413,7 +67375,7 @@ var BABYLON;
|
|
|
});
|
|
|
}, onProgress, function (scene, message, exception) {
|
|
|
reject(exception || new Error(message));
|
|
|
- });
|
|
|
+ }, pluginExtension);
|
|
|
});
|
|
|
};
|
|
|
/**
|
|
@@ -69305,8 +69267,8 @@ var BABYLON;
|
|
|
var transaction = this.db.transaction(["versions"]);
|
|
|
transaction.oncomplete = function (event) {
|
|
|
if (version) {
|
|
|
- // If the version in the JSON file is > than the version in DB
|
|
|
- if (_this.manifestVersionFound > version.data) {
|
|
|
+ // If the version in the JSON file is different from the version in DB
|
|
|
+ if (_this.manifestVersionFound !== version.data) {
|
|
|
_this.mustUpdateRessources = true;
|
|
|
updateInDBCallback();
|
|
|
}
|
|
@@ -86123,8 +86085,9 @@ var BABYLON;
|
|
|
*/
|
|
|
function MorphTarget(
|
|
|
/** defines the name of the target */
|
|
|
- name, influence) {
|
|
|
+ name, influence, scene) {
|
|
|
if (influence === void 0) { influence = 0; }
|
|
|
+ if (scene === void 0) { scene = null; }
|
|
|
this.name = name;
|
|
|
/**
|
|
|
* Gets or sets the list of animations
|
|
@@ -86137,6 +86100,8 @@ var BABYLON;
|
|
|
* Observable raised when the influence changes
|
|
|
*/
|
|
|
this.onInfluenceChanged = new BABYLON.Observable();
|
|
|
+ this._animationPropertiesOverride = null;
|
|
|
+ this._scene = scene || BABYLON.Engine.LastCreatedScene;
|
|
|
this.influence = influence;
|
|
|
}
|
|
|
Object.defineProperty(MorphTarget.prototype, "influence", {
|
|
@@ -86159,6 +86124,22 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(MorphTarget.prototype, "animationPropertiesOverride", {
|
|
|
+ /**
|
|
|
+ * Gets or sets the animation properties override
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ if (!this._animationPropertiesOverride && this._scene) {
|
|
|
+ return this._scene.animationPropertiesOverride;
|
|
|
+ }
|
|
|
+ return this._animationPropertiesOverride;
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ this._animationPropertiesOverride = value;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
Object.defineProperty(MorphTarget.prototype, "hasPositions", {
|
|
|
/**
|
|
|
* Gets a boolean defining if the target contains position data
|
|
@@ -86285,7 +86266,7 @@ var BABYLON;
|
|
|
if (!name) {
|
|
|
name = mesh.name;
|
|
|
}
|
|
|
- var result = new MorphTarget(name, influence);
|
|
|
+ var result = new MorphTarget(name, influence, mesh.getScene());
|
|
|
result.setPositions(mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind));
|
|
|
if (mesh.isVerticesDataPresent(BABYLON.VertexBuffer.NormalKind)) {
|
|
|
result.setNormals(mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind));
|
|
@@ -87980,6 +87961,8 @@ var BABYLON;
|
|
|
this._isActionableMesh = false;
|
|
|
this._teleportationRequestInitiated = false;
|
|
|
this._teleportationBackRequestInitiated = false;
|
|
|
+ this._rotationRightAsked = false;
|
|
|
+ this._rotationLeftAsked = false;
|
|
|
this._dpadPressed = true;
|
|
|
this._activePointer = false;
|
|
|
this._id = VRExperienceHelperGazer._idCounter++;
|
|
@@ -88021,10 +88004,14 @@ var BABYLON;
|
|
|
this._activePointer = false;
|
|
|
};
|
|
|
VRExperienceHelperGazer.prototype._updatePointerDistance = function (distance) {
|
|
|
+ if (distance === void 0) { distance = 100; }
|
|
|
};
|
|
|
VRExperienceHelperGazer.prototype.dispose = function () {
|
|
|
this._interactionsEnabled = false;
|
|
|
this._teleportationEnabled = false;
|
|
|
+ if (this._gazeTracker) {
|
|
|
+ this._gazeTracker.dispose();
|
|
|
+ }
|
|
|
};
|
|
|
VRExperienceHelperGazer._idCounter = 0;
|
|
|
return VRExperienceHelperGazer;
|
|
@@ -88091,6 +88078,7 @@ var BABYLON;
|
|
|
this._laserPointer.parent = mesh;
|
|
|
};
|
|
|
VRExperienceHelperControllerGazer.prototype._updatePointerDistance = function (distance) {
|
|
|
+ if (distance === void 0) { distance = 100; }
|
|
|
this._laserPointer.scaling.y = distance;
|
|
|
this._laserPointer.position.z = -distance / 2;
|
|
|
};
|
|
@@ -88164,8 +88152,6 @@ var BABYLON;
|
|
|
this._floorMeshesCollection = [];
|
|
|
this._rotationAllowed = true;
|
|
|
this._teleportBackwardsVector = new BABYLON.Vector3(0, -1, -1);
|
|
|
- this._rotationRightAsked = false;
|
|
|
- this._rotationLeftAsked = false;
|
|
|
this._isDefaultTeleportationTarget = true;
|
|
|
this._teleportationFillColor = "#444444";
|
|
|
this._teleportationBorderColor = "#FFFFFF";
|
|
@@ -88599,7 +88585,7 @@ var BABYLON;
|
|
|
if (this.rightController) {
|
|
|
this.rightController._activatePointer();
|
|
|
}
|
|
|
- else if (this.leftController) {
|
|
|
+ if (this.leftController) {
|
|
|
this.leftController._activatePointer();
|
|
|
}
|
|
|
}
|
|
@@ -89000,9 +88986,9 @@ var BABYLON;
|
|
|
if (gazer._teleportationRequestInitiated) {
|
|
|
return;
|
|
|
}
|
|
|
- if (!this._rotationLeftAsked) {
|
|
|
+ if (!gazer._rotationLeftAsked) {
|
|
|
if (stateObject.x < -this._padSensibilityUp && gazer._dpadPressed) {
|
|
|
- this._rotationLeftAsked = true;
|
|
|
+ gazer._rotationLeftAsked = true;
|
|
|
if (this._rotationAllowed) {
|
|
|
this._rotateCamera(false);
|
|
|
}
|
|
@@ -89010,12 +88996,12 @@ var BABYLON;
|
|
|
}
|
|
|
else {
|
|
|
if (stateObject.x > -this._padSensibilityDown) {
|
|
|
- this._rotationLeftAsked = false;
|
|
|
+ gazer._rotationLeftAsked = false;
|
|
|
}
|
|
|
}
|
|
|
- if (!this._rotationRightAsked) {
|
|
|
+ if (!gazer._rotationRightAsked) {
|
|
|
if (stateObject.x > this._padSensibilityUp && gazer._dpadPressed) {
|
|
|
- this._rotationRightAsked = true;
|
|
|
+ gazer._rotationRightAsked = true;
|
|
|
if (this._rotationAllowed) {
|
|
|
this._rotateCamera(true);
|
|
|
}
|
|
@@ -89023,7 +89009,7 @@ var BABYLON;
|
|
|
}
|
|
|
else {
|
|
|
if (stateObject.x < this._padSensibilityDown) {
|
|
|
- this._rotationRightAsked = false;
|
|
|
+ gazer._rotationRightAsked = false;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -89081,8 +89067,8 @@ var BABYLON;
|
|
|
controller.webVRController.onPadStateChangedObservable.add(function (stateObject) {
|
|
|
controller._dpadPressed = stateObject.pressed;
|
|
|
if (!controller._dpadPressed) {
|
|
|
- _this._rotationLeftAsked = false;
|
|
|
- _this._rotationRightAsked = false;
|
|
|
+ controller._rotationLeftAsked = false;
|
|
|
+ controller._rotationRightAsked = false;
|
|
|
controller._teleportationBackRequestInitiated = false;
|
|
|
}
|
|
|
});
|
|
@@ -89388,6 +89374,7 @@ var BABYLON;
|
|
|
gazer._updatePointerDistance(hit.distance);
|
|
|
}
|
|
|
else {
|
|
|
+ gazer._updatePointerDistance();
|
|
|
gazer._gazeTracker.isVisible = false;
|
|
|
}
|
|
|
if (hit && hit.pickedMesh) {
|
|
@@ -95929,6 +95916,8 @@ var BABYLON;
|
|
|
}
|
|
|
return false;
|
|
|
};
|
|
|
+ NullEngine.prototype.releaseEffects = function () {
|
|
|
+ };
|
|
|
return NullEngine;
|
|
|
}(BABYLON.Engine));
|
|
|
BABYLON.NullEngine = NullEngine;
|