@onerjs/core 8.48.6 → 8.48.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,6 +44,7 @@ export declare class Animatable {
44
44
  private _frameToSyncFromJump;
45
45
  private _goToFrame;
46
46
  private _linkedTargetRuntimeAnimationsMap;
47
+ private _linkedTargetAnimationPredicate;
47
48
  /**
48
49
  * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation.
49
50
  * This will only apply for non looping animation (default is true)
@@ -125,8 +126,9 @@ export declare class Animatable {
125
126
  /**
126
127
  * Add a target that run the same animations with the origin target
127
128
  * @param target
129
+ * @param predicate
128
130
  */
129
- addLinkedTarget(target: any): void;
131
+ addLinkedTarget(target: any, predicate?: (animation: Animation) => boolean): void;
130
132
  /**
131
133
  * Remove a target that run the same animations with the origin target
132
134
  * @param target
@@ -113,6 +113,7 @@ export class Animatable {
113
113
  this._frameToSyncFromJump = null;
114
114
  this._goToFrame = null;
115
115
  this._linkedTargetRuntimeAnimationsMap = new Map();
116
+ this._linkedTargetAnimationPredicate = new Map();
116
117
  /**
117
118
  * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation.
118
119
  * This will only apply for non looping animation (default is true)
@@ -159,16 +160,22 @@ export class Animatable {
159
160
  /**
160
161
  * Add a target that run the same animations with the origin target
161
162
  * @param target
163
+ * @param predicate
162
164
  */
163
- addLinkedTarget(target) {
165
+ addLinkedTarget(target, predicate) {
164
166
  if (!this._linkedTargetRuntimeAnimationsMap.has(target)) {
165
167
  const runtimeAnimations = [];
166
168
  for (let index = 0; index < this._runtimeAnimations.length; index++) {
167
169
  const animation = this._runtimeAnimations[index].animation;
168
- const newRuntimeAnimation = new RuntimeAnimation(target, animation, this._scene, this);
169
- runtimeAnimations.push(newRuntimeAnimation);
170
+ if (!predicate || predicate(animation)) {
171
+ const newRuntimeAnimation = new RuntimeAnimation(target, animation, this._scene, this);
172
+ runtimeAnimations.push(newRuntimeAnimation);
173
+ }
170
174
  }
171
175
  this._linkedTargetRuntimeAnimationsMap.set(target, runtimeAnimations);
176
+ if (predicate) {
177
+ this._linkedTargetAnimationPredicate.set(target, predicate);
178
+ }
172
179
  }
173
180
  }
174
181
  /**
@@ -182,6 +189,7 @@ export class Animatable {
182
189
  runtimeAnimation.dispose();
183
190
  });
184
191
  this._linkedTargetRuntimeAnimationsMap.delete(target);
192
+ this._linkedTargetAnimationPredicate.delete(target);
185
193
  }
186
194
  }
187
195
  _getAllLinkedTargetRuntimeAnimations() {
@@ -215,7 +223,10 @@ export class Animatable {
215
223
  this._runtimeAnimations.push(newRuntimeAnimation);
216
224
  const entries = Array.from(this._linkedTargetRuntimeAnimationsMap.entries());
217
225
  for (const [linkedTarget, targetAnimations] of entries) {
218
- targetAnimations.push(new RuntimeAnimation(linkedTarget, animation, this._scene, this));
226
+ const predicate = this._linkedTargetAnimationPredicate.get(linkedTarget);
227
+ if (!predicate || predicate(animation)) {
228
+ targetAnimations.push(new RuntimeAnimation(linkedTarget, animation, this._scene, this));
229
+ }
219
230
  }
220
231
  }
221
232
  }
@@ -346,12 +357,29 @@ export class Animatable {
346
357
  continue;
347
358
  }
348
359
  runtimeAnimation.dispose();
349
- runtimeAnimations.splice(index, 1);
360
+ if (this._runtimeAnimations.includes(runtimeAnimation)) {
361
+ this._runtimeAnimations.splice(this._runtimeAnimations.indexOf(runtimeAnimation), 1);
362
+ }
363
+ else {
364
+ for (const animations of Array.from(this._linkedTargetRuntimeAnimationsMap.values())) {
365
+ if (animations.includes(runtimeAnimation)) {
366
+ animations.splice(animations.indexOf(runtimeAnimation), 1);
367
+ }
368
+ }
369
+ }
370
+ }
371
+ for (const [linkedTarget, animations] of Array.from(this._linkedTargetRuntimeAnimationsMap.entries())) {
372
+ if (!animations || !animations.length) {
373
+ this._linkedTargetRuntimeAnimationsMap.delete(linkedTarget);
374
+ this._linkedTargetAnimationPredicate.delete(linkedTarget);
375
+ }
350
376
  }
351
- if (runtimeAnimations.length == 0) {
377
+ if (this._runtimeAnimations.length == 0) {
352
378
  if (!useGlobalSplice) {
353
379
  this._scene._activeAnimatables.splice(idx, 1);
354
380
  }
381
+ this._linkedTargetRuntimeAnimationsMap.clear();
382
+ this._linkedTargetAnimationPredicate.clear();
355
383
  if (!skipOnAnimationEnd) {
356
384
  this._raiseOnAnimationEnd();
357
385
  }
@@ -369,6 +397,8 @@ export class Animatable {
369
397
  runtimeAnimations[index].dispose();
370
398
  }
371
399
  this._runtimeAnimations.length = 0;
400
+ this._linkedTargetRuntimeAnimationsMap.clear();
401
+ this._linkedTargetAnimationPredicate.clear();
372
402
  if (!skipOnAnimationEnd) {
373
403
  this._raiseOnAnimationEnd();
374
404
  }
@@ -1 +1 @@
1
- {"version":3,"file":"animatable.core.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animatable.core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAIjF;;GAEG;AACH,MAAM,OAAO,UAAU;IA4CnB;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACH,IAAW,WAAW;QAClB,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,CAAC;QACb,CAAC;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,C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BACnD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;YAChD,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;IAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,UAAU,MAAW,EAAE,aAAsB,EAAE,UAAqC;QACrH,MAAM,WAAW,GAAG,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAE3D,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC,CAAC;IAEF,UAAU,CAAC,SAAS,CAAC,iBAAiB,GAAG;QACrC,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtD,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;YAChE,CAAC;YACD,IAAI,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;QACvC,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { Observable } from \"core/Misc/observable\";\r\nimport { type Scene } from \"core/scene\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { RuntimeAnimation } from \"./runtimeAnimation\";\r\nimport { Animation } from \"./animation\";\r\nimport { PrecisionDate } from \"core/Misc/precisionDate\";\r\nimport { Matrix, Quaternion, TmpVectors, Vector3 } from \"core/Maths/math.vector\";\r\nimport { type Bone } from \"core/Bones/bone\";\r\nimport { type Node } from \"../node\";\r\n\r\n/**\r\n * Class used to store an actual running animation\r\n */\r\nexport class Animatable {\r\n /**\r\n * If true, the animatable will be processed even if it is considered actively paused (weight of 0 and previous weight of 0).\r\n * This can be used to force the full processing of paused animatables in the animation engine.\r\n * Default is false.\r\n */\r\n public static ProcessPausedAnimatables = false;\r\n\r\n private _localDelayOffset: Nullable<number> = null;\r\n private _pausedDelay: Nullable<number> = null;\r\n private _manualJumpDelay: Nullable<number> = null;\r\n /** @hidden */\r\n public _runtimeAnimations = new Array<RuntimeAnimation>();\r\n private _paused = false;\r\n private _scene: Scene;\r\n private _speedRatio = 1;\r\n private _weight = -1.0;\r\n private _previousWeight = -1.0;\r\n private _syncRoot: Nullable<Animatable> = null;\r\n private _frameToSyncFromJump: Nullable<number> = null;\r\n private _goToFrame: Nullable<number> = null;\r\n private _linkedTargetRuntimeAnimationsMap = new Map<any, RuntimeAnimation[]>();\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation.\r\n * This will only apply for non looping animation (default is true)\r\n */\r\n public disposeOnEnd = true;\r\n\r\n /**\r\n * Gets a boolean indicating if the animation has started\r\n */\r\n public animationStarted = false;\r\n\r\n /**\r\n * Observer raised when the animation ends\r\n */\r\n public onAnimationEndObservable = new Observable<Animatable>();\r\n\r\n /**\r\n * Observer raised when the animation loops\r\n */\r\n public onAnimationLoopObservable = new Observable<Animatable>();\r\n\r\n /**\r\n * Gets the root Animatable used to synchronize and normalize animations\r\n */\r\n public get syncRoot(): Nullable<Animatable> {\r\n return this._syncRoot;\r\n }\r\n\r\n /**\r\n * Gets the current frame of the first RuntimeAnimation\r\n * Used to synchronize Animatables\r\n */\r\n public get masterFrame(): number {\r\n if (this._runtimeAnimations.length === 0) {\r\n return 0;\r\n }\r\n\r\n return this._runtimeAnimations[0].currentFrame;\r\n }\r\n\r\n /**\r\n * Gets or sets the animatable weight (-1.0 by default meaning not weighted)\r\n */\r\n public get weight(): number {\r\n return this._weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n if (value === -1) {\r\n // -1 is ok and means no weight\r\n this._weight = -1;\r\n return;\r\n }\r\n\r\n // Else weight must be in [0, 1] range\r\n this._weight = Math.min(Math.max(value, 0), 1.0);\r\n }\r\n\r\n /**\r\n * Gets or sets the speed ratio to apply to the animatable (1.0 by default)\r\n */\r\n public get speedRatio(): number {\r\n return this._speedRatio;\r\n }\r\n\r\n public set speedRatio(value: number) {\r\n for (let index = 0; index < this._runtimeAnimations.length; index++) {\r\n const animation = this._runtimeAnimations[index];\r\n\r\n animation._prepareForSpeedRatioChange(value);\r\n }\r\n this._speedRatio = value;\r\n\r\n // Resync _manualJumpDelay in case goToFrame was called before speedRatio was set.\r\n if (this._goToFrame !== null) {\r\n this.goToFrame(this._goToFrame);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the elapsed time since the animatable started in milliseconds\r\n */\r\n public get elapsedTime(): number {\r\n return this._localDelayOffset === null ? 0 : this._scene._animationTime - this._localDelayOffset;\r\n }\r\n\r\n /**\r\n * Creates a new Animatable\r\n * @param scene defines the hosting scene\r\n * @param target defines the target object\r\n * @param fromFrame defines the starting frame number (default is 0)\r\n * @param toFrame defines the ending frame number (default is 100)\r\n * @param loopAnimation defines if the animation must loop (default is false)\r\n * @param speedRatio defines the factor to apply to animation speed (default is 1)\r\n * @param onAnimationEnd defines a callback to call when animation ends if it is not looping\r\n * @param animations defines a group of animation to add to the new Animatable\r\n * @param onAnimationLoop defines a callback to call when animation loops\r\n * @param isAdditive defines whether the animation should be evaluated additively\r\n * @param playOrder defines the order in which this animatable should be processed in the list of active animatables (default: 0)\r\n */\r\n constructor(\r\n scene: Scene,\r\n /** defines the target object */\r\n public target: any,\r\n /** [0] defines the starting frame number (default is 0) */\r\n public fromFrame: number = 0,\r\n /** [100] defines the ending frame number (default is 100) */\r\n public toFrame: number = 100,\r\n /** [false] defines if the animation must loop (default is false) */\r\n public loopAnimation: boolean = false,\r\n speedRatio: number = 1.0,\r\n /** defines a callback to call when animation ends if it is not looping */\r\n public onAnimationEnd?: Nullable<() => void>,\r\n animations?: Animation[],\r\n /** defines a callback to call when animation loops */\r\n public onAnimationLoop?: Nullable<() => void>,\r\n /** [false] defines whether the animation should be evaluated additively */\r\n public isAdditive: boolean = false,\r\n /** [0] defines the order in which this animatable should be processed in the list of active animatables (default: 0) */\r\n public playOrder = 0\r\n ) {\r\n this._scene = scene;\r\n if (animations) {\r\n this.appendAnimations(target, animations);\r\n }\r\n\r\n this._speedRatio = speedRatio;\r\n scene._activeAnimatables.push(this);\r\n }\r\n\r\n // Methods\r\n /**\r\n * Synchronize and normalize current Animatable with a source Animatable\r\n * This is useful when using animation weights and when animations are not of the same length\r\n * @param root defines the root Animatable to synchronize with (null to stop synchronizing)\r\n * @returns the current Animatable\r\n */\r\n public syncWith(root: Nullable<Animatable>): Animatable {\r\n this._syncRoot = root;\r\n\r\n if (root) {\r\n // Make sure this animatable will animate after the root\r\n const index = this._scene._activeAnimatables.indexOf(this);\r\n if (index > -1) {\r\n this._scene._activeAnimatables.splice(index, 1);\r\n this._scene._activeAnimatables.push(this);\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a target that run the same animations with the origin target\r\n * @param target\r\n */\r\n public addLinkedTarget(target: any) {\r\n if (!this._linkedTargetRuntimeAnimationsMap.has(target)) {\r\n const runtimeAnimations: RuntimeAnimation[] = [];\r\n for (let index = 0; index < this._runtimeAnimations.length; index++) {\r\n const animation = this._runtimeAnimations[index].animation;\r\n const newRuntimeAnimation = new RuntimeAnimation(target, animation, this._scene, this);\r\n runtimeAnimations.push(newRuntimeAnimation);\r\n }\r\n this._linkedTargetRuntimeAnimationsMap.set(target, runtimeAnimations);\r\n }\r\n }\r\n\r\n /**\r\n * Remove a target that run the same animations with the origin target\r\n * @param target\r\n */\r\n public removeLinkedTarget(target: any) {\r\n if (this._linkedTargetRuntimeAnimationsMap.has(target)) {\r\n const runtimeAnimations = this._linkedTargetRuntimeAnimationsMap.get(target);\r\n runtimeAnimations!.forEach((runtimeAnimation) => {\r\n runtimeAnimation.dispose();\r\n });\r\n this._linkedTargetRuntimeAnimationsMap.delete(target);\r\n }\r\n }\r\n\r\n private _getAllLinkedTargetRuntimeAnimations(): RuntimeAnimation[] {\r\n return Array.from(this._linkedTargetRuntimeAnimationsMap.values()).flat();\r\n }\r\n\r\n private _getAllRuntimeAnimations(): RuntimeAnimation[] {\r\n return [...this._runtimeAnimations, ...this._getAllLinkedTargetRuntimeAnimations()];\r\n }\r\n\r\n /**\r\n * Gets the list of runtime animations\r\n * @returns an array of RuntimeAnimation\r\n */\r\n public getAnimations(): RuntimeAnimation[] {\r\n return this._runtimeAnimations;\r\n }\r\n\r\n /**\r\n * Adds more animations to the current animatable\r\n * @param target defines the target of the animations\r\n * @param animations defines the new animations to add\r\n */\r\n public appendAnimations(target: any, animations: Animation[]): void {\r\n for (let index = 0; index < animations.length; index++) {\r\n const animation = animations[index];\r\n\r\n const newRuntimeAnimation = new RuntimeAnimation(target, animation, this._scene, this);\r\n newRuntimeAnimation._onLoop = () => {\r\n this.onAnimationLoopObservable.notifyObservers(this);\r\n if (this.onAnimationLoop) {\r\n this.onAnimationLoop();\r\n }\r\n };\r\n\r\n this._runtimeAnimations.push(newRuntimeAnimation);\r\n const entries = Array.from(this._linkedTargetRuntimeAnimationsMap.entries());\r\n for (const [linkedTarget, targetAnimations] of entries) {\r\n targetAnimations.push(new RuntimeAnimation(linkedTarget, animation, this._scene, this));\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the source animation for a specific property\r\n * @param property defines the property to look for\r\n * @returns null or the source animation for the given property\r\n */\r\n public getAnimationByTargetProperty(property: string): Nullable<Animation> {\r\n const runtimeAnimations = this._runtimeAnimations;\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n if (runtimeAnimations[index].animation.targetProperty === property) {\r\n return runtimeAnimations[index].animation;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the runtime animation for a specific property\r\n * @param property defines the property to look for\r\n * @returns null or the runtime animation for the given property\r\n */\r\n public getRuntimeAnimationByTargetProperty(property: string): Nullable<RuntimeAnimation> {\r\n const runtimeAnimations = this._runtimeAnimations;\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n if (runtimeAnimations[index].animation.targetProperty === property) {\r\n return runtimeAnimations[index];\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Resets the animatable to its original state\r\n */\r\n public reset(): void {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].reset(true);\r\n }\r\n\r\n this._localDelayOffset = null;\r\n this._pausedDelay = null;\r\n }\r\n\r\n /**\r\n * Allows the animatable to blend with current running animations\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending\r\n * @param blendingSpeed defines the blending speed to use\r\n */\r\n public enableBlending(blendingSpeed: number): void {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].animation.enableBlending = true;\r\n runtimeAnimations[index].animation.blendingSpeed = blendingSpeed;\r\n }\r\n }\r\n\r\n /**\r\n * Disable animation blending\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending\r\n */\r\n public disableBlending(): void {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].animation.enableBlending = false;\r\n }\r\n }\r\n\r\n /**\r\n * Jump directly to a given frame\r\n * @param frame defines the frame to jump to\r\n * @param useWeight defines whether the animation weight should be applied to the image to be jumped to (false by default)\r\n */\r\n public goToFrame(frame: number, useWeight = false): void {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n if (runtimeAnimations[0]) {\r\n const fps = runtimeAnimations[0].animation.framePerSecond;\r\n this._frameToSyncFromJump = this._frameToSyncFromJump ?? runtimeAnimations[0].currentFrame;\r\n const delay = this.speedRatio === 0 ? 0 : (((frame - this._frameToSyncFromJump) / fps) * 1000) / this.speedRatio;\r\n this._manualJumpDelay = -delay;\r\n }\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].goToFrame(frame, useWeight ? this._weight : -1);\r\n }\r\n\r\n this._goToFrame = frame;\r\n }\r\n\r\n /**\r\n * Returns true if the animations for this animatable are paused\r\n */\r\n public get paused() {\r\n return this._paused;\r\n }\r\n\r\n /**\r\n * Pause the animation\r\n */\r\n public pause(): void {\r\n if (this._paused) {\r\n return;\r\n }\r\n this._paused = true;\r\n }\r\n\r\n /**\r\n * Restart the animation\r\n */\r\n public restart(): void {\r\n this._paused = false;\r\n }\r\n\r\n private _raiseOnAnimationEnd() {\r\n if (this.onAnimationEnd) {\r\n this.onAnimationEnd();\r\n }\r\n\r\n this.onAnimationEndObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Stop and delete the current animation\r\n * @param animationName defines a string used to only stop some of the runtime animations instead of all\r\n * @param targetMask a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)\r\n * @param useGlobalSplice if true, the animatables will be removed by the caller of this function (false by default)\r\n * @param skipOnAnimationEnd defines if the system should not raise onAnimationEnd. Default is false\r\n */\r\n public stop(animationName?: string, targetMask?: (target: any) => boolean, useGlobalSplice = false, skipOnAnimationEnd = false): void {\r\n if (animationName || targetMask) {\r\n const idx = this._scene._activeAnimatables.indexOf(this);\r\n\r\n if (idx > -1) {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = runtimeAnimations.length - 1; index >= 0; index--) {\r\n const runtimeAnimation = runtimeAnimations[index];\r\n if (animationName && runtimeAnimation.animation.name != animationName) {\r\n continue;\r\n }\r\n if (targetMask && !targetMask(runtimeAnimation.target)) {\r\n continue;\r\n }\r\n\r\n runtimeAnimation.dispose();\r\n runtimeAnimations.splice(index, 1);\r\n }\r\n\r\n if (runtimeAnimations.length == 0) {\r\n if (!useGlobalSplice) {\r\n this._scene._activeAnimatables.splice(idx, 1);\r\n }\r\n if (!skipOnAnimationEnd) {\r\n this._raiseOnAnimationEnd();\r\n }\r\n }\r\n }\r\n } else {\r\n const index = this._scene._activeAnimatables.indexOf(this);\r\n\r\n if (index > -1) {\r\n if (!useGlobalSplice) {\r\n this._scene._activeAnimatables.splice(index, 1);\r\n }\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].dispose();\r\n }\r\n\r\n this._runtimeAnimations.length = 0;\r\n\r\n if (!skipOnAnimationEnd) {\r\n this._raiseOnAnimationEnd();\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Wait asynchronously for the animation to end\r\n * @returns a promise which will be fulfilled when the animation ends\r\n */\r\n public async waitAsync(): Promise<Animatable> {\r\n return await new Promise((resolve) => {\r\n this.onAnimationEndObservable.add(\r\n () => {\r\n resolve(this);\r\n },\r\n undefined,\r\n undefined,\r\n this,\r\n true\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _animate(delay: number): boolean {\r\n if (this._paused) {\r\n this.animationStarted = false;\r\n if (this._pausedDelay === null) {\r\n this._pausedDelay = delay;\r\n }\r\n return true;\r\n }\r\n\r\n if (this._localDelayOffset === null) {\r\n this._localDelayOffset = delay;\r\n this._pausedDelay = null;\r\n } else if (this._pausedDelay !== null) {\r\n this._localDelayOffset += delay - this._pausedDelay;\r\n this._pausedDelay = null;\r\n }\r\n\r\n if (this._manualJumpDelay !== null) {\r\n this._localDelayOffset += this.speedRatio < 0 ? -this._manualJumpDelay : this._manualJumpDelay;\r\n this._manualJumpDelay = null;\r\n this._frameToSyncFromJump = null;\r\n }\r\n\r\n this._goToFrame = null;\r\n\r\n if (!Animatable.ProcessPausedAnimatables && this._weight === 0 && this._previousWeight === 0) {\r\n // We consider that an animatable with a weight === 0 is \"actively\" paused\r\n return true;\r\n }\r\n\r\n this._previousWeight = this._weight;\r\n\r\n // Animating\r\n let running = false;\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n let index: number;\r\n\r\n for (index = 0; index < runtimeAnimations.length; index++) {\r\n const animation = runtimeAnimations[index];\r\n const isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight);\r\n running = running || isRunning;\r\n }\r\n\r\n this.animationStarted = running;\r\n\r\n if (!running) {\r\n if (this.disposeOnEnd) {\r\n // Remove from active animatables\r\n index = this._scene._activeAnimatables.indexOf(this);\r\n this._scene._activeAnimatables.splice(index, 1);\r\n\r\n // Dispose all runtime animations\r\n for (index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].dispose();\r\n }\r\n }\r\n\r\n this._raiseOnAnimationEnd();\r\n\r\n if (this.disposeOnEnd) {\r\n this.onAnimationEnd = null;\r\n this.onAnimationLoop = null;\r\n this.onAnimationLoopObservable.clear();\r\n this.onAnimationEndObservable.clear();\r\n }\r\n }\r\n\r\n return running;\r\n }\r\n}\r\n\r\n/** @internal */\r\nfunction ProcessLateAnimationBindingsForMatrices(holder: {\r\n totalWeight: number;\r\n totalAdditiveWeight: number;\r\n animations: RuntimeAnimation[];\r\n additiveAnimations: RuntimeAnimation[];\r\n originalValue: Matrix;\r\n}): any {\r\n if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) {\r\n return holder.originalValue;\r\n }\r\n\r\n let normalizer = 1.0;\r\n const finalPosition = TmpVectors.Vector3[0];\r\n const finalScaling = TmpVectors.Vector3[1];\r\n const finalQuaternion = TmpVectors.Quaternion[0];\r\n let startIndex = 0;\r\n const originalAnimation = holder.animations[0];\r\n const originalValue = holder.originalValue;\r\n\r\n let scale: number;\r\n let skipOverride = false;\r\n if (holder.totalWeight < 1.0) {\r\n // We need to mix the original value in\r\n scale = 1.0 - holder.totalWeight;\r\n originalValue.decompose(finalScaling, finalQuaternion, finalPosition);\r\n } else {\r\n startIndex = 1;\r\n // We need to normalize the weights\r\n normalizer = holder.totalWeight;\r\n scale = originalAnimation.weight / normalizer;\r\n if (scale == 1) {\r\n if (holder.totalAdditiveWeight) {\r\n skipOverride = true;\r\n } else {\r\n return originalAnimation.currentValue;\r\n }\r\n }\r\n\r\n originalAnimation.currentValue.decompose(finalScaling, finalQuaternion, finalPosition);\r\n }\r\n\r\n // Add up the override animations\r\n if (!skipOverride) {\r\n finalScaling.scaleInPlace(scale);\r\n finalPosition.scaleInPlace(scale);\r\n finalQuaternion.scaleInPlace(scale);\r\n\r\n for (let animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {\r\n const runtimeAnimation = holder.animations[animIndex];\r\n if (runtimeAnimation.weight === 0) {\r\n continue;\r\n }\r\n\r\n scale = runtimeAnimation.weight / normalizer;\r\n const currentPosition = TmpVectors.Vector3[2];\r\n const currentScaling = TmpVectors.Vector3[3];\r\n const currentQuaternion = TmpVectors.Quaternion[1];\r\n\r\n runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition);\r\n\r\n currentScaling.scaleAndAddToRef(scale, finalScaling);\r\n currentQuaternion.scaleAndAddToRef(Quaternion.Dot(finalQuaternion, currentQuaternion) > 0 ? scale : -scale, finalQuaternion);\r\n currentPosition.scaleAndAddToRef(scale, finalPosition);\r\n }\r\n\r\n finalQuaternion.normalize();\r\n }\r\n\r\n // Add up the additive animations\r\n for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {\r\n const runtimeAnimation = holder.additiveAnimations[animIndex];\r\n if (runtimeAnimation.weight === 0) {\r\n continue;\r\n }\r\n\r\n const currentPosition = TmpVectors.Vector3[2];\r\n const currentScaling = TmpVectors.Vector3[3];\r\n const currentQuaternion = TmpVectors.Quaternion[1];\r\n\r\n runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition);\r\n currentScaling.multiplyToRef(finalScaling, currentScaling);\r\n Vector3.LerpToRef(finalScaling, currentScaling, runtimeAnimation.weight, finalScaling);\r\n finalQuaternion.multiplyToRef(currentQuaternion, currentQuaternion);\r\n Quaternion.SlerpToRef(finalQuaternion, currentQuaternion, runtimeAnimation.weight, finalQuaternion);\r\n currentPosition.scaleAndAddToRef(runtimeAnimation.weight, finalPosition);\r\n }\r\n\r\n const workValue = originalAnimation ? originalAnimation._animationState.workValue : TmpVectors.Matrix[0].clone();\r\n Matrix.ComposeToRef(finalScaling, finalQuaternion, finalPosition, workValue);\r\n return workValue;\r\n}\r\n\r\n/** @internal */\r\nfunction ProcessLateAnimationBindingsForQuaternions(\r\n holder: {\r\n totalWeight: number;\r\n totalAdditiveWeight: number;\r\n animations: RuntimeAnimation[];\r\n additiveAnimations: RuntimeAnimation[];\r\n originalValue: Quaternion;\r\n },\r\n refQuaternion: Quaternion\r\n): Quaternion {\r\n if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) {\r\n return refQuaternion;\r\n }\r\n\r\n const originalAnimation = holder.animations[0];\r\n const originalValue = holder.originalValue;\r\n let cumulativeQuaternion = refQuaternion;\r\n\r\n if (holder.totalWeight === 0 && holder.totalAdditiveWeight > 0) {\r\n cumulativeQuaternion.copyFrom(originalValue);\r\n } else if (holder.animations.length === 1) {\r\n Quaternion.SlerpToRef(originalValue, originalAnimation.currentValue, Math.min(1.0, holder.totalWeight), cumulativeQuaternion);\r\n\r\n if (holder.totalAdditiveWeight === 0) {\r\n return cumulativeQuaternion;\r\n }\r\n } else if (holder.animations.length > 1) {\r\n // Add up the override animations\r\n let normalizer = 1.0;\r\n let quaternions: Array<Quaternion>;\r\n let weights: Array<number>;\r\n\r\n if (holder.totalWeight < 1.0) {\r\n const scale = 1.0 - holder.totalWeight;\r\n\r\n quaternions = [];\r\n weights = [];\r\n\r\n quaternions.push(originalValue);\r\n weights.push(scale);\r\n } else {\r\n if (holder.animations.length === 2) {\r\n // Slerp as soon as we can\r\n Quaternion.SlerpToRef(holder.animations[0].currentValue, holder.animations[1].currentValue, holder.animations[1].weight / holder.totalWeight, refQuaternion);\r\n\r\n if (holder.totalAdditiveWeight === 0) {\r\n return refQuaternion;\r\n }\r\n }\r\n\r\n quaternions = [];\r\n weights = [];\r\n normalizer = holder.totalWeight;\r\n }\r\n\r\n for (let animIndex = 0; animIndex < holder.animations.length; animIndex++) {\r\n const runtimeAnimation = holder.animations[animIndex];\r\n quaternions.push(runtimeAnimation.currentValue);\r\n weights.push(runtimeAnimation.weight / normalizer);\r\n }\r\n\r\n // https://gamedev.stackexchange.com/questions/62354/method-for-interpolation-between-3-quaternions\r\n\r\n let cumulativeAmount = 0;\r\n for (let index = 0; index < quaternions.length; ) {\r\n if (!index) {\r\n Quaternion.SlerpToRef(quaternions[index], quaternions[index + 1], weights[index + 1] / (weights[index] + weights[index + 1]), refQuaternion);\r\n cumulativeQuaternion = refQuaternion;\r\n cumulativeAmount = weights[index] + weights[index + 1];\r\n index += 2;\r\n continue;\r\n }\r\n cumulativeAmount += weights[index];\r\n Quaternion.SlerpToRef(cumulativeQuaternion, quaternions[index], weights[index] / cumulativeAmount, cumulativeQuaternion);\r\n index++;\r\n }\r\n }\r\n\r\n // Add up the additive animations\r\n for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {\r\n const runtimeAnimation = holder.additiveAnimations[animIndex];\r\n if (runtimeAnimation.weight === 0) {\r\n continue;\r\n }\r\n\r\n cumulativeQuaternion.multiplyToRef(runtimeAnimation.currentValue, TmpVectors.Quaternion[0]);\r\n Quaternion.SlerpToRef(cumulativeQuaternion, TmpVectors.Quaternion[0], runtimeAnimation.weight, cumulativeQuaternion);\r\n }\r\n\r\n return cumulativeQuaternion;\r\n}\r\n\r\n/** @internal */\r\nfunction ProcessLateAnimationBindings(scene: Scene): void {\r\n if (!scene._registeredForLateAnimationBindings.length) {\r\n return;\r\n }\r\n for (let index = 0; index < scene._registeredForLateAnimationBindings.length; index++) {\r\n const target = scene._registeredForLateAnimationBindings.data[index];\r\n\r\n for (const path in target._lateAnimationHolders) {\r\n const holder = target._lateAnimationHolders[path];\r\n const originalAnimation: RuntimeAnimation = holder.animations[0];\r\n const originalValue = holder.originalValue;\r\n if (originalValue === undefined || originalValue === null) {\r\n continue;\r\n }\r\n const matrixDecomposeMode = Animation.AllowMatrixDecomposeForInterpolation && originalValue.m; // ie. data is matrix\r\n\r\n let finalValue: any = target[path];\r\n if (matrixDecomposeMode) {\r\n finalValue = ProcessLateAnimationBindingsForMatrices(holder);\r\n } else {\r\n const quaternionMode = originalValue.w !== undefined;\r\n if (quaternionMode) {\r\n finalValue = ProcessLateAnimationBindingsForQuaternions(holder, finalValue || Quaternion.Identity());\r\n } else {\r\n let startIndex = 0;\r\n let normalizer = 1.0;\r\n\r\n const originalAnimationIsLoopRelativeFromCurrent =\r\n originalAnimation && originalAnimation._animationState.loopMode === Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;\r\n\r\n if (holder.totalWeight < 1.0) {\r\n // We need to mix the original value in\r\n if (originalAnimationIsLoopRelativeFromCurrent) {\r\n finalValue = originalValue.clone ? originalValue.clone() : originalValue;\r\n } else if (originalAnimation && originalValue.scale) {\r\n finalValue = originalValue.scale(1.0 - holder.totalWeight);\r\n } else if (originalAnimation) {\r\n finalValue = originalValue * (1.0 - holder.totalWeight);\r\n } else if (originalValue.clone) {\r\n finalValue = originalValue.clone();\r\n } else {\r\n finalValue = originalValue;\r\n }\r\n } else if (originalAnimation) {\r\n // We need to normalize the weights\r\n normalizer = holder.totalWeight;\r\n const scale = originalAnimation.weight / normalizer;\r\n if (scale !== 1) {\r\n if (originalAnimation.currentValue.scale) {\r\n finalValue = originalAnimation.currentValue.scale(scale);\r\n } else {\r\n finalValue = originalAnimation.currentValue * scale;\r\n }\r\n } else {\r\n finalValue = originalAnimation.currentValue;\r\n }\r\n\r\n if (originalAnimationIsLoopRelativeFromCurrent) {\r\n if (finalValue.addToRef) {\r\n finalValue.addToRef(originalValue, finalValue);\r\n } else {\r\n finalValue += originalValue;\r\n }\r\n }\r\n\r\n startIndex = 1;\r\n }\r\n\r\n // Add up the override animations\r\n for (let animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {\r\n const runtimeAnimation = holder.animations[animIndex];\r\n const scale = runtimeAnimation.weight / normalizer;\r\n\r\n if (!scale) {\r\n continue;\r\n } else if (runtimeAnimation.currentValue.scaleAndAddToRef) {\r\n runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue);\r\n } else {\r\n finalValue += runtimeAnimation.currentValue * scale;\r\n }\r\n }\r\n\r\n // Add up the additive animations\r\n for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {\r\n const runtimeAnimation = holder.additiveAnimations[animIndex];\r\n const scale: number = runtimeAnimation.weight;\r\n\r\n if (!scale) {\r\n continue;\r\n } else if (runtimeAnimation.currentValue.scaleAndAddToRef) {\r\n runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue);\r\n } else {\r\n finalValue += runtimeAnimation.currentValue * scale;\r\n }\r\n }\r\n }\r\n }\r\n target[path] = finalValue;\r\n }\r\n\r\n target._lateAnimationHolders = {};\r\n }\r\n scene._registeredForLateAnimationBindings.reset();\r\n}\r\n\r\n/** @internal */\r\nexport function RegisterTargetForLateAnimationBinding(scene: Scene, runtimeAnimation: RuntimeAnimation, originalValue: any): void {\r\n const target = runtimeAnimation.target;\r\n scene._registeredForLateAnimationBindings.pushNoDuplicate(target);\r\n\r\n if (!target._lateAnimationHolders) {\r\n target._lateAnimationHolders = {};\r\n }\r\n\r\n if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath] = {\r\n totalWeight: 0,\r\n totalAdditiveWeight: 0,\r\n animations: [],\r\n additiveAnimations: [],\r\n originalValue: originalValue,\r\n };\r\n }\r\n\r\n if (runtimeAnimation.isAdditive) {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].additiveAnimations.push(runtimeAnimation);\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].totalAdditiveWeight += runtimeAnimation.weight;\r\n } else {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation);\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight;\r\n }\r\n}\r\n\r\n/**\r\n * Initialize all the inter dependecies between the animations and Scene and Bone\r\n * @param sceneClass defines the scene prototype to use\r\n * @param boneClass defines the bone prototype to use\r\n */\r\nexport function AddAnimationExtensions(sceneClass: typeof Scene, boneClass: typeof Bone): void {\r\n if (boneClass) {\r\n boneClass.prototype.copyAnimationRange = function (\r\n source: Bone,\r\n rangeName: string,\r\n frameOffset: number,\r\n rescaleAsRequired = false,\r\n skelDimensionsRatio: Nullable<Vector3> = null\r\n ): boolean {\r\n // all animation may be coming from a library skeleton, so may need to create animation\r\n if (this.animations.length === 0) {\r\n this.animations.push(new Animation(this.name, \"_matrix\", source.animations[0].framePerSecond, Animation.ANIMATIONTYPE_MATRIX, 0));\r\n this.animations[0].setKeys([]);\r\n }\r\n\r\n // get animation info / verify there is such a range from the source bone\r\n const sourceRange = source.animations[0].getRange(rangeName);\r\n if (!sourceRange) {\r\n return false;\r\n }\r\n const from = sourceRange.from;\r\n const to = sourceRange.to;\r\n const sourceKeys = source.animations[0].getKeys();\r\n\r\n // rescaling prep\r\n const sourceBoneLength = source.length;\r\n const sourceParent = source.getParent();\r\n const parent = this.getParent();\r\n const parentScalingReqd = rescaleAsRequired && sourceParent && sourceBoneLength && this.length && sourceBoneLength !== this.length;\r\n const parentRatio = parentScalingReqd && parent && sourceParent ? parent.length / sourceParent.length : 1;\r\n\r\n const dimensionsScalingReqd =\r\n rescaleAsRequired && !parent && skelDimensionsRatio && (skelDimensionsRatio.x !== 1 || skelDimensionsRatio.y !== 1 || skelDimensionsRatio.z !== 1);\r\n\r\n const destKeys = this.animations[0].getKeys();\r\n\r\n // loop vars declaration\r\n let orig: { frame: number; value: Matrix };\r\n let origTranslation: Vector3;\r\n let mat: Matrix;\r\n\r\n for (let key = 0, nKeys = sourceKeys.length; key < nKeys; key++) {\r\n orig = sourceKeys[key];\r\n if (orig.frame >= from && orig.frame <= to) {\r\n if (rescaleAsRequired) {\r\n mat = orig.value.clone();\r\n\r\n // scale based on parent ratio, when bone has parent\r\n if (parentScalingReqd) {\r\n origTranslation = mat.getTranslation();\r\n mat.setTranslation(origTranslation.scaleInPlace(parentRatio));\r\n\r\n // scale based on skeleton dimension ratio when root bone, and value is passed\r\n } else if (dimensionsScalingReqd && skelDimensionsRatio) {\r\n origTranslation = mat.getTranslation();\r\n mat.setTranslation(origTranslation.multiplyInPlace(skelDimensionsRatio));\r\n\r\n // use original when root bone, and no data for skelDimensionsRatio\r\n } else {\r\n mat = orig.value;\r\n }\r\n } else {\r\n mat = orig.value;\r\n }\r\n destKeys.push({ frame: orig.frame + frameOffset, value: mat });\r\n }\r\n }\r\n this.animations[0].createRange(rangeName, from + frameOffset, to + frameOffset);\r\n return true;\r\n };\r\n }\r\n\r\n if (!sceneClass) {\r\n return;\r\n }\r\n\r\n sceneClass.prototype._animate = function (customDeltaTime?: number): void {\r\n if (!this.animationsEnabled) {\r\n return;\r\n }\r\n\r\n // Getting time\r\n const now = PrecisionDate.Now;\r\n if (!this._animationTimeLast) {\r\n if (this._pendingData.length > 0) {\r\n return;\r\n }\r\n this._animationTimeLast = now;\r\n }\r\n\r\n this.deltaTime = customDeltaTime !== undefined ? customDeltaTime : this.useConstantAnimationDeltaTime ? 16.0 : (now - this._animationTimeLast) * this.animationTimeScale;\r\n this._animationTimeLast = now;\r\n\r\n const animatables = this._activeAnimatables;\r\n if (animatables.length === 0) {\r\n return;\r\n }\r\n\r\n this._animationTime += this.deltaTime;\r\n const animationTime = this._animationTime;\r\n\r\n for (let index = 0; index < animatables.length; index++) {\r\n const animatable = animatables[index];\r\n\r\n if (!animatable._animate(animationTime) && animatable.disposeOnEnd) {\r\n index--; // Array was updated\r\n }\r\n }\r\n\r\n // Late animation bindings\r\n ProcessLateAnimationBindings(this);\r\n };\r\n\r\n sceneClass.prototype.sortActiveAnimatables = function (): void {\r\n this._activeAnimatables.sort((a, b) => {\r\n return a.playOrder - b.playOrder;\r\n });\r\n };\r\n\r\n sceneClass.prototype.beginWeightedAnimation = function (\r\n target: any,\r\n from: number,\r\n to: number,\r\n weight = 1.0,\r\n loop?: boolean,\r\n speedRatio: number = 1.0,\r\n onAnimationEnd?: () => void,\r\n animatable?: Animatable,\r\n targetMask?: (target: any) => boolean,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable {\r\n const returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, false, targetMask, onAnimationLoop, isAdditive);\r\n returnedAnimatable.weight = weight;\r\n\r\n return returnedAnimatable;\r\n };\r\n\r\n sceneClass.prototype.beginAnimation = function (\r\n target: any,\r\n from: number,\r\n to: number,\r\n loop?: boolean,\r\n speedRatio: number = 1.0,\r\n onAnimationEnd?: () => void,\r\n animatable?: Animatable,\r\n stopCurrent = true,\r\n targetMask?: (target: any) => boolean,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable {\r\n // get speed speedRatio, to and from, based on the sign and value(s)\r\n if (speedRatio < 0) {\r\n const tmp = from;\r\n from = to;\r\n to = tmp;\r\n speedRatio = -speedRatio;\r\n }\r\n // if from > to switch speed ratio\r\n if (from > to) {\r\n speedRatio = -speedRatio;\r\n }\r\n if (stopCurrent) {\r\n this.stopAnimation(target, undefined, targetMask);\r\n }\r\n\r\n if (!animatable) {\r\n animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, undefined, onAnimationLoop, isAdditive);\r\n }\r\n\r\n const shouldRunTargetAnimations = targetMask ? targetMask(target) : true;\r\n // Local animations\r\n if (target.animations && shouldRunTargetAnimations) {\r\n animatable.appendAnimations(target, target.animations);\r\n }\r\n\r\n // Children animations\r\n if (target.getAnimatables) {\r\n const animatables = target.getAnimatables();\r\n for (let index = 0; index < animatables.length; index++) {\r\n this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, onAnimationLoop);\r\n }\r\n }\r\n\r\n animatable.reset();\r\n\r\n return animatable;\r\n };\r\n\r\n sceneClass.prototype.beginHierarchyAnimation = function (\r\n target: any,\r\n directDescendantsOnly: boolean,\r\n from: number,\r\n to: number,\r\n loop?: boolean,\r\n speedRatio: number = 1.0,\r\n onAnimationEnd?: () => void,\r\n animatable?: Animatable,\r\n stopCurrent = true,\r\n targetMask?: (target: any) => boolean,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable[] {\r\n const children = target.getDescendants(directDescendantsOnly);\r\n\r\n const result = [];\r\n result.push(this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive));\r\n for (const child of children) {\r\n result.push(this.beginAnimation(child, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive));\r\n }\r\n\r\n return result;\r\n };\r\n\r\n sceneClass.prototype.beginDirectAnimation = function (\r\n target: any,\r\n animations: Animation[],\r\n from: number,\r\n to: number,\r\n loop?: boolean,\r\n speedRatio: number = 1.0,\r\n onAnimationEnd?: () => void,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable {\r\n // get speed speedRatio, to and from, based on the sign and value(s)\r\n if (speedRatio < 0) {\r\n const tmp = from;\r\n from = to;\r\n to = tmp;\r\n speedRatio = -speedRatio;\r\n }\r\n // if from > to switch speed ratio\r\n if (from > to) {\r\n speedRatio = -speedRatio;\r\n }\r\n const animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, animations, onAnimationLoop, isAdditive);\r\n\r\n return animatable;\r\n };\r\n\r\n sceneClass.prototype.beginDirectHierarchyAnimation = function (\r\n target: Node,\r\n directDescendantsOnly: boolean,\r\n animations: Animation[],\r\n from: number,\r\n to: number,\r\n loop?: boolean,\r\n speedRatio?: number,\r\n onAnimationEnd?: () => void,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable[] {\r\n const children = target.getDescendants(directDescendantsOnly);\r\n\r\n const result = [];\r\n result.push(this.beginDirectAnimation(target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive));\r\n for (const child of children) {\r\n result.push(this.beginDirectAnimation(child, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive));\r\n }\r\n\r\n return result;\r\n };\r\n\r\n sceneClass.prototype.getAnimatableByTarget = function (target: any): Nullable<Animatable> {\r\n for (let index = 0; index < this._activeAnimatables.length; index++) {\r\n if (this._activeAnimatables[index].target === target) {\r\n return this._activeAnimatables[index];\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n sceneClass.prototype.getAllAnimatablesByTarget = function (target: any): Array<Animatable> {\r\n const result = [];\r\n for (let index = 0; index < this._activeAnimatables.length; index++) {\r\n if (this._activeAnimatables[index].target === target) {\r\n result.push(this._activeAnimatables[index]);\r\n }\r\n }\r\n\r\n return result;\r\n };\r\n\r\n sceneClass.prototype.stopAnimation = function (target: any, animationName?: string, targetMask?: (target: any) => boolean): void {\r\n const animatables = this.getAllAnimatablesByTarget(target);\r\n\r\n for (const animatable of animatables) {\r\n animatable.stop(animationName, targetMask);\r\n }\r\n };\r\n\r\n sceneClass.prototype.stopAllAnimations = function (): void {\r\n if (this._activeAnimatables) {\r\n for (let i = 0; i < this._activeAnimatables.length; i++) {\r\n this._activeAnimatables[i].stop(undefined, undefined, true);\r\n }\r\n this._activeAnimatables.length = 0;\r\n }\r\n\r\n for (const group of this.animationGroups) {\r\n group.stop();\r\n }\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"animatable.core.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animatable.core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAo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AAC;YACnC,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC,CAAC;IAEF,UAAU,CAAC,SAAS,CAAC,iBAAiB,GAAG;QACrC,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtD,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;YAChE,CAAC;YACD,IAAI,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;QACvC,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { Observable } from \"core/Misc/observable\";\r\nimport { type Scene } from \"core/scene\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { RuntimeAnimation } from \"./runtimeAnimation\";\r\nimport { Animation } from \"./animation\";\r\nimport { PrecisionDate } from \"core/Misc/precisionDate\";\r\nimport { Matrix, Quaternion, TmpVectors, Vector3 } from \"core/Maths/math.vector\";\r\nimport { type Bone } from \"core/Bones/bone\";\r\nimport { type Node } from \"../node\";\r\n\r\n/**\r\n * Class used to store an actual running animation\r\n */\r\nexport class Animatable {\r\n /**\r\n * If true, the animatable will be processed even if it is considered actively paused (weight of 0 and previous weight of 0).\r\n * This can be used to force the full processing of paused animatables in the animation engine.\r\n * Default is false.\r\n */\r\n public static ProcessPausedAnimatables = false;\r\n\r\n private _localDelayOffset: Nullable<number> = null;\r\n private _pausedDelay: Nullable<number> = null;\r\n private _manualJumpDelay: Nullable<number> = null;\r\n /** @hidden */\r\n public _runtimeAnimations = new Array<RuntimeAnimation>();\r\n private _paused = false;\r\n private _scene: Scene;\r\n private _speedRatio = 1;\r\n private _weight = -1.0;\r\n private _previousWeight = -1.0;\r\n private _syncRoot: Nullable<Animatable> = null;\r\n private _frameToSyncFromJump: Nullable<number> = null;\r\n private _goToFrame: Nullable<number> = null;\r\n private _linkedTargetRuntimeAnimationsMap = new Map<any, RuntimeAnimation[]>();\r\n private _linkedTargetAnimationPredicate = new Map<any, (animation: Animation) => boolean>();\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation.\r\n * This will only apply for non looping animation (default is true)\r\n */\r\n public disposeOnEnd = true;\r\n\r\n /**\r\n * Gets a boolean indicating if the animation has started\r\n */\r\n public animationStarted = false;\r\n\r\n /**\r\n * Observer raised when the animation ends\r\n */\r\n public onAnimationEndObservable = new Observable<Animatable>();\r\n\r\n /**\r\n * Observer raised when the animation loops\r\n */\r\n public onAnimationLoopObservable = new Observable<Animatable>();\r\n\r\n /**\r\n * Gets the root Animatable used to synchronize and normalize animations\r\n */\r\n public get syncRoot(): Nullable<Animatable> {\r\n return this._syncRoot;\r\n }\r\n\r\n /**\r\n * Gets the current frame of the first RuntimeAnimation\r\n * Used to synchronize Animatables\r\n */\r\n public get masterFrame(): number {\r\n if (this._runtimeAnimations.length === 0) {\r\n return 0;\r\n }\r\n\r\n return this._runtimeAnimations[0].currentFrame;\r\n }\r\n\r\n /**\r\n * Gets or sets the animatable weight (-1.0 by default meaning not weighted)\r\n */\r\n public get weight(): number {\r\n return this._weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n if (value === -1) {\r\n // -1 is ok and means no weight\r\n this._weight = -1;\r\n return;\r\n }\r\n\r\n // Else weight must be in [0, 1] range\r\n this._weight = Math.min(Math.max(value, 0), 1.0);\r\n }\r\n\r\n /**\r\n * Gets or sets the speed ratio to apply to the animatable (1.0 by default)\r\n */\r\n public get speedRatio(): number {\r\n return this._speedRatio;\r\n }\r\n\r\n public set speedRatio(value: number) {\r\n for (let index = 0; index < this._runtimeAnimations.length; index++) {\r\n const animation = this._runtimeAnimations[index];\r\n\r\n animation._prepareForSpeedRatioChange(value);\r\n }\r\n this._speedRatio = value;\r\n\r\n // Resync _manualJumpDelay in case goToFrame was called before speedRatio was set.\r\n if (this._goToFrame !== null) {\r\n this.goToFrame(this._goToFrame);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the elapsed time since the animatable started in milliseconds\r\n */\r\n public get elapsedTime(): number {\r\n return this._localDelayOffset === null ? 0 : this._scene._animationTime - this._localDelayOffset;\r\n }\r\n\r\n /**\r\n * Creates a new Animatable\r\n * @param scene defines the hosting scene\r\n * @param target defines the target object\r\n * @param fromFrame defines the starting frame number (default is 0)\r\n * @param toFrame defines the ending frame number (default is 100)\r\n * @param loopAnimation defines if the animation must loop (default is false)\r\n * @param speedRatio defines the factor to apply to animation speed (default is 1)\r\n * @param onAnimationEnd defines a callback to call when animation ends if it is not looping\r\n * @param animations defines a group of animation to add to the new Animatable\r\n * @param onAnimationLoop defines a callback to call when animation loops\r\n * @param isAdditive defines whether the animation should be evaluated additively\r\n * @param playOrder defines the order in which this animatable should be processed in the list of active animatables (default: 0)\r\n */\r\n constructor(\r\n scene: Scene,\r\n /** defines the target object */\r\n public target: any,\r\n /** [0] defines the starting frame number (default is 0) */\r\n public fromFrame: number = 0,\r\n /** [100] defines the ending frame number (default is 100) */\r\n public toFrame: number = 100,\r\n /** [false] defines if the animation must loop (default is false) */\r\n public loopAnimation: boolean = false,\r\n speedRatio: number = 1.0,\r\n /** defines a callback to call when animation ends if it is not looping */\r\n public onAnimationEnd?: Nullable<() => void>,\r\n animations?: Animation[],\r\n /** defines a callback to call when animation loops */\r\n public onAnimationLoop?: Nullable<() => void>,\r\n /** [false] defines whether the animation should be evaluated additively */\r\n public isAdditive: boolean = false,\r\n /** [0] defines the order in which this animatable should be processed in the list of active animatables (default: 0) */\r\n public playOrder = 0\r\n ) {\r\n this._scene = scene;\r\n if (animations) {\r\n this.appendAnimations(target, animations);\r\n }\r\n\r\n this._speedRatio = speedRatio;\r\n scene._activeAnimatables.push(this);\r\n }\r\n\r\n // Methods\r\n /**\r\n * Synchronize and normalize current Animatable with a source Animatable\r\n * This is useful when using animation weights and when animations are not of the same length\r\n * @param root defines the root Animatable to synchronize with (null to stop synchronizing)\r\n * @returns the current Animatable\r\n */\r\n public syncWith(root: Nullable<Animatable>): Animatable {\r\n this._syncRoot = root;\r\n\r\n if (root) {\r\n // Make sure this animatable will animate after the root\r\n const index = this._scene._activeAnimatables.indexOf(this);\r\n if (index > -1) {\r\n this._scene._activeAnimatables.splice(index, 1);\r\n this._scene._activeAnimatables.push(this);\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a target that run the same animations with the origin target\r\n * @param target\r\n * @param predicate\r\n */\r\n public addLinkedTarget(target: any, predicate?: (animation: Animation) => boolean) {\r\n if (!this._linkedTargetRuntimeAnimationsMap.has(target)) {\r\n const runtimeAnimations: RuntimeAnimation[] = [];\r\n for (let index = 0; index < this._runtimeAnimations.length; index++) {\r\n const animation = this._runtimeAnimations[index].animation;\r\n if (!predicate || predicate(animation)) {\r\n const newRuntimeAnimation = new RuntimeAnimation(target, animation, this._scene, this);\r\n runtimeAnimations.push(newRuntimeAnimation);\r\n }\r\n }\r\n this._linkedTargetRuntimeAnimationsMap.set(target, runtimeAnimations);\r\n if (predicate) {\r\n this._linkedTargetAnimationPredicate.set(target, predicate);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Remove a target that run the same animations with the origin target\r\n * @param target\r\n */\r\n public removeLinkedTarget(target: any) {\r\n if (this._linkedTargetRuntimeAnimationsMap.has(target)) {\r\n const runtimeAnimations = this._linkedTargetRuntimeAnimationsMap.get(target);\r\n runtimeAnimations!.forEach((runtimeAnimation) => {\r\n runtimeAnimation.dispose();\r\n });\r\n this._linkedTargetRuntimeAnimationsMap.delete(target);\r\n this._linkedTargetAnimationPredicate.delete(target);\r\n }\r\n }\r\n\r\n private _getAllLinkedTargetRuntimeAnimations(): RuntimeAnimation[] {\r\n return Array.from(this._linkedTargetRuntimeAnimationsMap.values()).flat();\r\n }\r\n\r\n private _getAllRuntimeAnimations(): RuntimeAnimation[] {\r\n return [...this._runtimeAnimations, ...this._getAllLinkedTargetRuntimeAnimations()];\r\n }\r\n\r\n /**\r\n * Gets the list of runtime animations\r\n * @returns an array of RuntimeAnimation\r\n */\r\n public getAnimations(): RuntimeAnimation[] {\r\n return this._runtimeAnimations;\r\n }\r\n\r\n /**\r\n * Adds more animations to the current animatable\r\n * @param target defines the target of the animations\r\n * @param animations defines the new animations to add\r\n */\r\n public appendAnimations(target: any, animations: Animation[]): void {\r\n for (let index = 0; index < animations.length; index++) {\r\n const animation = animations[index];\r\n\r\n const newRuntimeAnimation = new RuntimeAnimation(target, animation, this._scene, this);\r\n newRuntimeAnimation._onLoop = () => {\r\n this.onAnimationLoopObservable.notifyObservers(this);\r\n if (this.onAnimationLoop) {\r\n this.onAnimationLoop();\r\n }\r\n };\r\n\r\n this._runtimeAnimations.push(newRuntimeAnimation);\r\n const entries = Array.from(this._linkedTargetRuntimeAnimationsMap.entries());\r\n for (const [linkedTarget, targetAnimations] of entries) {\r\n const predicate = this._linkedTargetAnimationPredicate.get(linkedTarget);\r\n if (!predicate || predicate(animation)) {\r\n targetAnimations.push(new RuntimeAnimation(linkedTarget, animation, this._scene, this));\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the source animation for a specific property\r\n * @param property defines the property to look for\r\n * @returns null or the source animation for the given property\r\n */\r\n public getAnimationByTargetProperty(property: string): Nullable<Animation> {\r\n const runtimeAnimations = this._runtimeAnimations;\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n if (runtimeAnimations[index].animation.targetProperty === property) {\r\n return runtimeAnimations[index].animation;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the runtime animation for a specific property\r\n * @param property defines the property to look for\r\n * @returns null or the runtime animation for the given property\r\n */\r\n public getRuntimeAnimationByTargetProperty(property: string): Nullable<RuntimeAnimation> {\r\n const runtimeAnimations = this._runtimeAnimations;\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n if (runtimeAnimations[index].animation.targetProperty === property) {\r\n return runtimeAnimations[index];\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Resets the animatable to its original state\r\n */\r\n public reset(): void {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].reset(true);\r\n }\r\n\r\n this._localDelayOffset = null;\r\n this._pausedDelay = null;\r\n }\r\n\r\n /**\r\n * Allows the animatable to blend with current running animations\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending\r\n * @param blendingSpeed defines the blending speed to use\r\n */\r\n public enableBlending(blendingSpeed: number): void {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].animation.enableBlending = true;\r\n runtimeAnimations[index].animation.blendingSpeed = blendingSpeed;\r\n }\r\n }\r\n\r\n /**\r\n * Disable animation blending\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-blending\r\n */\r\n public disableBlending(): void {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].animation.enableBlending = false;\r\n }\r\n }\r\n\r\n /**\r\n * Jump directly to a given frame\r\n * @param frame defines the frame to jump to\r\n * @param useWeight defines whether the animation weight should be applied to the image to be jumped to (false by default)\r\n */\r\n public goToFrame(frame: number, useWeight = false): void {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n if (runtimeAnimations[0]) {\r\n const fps = runtimeAnimations[0].animation.framePerSecond;\r\n this._frameToSyncFromJump = this._frameToSyncFromJump ?? runtimeAnimations[0].currentFrame;\r\n const delay = this.speedRatio === 0 ? 0 : (((frame - this._frameToSyncFromJump) / fps) * 1000) / this.speedRatio;\r\n this._manualJumpDelay = -delay;\r\n }\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].goToFrame(frame, useWeight ? this._weight : -1);\r\n }\r\n\r\n this._goToFrame = frame;\r\n }\r\n\r\n /**\r\n * Returns true if the animations for this animatable are paused\r\n */\r\n public get paused() {\r\n return this._paused;\r\n }\r\n\r\n /**\r\n * Pause the animation\r\n */\r\n public pause(): void {\r\n if (this._paused) {\r\n return;\r\n }\r\n this._paused = true;\r\n }\r\n\r\n /**\r\n * Restart the animation\r\n */\r\n public restart(): void {\r\n this._paused = false;\r\n }\r\n\r\n private _raiseOnAnimationEnd() {\r\n if (this.onAnimationEnd) {\r\n this.onAnimationEnd();\r\n }\r\n\r\n this.onAnimationEndObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Stop and delete the current animation\r\n * @param animationName defines a string used to only stop some of the runtime animations instead of all\r\n * @param targetMask a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)\r\n * @param useGlobalSplice if true, the animatables will be removed by the caller of this function (false by default)\r\n * @param skipOnAnimationEnd defines if the system should not raise onAnimationEnd. Default is false\r\n */\r\n public stop(animationName?: string, targetMask?: (target: any) => boolean, useGlobalSplice = false, skipOnAnimationEnd = false): void {\r\n if (animationName || targetMask) {\r\n const idx = this._scene._activeAnimatables.indexOf(this);\r\n\r\n if (idx > -1) {\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = runtimeAnimations.length - 1; index >= 0; index--) {\r\n const runtimeAnimation = runtimeAnimations[index];\r\n if (animationName && runtimeAnimation.animation.name != animationName) {\r\n continue;\r\n }\r\n if (targetMask && !targetMask(runtimeAnimation.target)) {\r\n continue;\r\n }\r\n\r\n runtimeAnimation.dispose();\r\n if (this._runtimeAnimations.includes(runtimeAnimation)) {\r\n this._runtimeAnimations.splice(this._runtimeAnimations.indexOf(runtimeAnimation), 1);\r\n } else {\r\n for (const animations of Array.from(this._linkedTargetRuntimeAnimationsMap.values())) {\r\n if (animations.includes(runtimeAnimation)) {\r\n animations.splice(animations.indexOf(runtimeAnimation), 1);\r\n }\r\n }\r\n }\r\n }\r\n for (const [linkedTarget, animations] of Array.from(this._linkedTargetRuntimeAnimationsMap.entries())) {\r\n if (!animations || !animations.length) {\r\n this._linkedTargetRuntimeAnimationsMap.delete(linkedTarget);\r\n this._linkedTargetAnimationPredicate.delete(linkedTarget);\r\n }\r\n }\r\n if (this._runtimeAnimations.length == 0) {\r\n if (!useGlobalSplice) {\r\n this._scene._activeAnimatables.splice(idx, 1);\r\n }\r\n this._linkedTargetRuntimeAnimationsMap.clear();\r\n this._linkedTargetAnimationPredicate.clear();\r\n if (!skipOnAnimationEnd) {\r\n this._raiseOnAnimationEnd();\r\n }\r\n }\r\n }\r\n } else {\r\n const index = this._scene._activeAnimatables.indexOf(this);\r\n\r\n if (index > -1) {\r\n if (!useGlobalSplice) {\r\n this._scene._activeAnimatables.splice(index, 1);\r\n }\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n\r\n for (let index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].dispose();\r\n }\r\n\r\n this._runtimeAnimations.length = 0;\r\n this._linkedTargetRuntimeAnimationsMap.clear();\r\n this._linkedTargetAnimationPredicate.clear();\r\n\r\n if (!skipOnAnimationEnd) {\r\n this._raiseOnAnimationEnd();\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Wait asynchronously for the animation to end\r\n * @returns a promise which will be fulfilled when the animation ends\r\n */\r\n public async waitAsync(): Promise<Animatable> {\r\n return await new Promise((resolve) => {\r\n this.onAnimationEndObservable.add(\r\n () => {\r\n resolve(this);\r\n },\r\n undefined,\r\n undefined,\r\n this,\r\n true\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _animate(delay: number): boolean {\r\n if (this._paused) {\r\n this.animationStarted = false;\r\n if (this._pausedDelay === null) {\r\n this._pausedDelay = delay;\r\n }\r\n return true;\r\n }\r\n\r\n if (this._localDelayOffset === null) {\r\n this._localDelayOffset = delay;\r\n this._pausedDelay = null;\r\n } else if (this._pausedDelay !== null) {\r\n this._localDelayOffset += delay - this._pausedDelay;\r\n this._pausedDelay = null;\r\n }\r\n\r\n if (this._manualJumpDelay !== null) {\r\n this._localDelayOffset += this.speedRatio < 0 ? -this._manualJumpDelay : this._manualJumpDelay;\r\n this._manualJumpDelay = null;\r\n this._frameToSyncFromJump = null;\r\n }\r\n\r\n this._goToFrame = null;\r\n\r\n if (!Animatable.ProcessPausedAnimatables && this._weight === 0 && this._previousWeight === 0) {\r\n // We consider that an animatable with a weight === 0 is \"actively\" paused\r\n return true;\r\n }\r\n\r\n this._previousWeight = this._weight;\r\n\r\n // Animating\r\n let running = false;\r\n const runtimeAnimations = this._getAllRuntimeAnimations();\r\n let index: number;\r\n\r\n for (index = 0; index < runtimeAnimations.length; index++) {\r\n const animation = runtimeAnimations[index];\r\n const isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight);\r\n running = running || isRunning;\r\n }\r\n\r\n this.animationStarted = running;\r\n\r\n if (!running) {\r\n if (this.disposeOnEnd) {\r\n // Remove from active animatables\r\n index = this._scene._activeAnimatables.indexOf(this);\r\n this._scene._activeAnimatables.splice(index, 1);\r\n\r\n // Dispose all runtime animations\r\n for (index = 0; index < runtimeAnimations.length; index++) {\r\n runtimeAnimations[index].dispose();\r\n }\r\n }\r\n\r\n this._raiseOnAnimationEnd();\r\n\r\n if (this.disposeOnEnd) {\r\n this.onAnimationEnd = null;\r\n this.onAnimationLoop = null;\r\n this.onAnimationLoopObservable.clear();\r\n this.onAnimationEndObservable.clear();\r\n }\r\n }\r\n\r\n return running;\r\n }\r\n}\r\n\r\n/** @internal */\r\nfunction ProcessLateAnimationBindingsForMatrices(holder: {\r\n totalWeight: number;\r\n totalAdditiveWeight: number;\r\n animations: RuntimeAnimation[];\r\n additiveAnimations: RuntimeAnimation[];\r\n originalValue: Matrix;\r\n}): any {\r\n if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) {\r\n return holder.originalValue;\r\n }\r\n\r\n let normalizer = 1.0;\r\n const finalPosition = TmpVectors.Vector3[0];\r\n const finalScaling = TmpVectors.Vector3[1];\r\n const finalQuaternion = TmpVectors.Quaternion[0];\r\n let startIndex = 0;\r\n const originalAnimation = holder.animations[0];\r\n const originalValue = holder.originalValue;\r\n\r\n let scale: number;\r\n let skipOverride = false;\r\n if (holder.totalWeight < 1.0) {\r\n // We need to mix the original value in\r\n scale = 1.0 - holder.totalWeight;\r\n originalValue.decompose(finalScaling, finalQuaternion, finalPosition);\r\n } else {\r\n startIndex = 1;\r\n // We need to normalize the weights\r\n normalizer = holder.totalWeight;\r\n scale = originalAnimation.weight / normalizer;\r\n if (scale == 1) {\r\n if (holder.totalAdditiveWeight) {\r\n skipOverride = true;\r\n } else {\r\n return originalAnimation.currentValue;\r\n }\r\n }\r\n\r\n originalAnimation.currentValue.decompose(finalScaling, finalQuaternion, finalPosition);\r\n }\r\n\r\n // Add up the override animations\r\n if (!skipOverride) {\r\n finalScaling.scaleInPlace(scale);\r\n finalPosition.scaleInPlace(scale);\r\n finalQuaternion.scaleInPlace(scale);\r\n\r\n for (let animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {\r\n const runtimeAnimation = holder.animations[animIndex];\r\n if (runtimeAnimation.weight === 0) {\r\n continue;\r\n }\r\n\r\n scale = runtimeAnimation.weight / normalizer;\r\n const currentPosition = TmpVectors.Vector3[2];\r\n const currentScaling = TmpVectors.Vector3[3];\r\n const currentQuaternion = TmpVectors.Quaternion[1];\r\n\r\n runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition);\r\n\r\n currentScaling.scaleAndAddToRef(scale, finalScaling);\r\n currentQuaternion.scaleAndAddToRef(Quaternion.Dot(finalQuaternion, currentQuaternion) > 0 ? scale : -scale, finalQuaternion);\r\n currentPosition.scaleAndAddToRef(scale, finalPosition);\r\n }\r\n\r\n finalQuaternion.normalize();\r\n }\r\n\r\n // Add up the additive animations\r\n for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {\r\n const runtimeAnimation = holder.additiveAnimations[animIndex];\r\n if (runtimeAnimation.weight === 0) {\r\n continue;\r\n }\r\n\r\n const currentPosition = TmpVectors.Vector3[2];\r\n const currentScaling = TmpVectors.Vector3[3];\r\n const currentQuaternion = TmpVectors.Quaternion[1];\r\n\r\n runtimeAnimation.currentValue.decompose(currentScaling, currentQuaternion, currentPosition);\r\n currentScaling.multiplyToRef(finalScaling, currentScaling);\r\n Vector3.LerpToRef(finalScaling, currentScaling, runtimeAnimation.weight, finalScaling);\r\n finalQuaternion.multiplyToRef(currentQuaternion, currentQuaternion);\r\n Quaternion.SlerpToRef(finalQuaternion, currentQuaternion, runtimeAnimation.weight, finalQuaternion);\r\n currentPosition.scaleAndAddToRef(runtimeAnimation.weight, finalPosition);\r\n }\r\n\r\n const workValue = originalAnimation ? originalAnimation._animationState.workValue : TmpVectors.Matrix[0].clone();\r\n Matrix.ComposeToRef(finalScaling, finalQuaternion, finalPosition, workValue);\r\n return workValue;\r\n}\r\n\r\n/** @internal */\r\nfunction ProcessLateAnimationBindingsForQuaternions(\r\n holder: {\r\n totalWeight: number;\r\n totalAdditiveWeight: number;\r\n animations: RuntimeAnimation[];\r\n additiveAnimations: RuntimeAnimation[];\r\n originalValue: Quaternion;\r\n },\r\n refQuaternion: Quaternion\r\n): Quaternion {\r\n if (holder.totalWeight === 0 && holder.totalAdditiveWeight === 0) {\r\n return refQuaternion;\r\n }\r\n\r\n const originalAnimation = holder.animations[0];\r\n const originalValue = holder.originalValue;\r\n let cumulativeQuaternion = refQuaternion;\r\n\r\n if (holder.totalWeight === 0 && holder.totalAdditiveWeight > 0) {\r\n cumulativeQuaternion.copyFrom(originalValue);\r\n } else if (holder.animations.length === 1) {\r\n Quaternion.SlerpToRef(originalValue, originalAnimation.currentValue, Math.min(1.0, holder.totalWeight), cumulativeQuaternion);\r\n\r\n if (holder.totalAdditiveWeight === 0) {\r\n return cumulativeQuaternion;\r\n }\r\n } else if (holder.animations.length > 1) {\r\n // Add up the override animations\r\n let normalizer = 1.0;\r\n let quaternions: Array<Quaternion>;\r\n let weights: Array<number>;\r\n\r\n if (holder.totalWeight < 1.0) {\r\n const scale = 1.0 - holder.totalWeight;\r\n\r\n quaternions = [];\r\n weights = [];\r\n\r\n quaternions.push(originalValue);\r\n weights.push(scale);\r\n } else {\r\n if (holder.animations.length === 2) {\r\n // Slerp as soon as we can\r\n Quaternion.SlerpToRef(holder.animations[0].currentValue, holder.animations[1].currentValue, holder.animations[1].weight / holder.totalWeight, refQuaternion);\r\n\r\n if (holder.totalAdditiveWeight === 0) {\r\n return refQuaternion;\r\n }\r\n }\r\n\r\n quaternions = [];\r\n weights = [];\r\n normalizer = holder.totalWeight;\r\n }\r\n\r\n for (let animIndex = 0; animIndex < holder.animations.length; animIndex++) {\r\n const runtimeAnimation = holder.animations[animIndex];\r\n quaternions.push(runtimeAnimation.currentValue);\r\n weights.push(runtimeAnimation.weight / normalizer);\r\n }\r\n\r\n // https://gamedev.stackexchange.com/questions/62354/method-for-interpolation-between-3-quaternions\r\n\r\n let cumulativeAmount = 0;\r\n for (let index = 0; index < quaternions.length; ) {\r\n if (!index) {\r\n Quaternion.SlerpToRef(quaternions[index], quaternions[index + 1], weights[index + 1] / (weights[index] + weights[index + 1]), refQuaternion);\r\n cumulativeQuaternion = refQuaternion;\r\n cumulativeAmount = weights[index] + weights[index + 1];\r\n index += 2;\r\n continue;\r\n }\r\n cumulativeAmount += weights[index];\r\n Quaternion.SlerpToRef(cumulativeQuaternion, quaternions[index], weights[index] / cumulativeAmount, cumulativeQuaternion);\r\n index++;\r\n }\r\n }\r\n\r\n // Add up the additive animations\r\n for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {\r\n const runtimeAnimation = holder.additiveAnimations[animIndex];\r\n if (runtimeAnimation.weight === 0) {\r\n continue;\r\n }\r\n\r\n cumulativeQuaternion.multiplyToRef(runtimeAnimation.currentValue, TmpVectors.Quaternion[0]);\r\n Quaternion.SlerpToRef(cumulativeQuaternion, TmpVectors.Quaternion[0], runtimeAnimation.weight, cumulativeQuaternion);\r\n }\r\n\r\n return cumulativeQuaternion;\r\n}\r\n\r\n/** @internal */\r\nfunction ProcessLateAnimationBindings(scene: Scene): void {\r\n if (!scene._registeredForLateAnimationBindings.length) {\r\n return;\r\n }\r\n for (let index = 0; index < scene._registeredForLateAnimationBindings.length; index++) {\r\n const target = scene._registeredForLateAnimationBindings.data[index];\r\n\r\n for (const path in target._lateAnimationHolders) {\r\n const holder = target._lateAnimationHolders[path];\r\n const originalAnimation: RuntimeAnimation = holder.animations[0];\r\n const originalValue = holder.originalValue;\r\n if (originalValue === undefined || originalValue === null) {\r\n continue;\r\n }\r\n const matrixDecomposeMode = Animation.AllowMatrixDecomposeForInterpolation && originalValue.m; // ie. data is matrix\r\n\r\n let finalValue: any = target[path];\r\n if (matrixDecomposeMode) {\r\n finalValue = ProcessLateAnimationBindingsForMatrices(holder);\r\n } else {\r\n const quaternionMode = originalValue.w !== undefined;\r\n if (quaternionMode) {\r\n finalValue = ProcessLateAnimationBindingsForQuaternions(holder, finalValue || Quaternion.Identity());\r\n } else {\r\n let startIndex = 0;\r\n let normalizer = 1.0;\r\n\r\n const originalAnimationIsLoopRelativeFromCurrent =\r\n originalAnimation && originalAnimation._animationState.loopMode === Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;\r\n\r\n if (holder.totalWeight < 1.0) {\r\n // We need to mix the original value in\r\n if (originalAnimationIsLoopRelativeFromCurrent) {\r\n finalValue = originalValue.clone ? originalValue.clone() : originalValue;\r\n } else if (originalAnimation && originalValue.scale) {\r\n finalValue = originalValue.scale(1.0 - holder.totalWeight);\r\n } else if (originalAnimation) {\r\n finalValue = originalValue * (1.0 - holder.totalWeight);\r\n } else if (originalValue.clone) {\r\n finalValue = originalValue.clone();\r\n } else {\r\n finalValue = originalValue;\r\n }\r\n } else if (originalAnimation) {\r\n // We need to normalize the weights\r\n normalizer = holder.totalWeight;\r\n const scale = originalAnimation.weight / normalizer;\r\n if (scale !== 1) {\r\n if (originalAnimation.currentValue.scale) {\r\n finalValue = originalAnimation.currentValue.scale(scale);\r\n } else {\r\n finalValue = originalAnimation.currentValue * scale;\r\n }\r\n } else {\r\n finalValue = originalAnimation.currentValue;\r\n }\r\n\r\n if (originalAnimationIsLoopRelativeFromCurrent) {\r\n if (finalValue.addToRef) {\r\n finalValue.addToRef(originalValue, finalValue);\r\n } else {\r\n finalValue += originalValue;\r\n }\r\n }\r\n\r\n startIndex = 1;\r\n }\r\n\r\n // Add up the override animations\r\n for (let animIndex = startIndex; animIndex < holder.animations.length; animIndex++) {\r\n const runtimeAnimation = holder.animations[animIndex];\r\n const scale = runtimeAnimation.weight / normalizer;\r\n\r\n if (!scale) {\r\n continue;\r\n } else if (runtimeAnimation.currentValue.scaleAndAddToRef) {\r\n runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue);\r\n } else {\r\n finalValue += runtimeAnimation.currentValue * scale;\r\n }\r\n }\r\n\r\n // Add up the additive animations\r\n for (let animIndex = 0; animIndex < holder.additiveAnimations.length; animIndex++) {\r\n const runtimeAnimation = holder.additiveAnimations[animIndex];\r\n const scale: number = runtimeAnimation.weight;\r\n\r\n if (!scale) {\r\n continue;\r\n } else if (runtimeAnimation.currentValue.scaleAndAddToRef) {\r\n runtimeAnimation.currentValue.scaleAndAddToRef(scale, finalValue);\r\n } else {\r\n finalValue += runtimeAnimation.currentValue * scale;\r\n }\r\n }\r\n }\r\n }\r\n target[path] = finalValue;\r\n }\r\n\r\n target._lateAnimationHolders = {};\r\n }\r\n scene._registeredForLateAnimationBindings.reset();\r\n}\r\n\r\n/** @internal */\r\nexport function RegisterTargetForLateAnimationBinding(scene: Scene, runtimeAnimation: RuntimeAnimation, originalValue: any): void {\r\n const target = runtimeAnimation.target;\r\n scene._registeredForLateAnimationBindings.pushNoDuplicate(target);\r\n\r\n if (!target._lateAnimationHolders) {\r\n target._lateAnimationHolders = {};\r\n }\r\n\r\n if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath] = {\r\n totalWeight: 0,\r\n totalAdditiveWeight: 0,\r\n animations: [],\r\n additiveAnimations: [],\r\n originalValue: originalValue,\r\n };\r\n }\r\n\r\n if (runtimeAnimation.isAdditive) {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].additiveAnimations.push(runtimeAnimation);\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].totalAdditiveWeight += runtimeAnimation.weight;\r\n } else {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation);\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight;\r\n }\r\n}\r\n\r\n/**\r\n * Initialize all the inter dependecies between the animations and Scene and Bone\r\n * @param sceneClass defines the scene prototype to use\r\n * @param boneClass defines the bone prototype to use\r\n */\r\nexport function AddAnimationExtensions(sceneClass: typeof Scene, boneClass: typeof Bone): void {\r\n if (boneClass) {\r\n boneClass.prototype.copyAnimationRange = function (\r\n source: Bone,\r\n rangeName: string,\r\n frameOffset: number,\r\n rescaleAsRequired = false,\r\n skelDimensionsRatio: Nullable<Vector3> = null\r\n ): boolean {\r\n // all animation may be coming from a library skeleton, so may need to create animation\r\n if (this.animations.length === 0) {\r\n this.animations.push(new Animation(this.name, \"_matrix\", source.animations[0].framePerSecond, Animation.ANIMATIONTYPE_MATRIX, 0));\r\n this.animations[0].setKeys([]);\r\n }\r\n\r\n // get animation info / verify there is such a range from the source bone\r\n const sourceRange = source.animations[0].getRange(rangeName);\r\n if (!sourceRange) {\r\n return false;\r\n }\r\n const from = sourceRange.from;\r\n const to = sourceRange.to;\r\n const sourceKeys = source.animations[0].getKeys();\r\n\r\n // rescaling prep\r\n const sourceBoneLength = source.length;\r\n const sourceParent = source.getParent();\r\n const parent = this.getParent();\r\n const parentScalingReqd = rescaleAsRequired && sourceParent && sourceBoneLength && this.length && sourceBoneLength !== this.length;\r\n const parentRatio = parentScalingReqd && parent && sourceParent ? parent.length / sourceParent.length : 1;\r\n\r\n const dimensionsScalingReqd =\r\n rescaleAsRequired && !parent && skelDimensionsRatio && (skelDimensionsRatio.x !== 1 || skelDimensionsRatio.y !== 1 || skelDimensionsRatio.z !== 1);\r\n\r\n const destKeys = this.animations[0].getKeys();\r\n\r\n // loop vars declaration\r\n let orig: { frame: number; value: Matrix };\r\n let origTranslation: Vector3;\r\n let mat: Matrix;\r\n\r\n for (let key = 0, nKeys = sourceKeys.length; key < nKeys; key++) {\r\n orig = sourceKeys[key];\r\n if (orig.frame >= from && orig.frame <= to) {\r\n if (rescaleAsRequired) {\r\n mat = orig.value.clone();\r\n\r\n // scale based on parent ratio, when bone has parent\r\n if (parentScalingReqd) {\r\n origTranslation = mat.getTranslation();\r\n mat.setTranslation(origTranslation.scaleInPlace(parentRatio));\r\n\r\n // scale based on skeleton dimension ratio when root bone, and value is passed\r\n } else if (dimensionsScalingReqd && skelDimensionsRatio) {\r\n origTranslation = mat.getTranslation();\r\n mat.setTranslation(origTranslation.multiplyInPlace(skelDimensionsRatio));\r\n\r\n // use original when root bone, and no data for skelDimensionsRatio\r\n } else {\r\n mat = orig.value;\r\n }\r\n } else {\r\n mat = orig.value;\r\n }\r\n destKeys.push({ frame: orig.frame + frameOffset, value: mat });\r\n }\r\n }\r\n this.animations[0].createRange(rangeName, from + frameOffset, to + frameOffset);\r\n return true;\r\n };\r\n }\r\n\r\n if (!sceneClass) {\r\n return;\r\n }\r\n\r\n sceneClass.prototype._animate = function (customDeltaTime?: number): void {\r\n if (!this.animationsEnabled) {\r\n return;\r\n }\r\n\r\n // Getting time\r\n const now = PrecisionDate.Now;\r\n if (!this._animationTimeLast) {\r\n if (this._pendingData.length > 0) {\r\n return;\r\n }\r\n this._animationTimeLast = now;\r\n }\r\n\r\n this.deltaTime = customDeltaTime !== undefined ? customDeltaTime : this.useConstantAnimationDeltaTime ? 16.0 : (now - this._animationTimeLast) * this.animationTimeScale;\r\n this._animationTimeLast = now;\r\n\r\n const animatables = this._activeAnimatables;\r\n if (animatables.length === 0) {\r\n return;\r\n }\r\n\r\n this._animationTime += this.deltaTime;\r\n const animationTime = this._animationTime;\r\n\r\n for (let index = 0; index < animatables.length; index++) {\r\n const animatable = animatables[index];\r\n\r\n if (!animatable._animate(animationTime) && animatable.disposeOnEnd) {\r\n index--; // Array was updated\r\n }\r\n }\r\n\r\n // Late animation bindings\r\n ProcessLateAnimationBindings(this);\r\n };\r\n\r\n sceneClass.prototype.sortActiveAnimatables = function (): void {\r\n this._activeAnimatables.sort((a, b) => {\r\n return a.playOrder - b.playOrder;\r\n });\r\n };\r\n\r\n sceneClass.prototype.beginWeightedAnimation = function (\r\n target: any,\r\n from: number,\r\n to: number,\r\n weight = 1.0,\r\n loop?: boolean,\r\n speedRatio: number = 1.0,\r\n onAnimationEnd?: () => void,\r\n animatable?: Animatable,\r\n targetMask?: (target: any) => boolean,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable {\r\n const returnedAnimatable = this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, false, targetMask, onAnimationLoop, isAdditive);\r\n returnedAnimatable.weight = weight;\r\n\r\n return returnedAnimatable;\r\n };\r\n\r\n sceneClass.prototype.beginAnimation = function (\r\n target: any,\r\n from: number,\r\n to: number,\r\n loop?: boolean,\r\n speedRatio: number = 1.0,\r\n onAnimationEnd?: () => void,\r\n animatable?: Animatable,\r\n stopCurrent = true,\r\n targetMask?: (target: any) => boolean,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable {\r\n // get speed speedRatio, to and from, based on the sign and value(s)\r\n if (speedRatio < 0) {\r\n const tmp = from;\r\n from = to;\r\n to = tmp;\r\n speedRatio = -speedRatio;\r\n }\r\n // if from > to switch speed ratio\r\n if (from > to) {\r\n speedRatio = -speedRatio;\r\n }\r\n if (stopCurrent) {\r\n this.stopAnimation(target, undefined, targetMask);\r\n }\r\n\r\n if (!animatable) {\r\n animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, undefined, onAnimationLoop, isAdditive);\r\n }\r\n\r\n const shouldRunTargetAnimations = targetMask ? targetMask(target) : true;\r\n // Local animations\r\n if (target.animations && shouldRunTargetAnimations) {\r\n animatable.appendAnimations(target, target.animations);\r\n }\r\n\r\n // Children animations\r\n if (target.getAnimatables) {\r\n const animatables = target.getAnimatables();\r\n for (let index = 0; index < animatables.length; index++) {\r\n this.beginAnimation(animatables[index], from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, onAnimationLoop);\r\n }\r\n }\r\n\r\n animatable.reset();\r\n\r\n return animatable;\r\n };\r\n\r\n sceneClass.prototype.beginHierarchyAnimation = function (\r\n target: any,\r\n directDescendantsOnly: boolean,\r\n from: number,\r\n to: number,\r\n loop?: boolean,\r\n speedRatio: number = 1.0,\r\n onAnimationEnd?: () => void,\r\n animatable?: Animatable,\r\n stopCurrent = true,\r\n targetMask?: (target: any) => boolean,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable[] {\r\n const children = target.getDescendants(directDescendantsOnly);\r\n\r\n const result = [];\r\n result.push(this.beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive));\r\n for (const child of children) {\r\n result.push(this.beginAnimation(child, from, to, loop, speedRatio, onAnimationEnd, animatable, stopCurrent, targetMask, undefined, isAdditive));\r\n }\r\n\r\n return result;\r\n };\r\n\r\n sceneClass.prototype.beginDirectAnimation = function (\r\n target: any,\r\n animations: Animation[],\r\n from: number,\r\n to: number,\r\n loop?: boolean,\r\n speedRatio: number = 1.0,\r\n onAnimationEnd?: () => void,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable {\r\n // get speed speedRatio, to and from, based on the sign and value(s)\r\n if (speedRatio < 0) {\r\n const tmp = from;\r\n from = to;\r\n to = tmp;\r\n speedRatio = -speedRatio;\r\n }\r\n // if from > to switch speed ratio\r\n if (from > to) {\r\n speedRatio = -speedRatio;\r\n }\r\n const animatable = new Animatable(this, target, from, to, loop, speedRatio, onAnimationEnd, animations, onAnimationLoop, isAdditive);\r\n\r\n return animatable;\r\n };\r\n\r\n sceneClass.prototype.beginDirectHierarchyAnimation = function (\r\n target: Node,\r\n directDescendantsOnly: boolean,\r\n animations: Animation[],\r\n from: number,\r\n to: number,\r\n loop?: boolean,\r\n speedRatio?: number,\r\n onAnimationEnd?: () => void,\r\n onAnimationLoop?: () => void,\r\n isAdditive = false\r\n ): Animatable[] {\r\n const children = target.getDescendants(directDescendantsOnly);\r\n\r\n const result = [];\r\n result.push(this.beginDirectAnimation(target, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive));\r\n for (const child of children) {\r\n result.push(this.beginDirectAnimation(child, animations, from, to, loop, speedRatio, onAnimationEnd, onAnimationLoop, isAdditive));\r\n }\r\n\r\n return result;\r\n };\r\n\r\n sceneClass.prototype.getAnimatableByTarget = function (target: any): Nullable<Animatable> {\r\n for (let index = 0; index < this._activeAnimatables.length; index++) {\r\n if (this._activeAnimatables[index].target === target) {\r\n return this._activeAnimatables[index];\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n sceneClass.prototype.getAllAnimatablesByTarget = function (target: any): Array<Animatable> {\r\n const result = [];\r\n for (let index = 0; index < this._activeAnimatables.length; index++) {\r\n if (this._activeAnimatables[index].target === target) {\r\n result.push(this._activeAnimatables[index]);\r\n }\r\n }\r\n\r\n return result;\r\n };\r\n\r\n sceneClass.prototype.stopAnimation = function (target: any, animationName?: string, targetMask?: (target: any) => boolean): void {\r\n const animatables = this.getAllAnimatablesByTarget(target);\r\n\r\n for (const animatable of animatables) {\r\n animatable.stop(animationName, targetMask);\r\n }\r\n };\r\n\r\n sceneClass.prototype.stopAllAnimations = function (): void {\r\n if (this._activeAnimatables) {\r\n for (let i = 0; i < this._activeAnimatables.length; i++) {\r\n this._activeAnimatables[i].stop(undefined, undefined, true);\r\n }\r\n this._activeAnimatables.length = 0;\r\n }\r\n\r\n for (const group of this.animationGroups) {\r\n group.stop();\r\n }\r\n };\r\n}\r\n"]}
@@ -560,7 +560,9 @@ export class RuntimeAnimation {
560
560
  }
561
561
  // Reset event/state if looping
562
562
  if ((!yoyoMode && ((speedRatio > 0 && this.currentFrame > currentFrame) || (speedRatio < 0 && this.currentFrame < currentFrame))) || (yoyoMode && yoyoLoop)) {
563
- this._onLoop();
563
+ if (this._onLoop) {
564
+ this._onLoop();
565
+ }
564
566
  // Need to reset animation events
565
567
  for (let index = 0; index < events.length; index++) {
566
568
  if (!events[index].onlyOnce) {
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeAnimation.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/runtimeAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAEH,SAAS,EACT,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,GAC5B,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,MAAM,OAAO,gBAAgB;IA8GzB;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,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AM,CAAC,CAAC;QAEpC,eAAe;QACf,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;gBACjD,kGAAkG;gBAClG,mDAAmD;gBACnD,IACI,CAAC,UAAU,IAAI,CAAC,IAAI,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC;oBACvF,CAAC,UAAU,GAAG,CAAC,IAAI,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,EACxF,CAAC;oBACC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;oBAC5B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;wBAChB,gDAAgD;wBAChD,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;4BACjB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BACxB,KAAK,EAAE,CAAC;wBACZ,CAAC;wBACD,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;wBACpB,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;oBAC/B,CAAC,CAAC,wDAAwD;gBAC9D,CAAC;YACL,CAAC;QACL,CAAC;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACzB,CAAC;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ","sourcesContent":["import { type Nullable } from \"../types\";\r\nimport { Matrix } from \"../Maths/math.vector\";\r\nimport {\r\n type _IAnimationState,\r\n Animation,\r\n _StaticOffsetValueColor3,\r\n _StaticOffsetValueColor4,\r\n _StaticOffsetValueQuaternion,\r\n _StaticOffsetValueSize,\r\n _StaticOffsetValueVector2,\r\n _StaticOffsetValueVector3,\r\n} from \"./animation\";\r\nimport { type AnimationEvent } from \"./animationEvent\";\r\nimport { type Animatable } from \"./animatable\";\r\nimport { type Scene } from \"../scene\";\r\nimport { type IAnimationKey } from \"./animationKey\";\r\n\r\n/**\r\n * Defines a runtime animation\r\n */\r\nexport class RuntimeAnimation {\r\n private _events = new Array<AnimationEvent>();\r\n\r\n /**\r\n * The current frame of the runtime animation\r\n */\r\n private _currentFrame: number = 0;\r\n\r\n /**\r\n * The animation used by the runtime animation\r\n */\r\n public _animation: Animation;\r\n\r\n /**\r\n * The target of the runtime animation\r\n */\r\n private _target: any;\r\n\r\n /**\r\n * The initiating animatable\r\n */\r\n private _host: Animatable;\r\n\r\n /**\r\n * The original value of the runtime animation\r\n */\r\n private _originalValue = new Array<any>();\r\n\r\n /**\r\n * The original blend value of the runtime animation\r\n */\r\n private _originalBlendValue: Nullable<any> = null;\r\n\r\n /**\r\n * The offsets cache of the runtime animation\r\n */\r\n private _offsetsCache: { [key: string]: any } = {};\r\n\r\n /**\r\n * The high limits cache of the runtime animation\r\n */\r\n private _highLimitsCache: { [key: string]: any } = {};\r\n\r\n /**\r\n * Specifies if the runtime animation has been stopped\r\n */\r\n private _stopped = false;\r\n\r\n /**\r\n * The blending factor of the runtime animation\r\n */\r\n private _blendingFactor = 0;\r\n\r\n /**\r\n * The BabylonJS scene\r\n */\r\n private _scene: Scene;\r\n\r\n /**\r\n * The current value of the runtime animation\r\n */\r\n private _currentValue: Nullable<any> = null;\r\n\r\n /** @internal */\r\n public _animationState: _IAnimationState;\r\n\r\n /**\r\n * The active target of the runtime animation\r\n */\r\n private _activeTargets: any[];\r\n private _currentActiveTarget: Nullable<any> = null;\r\n private _directTarget: Nullable<any> = null;\r\n\r\n /**\r\n * The target path of the runtime animation\r\n */\r\n private _targetPath: string = \"\";\r\n\r\n /**\r\n * The weight of the runtime animation\r\n */\r\n private _weight = 1.0;\r\n\r\n /**\r\n * The absolute frame offset of the runtime animation\r\n */\r\n private _absoluteFrameOffset = 0;\r\n\r\n /**\r\n * The previous elapsed time (since start of animation) of the runtime animation\r\n */\r\n private _previousElapsedTime: number = 0;\r\n\r\n private _yoyoDirection: number = 1;\r\n\r\n /**\r\n * The previous absolute frame of the runtime animation (meaning, without taking into account the from/to values, only the elapsed time and the fps)\r\n */\r\n private _previousAbsoluteFrame: number = 0;\r\n\r\n private _enableBlending: boolean;\r\n\r\n private _keys: IAnimationKey[];\r\n private _minFrame: number;\r\n private _maxFrame: number;\r\n private _targetIsArray = false;\r\n\r\n /** @internal */\r\n public _coreRuntimeAnimation: RuntimeAnimation | null = null;\r\n\r\n /**\r\n * Gets the current frame of the runtime animation\r\n */\r\n public get currentFrame(): number {\r\n return this._currentFrame;\r\n }\r\n\r\n /**\r\n * Gets the weight of the runtime animation\r\n */\r\n public get weight(): number {\r\n return this._weight;\r\n }\r\n\r\n /**\r\n * Gets the current value of the runtime animation\r\n */\r\n public get currentValue(): any {\r\n return this._currentValue;\r\n }\r\n\r\n /**\r\n * Gets or sets the target path of the runtime animation\r\n */\r\n public get targetPath(): string {\r\n return this._targetPath;\r\n }\r\n\r\n /**\r\n * Gets the actual target of the runtime animation\r\n */\r\n public get target(): any {\r\n return this._currentActiveTarget;\r\n }\r\n\r\n /**\r\n * Gets the additive state of the runtime animation\r\n */\r\n public get isAdditive(): boolean {\r\n return this._host && this._host.isAdditive;\r\n }\r\n\r\n /** @internal */\r\n public _onLoop: () => void;\r\n\r\n /**\r\n * Create a new RuntimeAnimation object\r\n * @param target defines the target of the animation\r\n * @param animation defines the source animation object\r\n * @param scene defines the hosting scene\r\n * @param host defines the initiating Animatable\r\n */\r\n public constructor(target: any, animation: Animation, scene: Scene, host: Animatable) {\r\n this._animation = animation;\r\n this._target = target;\r\n this._scene = scene;\r\n this._host = host;\r\n this._activeTargets = [];\r\n\r\n animation._runtimeAnimations.push(this);\r\n\r\n // State\r\n this._animationState = {\r\n key: 0,\r\n repeatCount: 0,\r\n loopMode: this._getCorrectLoopMode(),\r\n };\r\n\r\n if (this._animation.dataType === Animation.ANIMATIONTYPE_MATRIX) {\r\n this._animationState.workValue = Matrix.Zero();\r\n }\r\n\r\n // Limits\r\n this._keys = this._animation.getKeys();\r\n this._minFrame = this._keys[0].frame;\r\n this._maxFrame = this._keys[this._keys.length - 1].frame;\r\n\r\n // Add a start key at frame 0 if missing\r\n if (this._minFrame !== 0) {\r\n const newKey = { frame: 0, value: this._keys[0].value };\r\n this._keys.splice(0, 0, newKey);\r\n }\r\n\r\n // Check data\r\n if (this._target instanceof Array) {\r\n let index = 0;\r\n for (const target of this._target) {\r\n this._preparePath(target, index);\r\n this._getOriginalValues(index);\r\n index++;\r\n }\r\n this._targetIsArray = true;\r\n } else {\r\n this._preparePath(this._target);\r\n this._getOriginalValues();\r\n this._targetIsArray = false;\r\n this._directTarget = this._activeTargets[0];\r\n }\r\n\r\n // Cloning events locally\r\n const events = animation.getEvents();\r\n if (events && events.length > 0) {\r\n for (const e of events) {\r\n this._events.push(e._clone());\r\n }\r\n }\r\n\r\n this._enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;\r\n }\r\n\r\n private _preparePath(target: any, targetIndex = 0) {\r\n const targetPropertyPath = this._animation.targetPropertyPath;\r\n\r\n if (targetPropertyPath.length > 1) {\r\n let property = target;\r\n for (let index = 0; index < targetPropertyPath.length - 1; index++) {\r\n const name = targetPropertyPath[index];\r\n property = property[name];\r\n if (property === undefined) {\r\n throw new Error(`Invalid property (${name}) in property path (${targetPropertyPath.join(\".\")})`);\r\n }\r\n }\r\n\r\n this._targetPath = targetPropertyPath[targetPropertyPath.length - 1];\r\n this._activeTargets[targetIndex] = property;\r\n } else {\r\n this._targetPath = targetPropertyPath[0];\r\n this._activeTargets[targetIndex] = target;\r\n }\r\n\r\n if (this._activeTargets[targetIndex][this._targetPath] === undefined) {\r\n throw new Error(`Invalid property (${this._targetPath}) in property path (${targetPropertyPath.join(\".\")})`);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the animation from the runtime animation\r\n */\r\n public get animation(): Animation {\r\n return this._animation;\r\n }\r\n\r\n /**\r\n * Resets the runtime animation to the beginning\r\n * @param restoreOriginal defines whether to restore the target property to the original value\r\n */\r\n public reset(restoreOriginal = false): void {\r\n if (restoreOriginal) {\r\n if (this._target instanceof Array) {\r\n let index = 0;\r\n for (const target of this._target) {\r\n if (this._originalValue[index] !== undefined) {\r\n this._setValue(target, this._activeTargets[index], this._originalValue[index], -1, index);\r\n }\r\n index++;\r\n }\r\n } else {\r\n if (this._originalValue[0] !== undefined) {\r\n this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);\r\n }\r\n }\r\n }\r\n\r\n this._offsetsCache = {};\r\n this._highLimitsCache = {};\r\n this._currentFrame = 0;\r\n this._blendingFactor = 0;\r\n\r\n // Events\r\n for (let index = 0; index < this._events.length; index++) {\r\n this._events[index].isDone = false;\r\n }\r\n }\r\n\r\n /**\r\n * Specifies if the runtime animation is stopped\r\n * @returns Boolean specifying if the runtime animation is stopped\r\n */\r\n public isStopped(): boolean {\r\n return this._stopped;\r\n }\r\n\r\n /**\r\n * Disposes of the runtime animation\r\n */\r\n public dispose(): void {\r\n const index = this._animation.runtimeAnimations.indexOf(this);\r\n\r\n if (index > -1) {\r\n this._animation.runtimeAnimations.splice(index, 1);\r\n }\r\n }\r\n\r\n /**\r\n * Apply the interpolated value to the target\r\n * @param currentValue defines the value computed by the animation\r\n * @param weight defines the weight to apply to this value (Defaults to 1.0)\r\n */\r\n public setValue(currentValue: any, weight: number) {\r\n if (this._targetIsArray) {\r\n for (let index = 0; index < this._target.length; index++) {\r\n const target = this._target[index];\r\n this._setValue(target, this._activeTargets[index], currentValue, weight, index);\r\n }\r\n return;\r\n }\r\n this._setValue(this._target, this._directTarget, currentValue, weight, 0);\r\n }\r\n\r\n private _getOriginalValues(targetIndex = 0) {\r\n let originalValue: any;\r\n const target = this._activeTargets[targetIndex];\r\n\r\n if (target.getLocalMatrix && this._targetPath === \"_matrix\") {\r\n // For bones\r\n originalValue = target.getLocalMatrix();\r\n } else {\r\n originalValue = target[this._targetPath];\r\n }\r\n\r\n if (originalValue && originalValue.clone) {\r\n this._originalValue[targetIndex] = originalValue.clone();\r\n } else {\r\n this._originalValue[targetIndex] = originalValue;\r\n }\r\n }\r\n\r\n private _registerTargetForLateAnimationBinding(runtimeAnimation: RuntimeAnimation, originalValue: any): void {\r\n const target = runtimeAnimation.target;\r\n this._scene._registeredForLateAnimationBindings.pushNoDuplicate(target);\r\n\r\n if (!target._lateAnimationHolders) {\r\n target._lateAnimationHolders = {};\r\n }\r\n\r\n if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath] = {\r\n totalWeight: 0,\r\n totalAdditiveWeight: 0,\r\n animations: [],\r\n additiveAnimations: [],\r\n originalValue: originalValue,\r\n };\r\n }\r\n\r\n if (runtimeAnimation.isAdditive) {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].additiveAnimations.push(runtimeAnimation);\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].totalAdditiveWeight += runtimeAnimation.weight;\r\n } else {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation);\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight;\r\n }\r\n }\r\n\r\n private _setValue(target: any, destination: any, currentValue: any, weight: number, targetIndex: number): void {\r\n // Set value\r\n this._currentActiveTarget = destination;\r\n\r\n this._weight = weight;\r\n\r\n if (this._enableBlending && this._blendingFactor <= 1.0) {\r\n if (!this._originalBlendValue) {\r\n const originalValue = destination[this._targetPath];\r\n\r\n if (originalValue.clone) {\r\n this._originalBlendValue = originalValue.clone();\r\n } else {\r\n this._originalBlendValue = originalValue;\r\n }\r\n }\r\n\r\n if (this._originalBlendValue.m) {\r\n // Matrix\r\n if (Animation.AllowMatrixDecomposeForInterpolation) {\r\n if (this._currentValue) {\r\n Matrix.DecomposeLerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);\r\n } else {\r\n this._currentValue = Matrix.DecomposeLerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n } else {\r\n if (this._currentValue) {\r\n Matrix.LerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);\r\n } else {\r\n this._currentValue = Matrix.Lerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n }\r\n } else {\r\n this._currentValue = Animation._UniversalLerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n\r\n const blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;\r\n this._blendingFactor += blendingSpeed;\r\n } else {\r\n if (!this._currentValue) {\r\n if (currentValue?.clone) {\r\n this._currentValue = currentValue.clone();\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n } else if (this._currentValue.copyFrom) {\r\n if (currentValue !== null) {\r\n this._currentValue.copyFrom(currentValue);\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n }\r\n\r\n if (weight !== -1.0) {\r\n this._registerTargetForLateAnimationBinding(this, this._originalValue[targetIndex]);\r\n } else {\r\n if (this._animationState.loopMode === Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT) {\r\n if (this._currentValue.addToRef) {\r\n this._currentValue.addToRef(this._originalValue[targetIndex], destination[this._targetPath]);\r\n } else {\r\n destination[this._targetPath] = this._originalValue[targetIndex] + this._currentValue;\r\n }\r\n } else {\r\n destination[this._targetPath] = this._currentValue;\r\n }\r\n }\r\n\r\n if (target.markAsDirty) {\r\n target.markAsDirty(this._animation.targetProperty);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the loop pmode of the runtime animation\r\n * @returns Loop Mode\r\n */\r\n private _getCorrectLoopMode(): number | undefined {\r\n if (this._target && this._target.animationPropertiesOverride) {\r\n return this._target.animationPropertiesOverride.loopMode as number;\r\n }\r\n\r\n return this._animation.loopMode;\r\n }\r\n\r\n /**\r\n * Move the current animation to a given frame\r\n * @param frame defines the frame to move to\r\n * @param weight defines the weight to apply to the animation (-1.0 by default)\r\n */\r\n public goToFrame(frame: number, weight = -1): void {\r\n const keys = this._animation.getKeys();\r\n\r\n if (frame < keys[0].frame) {\r\n frame = keys[0].frame;\r\n } else if (frame > keys[keys.length - 1].frame) {\r\n frame = keys[keys.length - 1].frame;\r\n }\r\n\r\n // Need to reset animation events\r\n const events = this._events;\r\n if (events.length) {\r\n for (let index = 0; index < events.length; index++) {\r\n if (!events[index].onlyOnce) {\r\n // reset events in the future\r\n events[index].isDone = events[index].frame < frame;\r\n }\r\n }\r\n }\r\n\r\n this._currentFrame = frame;\r\n const currentValue = this._animation._interpolate(frame, this._animationState);\r\n\r\n this.setValue(currentValue, weight);\r\n }\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _prepareForSpeedRatioChange(newSpeedRatio: number): void {\r\n const newAbsoluteFrame = (this._previousElapsedTime * (this._animation.framePerSecond * newSpeedRatio)) / 1000.0;\r\n\r\n this._absoluteFrameOffset = this._previousAbsoluteFrame - newAbsoluteFrame;\r\n }\r\n\r\n /**\r\n * Execute the current animation\r\n * @param elapsedTimeSinceAnimationStart defines the elapsed time (in milliseconds) since the animation was started\r\n * @param from defines the lower frame of the animation range\r\n * @param to defines the upper frame of the animation range\r\n * @param loop defines if the current animation must loop\r\n * @param speedRatio defines the current speed ratio\r\n * @param weight defines the weight of the animation (default is -1 so no weight)\r\n * @returns a boolean indicating if the animation is running\r\n */\r\n public animate(elapsedTimeSinceAnimationStart: number, from: number, to: number, loop: boolean, speedRatio: number, weight = -1.0): boolean {\r\n const animation = this._animation;\r\n const targetPropertyPath = animation.targetPropertyPath;\r\n if (!targetPropertyPath || targetPropertyPath.length < 1) {\r\n this._stopped = true;\r\n return false;\r\n }\r\n\r\n let returnValue = true;\r\n let currentFrame: number;\r\n const events = this._events;\r\n let frameRange: number;\r\n\r\n if (!this._coreRuntimeAnimation) {\r\n // Check limits\r\n if (from < this._minFrame || from > this._maxFrame) {\r\n from = this._minFrame;\r\n }\r\n if (to < this._minFrame || to > this._maxFrame) {\r\n to = this._maxFrame;\r\n }\r\n\r\n frameRange = to - from;\r\n let offsetValue: any;\r\n\r\n // Compute the frame according to the elapsed time and the fps of the animation (\"from\" and \"to\" are not factored in!)\r\n let absoluteFrame = (elapsedTimeSinceAnimationStart * (animation.framePerSecond * speedRatio)) / 1000.0 + this._absoluteFrameOffset;\r\n let highLimitValue = 0;\r\n\r\n // Apply the yoyo function if required\r\n let yoyoLoop = false;\r\n const yoyoMode = loop && this._animationState.loopMode === Animation.ANIMATIONLOOPMODE_YOYO;\r\n if (yoyoMode) {\r\n const position = (absoluteFrame - from) / frameRange;\r\n\r\n // Apply the yoyo curve\r\n const sin = Math.sin(position * Math.PI);\r\n const yoyoPosition = Math.abs(sin);\r\n\r\n // Map the yoyo position back to the range\r\n absoluteFrame = yoyoPosition * frameRange + from;\r\n\r\n const direction = sin >= 0 ? 1 : -1;\r\n if (this._yoyoDirection !== direction) {\r\n yoyoLoop = true;\r\n }\r\n\r\n this._yoyoDirection = direction;\r\n }\r\n\r\n this._previousElapsedTime = elapsedTimeSinceAnimationStart;\r\n this._previousAbsoluteFrame = absoluteFrame;\r\n\r\n if (!loop && to >= from && ((absoluteFrame >= frameRange && speedRatio > 0) || (absoluteFrame <= 0 && speedRatio < 0))) {\r\n // If we are out of range and not looping get back to caller\r\n returnValue = false;\r\n highLimitValue = animation.evaluate(to);\r\n } else if (!loop && from >= to && ((absoluteFrame <= frameRange && speedRatio < 0) || (absoluteFrame >= 0 && speedRatio > 0))) {\r\n returnValue = false;\r\n highLimitValue = animation.evaluate(from);\r\n } else if (this._animationState.loopMode !== Animation.ANIMATIONLOOPMODE_CYCLE) {\r\n const keyOffset = to.toString() + from.toString();\r\n if (!this._offsetsCache[keyOffset]) {\r\n this._animationState.repeatCount = 0;\r\n this._animationState.loopMode = Animation.ANIMATIONLOOPMODE_CYCLE; // force a specific codepath in animation._interpolate()!\r\n const fromValue = animation._interpolate(from, this._animationState);\r\n const toValue = animation._interpolate(to, this._animationState);\r\n\r\n this._animationState.loopMode = this._getCorrectLoopMode();\r\n switch (animation.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n this._offsetsCache[keyOffset] = toValue - fromValue;\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n this._highLimitsCache[keyOffset] = toValue;\r\n }\r\n\r\n highLimitValue = this._highLimitsCache[keyOffset];\r\n offsetValue = this._offsetsCache[keyOffset];\r\n }\r\n\r\n if (offsetValue === undefined) {\r\n switch (animation.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n offsetValue = 0;\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n offsetValue = _StaticOffsetValueQuaternion;\r\n break;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n offsetValue = _StaticOffsetValueVector3;\r\n break;\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n offsetValue = _StaticOffsetValueVector2;\r\n break;\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n offsetValue = _StaticOffsetValueSize;\r\n break;\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n offsetValue = _StaticOffsetValueColor3;\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n offsetValue = _StaticOffsetValueColor4;\r\n break;\r\n }\r\n }\r\n\r\n // Compute value\r\n\r\n if (this._host && this._host.syncRoot) {\r\n // If we must sync with an animatable, calculate the current frame based on the frame of the root animatable\r\n const syncRoot = this._host.syncRoot;\r\n const hostNormalizedFrame = (syncRoot.masterFrame - syncRoot.fromFrame) / (syncRoot.toFrame - syncRoot.fromFrame);\r\n currentFrame = from + frameRange * hostNormalizedFrame;\r\n } else {\r\n if ((absoluteFrame > 0 && from > to) || (absoluteFrame < 0 && from < to)) {\r\n currentFrame = returnValue && frameRange !== 0 ? to + (absoluteFrame % frameRange) : from;\r\n } else {\r\n currentFrame = returnValue && frameRange !== 0 ? from + (absoluteFrame % frameRange) : to;\r\n }\r\n }\r\n\r\n // Reset event/state if looping\r\n if ((!yoyoMode && ((speedRatio > 0 && this.currentFrame > currentFrame) || (speedRatio < 0 && this.currentFrame < currentFrame))) || (yoyoMode && yoyoLoop)) {\r\n this._onLoop();\r\n\r\n // Need to reset animation events\r\n for (let index = 0; index < events.length; index++) {\r\n if (!events[index].onlyOnce) {\r\n // reset event, the animation is looping\r\n events[index].isDone = false;\r\n }\r\n }\r\n\r\n this._animationState.key = speedRatio > 0 ? 0 : animation.getKeys().length - 1;\r\n }\r\n this._currentFrame = currentFrame;\r\n this._animationState.repeatCount = frameRange === 0 ? 0 : (absoluteFrame / frameRange) >> 0;\r\n this._animationState.highLimitValue = highLimitValue;\r\n this._animationState.offsetValue = offsetValue;\r\n } else {\r\n frameRange = to - from;\r\n currentFrame = this._coreRuntimeAnimation.currentFrame;\r\n this._currentFrame = currentFrame;\r\n this._animationState.repeatCount = this._coreRuntimeAnimation._animationState.repeatCount;\r\n this._animationState.highLimitValue = this._coreRuntimeAnimation._animationState.highLimitValue;\r\n this._animationState.offsetValue = this._coreRuntimeAnimation._animationState.offsetValue;\r\n }\r\n\r\n const currentValue = animation._interpolate(currentFrame, this._animationState);\r\n\r\n // Set value\r\n this.setValue(currentValue, weight);\r\n\r\n // Check events\r\n if (events.length) {\r\n for (let index = 0; index < events.length; index++) {\r\n // Make sure current frame has passed event frame and that event frame is within the current range\r\n // Also, handle both forward and reverse animations\r\n if (\r\n (frameRange >= 0 && currentFrame >= events[index].frame && events[index].frame >= from) ||\r\n (frameRange < 0 && currentFrame <= events[index].frame && events[index].frame <= from)\r\n ) {\r\n const event = events[index];\r\n if (!event.isDone) {\r\n // If event should be done only once, remove it.\r\n if (event.onlyOnce) {\r\n events.splice(index, 1);\r\n index--;\r\n }\r\n event.isDone = true;\r\n event.action(currentFrame);\r\n } // Don't do anything if the event has already been done.\r\n }\r\n }\r\n }\r\n\r\n if (!returnValue) {\r\n this._stopped = true;\r\n }\r\n\r\n return returnValue;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"runtimeAnimation.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/runtimeAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAEH,SAAS,EACT,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,GAC5B,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,MAAM,OAAO,gBAAgB;IA8GzB;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAA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} from \"../types\";\r\nimport { Matrix } from \"../Maths/math.vector\";\r\nimport {\r\n type _IAnimationState,\r\n Animation,\r\n _StaticOffsetValueColor3,\r\n _StaticOffsetValueColor4,\r\n _StaticOffsetValueQuaternion,\r\n _StaticOffsetValueSize,\r\n _StaticOffsetValueVector2,\r\n _StaticOffsetValueVector3,\r\n} from \"./animation\";\r\nimport { type AnimationEvent } from \"./animationEvent\";\r\nimport { type Animatable } from \"./animatable\";\r\nimport { type Scene } from \"../scene\";\r\nimport { type IAnimationKey } from \"./animationKey\";\r\n\r\n/**\r\n * Defines a runtime animation\r\n */\r\nexport class RuntimeAnimation {\r\n private _events = new Array<AnimationEvent>();\r\n\r\n /**\r\n * The current frame of the runtime animation\r\n */\r\n private _currentFrame: number = 0;\r\n\r\n /**\r\n * The animation used by the runtime animation\r\n */\r\n public _animation: Animation;\r\n\r\n /**\r\n * The target of the runtime animation\r\n */\r\n private _target: any;\r\n\r\n /**\r\n * The initiating animatable\r\n */\r\n private _host: Animatable;\r\n\r\n /**\r\n * The original value of the runtime animation\r\n */\r\n private _originalValue = new Array<any>();\r\n\r\n /**\r\n * The original blend value of the runtime animation\r\n */\r\n private _originalBlendValue: Nullable<any> = null;\r\n\r\n /**\r\n * The offsets cache of the runtime animation\r\n */\r\n private _offsetsCache: { [key: string]: any } = {};\r\n\r\n /**\r\n * The high limits cache of the runtime animation\r\n */\r\n private _highLimitsCache: { [key: string]: any } = {};\r\n\r\n /**\r\n * Specifies if the runtime animation has been stopped\r\n */\r\n private _stopped = false;\r\n\r\n /**\r\n * The blending factor of the runtime animation\r\n */\r\n private _blendingFactor = 0;\r\n\r\n /**\r\n * The BabylonJS scene\r\n */\r\n private _scene: Scene;\r\n\r\n /**\r\n * The current value of the runtime animation\r\n */\r\n private _currentValue: Nullable<any> = null;\r\n\r\n /** @internal */\r\n public _animationState: _IAnimationState;\r\n\r\n /**\r\n * The active target of the runtime animation\r\n */\r\n private _activeTargets: any[];\r\n private _currentActiveTarget: Nullable<any> = null;\r\n private _directTarget: Nullable<any> = null;\r\n\r\n /**\r\n * The target path of the runtime animation\r\n */\r\n private _targetPath: string = \"\";\r\n\r\n /**\r\n * The weight of the runtime animation\r\n */\r\n private _weight = 1.0;\r\n\r\n /**\r\n * The absolute frame offset of the runtime animation\r\n */\r\n private _absoluteFrameOffset = 0;\r\n\r\n /**\r\n * The previous elapsed time (since start of animation) of the runtime animation\r\n */\r\n private _previousElapsedTime: number = 0;\r\n\r\n private _yoyoDirection: number = 1;\r\n\r\n /**\r\n * The previous absolute frame of the runtime animation (meaning, without taking into account the from/to values, only the elapsed time and the fps)\r\n */\r\n private _previousAbsoluteFrame: number = 0;\r\n\r\n private _enableBlending: boolean;\r\n\r\n private _keys: IAnimationKey[];\r\n private _minFrame: number;\r\n private _maxFrame: number;\r\n private _targetIsArray = false;\r\n\r\n /** @internal */\r\n public _coreRuntimeAnimation: RuntimeAnimation | null = null;\r\n\r\n /**\r\n * Gets the current frame of the runtime animation\r\n */\r\n public get currentFrame(): number {\r\n return this._currentFrame;\r\n }\r\n\r\n /**\r\n * Gets the weight of the runtime animation\r\n */\r\n public get weight(): number {\r\n return this._weight;\r\n }\r\n\r\n /**\r\n * Gets the current value of the runtime animation\r\n */\r\n public get currentValue(): any {\r\n return this._currentValue;\r\n }\r\n\r\n /**\r\n * Gets or sets the target path of the runtime animation\r\n */\r\n public get targetPath(): string {\r\n return this._targetPath;\r\n }\r\n\r\n /**\r\n * Gets the actual target of the runtime animation\r\n */\r\n public get target(): any {\r\n return this._currentActiveTarget;\r\n }\r\n\r\n /**\r\n * Gets the additive state of the runtime animation\r\n */\r\n public get isAdditive(): boolean {\r\n return this._host && this._host.isAdditive;\r\n }\r\n\r\n /** @internal */\r\n public _onLoop: () => void;\r\n\r\n /**\r\n * Create a new RuntimeAnimation object\r\n * @param target defines the target of the animation\r\n * @param animation defines the source animation object\r\n * @param scene defines the hosting scene\r\n * @param host defines the initiating Animatable\r\n */\r\n public constructor(target: any, animation: Animation, scene: Scene, host: Animatable) {\r\n this._animation = animation;\r\n this._target = target;\r\n this._scene = scene;\r\n this._host = host;\r\n this._activeTargets = [];\r\n\r\n animation._runtimeAnimations.push(this);\r\n\r\n // State\r\n this._animationState = {\r\n key: 0,\r\n repeatCount: 0,\r\n loopMode: this._getCorrectLoopMode(),\r\n };\r\n\r\n if (this._animation.dataType === Animation.ANIMATIONTYPE_MATRIX) {\r\n this._animationState.workValue = Matrix.Zero();\r\n }\r\n\r\n // Limits\r\n this._keys = this._animation.getKeys();\r\n this._minFrame = this._keys[0].frame;\r\n this._maxFrame = this._keys[this._keys.length - 1].frame;\r\n\r\n // Add a start key at frame 0 if missing\r\n if (this._minFrame !== 0) {\r\n const newKey = { frame: 0, value: this._keys[0].value };\r\n this._keys.splice(0, 0, newKey);\r\n }\r\n\r\n // Check data\r\n if (this._target instanceof Array) {\r\n let index = 0;\r\n for (const target of this._target) {\r\n this._preparePath(target, index);\r\n this._getOriginalValues(index);\r\n index++;\r\n }\r\n this._targetIsArray = true;\r\n } else {\r\n this._preparePath(this._target);\r\n this._getOriginalValues();\r\n this._targetIsArray = false;\r\n this._directTarget = this._activeTargets[0];\r\n }\r\n\r\n // Cloning events locally\r\n const events = animation.getEvents();\r\n if (events && events.length > 0) {\r\n for (const e of events) {\r\n this._events.push(e._clone());\r\n }\r\n }\r\n\r\n this._enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;\r\n }\r\n\r\n private _preparePath(target: any, targetIndex = 0) {\r\n const targetPropertyPath = this._animation.targetPropertyPath;\r\n\r\n if (targetPropertyPath.length > 1) {\r\n let property = target;\r\n for (let index = 0; index < targetPropertyPath.length - 1; index++) {\r\n const name = targetPropertyPath[index];\r\n property = property[name];\r\n if (property === undefined) {\r\n throw new Error(`Invalid property (${name}) in property path (${targetPropertyPath.join(\".\")})`);\r\n }\r\n }\r\n\r\n this._targetPath = targetPropertyPath[targetPropertyPath.length - 1];\r\n this._activeTargets[targetIndex] = property;\r\n } else {\r\n this._targetPath = targetPropertyPath[0];\r\n this._activeTargets[targetIndex] = target;\r\n }\r\n\r\n if (this._activeTargets[targetIndex][this._targetPath] === undefined) {\r\n throw new Error(`Invalid property (${this._targetPath}) in property path (${targetPropertyPath.join(\".\")})`);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the animation from the runtime animation\r\n */\r\n public get animation(): Animation {\r\n return this._animation;\r\n }\r\n\r\n /**\r\n * Resets the runtime animation to the beginning\r\n * @param restoreOriginal defines whether to restore the target property to the original value\r\n */\r\n public reset(restoreOriginal = false): void {\r\n if (restoreOriginal) {\r\n if (this._target instanceof Array) {\r\n let index = 0;\r\n for (const target of this._target) {\r\n if (this._originalValue[index] !== undefined) {\r\n this._setValue(target, this._activeTargets[index], this._originalValue[index], -1, index);\r\n }\r\n index++;\r\n }\r\n } else {\r\n if (this._originalValue[0] !== undefined) {\r\n this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);\r\n }\r\n }\r\n }\r\n\r\n this._offsetsCache = {};\r\n this._highLimitsCache = {};\r\n this._currentFrame = 0;\r\n this._blendingFactor = 0;\r\n\r\n // Events\r\n for (let index = 0; index < this._events.length; index++) {\r\n this._events[index].isDone = false;\r\n }\r\n }\r\n\r\n /**\r\n * Specifies if the runtime animation is stopped\r\n * @returns Boolean specifying if the runtime animation is stopped\r\n */\r\n public isStopped(): boolean {\r\n return this._stopped;\r\n }\r\n\r\n /**\r\n * Disposes of the runtime animation\r\n */\r\n public dispose(): void {\r\n const index = this._animation.runtimeAnimations.indexOf(this);\r\n\r\n if (index > -1) {\r\n this._animation.runtimeAnimations.splice(index, 1);\r\n }\r\n }\r\n\r\n /**\r\n * Apply the interpolated value to the target\r\n * @param currentValue defines the value computed by the animation\r\n * @param weight defines the weight to apply to this value (Defaults to 1.0)\r\n */\r\n public setValue(currentValue: any, weight: number) {\r\n if (this._targetIsArray) {\r\n for (let index = 0; index < this._target.length; index++) {\r\n const target = this._target[index];\r\n this._setValue(target, this._activeTargets[index], currentValue, weight, index);\r\n }\r\n return;\r\n }\r\n this._setValue(this._target, this._directTarget, currentValue, weight, 0);\r\n }\r\n\r\n private _getOriginalValues(targetIndex = 0) {\r\n let originalValue: any;\r\n const target = this._activeTargets[targetIndex];\r\n\r\n if (target.getLocalMatrix && this._targetPath === \"_matrix\") {\r\n // For bones\r\n originalValue = target.getLocalMatrix();\r\n } else {\r\n originalValue = target[this._targetPath];\r\n }\r\n\r\n if (originalValue && originalValue.clone) {\r\n this._originalValue[targetIndex] = originalValue.clone();\r\n } else {\r\n this._originalValue[targetIndex] = originalValue;\r\n }\r\n }\r\n\r\n private _registerTargetForLateAnimationBinding(runtimeAnimation: RuntimeAnimation, originalValue: any): void {\r\n const target = runtimeAnimation.target;\r\n this._scene._registeredForLateAnimationBindings.pushNoDuplicate(target);\r\n\r\n if (!target._lateAnimationHolders) {\r\n target._lateAnimationHolders = {};\r\n }\r\n\r\n if (!target._lateAnimationHolders[runtimeAnimation.targetPath]) {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath] = {\r\n totalWeight: 0,\r\n totalAdditiveWeight: 0,\r\n animations: [],\r\n additiveAnimations: [],\r\n originalValue: originalValue,\r\n };\r\n }\r\n\r\n if (runtimeAnimation.isAdditive) {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].additiveAnimations.push(runtimeAnimation);\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].totalAdditiveWeight += runtimeAnimation.weight;\r\n } else {\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].animations.push(runtimeAnimation);\r\n target._lateAnimationHolders[runtimeAnimation.targetPath].totalWeight += runtimeAnimation.weight;\r\n }\r\n }\r\n\r\n private _setValue(target: any, destination: any, currentValue: any, weight: number, targetIndex: number): void {\r\n // Set value\r\n this._currentActiveTarget = destination;\r\n\r\n this._weight = weight;\r\n\r\n if (this._enableBlending && this._blendingFactor <= 1.0) {\r\n if (!this._originalBlendValue) {\r\n const originalValue = destination[this._targetPath];\r\n\r\n if (originalValue.clone) {\r\n this._originalBlendValue = originalValue.clone();\r\n } else {\r\n this._originalBlendValue = originalValue;\r\n }\r\n }\r\n\r\n if (this._originalBlendValue.m) {\r\n // Matrix\r\n if (Animation.AllowMatrixDecomposeForInterpolation) {\r\n if (this._currentValue) {\r\n Matrix.DecomposeLerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);\r\n } else {\r\n this._currentValue = Matrix.DecomposeLerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n } else {\r\n if (this._currentValue) {\r\n Matrix.LerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);\r\n } else {\r\n this._currentValue = Matrix.Lerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n }\r\n } else {\r\n this._currentValue = Animation._UniversalLerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n\r\n const blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;\r\n this._blendingFactor += blendingSpeed;\r\n } else {\r\n if (!this._currentValue) {\r\n if (currentValue?.clone) {\r\n this._currentValue = currentValue.clone();\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n } else if (this._currentValue.copyFrom) {\r\n if (currentValue !== null) {\r\n this._currentValue.copyFrom(currentValue);\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n }\r\n\r\n if (weight !== -1.0) {\r\n this._registerTargetForLateAnimationBinding(this, this._originalValue[targetIndex]);\r\n } else {\r\n if (this._animationState.loopMode === Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT) {\r\n if (this._currentValue.addToRef) {\r\n this._currentValue.addToRef(this._originalValue[targetIndex], destination[this._targetPath]);\r\n } else {\r\n destination[this._targetPath] = this._originalValue[targetIndex] + this._currentValue;\r\n }\r\n } else {\r\n destination[this._targetPath] = this._currentValue;\r\n }\r\n }\r\n\r\n if (target.markAsDirty) {\r\n target.markAsDirty(this._animation.targetProperty);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the loop pmode of the runtime animation\r\n * @returns Loop Mode\r\n */\r\n private _getCorrectLoopMode(): number | undefined {\r\n if (this._target && this._target.animationPropertiesOverride) {\r\n return this._target.animationPropertiesOverride.loopMode as number;\r\n }\r\n\r\n return this._animation.loopMode;\r\n }\r\n\r\n /**\r\n * Move the current animation to a given frame\r\n * @param frame defines the frame to move to\r\n * @param weight defines the weight to apply to the animation (-1.0 by default)\r\n */\r\n public goToFrame(frame: number, weight = -1): void {\r\n const keys = this._animation.getKeys();\r\n\r\n if (frame < keys[0].frame) {\r\n frame = keys[0].frame;\r\n } else if (frame > keys[keys.length - 1].frame) {\r\n frame = keys[keys.length - 1].frame;\r\n }\r\n\r\n // Need to reset animation events\r\n const events = this._events;\r\n if (events.length) {\r\n for (let index = 0; index < events.length; index++) {\r\n if (!events[index].onlyOnce) {\r\n // reset events in the future\r\n events[index].isDone = events[index].frame < frame;\r\n }\r\n }\r\n }\r\n\r\n this._currentFrame = frame;\r\n const currentValue = this._animation._interpolate(frame, this._animationState);\r\n\r\n this.setValue(currentValue, weight);\r\n }\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _prepareForSpeedRatioChange(newSpeedRatio: number): void {\r\n const newAbsoluteFrame = (this._previousElapsedTime * (this._animation.framePerSecond * newSpeedRatio)) / 1000.0;\r\n\r\n this._absoluteFrameOffset = this._previousAbsoluteFrame - newAbsoluteFrame;\r\n }\r\n\r\n /**\r\n * Execute the current animation\r\n * @param elapsedTimeSinceAnimationStart defines the elapsed time (in milliseconds) since the animation was started\r\n * @param from defines the lower frame of the animation range\r\n * @param to defines the upper frame of the animation range\r\n * @param loop defines if the current animation must loop\r\n * @param speedRatio defines the current speed ratio\r\n * @param weight defines the weight of the animation (default is -1 so no weight)\r\n * @returns a boolean indicating if the animation is running\r\n */\r\n public animate(elapsedTimeSinceAnimationStart: number, from: number, to: number, loop: boolean, speedRatio: number, weight = -1.0): boolean {\r\n const animation = this._animation;\r\n const targetPropertyPath = animation.targetPropertyPath;\r\n if (!targetPropertyPath || targetPropertyPath.length < 1) {\r\n this._stopped = true;\r\n return false;\r\n }\r\n\r\n let returnValue = true;\r\n let currentFrame: number;\r\n const events = this._events;\r\n let frameRange: number;\r\n\r\n if (!this._coreRuntimeAnimation) {\r\n // Check limits\r\n if (from < this._minFrame || from > this._maxFrame) {\r\n from = this._minFrame;\r\n }\r\n if (to < this._minFrame || to > this._maxFrame) {\r\n to = this._maxFrame;\r\n }\r\n\r\n frameRange = to - from;\r\n let offsetValue: any;\r\n\r\n // Compute the frame according to the elapsed time and the fps of the animation (\"from\" and \"to\" are not factored in!)\r\n let absoluteFrame = (elapsedTimeSinceAnimationStart * (animation.framePerSecond * speedRatio)) / 1000.0 + this._absoluteFrameOffset;\r\n let highLimitValue = 0;\r\n\r\n // Apply the yoyo function if required\r\n let yoyoLoop = false;\r\n const yoyoMode = loop && this._animationState.loopMode === Animation.ANIMATIONLOOPMODE_YOYO;\r\n if (yoyoMode) {\r\n const position = (absoluteFrame - from) / frameRange;\r\n\r\n // Apply the yoyo curve\r\n const sin = Math.sin(position * Math.PI);\r\n const yoyoPosition = Math.abs(sin);\r\n\r\n // Map the yoyo position back to the range\r\n absoluteFrame = yoyoPosition * frameRange + from;\r\n\r\n const direction = sin >= 0 ? 1 : -1;\r\n if (this._yoyoDirection !== direction) {\r\n yoyoLoop = true;\r\n }\r\n\r\n this._yoyoDirection = direction;\r\n }\r\n\r\n this._previousElapsedTime = elapsedTimeSinceAnimationStart;\r\n this._previousAbsoluteFrame = absoluteFrame;\r\n\r\n if (!loop && to >= from && ((absoluteFrame >= frameRange && speedRatio > 0) || (absoluteFrame <= 0 && speedRatio < 0))) {\r\n // If we are out of range and not looping get back to caller\r\n returnValue = false;\r\n highLimitValue = animation.evaluate(to);\r\n } else if (!loop && from >= to && ((absoluteFrame <= frameRange && speedRatio < 0) || (absoluteFrame >= 0 && speedRatio > 0))) {\r\n returnValue = false;\r\n highLimitValue = animation.evaluate(from);\r\n } else if (this._animationState.loopMode !== Animation.ANIMATIONLOOPMODE_CYCLE) {\r\n const keyOffset = to.toString() + from.toString();\r\n if (!this._offsetsCache[keyOffset]) {\r\n this._animationState.repeatCount = 0;\r\n this._animationState.loopMode = Animation.ANIMATIONLOOPMODE_CYCLE; // force a specific codepath in animation._interpolate()!\r\n const fromValue = animation._interpolate(from, this._animationState);\r\n const toValue = animation._interpolate(to, this._animationState);\r\n\r\n this._animationState.loopMode = this._getCorrectLoopMode();\r\n switch (animation.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n this._offsetsCache[keyOffset] = toValue - fromValue;\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n this._highLimitsCache[keyOffset] = toValue;\r\n }\r\n\r\n highLimitValue = this._highLimitsCache[keyOffset];\r\n offsetValue = this._offsetsCache[keyOffset];\r\n }\r\n\r\n if (offsetValue === undefined) {\r\n switch (animation.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n offsetValue = 0;\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n offsetValue = _StaticOffsetValueQuaternion;\r\n break;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n offsetValue = _StaticOffsetValueVector3;\r\n break;\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n offsetValue = _StaticOffsetValueVector2;\r\n break;\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n offsetValue = _StaticOffsetValueSize;\r\n break;\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n offsetValue = _StaticOffsetValueColor3;\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n offsetValue = _StaticOffsetValueColor4;\r\n break;\r\n }\r\n }\r\n\r\n // Compute value\r\n\r\n if (this._host && this._host.syncRoot) {\r\n // If we must sync with an animatable, calculate the current frame based on the frame of the root animatable\r\n const syncRoot = this._host.syncRoot;\r\n const hostNormalizedFrame = (syncRoot.masterFrame - syncRoot.fromFrame) / (syncRoot.toFrame - syncRoot.fromFrame);\r\n currentFrame = from + frameRange * hostNormalizedFrame;\r\n } else {\r\n if ((absoluteFrame > 0 && from > to) || (absoluteFrame < 0 && from < to)) {\r\n currentFrame = returnValue && frameRange !== 0 ? to + (absoluteFrame % frameRange) : from;\r\n } else {\r\n currentFrame = returnValue && frameRange !== 0 ? from + (absoluteFrame % frameRange) : to;\r\n }\r\n }\r\n\r\n // Reset event/state if looping\r\n if ((!yoyoMode && ((speedRatio > 0 && this.currentFrame > currentFrame) || (speedRatio < 0 && this.currentFrame < currentFrame))) || (yoyoMode && yoyoLoop)) {\r\n if (this._onLoop) {\r\n this._onLoop();\r\n }\r\n\r\n // Need to reset animation events\r\n for (let index = 0; index < events.length; index++) {\r\n if (!events[index].onlyOnce) {\r\n // reset event, the animation is looping\r\n events[index].isDone = false;\r\n }\r\n }\r\n\r\n this._animationState.key = speedRatio > 0 ? 0 : animation.getKeys().length - 1;\r\n }\r\n this._currentFrame = currentFrame;\r\n this._animationState.repeatCount = frameRange === 0 ? 0 : (absoluteFrame / frameRange) >> 0;\r\n this._animationState.highLimitValue = highLimitValue;\r\n this._animationState.offsetValue = offsetValue;\r\n } else {\r\n frameRange = to - from;\r\n currentFrame = this._coreRuntimeAnimation.currentFrame;\r\n this._currentFrame = currentFrame;\r\n this._animationState.repeatCount = this._coreRuntimeAnimation._animationState.repeatCount;\r\n this._animationState.highLimitValue = this._coreRuntimeAnimation._animationState.highLimitValue;\r\n this._animationState.offsetValue = this._coreRuntimeAnimation._animationState.offsetValue;\r\n }\r\n\r\n const currentValue = animation._interpolate(currentFrame, this._animationState);\r\n\r\n // Set value\r\n this.setValue(currentValue, weight);\r\n\r\n // Check events\r\n if (events.length) {\r\n for (let index = 0; index < events.length; index++) {\r\n // Make sure current frame has passed event frame and that event frame is within the current range\r\n // Also, handle both forward and reverse animations\r\n if (\r\n (frameRange >= 0 && currentFrame >= events[index].frame && events[index].frame >= from) ||\r\n (frameRange < 0 && currentFrame <= events[index].frame && events[index].frame <= from)\r\n ) {\r\n const event = events[index];\r\n if (!event.isDone) {\r\n // If event should be done only once, remove it.\r\n if (event.onlyOnce) {\r\n events.splice(index, 1);\r\n index--;\r\n }\r\n event.isDone = true;\r\n event.action(currentFrame);\r\n } // Don't do anything if the event has already been done.\r\n }\r\n }\r\n }\r\n\r\n if (!returnValue) {\r\n this._stopped = true;\r\n }\r\n\r\n return returnValue;\r\n }\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onerjs/core",
3
- "version": "8.48.6",
3
+ "version": "8.48.8",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",