@onerjs/core 8.31.5 → 8.31.6
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.
- package/Animations/animation.d.ts +2 -1
- package/Animations/animation.js +3 -3
- package/Animations/animation.js.map +1 -1
- package/Behaviors/Cameras/interpolatingBehavior.js +10 -3
- package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraKeyboardInput.js +2 -0
- package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraPointersInput.js +3 -5
- package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
- package/Cameras/geospatialCamera.d.ts +10 -0
- package/Cameras/geospatialCamera.js +25 -3
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.d.ts +1 -0
- package/Cameras/geospatialCameraMovement.js +36 -0
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Particles/Node/Blocks/index.d.ts +1 -0
- package/Particles/Node/Blocks/index.js +1 -0
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleFloatToIntBlock.d.ts +46 -0
- package/Particles/Node/Blocks/particleFloatToIntBlock.js +120 -0
- package/Particles/Node/Blocks/particleFloatToIntBlock.js.map +1 -0
- package/Particles/Node/Blocks/systemBlock.d.ts +4 -4
- package/Particles/Node/Blocks/systemBlock.js +22 -16
- package/Particles/Node/Blocks/systemBlock.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.js +1 -1
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +61 -30
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +6 -0
- package/Particles/thinParticleSystem.js +21 -12
- package/Particles/thinParticleSystem.js.map +1 -1
- package/package.json +1 -1
|
@@ -218,9 +218,10 @@ export declare class Animation {
|
|
|
218
218
|
* @param transition The transition type we want to use
|
|
219
219
|
* @param duration The duration of the animation, in milliseconds
|
|
220
220
|
* @param onAnimationEnd Callback trigger at the end of the animation
|
|
221
|
+
* @param stopCurrent If true, will stop the current animation on the property
|
|
221
222
|
* @returns Nullable animation
|
|
222
223
|
*/
|
|
223
|
-
static TransitionTo(property: string, targetValue: any, host: any, scene: Scene, frameRate: number, transition: Animation, duration: number, onAnimationEnd?: Nullable<() => void
|
|
224
|
+
static TransitionTo(property: string, targetValue: any, host: any, scene: Scene, frameRate: number, transition: Animation, duration: number, onAnimationEnd?: Nullable<() => void>, stopCurrent?: boolean): Nullable<Animatable>;
|
|
224
225
|
/**
|
|
225
226
|
* Return the array of runtime animations currently using this animation
|
|
226
227
|
*/
|
package/Animations/animation.js
CHANGED
|
@@ -308,9 +308,10 @@ export class Animation {
|
|
|
308
308
|
* @param transition The transition type we want to use
|
|
309
309
|
* @param duration The duration of the animation, in milliseconds
|
|
310
310
|
* @param onAnimationEnd Callback trigger at the end of the animation
|
|
311
|
+
* @param stopCurrent If true, will stop the current animation on the property
|
|
311
312
|
* @returns Nullable animation
|
|
312
313
|
*/
|
|
313
|
-
static TransitionTo(property, targetValue, host, scene, frameRate, transition, duration, onAnimationEnd = null) {
|
|
314
|
+
static TransitionTo(property, targetValue, host, scene, frameRate, transition, duration, onAnimationEnd = null, stopCurrent = true) {
|
|
314
315
|
if (duration <= 0) {
|
|
315
316
|
host[property] = targetValue;
|
|
316
317
|
if (onAnimationEnd) {
|
|
@@ -333,8 +334,7 @@ export class Animation {
|
|
|
333
334
|
host.animations = [];
|
|
334
335
|
}
|
|
335
336
|
host.animations.push(transition);
|
|
336
|
-
const animation = scene.beginAnimation(host, 0, endFrame, false);
|
|
337
|
-
animation.onAnimationEnd = onAnimationEnd;
|
|
337
|
+
const animation = scene.beginAnimation(host, 0, endFrame, false, 1.0, onAnimationEnd ?? undefined, undefined, stopCurrent);
|
|
338
338
|
return animation;
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,8CAA8C;AAE9C,aAAa;AACb,MAAM,CAAC,MAAM,4BAA4B,GAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjH,UAAU;AACV,MAAM,CAAC,MAAM,yBAAyB,GAA2B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAE/F,UAAU;AACV,MAAM,CAAC,MAAM,yBAAyB,GAA2B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAE/F,OAAO;AACP,MAAM,CAAC,MAAM,sBAAsB,GAAwB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAA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,gCAAsB,GAAG,SAAS,CAAC,qBAAqB,AAAlC,CAAmC;AAG3E,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AAC9C,IAAI,CAAC,sBAAsB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAU,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC","sourcesContent":["import type { IEasingFunction, EasingFunction } from \"./easing\";\r\nimport { Vector3, Quaternion, Vector2, Matrix, TmpVectors } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport { Hermite, Lerp } from \"../Maths/math.scalar.functions\";\r\nimport type { DeepImmutable, Nullable } from \"../types\";\r\nimport type { Scene } from \"../scene\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { IAnimationKey } from \"./animationKey\";\r\nimport { AnimationKeyInterpolation } from \"./animationKey\";\r\nimport { AnimationRange } from \"./animationRange\";\r\nimport type { AnimationEvent } from \"./animationEvent\";\r\nimport { Node } from \"../node\";\r\nimport type { IAnimatable } from \"./animatable.interface\";\r\nimport { Size } from \"../Maths/math.size\";\r\nimport { WebRequest } from \"../Misc/webRequest\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { Animatable } from \"./animatable\";\r\nimport type { RuntimeAnimation } from \"./runtimeAnimation\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\n\r\n// Static values to help the garbage collector\r\n\r\n// Quaternion\r\nexport const _StaticOffsetValueQuaternion: DeepImmutable<Quaternion> = Object.freeze(new Quaternion(0, 0, 0, 0));\r\n\r\n// Vector3\r\nexport const _StaticOffsetValueVector3: DeepImmutable<Vector3> = Object.freeze(Vector3.Zero());\r\n\r\n// Vector2\r\nexport const _StaticOffsetValueVector2: DeepImmutable<Vector2> = Object.freeze(Vector2.Zero());\r\n\r\n// Size\r\nexport const _StaticOffsetValueSize: DeepImmutable<Size> = Object.freeze(Size.Zero());\r\n\r\n// Color3\r\nexport const _StaticOffsetValueColor3: DeepImmutable<Color3> = Object.freeze(Color3.Black());\r\n\r\n// Color4\r\nexport const _StaticOffsetValueColor4: DeepImmutable<Color4> = Object.freeze(new Color4(0, 0, 0, 0));\r\n\r\n/**\r\n * Options to be used when creating an additive animation\r\n */\r\nexport interface IMakeAnimationAdditiveOptions {\r\n /**\r\n * The frame that the animation should be relative to (if not provided, 0 will be used)\r\n */\r\n referenceFrame?: number;\r\n /**\r\n * The name of the animation range to convert to additive. If not provided, fromFrame / toFrame will be used\r\n * If fromFrame / toFrame are not provided either, the whole animation will be converted to additive\r\n */\r\n range?: string;\r\n /**\r\n * If true, the original animation will be cloned and converted to additive. If false, the original animation will be converted to additive (default is false)\r\n */\r\n cloneOriginalAnimation?: boolean;\r\n /**\r\n * The name of the cloned animation if cloneOriginalAnimation is true. If not provided, use the original animation name\r\n */\r\n clonedAnimationName?: string;\r\n /**\r\n * Together with toFrame, defines the range of the animation to convert to additive. Will only be used if range is not provided\r\n * If range and fromFrame / toFrame are not provided, the whole animation will be converted to additive\r\n */\r\n fromFrame?: number;\r\n /**\r\n * Together with fromFrame, defines the range of the animation to convert to additive.\r\n */\r\n toFrame?: number;\r\n /**\r\n * If true, the key frames will be clipped to the range specified by range or fromFrame / toFrame (default is false)\r\n */\r\n clipKeys?: boolean;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface _IAnimationState {\r\n key: number;\r\n repeatCount: number;\r\n workValue?: any;\r\n loopMode?: number;\r\n offsetValue?: any;\r\n highLimitValue?: any;\r\n}\r\n\r\nconst EvaluateAnimationState: _IAnimationState = {\r\n key: 0,\r\n repeatCount: 0,\r\n loopMode: 2 /*Animation.ANIMATIONLOOPMODE_CONSTANT*/,\r\n};\r\n\r\n/**\r\n * Class used to store any kind of animation\r\n */\r\nexport class Animation {\r\n private static _UniqueIdGenerator = 0;\r\n\r\n /**\r\n * Use matrix interpolation instead of using direct key value when animating matrices\r\n */\r\n public static AllowMatricesInterpolation = false;\r\n\r\n /**\r\n * When matrix interpolation is enabled, this boolean forces the system to use Matrix.DecomposeLerp instead of Matrix.Lerp. Interpolation is more precise but slower\r\n */\r\n public static AllowMatrixDecomposeForInterpolation = true;\r\n\r\n /**\r\n * Gets or sets the unique id of the animation (the uniqueness is solely among other animations)\r\n */\r\n public uniqueId: number;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /** Snippet ID if the animation was created from the snippet server */\r\n public snippetId: string;\r\n\r\n /**\r\n * Stores the key frames of the animation\r\n */\r\n private _keys: Array<IAnimationKey>;\r\n\r\n /**\r\n * Stores the easing function of the animation\r\n */\r\n private _easingFunction: Nullable<IEasingFunction> = null;\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _runtimeAnimations = new Array<RuntimeAnimation>();\r\n\r\n /**\r\n * The set of event that will be linked to this animation\r\n */\r\n private _events = new Array<AnimationEvent>();\r\n\r\n /**\r\n * Stores an array of target property paths\r\n */\r\n public targetPropertyPath: string[];\r\n\r\n /**\r\n * Stores the blending speed of the animation\r\n */\r\n public blendingSpeed = 0.01;\r\n\r\n /**\r\n * Stores the animation ranges for the animation\r\n */\r\n private _ranges: { [name: string]: Nullable<AnimationRange> } = {};\r\n\r\n /** @internal */\r\n public _coreAnimation: Nullable<Animation> = null;\r\n\r\n /**\r\n * Ensure do not serialize animation , default false\r\n */\r\n public doNotSerialize = false;\r\n\r\n /**\r\n * @internal Internal use\r\n */\r\n public static _PrepareAnimation(\r\n name: string,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction\r\n ): Nullable<Animation> {\r\n let dataType = undefined;\r\n\r\n if (!isNaN(parseFloat(from)) && isFinite(from)) {\r\n dataType = Animation.ANIMATIONTYPE_FLOAT;\r\n } else if (from instanceof Quaternion) {\r\n dataType = Animation.ANIMATIONTYPE_QUATERNION;\r\n } else if (from instanceof Vector3) {\r\n dataType = Animation.ANIMATIONTYPE_VECTOR3;\r\n } else if (from instanceof Vector2) {\r\n dataType = Animation.ANIMATIONTYPE_VECTOR2;\r\n } else if (from instanceof Color3) {\r\n dataType = Animation.ANIMATIONTYPE_COLOR3;\r\n } else if (from instanceof Color4) {\r\n dataType = Animation.ANIMATIONTYPE_COLOR4;\r\n } else if (from instanceof Size) {\r\n dataType = Animation.ANIMATIONTYPE_SIZE;\r\n }\r\n\r\n if (dataType == undefined) {\r\n return null;\r\n }\r\n\r\n const animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);\r\n\r\n const keys: Array<IAnimationKey> = [\r\n { frame: 0, value: from },\r\n { frame: totalFrame, value: to },\r\n ];\r\n animation.setKeys(keys);\r\n\r\n if (easingFunction !== undefined) {\r\n animation.setEasingFunction(easingFunction);\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Sets up an animation\r\n * @param property The property to animate\r\n * @param animationType The animation type to apply\r\n * @param framePerSecond The frames per second of the animation\r\n * @param easingFunction The easing function used in the animation\r\n * @returns The created animation\r\n */\r\n public static CreateAnimation(property: string, animationType: number, framePerSecond: number, easingFunction: EasingFunction): Animation {\r\n const animation: Animation = new Animation(property + \"Animation\", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);\r\n\r\n animation.setEasingFunction(easingFunction);\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Create and start an animation on a node\r\n * @param name defines the name of the global animation that will be run on all nodes\r\n * @param target defines the target where the animation will take place\r\n * @param targetProperty defines property to animate\r\n * @param framePerSecond defines the number of frame per second yo use\r\n * @param totalFrame defines the number of frames in total\r\n * @param from defines the initial value\r\n * @param to defines the final value\r\n * @param loopMode defines which loop mode you want to use (off by default)\r\n * @param easingFunction defines the easing function to use (linear by default)\r\n * @param onAnimationEnd defines the callback to call when animation end\r\n * @param scene defines the hosting scene\r\n * @returns the animatable created for this animation\r\n */\r\n public static CreateAndStartAnimation(\r\n name: string,\r\n target: any,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void,\r\n scene?: Scene\r\n ): Nullable<Animatable> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n if (target.getScene) {\r\n scene = target.getScene();\r\n }\r\n\r\n if (!scene) {\r\n return null;\r\n }\r\n\r\n return scene.beginDirectAnimation(target, [animation], 0, totalFrame, animation.loopMode !== Animation.ANIMATIONLOOPMODE_CONSTANT, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Create and start an animation on a node and its descendants\r\n * @param name defines the name of the global animation that will be run on all nodes\r\n * @param node defines the root node where the animation will take place\r\n * @param directDescendantsOnly if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used\r\n * @param targetProperty defines property to animate\r\n * @param framePerSecond defines the number of frame per second to use\r\n * @param totalFrame defines the number of frames in total\r\n * @param from defines the initial value\r\n * @param to defines the final value\r\n * @param loopMode defines which loop mode you want to use (off by default)\r\n * @param easingFunction defines the easing function to use (linear by default)\r\n * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node)\r\n * @returns the list of animatables created for all nodes\r\n * @example https://www.babylonjs-playground.com/#MH0VLI\r\n */\r\n public static CreateAndStartHierarchyAnimation(\r\n name: string,\r\n node: Node,\r\n directDescendantsOnly: boolean,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void\r\n ): Nullable<Animatable[]> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n const scene = node.getScene();\r\n return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Creates a new animation, merges it with the existing animations and starts it\r\n * @param name Name of the animation\r\n * @param node Node which contains the scene that begins the animations\r\n * @param targetProperty Specifies which property to animate\r\n * @param framePerSecond The frames per second of the animation\r\n * @param totalFrame The total number of frames\r\n * @param from The frame at the beginning of the animation\r\n * @param to The frame at the end of the animation\r\n * @param loopMode Specifies the loop mode of the animation\r\n * @param easingFunction (Optional) The easing function of the animation, which allow custom mathematical formulas for animations\r\n * @param onAnimationEnd Callback to run once the animation is complete\r\n * @returns Nullable animation\r\n */\r\n public static CreateMergeAndStartAnimation(\r\n name: string,\r\n node: Node,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void\r\n ): Nullable<Animatable> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n node.animations.push(animation);\r\n\r\n return node.getScene().beginAnimation(node, 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Convert the keyframes of an animation to be relative to a given reference frame.\r\n * @param sourceAnimation defines the Animation containing keyframes to convert\r\n * @param referenceFrame defines the frame that keyframes in the range will be relative to (default: 0)\r\n * @param range defines the name of the AnimationRange belonging to the Animation to convert\r\n * @param cloneOriginal defines whether or not to clone the animation and convert the clone or convert the original animation (default is false)\r\n * @param clonedName defines the name of the resulting cloned Animation if cloneOriginal is true\r\n * @returns a new Animation if cloneOriginal is true or the original Animation if cloneOriginal is false\r\n */\r\n public static MakeAnimationAdditive(sourceAnimation: Animation, referenceFrame?: number, range?: string, cloneOriginal?: boolean, clonedName?: string): Animation;\r\n\r\n /**\r\n * Convert the keyframes of an animation to be relative to a given reference frame.\r\n * @param sourceAnimation defines the Animation containing keyframes to convert\r\n * @param options defines the options to use when converting ey keyframes\r\n * @returns a new Animation if options.cloneOriginalAnimation is true or the original Animation if options.cloneOriginalAnimation is false\r\n */\r\n public static MakeAnimationAdditive(sourceAnimation: Animation, options?: IMakeAnimationAdditiveOptions): Animation;\r\n\r\n /** @internal */\r\n public static MakeAnimationAdditive(\r\n sourceAnimation: Animation,\r\n referenceFrameOrOptions?: number | IMakeAnimationAdditiveOptions,\r\n range?: string,\r\n cloneOriginal = false,\r\n clonedName?: string\r\n ): Animation {\r\n let options: IMakeAnimationAdditiveOptions;\r\n\r\n if (typeof referenceFrameOrOptions === \"object\") {\r\n options = referenceFrameOrOptions;\r\n } else {\r\n options = {\r\n referenceFrame: referenceFrameOrOptions ?? 0,\r\n range: range,\r\n cloneOriginalAnimation: cloneOriginal,\r\n clonedAnimationName: clonedName,\r\n };\r\n }\r\n\r\n let animation = sourceAnimation;\r\n\r\n if (options.cloneOriginalAnimation) {\r\n animation = sourceAnimation.clone();\r\n animation.name = options.clonedAnimationName || animation.name;\r\n }\r\n\r\n if (!animation._keys.length) {\r\n return animation;\r\n }\r\n\r\n const referenceFrame = options.referenceFrame && options.referenceFrame >= 0 ? options.referenceFrame : 0;\r\n let startIndex = 0;\r\n const firstKey = animation._keys[0];\r\n let endIndex = animation._keys.length - 1;\r\n const lastKey = animation._keys[endIndex];\r\n const valueStore = {\r\n referenceValue: firstKey.value,\r\n referencePosition: TmpVectors.Vector3[0],\r\n referenceQuaternion: TmpVectors.Quaternion[0],\r\n referenceScaling: TmpVectors.Vector3[1],\r\n keyPosition: TmpVectors.Vector3[2],\r\n keyQuaternion: TmpVectors.Quaternion[1],\r\n keyScaling: TmpVectors.Vector3[3],\r\n };\r\n let from = firstKey.frame;\r\n let to = lastKey.frame;\r\n if (options.range) {\r\n const rangeValue = animation.getRange(options.range);\r\n\r\n if (rangeValue) {\r\n from = rangeValue.from;\r\n to = rangeValue.to;\r\n }\r\n } else {\r\n from = options.fromFrame ?? from;\r\n to = options.toFrame ?? to;\r\n }\r\n\r\n if (from !== firstKey.frame) {\r\n startIndex = animation.createKeyForFrame(from);\r\n }\r\n\r\n if (to !== lastKey.frame) {\r\n endIndex = animation.createKeyForFrame(to);\r\n }\r\n\r\n // There's only one key, so use it\r\n if (animation._keys.length === 1) {\r\n const value = animation._getKeyValue(animation._keys[0]);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n }\r\n\r\n // Reference frame is before the first frame, so just use the first frame\r\n else if (referenceFrame <= firstKey.frame) {\r\n const value = animation._getKeyValue(firstKey.value);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n }\r\n\r\n // Reference frame is after the last frame, so just use the last frame\r\n else if (referenceFrame >= lastKey.frame) {\r\n const value = animation._getKeyValue(lastKey.value);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n }\r\n\r\n // Interpolate the reference value from the animation\r\n else {\r\n EvaluateAnimationState.key = 0;\r\n const value = animation._interpolate(referenceFrame, EvaluateAnimationState);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n }\r\n\r\n // Conjugate the quaternion\r\n if (animation.dataType === Animation.ANIMATIONTYPE_QUATERNION) {\r\n valueStore.referenceValue.normalize().conjugateInPlace();\r\n }\r\n\r\n // Decompose matrix and conjugate the quaternion\r\n else if (animation.dataType === Animation.ANIMATIONTYPE_MATRIX) {\r\n valueStore.referenceValue.decompose(valueStore.referenceScaling, valueStore.referenceQuaternion, valueStore.referencePosition);\r\n valueStore.referenceQuaternion.normalize().conjugateInPlace();\r\n }\r\n\r\n let startFrame = Number.MAX_VALUE;\r\n const clippedKeys: Nullable<IAnimationKey[]> = options.clipKeys ? [] : null;\r\n\r\n // Subtract the reference value from all of the key values\r\n for (let index = startIndex; index <= endIndex; index++) {\r\n let key = animation._keys[index];\r\n\r\n if (clippedKeys || options.cloneOriginalAnimation) {\r\n key = {\r\n frame: key.frame,\r\n value: key.value.clone ? key.value.clone() : key.value,\r\n inTangent: key.inTangent,\r\n outTangent: key.outTangent,\r\n interpolation: key.interpolation,\r\n lockedTangent: key.lockedTangent,\r\n };\r\n if (clippedKeys) {\r\n if (startFrame === Number.MAX_VALUE) {\r\n startFrame = key.frame;\r\n }\r\n key.frame -= startFrame;\r\n clippedKeys.push(key);\r\n }\r\n }\r\n\r\n // If this key was duplicated to create a frame 0 key, skip it because its value has already been updated\r\n if (index && animation.dataType !== Animation.ANIMATIONTYPE_FLOAT && key.value === firstKey.value) {\r\n continue;\r\n }\r\n\r\n switch (animation.dataType) {\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n key.value.decompose(valueStore.keyScaling, valueStore.keyQuaternion, valueStore.keyPosition);\r\n valueStore.keyPosition.subtractInPlace(valueStore.referencePosition);\r\n valueStore.keyScaling.divideInPlace(valueStore.referenceScaling);\r\n valueStore.referenceQuaternion.multiplyToRef(valueStore.keyQuaternion, valueStore.keyQuaternion);\r\n Matrix.ComposeToRef(valueStore.keyScaling, valueStore.keyQuaternion, valueStore.keyPosition, key.value);\r\n break;\r\n\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n valueStore.referenceValue.multiplyToRef(key.value, key.value);\r\n break;\r\n\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n key.value.subtractToRef(valueStore.referenceValue, key.value);\r\n break;\r\n\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n key.value.width -= valueStore.referenceValue.width;\r\n key.value.height -= valueStore.referenceValue.height;\r\n break;\r\n\r\n default:\r\n key.value -= valueStore.referenceValue;\r\n }\r\n }\r\n\r\n if (clippedKeys) {\r\n animation.setKeys(clippedKeys, true);\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Transition property of an host to the target Value\r\n * @param property The property to transition\r\n * @param targetValue The target Value of the property\r\n * @param host The object where the property to animate belongs\r\n * @param scene Scene used to run the animation\r\n * @param frameRate Framerate (in frame/s) to use\r\n * @param transition The transition type we want to use\r\n * @param duration The duration of the animation, in milliseconds\r\n * @param onAnimationEnd Callback trigger at the end of the animation\r\n * @returns Nullable animation\r\n */\r\n public static TransitionTo(\r\n property: string,\r\n targetValue: any,\r\n host: any,\r\n scene: Scene,\r\n frameRate: number,\r\n transition: Animation,\r\n duration: number,\r\n onAnimationEnd: Nullable<() => void> = null\r\n ): Nullable<Animatable> {\r\n if (duration <= 0) {\r\n host[property] = targetValue;\r\n if (onAnimationEnd) {\r\n onAnimationEnd();\r\n }\r\n return null;\r\n }\r\n\r\n const endFrame: number = frameRate * (duration / 1000);\r\n\r\n transition.setKeys([\r\n {\r\n frame: 0,\r\n value: host[property].clone ? host[property].clone() : host[property],\r\n },\r\n {\r\n frame: endFrame,\r\n value: targetValue,\r\n },\r\n ]);\r\n\r\n if (!host.animations) {\r\n host.animations = [];\r\n }\r\n\r\n host.animations.push(transition);\r\n\r\n const animation: Animatable = scene.beginAnimation(host, 0, endFrame, false);\r\n animation.onAnimationEnd = onAnimationEnd;\r\n return animation;\r\n }\r\n\r\n /**\r\n * Return the array of runtime animations currently using this animation\r\n */\r\n public get runtimeAnimations(): RuntimeAnimation[] {\r\n return this._runtimeAnimations;\r\n }\r\n\r\n /**\r\n * Specifies if any of the runtime animations are currently running\r\n */\r\n public get hasRunningRuntimeAnimations(): boolean {\r\n for (const runtimeAnimation of this._runtimeAnimations) {\r\n if (!runtimeAnimation.isStopped()) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Initializes the animation\r\n * @param name Name of the animation\r\n * @param targetProperty Property to animate\r\n * @param framePerSecond The frames per second of the animation\r\n * @param dataType The data type of the animation\r\n * @param loopMode The loop mode of the animation\r\n * @param enableBlending Specifies if blending should be enabled\r\n */\r\n constructor(\r\n /**Name of the animation */\r\n public name: string,\r\n /**Property to animate */\r\n public targetProperty: string,\r\n /**The frames per second of the animation */\r\n public framePerSecond: number,\r\n /**The data type of the animation */\r\n public dataType: number,\r\n /**The loop mode of the animation */\r\n public loopMode?: number,\r\n /**Specifies if blending should be enabled */\r\n public enableBlending?: boolean\r\n ) {\r\n this.targetPropertyPath = targetProperty.split(\".\");\r\n this.dataType = dataType;\r\n this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode;\r\n this.uniqueId = Animation._UniqueIdGenerator++;\r\n }\r\n\r\n // Methods\r\n /**\r\n * Converts the animation to a string\r\n * @param fullDetails support for multiple levels of logging within scene loading\r\n * @returns String form of the animation\r\n */\r\n public toString(fullDetails?: boolean): string {\r\n let ret = \"Name: \" + this.name + \", property: \" + this.targetProperty;\r\n ret += \", datatype: \" + [\"Float\", \"Vector3\", \"Quaternion\", \"Matrix\", \"Color3\", \"Vector2\"][this.dataType];\r\n ret += \", nKeys: \" + (this._keys ? this._keys.length : \"none\");\r\n ret += \", nRanges: \" + (this._ranges ? Object.keys(this._ranges).length : \"none\");\r\n if (fullDetails) {\r\n ret += \", Ranges: {\";\r\n let first = true;\r\n for (const name in this._ranges) {\r\n if (first) {\r\n ret += \", \";\r\n first = false;\r\n }\r\n ret += name;\r\n }\r\n ret += \"}\";\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Add an event to this animation\r\n * @param event Event to add\r\n */\r\n public addEvent(event: AnimationEvent): void {\r\n this._events.push(event);\r\n this._events.sort((a, b) => a.frame - b.frame);\r\n }\r\n\r\n /**\r\n * Remove all events found at the given frame\r\n * @param frame The frame to remove events from\r\n */\r\n public removeEvents(frame: number): void {\r\n for (let index = 0; index < this._events.length; index++) {\r\n if (this._events[index].frame === frame) {\r\n this._events.splice(index, 1);\r\n index--;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves all the events from the animation\r\n * @returns Events from the animation\r\n */\r\n public getEvents(): AnimationEvent[] {\r\n return this._events;\r\n }\r\n\r\n /**\r\n * Creates an animation range\r\n * @param name Name of the animation range\r\n * @param from Starting frame of the animation range\r\n * @param to Ending frame of the animation\r\n */\r\n public createRange(name: string, from: number, to: number): void {\r\n // check name not already in use; could happen for bones after serialized\r\n if (!this._ranges[name]) {\r\n this._ranges[name] = new AnimationRange(name, from, to);\r\n }\r\n }\r\n\r\n /**\r\n * Deletes an animation range by name\r\n * @param name Name of the animation range to delete\r\n * @param deleteFrames Specifies if the key frames for the range should also be deleted (true) or not (false)\r\n */\r\n public deleteRange(name: string, deleteFrames = true): void {\r\n const range = this._ranges[name];\r\n if (!range) {\r\n return;\r\n }\r\n if (deleteFrames) {\r\n const from = range.from;\r\n const to = range.to;\r\n\r\n // this loop MUST go high to low for multiple splices to work\r\n for (let key = this._keys.length - 1; key >= 0; key--) {\r\n if (this._keys[key].frame >= from && this._keys[key].frame <= to) {\r\n this._keys.splice(key, 1);\r\n }\r\n }\r\n }\r\n this._ranges[name] = null; // said much faster than 'delete this._range[name]'\r\n }\r\n\r\n /**\r\n * Gets the animation range by name, or null if not defined\r\n * @param name Name of the animation range\r\n * @returns Nullable animation range\r\n */\r\n public getRange(name: string): Nullable<AnimationRange> {\r\n return this._ranges[name];\r\n }\r\n\r\n /**\r\n * Gets the key frames from the animation\r\n * @returns The key frames of the animation\r\n */\r\n public getKeys(): Array<IAnimationKey> {\r\n return this._keys;\r\n }\r\n\r\n /**\r\n * Gets the highest frame of the animation\r\n * @returns Highest frame of the animation\r\n */\r\n public getHighestFrame(): number {\r\n let ret = 0;\r\n\r\n for (let key = 0, nKeys = this._keys.length; key < nKeys; key++) {\r\n if (ret < this._keys[key].frame) {\r\n ret = this._keys[key].frame;\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Gets the easing function of the animation\r\n * @returns Easing function of the animation\r\n */\r\n public getEasingFunction(): Nullable<IEasingFunction> {\r\n return this._easingFunction;\r\n }\r\n\r\n /**\r\n * Sets the easing function of the animation\r\n * @param easingFunction A custom mathematical formula for animation\r\n */\r\n public setEasingFunction(easingFunction: Nullable<IEasingFunction>): void {\r\n this._easingFunction = easingFunction;\r\n }\r\n\r\n /**\r\n * Interpolates a scalar linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated scalar value\r\n */\r\n public floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number {\r\n return Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a scalar cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated scalar value\r\n */\r\n public floatInterpolateFunctionWithTangents(startValue: number, outTangent: number, endValue: number, inTangent: number, gradient: number): number {\r\n return Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a quaternion using a spherical linear interpolation\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated quaternion value\r\n */\r\n public quaternionInterpolateFunction(startValue: Quaternion, endValue: Quaternion, gradient: number): Quaternion {\r\n return Quaternion.Slerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a quaternion cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated quaternion value\r\n */\r\n public quaternionInterpolateFunctionWithTangents(startValue: Quaternion, outTangent: Quaternion, endValue: Quaternion, inTangent: Quaternion, gradient: number): Quaternion {\r\n return Quaternion.Hermite(startValue, outTangent, endValue, inTangent, gradient).normalize();\r\n }\r\n\r\n /**\r\n * Interpolates a Vector3 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated scalar value\r\n */\r\n public vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3 {\r\n return Vector3.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector3 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns InterpolatedVector3 value\r\n */\r\n public vector3InterpolateFunctionWithTangents(startValue: Vector3, outTangent: Vector3, endValue: Vector3, inTangent: Vector3, gradient: number): Vector3 {\r\n return Vector3.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector2 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated Vector2 value\r\n */\r\n public vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2 {\r\n return Vector2.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector2 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated Vector2 value\r\n */\r\n public vector2InterpolateFunctionWithTangents(startValue: Vector2, outTangent: Vector2, endValue: Vector2, inTangent: Vector2, gradient: number): Vector2 {\r\n return Vector2.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a size linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Size value\r\n */\r\n public sizeInterpolateFunction(startValue: Size, endValue: Size, gradient: number): Size {\r\n return Size.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color3 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Color3 value\r\n */\r\n public color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3 {\r\n return Color3.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color3 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns interpolated value\r\n */\r\n public color3InterpolateFunctionWithTangents(startValue: Color3, outTangent: Color3, endValue: Color3, inTangent: Color3, gradient: number): Color3 {\r\n return Color3.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color4 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Color3 value\r\n */\r\n public color4InterpolateFunction(startValue: Color4, endValue: Color4, gradient: number): Color4 {\r\n return Color4.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color4 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns interpolated value\r\n */\r\n public color4InterpolateFunctionWithTangents(startValue: Color4, outTangent: Color4, endValue: Color4, inTangent: Color4, gradient: number): Color4 {\r\n return Color4.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _getKeyValue(value: any): any {\r\n if (typeof value === \"function\") {\r\n return value();\r\n }\r\n\r\n return value;\r\n }\r\n\r\n /**\r\n * Evaluate the animation value at a given frame\r\n * @param currentFrame defines the frame where we want to evaluate the animation\r\n * @returns the animation value\r\n */\r\n public evaluate(currentFrame: number) {\r\n EvaluateAnimationState.key = 0;\r\n return this._interpolate(currentFrame, EvaluateAnimationState);\r\n }\r\n\r\n /** @internal */\r\n public _key: number;\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _interpolate(currentFrame: number, state: _IAnimationState, searchClosestKeyOnly = false): any {\r\n if (state.loopMode === Animation.ANIMATIONLOOPMODE_CONSTANT && state.repeatCount > 0) {\r\n return state.highLimitValue.clone ? state.highLimitValue.clone() : state.highLimitValue;\r\n }\r\n\r\n const keys = this._keys;\r\n let key: number;\r\n\r\n if (!this._coreAnimation) {\r\n const keysLength = keys.length;\r\n\r\n key = state.key;\r\n\r\n while (key >= 0 && currentFrame < keys[key].frame) {\r\n --key;\r\n }\r\n\r\n while (key + 1 <= keysLength - 1 && currentFrame >= keys[key + 1].frame) {\r\n ++key;\r\n }\r\n\r\n state.key = key;\r\n\r\n if (key < 0) {\r\n return searchClosestKeyOnly ? undefined : this._getKeyValue(keys[0].value);\r\n } else if (key + 1 > keysLength - 1) {\r\n return searchClosestKeyOnly ? undefined : this._getKeyValue(keys[keysLength - 1].value);\r\n }\r\n\r\n this._key = key;\r\n } else {\r\n key = this._coreAnimation._key;\r\n }\r\n\r\n const startKey = keys[key];\r\n const endKey = keys[key + 1];\r\n\r\n if (searchClosestKeyOnly && (currentFrame === startKey.frame || currentFrame === endKey.frame)) {\r\n return undefined;\r\n }\r\n const startValue = this._getKeyValue(startKey.value);\r\n const endValue = this._getKeyValue(endKey.value);\r\n if (startKey.interpolation === AnimationKeyInterpolation.STEP) {\r\n if (endKey.frame > currentFrame) {\r\n return startValue;\r\n } else {\r\n return endValue;\r\n }\r\n }\r\n\r\n const useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;\r\n const frameDelta = endKey.frame - startKey.frame;\r\n\r\n // gradient : percent of currentFrame between the frame inf and the frame sup\r\n let gradient = (currentFrame - startKey.frame) / frameDelta;\r\n\r\n // check for easingFunction and correction of gradient\r\n const easingFunction = startKey.easingFunction || this.getEasingFunction();\r\n // can also be undefined, if not provided\r\n if (easingFunction) {\r\n gradient = easingFunction.ease(gradient);\r\n }\r\n\r\n switch (this.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT: {\r\n const floatValue = useTangent\r\n ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient)\r\n : this.floatInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return floatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return (state.offsetValue ?? 0) * state.repeatCount + floatValue;\r\n }\r\n break;\r\n }\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION: {\r\n const quatValue = useTangent\r\n ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.quaternionInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return quatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return quatValue.addInPlace((state.offsetValue || _StaticOffsetValueQuaternion).scale(state.repeatCount));\r\n }\r\n\r\n return quatValue;\r\n }\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3: {\r\n const vec3Value = useTangent\r\n ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.vector3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return vec3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return vec3Value.add((state.offsetValue || _StaticOffsetValueVector3).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2: {\r\n const vec2Value = useTangent\r\n ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.vector2InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return vec2Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return vec2Value.add((state.offsetValue || _StaticOffsetValueVector2).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE: {\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient);\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient).add((state.offsetValue || _StaticOffsetValueSize).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3: {\r\n const color3Value = useTangent\r\n ? this.color3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.color3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return color3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return color3Value.add((state.offsetValue || _StaticOffsetValueColor3).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Color4\r\n case Animation.ANIMATIONTYPE_COLOR4: {\r\n const color4Value = useTangent\r\n ? this.color4InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.color4InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return color4Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return color4Value.add((state.offsetValue || _StaticOffsetValueColor4).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Matrix\r\n case Animation.ANIMATIONTYPE_MATRIX: {\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO: {\r\n if (Animation.AllowMatricesInterpolation) {\r\n return this.matrixInterpolateFunction(startValue, endValue, gradient, state.workValue);\r\n }\r\n return startValue;\r\n }\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT: {\r\n return startValue;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n /**\r\n * Defines the function to use to interpolate matrices\r\n * @param startValue defines the start matrix\r\n * @param endValue defines the end matrix\r\n * @param gradient defines the gradient between both matrices\r\n * @param result defines an optional target matrix where to store the interpolation\r\n * @returns the interpolated matrix\r\n */\r\n public matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number, result?: Matrix): Matrix {\r\n if (Animation.AllowMatrixDecomposeForInterpolation) {\r\n if (result) {\r\n Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n return Matrix.DecomposeLerp(startValue, endValue, gradient);\r\n }\r\n\r\n if (result) {\r\n Matrix.LerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n return Matrix.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Makes a copy of the animation\r\n * @returns Cloned animation\r\n */\r\n public clone(): Animation {\r\n const clone = new Animation(this.name, this.targetPropertyPath.join(\".\"), this.framePerSecond, this.dataType, this.loopMode);\r\n\r\n clone.enableBlending = this.enableBlending;\r\n clone.blendingSpeed = this.blendingSpeed;\r\n\r\n if (this._keys) {\r\n clone.setKeys(this._keys);\r\n }\r\n\r\n if (this._ranges) {\r\n clone._ranges = {};\r\n for (const name in this._ranges) {\r\n const range = this._ranges[name];\r\n if (!range) {\r\n continue;\r\n }\r\n clone._ranges[name] = range.clone();\r\n }\r\n }\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Sets the key frames of the animation\r\n * @param values The animation key frames to set\r\n * @param dontClone Whether to clone the keys or not (default is false, so the array of keys is cloned)\r\n */\r\n public setKeys(values: Array<IAnimationKey>, dontClone = false): void {\r\n this._keys = !dontClone ? values.slice(0) : values;\r\n }\r\n\r\n /**\r\n * Creates a key for the frame passed as a parameter and adds it to the animation IF a key doesn't already exist for that frame\r\n * @param frame Frame number\r\n * @returns The key index if the key was added or the index of the pre existing key if the frame passed as parameter already has a corresponding key\r\n */\r\n public createKeyForFrame(frame: number) {\r\n // Find the key corresponding to frame\r\n EvaluateAnimationState.key = 0;\r\n const value = this._interpolate(frame, EvaluateAnimationState, true);\r\n\r\n if (!value) {\r\n // A key corresponding to this frame already exists\r\n return this._keys[EvaluateAnimationState.key].frame === frame ? EvaluateAnimationState.key : EvaluateAnimationState.key + 1;\r\n }\r\n\r\n // The frame is between two keys, so create a new key\r\n const newKey: IAnimationKey = {\r\n frame,\r\n value: value.clone ? value.clone() : value,\r\n };\r\n\r\n this._keys.splice(EvaluateAnimationState.key + 1, 0, newKey);\r\n\r\n return EvaluateAnimationState.key + 1;\r\n }\r\n\r\n /**\r\n * Serializes the animation to an object\r\n * @returns Serialized object\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n\r\n serializationObject.name = this.name;\r\n serializationObject.property = this.targetProperty;\r\n serializationObject.framePerSecond = this.framePerSecond;\r\n serializationObject.dataType = this.dataType;\r\n serializationObject.loopBehavior = this.loopMode;\r\n serializationObject.enableBlending = this.enableBlending;\r\n serializationObject.blendingSpeed = this.blendingSpeed;\r\n\r\n const dataType = this.dataType;\r\n serializationObject.keys = [];\r\n const keys = this.getKeys();\r\n for (let index = 0; index < keys.length; index++) {\r\n const animationKey = keys[index];\r\n\r\n const key: any = {};\r\n key.frame = animationKey.frame;\r\n\r\n switch (dataType) {\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n key.values = [animationKey.value];\r\n if (animationKey.inTangent !== undefined) {\r\n key.values.push(animationKey.inTangent);\r\n }\r\n if (animationKey.outTangent !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.outTangent);\r\n }\r\n if (animationKey.interpolation !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n if (animationKey.outTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.interpolation);\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n key.values = animationKey.value.asArray();\r\n if (animationKey.inTangent != undefined) {\r\n key.values.push(animationKey.inTangent.asArray());\r\n }\r\n if (animationKey.outTangent != undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.outTangent.asArray());\r\n }\r\n if (animationKey.interpolation !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n if (animationKey.outTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.interpolation);\r\n }\r\n break;\r\n }\r\n\r\n serializationObject.keys.push(key);\r\n }\r\n\r\n serializationObject.ranges = [];\r\n for (const name in this._ranges) {\r\n const source = this._ranges[name];\r\n\r\n if (!source) {\r\n continue;\r\n }\r\n const range: any = {};\r\n range.name = name;\r\n range.from = source.from;\r\n range.to = source.to;\r\n serializationObject.ranges.push(range);\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Float animation type\r\n */\r\n public static readonly ANIMATIONTYPE_FLOAT = Constants.ANIMATIONTYPE_FLOAT;\r\n /**\r\n * Vector3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_VECTOR3 = Constants.ANIMATIONTYPE_VECTOR3;\r\n /**\r\n * Quaternion animation type\r\n */\r\n public static readonly ANIMATIONTYPE_QUATERNION = Constants.ANIMATIONTYPE_QUATERNION;\r\n /**\r\n * Matrix animation type\r\n */\r\n public static readonly ANIMATIONTYPE_MATRIX = Constants.ANIMATIONTYPE_MATRIX;\r\n /**\r\n * Color3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_COLOR3 = Constants.ANIMATIONTYPE_COLOR3;\r\n /**\r\n * Color3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_COLOR4 = Constants.ANIMATIONTYPE_COLOR4;\r\n /**\r\n * Vector2 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_VECTOR2 = Constants.ANIMATIONTYPE_VECTOR2;\r\n /**\r\n * Size animation type\r\n */\r\n public static readonly ANIMATIONTYPE_SIZE = Constants.ANIMATIONTYPE_SIZE;\r\n /**\r\n * Relative Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_RELATIVE = 0;\r\n /**\r\n * Cycle Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_CYCLE = 1;\r\n /**\r\n * Constant Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_CONSTANT = 2;\r\n /**\r\n * Yoyo Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_YOYO = 4;\r\n /**\r\n * Relative Loop Mode (add to current value of animated object, unlike ANIMATIONLOOPMODE_RELATIVE)\r\n */\r\n public static readonly ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT = 5;\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _UniversalLerp(left: any, right: any, amount: number): any {\r\n const constructor = left.constructor;\r\n if (constructor.Lerp) {\r\n // Lerp supported\r\n return constructor.Lerp(left, right, amount);\r\n } else if (constructor.Slerp) {\r\n // Slerp supported\r\n return constructor.Slerp(left, right, amount);\r\n } else if (left.toFixed) {\r\n // Number\r\n return left * (1.0 - amount) + amount * right;\r\n } else {\r\n // Blending not supported\r\n return right;\r\n }\r\n }\r\n\r\n /**\r\n * Parses an animation object and creates an animation\r\n * @param parsedAnimation Parsed animation object\r\n * @returns Animation object\r\n */\r\n public static Parse(parsedAnimation: any): Animation {\r\n const animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);\r\n\r\n const dataType = parsedAnimation.dataType;\r\n const keys: Array<IAnimationKey> = [];\r\n let data;\r\n let index: number;\r\n\r\n if (parsedAnimation.enableBlending) {\r\n animation.enableBlending = parsedAnimation.enableBlending;\r\n }\r\n\r\n if (parsedAnimation.blendingSpeed) {\r\n animation.blendingSpeed = parsedAnimation.blendingSpeed;\r\n }\r\n\r\n for (index = 0; index < parsedAnimation.keys.length; index++) {\r\n const key = parsedAnimation.keys[index];\r\n let inTangent: any = undefined;\r\n let outTangent: any = undefined;\r\n let interpolation: any = undefined;\r\n\r\n switch (dataType) {\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n data = key.values[0];\r\n if (key.values.length >= 2) {\r\n inTangent = key.values[1];\r\n }\r\n if (key.values.length >= 3) {\r\n outTangent = key.values[2];\r\n }\r\n if (key.values.length >= 4) {\r\n interpolation = key.values[3];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n data = Quaternion.FromArray(key.values);\r\n if (key.values.length >= 8) {\r\n const _inTangent = Quaternion.FromArray(key.values.slice(4, 8));\r\n if (!_inTangent.equals(Quaternion.Zero())) {\r\n inTangent = _inTangent;\r\n }\r\n }\r\n if (key.values.length >= 12) {\r\n const _outTangent = Quaternion.FromArray(key.values.slice(8, 12));\r\n if (!_outTangent.equals(Quaternion.Zero())) {\r\n outTangent = _outTangent;\r\n }\r\n }\r\n if (key.values.length >= 13) {\r\n interpolation = key.values[12];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n data = Matrix.FromArray(key.values);\r\n if (key.values.length >= 17) {\r\n interpolation = key.values[16];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n data = Color3.FromArray(key.values);\r\n if (key.values[3]) {\r\n inTangent = Color3.FromArray(key.values[3]);\r\n }\r\n if (key.values[4]) {\r\n outTangent = Color3.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n interpolation = key.values[5];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n data = Color4.FromArray(key.values);\r\n if (key.values[4]) {\r\n inTangent = Color4.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n outTangent = Color4.FromArray(key.values[5]);\r\n }\r\n if (key.values[6]) {\r\n interpolation = Color4.FromArray(key.values[6]);\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n default:\r\n data = Vector3.FromArray(key.values);\r\n if (key.values[3]) {\r\n inTangent = Vector3.FromArray(key.values[3]);\r\n }\r\n if (key.values[4]) {\r\n outTangent = Vector3.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n interpolation = key.values[5];\r\n }\r\n break;\r\n }\r\n\r\n const keyData: any = {};\r\n keyData.frame = key.frame;\r\n keyData.value = data;\r\n\r\n if (inTangent != undefined) {\r\n keyData.inTangent = inTangent;\r\n }\r\n if (outTangent != undefined) {\r\n keyData.outTangent = outTangent;\r\n }\r\n if (interpolation != undefined) {\r\n keyData.interpolation = interpolation;\r\n }\r\n keys.push(keyData);\r\n }\r\n\r\n animation.setKeys(keys);\r\n\r\n if (parsedAnimation.ranges) {\r\n for (index = 0; index < parsedAnimation.ranges.length; index++) {\r\n data = parsedAnimation.ranges[index];\r\n animation.createRange(data.name, data.from, data.to);\r\n }\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Appends the serialized animations from the source animations\r\n * @param source Source containing the animations\r\n * @param destination Target to store the animations\r\n */\r\n public static AppendSerializedAnimations(source: IAnimatable, destination: any): void {\r\n SerializationHelper.AppendSerializedAnimations(source, destination);\r\n }\r\n\r\n /**\r\n * Creates a new animation or an array of animations from a snippet saved in a remote file\r\n * @param name defines the name of the animation to create (can be null or empty to use the one from the json data)\r\n * @param url defines the url to load from\r\n * @returns a promise that will resolve to the new animation or an array of animations\r\n */\r\n public static async ParseFromFileAsync(name: Nullable<string>, url: string): Promise<Animation | Array<Animation>> {\r\n return await new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n let serializationObject = JSON.parse(request.responseText);\r\n if (serializationObject.animations) {\r\n serializationObject = serializationObject.animations;\r\n }\r\n\r\n if (serializationObject.length) {\r\n const output: Animation[] = [];\r\n for (const serializedAnimation of serializationObject) {\r\n output.push(this.Parse(serializedAnimation));\r\n }\r\n\r\n resolve(output);\r\n } else {\r\n const output = this.Parse(serializationObject);\r\n\r\n if (name) {\r\n output.name = name;\r\n }\r\n\r\n resolve(output);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the animation\");\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates an animation or an array of animations from a snippet saved by the Inspector\r\n * @param snippetId defines the snippet to load\r\n * @returns a promise that will resolve to the new animation or a new array of animations\r\n */\r\n public static async ParseFromSnippetAsync(snippetId: string): Promise<Animation | Array<Animation>> {\r\n return await new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n\r\n if (snippet.animations) {\r\n const serializationObject = JSON.parse(snippet.animations);\r\n const outputs: Animation[] = [];\r\n for (const serializedAnimation of serializationObject.animations) {\r\n const output = this.Parse(serializedAnimation);\r\n output.snippetId = snippetId;\r\n outputs.push(output);\r\n }\r\n\r\n resolve(outputs);\r\n } else {\r\n const serializationObject = JSON.parse(snippet.animation);\r\n const output = this.Parse(serializationObject);\r\n\r\n output.snippetId = snippetId;\r\n\r\n resolve(output);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates an animation or an array of animations from a snippet saved by the Inspector\r\n * @deprecated Please use ParseFromSnippetAsync instead\r\n * @param snippetId defines the snippet to load\r\n * @returns a promise that will resolve to the new animation or a new array of animations\r\n */\r\n public static CreateFromSnippetAsync = Animation.ParseFromSnippetAsync;\r\n}\r\n\r\nRegisterClass(\"BABYLON.Animation\", Animation);\r\nNode._AnimationRangeFactory = (name: string, from: number, to: number) => new AnimationRange(name, from, to);\r\n"]}
|
|
1
|
+
{"version":3,"file":"animation.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,8CAA8C;AAE9C,aAAa;AACb,MAAM,CAAC,MAAM,4BAA4B,GAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,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C,qBAAqB,AAAlC,CAAmC;AAC/E;;GAEG;AACoB,4BAAkB,GAAG,SAAS,CAAC,kBAAkB,AAA/B,CAAgC;AACzE;;GAEG;AACoB,oCAA0B,GAAG,CAAC,AAAJ,CAAK;AACtD;;GAEG;AACoB,iCAAuB,GAAG,CAAC,AAAJ,CAAK;AACnD;;GAEG;AACoB,oCAA0B,GAAG,CAAC,AAAJ,CAAK;AACtD;;GAEG;AACoB,gCAAsB,GAAG,CAAC,AAAJ,CAAK;AAClD;;GAEG;AACoB,iDAAuC,GAAG,CAAC,AAAJ,CAAK;AA0PnE;;;;;GAKG;AACW,gCAAsB,GAAG,SAAS,CAAC,qBAAqB,AAAlC,CAAmC;AAG3E,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AAC9C,IAAI,CAAC,sBAAsB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAU,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC","sourcesContent":["import type { IEasingFunction, EasingFunction } from \"./easing\";\r\nimport { Vector3, Quaternion, Vector2, Matrix, TmpVectors } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport { Hermite, Lerp } from \"../Maths/math.scalar.functions\";\r\nimport type { DeepImmutable, Nullable } from \"../types\";\r\nimport type { Scene } from \"../scene\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { IAnimationKey } from \"./animationKey\";\r\nimport { AnimationKeyInterpolation } from \"./animationKey\";\r\nimport { AnimationRange } from \"./animationRange\";\r\nimport type { AnimationEvent } from \"./animationEvent\";\r\nimport { Node } from \"../node\";\r\nimport type { IAnimatable } from \"./animatable.interface\";\r\nimport { Size } from \"../Maths/math.size\";\r\nimport { WebRequest } from \"../Misc/webRequest\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { Animatable } from \"./animatable\";\r\nimport type { RuntimeAnimation } from \"./runtimeAnimation\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\n\r\n// Static values to help the garbage collector\r\n\r\n// Quaternion\r\nexport const _StaticOffsetValueQuaternion: DeepImmutable<Quaternion> = Object.freeze(new Quaternion(0, 0, 0, 0));\r\n\r\n// Vector3\r\nexport const _StaticOffsetValueVector3: DeepImmutable<Vector3> = Object.freeze(Vector3.Zero());\r\n\r\n// Vector2\r\nexport const _StaticOffsetValueVector2: DeepImmutable<Vector2> = Object.freeze(Vector2.Zero());\r\n\r\n// Size\r\nexport const _StaticOffsetValueSize: DeepImmutable<Size> = Object.freeze(Size.Zero());\r\n\r\n// Color3\r\nexport const _StaticOffsetValueColor3: DeepImmutable<Color3> = Object.freeze(Color3.Black());\r\n\r\n// Color4\r\nexport const _StaticOffsetValueColor4: DeepImmutable<Color4> = Object.freeze(new Color4(0, 0, 0, 0));\r\n\r\n/**\r\n * Options to be used when creating an additive animation\r\n */\r\nexport interface IMakeAnimationAdditiveOptions {\r\n /**\r\n * The frame that the animation should be relative to (if not provided, 0 will be used)\r\n */\r\n referenceFrame?: number;\r\n /**\r\n * The name of the animation range to convert to additive. If not provided, fromFrame / toFrame will be used\r\n * If fromFrame / toFrame are not provided either, the whole animation will be converted to additive\r\n */\r\n range?: string;\r\n /**\r\n * If true, the original animation will be cloned and converted to additive. If false, the original animation will be converted to additive (default is false)\r\n */\r\n cloneOriginalAnimation?: boolean;\r\n /**\r\n * The name of the cloned animation if cloneOriginalAnimation is true. If not provided, use the original animation name\r\n */\r\n clonedAnimationName?: string;\r\n /**\r\n * Together with toFrame, defines the range of the animation to convert to additive. Will only be used if range is not provided\r\n * If range and fromFrame / toFrame are not provided, the whole animation will be converted to additive\r\n */\r\n fromFrame?: number;\r\n /**\r\n * Together with fromFrame, defines the range of the animation to convert to additive.\r\n */\r\n toFrame?: number;\r\n /**\r\n * If true, the key frames will be clipped to the range specified by range or fromFrame / toFrame (default is false)\r\n */\r\n clipKeys?: boolean;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface _IAnimationState {\r\n key: number;\r\n repeatCount: number;\r\n workValue?: any;\r\n loopMode?: number;\r\n offsetValue?: any;\r\n highLimitValue?: any;\r\n}\r\n\r\nconst EvaluateAnimationState: _IAnimationState = {\r\n key: 0,\r\n repeatCount: 0,\r\n loopMode: 2 /*Animation.ANIMATIONLOOPMODE_CONSTANT*/,\r\n};\r\n\r\n/**\r\n * Class used to store any kind of animation\r\n */\r\nexport class Animation {\r\n private static _UniqueIdGenerator = 0;\r\n\r\n /**\r\n * Use matrix interpolation instead of using direct key value when animating matrices\r\n */\r\n public static AllowMatricesInterpolation = false;\r\n\r\n /**\r\n * When matrix interpolation is enabled, this boolean forces the system to use Matrix.DecomposeLerp instead of Matrix.Lerp. Interpolation is more precise but slower\r\n */\r\n public static AllowMatrixDecomposeForInterpolation = true;\r\n\r\n /**\r\n * Gets or sets the unique id of the animation (the uniqueness is solely among other animations)\r\n */\r\n public uniqueId: number;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /** Snippet ID if the animation was created from the snippet server */\r\n public snippetId: string;\r\n\r\n /**\r\n * Stores the key frames of the animation\r\n */\r\n private _keys: Array<IAnimationKey>;\r\n\r\n /**\r\n * Stores the easing function of the animation\r\n */\r\n private _easingFunction: Nullable<IEasingFunction> = null;\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _runtimeAnimations = new Array<RuntimeAnimation>();\r\n\r\n /**\r\n * The set of event that will be linked to this animation\r\n */\r\n private _events = new Array<AnimationEvent>();\r\n\r\n /**\r\n * Stores an array of target property paths\r\n */\r\n public targetPropertyPath: string[];\r\n\r\n /**\r\n * Stores the blending speed of the animation\r\n */\r\n public blendingSpeed = 0.01;\r\n\r\n /**\r\n * Stores the animation ranges for the animation\r\n */\r\n private _ranges: { [name: string]: Nullable<AnimationRange> } = {};\r\n\r\n /** @internal */\r\n public _coreAnimation: Nullable<Animation> = null;\r\n\r\n /**\r\n * Ensure do not serialize animation , default false\r\n */\r\n public doNotSerialize = false;\r\n\r\n /**\r\n * @internal Internal use\r\n */\r\n public static _PrepareAnimation(\r\n name: string,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction\r\n ): Nullable<Animation> {\r\n let dataType = undefined;\r\n\r\n if (!isNaN(parseFloat(from)) && isFinite(from)) {\r\n dataType = Animation.ANIMATIONTYPE_FLOAT;\r\n } else if (from instanceof Quaternion) {\r\n dataType = Animation.ANIMATIONTYPE_QUATERNION;\r\n } else if (from instanceof Vector3) {\r\n dataType = Animation.ANIMATIONTYPE_VECTOR3;\r\n } else if (from instanceof Vector2) {\r\n dataType = Animation.ANIMATIONTYPE_VECTOR2;\r\n } else if (from instanceof Color3) {\r\n dataType = Animation.ANIMATIONTYPE_COLOR3;\r\n } else if (from instanceof Color4) {\r\n dataType = Animation.ANIMATIONTYPE_COLOR4;\r\n } else if (from instanceof Size) {\r\n dataType = Animation.ANIMATIONTYPE_SIZE;\r\n }\r\n\r\n if (dataType == undefined) {\r\n return null;\r\n }\r\n\r\n const animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);\r\n\r\n const keys: Array<IAnimationKey> = [\r\n { frame: 0, value: from },\r\n { frame: totalFrame, value: to },\r\n ];\r\n animation.setKeys(keys);\r\n\r\n if (easingFunction !== undefined) {\r\n animation.setEasingFunction(easingFunction);\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Sets up an animation\r\n * @param property The property to animate\r\n * @param animationType The animation type to apply\r\n * @param framePerSecond The frames per second of the animation\r\n * @param easingFunction The easing function used in the animation\r\n * @returns The created animation\r\n */\r\n public static CreateAnimation(property: string, animationType: number, framePerSecond: number, easingFunction: EasingFunction): Animation {\r\n const animation: Animation = new Animation(property + \"Animation\", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);\r\n\r\n animation.setEasingFunction(easingFunction);\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Create and start an animation on a node\r\n * @param name defines the name of the global animation that will be run on all nodes\r\n * @param target defines the target where the animation will take place\r\n * @param targetProperty defines property to animate\r\n * @param framePerSecond defines the number of frame per second yo use\r\n * @param totalFrame defines the number of frames in total\r\n * @param from defines the initial value\r\n * @param to defines the final value\r\n * @param loopMode defines which loop mode you want to use (off by default)\r\n * @param easingFunction defines the easing function to use (linear by default)\r\n * @param onAnimationEnd defines the callback to call when animation end\r\n * @param scene defines the hosting scene\r\n * @returns the animatable created for this animation\r\n */\r\n public static CreateAndStartAnimation(\r\n name: string,\r\n target: any,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void,\r\n scene?: Scene\r\n ): Nullable<Animatable> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n if (target.getScene) {\r\n scene = target.getScene();\r\n }\r\n\r\n if (!scene) {\r\n return null;\r\n }\r\n\r\n return scene.beginDirectAnimation(target, [animation], 0, totalFrame, animation.loopMode !== Animation.ANIMATIONLOOPMODE_CONSTANT, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Create and start an animation on a node and its descendants\r\n * @param name defines the name of the global animation that will be run on all nodes\r\n * @param node defines the root node where the animation will take place\r\n * @param directDescendantsOnly if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used\r\n * @param targetProperty defines property to animate\r\n * @param framePerSecond defines the number of frame per second to use\r\n * @param totalFrame defines the number of frames in total\r\n * @param from defines the initial value\r\n * @param to defines the final value\r\n * @param loopMode defines which loop mode you want to use (off by default)\r\n * @param easingFunction defines the easing function to use (linear by default)\r\n * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node)\r\n * @returns the list of animatables created for all nodes\r\n * @example https://www.babylonjs-playground.com/#MH0VLI\r\n */\r\n public static CreateAndStartHierarchyAnimation(\r\n name: string,\r\n node: Node,\r\n directDescendantsOnly: boolean,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void\r\n ): Nullable<Animatable[]> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n const scene = node.getScene();\r\n return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Creates a new animation, merges it with the existing animations and starts it\r\n * @param name Name of the animation\r\n * @param node Node which contains the scene that begins the animations\r\n * @param targetProperty Specifies which property to animate\r\n * @param framePerSecond The frames per second of the animation\r\n * @param totalFrame The total number of frames\r\n * @param from The frame at the beginning of the animation\r\n * @param to The frame at the end of the animation\r\n * @param loopMode Specifies the loop mode of the animation\r\n * @param easingFunction (Optional) The easing function of the animation, which allow custom mathematical formulas for animations\r\n * @param onAnimationEnd Callback to run once the animation is complete\r\n * @returns Nullable animation\r\n */\r\n public static CreateMergeAndStartAnimation(\r\n name: string,\r\n node: Node,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void\r\n ): Nullable<Animatable> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n node.animations.push(animation);\r\n\r\n return node.getScene().beginAnimation(node, 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Convert the keyframes of an animation to be relative to a given reference frame.\r\n * @param sourceAnimation defines the Animation containing keyframes to convert\r\n * @param referenceFrame defines the frame that keyframes in the range will be relative to (default: 0)\r\n * @param range defines the name of the AnimationRange belonging to the Animation to convert\r\n * @param cloneOriginal defines whether or not to clone the animation and convert the clone or convert the original animation (default is false)\r\n * @param clonedName defines the name of the resulting cloned Animation if cloneOriginal is true\r\n * @returns a new Animation if cloneOriginal is true or the original Animation if cloneOriginal is false\r\n */\r\n public static MakeAnimationAdditive(sourceAnimation: Animation, referenceFrame?: number, range?: string, cloneOriginal?: boolean, clonedName?: string): Animation;\r\n\r\n /**\r\n * Convert the keyframes of an animation to be relative to a given reference frame.\r\n * @param sourceAnimation defines the Animation containing keyframes to convert\r\n * @param options defines the options to use when converting ey keyframes\r\n * @returns a new Animation if options.cloneOriginalAnimation is true or the original Animation if options.cloneOriginalAnimation is false\r\n */\r\n public static MakeAnimationAdditive(sourceAnimation: Animation, options?: IMakeAnimationAdditiveOptions): Animation;\r\n\r\n /** @internal */\r\n public static MakeAnimationAdditive(\r\n sourceAnimation: Animation,\r\n referenceFrameOrOptions?: number | IMakeAnimationAdditiveOptions,\r\n range?: string,\r\n cloneOriginal = false,\r\n clonedName?: string\r\n ): Animation {\r\n let options: IMakeAnimationAdditiveOptions;\r\n\r\n if (typeof referenceFrameOrOptions === \"object\") {\r\n options = referenceFrameOrOptions;\r\n } else {\r\n options = {\r\n referenceFrame: referenceFrameOrOptions ?? 0,\r\n range: range,\r\n cloneOriginalAnimation: cloneOriginal,\r\n clonedAnimationName: clonedName,\r\n };\r\n }\r\n\r\n let animation = sourceAnimation;\r\n\r\n if (options.cloneOriginalAnimation) {\r\n animation = sourceAnimation.clone();\r\n animation.name = options.clonedAnimationName || animation.name;\r\n }\r\n\r\n if (!animation._keys.length) {\r\n return animation;\r\n }\r\n\r\n const referenceFrame = options.referenceFrame && options.referenceFrame >= 0 ? options.referenceFrame : 0;\r\n let startIndex = 0;\r\n const firstKey = animation._keys[0];\r\n let endIndex = animation._keys.length - 1;\r\n const lastKey = animation._keys[endIndex];\r\n const valueStore = {\r\n referenceValue: firstKey.value,\r\n referencePosition: TmpVectors.Vector3[0],\r\n referenceQuaternion: TmpVectors.Quaternion[0],\r\n referenceScaling: TmpVectors.Vector3[1],\r\n keyPosition: TmpVectors.Vector3[2],\r\n keyQuaternion: TmpVectors.Quaternion[1],\r\n keyScaling: TmpVectors.Vector3[3],\r\n };\r\n let from = firstKey.frame;\r\n let to = lastKey.frame;\r\n if (options.range) {\r\n const rangeValue = animation.getRange(options.range);\r\n\r\n if (rangeValue) {\r\n from = rangeValue.from;\r\n to = rangeValue.to;\r\n }\r\n } else {\r\n from = options.fromFrame ?? from;\r\n to = options.toFrame ?? to;\r\n }\r\n\r\n if (from !== firstKey.frame) {\r\n startIndex = animation.createKeyForFrame(from);\r\n }\r\n\r\n if (to !== lastKey.frame) {\r\n endIndex = animation.createKeyForFrame(to);\r\n }\r\n\r\n // There's only one key, so use it\r\n if (animation._keys.length === 1) {\r\n const value = animation._getKeyValue(animation._keys[0]);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n }\r\n\r\n // Reference frame is before the first frame, so just use the first frame\r\n else if (referenceFrame <= firstKey.frame) {\r\n const value = animation._getKeyValue(firstKey.value);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n }\r\n\r\n // Reference frame is after the last frame, so just use the last frame\r\n else if (referenceFrame >= lastKey.frame) {\r\n const value = animation._getKeyValue(lastKey.value);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n }\r\n\r\n // Interpolate the reference value from the animation\r\n else {\r\n EvaluateAnimationState.key = 0;\r\n const value = animation._interpolate(referenceFrame, EvaluateAnimationState);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n }\r\n\r\n // Conjugate the quaternion\r\n if (animation.dataType === Animation.ANIMATIONTYPE_QUATERNION) {\r\n valueStore.referenceValue.normalize().conjugateInPlace();\r\n }\r\n\r\n // Decompose matrix and conjugate the quaternion\r\n else if (animation.dataType === Animation.ANIMATIONTYPE_MATRIX) {\r\n valueStore.referenceValue.decompose(valueStore.referenceScaling, valueStore.referenceQuaternion, valueStore.referencePosition);\r\n valueStore.referenceQuaternion.normalize().conjugateInPlace();\r\n }\r\n\r\n let startFrame = Number.MAX_VALUE;\r\n const clippedKeys: Nullable<IAnimationKey[]> = options.clipKeys ? [] : null;\r\n\r\n // Subtract the reference value from all of the key values\r\n for (let index = startIndex; index <= endIndex; index++) {\r\n let key = animation._keys[index];\r\n\r\n if (clippedKeys || options.cloneOriginalAnimation) {\r\n key = {\r\n frame: key.frame,\r\n value: key.value.clone ? key.value.clone() : key.value,\r\n inTangent: key.inTangent,\r\n outTangent: key.outTangent,\r\n interpolation: key.interpolation,\r\n lockedTangent: key.lockedTangent,\r\n };\r\n if (clippedKeys) {\r\n if (startFrame === Number.MAX_VALUE) {\r\n startFrame = key.frame;\r\n }\r\n key.frame -= startFrame;\r\n clippedKeys.push(key);\r\n }\r\n }\r\n\r\n // If this key was duplicated to create a frame 0 key, skip it because its value has already been updated\r\n if (index && animation.dataType !== Animation.ANIMATIONTYPE_FLOAT && key.value === firstKey.value) {\r\n continue;\r\n }\r\n\r\n switch (animation.dataType) {\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n key.value.decompose(valueStore.keyScaling, valueStore.keyQuaternion, valueStore.keyPosition);\r\n valueStore.keyPosition.subtractInPlace(valueStore.referencePosition);\r\n valueStore.keyScaling.divideInPlace(valueStore.referenceScaling);\r\n valueStore.referenceQuaternion.multiplyToRef(valueStore.keyQuaternion, valueStore.keyQuaternion);\r\n Matrix.ComposeToRef(valueStore.keyScaling, valueStore.keyQuaternion, valueStore.keyPosition, key.value);\r\n break;\r\n\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n valueStore.referenceValue.multiplyToRef(key.value, key.value);\r\n break;\r\n\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n key.value.subtractToRef(valueStore.referenceValue, key.value);\r\n break;\r\n\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n key.value.width -= valueStore.referenceValue.width;\r\n key.value.height -= valueStore.referenceValue.height;\r\n break;\r\n\r\n default:\r\n key.value -= valueStore.referenceValue;\r\n }\r\n }\r\n\r\n if (clippedKeys) {\r\n animation.setKeys(clippedKeys, true);\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Transition property of an host to the target Value\r\n * @param property The property to transition\r\n * @param targetValue The target Value of the property\r\n * @param host The object where the property to animate belongs\r\n * @param scene Scene used to run the animation\r\n * @param frameRate Framerate (in frame/s) to use\r\n * @param transition The transition type we want to use\r\n * @param duration The duration of the animation, in milliseconds\r\n * @param onAnimationEnd Callback trigger at the end of the animation\r\n * @param stopCurrent If true, will stop the current animation on the property\r\n * @returns Nullable animation\r\n */\r\n public static TransitionTo(\r\n property: string,\r\n targetValue: any,\r\n host: any,\r\n scene: Scene,\r\n frameRate: number,\r\n transition: Animation,\r\n duration: number,\r\n onAnimationEnd: Nullable<() => void> = null,\r\n stopCurrent: boolean = true\r\n ): Nullable<Animatable> {\r\n if (duration <= 0) {\r\n host[property] = targetValue;\r\n if (onAnimationEnd) {\r\n onAnimationEnd();\r\n }\r\n return null;\r\n }\r\n\r\n const endFrame: number = frameRate * (duration / 1000);\r\n\r\n transition.setKeys([\r\n {\r\n frame: 0,\r\n value: host[property].clone ? host[property].clone() : host[property],\r\n },\r\n {\r\n frame: endFrame,\r\n value: targetValue,\r\n },\r\n ]);\r\n\r\n if (!host.animations) {\r\n host.animations = [];\r\n }\r\n\r\n host.animations.push(transition);\r\n\r\n const animation: Animatable = scene.beginAnimation(host, 0, endFrame, false, 1.0, onAnimationEnd ?? undefined, undefined, stopCurrent);\r\n return animation;\r\n }\r\n\r\n /**\r\n * Return the array of runtime animations currently using this animation\r\n */\r\n public get runtimeAnimations(): RuntimeAnimation[] {\r\n return this._runtimeAnimations;\r\n }\r\n\r\n /**\r\n * Specifies if any of the runtime animations are currently running\r\n */\r\n public get hasRunningRuntimeAnimations(): boolean {\r\n for (const runtimeAnimation of this._runtimeAnimations) {\r\n if (!runtimeAnimation.isStopped()) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Initializes the animation\r\n * @param name Name of the animation\r\n * @param targetProperty Property to animate\r\n * @param framePerSecond The frames per second of the animation\r\n * @param dataType The data type of the animation\r\n * @param loopMode The loop mode of the animation\r\n * @param enableBlending Specifies if blending should be enabled\r\n */\r\n constructor(\r\n /**Name of the animation */\r\n public name: string,\r\n /**Property to animate */\r\n public targetProperty: string,\r\n /**The frames per second of the animation */\r\n public framePerSecond: number,\r\n /**The data type of the animation */\r\n public dataType: number,\r\n /**The loop mode of the animation */\r\n public loopMode?: number,\r\n /**Specifies if blending should be enabled */\r\n public enableBlending?: boolean\r\n ) {\r\n this.targetPropertyPath = targetProperty.split(\".\");\r\n this.dataType = dataType;\r\n this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode;\r\n this.uniqueId = Animation._UniqueIdGenerator++;\r\n }\r\n\r\n // Methods\r\n /**\r\n * Converts the animation to a string\r\n * @param fullDetails support for multiple levels of logging within scene loading\r\n * @returns String form of the animation\r\n */\r\n public toString(fullDetails?: boolean): string {\r\n let ret = \"Name: \" + this.name + \", property: \" + this.targetProperty;\r\n ret += \", datatype: \" + [\"Float\", \"Vector3\", \"Quaternion\", \"Matrix\", \"Color3\", \"Vector2\"][this.dataType];\r\n ret += \", nKeys: \" + (this._keys ? this._keys.length : \"none\");\r\n ret += \", nRanges: \" + (this._ranges ? Object.keys(this._ranges).length : \"none\");\r\n if (fullDetails) {\r\n ret += \", Ranges: {\";\r\n let first = true;\r\n for (const name in this._ranges) {\r\n if (first) {\r\n ret += \", \";\r\n first = false;\r\n }\r\n ret += name;\r\n }\r\n ret += \"}\";\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Add an event to this animation\r\n * @param event Event to add\r\n */\r\n public addEvent(event: AnimationEvent): void {\r\n this._events.push(event);\r\n this._events.sort((a, b) => a.frame - b.frame);\r\n }\r\n\r\n /**\r\n * Remove all events found at the given frame\r\n * @param frame The frame to remove events from\r\n */\r\n public removeEvents(frame: number): void {\r\n for (let index = 0; index < this._events.length; index++) {\r\n if (this._events[index].frame === frame) {\r\n this._events.splice(index, 1);\r\n index--;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves all the events from the animation\r\n * @returns Events from the animation\r\n */\r\n public getEvents(): AnimationEvent[] {\r\n return this._events;\r\n }\r\n\r\n /**\r\n * Creates an animation range\r\n * @param name Name of the animation range\r\n * @param from Starting frame of the animation range\r\n * @param to Ending frame of the animation\r\n */\r\n public createRange(name: string, from: number, to: number): void {\r\n // check name not already in use; could happen for bones after serialized\r\n if (!this._ranges[name]) {\r\n this._ranges[name] = new AnimationRange(name, from, to);\r\n }\r\n }\r\n\r\n /**\r\n * Deletes an animation range by name\r\n * @param name Name of the animation range to delete\r\n * @param deleteFrames Specifies if the key frames for the range should also be deleted (true) or not (false)\r\n */\r\n public deleteRange(name: string, deleteFrames = true): void {\r\n const range = this._ranges[name];\r\n if (!range) {\r\n return;\r\n }\r\n if (deleteFrames) {\r\n const from = range.from;\r\n const to = range.to;\r\n\r\n // this loop MUST go high to low for multiple splices to work\r\n for (let key = this._keys.length - 1; key >= 0; key--) {\r\n if (this._keys[key].frame >= from && this._keys[key].frame <= to) {\r\n this._keys.splice(key, 1);\r\n }\r\n }\r\n }\r\n this._ranges[name] = null; // said much faster than 'delete this._range[name]'\r\n }\r\n\r\n /**\r\n * Gets the animation range by name, or null if not defined\r\n * @param name Name of the animation range\r\n * @returns Nullable animation range\r\n */\r\n public getRange(name: string): Nullable<AnimationRange> {\r\n return this._ranges[name];\r\n }\r\n\r\n /**\r\n * Gets the key frames from the animation\r\n * @returns The key frames of the animation\r\n */\r\n public getKeys(): Array<IAnimationKey> {\r\n return this._keys;\r\n }\r\n\r\n /**\r\n * Gets the highest frame of the animation\r\n * @returns Highest frame of the animation\r\n */\r\n public getHighestFrame(): number {\r\n let ret = 0;\r\n\r\n for (let key = 0, nKeys = this._keys.length; key < nKeys; key++) {\r\n if (ret < this._keys[key].frame) {\r\n ret = this._keys[key].frame;\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Gets the easing function of the animation\r\n * @returns Easing function of the animation\r\n */\r\n public getEasingFunction(): Nullable<IEasingFunction> {\r\n return this._easingFunction;\r\n }\r\n\r\n /**\r\n * Sets the easing function of the animation\r\n * @param easingFunction A custom mathematical formula for animation\r\n */\r\n public setEasingFunction(easingFunction: Nullable<IEasingFunction>): void {\r\n this._easingFunction = easingFunction;\r\n }\r\n\r\n /**\r\n * Interpolates a scalar linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated scalar value\r\n */\r\n public floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number {\r\n return Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a scalar cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated scalar value\r\n */\r\n public floatInterpolateFunctionWithTangents(startValue: number, outTangent: number, endValue: number, inTangent: number, gradient: number): number {\r\n return Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a quaternion using a spherical linear interpolation\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated quaternion value\r\n */\r\n public quaternionInterpolateFunction(startValue: Quaternion, endValue: Quaternion, gradient: number): Quaternion {\r\n return Quaternion.Slerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a quaternion cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated quaternion value\r\n */\r\n public quaternionInterpolateFunctionWithTangents(startValue: Quaternion, outTangent: Quaternion, endValue: Quaternion, inTangent: Quaternion, gradient: number): Quaternion {\r\n return Quaternion.Hermite(startValue, outTangent, endValue, inTangent, gradient).normalize();\r\n }\r\n\r\n /**\r\n * Interpolates a Vector3 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated scalar value\r\n */\r\n public vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3 {\r\n return Vector3.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector3 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns InterpolatedVector3 value\r\n */\r\n public vector3InterpolateFunctionWithTangents(startValue: Vector3, outTangent: Vector3, endValue: Vector3, inTangent: Vector3, gradient: number): Vector3 {\r\n return Vector3.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector2 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated Vector2 value\r\n */\r\n public vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2 {\r\n return Vector2.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector2 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated Vector2 value\r\n */\r\n public vector2InterpolateFunctionWithTangents(startValue: Vector2, outTangent: Vector2, endValue: Vector2, inTangent: Vector2, gradient: number): Vector2 {\r\n return Vector2.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a size linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Size value\r\n */\r\n public sizeInterpolateFunction(startValue: Size, endValue: Size, gradient: number): Size {\r\n return Size.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color3 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Color3 value\r\n */\r\n public color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3 {\r\n return Color3.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color3 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns interpolated value\r\n */\r\n public color3InterpolateFunctionWithTangents(startValue: Color3, outTangent: Color3, endValue: Color3, inTangent: Color3, gradient: number): Color3 {\r\n return Color3.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color4 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Color3 value\r\n */\r\n public color4InterpolateFunction(startValue: Color4, endValue: Color4, gradient: number): Color4 {\r\n return Color4.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color4 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns interpolated value\r\n */\r\n public color4InterpolateFunctionWithTangents(startValue: Color4, outTangent: Color4, endValue: Color4, inTangent: Color4, gradient: number): Color4 {\r\n return Color4.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _getKeyValue(value: any): any {\r\n if (typeof value === \"function\") {\r\n return value();\r\n }\r\n\r\n return value;\r\n }\r\n\r\n /**\r\n * Evaluate the animation value at a given frame\r\n * @param currentFrame defines the frame where we want to evaluate the animation\r\n * @returns the animation value\r\n */\r\n public evaluate(currentFrame: number) {\r\n EvaluateAnimationState.key = 0;\r\n return this._interpolate(currentFrame, EvaluateAnimationState);\r\n }\r\n\r\n /** @internal */\r\n public _key: number;\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _interpolate(currentFrame: number, state: _IAnimationState, searchClosestKeyOnly = false): any {\r\n if (state.loopMode === Animation.ANIMATIONLOOPMODE_CONSTANT && state.repeatCount > 0) {\r\n return state.highLimitValue.clone ? state.highLimitValue.clone() : state.highLimitValue;\r\n }\r\n\r\n const keys = this._keys;\r\n let key: number;\r\n\r\n if (!this._coreAnimation) {\r\n const keysLength = keys.length;\r\n\r\n key = state.key;\r\n\r\n while (key >= 0 && currentFrame < keys[key].frame) {\r\n --key;\r\n }\r\n\r\n while (key + 1 <= keysLength - 1 && currentFrame >= keys[key + 1].frame) {\r\n ++key;\r\n }\r\n\r\n state.key = key;\r\n\r\n if (key < 0) {\r\n return searchClosestKeyOnly ? undefined : this._getKeyValue(keys[0].value);\r\n } else if (key + 1 > keysLength - 1) {\r\n return searchClosestKeyOnly ? undefined : this._getKeyValue(keys[keysLength - 1].value);\r\n }\r\n\r\n this._key = key;\r\n } else {\r\n key = this._coreAnimation._key;\r\n }\r\n\r\n const startKey = keys[key];\r\n const endKey = keys[key + 1];\r\n\r\n if (searchClosestKeyOnly && (currentFrame === startKey.frame || currentFrame === endKey.frame)) {\r\n return undefined;\r\n }\r\n const startValue = this._getKeyValue(startKey.value);\r\n const endValue = this._getKeyValue(endKey.value);\r\n if (startKey.interpolation === AnimationKeyInterpolation.STEP) {\r\n if (endKey.frame > currentFrame) {\r\n return startValue;\r\n } else {\r\n return endValue;\r\n }\r\n }\r\n\r\n const useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;\r\n const frameDelta = endKey.frame - startKey.frame;\r\n\r\n // gradient : percent of currentFrame between the frame inf and the frame sup\r\n let gradient = (currentFrame - startKey.frame) / frameDelta;\r\n\r\n // check for easingFunction and correction of gradient\r\n const easingFunction = startKey.easingFunction || this.getEasingFunction();\r\n // can also be undefined, if not provided\r\n if (easingFunction) {\r\n gradient = easingFunction.ease(gradient);\r\n }\r\n\r\n switch (this.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT: {\r\n const floatValue = useTangent\r\n ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient)\r\n : this.floatInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return floatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return (state.offsetValue ?? 0) * state.repeatCount + floatValue;\r\n }\r\n break;\r\n }\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION: {\r\n const quatValue = useTangent\r\n ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.quaternionInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return quatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return quatValue.addInPlace((state.offsetValue || _StaticOffsetValueQuaternion).scale(state.repeatCount));\r\n }\r\n\r\n return quatValue;\r\n }\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3: {\r\n const vec3Value = useTangent\r\n ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.vector3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return vec3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return vec3Value.add((state.offsetValue || _StaticOffsetValueVector3).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2: {\r\n const vec2Value = useTangent\r\n ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.vector2InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return vec2Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return vec2Value.add((state.offsetValue || _StaticOffsetValueVector2).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE: {\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient);\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient).add((state.offsetValue || _StaticOffsetValueSize).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3: {\r\n const color3Value = useTangent\r\n ? this.color3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.color3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return color3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return color3Value.add((state.offsetValue || _StaticOffsetValueColor3).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Color4\r\n case Animation.ANIMATIONTYPE_COLOR4: {\r\n const color4Value = useTangent\r\n ? this.color4InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.color4InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return color4Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:\r\n return color4Value.add((state.offsetValue || _StaticOffsetValueColor4).scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Matrix\r\n case Animation.ANIMATIONTYPE_MATRIX: {\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO: {\r\n if (Animation.AllowMatricesInterpolation) {\r\n return this.matrixInterpolateFunction(startValue, endValue, gradient, state.workValue);\r\n }\r\n return startValue;\r\n }\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT: {\r\n return startValue;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n /**\r\n * Defines the function to use to interpolate matrices\r\n * @param startValue defines the start matrix\r\n * @param endValue defines the end matrix\r\n * @param gradient defines the gradient between both matrices\r\n * @param result defines an optional target matrix where to store the interpolation\r\n * @returns the interpolated matrix\r\n */\r\n public matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number, result?: Matrix): Matrix {\r\n if (Animation.AllowMatrixDecomposeForInterpolation) {\r\n if (result) {\r\n Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n return Matrix.DecomposeLerp(startValue, endValue, gradient);\r\n }\r\n\r\n if (result) {\r\n Matrix.LerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n return Matrix.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Makes a copy of the animation\r\n * @returns Cloned animation\r\n */\r\n public clone(): Animation {\r\n const clone = new Animation(this.name, this.targetPropertyPath.join(\".\"), this.framePerSecond, this.dataType, this.loopMode);\r\n\r\n clone.enableBlending = this.enableBlending;\r\n clone.blendingSpeed = this.blendingSpeed;\r\n\r\n if (this._keys) {\r\n clone.setKeys(this._keys);\r\n }\r\n\r\n if (this._ranges) {\r\n clone._ranges = {};\r\n for (const name in this._ranges) {\r\n const range = this._ranges[name];\r\n if (!range) {\r\n continue;\r\n }\r\n clone._ranges[name] = range.clone();\r\n }\r\n }\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Sets the key frames of the animation\r\n * @param values The animation key frames to set\r\n * @param dontClone Whether to clone the keys or not (default is false, so the array of keys is cloned)\r\n */\r\n public setKeys(values: Array<IAnimationKey>, dontClone = false): void {\r\n this._keys = !dontClone ? values.slice(0) : values;\r\n }\r\n\r\n /**\r\n * Creates a key for the frame passed as a parameter and adds it to the animation IF a key doesn't already exist for that frame\r\n * @param frame Frame number\r\n * @returns The key index if the key was added or the index of the pre existing key if the frame passed as parameter already has a corresponding key\r\n */\r\n public createKeyForFrame(frame: number) {\r\n // Find the key corresponding to frame\r\n EvaluateAnimationState.key = 0;\r\n const value = this._interpolate(frame, EvaluateAnimationState, true);\r\n\r\n if (!value) {\r\n // A key corresponding to this frame already exists\r\n return this._keys[EvaluateAnimationState.key].frame === frame ? EvaluateAnimationState.key : EvaluateAnimationState.key + 1;\r\n }\r\n\r\n // The frame is between two keys, so create a new key\r\n const newKey: IAnimationKey = {\r\n frame,\r\n value: value.clone ? value.clone() : value,\r\n };\r\n\r\n this._keys.splice(EvaluateAnimationState.key + 1, 0, newKey);\r\n\r\n return EvaluateAnimationState.key + 1;\r\n }\r\n\r\n /**\r\n * Serializes the animation to an object\r\n * @returns Serialized object\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n\r\n serializationObject.name = this.name;\r\n serializationObject.property = this.targetProperty;\r\n serializationObject.framePerSecond = this.framePerSecond;\r\n serializationObject.dataType = this.dataType;\r\n serializationObject.loopBehavior = this.loopMode;\r\n serializationObject.enableBlending = this.enableBlending;\r\n serializationObject.blendingSpeed = this.blendingSpeed;\r\n\r\n const dataType = this.dataType;\r\n serializationObject.keys = [];\r\n const keys = this.getKeys();\r\n for (let index = 0; index < keys.length; index++) {\r\n const animationKey = keys[index];\r\n\r\n const key: any = {};\r\n key.frame = animationKey.frame;\r\n\r\n switch (dataType) {\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n key.values = [animationKey.value];\r\n if (animationKey.inTangent !== undefined) {\r\n key.values.push(animationKey.inTangent);\r\n }\r\n if (animationKey.outTangent !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.outTangent);\r\n }\r\n if (animationKey.interpolation !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n if (animationKey.outTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.interpolation);\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n key.values = animationKey.value.asArray();\r\n if (animationKey.inTangent != undefined) {\r\n key.values.push(animationKey.inTangent.asArray());\r\n }\r\n if (animationKey.outTangent != undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.outTangent.asArray());\r\n }\r\n if (animationKey.interpolation !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n if (animationKey.outTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.interpolation);\r\n }\r\n break;\r\n }\r\n\r\n serializationObject.keys.push(key);\r\n }\r\n\r\n serializationObject.ranges = [];\r\n for (const name in this._ranges) {\r\n const source = this._ranges[name];\r\n\r\n if (!source) {\r\n continue;\r\n }\r\n const range: any = {};\r\n range.name = name;\r\n range.from = source.from;\r\n range.to = source.to;\r\n serializationObject.ranges.push(range);\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Float animation type\r\n */\r\n public static readonly ANIMATIONTYPE_FLOAT = Constants.ANIMATIONTYPE_FLOAT;\r\n /**\r\n * Vector3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_VECTOR3 = Constants.ANIMATIONTYPE_VECTOR3;\r\n /**\r\n * Quaternion animation type\r\n */\r\n public static readonly ANIMATIONTYPE_QUATERNION = Constants.ANIMATIONTYPE_QUATERNION;\r\n /**\r\n * Matrix animation type\r\n */\r\n public static readonly ANIMATIONTYPE_MATRIX = Constants.ANIMATIONTYPE_MATRIX;\r\n /**\r\n * Color3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_COLOR3 = Constants.ANIMATIONTYPE_COLOR3;\r\n /**\r\n * Color3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_COLOR4 = Constants.ANIMATIONTYPE_COLOR4;\r\n /**\r\n * Vector2 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_VECTOR2 = Constants.ANIMATIONTYPE_VECTOR2;\r\n /**\r\n * Size animation type\r\n */\r\n public static readonly ANIMATIONTYPE_SIZE = Constants.ANIMATIONTYPE_SIZE;\r\n /**\r\n * Relative Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_RELATIVE = 0;\r\n /**\r\n * Cycle Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_CYCLE = 1;\r\n /**\r\n * Constant Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_CONSTANT = 2;\r\n /**\r\n * Yoyo Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_YOYO = 4;\r\n /**\r\n * Relative Loop Mode (add to current value of animated object, unlike ANIMATIONLOOPMODE_RELATIVE)\r\n */\r\n public static readonly ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT = 5;\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _UniversalLerp(left: any, right: any, amount: number): any {\r\n const constructor = left.constructor;\r\n if (constructor.Lerp) {\r\n // Lerp supported\r\n return constructor.Lerp(left, right, amount);\r\n } else if (constructor.Slerp) {\r\n // Slerp supported\r\n return constructor.Slerp(left, right, amount);\r\n } else if (left.toFixed) {\r\n // Number\r\n return left * (1.0 - amount) + amount * right;\r\n } else {\r\n // Blending not supported\r\n return right;\r\n }\r\n }\r\n\r\n /**\r\n * Parses an animation object and creates an animation\r\n * @param parsedAnimation Parsed animation object\r\n * @returns Animation object\r\n */\r\n public static Parse(parsedAnimation: any): Animation {\r\n const animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);\r\n\r\n const dataType = parsedAnimation.dataType;\r\n const keys: Array<IAnimationKey> = [];\r\n let data;\r\n let index: number;\r\n\r\n if (parsedAnimation.enableBlending) {\r\n animation.enableBlending = parsedAnimation.enableBlending;\r\n }\r\n\r\n if (parsedAnimation.blendingSpeed) {\r\n animation.blendingSpeed = parsedAnimation.blendingSpeed;\r\n }\r\n\r\n for (index = 0; index < parsedAnimation.keys.length; index++) {\r\n const key = parsedAnimation.keys[index];\r\n let inTangent: any = undefined;\r\n let outTangent: any = undefined;\r\n let interpolation: any = undefined;\r\n\r\n switch (dataType) {\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n data = key.values[0];\r\n if (key.values.length >= 2) {\r\n inTangent = key.values[1];\r\n }\r\n if (key.values.length >= 3) {\r\n outTangent = key.values[2];\r\n }\r\n if (key.values.length >= 4) {\r\n interpolation = key.values[3];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n data = Quaternion.FromArray(key.values);\r\n if (key.values.length >= 8) {\r\n const _inTangent = Quaternion.FromArray(key.values.slice(4, 8));\r\n if (!_inTangent.equals(Quaternion.Zero())) {\r\n inTangent = _inTangent;\r\n }\r\n }\r\n if (key.values.length >= 12) {\r\n const _outTangent = Quaternion.FromArray(key.values.slice(8, 12));\r\n if (!_outTangent.equals(Quaternion.Zero())) {\r\n outTangent = _outTangent;\r\n }\r\n }\r\n if (key.values.length >= 13) {\r\n interpolation = key.values[12];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n data = Matrix.FromArray(key.values);\r\n if (key.values.length >= 17) {\r\n interpolation = key.values[16];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n data = Color3.FromArray(key.values);\r\n if (key.values[3]) {\r\n inTangent = Color3.FromArray(key.values[3]);\r\n }\r\n if (key.values[4]) {\r\n outTangent = Color3.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n interpolation = key.values[5];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n data = Color4.FromArray(key.values);\r\n if (key.values[4]) {\r\n inTangent = Color4.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n outTangent = Color4.FromArray(key.values[5]);\r\n }\r\n if (key.values[6]) {\r\n interpolation = Color4.FromArray(key.values[6]);\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n default:\r\n data = Vector3.FromArray(key.values);\r\n if (key.values[3]) {\r\n inTangent = Vector3.FromArray(key.values[3]);\r\n }\r\n if (key.values[4]) {\r\n outTangent = Vector3.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n interpolation = key.values[5];\r\n }\r\n break;\r\n }\r\n\r\n const keyData: any = {};\r\n keyData.frame = key.frame;\r\n keyData.value = data;\r\n\r\n if (inTangent != undefined) {\r\n keyData.inTangent = inTangent;\r\n }\r\n if (outTangent != undefined) {\r\n keyData.outTangent = outTangent;\r\n }\r\n if (interpolation != undefined) {\r\n keyData.interpolation = interpolation;\r\n }\r\n keys.push(keyData);\r\n }\r\n\r\n animation.setKeys(keys);\r\n\r\n if (parsedAnimation.ranges) {\r\n for (index = 0; index < parsedAnimation.ranges.length; index++) {\r\n data = parsedAnimation.ranges[index];\r\n animation.createRange(data.name, data.from, data.to);\r\n }\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Appends the serialized animations from the source animations\r\n * @param source Source containing the animations\r\n * @param destination Target to store the animations\r\n */\r\n public static AppendSerializedAnimations(source: IAnimatable, destination: any): void {\r\n SerializationHelper.AppendSerializedAnimations(source, destination);\r\n }\r\n\r\n /**\r\n * Creates a new animation or an array of animations from a snippet saved in a remote file\r\n * @param name defines the name of the animation to create (can be null or empty to use the one from the json data)\r\n * @param url defines the url to load from\r\n * @returns a promise that will resolve to the new animation or an array of animations\r\n */\r\n public static async ParseFromFileAsync(name: Nullable<string>, url: string): Promise<Animation | Array<Animation>> {\r\n return await new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n let serializationObject = JSON.parse(request.responseText);\r\n if (serializationObject.animations) {\r\n serializationObject = serializationObject.animations;\r\n }\r\n\r\n if (serializationObject.length) {\r\n const output: Animation[] = [];\r\n for (const serializedAnimation of serializationObject) {\r\n output.push(this.Parse(serializedAnimation));\r\n }\r\n\r\n resolve(output);\r\n } else {\r\n const output = this.Parse(serializationObject);\r\n\r\n if (name) {\r\n output.name = name;\r\n }\r\n\r\n resolve(output);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the animation\");\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates an animation or an array of animations from a snippet saved by the Inspector\r\n * @param snippetId defines the snippet to load\r\n * @returns a promise that will resolve to the new animation or a new array of animations\r\n */\r\n public static async ParseFromSnippetAsync(snippetId: string): Promise<Animation | Array<Animation>> {\r\n return await new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n\r\n if (snippet.animations) {\r\n const serializationObject = JSON.parse(snippet.animations);\r\n const outputs: Animation[] = [];\r\n for (const serializedAnimation of serializationObject.animations) {\r\n const output = this.Parse(serializedAnimation);\r\n output.snippetId = snippetId;\r\n outputs.push(output);\r\n }\r\n\r\n resolve(outputs);\r\n } else {\r\n const serializationObject = JSON.parse(snippet.animation);\r\n const output = this.Parse(serializationObject);\r\n\r\n output.snippetId = snippetId;\r\n\r\n resolve(output);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates an animation or an array of animations from a snippet saved by the Inspector\r\n * @deprecated Please use ParseFromSnippetAsync instead\r\n * @param snippetId defines the snippet to load\r\n * @returns a promise that will resolve to the new animation or a new array of animations\r\n */\r\n public static CreateFromSnippetAsync = Animation.ParseFromSnippetAsync;\r\n}\r\n\r\nRegisterClass(\"BABYLON.Animation\", Animation);\r\nNode._AnimationRangeFactory = (name: string, from: number, to: number) => new AnimationRange(name, from, to);\r\n"]}
|
|
@@ -86,8 +86,14 @@ export class InterpolatingBehavior {
|
|
|
86
86
|
}
|
|
87
87
|
const camera = this._attachedCamera;
|
|
88
88
|
const scene = camera.getScene();
|
|
89
|
-
const checkClear = (
|
|
90
|
-
|
|
89
|
+
const checkClear = (propertyName) => {
|
|
90
|
+
// Remove the associated animation from camera once the transition to target is complete so that property animations don't accumulate
|
|
91
|
+
for (let i = camera.animations.length - 1; i >= 0; --i) {
|
|
92
|
+
if (camera.animations[i].name === propertyName + "Animation") {
|
|
93
|
+
camera.animations.splice(i, 1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
this._animatables.delete(propertyName);
|
|
91
97
|
if (this._animatables.size === 0) {
|
|
92
98
|
this._promiseResolve = undefined;
|
|
93
99
|
resolve();
|
|
@@ -97,7 +103,8 @@ export class InterpolatingBehavior {
|
|
|
97
103
|
if (value !== undefined) {
|
|
98
104
|
const propertyName = String(key);
|
|
99
105
|
const animation = Animation.CreateAnimation(propertyName, GetAnimationType(value), 60, easingFn);
|
|
100
|
-
|
|
106
|
+
// Pass false for stopCurrent so that we can interpolate multiple properties at once
|
|
107
|
+
const animatable = Animation.TransitionTo(propertyName, value, camera, scene, 60, animation, transitionDuration, () => checkClear(propertyName), false);
|
|
101
108
|
if (animatable) {
|
|
102
109
|
this._animatables.set(propertyName, animatable);
|
|
103
110
|
}
|