@babylonjs/core 6.17.1 → 6.19.0

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.
Files changed (186) hide show
  1. package/Animations/animation.d.ts +2 -1
  2. package/Animations/animation.js +3 -2
  3. package/Animations/animation.js.map +1 -1
  4. package/Animations/animationGroup.d.ts +26 -5
  5. package/Animations/animationGroup.js +101 -11
  6. package/Animations/animationGroup.js.map +1 -1
  7. package/Audio/sound.d.ts +1 -0
  8. package/Audio/sound.js +2 -1
  9. package/Audio/sound.js.map +1 -1
  10. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.d.ts +2 -0
  11. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +9 -2
  12. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  13. package/DeviceInput/webDeviceInputSystem.d.ts +9 -0
  14. package/DeviceInput/webDeviceInputSystem.js +22 -0
  15. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  16. package/Engines/WebGL/webGLHardwareTexture.d.ts +1 -0
  17. package/Engines/WebGL/webGLHardwareTexture.js +4 -0
  18. package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
  19. package/Engines/WebGL/webGLRenderTargetWrapper.js +4 -3
  20. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  21. package/Engines/renderTargetWrapper.js +3 -0
  22. package/Engines/renderTargetWrapper.js.map +1 -1
  23. package/Engines/thinEngine.js +2 -2
  24. package/Engines/thinEngine.js.map +1 -1
  25. package/Lights/Shadows/cascadedShadowGenerator.js +2 -2
  26. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  27. package/Lights/directionalLight.js +3 -3
  28. package/Lights/directionalLight.js.map +1 -1
  29. package/Materials/Node/Blocks/Dual/fogBlock.d.ts +1 -1
  30. package/Materials/Node/Blocks/Dual/fogBlock.js +3 -3
  31. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  32. package/Materials/Node/Blocks/Dual/lightBlock.d.ts +1 -1
  33. package/Materials/Node/Blocks/Dual/lightBlock.js +8 -3
  34. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  35. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +1 -1
  36. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +4 -4
  37. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  38. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.d.ts +2 -1
  39. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js +2 -2
  40. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
  41. package/Materials/Node/Blocks/Dual/textureBlock.d.ts +3 -1
  42. package/Materials/Node/Blocks/Dual/textureBlock.js +21 -4
  43. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  44. package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +1 -1
  45. package/Materials/Node/Blocks/Fragment/TBNBlock.js +4 -4
  46. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  47. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +1 -2
  48. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +3 -0
  49. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  50. package/Materials/Node/Blocks/Fragment/index.d.ts +1 -0
  51. package/Materials/Node/Blocks/Fragment/index.js +1 -0
  52. package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
  53. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +1 -1
  54. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +2 -2
  55. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  56. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.d.ts +31 -0
  57. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js +87 -0
  58. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js.map +1 -0
  59. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.d.ts +1 -1
  60. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +2 -2
  61. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
  62. package/Materials/Node/Blocks/Input/index.d.ts +1 -0
  63. package/Materials/Node/Blocks/Input/index.js +1 -0
  64. package/Materials/Node/Blocks/Input/index.js.map +1 -1
  65. package/Materials/Node/Blocks/Input/prePassTextureBlock.d.ts +62 -0
  66. package/Materials/Node/Blocks/Input/prePassTextureBlock.js +135 -0
  67. package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -0
  68. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +1 -1
  69. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +4 -4
  70. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  71. package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +1 -1
  72. package/Materials/Node/Blocks/PBR/refractionBlock.js +2 -2
  73. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  74. package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +1 -1
  75. package/Materials/Node/Blocks/Particle/particleTextureBlock.js +2 -2
  76. package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
  77. package/Materials/Node/Blocks/Vertex/bonesBlock.d.ts +1 -1
  78. package/Materials/Node/Blocks/Vertex/bonesBlock.js +4 -4
  79. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  80. package/Materials/Node/Blocks/Vertex/instancesBlock.d.ts +1 -1
  81. package/Materials/Node/Blocks/Vertex/instancesBlock.js +6 -6
  82. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  83. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.d.ts +1 -1
  84. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +5 -5
  85. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  86. package/Materials/Node/Blocks/viewDirectionBlock.d.ts +1 -1
  87. package/Materials/Node/Blocks/viewDirectionBlock.js +2 -2
  88. package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
  89. package/Materials/Node/nodeMaterial.d.ts +27 -1
  90. package/Materials/Node/nodeMaterial.js +96 -1
  91. package/Materials/Node/nodeMaterial.js.map +1 -1
  92. package/Materials/Node/nodeMaterialBlock.d.ts +2 -1
  93. package/Materials/Node/nodeMaterialBlock.js +2 -1
  94. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  95. package/Materials/Node/nodeMaterialBuildState.d.ts +6 -0
  96. package/Materials/Node/nodeMaterialBuildState.js +9 -0
  97. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  98. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +1 -1
  99. package/Materials/Textures/Procedurals/proceduralTexture.js +3 -1
  100. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  101. package/Meshes/Node/Blocks/Instances/instantiateBlock.d.ts +77 -0
  102. package/Meshes/Node/Blocks/Instances/instantiateBlock.js +169 -0
  103. package/Meshes/Node/Blocks/Instances/instantiateBlock.js.map +1 -0
  104. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.d.ts +10 -0
  105. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +88 -69
  106. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
  107. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.d.ts +15 -0
  108. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +108 -67
  109. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
  110. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +10 -0
  111. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +82 -63
  112. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
  113. package/Meshes/Node/Blocks/Set/setColorsBlock.d.ts +5 -0
  114. package/Meshes/Node/Blocks/Set/setColorsBlock.js +7 -0
  115. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  116. package/Meshes/Node/Blocks/Set/setNormalsBlock.d.ts +5 -0
  117. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +7 -0
  118. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  119. package/Meshes/Node/Blocks/Set/setPositionsBlock.d.ts +5 -0
  120. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +7 -0
  121. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  122. package/Meshes/Node/Blocks/Set/setTangentsBlock.d.ts +5 -0
  123. package/Meshes/Node/Blocks/Set/setTangentsBlock.js +7 -0
  124. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  125. package/Meshes/Node/Blocks/Set/setUVsBlock.d.ts +5 -0
  126. package/Meshes/Node/Blocks/Set/setUVsBlock.js +7 -0
  127. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  128. package/Meshes/Node/Blocks/Sources/cylinderBlock.js +9 -5
  129. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  130. package/Meshes/Node/Blocks/computeNormalsBlock.js +3 -0
  131. package/Meshes/Node/Blocks/computeNormalsBlock.js.map +1 -1
  132. package/Meshes/Node/Blocks/geometryInputBlock.js +4 -0
  133. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  134. package/Meshes/Node/Blocks/mappingBlock.d.ts +52 -0
  135. package/Meshes/Node/Blocks/mappingBlock.js +151 -0
  136. package/Meshes/Node/Blocks/mappingBlock.js.map +1 -0
  137. package/Meshes/Node/Enums/nodeGeometryContextualSources.d.ts +3 -1
  138. package/Meshes/Node/Enums/nodeGeometryContextualSources.js +2 -0
  139. package/Meshes/Node/Enums/nodeGeometryContextualSources.js.map +1 -1
  140. package/Meshes/Node/Interfaces/nodeGeometryExecutionContext.d.ts +5 -0
  141. package/Meshes/Node/Interfaces/nodeGeometryExecutionContext.js.map +1 -1
  142. package/Meshes/Node/index.d.ts +2 -0
  143. package/Meshes/Node/index.js +2 -0
  144. package/Meshes/Node/index.js.map +1 -1
  145. package/Meshes/Node/nodeGeometryBlock.js +1 -0
  146. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  147. package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +4 -0
  148. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +4 -0
  149. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  150. package/Meshes/Node/nodeGeometryBuildState.d.ts +5 -1
  151. package/Meshes/Node/nodeGeometryBuildState.js +35 -13
  152. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  153. package/Particles/pointsCloudSystem.js +4 -3
  154. package/Particles/pointsCloudSystem.js.map +1 -1
  155. package/Physics/v2/IPhysicsEnginePlugin.d.ts +9 -7
  156. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  157. package/Physics/v2/Plugins/havokPlugin.d.ts +21 -8
  158. package/Physics/v2/Plugins/havokPlugin.js +139 -29
  159. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  160. package/Physics/v2/physicsAggregate.js +4 -0
  161. package/Physics/v2/physicsAggregate.js.map +1 -1
  162. package/Physics/v2/physicsBody.d.ts +12 -2
  163. package/Physics/v2/physicsBody.js +19 -1
  164. package/Physics/v2/physicsBody.js.map +1 -1
  165. package/Physics/v2/physicsConstraint.d.ts +15 -14
  166. package/Physics/v2/physicsConstraint.js +7 -7
  167. package/Physics/v2/physicsConstraint.js.map +1 -1
  168. package/Rendering/prePassRenderer.d.ts +6 -0
  169. package/Rendering/prePassRenderer.js +16 -3
  170. package/Rendering/prePassRenderer.js.map +1 -1
  171. package/Shaders/ShadersInclude/lightFragment.js +1 -0
  172. package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
  173. package/Shaders/ShadersInclude/pbrBlockDirectLighting.js +1 -0
  174. package/Shaders/ShadersInclude/pbrBlockDirectLighting.js.map +1 -1
  175. package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js +2 -1
  176. package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
  177. package/Shaders/background.fragment.js +1 -1
  178. package/Shaders/background.fragment.js.map +1 -1
  179. package/Shaders/default.fragment.js +2 -2
  180. package/Shaders/default.fragment.js.map +1 -1
  181. package/Sprites/sprite.js +4 -4
  182. package/Sprites/sprite.js.map +1 -1
  183. package/XR/webXRCamera.d.ts +5 -0
  184. package/XR/webXRCamera.js +9 -0
  185. package/XR/webXRCamera.js.map +1 -1
  186. package/package.json +1 -1
@@ -404,8 +404,9 @@ export declare class Animation {
404
404
  /**
405
405
  * Sets the key frames of the animation
406
406
  * @param values The animation key frames to set
407
+ * @param dontClone Whether to clone the keys or not (default is false, so the array of keys is cloned)
407
408
  */
408
- setKeys(values: Array<IAnimationKey>): void;
409
+ setKeys(values: Array<IAnimationKey>, dontClone?: boolean): void;
409
410
  /**
410
411
  * Serializes the animation to an object
411
412
  * @returns Serialized object
@@ -941,9 +941,10 @@ export class Animation {
941
941
  /**
942
942
  * Sets the key frames of the animation
943
943
  * @param values The animation key frames to set
944
+ * @param dontClone Whether to clone the keys or not (default is false, so the array of keys is cloned)
944
945
  */
945
- setKeys(values) {
946
- this._keys = values.slice(0);
946
+ setKeys(values, dontClone = false) {
947
+ this._keys = !dontClone ? values.slice(0) : values;
947
948
  }
948
949
  /**
949
950
  * Serializes the animation to an object
@@ -1 +1 @@
1
- {"version":3,"file":"animation.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,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,IAAI,CAAC,sBAAsB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAU,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC","sourcesContent":["import type { IEasingFunction, EasingFunction } from \"./easing\";\r\nimport { Vector3, Quaternion, Vector2, Matrix, TmpVectors } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport { Scalar } from \"../Maths/math.scalar\";\r\n\r\nimport type { Nullable } from \"../types\";\r\nimport type { Scene } from \"../scene\";\r\nimport { SerializationHelper } from \"../Misc/decorators\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { IAnimationKey } from \"./animationKey\";\r\nimport { AnimationKeyInterpolation } from \"./animationKey\";\r\nimport { AnimationRange } from \"./animationRange\";\r\nimport type { AnimationEvent } from \"./animationEvent\";\r\nimport { Node } from \"../node\";\r\nimport type { IAnimatable } from \"./animatable.interface\";\r\nimport { Size } from \"../Maths/math.size\";\r\nimport { WebRequest } from \"../Misc/webRequest\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport type { Animatable } from \"./animatable\";\r\nimport type { RuntimeAnimation } from \"./runtimeAnimation\";\r\n\r\n/**\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\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 = Constants.SnippetUrl;\r\n\r\n /** Snippet ID if the animation was created from the snippet server */\r\n public snippetId: string;\r\n\r\n /**\r\n * Stores the key frames of the animation\r\n */\r\n private _keys: Array<IAnimationKey>;\r\n\r\n /**\r\n * Stores the easing function of the animation\r\n */\r\n private _easingFunction: Nullable<IEasingFunction> = null;\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _runtimeAnimations = new Array<RuntimeAnimation>();\r\n\r\n /**\r\n * The set of event that will be linked to this animation\r\n */\r\n private _events = new Array<AnimationEvent>();\r\n\r\n /**\r\n * Stores an array of target property paths\r\n */\r\n public targetPropertyPath: string[];\r\n\r\n /**\r\n * Stores the blending speed of the animation\r\n */\r\n public blendingSpeed = 0.01;\r\n\r\n /**\r\n * Stores the animation ranges for the animation\r\n */\r\n private _ranges: { [name: string]: Nullable<AnimationRange> } = {};\r\n\r\n /**\r\n * @internal Internal use\r\n */\r\n public static _PrepareAnimation(\r\n name: string,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction\r\n ): Nullable<Animation> {\r\n let dataType = undefined;\r\n\r\n if (!isNaN(parseFloat(from)) && isFinite(from)) {\r\n dataType = Animation.ANIMATIONTYPE_FLOAT;\r\n } else if (from instanceof Quaternion) {\r\n dataType = Animation.ANIMATIONTYPE_QUATERNION;\r\n } else if (from instanceof Vector3) {\r\n dataType = Animation.ANIMATIONTYPE_VECTOR3;\r\n } else if (from instanceof Vector2) {\r\n dataType = Animation.ANIMATIONTYPE_VECTOR2;\r\n } else if (from instanceof Color3) {\r\n dataType = Animation.ANIMATIONTYPE_COLOR3;\r\n } else if (from instanceof Color4) {\r\n dataType = Animation.ANIMATIONTYPE_COLOR4;\r\n } else if (from instanceof Size) {\r\n dataType = Animation.ANIMATIONTYPE_SIZE;\r\n }\r\n\r\n if (dataType == undefined) {\r\n return null;\r\n }\r\n\r\n const animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);\r\n\r\n const keys: Array<IAnimationKey> = [\r\n { frame: 0, value: from },\r\n { frame: totalFrame, value: to },\r\n ];\r\n animation.setKeys(keys);\r\n\r\n if (easingFunction !== undefined) {\r\n animation.setEasingFunction(easingFunction);\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Sets up an animation\r\n * @param property The property to animate\r\n * @param animationType The animation type to apply\r\n * @param framePerSecond The frames per second of the animation\r\n * @param easingFunction The easing function used in the animation\r\n * @returns The created animation\r\n */\r\n public static CreateAnimation(property: string, animationType: number, framePerSecond: number, easingFunction: EasingFunction): Animation {\r\n const animation: Animation = new Animation(property + \"Animation\", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);\r\n\r\n animation.setEasingFunction(easingFunction);\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Create and start an animation on a node\r\n * @param name defines the name of the global animation that will be run on all nodes\r\n * @param target defines the target where the animation will take place\r\n * @param targetProperty defines property to animate\r\n * @param framePerSecond defines the number of frame per second yo use\r\n * @param totalFrame defines the number of frames in total\r\n * @param from defines the initial value\r\n * @param to defines the final value\r\n * @param loopMode defines which loop mode you want to use (off by default)\r\n * @param easingFunction defines the easing function to use (linear by default)\r\n * @param onAnimationEnd defines the callback to call when animation end\r\n * @param scene defines the hosting scene\r\n * @returns the animatable created for this animation\r\n */\r\n public static CreateAndStartAnimation(\r\n name: string,\r\n target: any,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void,\r\n scene?: Scene\r\n ): Nullable<Animatable> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n if (target.getScene) {\r\n scene = target.getScene();\r\n }\r\n\r\n if (!scene) {\r\n return null;\r\n }\r\n\r\n return scene.beginDirectAnimation(target, [animation], 0, totalFrame, animation.loopMode === 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(\r\n name: string,\r\n node: Node,\r\n directDescendantsOnly: boolean,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void\r\n ): Nullable<Animatable[]> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n const scene = node.getScene();\r\n return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Creates a new animation, merges it with the existing animations and starts it\r\n * @param name Name of the animation\r\n * @param node Node which contains the scene that begins the animations\r\n * @param targetProperty Specifies which property to animate\r\n * @param framePerSecond The frames per second of the animation\r\n * @param totalFrame The total number of frames\r\n * @param from The frame at the beginning of the animation\r\n * @param to The frame at the end of the animation\r\n * @param loopMode Specifies the loop mode of the animation\r\n * @param easingFunction (Optional) The easing function of the animation, which allow custom mathematical formulas for animations\r\n * @param onAnimationEnd Callback to run once the animation is complete\r\n * @returns Nullable animation\r\n */\r\n public static CreateMergeAndStartAnimation(\r\n name: string,\r\n node: Node,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void\r\n ): Nullable<Animatable> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n node.animations.push(animation);\r\n\r\n return node.getScene().beginAnimation(node, 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Convert the keyframes 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 const firstKey = animation._keys[0];\r\n let endIndex = animation._keys.length - 1;\r\n const lastKey = animation._keys[endIndex];\r\n const valueStore = {\r\n referenceValue: firstKey.value,\r\n referencePosition: TmpVectors.Vector3[0],\r\n referenceQuaternion: TmpVectors.Quaternion[0],\r\n referenceScaling: TmpVectors.Vector3[1],\r\n keyPosition: TmpVectors.Vector3[2],\r\n keyQuaternion: TmpVectors.Quaternion[1],\r\n keyScaling: TmpVectors.Vector3[3],\r\n };\r\n let referenceFound = false;\r\n let from = firstKey.frame;\r\n let to = lastKey.frame;\r\n if (range) {\r\n const 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 const 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 const 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 const 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 let index = 0;\r\n while (!referenceFound || !fromKeyFound || (!toKeyFound && index < animation._keys.length - 1)) {\r\n const currentKey = animation._keys[index];\r\n const 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 const 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 const animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT,\r\n };\r\n const value = animation._interpolate(from, animationState);\r\n const 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 const animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT,\r\n };\r\n const value = animation._interpolate(to, animationState);\r\n const 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 (index = startIndex; index <= endIndex; index++) {\r\n const 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(\r\n property: string,\r\n targetValue: any,\r\n host: any,\r\n scene: Scene,\r\n frameRate: number,\r\n transition: Animation,\r\n duration: number,\r\n onAnimationEnd: Nullable<() => void> = null\r\n ): Nullable<Animatable> {\r\n if (duration <= 0) {\r\n host[property] = targetValue;\r\n if (onAnimationEnd) {\r\n onAnimationEnd();\r\n }\r\n return null;\r\n }\r\n\r\n const endFrame: number = frameRate * (duration / 1000);\r\n\r\n transition.setKeys([\r\n {\r\n frame: 0,\r\n value: host[property].clone ? host[property].clone() : host[property],\r\n },\r\n {\r\n frame: endFrame,\r\n value: targetValue,\r\n },\r\n ]);\r\n\r\n if (!host.animations) {\r\n host.animations = [];\r\n }\r\n\r\n host.animations.push(transition);\r\n\r\n const animation: Animatable = scene.beginAnimation(host, 0, endFrame, false);\r\n animation.onAnimationEnd = onAnimationEnd;\r\n return animation;\r\n }\r\n\r\n /**\r\n * Return the array of runtime animations currently using this animation\r\n */\r\n public get runtimeAnimations(): RuntimeAnimation[] {\r\n return this._runtimeAnimations;\r\n }\r\n\r\n /**\r\n * Specifies if any of the runtime animations are currently running\r\n */\r\n public get hasRunningRuntimeAnimations(): boolean {\r\n for (const runtimeAnimation of this._runtimeAnimations) {\r\n if (!runtimeAnimation.isStopped()) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Initializes the animation\r\n * @param name Name of the animation\r\n * @param targetProperty Property to animate\r\n * @param framePerSecond The frames per second of the animation\r\n * @param dataType The data type of the animation\r\n * @param loopMode The loop mode of the animation\r\n * @param enableBlending Specifies if blending should be enabled\r\n */\r\n constructor(\r\n /**Name of the animation */\r\n public name: string,\r\n /**Property to animate */\r\n public targetProperty: string,\r\n /**The frames per second of the animation */\r\n public framePerSecond: number,\r\n /**The data type of the animation */\r\n public dataType: number,\r\n /**The loop mode of the animation */\r\n public loopMode?: number,\r\n /**Specifies if blending should be enabled */\r\n public enableBlending?: boolean\r\n ) {\r\n this.targetPropertyPath = targetProperty.split(\".\");\r\n this.dataType = dataType;\r\n this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode;\r\n this.uniqueId = Animation._UniqueIdGenerator++;\r\n }\r\n\r\n // Methods\r\n /**\r\n * Converts the animation to a string\r\n * @param fullDetails support for multiple levels of logging within scene loading\r\n * @returns String form of the animation\r\n */\r\n public toString(fullDetails?: boolean): string {\r\n let ret = \"Name: \" + this.name + \", property: \" + this.targetProperty;\r\n ret += \", datatype: \" + [\"Float\", \"Vector3\", \"Quaternion\", \"Matrix\", \"Color3\", \"Vector2\"][this.dataType];\r\n ret += \", nKeys: \" + (this._keys ? this._keys.length : \"none\");\r\n ret += \", nRanges: \" + (this._ranges ? Object.keys(this._ranges).length : \"none\");\r\n if (fullDetails) {\r\n ret += \", Ranges: {\";\r\n let first = true;\r\n for (const name in this._ranges) {\r\n if (first) {\r\n ret += \", \";\r\n first = false;\r\n }\r\n ret += name;\r\n }\r\n ret += \"}\";\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Add an event to this animation\r\n * @param event Event to add\r\n */\r\n public addEvent(event: AnimationEvent): void {\r\n this._events.push(event);\r\n this._events.sort((a, b) => a.frame - b.frame);\r\n }\r\n\r\n /**\r\n * Remove all events found at the given frame\r\n * @param frame The frame to remove events from\r\n */\r\n public removeEvents(frame: number): void {\r\n for (let index = 0; index < this._events.length; index++) {\r\n if (this._events[index].frame === frame) {\r\n this._events.splice(index, 1);\r\n index--;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves all the events from the animation\r\n * @returns Events from the animation\r\n */\r\n public getEvents(): AnimationEvent[] {\r\n return this._events;\r\n }\r\n\r\n /**\r\n * Creates an animation range\r\n * @param name Name of the animation range\r\n * @param from Starting frame of the animation range\r\n * @param to Ending frame of the animation\r\n */\r\n public createRange(name: string, from: number, to: number): void {\r\n // check name not already in use; could happen for bones after serialized\r\n if (!this._ranges[name]) {\r\n this._ranges[name] = new AnimationRange(name, from, to);\r\n }\r\n }\r\n\r\n /**\r\n * Deletes an animation range by name\r\n * @param name Name of the animation range to delete\r\n * @param deleteFrames Specifies if the key frames for the range should also be deleted (true) or not (false)\r\n */\r\n public deleteRange(name: string, deleteFrames = true): void {\r\n const range = this._ranges[name];\r\n if (!range) {\r\n return;\r\n }\r\n if (deleteFrames) {\r\n const from = range.from;\r\n const to = range.to;\r\n\r\n // this loop MUST go high to low for multiple splices to work\r\n for (let key = this._keys.length - 1; key >= 0; key--) {\r\n if (this._keys[key].frame >= from && this._keys[key].frame <= to) {\r\n this._keys.splice(key, 1);\r\n }\r\n }\r\n }\r\n this._ranges[name] = null; // said much faster than 'delete this._range[name]'\r\n }\r\n\r\n /**\r\n * Gets the animation range by name, or null if not defined\r\n * @param name Name of the animation range\r\n * @returns Nullable animation range\r\n */\r\n public getRange(name: string): Nullable<AnimationRange> {\r\n return this._ranges[name];\r\n }\r\n\r\n /**\r\n * Gets the key frames from the animation\r\n * @returns The key frames of the animation\r\n */\r\n public getKeys(): Array<IAnimationKey> {\r\n return this._keys;\r\n }\r\n\r\n /**\r\n * Gets the highest frame rate of the animation\r\n * @returns Highest frame rate of the animation\r\n */\r\n public getHighestFrame(): number {\r\n let ret = 0;\r\n\r\n for (let key = 0, nKeys = this._keys.length; key < nKeys; key++) {\r\n if (ret < this._keys[key].frame) {\r\n ret = this._keys[key].frame;\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Gets the easing function of the animation\r\n * @returns Easing function of the animation\r\n */\r\n public getEasingFunction(): Nullable<IEasingFunction> {\r\n return this._easingFunction;\r\n }\r\n\r\n /**\r\n * Sets the easing function of the animation\r\n * @param easingFunction A custom mathematical formula for animation\r\n */\r\n public setEasingFunction(easingFunction: Nullable<IEasingFunction>): void {\r\n this._easingFunction = easingFunction;\r\n }\r\n\r\n /**\r\n * Interpolates a scalar linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated scalar value\r\n */\r\n public floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number {\r\n return 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 (value between 0 and 1)\r\n * @returns Interpolated scalar value\r\n */\r\n public vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3 {\r\n return Vector3.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector3 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns InterpolatedVector3 value\r\n */\r\n public vector3InterpolateFunctionWithTangents(startValue: Vector3, outTangent: Vector3, endValue: Vector3, inTangent: Vector3, gradient: number): Vector3 {\r\n return Vector3.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector2 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated Vector2 value\r\n */\r\n public vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2 {\r\n return Vector2.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector2 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated Vector2 value\r\n */\r\n public vector2InterpolateFunctionWithTangents(startValue: Vector2, outTangent: Vector2, endValue: Vector2, inTangent: Vector2, gradient: number): Vector2 {\r\n return Vector2.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a size linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Size value\r\n */\r\n public sizeInterpolateFunction(startValue: Size, endValue: Size, gradient: number): Size {\r\n return Size.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color3 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Color3 value\r\n */\r\n public color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3 {\r\n return Color3.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color3 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns interpolated value\r\n */\r\n public color3InterpolateFunctionWithTangents(startValue: Color3, outTangent: Color3, endValue: Color3, inTangent: Color3, gradient: number): Color3 {\r\n return Color3.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color4 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Color3 value\r\n */\r\n public color4InterpolateFunction(startValue: Color4, endValue: Color4, gradient: number): Color4 {\r\n return Color4.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color4 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns interpolated value\r\n */\r\n public color4InterpolateFunctionWithTangents(startValue: Color4, outTangent: Color4, endValue: Color4, inTangent: Color4, gradient: number): Color4 {\r\n return Color4.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _getKeyValue(value: any): any {\r\n if (typeof value === \"function\") {\r\n return value();\r\n }\r\n\r\n return value;\r\n }\r\n\r\n /**\r\n * Evaluate the animation value at a given frame\r\n * @param currentFrame defines the frame where we want to evaluate the animation\r\n * @returns the animation value\r\n */\r\n public evaluate(currentFrame: number) {\r\n 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 * @internal 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 const keysLength = keys.length;\r\n\r\n let key = state.key;\r\n\r\n while (key >= 0 && currentFrame < keys[key].frame) {\r\n --key;\r\n }\r\n\r\n while (key + 1 <= keysLength - 1 && currentFrame >= keys[key + 1].frame) {\r\n ++key;\r\n }\r\n\r\n state.key = key;\r\n\r\n if (key < 0) {\r\n return this._getKeyValue(keys[0].value);\r\n } else if (key + 1 > keysLength - 1) {\r\n return this._getKeyValue(keys[keysLength - 1].value);\r\n }\r\n\r\n const startKey = keys[key];\r\n const endKey = keys[key + 1];\r\n const startValue = this._getKeyValue(startKey.value);\r\n const endValue = this._getKeyValue(endKey.value);\r\n if (startKey.interpolation === AnimationKeyInterpolation.STEP) {\r\n if (endKey.frame > currentFrame) {\r\n return startValue;\r\n } else {\r\n return endValue;\r\n }\r\n }\r\n\r\n const useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;\r\n const frameDelta = endKey.frame - startKey.frame;\r\n\r\n // gradient : percent of currentFrame between the frame inf and the frame sup\r\n let gradient = (currentFrame - startKey.frame) / frameDelta;\r\n\r\n // check for easingFunction and correction of gradient\r\n const easingFunction = 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 const floatValue = useTangent\r\n ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient)\r\n : this.floatInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return floatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return state.offsetValue * state.repeatCount + floatValue;\r\n }\r\n break;\r\n }\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION: {\r\n const quatValue = useTangent\r\n ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.quaternionInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return quatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return quatValue.addInPlace(state.offsetValue.scale(state.repeatCount));\r\n }\r\n\r\n return quatValue;\r\n }\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3: {\r\n const vec3Value = useTangent\r\n ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.vector3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return vec3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return vec3Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2: {\r\n const vec2Value = useTangent\r\n ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.vector2InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return vec2Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return vec2Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE: {\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient);\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient).add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3: {\r\n const color3Value = useTangent\r\n ? this.color3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.color3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return color3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return color3Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Color4\r\n case Animation.ANIMATIONTYPE_COLOR4: {\r\n const color4Value = useTangent\r\n ? this.color4InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.color4InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return color4Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return color4Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Matrix\r\n case Animation.ANIMATIONTYPE_MATRIX: {\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO: {\r\n if (Animation.AllowMatricesInterpolation) {\r\n return this.matrixInterpolateFunction(startValue, endValue, gradient, state.workValue);\r\n }\r\n return startValue;\r\n }\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE: {\r\n return startValue;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n /**\r\n * Defines the function to use to interpolate matrices\r\n * @param startValue defines the start matrix\r\n * @param endValue defines the end matrix\r\n * @param gradient defines the gradient between both matrices\r\n * @param result defines an optional target matrix where to store the interpolation\r\n * @returns the interpolated matrix\r\n */\r\n public matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number, result?: Matrix): Matrix {\r\n if (Animation.AllowMatrixDecomposeForInterpolation) {\r\n if (result) {\r\n Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n return Matrix.DecomposeLerp(startValue, endValue, gradient);\r\n }\r\n\r\n if (result) {\r\n Matrix.LerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n return Matrix.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Makes a copy of the animation\r\n * @returns Cloned animation\r\n */\r\n public clone(): Animation {\r\n const clone = new Animation(this.name, this.targetPropertyPath.join(\".\"), this.framePerSecond, this.dataType, this.loopMode);\r\n\r\n clone.enableBlending = this.enableBlending;\r\n clone.blendingSpeed = this.blendingSpeed;\r\n\r\n if (this._keys) {\r\n clone.setKeys(this._keys);\r\n }\r\n\r\n if (this._ranges) {\r\n clone._ranges = {};\r\n for (const name in this._ranges) {\r\n const range = this._ranges[name];\r\n if (!range) {\r\n continue;\r\n }\r\n clone._ranges[name] = range.clone();\r\n }\r\n }\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Sets the key frames of the animation\r\n * @param values The animation key frames to set\r\n */\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 const serializationObject: any = {};\r\n\r\n serializationObject.name = this.name;\r\n serializationObject.property = this.targetProperty;\r\n serializationObject.framePerSecond = this.framePerSecond;\r\n serializationObject.dataType = this.dataType;\r\n serializationObject.loopBehavior = this.loopMode;\r\n serializationObject.enableBlending = this.enableBlending;\r\n serializationObject.blendingSpeed = this.blendingSpeed;\r\n\r\n const dataType = this.dataType;\r\n serializationObject.keys = [];\r\n const keys = this.getKeys();\r\n for (let index = 0; index < keys.length; index++) {\r\n const animationKey = keys[index];\r\n\r\n const key: any = {};\r\n key.frame = animationKey.frame;\r\n\r\n switch (dataType) {\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n key.values = [animationKey.value];\r\n if (animationKey.inTangent !== undefined) {\r\n key.values.push(animationKey.inTangent);\r\n }\r\n if (animationKey.outTangent !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.outTangent);\r\n }\r\n if (animationKey.interpolation !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n if (animationKey.outTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.interpolation);\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n key.values = animationKey.value.asArray();\r\n if (animationKey.inTangent != undefined) {\r\n key.values.push(animationKey.inTangent.asArray());\r\n }\r\n if (animationKey.outTangent != undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.outTangent.asArray());\r\n }\r\n if (animationKey.interpolation !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n if (animationKey.outTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.interpolation);\r\n }\r\n break;\r\n }\r\n\r\n serializationObject.keys.push(key);\r\n }\r\n\r\n serializationObject.ranges = [];\r\n for (const name in this._ranges) {\r\n const source = this._ranges[name];\r\n\r\n if (!source) {\r\n continue;\r\n }\r\n const range: any = {};\r\n range.name = name;\r\n range.from = source.from;\r\n range.to = source.to;\r\n serializationObject.ranges.push(range);\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Float animation type\r\n */\r\n public static readonly ANIMATIONTYPE_FLOAT = 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 * Yoyo Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_YOYO = 4;\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _UniversalLerp(left: any, right: any, amount: number): any {\r\n const constructor = left.constructor;\r\n if (constructor.Lerp) {\r\n // Lerp supported\r\n return constructor.Lerp(left, right, amount);\r\n } else if (constructor.Slerp) {\r\n // Slerp supported\r\n return constructor.Slerp(left, right, amount);\r\n } else if (left.toFixed) {\r\n // Number\r\n return left * (1.0 - amount) + amount * right;\r\n } else {\r\n // Blending not supported\r\n return right;\r\n }\r\n }\r\n\r\n /**\r\n * Parses an animation object and creates an animation\r\n * @param parsedAnimation Parsed animation object\r\n * @returns Animation object\r\n */\r\n public static Parse(parsedAnimation: any): Animation {\r\n const animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);\r\n\r\n const dataType = parsedAnimation.dataType;\r\n const keys: Array<IAnimationKey> = [];\r\n let data;\r\n let index: number;\r\n\r\n if (parsedAnimation.enableBlending) {\r\n animation.enableBlending = parsedAnimation.enableBlending;\r\n }\r\n\r\n if (parsedAnimation.blendingSpeed) {\r\n animation.blendingSpeed = parsedAnimation.blendingSpeed;\r\n }\r\n\r\n for (index = 0; index < parsedAnimation.keys.length; index++) {\r\n const key = parsedAnimation.keys[index];\r\n let inTangent: any = undefined;\r\n let outTangent: any = undefined;\r\n let interpolation: any = undefined;\r\n\r\n switch (dataType) {\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n data = key.values[0];\r\n if (key.values.length >= 2) {\r\n inTangent = key.values[1];\r\n }\r\n if (key.values.length >= 3) {\r\n outTangent = key.values[2];\r\n }\r\n if (key.values.length >= 4) {\r\n interpolation = key.values[3];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n data = Quaternion.FromArray(key.values);\r\n if (key.values.length >= 8) {\r\n const _inTangent = Quaternion.FromArray(key.values.slice(4, 8));\r\n if (!_inTangent.equals(Quaternion.Zero())) {\r\n inTangent = _inTangent;\r\n }\r\n }\r\n if (key.values.length >= 12) {\r\n const _outTangent = Quaternion.FromArray(key.values.slice(8, 12));\r\n if (!_outTangent.equals(Quaternion.Zero())) {\r\n outTangent = _outTangent;\r\n }\r\n }\r\n if (key.values.length >= 13) {\r\n interpolation = key.values[12];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n data = Matrix.FromArray(key.values);\r\n if (key.values.length >= 17) {\r\n interpolation = key.values[16];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n data = Color3.FromArray(key.values);\r\n if (key.values[3]) {\r\n inTangent = Color3.FromArray(key.values[3]);\r\n }\r\n if (key.values[4]) {\r\n outTangent = Color3.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n interpolation = key.values[5];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n data = Color4.FromArray(key.values);\r\n if (key.values[4]) {\r\n inTangent = Color4.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n outTangent = Color4.FromArray(key.values[5]);\r\n }\r\n if (key.values[6]) {\r\n interpolation = Color4.FromArray(key.values[6]);\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n default:\r\n data = Vector3.FromArray(key.values);\r\n if (key.values[3]) {\r\n inTangent = Vector3.FromArray(key.values[3]);\r\n }\r\n if (key.values[4]) {\r\n outTangent = Vector3.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n interpolation = key.values[5];\r\n }\r\n break;\r\n }\r\n\r\n const keyData: any = {};\r\n keyData.frame = key.frame;\r\n keyData.value = data;\r\n\r\n if (inTangent != undefined) {\r\n keyData.inTangent = inTangent;\r\n }\r\n if (outTangent != undefined) {\r\n keyData.outTangent = outTangent;\r\n }\r\n if (interpolation != undefined) {\r\n keyData.interpolation = interpolation;\r\n }\r\n keys.push(keyData);\r\n }\r\n\r\n animation.setKeys(keys);\r\n\r\n if (parsedAnimation.ranges) {\r\n for (index = 0; index < parsedAnimation.ranges.length; index++) {\r\n data = parsedAnimation.ranges[index];\r\n animation.createRange(data.name, data.from, data.to);\r\n }\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Appends the serialized animations from the source animations\r\n * @param source Source containing the animations\r\n * @param destination Target to store the animations\r\n */\r\n public static AppendSerializedAnimations(source: IAnimatable, destination: any): void {\r\n SerializationHelper.AppendSerializedAnimations(source, destination);\r\n }\r\n\r\n /**\r\n * Creates a new animation or an array of animations from a snippet saved in a remote file\r\n * @param name defines the name of the animation to create (can be null or empty to use the one from the json data)\r\n * @param url defines the url to load from\r\n * @returns a promise that will resolve to the new animation or an array of animations\r\n */\r\n public static ParseFromFileAsync(name: Nullable<string>, url: string): Promise<Animation | Array<Animation>> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n let serializationObject = JSON.parse(request.responseText);\r\n if (serializationObject.animations) {\r\n serializationObject = serializationObject.animations;\r\n }\r\n\r\n if (serializationObject.length) {\r\n const output = new Array<Animation>();\r\n for (const serializedAnimation of serializationObject) {\r\n output.push(this.Parse(serializedAnimation));\r\n }\r\n\r\n resolve(output);\r\n } else {\r\n const output = this.Parse(serializationObject);\r\n\r\n if (name) {\r\n output.name = name;\r\n }\r\n\r\n resolve(output);\r\n }\r\n } else {\r\n 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 ParseFromSnippetAsync(snippetId: string): Promise<Animation | Array<Animation>> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n\r\n if (snippet.animations) {\r\n const serializationObject = JSON.parse(snippet.animations);\r\n const outputs = new Array<Animation>();\r\n for (const serializedAnimation of serializationObject.animations) {\r\n const output = this.Parse(serializedAnimation);\r\n output.snippetId = snippetId;\r\n outputs.push(output);\r\n }\r\n\r\n resolve(outputs);\r\n } else {\r\n const serializationObject = JSON.parse(snippet.animation);\r\n const output = this.Parse(serializationObject);\r\n\r\n output.snippetId = snippetId;\r\n\r\n resolve(output);\r\n }\r\n } else {\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates an animation or an array of animations from a snippet saved by the Inspector\r\n * @deprecated Please use ParseFromSnippetAsync instead\r\n * @param snippetId defines the snippet to load\r\n * @returns a promise that will resolve to the new animation or a new array of animations\r\n */\r\n public static CreateFromSnippetAsync = Animation.ParseFromSnippetAsync;\r\n}\r\n\r\nRegisterClass(\"BABYLON.Animation\", Animation);\r\nNode._AnimationRangeFactory = (name: string, from: number, to: number) => new AnimationRange(name, from, to);\r\n"]}
1
+ {"version":3,"file":"animation.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,C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AAE,SAAS,CAAC,CAAC;AAC9C,IAAI,CAAC,sBAAsB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAU,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC","sourcesContent":["import type { IEasingFunction, EasingFunction } from \"./easing\";\r\nimport { Vector3, Quaternion, Vector2, Matrix, TmpVectors } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport { Scalar } from \"../Maths/math.scalar\";\r\n\r\nimport type { Nullable } from \"../types\";\r\nimport type { Scene } from \"../scene\";\r\nimport { SerializationHelper } from \"../Misc/decorators\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { IAnimationKey } from \"./animationKey\";\r\nimport { AnimationKeyInterpolation } from \"./animationKey\";\r\nimport { AnimationRange } from \"./animationRange\";\r\nimport type { AnimationEvent } from \"./animationEvent\";\r\nimport { Node } from \"../node\";\r\nimport type { IAnimatable } from \"./animatable.interface\";\r\nimport { Size } from \"../Maths/math.size\";\r\nimport { WebRequest } from \"../Misc/webRequest\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport type { Animatable } from \"./animatable\";\r\nimport type { RuntimeAnimation } from \"./runtimeAnimation\";\r\n\r\n/**\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\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 = Constants.SnippetUrl;\r\n\r\n /** Snippet ID if the animation was created from the snippet server */\r\n public snippetId: string;\r\n\r\n /**\r\n * Stores the key frames of the animation\r\n */\r\n private _keys: Array<IAnimationKey>;\r\n\r\n /**\r\n * Stores the easing function of the animation\r\n */\r\n private _easingFunction: Nullable<IEasingFunction> = null;\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _runtimeAnimations = new Array<RuntimeAnimation>();\r\n\r\n /**\r\n * The set of event that will be linked to this animation\r\n */\r\n private _events = new Array<AnimationEvent>();\r\n\r\n /**\r\n * Stores an array of target property paths\r\n */\r\n public targetPropertyPath: string[];\r\n\r\n /**\r\n * Stores the blending speed of the animation\r\n */\r\n public blendingSpeed = 0.01;\r\n\r\n /**\r\n * Stores the animation ranges for the animation\r\n */\r\n private _ranges: { [name: string]: Nullable<AnimationRange> } = {};\r\n\r\n /**\r\n * @internal Internal use\r\n */\r\n public static _PrepareAnimation(\r\n name: string,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction\r\n ): Nullable<Animation> {\r\n let dataType = undefined;\r\n\r\n if (!isNaN(parseFloat(from)) && isFinite(from)) {\r\n dataType = Animation.ANIMATIONTYPE_FLOAT;\r\n } else if (from instanceof Quaternion) {\r\n dataType = Animation.ANIMATIONTYPE_QUATERNION;\r\n } else if (from instanceof Vector3) {\r\n dataType = Animation.ANIMATIONTYPE_VECTOR3;\r\n } else if (from instanceof Vector2) {\r\n dataType = Animation.ANIMATIONTYPE_VECTOR2;\r\n } else if (from instanceof Color3) {\r\n dataType = Animation.ANIMATIONTYPE_COLOR3;\r\n } else if (from instanceof Color4) {\r\n dataType = Animation.ANIMATIONTYPE_COLOR4;\r\n } else if (from instanceof Size) {\r\n dataType = Animation.ANIMATIONTYPE_SIZE;\r\n }\r\n\r\n if (dataType == undefined) {\r\n return null;\r\n }\r\n\r\n const animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);\r\n\r\n const keys: Array<IAnimationKey> = [\r\n { frame: 0, value: from },\r\n { frame: totalFrame, value: to },\r\n ];\r\n animation.setKeys(keys);\r\n\r\n if (easingFunction !== undefined) {\r\n animation.setEasingFunction(easingFunction);\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Sets up an animation\r\n * @param property The property to animate\r\n * @param animationType The animation type to apply\r\n * @param framePerSecond The frames per second of the animation\r\n * @param easingFunction The easing function used in the animation\r\n * @returns The created animation\r\n */\r\n public static CreateAnimation(property: string, animationType: number, framePerSecond: number, easingFunction: EasingFunction): Animation {\r\n const animation: Animation = new Animation(property + \"Animation\", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);\r\n\r\n animation.setEasingFunction(easingFunction);\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Create and start an animation on a node\r\n * @param name defines the name of the global animation that will be run on all nodes\r\n * @param target defines the target where the animation will take place\r\n * @param targetProperty defines property to animate\r\n * @param framePerSecond defines the number of frame per second yo use\r\n * @param totalFrame defines the number of frames in total\r\n * @param from defines the initial value\r\n * @param to defines the final value\r\n * @param loopMode defines which loop mode you want to use (off by default)\r\n * @param easingFunction defines the easing function to use (linear by default)\r\n * @param onAnimationEnd defines the callback to call when animation end\r\n * @param scene defines the hosting scene\r\n * @returns the animatable created for this animation\r\n */\r\n public static CreateAndStartAnimation(\r\n name: string,\r\n target: any,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void,\r\n scene?: Scene\r\n ): Nullable<Animatable> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n if (target.getScene) {\r\n scene = target.getScene();\r\n }\r\n\r\n if (!scene) {\r\n return null;\r\n }\r\n\r\n return scene.beginDirectAnimation(target, [animation], 0, totalFrame, animation.loopMode === 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(\r\n name: string,\r\n node: Node,\r\n directDescendantsOnly: boolean,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void\r\n ): Nullable<Animatable[]> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n const scene = node.getScene();\r\n return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Creates a new animation, merges it with the existing animations and starts it\r\n * @param name Name of the animation\r\n * @param node Node which contains the scene that begins the animations\r\n * @param targetProperty Specifies which property to animate\r\n * @param framePerSecond The frames per second of the animation\r\n * @param totalFrame The total number of frames\r\n * @param from The frame at the beginning of the animation\r\n * @param to The frame at the end of the animation\r\n * @param loopMode Specifies the loop mode of the animation\r\n * @param easingFunction (Optional) The easing function of the animation, which allow custom mathematical formulas for animations\r\n * @param onAnimationEnd Callback to run once the animation is complete\r\n * @returns Nullable animation\r\n */\r\n public static CreateMergeAndStartAnimation(\r\n name: string,\r\n node: Node,\r\n targetProperty: string,\r\n framePerSecond: number,\r\n totalFrame: number,\r\n from: any,\r\n to: any,\r\n loopMode?: number,\r\n easingFunction?: EasingFunction,\r\n onAnimationEnd?: () => void\r\n ): Nullable<Animatable> {\r\n const animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);\r\n\r\n if (!animation) {\r\n return null;\r\n }\r\n\r\n node.animations.push(animation);\r\n\r\n return node.getScene().beginAnimation(node, 0, totalFrame, animation.loopMode === 1, 1.0, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Convert the keyframes 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 const firstKey = animation._keys[0];\r\n let endIndex = animation._keys.length - 1;\r\n const lastKey = animation._keys[endIndex];\r\n const valueStore = {\r\n referenceValue: firstKey.value,\r\n referencePosition: TmpVectors.Vector3[0],\r\n referenceQuaternion: TmpVectors.Quaternion[0],\r\n referenceScaling: TmpVectors.Vector3[1],\r\n keyPosition: TmpVectors.Vector3[2],\r\n keyQuaternion: TmpVectors.Quaternion[1],\r\n keyScaling: TmpVectors.Vector3[3],\r\n };\r\n let referenceFound = false;\r\n let from = firstKey.frame;\r\n let to = lastKey.frame;\r\n if (range) {\r\n const 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 const 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 const 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 const 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 let index = 0;\r\n while (!referenceFound || !fromKeyFound || (!toKeyFound && index < animation._keys.length - 1)) {\r\n const currentKey = animation._keys[index];\r\n const 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 const 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 const animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT,\r\n };\r\n const value = animation._interpolate(from, animationState);\r\n const 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 const animationState = {\r\n key: index,\r\n repeatCount: 0,\r\n loopMode: this.ANIMATIONLOOPMODE_CONSTANT,\r\n };\r\n const value = animation._interpolate(to, animationState);\r\n const 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 (index = startIndex; index <= endIndex; index++) {\r\n const 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(\r\n property: string,\r\n targetValue: any,\r\n host: any,\r\n scene: Scene,\r\n frameRate: number,\r\n transition: Animation,\r\n duration: number,\r\n onAnimationEnd: Nullable<() => void> = null\r\n ): Nullable<Animatable> {\r\n if (duration <= 0) {\r\n host[property] = targetValue;\r\n if (onAnimationEnd) {\r\n onAnimationEnd();\r\n }\r\n return null;\r\n }\r\n\r\n const endFrame: number = frameRate * (duration / 1000);\r\n\r\n transition.setKeys([\r\n {\r\n frame: 0,\r\n value: host[property].clone ? host[property].clone() : host[property],\r\n },\r\n {\r\n frame: endFrame,\r\n value: targetValue,\r\n },\r\n ]);\r\n\r\n if (!host.animations) {\r\n host.animations = [];\r\n }\r\n\r\n host.animations.push(transition);\r\n\r\n const animation: Animatable = scene.beginAnimation(host, 0, endFrame, false);\r\n animation.onAnimationEnd = onAnimationEnd;\r\n return animation;\r\n }\r\n\r\n /**\r\n * Return the array of runtime animations currently using this animation\r\n */\r\n public get runtimeAnimations(): RuntimeAnimation[] {\r\n return this._runtimeAnimations;\r\n }\r\n\r\n /**\r\n * Specifies if any of the runtime animations are currently running\r\n */\r\n public get hasRunningRuntimeAnimations(): boolean {\r\n for (const runtimeAnimation of this._runtimeAnimations) {\r\n if (!runtimeAnimation.isStopped()) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Initializes the animation\r\n * @param name Name of the animation\r\n * @param targetProperty Property to animate\r\n * @param framePerSecond The frames per second of the animation\r\n * @param dataType The data type of the animation\r\n * @param loopMode The loop mode of the animation\r\n * @param enableBlending Specifies if blending should be enabled\r\n */\r\n constructor(\r\n /**Name of the animation */\r\n public name: string,\r\n /**Property to animate */\r\n public targetProperty: string,\r\n /**The frames per second of the animation */\r\n public framePerSecond: number,\r\n /**The data type of the animation */\r\n public dataType: number,\r\n /**The loop mode of the animation */\r\n public loopMode?: number,\r\n /**Specifies if blending should be enabled */\r\n public enableBlending?: boolean\r\n ) {\r\n this.targetPropertyPath = targetProperty.split(\".\");\r\n this.dataType = dataType;\r\n this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode;\r\n this.uniqueId = Animation._UniqueIdGenerator++;\r\n }\r\n\r\n // Methods\r\n /**\r\n * Converts the animation to a string\r\n * @param fullDetails support for multiple levels of logging within scene loading\r\n * @returns String form of the animation\r\n */\r\n public toString(fullDetails?: boolean): string {\r\n let ret = \"Name: \" + this.name + \", property: \" + this.targetProperty;\r\n ret += \", datatype: \" + [\"Float\", \"Vector3\", \"Quaternion\", \"Matrix\", \"Color3\", \"Vector2\"][this.dataType];\r\n ret += \", nKeys: \" + (this._keys ? this._keys.length : \"none\");\r\n ret += \", nRanges: \" + (this._ranges ? Object.keys(this._ranges).length : \"none\");\r\n if (fullDetails) {\r\n ret += \", Ranges: {\";\r\n let first = true;\r\n for (const name in this._ranges) {\r\n if (first) {\r\n ret += \", \";\r\n first = false;\r\n }\r\n ret += name;\r\n }\r\n ret += \"}\";\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Add an event to this animation\r\n * @param event Event to add\r\n */\r\n public addEvent(event: AnimationEvent): void {\r\n this._events.push(event);\r\n this._events.sort((a, b) => a.frame - b.frame);\r\n }\r\n\r\n /**\r\n * Remove all events found at the given frame\r\n * @param frame The frame to remove events from\r\n */\r\n public removeEvents(frame: number): void {\r\n for (let index = 0; index < this._events.length; index++) {\r\n if (this._events[index].frame === frame) {\r\n this._events.splice(index, 1);\r\n index--;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves all the events from the animation\r\n * @returns Events from the animation\r\n */\r\n public getEvents(): AnimationEvent[] {\r\n return this._events;\r\n }\r\n\r\n /**\r\n * Creates an animation range\r\n * @param name Name of the animation range\r\n * @param from Starting frame of the animation range\r\n * @param to Ending frame of the animation\r\n */\r\n public createRange(name: string, from: number, to: number): void {\r\n // check name not already in use; could happen for bones after serialized\r\n if (!this._ranges[name]) {\r\n this._ranges[name] = new AnimationRange(name, from, to);\r\n }\r\n }\r\n\r\n /**\r\n * Deletes an animation range by name\r\n * @param name Name of the animation range to delete\r\n * @param deleteFrames Specifies if the key frames for the range should also be deleted (true) or not (false)\r\n */\r\n public deleteRange(name: string, deleteFrames = true): void {\r\n const range = this._ranges[name];\r\n if (!range) {\r\n return;\r\n }\r\n if (deleteFrames) {\r\n const from = range.from;\r\n const to = range.to;\r\n\r\n // this loop MUST go high to low for multiple splices to work\r\n for (let key = this._keys.length - 1; key >= 0; key--) {\r\n if (this._keys[key].frame >= from && this._keys[key].frame <= to) {\r\n this._keys.splice(key, 1);\r\n }\r\n }\r\n }\r\n this._ranges[name] = null; // said much faster than 'delete this._range[name]'\r\n }\r\n\r\n /**\r\n * Gets the animation range by name, or null if not defined\r\n * @param name Name of the animation range\r\n * @returns Nullable animation range\r\n */\r\n public getRange(name: string): Nullable<AnimationRange> {\r\n return this._ranges[name];\r\n }\r\n\r\n /**\r\n * Gets the key frames from the animation\r\n * @returns The key frames of the animation\r\n */\r\n public getKeys(): Array<IAnimationKey> {\r\n return this._keys;\r\n }\r\n\r\n /**\r\n * Gets the highest frame rate of the animation\r\n * @returns Highest frame rate of the animation\r\n */\r\n public getHighestFrame(): number {\r\n let ret = 0;\r\n\r\n for (let key = 0, nKeys = this._keys.length; key < nKeys; key++) {\r\n if (ret < this._keys[key].frame) {\r\n ret = this._keys[key].frame;\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Gets the easing function of the animation\r\n * @returns Easing function of the animation\r\n */\r\n public getEasingFunction(): Nullable<IEasingFunction> {\r\n return this._easingFunction;\r\n }\r\n\r\n /**\r\n * Sets the easing function of the animation\r\n * @param easingFunction A custom mathematical formula for animation\r\n */\r\n public setEasingFunction(easingFunction: Nullable<IEasingFunction>): void {\r\n this._easingFunction = easingFunction;\r\n }\r\n\r\n /**\r\n * Interpolates a scalar linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated scalar value\r\n */\r\n public floatInterpolateFunction(startValue: number, endValue: number, gradient: number): number {\r\n return 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 (value between 0 and 1)\r\n * @returns Interpolated scalar value\r\n */\r\n public vector3InterpolateFunction(startValue: Vector3, endValue: Vector3, gradient: number): Vector3 {\r\n return Vector3.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector3 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns InterpolatedVector3 value\r\n */\r\n public vector3InterpolateFunctionWithTangents(startValue: Vector3, outTangent: Vector3, endValue: Vector3, inTangent: Vector3, gradient: number): Vector3 {\r\n return Vector3.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector2 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated Vector2 value\r\n */\r\n public vector2InterpolateFunction(startValue: Vector2, endValue: Vector2, gradient: number): Vector2 {\r\n return Vector2.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Vector2 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate (value between 0 and 1)\r\n * @returns Interpolated Vector2 value\r\n */\r\n public vector2InterpolateFunctionWithTangents(startValue: Vector2, outTangent: Vector2, endValue: Vector2, inTangent: Vector2, gradient: number): Vector2 {\r\n return Vector2.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a size linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Size value\r\n */\r\n public sizeInterpolateFunction(startValue: Size, endValue: Size, gradient: number): Size {\r\n return Size.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color3 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Color3 value\r\n */\r\n public color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3 {\r\n return Color3.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color3 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns interpolated value\r\n */\r\n public color3InterpolateFunctionWithTangents(startValue: Color3, outTangent: Color3, endValue: Color3, inTangent: Color3, gradient: number): Color3 {\r\n return Color3.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color4 linearly\r\n * @param startValue Start value of the animation curve\r\n * @param endValue End value of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns Interpolated Color3 value\r\n */\r\n public color4InterpolateFunction(startValue: Color4, endValue: Color4, gradient: number): Color4 {\r\n return Color4.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Interpolates a Color4 cubically\r\n * @param startValue Start value of the animation curve\r\n * @param outTangent End tangent of the animation\r\n * @param endValue End value of the animation curve\r\n * @param inTangent Start tangent of the animation curve\r\n * @param gradient Scalar amount to interpolate\r\n * @returns interpolated value\r\n */\r\n public color4InterpolateFunctionWithTangents(startValue: Color4, outTangent: Color4, endValue: Color4, inTangent: Color4, gradient: number): Color4 {\r\n return Color4.Hermite(startValue, outTangent, endValue, inTangent, gradient);\r\n }\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _getKeyValue(value: any): any {\r\n if (typeof value === \"function\") {\r\n return value();\r\n }\r\n\r\n return value;\r\n }\r\n\r\n /**\r\n * Evaluate the animation value at a given frame\r\n * @param currentFrame defines the frame where we want to evaluate the animation\r\n * @returns the animation value\r\n */\r\n public evaluate(currentFrame: number) {\r\n 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 * @internal 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 const keysLength = keys.length;\r\n\r\n let key = state.key;\r\n\r\n while (key >= 0 && currentFrame < keys[key].frame) {\r\n --key;\r\n }\r\n\r\n while (key + 1 <= keysLength - 1 && currentFrame >= keys[key + 1].frame) {\r\n ++key;\r\n }\r\n\r\n state.key = key;\r\n\r\n if (key < 0) {\r\n return this._getKeyValue(keys[0].value);\r\n } else if (key + 1 > keysLength - 1) {\r\n return this._getKeyValue(keys[keysLength - 1].value);\r\n }\r\n\r\n const startKey = keys[key];\r\n const endKey = keys[key + 1];\r\n const startValue = this._getKeyValue(startKey.value);\r\n const endValue = this._getKeyValue(endKey.value);\r\n if (startKey.interpolation === AnimationKeyInterpolation.STEP) {\r\n if (endKey.frame > currentFrame) {\r\n return startValue;\r\n } else {\r\n return endValue;\r\n }\r\n }\r\n\r\n const useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;\r\n const frameDelta = endKey.frame - startKey.frame;\r\n\r\n // gradient : percent of currentFrame between the frame inf and the frame sup\r\n let gradient = (currentFrame - startKey.frame) / frameDelta;\r\n\r\n // check for easingFunction and correction of gradient\r\n const easingFunction = 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 const floatValue = useTangent\r\n ? this.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient)\r\n : this.floatInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return floatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return state.offsetValue * state.repeatCount + floatValue;\r\n }\r\n break;\r\n }\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION: {\r\n const quatValue = useTangent\r\n ? this.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.quaternionInterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return quatValue;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return quatValue.addInPlace(state.offsetValue.scale(state.repeatCount));\r\n }\r\n\r\n return quatValue;\r\n }\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3: {\r\n const vec3Value = useTangent\r\n ? this.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.vector3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return vec3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return vec3Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2: {\r\n const vec2Value = useTangent\r\n ? this.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.vector2InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return vec2Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return vec2Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE: {\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient);\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return this.sizeInterpolateFunction(startValue, endValue, gradient).add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3: {\r\n const color3Value = useTangent\r\n ? this.color3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.color3InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return color3Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return color3Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Color4\r\n case Animation.ANIMATIONTYPE_COLOR4: {\r\n const color4Value = useTangent\r\n ? this.color4InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient)\r\n : this.color4InterpolateFunction(startValue, endValue, gradient);\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO:\r\n return color4Value;\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE:\r\n return color4Value.add(state.offsetValue.scale(state.repeatCount));\r\n }\r\n break;\r\n }\r\n // Matrix\r\n case Animation.ANIMATIONTYPE_MATRIX: {\r\n switch (state.loopMode) {\r\n case Animation.ANIMATIONLOOPMODE_CYCLE:\r\n case Animation.ANIMATIONLOOPMODE_CONSTANT:\r\n case Animation.ANIMATIONLOOPMODE_YOYO: {\r\n if (Animation.AllowMatricesInterpolation) {\r\n return this.matrixInterpolateFunction(startValue, endValue, gradient, state.workValue);\r\n }\r\n return startValue;\r\n }\r\n case Animation.ANIMATIONLOOPMODE_RELATIVE: {\r\n return startValue;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n /**\r\n * Defines the function to use to interpolate matrices\r\n * @param startValue defines the start matrix\r\n * @param endValue defines the end matrix\r\n * @param gradient defines the gradient between both matrices\r\n * @param result defines an optional target matrix where to store the interpolation\r\n * @returns the interpolated matrix\r\n */\r\n public matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number, result?: Matrix): Matrix {\r\n if (Animation.AllowMatrixDecomposeForInterpolation) {\r\n if (result) {\r\n Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n return Matrix.DecomposeLerp(startValue, endValue, gradient);\r\n }\r\n\r\n if (result) {\r\n Matrix.LerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n return Matrix.Lerp(startValue, endValue, gradient);\r\n }\r\n\r\n /**\r\n * Makes a copy of the animation\r\n * @returns Cloned animation\r\n */\r\n public clone(): Animation {\r\n const clone = new Animation(this.name, this.targetPropertyPath.join(\".\"), this.framePerSecond, this.dataType, this.loopMode);\r\n\r\n clone.enableBlending = this.enableBlending;\r\n clone.blendingSpeed = this.blendingSpeed;\r\n\r\n if (this._keys) {\r\n clone.setKeys(this._keys);\r\n }\r\n\r\n if (this._ranges) {\r\n clone._ranges = {};\r\n for (const name in this._ranges) {\r\n const range = this._ranges[name];\r\n if (!range) {\r\n continue;\r\n }\r\n clone._ranges[name] = range.clone();\r\n }\r\n }\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Sets the key frames of the animation\r\n * @param values The animation key frames to set\r\n * @param dontClone Whether to clone the keys or not (default is false, so the array of keys is cloned)\r\n */\r\n public setKeys(values: Array<IAnimationKey>, dontClone = false): void {\r\n this._keys = !dontClone ? values.slice(0) : values;\r\n }\r\n\r\n /**\r\n * Serializes the animation to an object\r\n * @returns Serialized object\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n\r\n serializationObject.name = this.name;\r\n serializationObject.property = this.targetProperty;\r\n serializationObject.framePerSecond = this.framePerSecond;\r\n serializationObject.dataType = this.dataType;\r\n serializationObject.loopBehavior = this.loopMode;\r\n serializationObject.enableBlending = this.enableBlending;\r\n serializationObject.blendingSpeed = this.blendingSpeed;\r\n\r\n const dataType = this.dataType;\r\n serializationObject.keys = [];\r\n const keys = this.getKeys();\r\n for (let index = 0; index < keys.length; index++) {\r\n const animationKey = keys[index];\r\n\r\n const key: any = {};\r\n key.frame = animationKey.frame;\r\n\r\n switch (dataType) {\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n key.values = [animationKey.value];\r\n if (animationKey.inTangent !== undefined) {\r\n key.values.push(animationKey.inTangent);\r\n }\r\n if (animationKey.outTangent !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.outTangent);\r\n }\r\n if (animationKey.interpolation !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n if (animationKey.outTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.interpolation);\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n key.values = animationKey.value.asArray();\r\n if (animationKey.inTangent != undefined) {\r\n key.values.push(animationKey.inTangent.asArray());\r\n }\r\n if (animationKey.outTangent != undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.outTangent.asArray());\r\n }\r\n if (animationKey.interpolation !== undefined) {\r\n if (animationKey.inTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n if (animationKey.outTangent === undefined) {\r\n key.values.push(undefined);\r\n }\r\n key.values.push(animationKey.interpolation);\r\n }\r\n break;\r\n }\r\n\r\n serializationObject.keys.push(key);\r\n }\r\n\r\n serializationObject.ranges = [];\r\n for (const name in this._ranges) {\r\n const source = this._ranges[name];\r\n\r\n if (!source) {\r\n continue;\r\n }\r\n const range: any = {};\r\n range.name = name;\r\n range.from = source.from;\r\n range.to = source.to;\r\n serializationObject.ranges.push(range);\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Float animation type\r\n */\r\n public static readonly ANIMATIONTYPE_FLOAT = 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 * Yoyo Loop Mode\r\n */\r\n public static readonly ANIMATIONLOOPMODE_YOYO = 4;\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _UniversalLerp(left: any, right: any, amount: number): any {\r\n const constructor = left.constructor;\r\n if (constructor.Lerp) {\r\n // Lerp supported\r\n return constructor.Lerp(left, right, amount);\r\n } else if (constructor.Slerp) {\r\n // Slerp supported\r\n return constructor.Slerp(left, right, amount);\r\n } else if (left.toFixed) {\r\n // Number\r\n return left * (1.0 - amount) + amount * right;\r\n } else {\r\n // Blending not supported\r\n return right;\r\n }\r\n }\r\n\r\n /**\r\n * Parses an animation object and creates an animation\r\n * @param parsedAnimation Parsed animation object\r\n * @returns Animation object\r\n */\r\n public static Parse(parsedAnimation: any): Animation {\r\n const animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);\r\n\r\n const dataType = parsedAnimation.dataType;\r\n const keys: Array<IAnimationKey> = [];\r\n let data;\r\n let index: number;\r\n\r\n if (parsedAnimation.enableBlending) {\r\n animation.enableBlending = parsedAnimation.enableBlending;\r\n }\r\n\r\n if (parsedAnimation.blendingSpeed) {\r\n animation.blendingSpeed = parsedAnimation.blendingSpeed;\r\n }\r\n\r\n for (index = 0; index < parsedAnimation.keys.length; index++) {\r\n const key = parsedAnimation.keys[index];\r\n let inTangent: any = undefined;\r\n let outTangent: any = undefined;\r\n let interpolation: any = undefined;\r\n\r\n switch (dataType) {\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n data = key.values[0];\r\n if (key.values.length >= 2) {\r\n inTangent = key.values[1];\r\n }\r\n if (key.values.length >= 3) {\r\n outTangent = key.values[2];\r\n }\r\n if (key.values.length >= 4) {\r\n interpolation = key.values[3];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n data = Quaternion.FromArray(key.values);\r\n if (key.values.length >= 8) {\r\n const _inTangent = Quaternion.FromArray(key.values.slice(4, 8));\r\n if (!_inTangent.equals(Quaternion.Zero())) {\r\n inTangent = _inTangent;\r\n }\r\n }\r\n if (key.values.length >= 12) {\r\n const _outTangent = Quaternion.FromArray(key.values.slice(8, 12));\r\n if (!_outTangent.equals(Quaternion.Zero())) {\r\n outTangent = _outTangent;\r\n }\r\n }\r\n if (key.values.length >= 13) {\r\n interpolation = key.values[12];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_MATRIX:\r\n data = Matrix.FromArray(key.values);\r\n if (key.values.length >= 17) {\r\n interpolation = key.values[16];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n data = Color3.FromArray(key.values);\r\n if (key.values[3]) {\r\n inTangent = Color3.FromArray(key.values[3]);\r\n }\r\n if (key.values[4]) {\r\n outTangent = Color3.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n interpolation = key.values[5];\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_COLOR4:\r\n data = Color4.FromArray(key.values);\r\n if (key.values[4]) {\r\n inTangent = Color4.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n outTangent = Color4.FromArray(key.values[5]);\r\n }\r\n if (key.values[6]) {\r\n interpolation = Color4.FromArray(key.values[6]);\r\n }\r\n break;\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n default:\r\n data = Vector3.FromArray(key.values);\r\n if (key.values[3]) {\r\n inTangent = Vector3.FromArray(key.values[3]);\r\n }\r\n if (key.values[4]) {\r\n outTangent = Vector3.FromArray(key.values[4]);\r\n }\r\n if (key.values[5]) {\r\n interpolation = key.values[5];\r\n }\r\n break;\r\n }\r\n\r\n const keyData: any = {};\r\n keyData.frame = key.frame;\r\n keyData.value = data;\r\n\r\n if (inTangent != undefined) {\r\n keyData.inTangent = inTangent;\r\n }\r\n if (outTangent != undefined) {\r\n keyData.outTangent = outTangent;\r\n }\r\n if (interpolation != undefined) {\r\n keyData.interpolation = interpolation;\r\n }\r\n keys.push(keyData);\r\n }\r\n\r\n animation.setKeys(keys);\r\n\r\n if (parsedAnimation.ranges) {\r\n for (index = 0; index < parsedAnimation.ranges.length; index++) {\r\n data = parsedAnimation.ranges[index];\r\n animation.createRange(data.name, data.from, data.to);\r\n }\r\n }\r\n\r\n return animation;\r\n }\r\n\r\n /**\r\n * Appends the serialized animations from the source animations\r\n * @param source Source containing the animations\r\n * @param destination Target to store the animations\r\n */\r\n public static AppendSerializedAnimations(source: IAnimatable, destination: any): void {\r\n SerializationHelper.AppendSerializedAnimations(source, destination);\r\n }\r\n\r\n /**\r\n * Creates a new animation or an array of animations from a snippet saved in a remote file\r\n * @param name defines the name of the animation to create (can be null or empty to use the one from the json data)\r\n * @param url defines the url to load from\r\n * @returns a promise that will resolve to the new animation or an array of animations\r\n */\r\n public static ParseFromFileAsync(name: Nullable<string>, url: string): Promise<Animation | Array<Animation>> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n let serializationObject = JSON.parse(request.responseText);\r\n if (serializationObject.animations) {\r\n serializationObject = serializationObject.animations;\r\n }\r\n\r\n if (serializationObject.length) {\r\n const output = new Array<Animation>();\r\n for (const serializedAnimation of serializationObject) {\r\n output.push(this.Parse(serializedAnimation));\r\n }\r\n\r\n resolve(output);\r\n } else {\r\n const output = this.Parse(serializationObject);\r\n\r\n if (name) {\r\n output.name = name;\r\n }\r\n\r\n resolve(output);\r\n }\r\n } else {\r\n 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 ParseFromSnippetAsync(snippetId: string): Promise<Animation | Array<Animation>> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n\r\n if (snippet.animations) {\r\n const serializationObject = JSON.parse(snippet.animations);\r\n const outputs = new Array<Animation>();\r\n for (const serializedAnimation of serializationObject.animations) {\r\n const output = this.Parse(serializedAnimation);\r\n output.snippetId = snippetId;\r\n outputs.push(output);\r\n }\r\n\r\n resolve(outputs);\r\n } else {\r\n const serializationObject = JSON.parse(snippet.animation);\r\n const output = this.Parse(serializationObject);\r\n\r\n output.snippetId = snippetId;\r\n\r\n resolve(output);\r\n }\r\n } else {\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates an animation or an array of animations from a snippet saved by the Inspector\r\n * @deprecated Please use ParseFromSnippetAsync instead\r\n * @param snippetId defines the snippet to load\r\n * @returns a promise that will resolve to the new animation or a new array of animations\r\n */\r\n public static CreateFromSnippetAsync = Animation.ParseFromSnippetAsync;\r\n}\r\n\r\nRegisterClass(\"BABYLON.Animation\", Animation);\r\nNode._AnimationRangeFactory = (name: string, from: number, to: number) => new AnimationRange(name, from, to);\r\n"]}
@@ -46,6 +46,8 @@ export declare class AnimationGroup implements IDisposable {
46
46
  private _isAdditive;
47
47
  private _weight;
48
48
  private _playOrder;
49
+ private _enableBlending;
50
+ private _blendingSpeed;
49
51
  /** @internal */
50
52
  _parentContainer: Nullable<AbstractScene>;
51
53
  /**
@@ -153,14 +155,16 @@ export declare class AnimationGroup implements IDisposable {
153
155
  set playOrder(value: number);
154
156
  /**
155
157
  * Allows the animations of the animation group to blend with current running animations
156
- * Note: this method should be called after all targeted animations have been added to the group
157
- * @param blendingSpeed defines the blending speed to use
158
+ * Note that a null value means that each animation will use their own existing blending configuration (Animation.enableBlending)
158
159
  */
159
- enableBlending(blendingSpeed: number): void;
160
+ get enableBlending(): Nullable<boolean>;
161
+ set enableBlending(value: Nullable<boolean>);
160
162
  /**
161
- * Disable animation blending
163
+ * Gets or sets the animation blending speed
164
+ * Note that a null value means that each animation will use their own existing blending configuration (Animation.blendingSpeed)
162
165
  */
163
- disableBlending(): void;
166
+ get blendingSpeed(): Nullable<number>;
167
+ set blendingSpeed(value: Nullable<number>);
164
168
  /**
165
169
  * Merge the array of animation groups into a new animation group
166
170
  * @param animationGroups List of animation groups to merge
@@ -301,6 +305,23 @@ export declare class AnimationGroup implements IDisposable {
301
305
  * @returns a new AnimationGroup if cloneOriginal is true or the original AnimationGroup if cloneOriginal is false
302
306
  */
303
307
  static MakeAnimationAdditive(sourceAnimationGroup: AnimationGroup, referenceFrame?: number, range?: string, cloneOriginal?: boolean, clonedName?: string): AnimationGroup;
308
+ /**
309
+ * Creates a new animation, keeping only the keys that are inside a given range
310
+ * @param animationGroup defines the animation group on which to operate
311
+ * @param fromKey defines the lower bound of the range
312
+ * @param toKey defines the upper bound of the range
313
+ * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup
314
+ * @returns a new animation group stripped from all the keys outside the given range
315
+ */
316
+ static ClipKeys(sourceAnimationGroup: AnimationGroup, fromKey: number, toKey: number, name?: string): AnimationGroup;
317
+ /**
318
+ * Updates an existing animation, keeping only the keys that are inside a given range
319
+ * @param animationGroup defines the animation group on which to operate
320
+ * @param fromKey defines the lower bound of the range
321
+ * @param toKey defines the upper bound of the range
322
+ * @returns the source animationGroup stripped from all the keys outside the given range
323
+ */
324
+ static ClipKeysInPlace(animationGroup: AnimationGroup, fromKey: number, toKey: number): AnimationGroup;
304
325
  /**
305
326
  * Returns the string "AnimationGroup"
306
327
  * @returns "AnimationGroup"