|
@@ -4871,6 +4871,25 @@ var BABYLON;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
|
|
+ * Returns the dot product (float) between the quaternions "left" and "right"
|
|
|
|
+ * @param left defines the left operand
|
|
|
|
+ * @param right defines the right operand
|
|
|
|
+ * @returns the dot product
|
|
|
|
+ */
|
|
|
|
+ Quaternion.Dot = function (left, right) {
|
|
|
|
+ return (left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w);
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Checks if the two quaternions are close to each other
|
|
|
|
+ * @param quat0 defines the first quaternion to check
|
|
|
|
+ * @param quat1 defines the second quaternion to check
|
|
|
|
+ * @returns true if the two quaternions are close to each other
|
|
|
|
+ */
|
|
|
|
+ Quaternion.AreClose = function (quat0, quat1) {
|
|
|
|
+ var dot = Quaternion.Dot(quat0, quat1);
|
|
|
|
+ return dot >= 0;
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
* Creates an empty quaternion
|
|
* Creates an empty quaternion
|
|
* @returns a new quaternion set to (0.0, 0.0, 0.0)
|
|
* @returns a new quaternion set to (0.0, 0.0, 0.0)
|
|
*/
|
|
*/
|
|
@@ -23937,6 +23956,7 @@ var BABYLON;
|
|
this._previousStartingPointerPosition = new BABYLON.Vector2(0, 0);
|
|
this._previousStartingPointerPosition = new BABYLON.Vector2(0, 0);
|
|
this._startingPointerTime = 0;
|
|
this._startingPointerTime = 0;
|
|
this._previousStartingPointerTime = 0;
|
|
this._previousStartingPointerTime = 0;
|
|
|
|
+ this._pointerCaptures = {};
|
|
// Deterministic lockstep
|
|
// Deterministic lockstep
|
|
this._timeAccumulator = 0;
|
|
this._timeAccumulator = 0;
|
|
this._currentStepId = 0;
|
|
this._currentStepId = 0;
|
|
@@ -25317,7 +25337,7 @@ var BABYLON;
|
|
this._onPointerMove = function (evt) {
|
|
this._onPointerMove = function (evt) {
|
|
_this._updatePointerPosition(evt);
|
|
_this._updatePointerPosition(evt);
|
|
// PreObservable support
|
|
// PreObservable support
|
|
- if (_this.onPrePointerObservable.hasObservers()) {
|
|
|
|
|
|
+ if (_this.onPrePointerObservable.hasObservers() && !_this._pointerCaptures[evt.pointerId]) {
|
|
var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
|
|
var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
|
|
var pi = new BABYLON.PointerInfoPre(type, evt, _this._unTranslatedPointerX, _this._unTranslatedPointerY);
|
|
var pi = new BABYLON.PointerInfoPre(type, evt, _this._unTranslatedPointerX, _this._unTranslatedPointerY);
|
|
_this.onPrePointerObservable.notifyObservers(pi, type);
|
|
_this.onPrePointerObservable.notifyObservers(pi, type);
|
|
@@ -25356,6 +25376,7 @@ var BABYLON;
|
|
if (!_this.cameraToUseForPointers && !_this.activeCamera) {
|
|
if (!_this.cameraToUseForPointers && !_this.activeCamera) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ _this._pointerCaptures[evt.pointerId] = true;
|
|
_this._startingPointerPosition.x = _this._pointerX;
|
|
_this._startingPointerPosition.x = _this._pointerX;
|
|
_this._startingPointerPosition.y = _this._pointerY;
|
|
_this._startingPointerPosition.y = _this._pointerY;
|
|
_this._startingPointerTime = Date.now();
|
|
_this._startingPointerTime = Date.now();
|
|
@@ -25403,7 +25424,7 @@ var BABYLON;
|
|
_this._updatePointerPosition(evt);
|
|
_this._updatePointerPosition(evt);
|
|
_this._initClickEvent(_this.onPrePointerObservable, _this.onPointerObservable, evt, function (clickInfo, pickResult) {
|
|
_this._initClickEvent(_this.onPrePointerObservable, _this.onPointerObservable, evt, function (clickInfo, pickResult) {
|
|
// PreObservable support
|
|
// PreObservable support
|
|
- if (_this.onPrePointerObservable.hasObservers()) {
|
|
|
|
|
|
+ if (_this.onPrePointerObservable.hasObservers() && !_this._pointerCaptures[evt.pointerId]) {
|
|
if (!clickInfo.ignore) {
|
|
if (!clickInfo.ignore) {
|
|
if (!clickInfo.hasSwiped) {
|
|
if (!clickInfo.hasSwiped) {
|
|
if (clickInfo.singleClick && _this.onPrePointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
|
|
if (clickInfo.singleClick && _this.onPrePointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
|
|
@@ -25436,6 +25457,7 @@ var BABYLON;
|
|
if (!_this.cameraToUseForPointers && !_this.activeCamera) {
|
|
if (!_this.cameraToUseForPointers && !_this.activeCamera) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ _this._pointerCaptures[evt.pointerId] = false;
|
|
if (!_this.pointerUpPredicate) {
|
|
if (!_this.pointerUpPredicate) {
|
|
_this.pointerUpPredicate = function (mesh) {
|
|
_this.pointerUpPredicate = function (mesh) {
|
|
return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled();
|
|
return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled();
|
|
@@ -25957,7 +25979,7 @@ var BABYLON;
|
|
this._processLateAnimationBindings();
|
|
this._processLateAnimationBindings();
|
|
};
|
|
};
|
|
/** @hidden */
|
|
/** @hidden */
|
|
- Scene.prototype._registerTargetForLateAnimationBinding = function (runtimeAnimation) {
|
|
|
|
|
|
+ Scene.prototype._registerTargetForLateAnimationBinding = function (runtimeAnimation, originalValue) {
|
|
var target = runtimeAnimation.target;
|
|
var target = runtimeAnimation.target;
|
|
this._registeredForLateAnimationBindings.pushNoDuplicate(target);
|
|
this._registeredForLateAnimationBindings.pushNoDuplicate(target);
|
|
if (!target._lateAnimationHolders) {
|
|
if (!target._lateAnimationHolders) {
|
|
@@ -25966,19 +25988,21 @@ var BABYLON;
|
|
if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) {
|
|
if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) {
|
|
target._lateAnimationHolders[runtimeAnimation.targetPath] = {
|
|
target._lateAnimationHolders[runtimeAnimation.targetPath] = {
|
|
totalWeight: 0,
|
|
totalWeight: 0,
|
|
- animations: []
|
|
|
|
|
|
+ animations: [],
|
|
|
|
+ originalValue: originalValue
|
|
};
|
|
};
|
|
}
|
|
}
|
|
target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation);
|
|
target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation);
|
|
target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight;
|
|
target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight;
|
|
};
|
|
};
|
|
- Scene.prototype._processLateAnimationBindingsForMatrices = function (holder, originalValue) {
|
|
|
|
|
|
+ Scene.prototype._processLateAnimationBindingsForMatrices = function (holder) {
|
|
var normalizer = 1.0;
|
|
var normalizer = 1.0;
|
|
var finalPosition = BABYLON.Tmp.Vector3[0];
|
|
var finalPosition = BABYLON.Tmp.Vector3[0];
|
|
var finalScaling = BABYLON.Tmp.Vector3[1];
|
|
var finalScaling = BABYLON.Tmp.Vector3[1];
|
|
var finalQuaternion = BABYLON.Tmp.Quaternion[0];
|
|
var finalQuaternion = BABYLON.Tmp.Quaternion[0];
|
|
var startIndex = 0;
|
|
var startIndex = 0;
|
|
var originalAnimation = holder.animations[0];
|
|
var originalAnimation = holder.animations[0];
|
|
|
|
+ var originalValue = holder.originalValue;
|
|
var scale = 1;
|
|
var scale = 1;
|
|
if (holder.totalWeight < 1.0) {
|
|
if (holder.totalWeight < 1.0) {
|
|
// We need to mix the original value in
|
|
// We need to mix the original value in
|
|
@@ -26012,6 +26036,46 @@ var BABYLON;
|
|
BABYLON.Matrix.ComposeToRef(finalScaling, finalQuaternion, finalPosition, originalAnimation._workValue);
|
|
BABYLON.Matrix.ComposeToRef(finalScaling, finalQuaternion, finalPosition, originalAnimation._workValue);
|
|
return originalAnimation._workValue;
|
|
return originalAnimation._workValue;
|
|
};
|
|
};
|
|
|
|
+ Scene.prototype._processLateAnimationBindingsForQuaternions = function (holder) {
|
|
|
|
+ var originalAnimation = holder.animations[0];
|
|
|
|
+ var originalValue = holder.originalValue;
|
|
|
|
+ if (holder.animations.length === 1) {
|
|
|
|
+ return BABYLON.Quaternion.Slerp(originalValue, originalAnimation.currentValue, Math.min(1.0, holder.totalWeight));
|
|
|
|
+ }
|
|
|
|
+ var normalizer = 1.0;
|
|
|
|
+ var cumulativeQuaternion = null;
|
|
|
|
+ if (holder.totalWeight < 1.0) {
|
|
|
|
+ // We need to mix the original value in
|
|
|
|
+ //originalValue.decompose(finalScaling, finalQuaternion, finalPosition);
|
|
|
|
+ var scale = 1.0 - holder.totalWeight;
|
|
|
|
+ cumulativeQuaternion = originalValue.scaleInPlace(scale);
|
|
|
|
+ cumulativeQuaternion.normalize();
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (holder.animations.length === 2) { // Slerp as soon as we can
|
|
|
|
+ return BABYLON.Quaternion.Slerp(holder.animations[0].currentValue, holder.animations[1].currentValue, holder.animations[1].weight / holder.totalWeight);
|
|
|
|
+ }
|
|
|
|
+ normalizer = holder.totalWeight;
|
|
|
|
+ }
|
|
|
|
+ // There is no simple way to cumulate and weight quaternions so doing approximations here
|
|
|
|
+ for (var animIndex = 0; animIndex < holder.animations.length; animIndex++) {
|
|
|
|
+ var runtimeAnimation = holder.animations[animIndex];
|
|
|
|
+ var scale = runtimeAnimation.weight / normalizer;
|
|
|
|
+ var current = runtimeAnimation.currentValue;
|
|
|
|
+ current.scaleInPlace(scale);
|
|
|
|
+ current.normalize();
|
|
|
|
+ if (!cumulativeQuaternion) {
|
|
|
|
+ cumulativeQuaternion = current;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (!BABYLON.Quaternion.AreClose(current, cumulativeQuaternion)) {
|
|
|
|
+ current.conjugateInPlace();
|
|
|
|
+ }
|
|
|
|
+ cumulativeQuaternion.addInPlace(current);
|
|
|
|
+ cumulativeQuaternion.normalize();
|
|
|
|
+ }
|
|
|
|
+ return cumulativeQuaternion;
|
|
|
|
+ };
|
|
Scene.prototype._processLateAnimationBindings = function () {
|
|
Scene.prototype._processLateAnimationBindings = function () {
|
|
if (!this._registeredForLateAnimationBindings.length) {
|
|
if (!this._registeredForLateAnimationBindings.length) {
|
|
return;
|
|
return;
|
|
@@ -26021,54 +26085,59 @@ var BABYLON;
|
|
for (var path in target._lateAnimationHolders) {
|
|
for (var path in target._lateAnimationHolders) {
|
|
var holder = target._lateAnimationHolders[path];
|
|
var holder = target._lateAnimationHolders[path];
|
|
var originalAnimation = holder.animations[0];
|
|
var originalAnimation = holder.animations[0];
|
|
- var originalValue = originalAnimation.originalValue;
|
|
|
|
- var finalTarget = originalAnimation.target;
|
|
|
|
|
|
+ var originalValue = holder.originalValue;
|
|
var matrixDecomposeMode = BABYLON.Animation.AllowMatrixDecomposeForInterpolation && originalValue.m; // ie. data is matrix
|
|
var matrixDecomposeMode = BABYLON.Animation.AllowMatrixDecomposeForInterpolation && originalValue.m; // ie. data is matrix
|
|
var finalValue = void 0;
|
|
var finalValue = void 0;
|
|
if (matrixDecomposeMode) {
|
|
if (matrixDecomposeMode) {
|
|
- finalValue = this._processLateAnimationBindingsForMatrices(holder, originalValue);
|
|
|
|
|
|
+ finalValue = this._processLateAnimationBindingsForMatrices(holder);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- var startIndex = 0;
|
|
|
|
- var normalizer = 1.0;
|
|
|
|
- if (holder.totalWeight < 1.0) {
|
|
|
|
- // We need to mix the original value in
|
|
|
|
- if (originalValue.scale) {
|
|
|
|
- finalValue = originalValue.scale(1.0 - holder.totalWeight);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- finalValue = originalValue * (1.0 - holder.totalWeight);
|
|
|
|
- }
|
|
|
|
|
|
+ var quaternionMode = originalValue.w !== undefined;
|
|
|
|
+ if (quaternionMode) {
|
|
|
|
+ finalValue = this._processLateAnimationBindingsForQuaternions(holder);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- // We need to normalize the weights
|
|
|
|
- normalizer = holder.totalWeight;
|
|
|
|
- var scale_1 = originalAnimation.weight / normalizer;
|
|
|
|
- if (scale_1 !== 1) {
|
|
|
|
- if (originalAnimation.currentValue.scale) {
|
|
|
|
- finalValue = originalAnimation.currentValue.scale(scale_1);
|
|
|
|
|
|
+ var startIndex = 0;
|
|
|
|
+ var normalizer = 1.0;
|
|
|
|
+ if (holder.totalWeight < 1.0) {
|
|
|
|
+ // We need to mix the original value in
|
|
|
|
+ if (originalValue.scale) {
|
|
|
|
+ finalValue = originalValue.scale(1.0 - holder.totalWeight);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- finalValue = originalAnimation.currentValue * scale_1;
|
|
|
|
|
|
+ finalValue = originalValue * (1.0 - holder.totalWeight);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- finalValue = originalAnimation.currentValue;
|
|
|
|
- }
|
|
|
|
- startIndex = 1;
|
|
|
|
- }
|
|
|
|
- for (var animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {
|
|
|
|
- var runtimeAnimation = holder.animations[animIndex];
|
|
|
|
- var scale = runtimeAnimation.weight / normalizer;
|
|
|
|
- if (runtimeAnimation.currentValue.scaleAndAddToRef) {
|
|
|
|
- runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue);
|
|
|
|
|
|
+ // We need to normalize the weights
|
|
|
|
+ normalizer = holder.totalWeight;
|
|
|
|
+ var scale_1 = originalAnimation.weight / normalizer;
|
|
|
|
+ if (scale_1 !== 1) {
|
|
|
|
+ if (originalAnimation.currentValue.scale) {
|
|
|
|
+ finalValue = originalAnimation.currentValue.scale(scale_1);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ finalValue = originalAnimation.currentValue * scale_1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ finalValue = originalAnimation.currentValue;
|
|
|
|
+ }
|
|
|
|
+ startIndex = 1;
|
|
}
|
|
}
|
|
- else {
|
|
|
|
- finalValue += runtimeAnimation.currentValue * scale;
|
|
|
|
|
|
+ for (var animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {
|
|
|
|
+ var runtimeAnimation = holder.animations[animIndex];
|
|
|
|
+ var scale = runtimeAnimation.weight / normalizer;
|
|
|
|
+ if (runtimeAnimation.currentValue.scaleAndAddToRef) {
|
|
|
|
+ runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ finalValue += runtimeAnimation.currentValue * scale;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- finalTarget[path] = finalValue;
|
|
|
|
|
|
+ target[path] = finalValue;
|
|
}
|
|
}
|
|
target._lateAnimationHolders = {};
|
|
target._lateAnimationHolders = {};
|
|
}
|
|
}
|
|
@@ -51843,6 +51912,10 @@ var BABYLON;
|
|
*/
|
|
*/
|
|
this._currentFrame = 0;
|
|
this._currentFrame = 0;
|
|
/**
|
|
/**
|
|
|
|
+ * The original value of the runtime animation
|
|
|
|
+ */
|
|
|
|
+ this._originalValue = new Array();
|
|
|
|
+ /**
|
|
* The offsets cache of the runtime animation
|
|
* The offsets cache of the runtime animation
|
|
*/
|
|
*/
|
|
this._offsetsCache = {};
|
|
this._offsetsCache = {};
|
|
@@ -51904,16 +51977,6 @@ var BABYLON;
|
|
enumerable: true,
|
|
enumerable: true,
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
- Object.defineProperty(RuntimeAnimation.prototype, "originalValue", {
|
|
|
|
- /**
|
|
|
|
- * Gets the original value of the runtime animation
|
|
|
|
- */
|
|
|
|
- get: function () {
|
|
|
|
- return this._originalValue;
|
|
|
|
- },
|
|
|
|
- enumerable: true,
|
|
|
|
- configurable: true
|
|
|
|
- });
|
|
|
|
Object.defineProperty(RuntimeAnimation.prototype, "currentValue", {
|
|
Object.defineProperty(RuntimeAnimation.prototype, "currentValue", {
|
|
/**
|
|
/**
|
|
* Gets the current value of the runtime animation
|
|
* Gets the current value of the runtime animation
|
|
@@ -51960,14 +52023,28 @@ var BABYLON;
|
|
*/
|
|
*/
|
|
RuntimeAnimation.prototype.reset = function (restoreOriginal) {
|
|
RuntimeAnimation.prototype.reset = function (restoreOriginal) {
|
|
if (restoreOriginal === void 0) { restoreOriginal = false; }
|
|
if (restoreOriginal === void 0) { restoreOriginal = false; }
|
|
- if (restoreOriginal && this._originalValue != null) {
|
|
|
|
- this.setValue(this._originalValue, -1);
|
|
|
|
|
|
+ if (restoreOriginal) {
|
|
|
|
+ if (this._target instanceof Array) {
|
|
|
|
+ var index = 0;
|
|
|
|
+ for (var _i = 0, _a = this._target; _i < _a.length; _i++) {
|
|
|
|
+ var target = _a[_i];
|
|
|
|
+ if (this._originalValue[index] !== undefined) {
|
|
|
|
+ this._setValue(target, this._originalValue[index], -1);
|
|
|
|
+ }
|
|
|
|
+ index++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (this._originalValue[0] !== undefined) {
|
|
|
|
+ this._setValue(this._target, this._originalValue[0], -1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this._offsetsCache = {};
|
|
this._offsetsCache = {};
|
|
this._highLimitsCache = {};
|
|
this._highLimitsCache = {};
|
|
this._currentFrame = 0;
|
|
this._currentFrame = 0;
|
|
this._blendingFactor = 0;
|
|
this._blendingFactor = 0;
|
|
- this._originalValue = null;
|
|
|
|
|
|
+ this._originalValue = new Array();
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Specifies if the runtime animation is stopped
|
|
* Specifies if the runtime animation is stopped
|
|
@@ -52009,16 +52086,19 @@ var BABYLON;
|
|
RuntimeAnimation.prototype.setValue = function (currentValue, weight) {
|
|
RuntimeAnimation.prototype.setValue = function (currentValue, weight) {
|
|
if (weight === void 0) { weight = 1.0; }
|
|
if (weight === void 0) { weight = 1.0; }
|
|
if (this._target instanceof Array) {
|
|
if (this._target instanceof Array) {
|
|
|
|
+ var index = 0;
|
|
for (var _i = 0, _a = this._target; _i < _a.length; _i++) {
|
|
for (var _i = 0, _a = this._target; _i < _a.length; _i++) {
|
|
var target = _a[_i];
|
|
var target = _a[_i];
|
|
- this._setValue(target, currentValue, weight);
|
|
|
|
|
|
+ this._setValue(target, currentValue, weight, index);
|
|
|
|
+ index++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
this._setValue(this._target, currentValue, weight);
|
|
this._setValue(this._target, currentValue, weight);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- RuntimeAnimation.prototype._setValue = function (target, currentValue, weight) {
|
|
|
|
|
|
+ RuntimeAnimation.prototype._setValue = function (target, currentValue, weight, targetIndex) {
|
|
|
|
+ if (targetIndex === void 0) { targetIndex = 0; }
|
|
// Set value
|
|
// Set value
|
|
var path;
|
|
var path;
|
|
var destination;
|
|
var destination;
|
|
@@ -52038,7 +52118,7 @@ var BABYLON;
|
|
this._targetPath = path;
|
|
this._targetPath = path;
|
|
this._activeTarget = destination;
|
|
this._activeTarget = destination;
|
|
this._weight = weight;
|
|
this._weight = weight;
|
|
- if (!this._originalValue) {
|
|
|
|
|
|
+ if (this._originalValue[targetIndex] === undefined) {
|
|
var originalValue = void 0;
|
|
var originalValue = void 0;
|
|
if (destination.getRestPose && path === "_matrix") { // For bones
|
|
if (destination.getRestPose && path === "_matrix") { // For bones
|
|
originalValue = destination.getRestPose();
|
|
originalValue = destination.getRestPose();
|
|
@@ -52047,10 +52127,10 @@ var BABYLON;
|
|
originalValue = destination[path];
|
|
originalValue = destination[path];
|
|
}
|
|
}
|
|
if (originalValue && originalValue.clone) {
|
|
if (originalValue && originalValue.clone) {
|
|
- this._originalValue = originalValue.clone();
|
|
|
|
|
|
+ this._originalValue[targetIndex] = originalValue.clone();
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- this._originalValue = originalValue;
|
|
|
|
|
|
+ this._originalValue[targetIndex] = originalValue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// Blending
|
|
// Blending
|
|
@@ -52105,7 +52185,7 @@ var BABYLON;
|
|
this._currentValue = currentValue;
|
|
this._currentValue = currentValue;
|
|
}
|
|
}
|
|
if (weight !== -1.0) {
|
|
if (weight !== -1.0) {
|
|
- this._scene._registerTargetForLateAnimationBinding(this);
|
|
|
|
|
|
+ this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[targetIndex]);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
destination[path] = this._currentValue;
|
|
destination[path] = this._currentValue;
|
|
@@ -102248,6 +102328,8 @@ var BABYLON;
|
|
* If true, no extra effects are applied to transparent pixels.
|
|
* If true, no extra effects are applied to transparent pixels.
|
|
*/
|
|
*/
|
|
this.transparencyAsCoverage = false;
|
|
this.transparencyAsCoverage = false;
|
|
|
|
+ /** @hidden */
|
|
|
|
+ this._normalizeAnimationGroupsToBeginAtZero = true;
|
|
/**
|
|
/**
|
|
* Function called before loading a url referenced by the asset.
|
|
* Function called before loading a url referenced by the asset.
|
|
*/
|
|
*/
|
|
@@ -102560,6 +102642,7 @@ var BABYLON;
|
|
loader.useClipPlane = this.useClipPlane;
|
|
loader.useClipPlane = this.useClipPlane;
|
|
loader.compileShadowGenerators = this.compileShadowGenerators;
|
|
loader.compileShadowGenerators = this.compileShadowGenerators;
|
|
loader.transparencyAsCoverage = this.transparencyAsCoverage;
|
|
loader.transparencyAsCoverage = this.transparencyAsCoverage;
|
|
|
|
+ loader._normalizeAnimationGroupsToBeginAtZero = this._normalizeAnimationGroupsToBeginAtZero;
|
|
loader.preprocessUrlAsync = this.preprocessUrlAsync;
|
|
loader.preprocessUrlAsync = this.preprocessUrlAsync;
|
|
loader.onMeshLoadedObservable.add(function (mesh) { return _this.onMeshLoadedObservable.notifyObservers(mesh); });
|
|
loader.onMeshLoadedObservable.add(function (mesh) { return _this.onMeshLoadedObservable.notifyObservers(mesh); });
|
|
loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
|
|
loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
|
|
@@ -104139,6 +104222,7 @@ var BABYLON;
|
|
this.useClipPlane = false;
|
|
this.useClipPlane = false;
|
|
this.compileShadowGenerators = false;
|
|
this.compileShadowGenerators = false;
|
|
this.transparencyAsCoverage = false;
|
|
this.transparencyAsCoverage = false;
|
|
|
|
+ this._normalizeAnimationGroupsToBeginAtZero = true;
|
|
this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
|
|
this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
|
|
this.onMeshLoadedObservable = new BABYLON.Observable();
|
|
this.onMeshLoadedObservable = new BABYLON.Observable();
|
|
this.onTextureLoadedObservable = new BABYLON.Observable();
|
|
this.onTextureLoadedObservable = new BABYLON.Observable();
|
|
@@ -105020,6 +105104,8 @@ var BABYLON;
|
|
* If true, no extra effects are applied to transparent pixels.
|
|
* If true, no extra effects are applied to transparent pixels.
|
|
*/
|
|
*/
|
|
this.transparencyAsCoverage = false;
|
|
this.transparencyAsCoverage = false;
|
|
|
|
+ /** @hidden */
|
|
|
|
+ this._normalizeAnimationGroupsToBeginAtZero = true;
|
|
/**
|
|
/**
|
|
* Function called before loading a url referenced by the asset.
|
|
* Function called before loading a url referenced by the asset.
|
|
*/
|
|
*/
|
|
@@ -105752,6 +105838,7 @@ var BABYLON;
|
|
return Promise.all(promises).then(function () { });
|
|
return Promise.all(promises).then(function () { });
|
|
};
|
|
};
|
|
GLTFLoader.prototype._loadAnimationAsync = function (context, animation) {
|
|
GLTFLoader.prototype._loadAnimationAsync = function (context, animation) {
|
|
|
|
+ var _this = this;
|
|
var babylonAnimationGroup = new BABYLON.AnimationGroup(animation.name || "animation" + animation._index, this._babylonScene);
|
|
var babylonAnimationGroup = new BABYLON.AnimationGroup(animation.name || "animation" + animation._index, this._babylonScene);
|
|
animation._babylonAnimationGroup = babylonAnimationGroup;
|
|
animation._babylonAnimationGroup = babylonAnimationGroup;
|
|
var promises = new Array();
|
|
var promises = new Array();
|
|
@@ -105762,7 +105849,7 @@ var BABYLON;
|
|
promises.push(this._loadAnimationChannelAsync(context + "/channels/" + channel._index, context, animation, channel, babylonAnimationGroup));
|
|
promises.push(this._loadAnimationChannelAsync(context + "/channels/" + channel._index, context, animation, channel, babylonAnimationGroup));
|
|
}
|
|
}
|
|
return Promise.all(promises).then(function () {
|
|
return Promise.all(promises).then(function () {
|
|
- babylonAnimationGroup.normalize();
|
|
|
|
|
|
+ babylonAnimationGroup.normalize(_this._normalizeAnimationGroupsToBeginAtZero ? 0 : null);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
GLTFLoader.prototype._loadAnimationChannelAsync = function (context, animationContext, animation, channel, babylonAnimationGroup) {
|
|
GLTFLoader.prototype._loadAnimationChannelAsync = function (context, animationContext, animation, channel, babylonAnimationGroup) {
|