@babylonjs/core 5.0.0-beta.7 → 5.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.d.ts +2 -2
- package/Animations/animation.js +5 -1
- package/Animations/animation.js.map +1 -1
- package/Bones/skeleton.d.ts +0 -6
- package/Bones/skeleton.js +2 -14
- package/Bones/skeleton.js.map +1 -1
- package/Compat/compatibilityOptions.d.ts +9 -0
- package/Compat/compatibilityOptions.js +14 -0
- package/Compat/compatibilityOptions.js.map +1 -0
- package/Compat/index.d.ts +1 -0
- package/Compat/index.js +2 -0
- package/Compat/index.js.map +1 -0
- package/Culling/ray.js +2 -2
- package/Culling/ray.js.map +1 -1
- package/Debug/skeletonViewer.js +3 -4
- package/Debug/skeletonViewer.js.map +1 -1
- package/Engines/Extensions/engine.multiview.js +0 -1
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +2 -1
- package/Engines/WebGPU/webgpuConstants.js +1 -0
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +5 -5
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/engine.d.ts +45 -26
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +31 -20
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/keyboardEvents.d.ts +7 -1
- package/Events/keyboardEvents.js +11 -1
- package/Events/keyboardEvents.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +0 -10
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +1 -1
- package/Gizmos/gizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +2 -2
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +5 -5
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +0 -8
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Textures/texture.js +5 -5
- package/Materials/Textures/texture.js.map +1 -1
- package/Meshes/Builders/boxBuilder.js +5 -4
- package/Meshes/Builders/boxBuilder.js.map +1 -1
- package/Meshes/Builders/capsuleBuilder.js +4 -3
- package/Meshes/Builders/capsuleBuilder.js.map +1 -1
- package/Meshes/Builders/cylinderBuilder.js +10 -7
- package/Meshes/Builders/cylinderBuilder.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +5 -2
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/discBuilder.js +3 -2
- package/Meshes/Builders/discBuilder.js.map +1 -1
- package/Meshes/Builders/goldbergBuilder.js +10 -1
- package/Meshes/Builders/goldbergBuilder.js.map +1 -1
- package/Meshes/Builders/groundBuilder.js +2 -1
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/Builders/icoSphereBuilder.js +2 -1
- package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
- package/Meshes/Builders/planeBuilder.js +5 -4
- package/Meshes/Builders/planeBuilder.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.js +6 -2
- package/Meshes/Builders/polygonBuilder.js.map +1 -1
- package/Meshes/Builders/polyhedronBuilder.js +3 -2
- package/Meshes/Builders/polyhedronBuilder.js.map +1 -1
- package/Meshes/Builders/ribbonBuilder.js +4 -3
- package/Meshes/Builders/ribbonBuilder.js.map +1 -1
- package/Meshes/Builders/sphereBuilder.js +2 -1
- package/Meshes/Builders/sphereBuilder.js.map +1 -1
- package/Meshes/Builders/tiledBoxBuilder.js +4 -0
- package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
- package/Meshes/Builders/torusBuilder.js +2 -1
- package/Meshes/Builders/torusBuilder.js.map +1 -1
- package/Meshes/Builders/torusKnotBuilder.js +2 -1
- package/Meshes/Builders/torusKnotBuilder.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +8 -2
- package/Meshes/abstractMesh.js +33 -31
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.js +31 -0
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/instancedMesh.js +5 -6
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +1 -1
- package/Meshes/mesh.js +31 -29
- package/Meshes/mesh.js.map +1 -1
- package/Misc/decorators.js +7 -0
- package/Misc/decorators.js.map +1 -1
- package/Misc/deepCopier.js +3 -3
- package/Misc/deepCopier.js.map +1 -1
- package/assetContainer.js +1 -4
- package/assetContainer.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +7 -1
- package/scene.js +11 -10
- package/scene.js.map +1 -1
|
@@ -251,12 +251,12 @@ export declare class Animation {
|
|
|
251
251
|
* Gets the easing function of the animation
|
|
252
252
|
* @returns Easing function of the animation
|
|
253
253
|
*/
|
|
254
|
-
getEasingFunction(): IEasingFunction
|
|
254
|
+
getEasingFunction(): Nullable<IEasingFunction>;
|
|
255
255
|
/**
|
|
256
256
|
* Sets the easing function of the animation
|
|
257
257
|
* @param easingFunction A custom mathematical formula for animation
|
|
258
258
|
*/
|
|
259
|
-
setEasingFunction(easingFunction: IEasingFunction): void;
|
|
259
|
+
setEasingFunction(easingFunction: Nullable<IEasingFunction>): void;
|
|
260
260
|
/**
|
|
261
261
|
* Interpolates a scalar linearly
|
|
262
262
|
* @param startValue Start value of the animation curve
|
package/Animations/animation.js
CHANGED
|
@@ -49,6 +49,10 @@ var Animation = /** @class */ (function () {
|
|
|
49
49
|
this.dataType = dataType;
|
|
50
50
|
this.loopMode = loopMode;
|
|
51
51
|
this.enableBlending = enableBlending;
|
|
52
|
+
/**
|
|
53
|
+
* Stores the easing function of the animation
|
|
54
|
+
*/
|
|
55
|
+
this._easingFunction = null;
|
|
52
56
|
/**
|
|
53
57
|
* @hidden Internal use only
|
|
54
58
|
*/
|
|
@@ -770,7 +774,7 @@ var Animation = /** @class */ (function () {
|
|
|
770
774
|
var gradient = (currentFrame - startKey.frame) / frameDelta;
|
|
771
775
|
// check for easingFunction and correction of gradient
|
|
772
776
|
var easingFunction = this.getEasingFunction();
|
|
773
|
-
if (easingFunction
|
|
777
|
+
if (easingFunction !== null) {
|
|
774
778
|
gradient = easingFunction.ease(gradient);
|
|
775
779
|
}
|
|
776
780
|
switch (this.dataType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.js","sourceRoot":"","sources":["../../../sourceES6/core/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,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAiB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,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;AAKhD;;GAEG;AACH;IAAA;IAOA,CAAC;IAAD,uBAAC;AAAD,CAAC,AAPD,IAOC;;AAED;;GAEG;AACH;IA6dI;;;;;;;;OAQG;IACH;IACI,2BAA2B;IACpB,IAAY;IACnB,yBAAyB;IAClB,cAAsB;IAC7B,4CAA4C;IACrC,cAAsB;IAC7B,oCAAoC;IAC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CAAC;IACjD;;OAEG;IACoB,4BAAkB,GAAG,CAAC,CAAC;IAC9C;;OAEG;IACoB,oCAA0B,GAAG,CAAC,CAAC;IACtD;;OAEG;IACoB,iCAAuB,GAAG,CAAC,CAAC;IACnD;;OAEG;IACoB,oCAA0B,GAAG,CAAC,CAAC;IAkP1D,gBAAC;CAAA,AAj4CD,IAi4CC;SAj4CY,SAAS;AAm4CtB,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AAC9C,IAAI,CAAC,sBAAsB,GAAG,UAAC,IAAY,EAAE,IAAY,EAAE,EAAU,IAAK,OAAA,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,EAAlC,CAAkC,CAAC","sourcesContent":["import { 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 { Scalar } from \"../Maths/math.scalar\";\r\n\r\nimport { Nullable } from \"../types\";\r\nimport { Scene } from \"../scene\";\r\nimport { SerializationHelper } from \"../Misc/decorators\";\r\nimport { RegisterClass } from '../Misc/typeStore';\r\nimport { IAnimationKey, AnimationKeyInterpolation } from './animationKey';\r\nimport { AnimationRange } from './animationRange';\r\nimport { AnimationEvent } from './animationEvent';\r\nimport { Node } from \"../node\";\r\nimport { IAnimatable } from './animatable.interface';\r\nimport { Size } from '../Maths/math.size';\r\nimport { WebRequest } from '../Misc/webRequest';\r\n\r\ndeclare type Animatable = import(\"./animatable\").Animatable;\r\ndeclare type RuntimeAnimation = import(\"./runtimeAnimation\").RuntimeAnimation;\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class _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\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 = \"https://snippet.babylonjs.com\";\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: IEasingFunction;\r\n\r\n /**\r\n * @hidden 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 /**\r\n * @hidden Internal use\r\n */\r\n public static _PrepareAnimation(name: string, targetProperty: string, framePerSecond: number, totalFrame: number,\r\n from: any, to: any, loopMode?: number, easingFunction?: EasingFunction): Nullable<Animation> {\r\n var 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 var animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);\r\n\r\n var keys: Array<IAnimationKey> = [{ frame: 0, value: from }, { frame: totalFrame, value: to }];\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 var animation: Animation = new Animation(property + \"Animation\",\r\n property,\r\n framePerSecond,\r\n animationType,\r\n 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(name: string, target: any, targetProperty: string,\r\n framePerSecond: number, totalFrame: number,\r\n from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void, scene?: Scene): Nullable<Animatable> {\r\n\r\n var 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 === 1), 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(name: string, node: Node, directDescendantsOnly: boolean, targetProperty: string,\r\n framePerSecond: number, totalFrame: number,\r\n from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Nullable<Animatable[]> {\r\n\r\n var 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 let 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(name: string, node: Node, targetProperty: string,\r\n framePerSecond: number, totalFrame: number,\r\n from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Nullable<Animatable> {\r\n\r\n var 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 for all animations belonging to the group 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\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 = 0, range?: string, cloneOriginal = false, clonedName?: string): Animation {\r\n let animation = sourceAnimation;\r\n\r\n if (cloneOriginal) {\r\n animation = sourceAnimation.clone();\r\n animation.name = clonedName || animation.name;\r\n }\r\n\r\n if (!animation._keys.length) {\r\n return animation;\r\n }\r\n\r\n referenceFrame = referenceFrame >= 0 ? referenceFrame : 0;\r\n let startIndex = 0;\r\n let firstKey = animation._keys[0];\r\n let endIndex = animation._keys.length - 1;\r\n let lastKey = animation._keys[endIndex];\r\n let 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 referenceFound = false;\r\n let from = firstKey.frame;\r\n let to = lastKey.frame;\r\n if (range) {\r\n let rangeValue = animation.getRange(range);\r\n\r\n if (rangeValue) {\r\n from = rangeValue.from;\r\n to = rangeValue.to;\r\n }\r\n }\r\n let fromKeyFound = firstKey.frame === from;\r\n let toKeyFound = lastKey.frame === to;\r\n\r\n // There's only one key, so use it\r\n if (animation._keys.length === 1) {\r\n let value = animation._getKeyValue(animation._keys[0]);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n referenceFound = true;\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 let value = animation._getKeyValue(firstKey.value);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n referenceFound = true;\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 let value = animation._getKeyValue(lastKey.value);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n referenceFound = true;\r\n }\r\n\r\n // Find key bookends, create them if they don't exist\r\n var index = 0;\r\n while (!referenceFound || !fromKeyFound || !toKeyFound && index < animation._keys.length - 1) {\r\n let currentKey = animation._keys[index];\r\n let nextKey = animation._keys[index + 1];\r\n\r\n // If reference frame wasn't found yet, check if we can interpolate to it\r\n if (!referenceFound && referenceFrame >= currentKey.frame && referenceFrame <= nextKey.frame) {\r\n let value;\r\n\r\n if (referenceFrame === currentKey.frame) {\r\n value = animation._getKeyValue(currentKey.value);\r\n } else if (referenceFrame === nextKey.frame) {\r\n value = animation._getKeyValue(nextKey.value);\r\n } else {\r\n let animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT\r\n };\r\n value = animation._interpolate(referenceFrame, animationState);\r\n }\r\n\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n referenceFound = true;\r\n }\r\n\r\n // If from key wasn't found yet, check if we can interpolate to it\r\n if (!fromKeyFound && from >= currentKey.frame && from <= nextKey.frame) {\r\n if (from === currentKey.frame) {\r\n startIndex = index;\r\n } else if (from === nextKey.frame) {\r\n startIndex = index + 1;\r\n } else {\r\n let animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT\r\n };\r\n let value = animation._interpolate(from, animationState);\r\n let key: IAnimationKey = {\r\n frame: from,\r\n value: value.clone ? value.clone() : value\r\n };\r\n animation._keys.splice(index + 1, 0, key);\r\n startIndex = index + 1;\r\n }\r\n\r\n fromKeyFound = true;\r\n }\r\n\r\n // If to key wasn't found yet, check if we can interpolate to it\r\n if (!toKeyFound && to >= currentKey.frame && to <= nextKey.frame) {\r\n if (to === currentKey.frame) {\r\n endIndex = index;\r\n } else if (to === nextKey.frame) {\r\n endIndex = index + 1;\r\n } else {\r\n let animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT\r\n };\r\n let value = animation._interpolate(to, animationState);\r\n let key: IAnimationKey = {\r\n frame: to,\r\n value: value.clone ? value.clone() : value\r\n };\r\n animation._keys.splice(index + 1, 0, key);\r\n endIndex = index + 1;\r\n }\r\n\r\n toKeyFound = true;\r\n }\r\n\r\n index++;\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 // Subtract the reference value from all of the key values\r\n for (var index = startIndex; index <= endIndex; index++) {\r\n let key = animation._keys[index];\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 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(property: string, targetValue: any, host: any, scene: Scene, frameRate: number, transition: Animation, duration: number, onAnimationEnd: Nullable<() => void> = null): 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 var endFrame: number = frameRate * (duration / 1000);\r\n\r\n transition.setKeys([{\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 if (!host.animations) {\r\n host.animations = [];\r\n }\r\n\r\n host.animations.push(transition);\r\n\r\n var 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 (var 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 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 var 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 var first = true;\r\n for (var 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 (var 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 let range = this._ranges[name];\r\n if (!range) {\r\n return;\r\n\r\n }\r\n if (deleteFrames) {\r\n var from = range.from;\r\n var to = range.to;\r\n\r\n // this loop MUST go high to low for multiple splices to work\r\n for (var 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 /**\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 rate of the animation\r\n * @returns Highest frame rate of the animation\r\n */\r\n public getHighestFrame(): number {\r\n var ret = 0;\r\n\r\n for (var 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(): 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: 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 Scalar.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 Scalar.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\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\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\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\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 * @hidden 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 return this._interpolate(currentFrame, {\r\n key: 0,\r\n repeatCount: 0,\r\n loopMode: Animation.ANIMATIONLOOPMODE_CONSTANT\r\n });\r\n }\r\n\r\n /**\r\n * @hidden Internal use only\r\n */\r\n public _interpolate(currentFrame: number, state: _IAnimationState): 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 if (keys.length === 1) {\r\n return this._getKeyValue(keys[0].value);\r\n }\r\n\r\n var startKeyIndex = state.key;\r\n\r\n if (keys[startKeyIndex].frame >= currentFrame) {\r\n while (startKeyIndex - 1 >= 0 && keys[startKeyIndex].frame >= currentFrame) {\r\n startKeyIndex--;\r\n }\r\n }\r\n\r\n for (var key = startKeyIndex; key < keys.length - 1; key++) {\r\n var endKey = keys[key + 1];\r\n\r\n if (endKey.frame >= currentFrame) {\r\n state.key = key;\r\n var startKey = keys[key];\r\n var startValue = this._getKeyValue(startKey.value);\r\n var 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 var useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;\r\n var frameDelta = endKey.frame - startKey.frame;\r\n\r\n // gradient : percent of currentFrame between the frame inf and the frame sup\r\n var gradient = (currentFrame - startKey.frame) / frameDelta;\r\n\r\n // check for easingFunction and correction of gradient\r\n let easingFunction = this.getEasingFunction();\r\n if (easingFunction != null) {\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 var floatValue = useTangent ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient) : this.floatInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return floatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return state.offsetValue * state.repeatCount + floatValue;\r\n }\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n var quatValue = useTangent ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.quaternionInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return quatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return quatValue.addInPlace(state.offsetValue.scale(state.repeatCount));\r\n }\r\n\r\n return quatValue;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n var vec3Value = useTangent ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.vector3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return vec3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return vec3Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n var vec2Value = useTangent ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.vector2InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return vec2Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return vec2Value.add(state.offsetValue.scale(state.repeatCount));\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 return this.sizeInterpolateFunction(startValue, endValue, gradient);\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient).add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n var color3Value = useTangent ? this.color3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.color3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return color3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return color3Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n // Color4\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n var color4Value = useTangent ? this.color4InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.color4InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return color4Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return color4Value.add(state.offsetValue.scale(state.repeatCount));\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 if (Animation.AllowMatricesInterpolation) {\r\n return this.matrixInterpolateFunction(startValue, endValue, gradient, state.workValue);\r\n }\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return startValue;\r\n }\r\n default:\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return this._getKeyValue(keys[keys.length - 1].value);\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 var 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 (var name in this._ranges) {\r\n let 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 */\r\n public setKeys(values: Array<IAnimationKey>): void {\r\n this._keys = values.slice(0);\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 var 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 var dataType = this.dataType;\r\n serializationObject.keys = [];\r\n var keys = this.getKeys();\r\n for (var index = 0; index < keys.length; index++) {\r\n var animationKey = keys[index];\r\n\r\n var 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 (var name in this._ranges) {\r\n let source = this._ranges[name];\r\n\r\n if (!source) {\r\n continue;\r\n }\r\n var 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 = 0;\r\n /**\r\n * Vector3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_VECTOR3 = 1;\r\n /**\r\n * Quaternion animation type\r\n */\r\n public static readonly ANIMATIONTYPE_QUATERNION = 2;\r\n /**\r\n * Matrix animation type\r\n */\r\n public static readonly ANIMATIONTYPE_MATRIX = 3;\r\n /**\r\n * Color3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_COLOR3 = 4;\r\n /**\r\n * Color3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_COLOR4 = 7;\r\n /**\r\n * Vector2 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_VECTOR2 = 5;\r\n /**\r\n * Size animation type\r\n */\r\n public static readonly ANIMATIONTYPE_SIZE = 6;\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 /** @hidden */\r\n public static _UniversalLerp(left: any, right: any, amount: number): any {\r\n let constructor = left.constructor;\r\n if (constructor.Lerp) { // Lerp supported\r\n return constructor.Lerp(left, right, amount);\r\n } else if (constructor.Slerp) { // Slerp supported\r\n return constructor.Slerp(left, right, amount);\r\n } else if (left.toFixed) { // Number\r\n return left * (1.0 - amount) + amount * right;\r\n } else { // 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 var animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);\r\n\r\n var dataType = parsedAnimation.dataType;\r\n var keys: Array<IAnimationKey> = [];\r\n var data;\r\n var 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 var 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 var _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 var _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 var 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 ParseFromFileAsync(name: Nullable<string>, url: string): Promise<Animation | Array<Animation>> {\r\n\r\n return new Promise((resolve, reject) => {\r\n var 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 let output = new Array<Animation>();\r\n for (var serializedAnimation of serializationObject) {\r\n output.push(this.Parse(serializedAnimation));\r\n }\r\n\r\n resolve(output);\r\n } else {\r\n let 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 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 CreateFromSnippetAsync(snippetId: string): Promise<Animation | Array<Animation>> {\r\n return new Promise((resolve, reject) => {\r\n var request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n var snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n\r\n if (snippet.animations) {\r\n let serializationObject = JSON.parse(snippet.animations);\r\n let outputs = new Array<Animation>();\r\n for (var serializedAnimation of serializationObject.animations) {\r\n let 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 let serializationObject = JSON.parse(snippet.animation);\r\n let output = this.Parse(serializationObject);\r\n\r\n output.snippetId = snippetId;\r\n\r\n resolve(output);\r\n }\r\n } else {\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\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":["../../../sourceES6/core/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,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAiB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,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;AAKhD;;GAEG;AACH;IAAA;IAOA,CAAC;IAAD,uBAAC;AAAD,CAAC,AAPD,IAOC;;AAED;;GAEG;AACH;IA6dI;;;;;;;;OAQG;IACH;IACI,2BAA2B;IACpB,IAAY;IACnB,yBAAyB;IAClB,cAAsB;IAC7B,4CAA4C;IACrC,cAAsB;IAC7B,oCAAoC;IAC7B,QAAgB;IACvB,oCAAoC;IAC7B,QAAiB;IACxB,6CAA6C;IACtC,cAAwB;QAVxB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,mBAAc,GAAd,cAAc,CAAQ;QAEtB,mBAAc,GAAd,cAAc,CAA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CAAuB,GAAG,CAAC,CAAC;IACnD;;OAEG;IACoB,oCAA0B,GAAG,CAAC,CAAC;IAkP1D,gBAAC;CAAA,AAj4CD,IAi4CC;SAj4CY,SAAS;AAm4CtB,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AAC9C,IAAI,CAAC,sBAAsB,GAAG,UAAC,IAAY,EAAE,IAAY,EAAE,EAAU,IAAK,OAAA,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,EAAlC,CAAkC,CAAC","sourcesContent":["import { 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 { Scalar } from \"../Maths/math.scalar\";\r\n\r\nimport { Nullable } from \"../types\";\r\nimport { Scene } from \"../scene\";\r\nimport { SerializationHelper } from \"../Misc/decorators\";\r\nimport { RegisterClass } from '../Misc/typeStore';\r\nimport { IAnimationKey, AnimationKeyInterpolation } from './animationKey';\r\nimport { AnimationRange } from './animationRange';\r\nimport { AnimationEvent } from './animationEvent';\r\nimport { Node } from \"../node\";\r\nimport { IAnimatable } from './animatable.interface';\r\nimport { Size } from '../Maths/math.size';\r\nimport { WebRequest } from '../Misc/webRequest';\r\n\r\ndeclare type Animatable = import(\"./animatable\").Animatable;\r\ndeclare type RuntimeAnimation = import(\"./runtimeAnimation\").RuntimeAnimation;\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class _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\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 = \"https://snippet.babylonjs.com\";\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 * @hidden 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 /**\r\n * @hidden Internal use\r\n */\r\n public static _PrepareAnimation(name: string, targetProperty: string, framePerSecond: number, totalFrame: number,\r\n from: any, to: any, loopMode?: number, easingFunction?: EasingFunction): Nullable<Animation> {\r\n var 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 var animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);\r\n\r\n var keys: Array<IAnimationKey> = [{ frame: 0, value: from }, { frame: totalFrame, value: to }];\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 var animation: Animation = new Animation(property + \"Animation\",\r\n property,\r\n framePerSecond,\r\n animationType,\r\n 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(name: string, target: any, targetProperty: string,\r\n framePerSecond: number, totalFrame: number,\r\n from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void, scene?: Scene): Nullable<Animatable> {\r\n\r\n var 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 === 1), 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(name: string, node: Node, directDescendantsOnly: boolean, targetProperty: string,\r\n framePerSecond: number, totalFrame: number,\r\n from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Nullable<Animatable[]> {\r\n\r\n var 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 let 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(name: string, node: Node, targetProperty: string,\r\n framePerSecond: number, totalFrame: number,\r\n from: any, to: any, loopMode?: number, easingFunction?: EasingFunction, onAnimationEnd?: () => void): Nullable<Animatable> {\r\n\r\n var 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 for all animations belonging to the group 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\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 = 0, range?: string, cloneOriginal = false, clonedName?: string): Animation {\r\n let animation = sourceAnimation;\r\n\r\n if (cloneOriginal) {\r\n animation = sourceAnimation.clone();\r\n animation.name = clonedName || animation.name;\r\n }\r\n\r\n if (!animation._keys.length) {\r\n return animation;\r\n }\r\n\r\n referenceFrame = referenceFrame >= 0 ? referenceFrame : 0;\r\n let startIndex = 0;\r\n let firstKey = animation._keys[0];\r\n let endIndex = animation._keys.length - 1;\r\n let lastKey = animation._keys[endIndex];\r\n let 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 referenceFound = false;\r\n let from = firstKey.frame;\r\n let to = lastKey.frame;\r\n if (range) {\r\n let rangeValue = animation.getRange(range);\r\n\r\n if (rangeValue) {\r\n from = rangeValue.from;\r\n to = rangeValue.to;\r\n }\r\n }\r\n let fromKeyFound = firstKey.frame === from;\r\n let toKeyFound = lastKey.frame === to;\r\n\r\n // There's only one key, so use it\r\n if (animation._keys.length === 1) {\r\n let value = animation._getKeyValue(animation._keys[0]);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n referenceFound = true;\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 let value = animation._getKeyValue(firstKey.value);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n referenceFound = true;\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 let value = animation._getKeyValue(lastKey.value);\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n referenceFound = true;\r\n }\r\n\r\n // Find key bookends, create them if they don't exist\r\n var index = 0;\r\n while (!referenceFound || !fromKeyFound || !toKeyFound && index < animation._keys.length - 1) {\r\n let currentKey = animation._keys[index];\r\n let nextKey = animation._keys[index + 1];\r\n\r\n // If reference frame wasn't found yet, check if we can interpolate to it\r\n if (!referenceFound && referenceFrame >= currentKey.frame && referenceFrame <= nextKey.frame) {\r\n let value;\r\n\r\n if (referenceFrame === currentKey.frame) {\r\n value = animation._getKeyValue(currentKey.value);\r\n } else if (referenceFrame === nextKey.frame) {\r\n value = animation._getKeyValue(nextKey.value);\r\n } else {\r\n let animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT\r\n };\r\n value = animation._interpolate(referenceFrame, animationState);\r\n }\r\n\r\n valueStore.referenceValue = value.clone ? value.clone() : value;\r\n referenceFound = true;\r\n }\r\n\r\n // If from key wasn't found yet, check if we can interpolate to it\r\n if (!fromKeyFound && from >= currentKey.frame && from <= nextKey.frame) {\r\n if (from === currentKey.frame) {\r\n startIndex = index;\r\n } else if (from === nextKey.frame) {\r\n startIndex = index + 1;\r\n } else {\r\n let animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT\r\n };\r\n let value = animation._interpolate(from, animationState);\r\n let key: IAnimationKey = {\r\n frame: from,\r\n value: value.clone ? value.clone() : value\r\n };\r\n animation._keys.splice(index + 1, 0, key);\r\n startIndex = index + 1;\r\n }\r\n\r\n fromKeyFound = true;\r\n }\r\n\r\n // If to key wasn't found yet, check if we can interpolate to it\r\n if (!toKeyFound && to >= currentKey.frame && to <= nextKey.frame) {\r\n if (to === currentKey.frame) {\r\n endIndex = index;\r\n } else if (to === nextKey.frame) {\r\n endIndex = index + 1;\r\n } else {\r\n let animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT\r\n };\r\n let value = animation._interpolate(to, animationState);\r\n let key: IAnimationKey = {\r\n frame: to,\r\n value: value.clone ? value.clone() : value\r\n };\r\n animation._keys.splice(index + 1, 0, key);\r\n endIndex = index + 1;\r\n }\r\n\r\n toKeyFound = true;\r\n }\r\n\r\n index++;\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 // Subtract the reference value from all of the key values\r\n for (var index = startIndex; index <= endIndex; index++) {\r\n let key = animation._keys[index];\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 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(property: string, targetValue: any, host: any, scene: Scene, frameRate: number, transition: Animation, duration: number, onAnimationEnd: Nullable<() => void> = null): 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 var endFrame: number = frameRate * (duration / 1000);\r\n\r\n transition.setKeys([{\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 if (!host.animations) {\r\n host.animations = [];\r\n }\r\n\r\n host.animations.push(transition);\r\n\r\n var 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 (var 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 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 var 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 var first = true;\r\n for (var 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 (var 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 let range = this._ranges[name];\r\n if (!range) {\r\n return;\r\n\r\n }\r\n if (deleteFrames) {\r\n var from = range.from;\r\n var to = range.to;\r\n\r\n // this loop MUST go high to low for multiple splices to work\r\n for (var 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 /**\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 rate of the animation\r\n * @returns Highest frame rate of the animation\r\n */\r\n public getHighestFrame(): number {\r\n var ret = 0;\r\n\r\n for (var 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 Scalar.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 Scalar.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\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\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\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\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 * @hidden 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 return this._interpolate(currentFrame, {\r\n key: 0,\r\n repeatCount: 0,\r\n loopMode: Animation.ANIMATIONLOOPMODE_CONSTANT\r\n });\r\n }\r\n\r\n /**\r\n * @hidden Internal use only\r\n */\r\n public _interpolate(currentFrame: number, state: _IAnimationState): 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 if (keys.length === 1) {\r\n return this._getKeyValue(keys[0].value);\r\n }\r\n\r\n var startKeyIndex = state.key;\r\n\r\n if (keys[startKeyIndex].frame >= currentFrame) {\r\n while (startKeyIndex - 1 >= 0 && keys[startKeyIndex].frame >= currentFrame) {\r\n startKeyIndex--;\r\n }\r\n }\r\n\r\n for (var key = startKeyIndex; key < keys.length - 1; key++) {\r\n var endKey = keys[key + 1];\r\n\r\n if (endKey.frame >= currentFrame) {\r\n state.key = key;\r\n var startKey = keys[key];\r\n var startValue = this._getKeyValue(startKey.value);\r\n var 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 var useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;\r\n var frameDelta = endKey.frame - startKey.frame;\r\n\r\n // gradient : percent of currentFrame between the frame inf and the frame sup\r\n var gradient = (currentFrame - startKey.frame) / frameDelta;\r\n\r\n // check for easingFunction and correction of gradient\r\n let easingFunction = this.getEasingFunction();\r\n if (easingFunction !== null) {\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 var floatValue = useTangent ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient) : this.floatInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return floatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return state.offsetValue * state.repeatCount + floatValue;\r\n }\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n var quatValue = useTangent ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.quaternionInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return quatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return quatValue.addInPlace(state.offsetValue.scale(state.repeatCount));\r\n }\r\n\r\n return quatValue;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n var vec3Value = useTangent ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.vector3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return vec3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return vec3Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n var vec2Value = useTangent ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.vector2InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return vec2Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return vec2Value.add(state.offsetValue.scale(state.repeatCount));\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 return this.sizeInterpolateFunction(startValue, endValue, gradient);\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient).add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n var color3Value = useTangent ? this.color3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.color3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return color3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return color3Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n // Color4\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n var color4Value = useTangent ? this.color4InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this.color4InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n return color4Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return color4Value.add(state.offsetValue.scale(state.repeatCount));\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 if (Animation.AllowMatricesInterpolation) {\r\n return this.matrixInterpolateFunction(startValue, endValue, gradient, state.workValue);\r\n }\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return startValue;\r\n }\r\n default:\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return this._getKeyValue(keys[keys.length - 1].value);\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 var 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 (var name in this._ranges) {\r\n let 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 */\r\n public setKeys(values: Array<IAnimationKey>): void {\r\n this._keys = values.slice(0);\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 var 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 var dataType = this.dataType;\r\n serializationObject.keys = [];\r\n var keys = this.getKeys();\r\n for (var index = 0; index < keys.length; index++) {\r\n var animationKey = keys[index];\r\n\r\n var 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 (var name in this._ranges) {\r\n let source = this._ranges[name];\r\n\r\n if (!source) {\r\n continue;\r\n }\r\n var 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 = 0;\r\n /**\r\n * Vector3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_VECTOR3 = 1;\r\n /**\r\n * Quaternion animation type\r\n */\r\n public static readonly ANIMATIONTYPE_QUATERNION = 2;\r\n /**\r\n * Matrix animation type\r\n */\r\n public static readonly ANIMATIONTYPE_MATRIX = 3;\r\n /**\r\n * Color3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_COLOR3 = 4;\r\n /**\r\n * Color3 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_COLOR4 = 7;\r\n /**\r\n * Vector2 animation type\r\n */\r\n public static readonly ANIMATIONTYPE_VECTOR2 = 5;\r\n /**\r\n * Size animation type\r\n */\r\n public static readonly ANIMATIONTYPE_SIZE = 6;\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 /** @hidden */\r\n public static _UniversalLerp(left: any, right: any, amount: number): any {\r\n let constructor = left.constructor;\r\n if (constructor.Lerp) { // Lerp supported\r\n return constructor.Lerp(left, right, amount);\r\n } else if (constructor.Slerp) { // Slerp supported\r\n return constructor.Slerp(left, right, amount);\r\n } else if (left.toFixed) { // Number\r\n return left * (1.0 - amount) + amount * right;\r\n } else { // 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 var animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);\r\n\r\n var dataType = parsedAnimation.dataType;\r\n var keys: Array<IAnimationKey> = [];\r\n var data;\r\n var 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 var 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 var _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 var _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 var 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 ParseFromFileAsync(name: Nullable<string>, url: string): Promise<Animation | Array<Animation>> {\r\n\r\n return new Promise((resolve, reject) => {\r\n var 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 let output = new Array<Animation>();\r\n for (var serializedAnimation of serializationObject) {\r\n output.push(this.Parse(serializedAnimation));\r\n }\r\n\r\n resolve(output);\r\n } else {\r\n let 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 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 CreateFromSnippetAsync(snippetId: string): Promise<Animation | Array<Animation>> {\r\n return new Promise((resolve, reject) => {\r\n var request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n var snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n\r\n if (snippet.animations) {\r\n let serializationObject = JSON.parse(snippet.animations);\r\n let outputs = new Array<Animation>();\r\n for (var serializedAnimation of serializationObject.animations) {\r\n let 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 let serializationObject = JSON.parse(snippet.animation);\r\n let output = this.Parse(serializationObject);\r\n\r\n output.snippetId = snippetId;\r\n\r\n resolve(output);\r\n }\r\n } else {\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\nRegisterClass(\"BABYLON.Animation\", Animation);\r\nNode._AnimationRangeFactory = (name: string, from: number, to: number) => new AnimationRange(name, from, to);\r\n"]}
|
package/Bones/skeleton.d.ts
CHANGED
|
@@ -33,10 +33,6 @@ export declare class Skeleton implements IAnimatable {
|
|
|
33
33
|
* Defines a boolean indicating if the root matrix is provided by meshes or by the current skeleton (this is the default value)
|
|
34
34
|
*/
|
|
35
35
|
needInitialSkinMatrix: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Defines a mesh that override the matrix used to get the world matrix (null by default).
|
|
38
|
-
*/
|
|
39
|
-
overrideMesh: Nullable<AbstractMesh>;
|
|
40
36
|
/**
|
|
41
37
|
* Gets the list of animations attached to this skeleton
|
|
42
38
|
*/
|
|
@@ -58,8 +54,6 @@ export declare class Skeleton implements IAnimatable {
|
|
|
58
54
|
/** @hidden */
|
|
59
55
|
_hasWaitingData: Nullable<boolean>;
|
|
60
56
|
/** @hidden */
|
|
61
|
-
_waitingOverrideMeshId: Nullable<string>;
|
|
62
|
-
/** @hidden */
|
|
63
57
|
_parentContainer: Nullable<AbstractScene>;
|
|
64
58
|
/**
|
|
65
59
|
* Specifies if the skeleton should be serialized
|
package/Bones/skeleton.js
CHANGED
|
@@ -33,10 +33,6 @@ var Skeleton = /** @class */ (function () {
|
|
|
33
33
|
* Defines a boolean indicating if the root matrix is provided by meshes or by the current skeleton (this is the default value)
|
|
34
34
|
*/
|
|
35
35
|
this.needInitialSkinMatrix = false;
|
|
36
|
-
/**
|
|
37
|
-
* Defines a mesh that override the matrix used to get the world matrix (null by default).
|
|
38
|
-
*/
|
|
39
|
-
this.overrideMesh = null;
|
|
40
36
|
this._isDirty = true;
|
|
41
37
|
this._meshesWithPoseMatrix = new Array();
|
|
42
38
|
this._identity = Matrix.Identity();
|
|
@@ -49,8 +45,6 @@ var Skeleton = /** @class */ (function () {
|
|
|
49
45
|
/** @hidden */
|
|
50
46
|
this._hasWaitingData = null;
|
|
51
47
|
/** @hidden */
|
|
52
|
-
this._waitingOverrideMeshId = null;
|
|
53
|
-
/** @hidden */
|
|
54
48
|
this._parentContainer = null;
|
|
55
49
|
/**
|
|
56
50
|
* Specifies if the skeleton should be serialized
|
|
@@ -514,7 +508,6 @@ var Skeleton = /** @class */ (function () {
|
|
|
514
508
|
Skeleton.prototype.clone = function (name, id) {
|
|
515
509
|
var result = new Skeleton(name, id || name, this._scene);
|
|
516
510
|
result.needInitialSkinMatrix = this.needInitialSkinMatrix;
|
|
517
|
-
result.overrideMesh = this.overrideMesh;
|
|
518
511
|
for (var index = 0; index < this.bones.length; index++) {
|
|
519
512
|
var source = this.bones[index];
|
|
520
513
|
var parentBone = null;
|
|
@@ -582,7 +575,7 @@ var Skeleton = /** @class */ (function () {
|
|
|
582
575
|
* @returns a JSON object
|
|
583
576
|
*/
|
|
584
577
|
Skeleton.prototype.serialize = function () {
|
|
585
|
-
var _a
|
|
578
|
+
var _a;
|
|
586
579
|
var serializationObject = {};
|
|
587
580
|
serializationObject.name = this.name;
|
|
588
581
|
serializationObject.id = this.id;
|
|
@@ -591,7 +584,6 @@ var Skeleton = /** @class */ (function () {
|
|
|
591
584
|
}
|
|
592
585
|
serializationObject.bones = [];
|
|
593
586
|
serializationObject.needInitialSkinMatrix = this.needInitialSkinMatrix;
|
|
594
|
-
serializationObject.overrideMeshId = (_a = this.overrideMesh) === null || _a === void 0 ? void 0 : _a.id;
|
|
595
587
|
for (var index = 0; index < this.bones.length; index++) {
|
|
596
588
|
var bone = this.bones[index];
|
|
597
589
|
var parent_2 = bone.getParent();
|
|
@@ -602,7 +594,7 @@ var Skeleton = /** @class */ (function () {
|
|
|
602
594
|
id: bone.id,
|
|
603
595
|
matrix: bone.getBaseMatrix().toArray(),
|
|
604
596
|
rest: bone.getRestPose().toArray(),
|
|
605
|
-
linkedTransformNodeId: (
|
|
597
|
+
linkedTransformNodeId: (_a = bone.getTransformNode()) === null || _a === void 0 ? void 0 : _a.id
|
|
606
598
|
};
|
|
607
599
|
serializationObject.bones.push(serializedBone);
|
|
608
600
|
if (bone.length) {
|
|
@@ -641,10 +633,6 @@ var Skeleton = /** @class */ (function () {
|
|
|
641
633
|
skeleton.dimensionsAtRest = Vector3.FromArray(parsedSkeleton.dimensionsAtRest);
|
|
642
634
|
}
|
|
643
635
|
skeleton.needInitialSkinMatrix = parsedSkeleton.needInitialSkinMatrix;
|
|
644
|
-
if (parsedSkeleton.overrideMeshId) {
|
|
645
|
-
skeleton._hasWaitingData = true;
|
|
646
|
-
skeleton._waitingOverrideMeshId = parsedSkeleton.overrideMeshId;
|
|
647
|
-
}
|
|
648
636
|
var index;
|
|
649
637
|
for (index = 0; index < parsedSkeleton.bones.length; index++) {
|
|
650
638
|
var parsedBone = parsedSkeleton.bones[index];
|