|
@@ -1089,6 +1089,8 @@ var BABYLON;
|
|
|
* If true, no extra effects are applied to transparent pixels.
|
|
|
*/
|
|
|
this.transparencyAsCoverage = false;
|
|
|
+ /** @hidden */
|
|
|
+ this._normalizeAnimationGroupsToBeginAtZero = true;
|
|
|
/**
|
|
|
* Function called before loading a url referenced by the asset.
|
|
|
*/
|
|
@@ -1401,6 +1403,7 @@ var BABYLON;
|
|
|
loader.useClipPlane = this.useClipPlane;
|
|
|
loader.compileShadowGenerators = this.compileShadowGenerators;
|
|
|
loader.transparencyAsCoverage = this.transparencyAsCoverage;
|
|
|
+ loader._normalizeAnimationGroupsToBeginAtZero = this._normalizeAnimationGroupsToBeginAtZero;
|
|
|
loader.preprocessUrlAsync = this.preprocessUrlAsync;
|
|
|
loader.onMeshLoadedObservable.add(function (mesh) { return _this.onMeshLoadedObservable.notifyObservers(mesh); });
|
|
|
loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
|
|
@@ -2980,6 +2983,7 @@ var BABYLON;
|
|
|
this.useClipPlane = false;
|
|
|
this.compileShadowGenerators = false;
|
|
|
this.transparencyAsCoverage = false;
|
|
|
+ this._normalizeAnimationGroupsToBeginAtZero = true;
|
|
|
this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
|
|
|
this.onMeshLoadedObservable = new BABYLON.Observable();
|
|
|
this.onTextureLoadedObservable = new BABYLON.Observable();
|
|
@@ -3861,6 +3865,8 @@ var BABYLON;
|
|
|
* If true, no extra effects are applied to transparent pixels.
|
|
|
*/
|
|
|
this.transparencyAsCoverage = false;
|
|
|
+ /** @hidden */
|
|
|
+ this._normalizeAnimationGroupsToBeginAtZero = true;
|
|
|
/**
|
|
|
* Function called before loading a url referenced by the asset.
|
|
|
*/
|
|
@@ -4593,6 +4599,7 @@ var BABYLON;
|
|
|
return Promise.all(promises).then(function () { });
|
|
|
};
|
|
|
GLTFLoader.prototype._loadAnimationAsync = function (context, animation) {
|
|
|
+ var _this = this;
|
|
|
var babylonAnimationGroup = new BABYLON.AnimationGroup(animation.name || "animation" + animation._index, this._babylonScene);
|
|
|
animation._babylonAnimationGroup = babylonAnimationGroup;
|
|
|
var promises = new Array();
|
|
@@ -4603,7 +4610,7 @@ var BABYLON;
|
|
|
promises.push(this._loadAnimationChannelAsync(context + "/channels/" + channel._index, context, animation, channel, babylonAnimationGroup));
|
|
|
}
|
|
|
return Promise.all(promises).then(function () {
|
|
|
- babylonAnimationGroup.normalize();
|
|
|
+ babylonAnimationGroup.normalize(_this._normalizeAnimationGroupsToBeginAtZero ? 0 : null);
|
|
|
});
|
|
|
};
|
|
|
GLTFLoader.prototype._loadAnimationChannelAsync = function (context, animationContext, animation, channel, babylonAnimationGroup) {
|