@babylonjs/core 6.23.0 → 6.23.1

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 (167) hide show
  1. package/Animations/animationGroup.d.ts +1 -1
  2. package/Animations/animationGroup.js.map +1 -1
  3. package/Behaviors/Cameras/framingBehavior.d.ts +0 -5
  4. package/Behaviors/Cameras/framingBehavior.js +2 -34
  5. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  6. package/Buffers/buffer.d.ts +64 -1
  7. package/Buffers/buffer.js +30 -23
  8. package/Buffers/buffer.js.map +1 -1
  9. package/Buffers/storageBuffer.d.ts +3 -1
  10. package/Buffers/storageBuffer.js +4 -2
  11. package/Buffers/storageBuffer.js.map +1 -1
  12. package/Cameras/Inputs/BaseCameraPointersInput.js +1 -1
  13. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  14. package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js +1 -1
  15. package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js.map +1 -1
  16. package/Cameras/Inputs/freeCameraMouseInput.js +1 -1
  17. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  18. package/Cameras/Stereoscopic/anaglyphArcRotateCamera.d.ts +1 -1
  19. package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js +1 -1
  20. package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js.map +1 -1
  21. package/Cameras/Stereoscopic/anaglyphFreeCamera.d.ts +1 -1
  22. package/Cameras/Stereoscopic/anaglyphFreeCamera.js +1 -1
  23. package/Cameras/Stereoscopic/anaglyphFreeCamera.js.map +1 -1
  24. package/Cameras/Stereoscopic/anaglyphGamepadCamera.d.ts +1 -1
  25. package/Cameras/Stereoscopic/anaglyphGamepadCamera.js +1 -1
  26. package/Cameras/Stereoscopic/anaglyphGamepadCamera.js.map +1 -1
  27. package/Cameras/Stereoscopic/anaglyphUniversalCamera.d.ts +1 -1
  28. package/Cameras/Stereoscopic/anaglyphUniversalCamera.js +1 -1
  29. package/Cameras/Stereoscopic/anaglyphUniversalCamera.js.map +1 -1
  30. package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.d.ts +1 -1
  31. package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js +1 -1
  32. package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js.map +1 -1
  33. package/Cameras/Stereoscopic/stereoscopicFreeCamera.d.ts +1 -1
  34. package/Cameras/Stereoscopic/stereoscopicFreeCamera.js +1 -1
  35. package/Cameras/Stereoscopic/stereoscopicFreeCamera.js.map +1 -1
  36. package/Cameras/Stereoscopic/stereoscopicGamepadCamera.d.ts +1 -1
  37. package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js +1 -1
  38. package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js.map +1 -1
  39. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.d.ts +1 -1
  40. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js +1 -1
  41. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js.map +1 -1
  42. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.d.ts +1 -1
  43. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js +1 -1
  44. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js.map +1 -1
  45. package/Cameras/VR/vrDeviceOrientationFreeCamera.d.ts +1 -1
  46. package/Cameras/VR/vrDeviceOrientationFreeCamera.js +1 -1
  47. package/Cameras/VR/vrDeviceOrientationFreeCamera.js.map +1 -1
  48. package/Cameras/VR/vrDeviceOrientationGamepadCamera.d.ts +1 -1
  49. package/Cameras/VR/vrDeviceOrientationGamepadCamera.js +1 -1
  50. package/Cameras/VR/vrDeviceOrientationGamepadCamera.js.map +1 -1
  51. package/Cameras/arcRotateCamera.d.ts +4 -0
  52. package/Cameras/arcRotateCamera.js +22 -1
  53. package/Cameras/arcRotateCamera.js.map +1 -1
  54. package/Culling/Octrees/octreeSceneComponent.js +4 -4
  55. package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
  56. package/Debug/physicsViewer.js +4 -4
  57. package/Debug/physicsViewer.js.map +1 -1
  58. package/Debug/rayHelper.js +1 -1
  59. package/Debug/rayHelper.js.map +1 -1
  60. package/Engines/Extensions/engine.storageBuffer.d.ts +2 -1
  61. package/Engines/Extensions/engine.storageBuffer.js.map +1 -1
  62. package/Engines/Extensions/engine.uniformBuffer.d.ts +4 -2
  63. package/Engines/Extensions/engine.uniformBuffer.js +2 -2
  64. package/Engines/Extensions/engine.uniformBuffer.js.map +1 -1
  65. package/Engines/WebGPU/Extensions/engine.storageBuffer.d.ts +2 -1
  66. package/Engines/WebGPU/Extensions/engine.storageBuffer.js +3 -3
  67. package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
  68. package/Engines/WebGPU/Extensions/engine.uniformBuffer.js +5 -5
  69. package/Engines/WebGPU/Extensions/engine.uniformBuffer.js.map +1 -1
  70. package/Engines/WebGPU/webgpuBufferManager.d.ts +3 -2
  71. package/Engines/WebGPU/webgpuBufferManager.js +16 -3
  72. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  73. package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +2 -0
  74. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +61 -0
  75. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  76. package/Engines/WebGPU/webgpuDrawContext.js +1 -1
  77. package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
  78. package/Engines/WebGPU/webgpuPipelineContext.d.ts +3 -0
  79. package/Engines/WebGPU/webgpuPipelineContext.js +1 -0
  80. package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
  81. package/Engines/WebGPU/webgpuQuerySet.js +3 -3
  82. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  83. package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
  84. package/Engines/WebGPU/webgpuShaderProcessor.d.ts +3 -0
  85. package/Engines/WebGPU/webgpuShaderProcessor.js +5 -0
  86. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  87. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +11 -1
  88. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  89. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +3 -0
  90. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +32 -4
  91. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  92. package/Engines/WebGPU/webgpuTextureHelper.js +5 -3
  93. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  94. package/Engines/WebGPU/webgpuTintWASM.js +1 -1
  95. package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
  96. package/Engines/engine.d.ts +1 -1
  97. package/Engines/nativeEngine.d.ts +2 -2
  98. package/Engines/nativeEngine.js +5 -2
  99. package/Engines/nativeEngine.js.map +1 -1
  100. package/Engines/thinEngine.d.ts +7 -3
  101. package/Engines/thinEngine.js +11 -7
  102. package/Engines/thinEngine.js.map +1 -1
  103. package/Engines/webgpuEngine.d.ts +9 -4
  104. package/Engines/webgpuEngine.js +16 -11
  105. package/Engines/webgpuEngine.js.map +1 -1
  106. package/FlowGraph/flowGraph.js +1 -1
  107. package/FlowGraph/flowGraph.js.map +1 -1
  108. package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
  109. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  110. package/Lights/Shadows/shadowGenerator.js +1 -1
  111. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  112. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.d.ts +4 -0
  113. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js +21 -0
  114. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js.map +1 -1
  115. package/Materials/Textures/equiRectangularCubeTexture.js +1 -1
  116. package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
  117. package/Materials/Textures/texture.d.ts +2 -0
  118. package/Materials/Textures/texture.js +8 -0
  119. package/Materials/Textures/texture.js.map +1 -1
  120. package/Materials/Textures/videoTexture.d.ts +4 -0
  121. package/Materials/Textures/videoTexture.js +21 -0
  122. package/Materials/Textures/videoTexture.js.map +1 -1
  123. package/Materials/effect.d.ts +8 -3
  124. package/Materials/effect.js +25 -19
  125. package/Materials/effect.js.map +1 -1
  126. package/Materials/material.js +8 -6
  127. package/Materials/material.js.map +1 -1
  128. package/Materials/meshDebugPluginMaterial.js +1 -1
  129. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  130. package/Materials/uniformBuffer.d.ts +1 -0
  131. package/Materials/uniformBuffer.js +9 -2
  132. package/Materials/uniformBuffer.js.map +1 -1
  133. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.d.ts +66 -0
  134. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +100 -0
  135. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -0
  136. package/Meshes/Node/Blocks/Instances/instantiateBlock.d.ts +5 -30
  137. package/Meshes/Node/Blocks/Instances/instantiateBlock.js +2 -52
  138. package/Meshes/Node/Blocks/Instances/instantiateBlock.js.map +1 -1
  139. package/Meshes/Node/Blocks/Instances/instantiateLinearBlock.d.ts +31 -0
  140. package/Meshes/Node/Blocks/Instances/instantiateLinearBlock.js +101 -0
  141. package/Meshes/Node/Blocks/Instances/instantiateLinearBlock.js.map +1 -0
  142. package/Meshes/Node/Blocks/Instances/instantiateRadialBlock.d.ts +43 -0
  143. package/Meshes/Node/Blocks/Instances/instantiateRadialBlock.js +139 -0
  144. package/Meshes/Node/Blocks/Instances/instantiateRadialBlock.js.map +1 -0
  145. package/Meshes/Node/index.d.ts +2 -0
  146. package/Meshes/Node/index.js +2 -0
  147. package/Meshes/Node/index.js.map +1 -1
  148. package/Meshes/geometry.js +8 -2
  149. package/Meshes/geometry.js.map +1 -1
  150. package/Misc/videoRecorder.js +3 -3
  151. package/Misc/videoRecorder.js.map +1 -1
  152. package/Physics/physicsHelper.js +3 -3
  153. package/Physics/physicsHelper.js.map +1 -1
  154. package/Physics/v2/Plugins/havokPlugin.js +64 -56
  155. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  156. package/Rendering/fluidRenderer/fluidRenderer.js +4 -4
  157. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  158. package/Shaders/ShadersInclude/shadowsFragmentFunctions.js +1 -0
  159. package/Shaders/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
  160. package/XR/features/WebXRSpaceWarp.d.ts +2 -0
  161. package/XR/features/WebXRSpaceWarp.js +6 -1
  162. package/XR/features/WebXRSpaceWarp.js.map +1 -1
  163. package/XR/webXRSessionManager.js +1 -1
  164. package/XR/webXRSessionManager.js.map +1 -1
  165. package/package.json +1 -1
  166. package/scene.js +4 -4
  167. package/scene.js.map +1 -1
@@ -332,7 +332,7 @@ export declare class AnimationGroup implements IDisposable {
332
332
  /**
333
333
  * Convert the keyframes for all animations belonging to the group to be relative to a given reference frame.
334
334
  * @param sourceAnimationGroup defines the AnimationGroup containing animations to convert
335
- * @param options defines the options to use when converting ey keyframes
335
+ * @param options defines the options to use when converting keyframes
336
336
  * @returns a new AnimationGroup if options.cloneOriginalAnimationGroup is true or the original AnimationGroup if options.cloneOriginalAnimationGroup is false
337
337
  */
338
338
  static MakeAnimationAdditive(sourceAnimationGroup: AnimationGroup, options?: IMakeAnimationGroupAdditiveOptions): AnimationGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"animationGroup.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animationGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAKxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC;;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AC,mBAAmB,CAAC,MAAM,CAAC;YACzE,GAAG,IAAI,wBAAwB,GAAG,IAAI,CAAC,YAAY,CAAC;SACvD;QACD,OAAO,GAAG,CAAC;IACf,CAAC;CACJ","sourcesContent":["import type { Animatable } from \"./animatable\";\r\nimport { Animation } from \"./animation\";\r\nimport type { IMakeAnimationAdditiveOptions } from \"./animation\";\r\nimport type { IAnimationKey } from \"./animationKey\";\r\n\r\nimport type { Scene, IDisposable } from \"../scene\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\n\r\nimport type { AbstractScene } from \"../abstractScene\";\r\nimport { Tags } from \"../Misc/tags\";\r\nimport type { AnimationGroupMask } from \"./animationGroupMask\";\r\n\r\n/**\r\n * This class defines the direct association between an animation and a target\r\n */\r\nexport class TargetedAnimation {\r\n /**\r\n * Animation to perform\r\n */\r\n public animation: Animation;\r\n /**\r\n * Target to animate\r\n */\r\n public target: any;\r\n\r\n /**\r\n * Returns the string \"TargetedAnimation\"\r\n * @returns \"TargetedAnimation\"\r\n */\r\n public getClassName(): string {\r\n return \"TargetedAnimation\";\r\n }\r\n\r\n /**\r\n * Serialize the object\r\n * @returns the JSON object representing the current entity\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n serializationObject.animation = this.animation.serialize();\r\n serializationObject.targetId = this.target.id;\r\n\r\n return serializationObject;\r\n }\r\n}\r\n\r\n/**\r\n * Options to be used when creating an additive group animation\r\n */\r\nexport interface IMakeAnimationGroupAdditiveOptions extends IMakeAnimationAdditiveOptions {\r\n /**\r\n * Defines if the animation group should be cloned or not (default is false)\r\n */\r\n cloneOriginalAnimationGroup?: boolean;\r\n /**\r\n * The name of the cloned animation group if cloneOriginalAnimationGroup is true\r\n */\r\n clonedAnimationGroupName?: string;\r\n}\r\n\r\n/**\r\n * Use this class to create coordinated animations on multiple targets\r\n */\r\nexport class AnimationGroup implements IDisposable {\r\n private _scene: Scene;\r\n\r\n private _targetedAnimations = new Array<TargetedAnimation>();\r\n private _animatables = new Array<Animatable>();\r\n private _from = Number.MAX_VALUE;\r\n private _to = -Number.MAX_VALUE;\r\n private _isStarted: boolean;\r\n private _isPaused: boolean;\r\n private _speedRatio = 1;\r\n private _loopAnimation = false;\r\n private _isAdditive = false;\r\n private _weight = -1;\r\n private _playOrder = 0;\r\n private _enableBlending: Nullable<boolean> = null;\r\n private _blendingSpeed: Nullable<number> = null;\r\n private _numActiveAnimatables = 0;\r\n\r\n /** @internal */\r\n public _parentContainer: Nullable<AbstractScene> = null;\r\n\r\n /**\r\n * Gets or sets the unique id of the node\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * This observable will notify when one animation have ended\r\n */\r\n public onAnimationEndObservable = new Observable<TargetedAnimation>();\r\n\r\n /**\r\n * Observer raised when one animation loops\r\n */\r\n public onAnimationLoopObservable = new Observable<TargetedAnimation>();\r\n\r\n /**\r\n * Observer raised when all animations have looped\r\n */\r\n public onAnimationGroupLoopObservable = new Observable<AnimationGroup>();\r\n\r\n /**\r\n * This observable will notify when all animations have ended.\r\n */\r\n public onAnimationGroupEndObservable = new Observable<AnimationGroup>();\r\n\r\n /**\r\n * This observable will notify when all animations have paused.\r\n */\r\n public onAnimationGroupPauseObservable = new Observable<AnimationGroup>();\r\n\r\n /**\r\n * This observable will notify when all animations are playing.\r\n */\r\n public onAnimationGroupPlayObservable = new Observable<AnimationGroup>();\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information for the node\r\n */\r\n public metadata: any = null;\r\n\r\n /**\r\n * Gets or sets the mask associated with this animation group. This mask is used to filter which objects should be animated.\r\n */\r\n public mask?: AnimationGroupMask;\r\n\r\n /**\r\n * Makes sure that the animations are either played or stopped according to the animation group mask.\r\n * Note however that the call won't have any effect if the animation group has not been started yet.\r\n * You should call this function if you modify the mask after the animation group has been started.\r\n */\r\n public syncWithMask() {\r\n if (!this.mask) {\r\n this._numActiveAnimatables = this._targetedAnimations.length;\r\n return;\r\n }\r\n\r\n this._numActiveAnimatables = 0;\r\n\r\n for (let i = 0; i < this._animatables.length; ++i) {\r\n const animatable = this._animatables[i];\r\n\r\n if (this.mask.retainsTarget(animatable.target.name)) {\r\n this._numActiveAnimatables++;\r\n if (animatable.paused) {\r\n animatable.restart();\r\n }\r\n } else {\r\n if (!animatable.paused) {\r\n animatable.pause();\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Removes all animations for the targets not retained by the animation group mask.\r\n * Use this function if you know you won't need those animations anymore and if you want to free memory.\r\n */\r\n public removeUnmaskedAnimations() {\r\n if (!this.mask) {\r\n return;\r\n }\r\n\r\n // Removes all animatables (in case the animation group has already been started)\r\n for (let i = 0; i < this._animatables.length; ++i) {\r\n const animatable = this._animatables[i];\r\n\r\n if (!this.mask.retainsTarget(animatable.target.name)) {\r\n animatable.stop();\r\n this._animatables.splice(i, 1);\r\n --i;\r\n }\r\n }\r\n\r\n // Removes the targeted animations\r\n for (let index = 0; index < this._targetedAnimations.length; index++) {\r\n const targetedAnimation = this._targetedAnimations[index];\r\n\r\n if (!this.mask.retainsTarget(targetedAnimation.target.name)) {\r\n this._targetedAnimations.splice(index, 1);\r\n --index;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the first frame\r\n */\r\n public get from(): number {\r\n return this._from;\r\n }\r\n\r\n /**\r\n * Gets the last frame\r\n */\r\n public get to(): number {\r\n return this._to;\r\n }\r\n\r\n /**\r\n * Define if the animations are started\r\n */\r\n public get isStarted(): boolean {\r\n return this._isStarted;\r\n }\r\n\r\n /**\r\n * Gets a value indicating that the current group is playing\r\n */\r\n public get isPlaying(): boolean {\r\n return this._isStarted && !this._isPaused;\r\n }\r\n\r\n /**\r\n * Gets or sets the speed ratio to use for all animations\r\n */\r\n public get speedRatio(): number {\r\n return this._speedRatio;\r\n }\r\n\r\n /**\r\n * Gets or sets the speed ratio to use for all animations\r\n */\r\n public set speedRatio(value: number) {\r\n if (this._speedRatio === value) {\r\n return;\r\n }\r\n\r\n this._speedRatio = value;\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.speedRatio = this._speedRatio;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets if all animations should loop or not\r\n */\r\n public get loopAnimation(): boolean {\r\n return this._loopAnimation;\r\n }\r\n\r\n public set loopAnimation(value: boolean) {\r\n if (this._loopAnimation === value) {\r\n return;\r\n }\r\n\r\n this._loopAnimation = value;\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.loopAnimation = this._loopAnimation;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets if all animations should be evaluated additively\r\n */\r\n public get isAdditive(): boolean {\r\n return this._isAdditive;\r\n }\r\n\r\n public set isAdditive(value: boolean) {\r\n if (this._isAdditive === value) {\r\n return;\r\n }\r\n\r\n this._isAdditive = value;\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.isAdditive = this._isAdditive;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the weight to apply to all animations of the group\r\n */\r\n public get weight(): number {\r\n return this._weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n if (this._weight === value) {\r\n return;\r\n }\r\n\r\n this._weight = value;\r\n this.setWeightForAllAnimatables(this._weight);\r\n }\r\n\r\n /**\r\n * Gets the targeted animations for this animation group\r\n */\r\n public get targetedAnimations(): Array<TargetedAnimation> {\r\n return this._targetedAnimations;\r\n }\r\n\r\n /**\r\n * returning the list of animatables controlled by this animation group.\r\n */\r\n public get animatables(): Array<Animatable> {\r\n return this._animatables;\r\n }\r\n\r\n /**\r\n * Gets the list of target animations\r\n */\r\n public get children() {\r\n return this._targetedAnimations;\r\n }\r\n\r\n /**\r\n * Gets or sets the order of play of the animation group (default: 0)\r\n */\r\n public get playOrder() {\r\n return this._playOrder;\r\n }\r\n\r\n public set playOrder(value: number) {\r\n if (this._playOrder === value) {\r\n return;\r\n }\r\n\r\n this._playOrder = value;\r\n\r\n if (this._animatables.length > 0) {\r\n for (let i = 0; i < this._animatables.length; i++) {\r\n this._animatables[i].playOrder = this._playOrder;\r\n }\r\n\r\n this._scene.sortActiveAnimatables();\r\n }\r\n }\r\n\r\n /**\r\n * Allows the animations of the animation group to blend with current running animations\r\n * Note that a null value means that each animation will use their own existing blending configuration (Animation.enableBlending)\r\n */\r\n public get enableBlending() {\r\n return this._enableBlending;\r\n }\r\n\r\n public set enableBlending(value: Nullable<boolean>) {\r\n if (this._enableBlending === value) {\r\n return;\r\n }\r\n\r\n this._enableBlending = value;\r\n\r\n if (value !== null) {\r\n for (let i = 0; i < this._targetedAnimations.length; ++i) {\r\n this._targetedAnimations[i].animation.enableBlending = value;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the animation blending speed\r\n * Note that a null value means that each animation will use their own existing blending configuration (Animation.blendingSpeed)\r\n */\r\n public get blendingSpeed() {\r\n return this._blendingSpeed;\r\n }\r\n\r\n public set blendingSpeed(value: Nullable<number>) {\r\n if (this._blendingSpeed === value) {\r\n return;\r\n }\r\n\r\n this._blendingSpeed = value;\r\n\r\n if (value !== null) {\r\n for (let i = 0; i < this._targetedAnimations.length; ++i) {\r\n this._targetedAnimations[i].animation.blendingSpeed = value;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the length (in seconds) of the animation group\r\n * This function assumes that all animations are played at the same framePerSecond speed!\r\n * Note: you can only call this method after you've added at least one targeted animation!\r\n * @param from Starting frame range (default is AnimationGroup.from)\r\n * @param to Ending frame range (default is AnimationGroup.to)\r\n * @returns The length in seconds\r\n */\r\n public getLength(from?: number, to?: number): number {\r\n from = from ?? this._from;\r\n to = to ?? this._to;\r\n\r\n const fps = this.targetedAnimations[0].animation.framePerSecond * this._speedRatio;\r\n\r\n return (to - from) / fps;\r\n }\r\n\r\n /**\r\n * Merge the array of animation groups into a new animation group\r\n * @param animationGroups List of animation groups to merge\r\n * @param disposeSource If true, animation groups will be disposed after being merged (default: true)\r\n * @param normalize If true, animation groups will be normalized before being merged, so that all animations have the same \"from\" and \"to\" frame (default: false)\r\n * @param weight Weight for the new animation group. If not provided, it will inherit the weight from the first animation group of the array\r\n * @returns The new animation group or null if no animation groups were passed\r\n */\r\n public static MergeAnimationGroups(animationGroups: Array<AnimationGroup>, disposeSource = true, normalize = false, weight?: number): Nullable<AnimationGroup> {\r\n if (animationGroups.length === 0) {\r\n return null;\r\n }\r\n\r\n weight = weight ?? animationGroups[0].weight;\r\n\r\n let beginFrame = Number.MAX_VALUE;\r\n let endFrame = -Number.MAX_VALUE;\r\n\r\n if (normalize) {\r\n for (const animationGroup of animationGroups) {\r\n if (animationGroup.from < beginFrame) {\r\n beginFrame = animationGroup.from;\r\n }\r\n\r\n if (animationGroup.to > endFrame) {\r\n endFrame = animationGroup.to;\r\n }\r\n }\r\n }\r\n\r\n const mergedAnimationGroup = new AnimationGroup(animationGroups[0].name + \"_merged\", animationGroups[0]._scene, weight);\r\n\r\n for (const animationGroup of animationGroups) {\r\n if (normalize) {\r\n animationGroup.normalize(beginFrame, endFrame);\r\n }\r\n\r\n for (const targetedAnimation of animationGroup.targetedAnimations) {\r\n mergedAnimationGroup.addTargetedAnimation(targetedAnimation.animation, targetedAnimation.target);\r\n }\r\n\r\n if (disposeSource) {\r\n animationGroup.dispose();\r\n }\r\n }\r\n\r\n return mergedAnimationGroup;\r\n }\r\n\r\n /**\r\n * Instantiates a new Animation Group.\r\n * This helps managing several animations at once.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations\r\n * @param name Defines the name of the group\r\n * @param scene Defines the scene the group belongs to\r\n * @param weight Defines the weight to use for animations in the group (-1.0 by default, meaning \"no weight\")\r\n * @param playOrder Defines the order of play of the animation group (default is 0)\r\n */\r\n public constructor(\r\n /** The name of the animation group */\r\n public name: string,\r\n scene: Nullable<Scene> = null,\r\n weight = -1,\r\n playOrder = 0\r\n ) {\r\n this._scene = scene || EngineStore.LastCreatedScene!;\r\n this._weight = weight;\r\n this._playOrder = playOrder;\r\n this.uniqueId = this._scene.getUniqueId();\r\n\r\n this._scene.addAnimationGroup(this);\r\n }\r\n\r\n /**\r\n * Add an animation (with its target) in the group\r\n * @param animation defines the animation we want to add\r\n * @param target defines the target of the animation\r\n * @returns the TargetedAnimation object\r\n */\r\n public addTargetedAnimation(animation: Animation, target: any): TargetedAnimation {\r\n const targetedAnimation = new TargetedAnimation();\r\n targetedAnimation.animation = animation;\r\n targetedAnimation.target = target;\r\n\r\n const keys = animation.getKeys();\r\n if (this._from > keys[0].frame) {\r\n this._from = keys[0].frame;\r\n }\r\n\r\n if (this._to < keys[keys.length - 1].frame) {\r\n this._to = keys[keys.length - 1].frame;\r\n }\r\n\r\n if (this._enableBlending !== null) {\r\n animation.enableBlending = this._enableBlending;\r\n }\r\n\r\n if (this._blendingSpeed !== null) {\r\n animation.blendingSpeed = this._blendingSpeed;\r\n }\r\n\r\n this._targetedAnimations.push(targetedAnimation);\r\n\r\n return targetedAnimation;\r\n }\r\n\r\n /**\r\n * Remove an animation from the group\r\n * @param animation defines the animation we want to remove\r\n */\r\n public removeTargetedAnimation(animation: Animation) {\r\n for (let index = this._targetedAnimations.length - 1; index > -1; index--) {\r\n const targetedAnimation = this._targetedAnimations[index];\r\n if (targetedAnimation.animation === animation) {\r\n this._targetedAnimations.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame\r\n * It can add constant keys at begin or end\r\n * @param beginFrame defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null)\r\n * @param endFrame defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)\r\n * @returns the animation group\r\n */\r\n public normalize(beginFrame: Nullable<number> = null, endFrame: Nullable<number> = null): AnimationGroup {\r\n if (beginFrame == null) {\r\n beginFrame = this._from;\r\n }\r\n if (endFrame == null) {\r\n endFrame = this._to;\r\n }\r\n\r\n for (let index = 0; index < this._targetedAnimations.length; index++) {\r\n const targetedAnimation = this._targetedAnimations[index];\r\n const keys = targetedAnimation.animation.getKeys();\r\n const startKey = keys[0];\r\n const endKey = keys[keys.length - 1];\r\n\r\n if (startKey.frame > beginFrame) {\r\n const newKey: IAnimationKey = {\r\n frame: beginFrame,\r\n value: startKey.value,\r\n inTangent: startKey.inTangent,\r\n outTangent: startKey.outTangent,\r\n interpolation: startKey.interpolation,\r\n };\r\n keys.splice(0, 0, newKey);\r\n }\r\n\r\n if (endKey.frame < endFrame) {\r\n const newKey: IAnimationKey = {\r\n frame: endFrame,\r\n value: endKey.value,\r\n inTangent: endKey.inTangent,\r\n outTangent: endKey.outTangent,\r\n interpolation: endKey.interpolation,\r\n };\r\n keys.push(newKey);\r\n }\r\n }\r\n\r\n this._from = beginFrame;\r\n this._to = endFrame;\r\n\r\n return this;\r\n }\r\n\r\n private _animationLoopCount: number;\r\n private _animationLoopFlags: boolean[] = [];\r\n\r\n private _processLoop(animatable: Animatable, targetedAnimation: TargetedAnimation, index: number) {\r\n animatable.onAnimationLoop = () => {\r\n this.onAnimationLoopObservable.notifyObservers(targetedAnimation);\r\n\r\n if (this._animationLoopFlags[index]) {\r\n return;\r\n }\r\n\r\n this._animationLoopFlags[index] = true;\r\n\r\n this._animationLoopCount++;\r\n if (this._animationLoopCount === this._numActiveAnimatables) {\r\n this.onAnimationGroupLoopObservable.notifyObservers(this);\r\n this._animationLoopCount = 0;\r\n this._animationLoopFlags.length = 0;\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Start all animations on given targets\r\n * @param loop defines if animations must loop\r\n * @param speedRatio defines the ratio to apply to animation speed (1 by default)\r\n * @param from defines the from key (optional)\r\n * @param to defines the to key (optional)\r\n * @param isAdditive defines the additive state for the resulting animatables (optional)\r\n * @returns the current animation group\r\n */\r\n public start(loop = false, speedRatio = 1, from?: number, to?: number, isAdditive?: boolean): AnimationGroup {\r\n if (this._isStarted || this._targetedAnimations.length === 0) {\r\n return this;\r\n }\r\n\r\n this._loopAnimation = loop;\r\n\r\n this._animationLoopCount = 0;\r\n this._animationLoopFlags.length = 0;\r\n\r\n for (let index = 0; index < this._targetedAnimations.length; index++) {\r\n const targetedAnimation = this._targetedAnimations[index];\r\n const animatable = this._scene.beginDirectAnimation(\r\n targetedAnimation.target,\r\n [targetedAnimation.animation],\r\n from !== undefined ? from : this._from,\r\n to !== undefined ? to : this._to,\r\n loop,\r\n speedRatio,\r\n undefined,\r\n undefined,\r\n isAdditive !== undefined ? isAdditive : this._isAdditive\r\n );\r\n animatable.weight = this._weight;\r\n animatable.playOrder = this._playOrder;\r\n animatable.onAnimationEnd = () => {\r\n this.onAnimationEndObservable.notifyObservers(targetedAnimation);\r\n this._checkAnimationGroupEnded(animatable);\r\n };\r\n\r\n this._processLoop(animatable, targetedAnimation, index);\r\n this._animatables.push(animatable);\r\n }\r\n\r\n this.syncWithMask();\r\n\r\n this._scene.sortActiveAnimatables();\r\n\r\n this._speedRatio = speedRatio;\r\n\r\n this._isStarted = true;\r\n this._isPaused = false;\r\n\r\n this.onAnimationGroupPlayObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Pause all animations\r\n * @returns the animation group\r\n */\r\n public pause(): AnimationGroup {\r\n if (!this._isStarted) {\r\n return this;\r\n }\r\n\r\n this._isPaused = true;\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.pause();\r\n }\r\n\r\n this.onAnimationGroupPauseObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Play all animations to initial state\r\n * This function will start() the animations if they were not started or will restart() them if they were paused\r\n * @param loop defines if animations must loop\r\n * @returns the animation group\r\n */\r\n public play(loop?: boolean): AnimationGroup {\r\n // only if all animatables are ready and exist\r\n if (this.isStarted && this._animatables.length === this._targetedAnimations.length) {\r\n if (loop !== undefined) {\r\n this.loopAnimation = loop;\r\n }\r\n this.restart();\r\n } else {\r\n this.stop();\r\n this.start(loop, this._speedRatio);\r\n }\r\n\r\n this._isPaused = false;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Reset all animations to initial state\r\n * @returns the animation group\r\n */\r\n public reset(): AnimationGroup {\r\n if (!this._isStarted) {\r\n this.play();\r\n this.goToFrame(0);\r\n this.stop();\r\n return this;\r\n }\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.reset();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Restart animations from key 0\r\n * @returns the animation group\r\n */\r\n public restart(): AnimationGroup {\r\n if (!this._isStarted) {\r\n return this;\r\n }\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.restart();\r\n }\r\n\r\n this.onAnimationGroupPlayObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Stop all animations\r\n * @returns the animation group\r\n */\r\n public stop(): AnimationGroup {\r\n if (!this._isStarted) {\r\n return this;\r\n }\r\n\r\n const list = this._animatables.slice();\r\n for (let index = 0; index < list.length; index++) {\r\n list[index].stop(undefined, undefined, true);\r\n }\r\n\r\n // We will take care of removing all stopped animatables\r\n let curIndex = 0;\r\n for (let index = 0; index < this._scene._activeAnimatables.length; index++) {\r\n const animatable = this._scene._activeAnimatables[index];\r\n if (animatable._runtimeAnimations.length > 0) {\r\n this._scene._activeAnimatables[curIndex++] = animatable;\r\n }\r\n }\r\n this._scene._activeAnimatables.length = curIndex;\r\n\r\n this._isStarted = false;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Set animation weight for all animatables\r\n *\r\n * @since 6.12.4\r\n * You can pass the weight to the AnimationGroup constructor, or use the weight property to set it after the group has been created,\r\n * making it easier to define the overall animation weight than calling setWeightForAllAnimatables() after the animation group has been started\r\n * @param weight defines the weight to use\r\n * @returns the animationGroup\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-weights\r\n */\r\n public setWeightForAllAnimatables(weight: number): AnimationGroup {\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.weight = weight;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Synchronize and normalize all animatables with a source animatable\r\n * @param root defines the root animatable to synchronize with (null to stop synchronizing)\r\n * @returns the animationGroup\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-weights\r\n */\r\n public syncAllAnimationsWith(root: Nullable<Animatable>): AnimationGroup {\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.syncWith(root);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Goes to a specific frame in this animation group\r\n * @param frame the frame number to go to\r\n * @returns the animationGroup\r\n */\r\n public goToFrame(frame: number): AnimationGroup {\r\n if (!this._isStarted) {\r\n return this;\r\n }\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.goToFrame(frame);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Dispose all associated resources\r\n */\r\n public dispose(): void {\r\n this._targetedAnimations.length = 0;\r\n this._animatables.length = 0;\r\n\r\n // Remove from scene\r\n const index = this._scene.animationGroups.indexOf(this);\r\n\r\n if (index > -1) {\r\n this._scene.animationGroups.splice(index, 1);\r\n }\r\n\r\n if (this._parentContainer) {\r\n const index = this._parentContainer.animationGroups.indexOf(this);\r\n if (index > -1) {\r\n this._parentContainer.animationGroups.splice(index, 1);\r\n }\r\n this._parentContainer = null;\r\n }\r\n\r\n this.onAnimationEndObservable.clear();\r\n this.onAnimationGroupEndObservable.clear();\r\n this.onAnimationGroupPauseObservable.clear();\r\n this.onAnimationGroupPlayObservable.clear();\r\n this.onAnimationLoopObservable.clear();\r\n this.onAnimationGroupLoopObservable.clear();\r\n }\r\n\r\n private _checkAnimationGroupEnded(animatable: Animatable) {\r\n // animatable should be taken out of the array\r\n const idx = this._animatables.indexOf(animatable);\r\n if (idx > -1) {\r\n this._animatables.splice(idx, 1);\r\n }\r\n\r\n // all animatables were removed? animation group ended!\r\n if (this._animatables.length === 0) {\r\n this._isStarted = false;\r\n this.onAnimationGroupEndObservable.notifyObservers(this);\r\n }\r\n }\r\n\r\n /**\r\n * Clone the current animation group and returns a copy\r\n * @param newName defines the name of the new group\r\n * @param targetConverter defines an optional function used to convert current animation targets to new ones\r\n * @param cloneAnimations defines if the animations should be cloned or referenced\r\n * @returns the new animation group\r\n */\r\n public clone(newName: string, targetConverter?: (oldTarget: any) => any, cloneAnimations = false): AnimationGroup {\r\n const newGroup = new AnimationGroup(newName || this.name, this._scene, this._weight, this._playOrder);\r\n\r\n newGroup._from = this.from;\r\n newGroup._to = this.to;\r\n newGroup._speedRatio = this.speedRatio;\r\n newGroup._loopAnimation = this.loopAnimation;\r\n newGroup._isAdditive = this.isAdditive;\r\n newGroup._enableBlending = this.enableBlending;\r\n newGroup._blendingSpeed = this.blendingSpeed;\r\n newGroup.metadata = this.metadata;\r\n newGroup.mask = this.mask;\r\n\r\n for (const targetAnimation of this._targetedAnimations) {\r\n newGroup.addTargetedAnimation(\r\n cloneAnimations ? targetAnimation.animation.clone() : targetAnimation.animation,\r\n targetConverter ? targetConverter(targetAnimation.target) : targetAnimation.target\r\n );\r\n }\r\n\r\n return newGroup;\r\n }\r\n\r\n /**\r\n * Serializes the animationGroup 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.from = this.from;\r\n serializationObject.to = this.to;\r\n serializationObject.speedRatio = this.speedRatio;\r\n serializationObject.loopAnimation = this.loopAnimation;\r\n serializationObject.isAdditive = this.isAdditive;\r\n serializationObject.weight = this.weight;\r\n serializationObject.playOrder = this.playOrder;\r\n serializationObject.enableBlending = this.enableBlending;\r\n serializationObject.blendingSpeed = this.blendingSpeed;\r\n\r\n serializationObject.targetedAnimations = [];\r\n for (let targetedAnimationIndex = 0; targetedAnimationIndex < this.targetedAnimations.length; targetedAnimationIndex++) {\r\n const targetedAnimation = this.targetedAnimations[targetedAnimationIndex];\r\n serializationObject.targetedAnimations[targetedAnimationIndex] = targetedAnimation.serialize();\r\n }\r\n\r\n if (Tags && Tags.HasTags(this)) {\r\n serializationObject.tags = Tags.GetTags(this);\r\n }\r\n\r\n // Metadata\r\n if (this.metadata) {\r\n serializationObject.metadata = this.metadata;\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Returns a new AnimationGroup object parsed from the source provided.\r\n * @param parsedAnimationGroup defines the source\r\n * @param scene defines the scene that will receive the animationGroup\r\n * @returns a new AnimationGroup\r\n */\r\n public static Parse(parsedAnimationGroup: any, scene: Scene): AnimationGroup {\r\n const animationGroup = new AnimationGroup(parsedAnimationGroup.name, scene, parsedAnimationGroup.weight, parsedAnimationGroup.playOrder);\r\n for (let i = 0; i < parsedAnimationGroup.targetedAnimations.length; i++) {\r\n const targetedAnimation = parsedAnimationGroup.targetedAnimations[i];\r\n const animation = Animation.Parse(targetedAnimation.animation);\r\n const id = targetedAnimation.targetId;\r\n if (targetedAnimation.animation.property === \"influence\") {\r\n // morph target animation\r\n const morphTarget = scene.getMorphTargetById(id);\r\n if (morphTarget) {\r\n animationGroup.addTargetedAnimation(animation, morphTarget);\r\n }\r\n } else {\r\n const targetNode = scene.getNodeById(id);\r\n\r\n if (targetNode != null) {\r\n animationGroup.addTargetedAnimation(animation, targetNode);\r\n }\r\n }\r\n }\r\n\r\n if (Tags) {\r\n Tags.AddTagsTo(animationGroup, parsedAnimationGroup.tags);\r\n }\r\n\r\n if (parsedAnimationGroup.from !== null && parsedAnimationGroup.to !== null) {\r\n animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to);\r\n }\r\n\r\n if (parsedAnimationGroup.speedRatio !== undefined) {\r\n animationGroup._speedRatio = parsedAnimationGroup.speedRatio;\r\n }\r\n if (parsedAnimationGroup.loopAnimation !== undefined) {\r\n animationGroup._loopAnimation = parsedAnimationGroup.loopAnimation;\r\n }\r\n\r\n if (parsedAnimationGroup.isAdditive !== undefined) {\r\n animationGroup._isAdditive = parsedAnimationGroup.isAdditive;\r\n }\r\n\r\n if (parsedAnimationGroup.weight !== undefined) {\r\n animationGroup._weight = parsedAnimationGroup.weight;\r\n }\r\n\r\n if (parsedAnimationGroup.playOrder !== undefined) {\r\n animationGroup._playOrder = parsedAnimationGroup.playOrder;\r\n }\r\n\r\n if (parsedAnimationGroup.enableBlending !== undefined) {\r\n animationGroup._enableBlending = parsedAnimationGroup.enableBlending;\r\n }\r\n\r\n if (parsedAnimationGroup.blendingSpeed !== undefined) {\r\n animationGroup._blendingSpeed = parsedAnimationGroup.blendingSpeed;\r\n }\r\n\r\n if (parsedAnimationGroup.metadata !== undefined) {\r\n animationGroup.metadata = parsedAnimationGroup.metadata;\r\n }\r\n\r\n return animationGroup;\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 sourceAnimationGroup defines the AnimationGroup containing animations to convert\r\n * @param referenceFrame defines the frame that keyframes in the range will be relative to (default: 0)\r\n * @param range defines the name of the AnimationRange belonging to the animations in the group to convert\r\n * @param cloneOriginal defines whether or not to clone the group and convert the clone or convert the original group (default is false)\r\n * @param clonedName defines the name of the resulting cloned AnimationGroup if cloneOriginal is true\r\n * @returns a new AnimationGroup if cloneOriginal is true or the original AnimationGroup if cloneOriginal is false\r\n */\r\n public static MakeAnimationAdditive(sourceAnimationGroup: AnimationGroup, referenceFrame: number, range?: string, cloneOriginal?: boolean, clonedName?: string): AnimationGroup;\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 sourceAnimationGroup defines the AnimationGroup containing animations to convert\r\n * @param options defines the options to use when converting ey keyframes\r\n * @returns a new AnimationGroup if options.cloneOriginalAnimationGroup is true or the original AnimationGroup if options.cloneOriginalAnimationGroup is false\r\n */\r\n public static MakeAnimationAdditive(sourceAnimationGroup: AnimationGroup, options?: IMakeAnimationGroupAdditiveOptions): AnimationGroup;\r\n\r\n /** @internal */\r\n public static MakeAnimationAdditive(\r\n sourceAnimationGroup: AnimationGroup,\r\n referenceFrameOrOptions?: number | IMakeAnimationGroupAdditiveOptions,\r\n range?: string,\r\n cloneOriginal = false,\r\n clonedName?: string\r\n ): AnimationGroup {\r\n let options: IMakeAnimationGroupAdditiveOptions;\r\n\r\n if (typeof referenceFrameOrOptions === \"object\") {\r\n options = referenceFrameOrOptions;\r\n } else {\r\n options = {\r\n referenceFrame: referenceFrameOrOptions,\r\n range: range,\r\n cloneOriginalAnimationGroup: cloneOriginal,\r\n clonedAnimationName: clonedName,\r\n };\r\n }\r\n\r\n let animationGroup = sourceAnimationGroup;\r\n if (options.cloneOriginalAnimationGroup) {\r\n animationGroup = sourceAnimationGroup.clone(options.clonedAnimationGroupName || animationGroup.name);\r\n }\r\n\r\n const targetedAnimations = animationGroup.targetedAnimations;\r\n for (let index = 0; index < targetedAnimations.length; index++) {\r\n const targetedAnimation = targetedAnimations[index];\r\n targetedAnimation.animation = Animation.MakeAnimationAdditive(targetedAnimation.animation, options);\r\n }\r\n\r\n animationGroup.isAdditive = true;\r\n\r\n if (options.clipKeys) {\r\n // We need to recalculate the from/to frames for the animation group because some keys may have been removed\r\n let from = Number.MAX_VALUE;\r\n let to = -Number.MAX_VALUE;\r\n\r\n const targetedAnimations = animationGroup.targetedAnimations;\r\n for (let index = 0; index < targetedAnimations.length; index++) {\r\n const targetedAnimation = targetedAnimations[index];\r\n const animation = targetedAnimation.animation;\r\n const keys = animation.getKeys();\r\n\r\n if (from > keys[0].frame) {\r\n from = keys[0].frame;\r\n }\r\n\r\n if (to < keys[keys.length - 1].frame) {\r\n to = keys[keys.length - 1].frame;\r\n }\r\n }\r\n\r\n animationGroup._from = from;\r\n animationGroup._to = to;\r\n }\r\n\r\n return animationGroup;\r\n }\r\n\r\n /**\r\n * Creates a new animation, keeping only the keys that are inside a given key range\r\n * @param sourceAnimationGroup defines the animation group on which to operate\r\n * @param fromKey defines the lower bound of the range\r\n * @param toKey defines the upper bound of the range\r\n * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned\r\n * @returns a new animation group stripped from all the keys outside the given range\r\n */\r\n public static ClipKeys(sourceAnimationGroup: AnimationGroup, fromKey: number, toKey: number, name?: string, dontCloneAnimations?: boolean): AnimationGroup {\r\n const animationGroup = sourceAnimationGroup.clone(name || sourceAnimationGroup.name);\r\n\r\n return AnimationGroup.ClipKeysInPlace(animationGroup, fromKey, toKey, dontCloneAnimations);\r\n }\r\n\r\n /**\r\n * Updates an existing animation, keeping only the keys that are inside a given key range\r\n * @param animationGroup defines the animation group on which to operate\r\n * @param fromKey defines the lower bound of the range\r\n * @param toKey defines the upper bound of the range\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned\r\n * @returns the animationGroup stripped from all the keys outside the given range\r\n */\r\n public static ClipKeysInPlace(animationGroup: AnimationGroup, fromKey: number, toKey: number, dontCloneAnimations?: boolean): AnimationGroup {\r\n return AnimationGroup.ClipInPlace(animationGroup, fromKey, toKey, dontCloneAnimations, false);\r\n }\r\n\r\n /**\r\n * Creates a new animation, keeping only the frames that are inside a given frame range\r\n * @param sourceAnimationGroup defines the animation group on which to operate\r\n * @param fromFrame defines the lower bound of the range\r\n * @param toFrame defines the upper bound of the range\r\n * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned\r\n * @returns a new animation group stripped from all the frames outside the given range\r\n */\r\n public static ClipFrames(sourceAnimationGroup: AnimationGroup, fromFrame: number, toFrame: number, name?: string, dontCloneAnimations?: boolean): AnimationGroup {\r\n const animationGroup = sourceAnimationGroup.clone(name || sourceAnimationGroup.name);\r\n\r\n return AnimationGroup.ClipFramesInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations);\r\n }\r\n\r\n /**\r\n * Updates an existing animation, keeping only the frames that are inside a given frame range\r\n * @param animationGroup defines the animation group on which to operate\r\n * @param fromFrame defines the lower bound of the range\r\n * @param toFrame defines the upper bound of the range\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned\r\n * @returns the animationGroup stripped from all the frames outside the given range\r\n */\r\n public static ClipFramesInPlace(animationGroup: AnimationGroup, fromFrame: number, toFrame: number, dontCloneAnimations?: boolean): AnimationGroup {\r\n return AnimationGroup.ClipInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations, true);\r\n }\r\n\r\n /**\r\n * Updates an existing animation, keeping only the keys that are inside a given key or frame range\r\n * @param animationGroup defines the animation group on which to operate\r\n * @param start defines the lower bound of the range\r\n * @param end defines the upper bound of the range\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned\r\n * @param useFrame defines if the range is defined by frame numbers or key indices (default is false which means use key indices)\r\n * @returns the animationGroup stripped from all the keys outside the given range\r\n */\r\n public static ClipInPlace(animationGroup: AnimationGroup, start: number, end: number, dontCloneAnimations?: boolean, useFrame = false): AnimationGroup {\r\n let from = Number.MAX_VALUE;\r\n let to = -Number.MAX_VALUE;\r\n\r\n const targetedAnimations = animationGroup.targetedAnimations;\r\n for (let index = 0; index < targetedAnimations.length; index++) {\r\n const targetedAnimation = targetedAnimations[index];\r\n const animation = dontCloneAnimations ? targetedAnimation.animation : targetedAnimation.animation.clone();\r\n\r\n if (useFrame) {\r\n // Make sure we have keys corresponding to the bounds of the frame range\r\n animation.createKeyForFrame(start);\r\n animation.createKeyForFrame(end);\r\n }\r\n\r\n const keys = animation.getKeys();\r\n const newKeys: IAnimationKey[] = [];\r\n\r\n let startFrame = Number.MAX_VALUE;\r\n for (let k = 0; k < keys.length; k++) {\r\n const key = keys[k];\r\n if ((!useFrame && k >= start && k <= end) || (useFrame && key.frame >= start && key.frame <= end)) {\r\n const newKey: IAnimationKey = {\r\n frame: key.frame,\r\n value: key.value.clone ? key.value.clone() : key.value,\r\n inTangent: key.inTangent,\r\n outTangent: key.outTangent,\r\n interpolation: key.interpolation,\r\n lockedTangent: key.lockedTangent,\r\n };\r\n if (startFrame === Number.MAX_VALUE) {\r\n startFrame = newKey.frame;\r\n }\r\n newKey.frame -= startFrame;\r\n newKeys.push(newKey);\r\n }\r\n }\r\n\r\n if (newKeys.length === 0) {\r\n targetedAnimations.splice(index, 1);\r\n index--;\r\n continue;\r\n }\r\n\r\n if (from > newKeys[0].frame) {\r\n from = newKeys[0].frame;\r\n }\r\n\r\n if (to < newKeys[newKeys.length - 1].frame) {\r\n to = newKeys[newKeys.length - 1].frame;\r\n }\r\n\r\n animation.setKeys(newKeys, true);\r\n targetedAnimation.animation = animation; // in case the animation has been cloned\r\n }\r\n\r\n animationGroup._from = from;\r\n animationGroup._to = to;\r\n\r\n return animationGroup;\r\n }\r\n\r\n /**\r\n * Returns the string \"AnimationGroup\"\r\n * @returns \"AnimationGroup\"\r\n */\r\n public getClassName(): string {\r\n return \"AnimationGroup\";\r\n }\r\n\r\n /**\r\n * Creates a detailed string about the object\r\n * @param fullDetails defines if the output string will support multiple levels of logging within scene loading\r\n * @returns a string representing the object\r\n */\r\n public toString(fullDetails?: boolean): string {\r\n let ret = \"Name: \" + this.name;\r\n ret += \", type: \" + this.getClassName();\r\n if (fullDetails) {\r\n ret += \", from: \" + this._from;\r\n ret += \", to: \" + this._to;\r\n ret += \", isStarted: \" + this._isStarted;\r\n ret += \", speedRatio: \" + this._speedRatio;\r\n ret += \", targetedAnimations length: \" + this._targetedAnimations.length;\r\n ret += \", animatables length: \" + this._animatables;\r\n }\r\n return ret;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"animationGroup.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animationGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aA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AAC,GAAG,CAAC;YAC3B,GAAG,IAAI,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC;YACzC,GAAG,IAAI,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC;YAC3C,GAAG,IAAI,+BAA+B,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC;YACzE,GAAG,IAAI,wBAAwB,GAAG,IAAI,CAAC,YAAY,CAAC;SACvD;QACD,OAAO,GAAG,CAAC;IACf,CAAC;CACJ","sourcesContent":["import type { Animatable } from \"./animatable\";\r\nimport { Animation } from \"./animation\";\r\nimport type { IMakeAnimationAdditiveOptions } from \"./animation\";\r\nimport type { IAnimationKey } from \"./animationKey\";\r\n\r\nimport type { Scene, IDisposable } from \"../scene\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\n\r\nimport type { AbstractScene } from \"../abstractScene\";\r\nimport { Tags } from \"../Misc/tags\";\r\nimport type { AnimationGroupMask } from \"./animationGroupMask\";\r\n\r\n/**\r\n * This class defines the direct association between an animation and a target\r\n */\r\nexport class TargetedAnimation {\r\n /**\r\n * Animation to perform\r\n */\r\n public animation: Animation;\r\n /**\r\n * Target to animate\r\n */\r\n public target: any;\r\n\r\n /**\r\n * Returns the string \"TargetedAnimation\"\r\n * @returns \"TargetedAnimation\"\r\n */\r\n public getClassName(): string {\r\n return \"TargetedAnimation\";\r\n }\r\n\r\n /**\r\n * Serialize the object\r\n * @returns the JSON object representing the current entity\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n serializationObject.animation = this.animation.serialize();\r\n serializationObject.targetId = this.target.id;\r\n\r\n return serializationObject;\r\n }\r\n}\r\n\r\n/**\r\n * Options to be used when creating an additive group animation\r\n */\r\nexport interface IMakeAnimationGroupAdditiveOptions extends IMakeAnimationAdditiveOptions {\r\n /**\r\n * Defines if the animation group should be cloned or not (default is false)\r\n */\r\n cloneOriginalAnimationGroup?: boolean;\r\n /**\r\n * The name of the cloned animation group if cloneOriginalAnimationGroup is true\r\n */\r\n clonedAnimationGroupName?: string;\r\n}\r\n\r\n/**\r\n * Use this class to create coordinated animations on multiple targets\r\n */\r\nexport class AnimationGroup implements IDisposable {\r\n private _scene: Scene;\r\n\r\n private _targetedAnimations = new Array<TargetedAnimation>();\r\n private _animatables = new Array<Animatable>();\r\n private _from = Number.MAX_VALUE;\r\n private _to = -Number.MAX_VALUE;\r\n private _isStarted: boolean;\r\n private _isPaused: boolean;\r\n private _speedRatio = 1;\r\n private _loopAnimation = false;\r\n private _isAdditive = false;\r\n private _weight = -1;\r\n private _playOrder = 0;\r\n private _enableBlending: Nullable<boolean> = null;\r\n private _blendingSpeed: Nullable<number> = null;\r\n private _numActiveAnimatables = 0;\r\n\r\n /** @internal */\r\n public _parentContainer: Nullable<AbstractScene> = null;\r\n\r\n /**\r\n * Gets or sets the unique id of the node\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * This observable will notify when one animation have ended\r\n */\r\n public onAnimationEndObservable = new Observable<TargetedAnimation>();\r\n\r\n /**\r\n * Observer raised when one animation loops\r\n */\r\n public onAnimationLoopObservable = new Observable<TargetedAnimation>();\r\n\r\n /**\r\n * Observer raised when all animations have looped\r\n */\r\n public onAnimationGroupLoopObservable = new Observable<AnimationGroup>();\r\n\r\n /**\r\n * This observable will notify when all animations have ended.\r\n */\r\n public onAnimationGroupEndObservable = new Observable<AnimationGroup>();\r\n\r\n /**\r\n * This observable will notify when all animations have paused.\r\n */\r\n public onAnimationGroupPauseObservable = new Observable<AnimationGroup>();\r\n\r\n /**\r\n * This observable will notify when all animations are playing.\r\n */\r\n public onAnimationGroupPlayObservable = new Observable<AnimationGroup>();\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information for the node\r\n */\r\n public metadata: any = null;\r\n\r\n /**\r\n * Gets or sets the mask associated with this animation group. This mask is used to filter which objects should be animated.\r\n */\r\n public mask?: AnimationGroupMask;\r\n\r\n /**\r\n * Makes sure that the animations are either played or stopped according to the animation group mask.\r\n * Note however that the call won't have any effect if the animation group has not been started yet.\r\n * You should call this function if you modify the mask after the animation group has been started.\r\n */\r\n public syncWithMask() {\r\n if (!this.mask) {\r\n this._numActiveAnimatables = this._targetedAnimations.length;\r\n return;\r\n }\r\n\r\n this._numActiveAnimatables = 0;\r\n\r\n for (let i = 0; i < this._animatables.length; ++i) {\r\n const animatable = this._animatables[i];\r\n\r\n if (this.mask.retainsTarget(animatable.target.name)) {\r\n this._numActiveAnimatables++;\r\n if (animatable.paused) {\r\n animatable.restart();\r\n }\r\n } else {\r\n if (!animatable.paused) {\r\n animatable.pause();\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Removes all animations for the targets not retained by the animation group mask.\r\n * Use this function if you know you won't need those animations anymore and if you want to free memory.\r\n */\r\n public removeUnmaskedAnimations() {\r\n if (!this.mask) {\r\n return;\r\n }\r\n\r\n // Removes all animatables (in case the animation group has already been started)\r\n for (let i = 0; i < this._animatables.length; ++i) {\r\n const animatable = this._animatables[i];\r\n\r\n if (!this.mask.retainsTarget(animatable.target.name)) {\r\n animatable.stop();\r\n this._animatables.splice(i, 1);\r\n --i;\r\n }\r\n }\r\n\r\n // Removes the targeted animations\r\n for (let index = 0; index < this._targetedAnimations.length; index++) {\r\n const targetedAnimation = this._targetedAnimations[index];\r\n\r\n if (!this.mask.retainsTarget(targetedAnimation.target.name)) {\r\n this._targetedAnimations.splice(index, 1);\r\n --index;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the first frame\r\n */\r\n public get from(): number {\r\n return this._from;\r\n }\r\n\r\n /**\r\n * Gets the last frame\r\n */\r\n public get to(): number {\r\n return this._to;\r\n }\r\n\r\n /**\r\n * Define if the animations are started\r\n */\r\n public get isStarted(): boolean {\r\n return this._isStarted;\r\n }\r\n\r\n /**\r\n * Gets a value indicating that the current group is playing\r\n */\r\n public get isPlaying(): boolean {\r\n return this._isStarted && !this._isPaused;\r\n }\r\n\r\n /**\r\n * Gets or sets the speed ratio to use for all animations\r\n */\r\n public get speedRatio(): number {\r\n return this._speedRatio;\r\n }\r\n\r\n /**\r\n * Gets or sets the speed ratio to use for all animations\r\n */\r\n public set speedRatio(value: number) {\r\n if (this._speedRatio === value) {\r\n return;\r\n }\r\n\r\n this._speedRatio = value;\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.speedRatio = this._speedRatio;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets if all animations should loop or not\r\n */\r\n public get loopAnimation(): boolean {\r\n return this._loopAnimation;\r\n }\r\n\r\n public set loopAnimation(value: boolean) {\r\n if (this._loopAnimation === value) {\r\n return;\r\n }\r\n\r\n this._loopAnimation = value;\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.loopAnimation = this._loopAnimation;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets if all animations should be evaluated additively\r\n */\r\n public get isAdditive(): boolean {\r\n return this._isAdditive;\r\n }\r\n\r\n public set isAdditive(value: boolean) {\r\n if (this._isAdditive === value) {\r\n return;\r\n }\r\n\r\n this._isAdditive = value;\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.isAdditive = this._isAdditive;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the weight to apply to all animations of the group\r\n */\r\n public get weight(): number {\r\n return this._weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n if (this._weight === value) {\r\n return;\r\n }\r\n\r\n this._weight = value;\r\n this.setWeightForAllAnimatables(this._weight);\r\n }\r\n\r\n /**\r\n * Gets the targeted animations for this animation group\r\n */\r\n public get targetedAnimations(): Array<TargetedAnimation> {\r\n return this._targetedAnimations;\r\n }\r\n\r\n /**\r\n * returning the list of animatables controlled by this animation group.\r\n */\r\n public get animatables(): Array<Animatable> {\r\n return this._animatables;\r\n }\r\n\r\n /**\r\n * Gets the list of target animations\r\n */\r\n public get children() {\r\n return this._targetedAnimations;\r\n }\r\n\r\n /**\r\n * Gets or sets the order of play of the animation group (default: 0)\r\n */\r\n public get playOrder() {\r\n return this._playOrder;\r\n }\r\n\r\n public set playOrder(value: number) {\r\n if (this._playOrder === value) {\r\n return;\r\n }\r\n\r\n this._playOrder = value;\r\n\r\n if (this._animatables.length > 0) {\r\n for (let i = 0; i < this._animatables.length; i++) {\r\n this._animatables[i].playOrder = this._playOrder;\r\n }\r\n\r\n this._scene.sortActiveAnimatables();\r\n }\r\n }\r\n\r\n /**\r\n * Allows the animations of the animation group to blend with current running animations\r\n * Note that a null value means that each animation will use their own existing blending configuration (Animation.enableBlending)\r\n */\r\n public get enableBlending() {\r\n return this._enableBlending;\r\n }\r\n\r\n public set enableBlending(value: Nullable<boolean>) {\r\n if (this._enableBlending === value) {\r\n return;\r\n }\r\n\r\n this._enableBlending = value;\r\n\r\n if (value !== null) {\r\n for (let i = 0; i < this._targetedAnimations.length; ++i) {\r\n this._targetedAnimations[i].animation.enableBlending = value;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the animation blending speed\r\n * Note that a null value means that each animation will use their own existing blending configuration (Animation.blendingSpeed)\r\n */\r\n public get blendingSpeed() {\r\n return this._blendingSpeed;\r\n }\r\n\r\n public set blendingSpeed(value: Nullable<number>) {\r\n if (this._blendingSpeed === value) {\r\n return;\r\n }\r\n\r\n this._blendingSpeed = value;\r\n\r\n if (value !== null) {\r\n for (let i = 0; i < this._targetedAnimations.length; ++i) {\r\n this._targetedAnimations[i].animation.blendingSpeed = value;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the length (in seconds) of the animation group\r\n * This function assumes that all animations are played at the same framePerSecond speed!\r\n * Note: you can only call this method after you've added at least one targeted animation!\r\n * @param from Starting frame range (default is AnimationGroup.from)\r\n * @param to Ending frame range (default is AnimationGroup.to)\r\n * @returns The length in seconds\r\n */\r\n public getLength(from?: number, to?: number): number {\r\n from = from ?? this._from;\r\n to = to ?? this._to;\r\n\r\n const fps = this.targetedAnimations[0].animation.framePerSecond * this._speedRatio;\r\n\r\n return (to - from) / fps;\r\n }\r\n\r\n /**\r\n * Merge the array of animation groups into a new animation group\r\n * @param animationGroups List of animation groups to merge\r\n * @param disposeSource If true, animation groups will be disposed after being merged (default: true)\r\n * @param normalize If true, animation groups will be normalized before being merged, so that all animations have the same \"from\" and \"to\" frame (default: false)\r\n * @param weight Weight for the new animation group. If not provided, it will inherit the weight from the first animation group of the array\r\n * @returns The new animation group or null if no animation groups were passed\r\n */\r\n public static MergeAnimationGroups(animationGroups: Array<AnimationGroup>, disposeSource = true, normalize = false, weight?: number): Nullable<AnimationGroup> {\r\n if (animationGroups.length === 0) {\r\n return null;\r\n }\r\n\r\n weight = weight ?? animationGroups[0].weight;\r\n\r\n let beginFrame = Number.MAX_VALUE;\r\n let endFrame = -Number.MAX_VALUE;\r\n\r\n if (normalize) {\r\n for (const animationGroup of animationGroups) {\r\n if (animationGroup.from < beginFrame) {\r\n beginFrame = animationGroup.from;\r\n }\r\n\r\n if (animationGroup.to > endFrame) {\r\n endFrame = animationGroup.to;\r\n }\r\n }\r\n }\r\n\r\n const mergedAnimationGroup = new AnimationGroup(animationGroups[0].name + \"_merged\", animationGroups[0]._scene, weight);\r\n\r\n for (const animationGroup of animationGroups) {\r\n if (normalize) {\r\n animationGroup.normalize(beginFrame, endFrame);\r\n }\r\n\r\n for (const targetedAnimation of animationGroup.targetedAnimations) {\r\n mergedAnimationGroup.addTargetedAnimation(targetedAnimation.animation, targetedAnimation.target);\r\n }\r\n\r\n if (disposeSource) {\r\n animationGroup.dispose();\r\n }\r\n }\r\n\r\n return mergedAnimationGroup;\r\n }\r\n\r\n /**\r\n * Instantiates a new Animation Group.\r\n * This helps managing several animations at once.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations\r\n * @param name Defines the name of the group\r\n * @param scene Defines the scene the group belongs to\r\n * @param weight Defines the weight to use for animations in the group (-1.0 by default, meaning \"no weight\")\r\n * @param playOrder Defines the order of play of the animation group (default is 0)\r\n */\r\n public constructor(\r\n /** The name of the animation group */\r\n public name: string,\r\n scene: Nullable<Scene> = null,\r\n weight = -1,\r\n playOrder = 0\r\n ) {\r\n this._scene = scene || EngineStore.LastCreatedScene!;\r\n this._weight = weight;\r\n this._playOrder = playOrder;\r\n this.uniqueId = this._scene.getUniqueId();\r\n\r\n this._scene.addAnimationGroup(this);\r\n }\r\n\r\n /**\r\n * Add an animation (with its target) in the group\r\n * @param animation defines the animation we want to add\r\n * @param target defines the target of the animation\r\n * @returns the TargetedAnimation object\r\n */\r\n public addTargetedAnimation(animation: Animation, target: any): TargetedAnimation {\r\n const targetedAnimation = new TargetedAnimation();\r\n targetedAnimation.animation = animation;\r\n targetedAnimation.target = target;\r\n\r\n const keys = animation.getKeys();\r\n if (this._from > keys[0].frame) {\r\n this._from = keys[0].frame;\r\n }\r\n\r\n if (this._to < keys[keys.length - 1].frame) {\r\n this._to = keys[keys.length - 1].frame;\r\n }\r\n\r\n if (this._enableBlending !== null) {\r\n animation.enableBlending = this._enableBlending;\r\n }\r\n\r\n if (this._blendingSpeed !== null) {\r\n animation.blendingSpeed = this._blendingSpeed;\r\n }\r\n\r\n this._targetedAnimations.push(targetedAnimation);\r\n\r\n return targetedAnimation;\r\n }\r\n\r\n /**\r\n * Remove an animation from the group\r\n * @param animation defines the animation we want to remove\r\n */\r\n public removeTargetedAnimation(animation: Animation) {\r\n for (let index = this._targetedAnimations.length - 1; index > -1; index--) {\r\n const targetedAnimation = this._targetedAnimations[index];\r\n if (targetedAnimation.animation === animation) {\r\n this._targetedAnimations.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame\r\n * It can add constant keys at begin or end\r\n * @param beginFrame defines the new begin frame for all animations or the smallest begin frame of all animations if null (defaults to null)\r\n * @param endFrame defines the new end frame for all animations or the largest end frame of all animations if null (defaults to null)\r\n * @returns the animation group\r\n */\r\n public normalize(beginFrame: Nullable<number> = null, endFrame: Nullable<number> = null): AnimationGroup {\r\n if (beginFrame == null) {\r\n beginFrame = this._from;\r\n }\r\n if (endFrame == null) {\r\n endFrame = this._to;\r\n }\r\n\r\n for (let index = 0; index < this._targetedAnimations.length; index++) {\r\n const targetedAnimation = this._targetedAnimations[index];\r\n const keys = targetedAnimation.animation.getKeys();\r\n const startKey = keys[0];\r\n const endKey = keys[keys.length - 1];\r\n\r\n if (startKey.frame > beginFrame) {\r\n const newKey: IAnimationKey = {\r\n frame: beginFrame,\r\n value: startKey.value,\r\n inTangent: startKey.inTangent,\r\n outTangent: startKey.outTangent,\r\n interpolation: startKey.interpolation,\r\n };\r\n keys.splice(0, 0, newKey);\r\n }\r\n\r\n if (endKey.frame < endFrame) {\r\n const newKey: IAnimationKey = {\r\n frame: endFrame,\r\n value: endKey.value,\r\n inTangent: endKey.inTangent,\r\n outTangent: endKey.outTangent,\r\n interpolation: endKey.interpolation,\r\n };\r\n keys.push(newKey);\r\n }\r\n }\r\n\r\n this._from = beginFrame;\r\n this._to = endFrame;\r\n\r\n return this;\r\n }\r\n\r\n private _animationLoopCount: number;\r\n private _animationLoopFlags: boolean[] = [];\r\n\r\n private _processLoop(animatable: Animatable, targetedAnimation: TargetedAnimation, index: number) {\r\n animatable.onAnimationLoop = () => {\r\n this.onAnimationLoopObservable.notifyObservers(targetedAnimation);\r\n\r\n if (this._animationLoopFlags[index]) {\r\n return;\r\n }\r\n\r\n this._animationLoopFlags[index] = true;\r\n\r\n this._animationLoopCount++;\r\n if (this._animationLoopCount === this._numActiveAnimatables) {\r\n this.onAnimationGroupLoopObservable.notifyObservers(this);\r\n this._animationLoopCount = 0;\r\n this._animationLoopFlags.length = 0;\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * Start all animations on given targets\r\n * @param loop defines if animations must loop\r\n * @param speedRatio defines the ratio to apply to animation speed (1 by default)\r\n * @param from defines the from key (optional)\r\n * @param to defines the to key (optional)\r\n * @param isAdditive defines the additive state for the resulting animatables (optional)\r\n * @returns the current animation group\r\n */\r\n public start(loop = false, speedRatio = 1, from?: number, to?: number, isAdditive?: boolean): AnimationGroup {\r\n if (this._isStarted || this._targetedAnimations.length === 0) {\r\n return this;\r\n }\r\n\r\n this._loopAnimation = loop;\r\n\r\n this._animationLoopCount = 0;\r\n this._animationLoopFlags.length = 0;\r\n\r\n for (let index = 0; index < this._targetedAnimations.length; index++) {\r\n const targetedAnimation = this._targetedAnimations[index];\r\n const animatable = this._scene.beginDirectAnimation(\r\n targetedAnimation.target,\r\n [targetedAnimation.animation],\r\n from !== undefined ? from : this._from,\r\n to !== undefined ? to : this._to,\r\n loop,\r\n speedRatio,\r\n undefined,\r\n undefined,\r\n isAdditive !== undefined ? isAdditive : this._isAdditive\r\n );\r\n animatable.weight = this._weight;\r\n animatable.playOrder = this._playOrder;\r\n animatable.onAnimationEnd = () => {\r\n this.onAnimationEndObservable.notifyObservers(targetedAnimation);\r\n this._checkAnimationGroupEnded(animatable);\r\n };\r\n\r\n this._processLoop(animatable, targetedAnimation, index);\r\n this._animatables.push(animatable);\r\n }\r\n\r\n this.syncWithMask();\r\n\r\n this._scene.sortActiveAnimatables();\r\n\r\n this._speedRatio = speedRatio;\r\n\r\n this._isStarted = true;\r\n this._isPaused = false;\r\n\r\n this.onAnimationGroupPlayObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Pause all animations\r\n * @returns the animation group\r\n */\r\n public pause(): AnimationGroup {\r\n if (!this._isStarted) {\r\n return this;\r\n }\r\n\r\n this._isPaused = true;\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.pause();\r\n }\r\n\r\n this.onAnimationGroupPauseObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Play all animations to initial state\r\n * This function will start() the animations if they were not started or will restart() them if they were paused\r\n * @param loop defines if animations must loop\r\n * @returns the animation group\r\n */\r\n public play(loop?: boolean): AnimationGroup {\r\n // only if all animatables are ready and exist\r\n if (this.isStarted && this._animatables.length === this._targetedAnimations.length) {\r\n if (loop !== undefined) {\r\n this.loopAnimation = loop;\r\n }\r\n this.restart();\r\n } else {\r\n this.stop();\r\n this.start(loop, this._speedRatio);\r\n }\r\n\r\n this._isPaused = false;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Reset all animations to initial state\r\n * @returns the animation group\r\n */\r\n public reset(): AnimationGroup {\r\n if (!this._isStarted) {\r\n this.play();\r\n this.goToFrame(0);\r\n this.stop();\r\n return this;\r\n }\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.reset();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Restart animations from key 0\r\n * @returns the animation group\r\n */\r\n public restart(): AnimationGroup {\r\n if (!this._isStarted) {\r\n return this;\r\n }\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.restart();\r\n }\r\n\r\n this.onAnimationGroupPlayObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Stop all animations\r\n * @returns the animation group\r\n */\r\n public stop(): AnimationGroup {\r\n if (!this._isStarted) {\r\n return this;\r\n }\r\n\r\n const list = this._animatables.slice();\r\n for (let index = 0; index < list.length; index++) {\r\n list[index].stop(undefined, undefined, true);\r\n }\r\n\r\n // We will take care of removing all stopped animatables\r\n let curIndex = 0;\r\n for (let index = 0; index < this._scene._activeAnimatables.length; index++) {\r\n const animatable = this._scene._activeAnimatables[index];\r\n if (animatable._runtimeAnimations.length > 0) {\r\n this._scene._activeAnimatables[curIndex++] = animatable;\r\n }\r\n }\r\n this._scene._activeAnimatables.length = curIndex;\r\n\r\n this._isStarted = false;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Set animation weight for all animatables\r\n *\r\n * @since 6.12.4\r\n * You can pass the weight to the AnimationGroup constructor, or use the weight property to set it after the group has been created,\r\n * making it easier to define the overall animation weight than calling setWeightForAllAnimatables() after the animation group has been started\r\n * @param weight defines the weight to use\r\n * @returns the animationGroup\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-weights\r\n */\r\n public setWeightForAllAnimatables(weight: number): AnimationGroup {\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.weight = weight;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Synchronize and normalize all animatables with a source animatable\r\n * @param root defines the root animatable to synchronize with (null to stop synchronizing)\r\n * @returns the animationGroup\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#animation-weights\r\n */\r\n public syncAllAnimationsWith(root: Nullable<Animatable>): AnimationGroup {\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.syncWith(root);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Goes to a specific frame in this animation group\r\n * @param frame the frame number to go to\r\n * @returns the animationGroup\r\n */\r\n public goToFrame(frame: number): AnimationGroup {\r\n if (!this._isStarted) {\r\n return this;\r\n }\r\n\r\n for (let index = 0; index < this._animatables.length; index++) {\r\n const animatable = this._animatables[index];\r\n animatable.goToFrame(frame);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Dispose all associated resources\r\n */\r\n public dispose(): void {\r\n this._targetedAnimations.length = 0;\r\n this._animatables.length = 0;\r\n\r\n // Remove from scene\r\n const index = this._scene.animationGroups.indexOf(this);\r\n\r\n if (index > -1) {\r\n this._scene.animationGroups.splice(index, 1);\r\n }\r\n\r\n if (this._parentContainer) {\r\n const index = this._parentContainer.animationGroups.indexOf(this);\r\n if (index > -1) {\r\n this._parentContainer.animationGroups.splice(index, 1);\r\n }\r\n this._parentContainer = null;\r\n }\r\n\r\n this.onAnimationEndObservable.clear();\r\n this.onAnimationGroupEndObservable.clear();\r\n this.onAnimationGroupPauseObservable.clear();\r\n this.onAnimationGroupPlayObservable.clear();\r\n this.onAnimationLoopObservable.clear();\r\n this.onAnimationGroupLoopObservable.clear();\r\n }\r\n\r\n private _checkAnimationGroupEnded(animatable: Animatable) {\r\n // animatable should be taken out of the array\r\n const idx = this._animatables.indexOf(animatable);\r\n if (idx > -1) {\r\n this._animatables.splice(idx, 1);\r\n }\r\n\r\n // all animatables were removed? animation group ended!\r\n if (this._animatables.length === 0) {\r\n this._isStarted = false;\r\n this.onAnimationGroupEndObservable.notifyObservers(this);\r\n }\r\n }\r\n\r\n /**\r\n * Clone the current animation group and returns a copy\r\n * @param newName defines the name of the new group\r\n * @param targetConverter defines an optional function used to convert current animation targets to new ones\r\n * @param cloneAnimations defines if the animations should be cloned or referenced\r\n * @returns the new animation group\r\n */\r\n public clone(newName: string, targetConverter?: (oldTarget: any) => any, cloneAnimations = false): AnimationGroup {\r\n const newGroup = new AnimationGroup(newName || this.name, this._scene, this._weight, this._playOrder);\r\n\r\n newGroup._from = this.from;\r\n newGroup._to = this.to;\r\n newGroup._speedRatio = this.speedRatio;\r\n newGroup._loopAnimation = this.loopAnimation;\r\n newGroup._isAdditive = this.isAdditive;\r\n newGroup._enableBlending = this.enableBlending;\r\n newGroup._blendingSpeed = this.blendingSpeed;\r\n newGroup.metadata = this.metadata;\r\n newGroup.mask = this.mask;\r\n\r\n for (const targetAnimation of this._targetedAnimations) {\r\n newGroup.addTargetedAnimation(\r\n cloneAnimations ? targetAnimation.animation.clone() : targetAnimation.animation,\r\n targetConverter ? targetConverter(targetAnimation.target) : targetAnimation.target\r\n );\r\n }\r\n\r\n return newGroup;\r\n }\r\n\r\n /**\r\n * Serializes the animationGroup 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.from = this.from;\r\n serializationObject.to = this.to;\r\n serializationObject.speedRatio = this.speedRatio;\r\n serializationObject.loopAnimation = this.loopAnimation;\r\n serializationObject.isAdditive = this.isAdditive;\r\n serializationObject.weight = this.weight;\r\n serializationObject.playOrder = this.playOrder;\r\n serializationObject.enableBlending = this.enableBlending;\r\n serializationObject.blendingSpeed = this.blendingSpeed;\r\n\r\n serializationObject.targetedAnimations = [];\r\n for (let targetedAnimationIndex = 0; targetedAnimationIndex < this.targetedAnimations.length; targetedAnimationIndex++) {\r\n const targetedAnimation = this.targetedAnimations[targetedAnimationIndex];\r\n serializationObject.targetedAnimations[targetedAnimationIndex] = targetedAnimation.serialize();\r\n }\r\n\r\n if (Tags && Tags.HasTags(this)) {\r\n serializationObject.tags = Tags.GetTags(this);\r\n }\r\n\r\n // Metadata\r\n if (this.metadata) {\r\n serializationObject.metadata = this.metadata;\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Returns a new AnimationGroup object parsed from the source provided.\r\n * @param parsedAnimationGroup defines the source\r\n * @param scene defines the scene that will receive the animationGroup\r\n * @returns a new AnimationGroup\r\n */\r\n public static Parse(parsedAnimationGroup: any, scene: Scene): AnimationGroup {\r\n const animationGroup = new AnimationGroup(parsedAnimationGroup.name, scene, parsedAnimationGroup.weight, parsedAnimationGroup.playOrder);\r\n for (let i = 0; i < parsedAnimationGroup.targetedAnimations.length; i++) {\r\n const targetedAnimation = parsedAnimationGroup.targetedAnimations[i];\r\n const animation = Animation.Parse(targetedAnimation.animation);\r\n const id = targetedAnimation.targetId;\r\n if (targetedAnimation.animation.property === \"influence\") {\r\n // morph target animation\r\n const morphTarget = scene.getMorphTargetById(id);\r\n if (morphTarget) {\r\n animationGroup.addTargetedAnimation(animation, morphTarget);\r\n }\r\n } else {\r\n const targetNode = scene.getNodeById(id);\r\n\r\n if (targetNode != null) {\r\n animationGroup.addTargetedAnimation(animation, targetNode);\r\n }\r\n }\r\n }\r\n\r\n if (Tags) {\r\n Tags.AddTagsTo(animationGroup, parsedAnimationGroup.tags);\r\n }\r\n\r\n if (parsedAnimationGroup.from !== null && parsedAnimationGroup.to !== null) {\r\n animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to);\r\n }\r\n\r\n if (parsedAnimationGroup.speedRatio !== undefined) {\r\n animationGroup._speedRatio = parsedAnimationGroup.speedRatio;\r\n }\r\n if (parsedAnimationGroup.loopAnimation !== undefined) {\r\n animationGroup._loopAnimation = parsedAnimationGroup.loopAnimation;\r\n }\r\n\r\n if (parsedAnimationGroup.isAdditive !== undefined) {\r\n animationGroup._isAdditive = parsedAnimationGroup.isAdditive;\r\n }\r\n\r\n if (parsedAnimationGroup.weight !== undefined) {\r\n animationGroup._weight = parsedAnimationGroup.weight;\r\n }\r\n\r\n if (parsedAnimationGroup.playOrder !== undefined) {\r\n animationGroup._playOrder = parsedAnimationGroup.playOrder;\r\n }\r\n\r\n if (parsedAnimationGroup.enableBlending !== undefined) {\r\n animationGroup._enableBlending = parsedAnimationGroup.enableBlending;\r\n }\r\n\r\n if (parsedAnimationGroup.blendingSpeed !== undefined) {\r\n animationGroup._blendingSpeed = parsedAnimationGroup.blendingSpeed;\r\n }\r\n\r\n if (parsedAnimationGroup.metadata !== undefined) {\r\n animationGroup.metadata = parsedAnimationGroup.metadata;\r\n }\r\n\r\n return animationGroup;\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 sourceAnimationGroup defines the AnimationGroup containing animations to convert\r\n * @param referenceFrame defines the frame that keyframes in the range will be relative to (default: 0)\r\n * @param range defines the name of the AnimationRange belonging to the animations in the group to convert\r\n * @param cloneOriginal defines whether or not to clone the group and convert the clone or convert the original group (default is false)\r\n * @param clonedName defines the name of the resulting cloned AnimationGroup if cloneOriginal is true\r\n * @returns a new AnimationGroup if cloneOriginal is true or the original AnimationGroup if cloneOriginal is false\r\n */\r\n public static MakeAnimationAdditive(sourceAnimationGroup: AnimationGroup, referenceFrame: number, range?: string, cloneOriginal?: boolean, clonedName?: string): AnimationGroup;\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 sourceAnimationGroup defines the AnimationGroup containing animations to convert\r\n * @param options defines the options to use when converting keyframes\r\n * @returns a new AnimationGroup if options.cloneOriginalAnimationGroup is true or the original AnimationGroup if options.cloneOriginalAnimationGroup is false\r\n */\r\n public static MakeAnimationAdditive(sourceAnimationGroup: AnimationGroup, options?: IMakeAnimationGroupAdditiveOptions): AnimationGroup;\r\n\r\n /** @internal */\r\n public static MakeAnimationAdditive(\r\n sourceAnimationGroup: AnimationGroup,\r\n referenceFrameOrOptions?: number | IMakeAnimationGroupAdditiveOptions,\r\n range?: string,\r\n cloneOriginal = false,\r\n clonedName?: string\r\n ): AnimationGroup {\r\n let options: IMakeAnimationGroupAdditiveOptions;\r\n\r\n if (typeof referenceFrameOrOptions === \"object\") {\r\n options = referenceFrameOrOptions;\r\n } else {\r\n options = {\r\n referenceFrame: referenceFrameOrOptions,\r\n range: range,\r\n cloneOriginalAnimationGroup: cloneOriginal,\r\n clonedAnimationName: clonedName,\r\n };\r\n }\r\n\r\n let animationGroup = sourceAnimationGroup;\r\n if (options.cloneOriginalAnimationGroup) {\r\n animationGroup = sourceAnimationGroup.clone(options.clonedAnimationGroupName || animationGroup.name);\r\n }\r\n\r\n const targetedAnimations = animationGroup.targetedAnimations;\r\n for (let index = 0; index < targetedAnimations.length; index++) {\r\n const targetedAnimation = targetedAnimations[index];\r\n targetedAnimation.animation = Animation.MakeAnimationAdditive(targetedAnimation.animation, options);\r\n }\r\n\r\n animationGroup.isAdditive = true;\r\n\r\n if (options.clipKeys) {\r\n // We need to recalculate the from/to frames for the animation group because some keys may have been removed\r\n let from = Number.MAX_VALUE;\r\n let to = -Number.MAX_VALUE;\r\n\r\n const targetedAnimations = animationGroup.targetedAnimations;\r\n for (let index = 0; index < targetedAnimations.length; index++) {\r\n const targetedAnimation = targetedAnimations[index];\r\n const animation = targetedAnimation.animation;\r\n const keys = animation.getKeys();\r\n\r\n if (from > keys[0].frame) {\r\n from = keys[0].frame;\r\n }\r\n\r\n if (to < keys[keys.length - 1].frame) {\r\n to = keys[keys.length - 1].frame;\r\n }\r\n }\r\n\r\n animationGroup._from = from;\r\n animationGroup._to = to;\r\n }\r\n\r\n return animationGroup;\r\n }\r\n\r\n /**\r\n * Creates a new animation, keeping only the keys that are inside a given key range\r\n * @param sourceAnimationGroup defines the animation group on which to operate\r\n * @param fromKey defines the lower bound of the range\r\n * @param toKey defines the upper bound of the range\r\n * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned\r\n * @returns a new animation group stripped from all the keys outside the given range\r\n */\r\n public static ClipKeys(sourceAnimationGroup: AnimationGroup, fromKey: number, toKey: number, name?: string, dontCloneAnimations?: boolean): AnimationGroup {\r\n const animationGroup = sourceAnimationGroup.clone(name || sourceAnimationGroup.name);\r\n\r\n return AnimationGroup.ClipKeysInPlace(animationGroup, fromKey, toKey, dontCloneAnimations);\r\n }\r\n\r\n /**\r\n * Updates an existing animation, keeping only the keys that are inside a given key range\r\n * @param animationGroup defines the animation group on which to operate\r\n * @param fromKey defines the lower bound of the range\r\n * @param toKey defines the upper bound of the range\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned\r\n * @returns the animationGroup stripped from all the keys outside the given range\r\n */\r\n public static ClipKeysInPlace(animationGroup: AnimationGroup, fromKey: number, toKey: number, dontCloneAnimations?: boolean): AnimationGroup {\r\n return AnimationGroup.ClipInPlace(animationGroup, fromKey, toKey, dontCloneAnimations, false);\r\n }\r\n\r\n /**\r\n * Creates a new animation, keeping only the frames that are inside a given frame range\r\n * @param sourceAnimationGroup defines the animation group on which to operate\r\n * @param fromFrame defines the lower bound of the range\r\n * @param toFrame defines the upper bound of the range\r\n * @param name defines the name of the new animation group. If not provided, use the same name as animationGroup\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned\r\n * @returns a new animation group stripped from all the frames outside the given range\r\n */\r\n public static ClipFrames(sourceAnimationGroup: AnimationGroup, fromFrame: number, toFrame: number, name?: string, dontCloneAnimations?: boolean): AnimationGroup {\r\n const animationGroup = sourceAnimationGroup.clone(name || sourceAnimationGroup.name);\r\n\r\n return AnimationGroup.ClipFramesInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations);\r\n }\r\n\r\n /**\r\n * Updates an existing animation, keeping only the frames that are inside a given frame range\r\n * @param animationGroup defines the animation group on which to operate\r\n * @param fromFrame defines the lower bound of the range\r\n * @param toFrame defines the upper bound of the range\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the frames. Default is false, so animations will be cloned\r\n * @returns the animationGroup stripped from all the frames outside the given range\r\n */\r\n public static ClipFramesInPlace(animationGroup: AnimationGroup, fromFrame: number, toFrame: number, dontCloneAnimations?: boolean): AnimationGroup {\r\n return AnimationGroup.ClipInPlace(animationGroup, fromFrame, toFrame, dontCloneAnimations, true);\r\n }\r\n\r\n /**\r\n * Updates an existing animation, keeping only the keys that are inside a given key or frame range\r\n * @param animationGroup defines the animation group on which to operate\r\n * @param start defines the lower bound of the range\r\n * @param end defines the upper bound of the range\r\n * @param dontCloneAnimations defines whether or not the animations should be cloned before clipping the keys. Default is false, so animations will be cloned\r\n * @param useFrame defines if the range is defined by frame numbers or key indices (default is false which means use key indices)\r\n * @returns the animationGroup stripped from all the keys outside the given range\r\n */\r\n public static ClipInPlace(animationGroup: AnimationGroup, start: number, end: number, dontCloneAnimations?: boolean, useFrame = false): AnimationGroup {\r\n let from = Number.MAX_VALUE;\r\n let to = -Number.MAX_VALUE;\r\n\r\n const targetedAnimations = animationGroup.targetedAnimations;\r\n for (let index = 0; index < targetedAnimations.length; index++) {\r\n const targetedAnimation = targetedAnimations[index];\r\n const animation = dontCloneAnimations ? targetedAnimation.animation : targetedAnimation.animation.clone();\r\n\r\n if (useFrame) {\r\n // Make sure we have keys corresponding to the bounds of the frame range\r\n animation.createKeyForFrame(start);\r\n animation.createKeyForFrame(end);\r\n }\r\n\r\n const keys = animation.getKeys();\r\n const newKeys: IAnimationKey[] = [];\r\n\r\n let startFrame = Number.MAX_VALUE;\r\n for (let k = 0; k < keys.length; k++) {\r\n const key = keys[k];\r\n if ((!useFrame && k >= start && k <= end) || (useFrame && key.frame >= start && key.frame <= end)) {\r\n const newKey: IAnimationKey = {\r\n frame: key.frame,\r\n value: key.value.clone ? key.value.clone() : key.value,\r\n inTangent: key.inTangent,\r\n outTangent: key.outTangent,\r\n interpolation: key.interpolation,\r\n lockedTangent: key.lockedTangent,\r\n };\r\n if (startFrame === Number.MAX_VALUE) {\r\n startFrame = newKey.frame;\r\n }\r\n newKey.frame -= startFrame;\r\n newKeys.push(newKey);\r\n }\r\n }\r\n\r\n if (newKeys.length === 0) {\r\n targetedAnimations.splice(index, 1);\r\n index--;\r\n continue;\r\n }\r\n\r\n if (from > newKeys[0].frame) {\r\n from = newKeys[0].frame;\r\n }\r\n\r\n if (to < newKeys[newKeys.length - 1].frame) {\r\n to = newKeys[newKeys.length - 1].frame;\r\n }\r\n\r\n animation.setKeys(newKeys, true);\r\n targetedAnimation.animation = animation; // in case the animation has been cloned\r\n }\r\n\r\n animationGroup._from = from;\r\n animationGroup._to = to;\r\n\r\n return animationGroup;\r\n }\r\n\r\n /**\r\n * Returns the string \"AnimationGroup\"\r\n * @returns \"AnimationGroup\"\r\n */\r\n public getClassName(): string {\r\n return \"AnimationGroup\";\r\n }\r\n\r\n /**\r\n * Creates a detailed string about the object\r\n * @param fullDetails defines if the output string will support multiple levels of logging within scene loading\r\n * @returns a string representing the object\r\n */\r\n public toString(fullDetails?: boolean): string {\r\n let ret = \"Name: \" + this.name;\r\n ret += \", type: \" + this.getClassName();\r\n if (fullDetails) {\r\n ret += \", from: \" + this._from;\r\n ret += \", to: \" + this._to;\r\n ret += \", isStarted: \" + this._isStarted;\r\n ret += \", speedRatio: \" + this._speedRatio;\r\n ret += \", targetedAnimations length: \" + this._targetedAnimations.length;\r\n ret += \", animatables length: \" + this._animatables;\r\n }\r\n return ret;\r\n }\r\n}\r\n"]}
@@ -174,11 +174,6 @@ export declare class FramingBehavior implements Behavior<ArcRotateCamera> {
174
174
  * is automatically returned to its default position (expected to be above ground plane).
175
175
  */
176
176
  private _maintainCameraAboveGround;
177
- /**
178
- * Returns the frustum slope based on the canvas ratio and camera FOV
179
- * @returns The frustum slope represented as a Vector2 with X and Y slopes
180
- */
181
- private _getFrustumSlope;
182
177
  /**
183
178
  * Removes all animation locks. Allows new animations to be added to any of the arcCamera properties.
184
179
  */
@@ -2,7 +2,7 @@ import { ExponentialEase, EasingFunction } from "../../Animations/easing.js";
2
2
  import { Observable } from "../../Misc/observable.js";
3
3
  import { PointerEventTypes } from "../../Events/pointerEvents.js";
4
4
  import { PrecisionDate } from "../../Misc/precisionDate.js";
5
- import { Vector3, Vector2 } from "../../Maths/math.vector.js";
5
+ import { Vector3 } from "../../Maths/math.vector.js";
6
6
  import { Animation } from "../../Animations/animation.js";
7
7
  /**
8
8
  * The framing behavior (FramingBehavior) is designed to automatically position an ArcRotateCamera when its target is set to a mesh. It is also useful if you want to prevent the camera to go under a virtual horizontal plane.
@@ -315,21 +315,11 @@ export class FramingBehavior {
315
315
  * to fully enclose the mesh in the viewing frustum.
316
316
  */
317
317
  _calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld) {
318
- const size = maximumWorld.subtract(minimumWorld);
319
- const boxVectorGlobalDiagonal = size.length();
320
- const frustumSlope = this._getFrustumSlope();
321
- // Formula for setting distance
322
- // (Good explanation: http://stackoverflow.com/questions/2866350/move-camera-to-fit-3d-scene)
323
- const radiusWithoutFraming = boxVectorGlobalDiagonal * 0.5;
324
- // Horizon distance
325
- const radius = radiusWithoutFraming * this._radiusScale;
326
- const distanceForHorizontalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlope.x * frustumSlope.x));
327
- const distanceForVerticalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlope.y * frustumSlope.y));
328
- let distance = Math.max(distanceForHorizontalFrustum, distanceForVerticalFrustum);
329
318
  const camera = this._attachedCamera;
330
319
  if (!camera) {
331
320
  return 0;
332
321
  }
322
+ let distance = camera._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld, this._radiusScale);
333
323
  if (camera.lowerRadiusLimit && this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
334
324
  // Don't exceed the requested limit
335
325
  distance = distance < camera.lowerRadiusLimit ? camera.lowerRadiusLimit : distance;
@@ -368,28 +358,6 @@ export class FramingBehavior {
368
358
  }
369
359
  }
370
360
  }
371
- /**
372
- * Returns the frustum slope based on the canvas ratio and camera FOV
373
- * @returns The frustum slope represented as a Vector2 with X and Y slopes
374
- */
375
- _getFrustumSlope() {
376
- // Calculate the viewport ratio
377
- // Aspect Ratio is Height/Width.
378
- const camera = this._attachedCamera;
379
- if (!camera) {
380
- return Vector2.Zero();
381
- }
382
- const engine = camera.getScene().getEngine();
383
- const aspectRatio = engine.getAspectRatio(camera);
384
- // Camera FOV is the vertical field of view (top-bottom) in radians.
385
- // Slope of the frustum top/bottom planes in view space, relative to the forward vector.
386
- const frustumSlopeY = Math.tan(camera.fov / 2);
387
- // Slope of the frustum left/right planes in view space, relative to the forward vector.
388
- // Provides the amount that one side (e.g. left) of the frustum gets wider for every unit
389
- // along the forward vector.
390
- const frustumSlopeX = frustumSlopeY * aspectRatio;
391
- return new Vector2(frustumSlopeX, frustumSlopeY);
392
- }
393
361
  /**
394
362
  * Removes all animation locks. Allows new animations to be added to any of the arcCamera properties.
395
363
  */
@@ -1 +1 @@
1
- {"version":3,"file":"framingBehavior.js","sourceRoot":"","sources":["../../../../../dev/core/src/Behaviors/Cameras/framingBehavior.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,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Ac,GAAG,IAAI,CAAC;gBAC3C,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aAC/B;YACD,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;SAC7B;IACL,CAAC;IAED;;OAEG;IACH,IAAW,cAAc;QACrB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACvB,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,CACH,IAAI,CAAC,eAAe,CAAC,mBAAmB,KAAK,CAAC;YAC9C,IAAI,CAAC,eAAe,CAAC,kBAAkB,KAAK,CAAC;YAC7C,IAAI,CAAC,eAAe,CAAC,oBAAoB,KAAK,CAAC;YAC/C,IAAI,CAAC,eAAe,CAAC,gBAAgB,KAAK,CAAC;YAC3C,IAAI,CAAC,eAAe,CAAC,gBAAgB,KAAK,CAAC;YAC3C,IAAI,CAAC,cAAc,CACtB,CAAC;IACN,CAAC;;AA9fD;;GAEG;AACW,8BAAc,GAAG,IAAI,eAAe,EAAE,AAAxB,CAAyB;AAErD;;GAEG;AACW,0BAAU,GAAG,cAAc,CAAC,oBAAoB,AAAtC,CAAuC;AAwf/D,UAAU;AAEV;;GAEG;AACW,oCAAoB,GAAG,CAAC,AAAJ,CAAK;AAEvC;;GAEG;AACW,mCAAmB,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import type { Behavior } from \"../../Behaviors/behavior\";\r\nimport type { Camera } from \"../../Cameras/camera\";\r\nimport type { ArcRotateCamera } from \"../../Cameras/arcRotateCamera\";\r\nimport { ExponentialEase, EasingFunction } from \"../../Animations/easing\";\r\nimport type { Observer } from \"../../Misc/observable\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { PointerInfoPre } from \"../../Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"../../Events/pointerEvents\";\r\nimport { PrecisionDate } from \"../../Misc/precisionDate\";\r\n\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { Vector3, Vector2 } from \"../../Maths/math.vector\";\r\nimport type { Animatable } from \"../../Animations/animatable\";\r\nimport { Animation } from \"../../Animations/animation\";\r\n\r\n/**\r\n * The framing behavior (FramingBehavior) is designed to automatically position an ArcRotateCamera when its target is set to a mesh. It is also useful if you want to prevent the camera to go under a virtual horizontal plane.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior\r\n */\r\nexport class FramingBehavior implements Behavior<ArcRotateCamera> {\r\n /**\r\n * Gets the name of the behavior.\r\n */\r\n public get name(): string {\r\n return \"Framing\";\r\n }\r\n\r\n /**\r\n * An event triggered when the animation to zoom on target mesh has ended\r\n */\r\n public onTargetFramingAnimationEndObservable = new Observable<void>();\r\n\r\n private _mode = FramingBehavior.FitFrustumSidesMode;\r\n private _radiusScale = 1.0;\r\n private _positionScale = 0.5;\r\n private _defaultElevation = 0.3;\r\n private _elevationReturnTime = 1500;\r\n private _elevationReturnWaitTime = 1000;\r\n private _zoomStopsAnimation = false;\r\n private _framingTime = 1500;\r\n\r\n /**\r\n * The easing function used by animations\r\n */\r\n public static EasingFunction = new ExponentialEase();\r\n\r\n /**\r\n * The easing mode used by animations\r\n */\r\n public static EasingMode = EasingFunction.EASINGMODE_EASEINOUT;\r\n\r\n /**\r\n * Sets the current mode used by the behavior\r\n */\r\n public set mode(mode: number) {\r\n this._mode = mode;\r\n }\r\n\r\n /**\r\n * Gets current mode used by the behavior.\r\n */\r\n public get mode(): number {\r\n return this._mode;\r\n }\r\n\r\n /**\r\n * Sets the scale applied to the radius (1 by default)\r\n */\r\n public set radiusScale(radius: number) {\r\n this._radiusScale = radius;\r\n }\r\n\r\n /**\r\n * Gets the scale applied to the radius\r\n */\r\n public get radiusScale(): number {\r\n return this._radiusScale;\r\n }\r\n\r\n /**\r\n * Sets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.\r\n */\r\n public set positionScale(scale: number) {\r\n this._positionScale = scale;\r\n }\r\n\r\n /**\r\n * Gets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.\r\n */\r\n public get positionScale(): number {\r\n return this._positionScale;\r\n }\r\n\r\n /**\r\n * Sets the angle above/below the horizontal plane to return to when the return to default elevation idle\r\n * behaviour is triggered, in radians.\r\n */\r\n public set defaultElevation(elevation: number) {\r\n this._defaultElevation = elevation;\r\n }\r\n\r\n /**\r\n * Gets the angle above/below the horizontal plane to return to when the return to default elevation idle\r\n * behaviour is triggered, in radians.\r\n */\r\n public get defaultElevation() {\r\n return this._defaultElevation;\r\n }\r\n\r\n /**\r\n * Sets the time (in milliseconds) taken to return to the default beta position.\r\n * Negative value indicates camera should not return to default.\r\n */\r\n public set elevationReturnTime(speed: number) {\r\n this._elevationReturnTime = speed;\r\n }\r\n\r\n /**\r\n * Gets the time (in milliseconds) taken to return to the default beta position.\r\n * Negative value indicates camera should not return to default.\r\n */\r\n public get elevationReturnTime(): number {\r\n return this._elevationReturnTime;\r\n }\r\n\r\n /**\r\n * Sets the delay (in milliseconds) taken before the camera returns to the default beta position.\r\n */\r\n public set elevationReturnWaitTime(time: number) {\r\n this._elevationReturnWaitTime = time;\r\n }\r\n\r\n /**\r\n * Gets the delay (in milliseconds) taken before the camera returns to the default beta position.\r\n */\r\n public get elevationReturnWaitTime(): number {\r\n return this._elevationReturnWaitTime;\r\n }\r\n\r\n /**\r\n * Sets the flag that indicates if user zooming should stop animation.\r\n */\r\n public set zoomStopsAnimation(flag: boolean) {\r\n this._zoomStopsAnimation = flag;\r\n }\r\n\r\n /**\r\n * Gets the flag that indicates if user zooming should stop animation.\r\n */\r\n public get zoomStopsAnimation(): boolean {\r\n return this._zoomStopsAnimation;\r\n }\r\n\r\n /**\r\n * Sets the transition time when framing the mesh, in milliseconds\r\n */\r\n public set framingTime(time: number) {\r\n this._framingTime = time;\r\n }\r\n\r\n /**\r\n * Gets the transition time when framing the mesh, in milliseconds\r\n */\r\n public get framingTime() {\r\n return this._framingTime;\r\n }\r\n\r\n /**\r\n * Define if the behavior should automatically change the configured\r\n * camera limits and sensibilities.\r\n */\r\n public autoCorrectCameraLimitsAndSensibility = true;\r\n\r\n // Default behavior functions\r\n private _onPrePointerObservableObserver: Nullable<Observer<PointerInfoPre>>;\r\n private _onAfterCheckInputsObserver: Nullable<Observer<Camera>>;\r\n private _onMeshTargetChangedObserver: Nullable<Observer<Nullable<AbstractMesh>>>;\r\n private _attachedCamera: Nullable<ArcRotateCamera>;\r\n private _isPointerDown = false;\r\n private _lastInteractionTime = -Infinity;\r\n\r\n /**\r\n * Initializes the behavior.\r\n */\r\n public init(): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * Attaches the behavior to its arc rotate camera.\r\n * @param camera Defines the camera to attach the behavior to\r\n */\r\n public attach(camera: ArcRotateCamera): void {\r\n this._attachedCamera = camera;\r\n const scene = this._attachedCamera.getScene();\r\n\r\n FramingBehavior.EasingFunction.setEasingMode(FramingBehavior.EasingMode);\r\n\r\n this._onPrePointerObservableObserver = scene.onPrePointerObservable.add((pointerInfoPre) => {\r\n if (pointerInfoPre.type === PointerEventTypes.POINTERDOWN) {\r\n this._isPointerDown = true;\r\n return;\r\n }\r\n\r\n if (pointerInfoPre.type === PointerEventTypes.POINTERUP) {\r\n this._isPointerDown = false;\r\n }\r\n });\r\n\r\n this._onMeshTargetChangedObserver = camera.onMeshTargetChangedObservable.add((mesh) => {\r\n if (mesh) {\r\n this.zoomOnMesh(mesh, undefined, () => {\r\n this.onTargetFramingAnimationEndObservable.notifyObservers();\r\n });\r\n }\r\n });\r\n\r\n this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {\r\n // Stop the animation if there is user interaction and the animation should stop for this interaction\r\n this._applyUserInteraction();\r\n\r\n // Maintain the camera above the ground. If the user pulls the camera beneath the ground plane, lift it\r\n // back to the default position after a given timeout\r\n this._maintainCameraAboveGround();\r\n });\r\n }\r\n\r\n /**\r\n * Detaches the behavior from its current arc rotate camera.\r\n */\r\n public detach(): void {\r\n if (!this._attachedCamera) {\r\n return;\r\n }\r\n\r\n const scene = this._attachedCamera.getScene();\r\n\r\n if (this._onPrePointerObservableObserver) {\r\n scene.onPrePointerObservable.remove(this._onPrePointerObservableObserver);\r\n }\r\n\r\n if (this._onAfterCheckInputsObserver) {\r\n this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver);\r\n }\r\n\r\n if (this._onMeshTargetChangedObserver) {\r\n this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver);\r\n }\r\n\r\n this._attachedCamera = null;\r\n }\r\n\r\n // Framing control\r\n private _animatables = new Array<Animatable>();\r\n private _betaIsAnimating = false;\r\n private _betaTransition: Animation;\r\n private _radiusTransition: Animation;\r\n private _vectorTransition: Animation;\r\n\r\n /**\r\n * Targets the given mesh and updates zoom level accordingly.\r\n * @param mesh The mesh to target.\r\n * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh\r\n * @param onAnimationEnd Callback triggered at the end of the framing animation\r\n */\r\n public zoomOnMesh(mesh: AbstractMesh, focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): void {\r\n mesh.computeWorldMatrix(true);\r\n\r\n const boundingBox = mesh.getBoundingInfo().boundingBox;\r\n this.zoomOnBoundingInfo(boundingBox.minimumWorld, boundingBox.maximumWorld, focusOnOriginXZ, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Targets the given mesh with its children and updates zoom level accordingly.\r\n * @param mesh The mesh to target.\r\n * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh\r\n * @param onAnimationEnd Callback triggered at the end of the framing animation\r\n */\r\n public zoomOnMeshHierarchy(mesh: AbstractMesh, focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): void {\r\n mesh.computeWorldMatrix(true);\r\n\r\n const boundingBox = mesh.getHierarchyBoundingVectors(true);\r\n this.zoomOnBoundingInfo(boundingBox.min, boundingBox.max, focusOnOriginXZ, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Targets the given meshes with their children and updates zoom level accordingly.\r\n * @param meshes The mesh to target.\r\n * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh\r\n * @param onAnimationEnd Callback triggered at the end of the framing animation\r\n */\r\n public zoomOnMeshesHierarchy(meshes: AbstractMesh[], focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): void {\r\n const min = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n const max = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\r\n\r\n for (let i = 0; i < meshes.length; i++) {\r\n const boundingInfo = meshes[i].getHierarchyBoundingVectors(true);\r\n Vector3.CheckExtends(boundingInfo.min, min, max);\r\n Vector3.CheckExtends(boundingInfo.max, min, max);\r\n }\r\n\r\n this.zoomOnBoundingInfo(min, max, focusOnOriginXZ, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Targets the bounding box info defined by its extends and updates zoom level accordingly.\r\n * @param minimumWorld Determines the smaller position of the bounding box extend\r\n * @param maximumWorld Determines the bigger position of the bounding box extend\r\n * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh\r\n * @param onAnimationEnd Callback triggered at the end of the framing animation\r\n * @returns true if the zoom was done\r\n */\r\n public zoomOnBoundingInfo(minimumWorld: Vector3, maximumWorld: Vector3, focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): boolean {\r\n let zoomTarget: Vector3;\r\n\r\n if (!this._attachedCamera) {\r\n return false;\r\n }\r\n\r\n // Find target by interpolating from bottom of bounding box in world-space to top via framingPositionY\r\n const bottom = minimumWorld.y;\r\n const top = maximumWorld.y;\r\n const zoomTargetY = bottom + (top - bottom) * this._positionScale;\r\n const radiusWorld = maximumWorld.subtract(minimumWorld).scale(0.5);\r\n\r\n if (focusOnOriginXZ) {\r\n zoomTarget = new Vector3(0, zoomTargetY, 0);\r\n } else {\r\n const centerWorld = minimumWorld.add(radiusWorld);\r\n zoomTarget = new Vector3(centerWorld.x, zoomTargetY, centerWorld.z);\r\n }\r\n\r\n if (!this._vectorTransition) {\r\n this._vectorTransition = Animation.CreateAnimation(\"target\", Animation.ANIMATIONTYPE_VECTOR3, 60, FramingBehavior.EasingFunction);\r\n }\r\n\r\n this._betaIsAnimating = true;\r\n let animatable = Animation.TransitionTo(\"target\", zoomTarget, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime);\r\n if (animatable) {\r\n this._animatables.push(animatable);\r\n }\r\n\r\n // sets the radius and lower radius bounds\r\n // Small delta ensures camera is not always at lower zoom limit.\r\n let radius = 0;\r\n if (this._mode === FramingBehavior.FitFrustumSidesMode) {\r\n const position = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld);\r\n if (this.autoCorrectCameraLimitsAndSensibility) {\r\n this._attachedCamera.lowerRadiusLimit = radiusWorld.length() + this._attachedCamera.minZ;\r\n }\r\n radius = position;\r\n } else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {\r\n radius = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld);\r\n if (this.autoCorrectCameraLimitsAndSensibility && this._attachedCamera.lowerRadiusLimit === null) {\r\n this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ;\r\n }\r\n }\r\n\r\n // Set sensibilities\r\n if (this.autoCorrectCameraLimitsAndSensibility) {\r\n const extend = maximumWorld.subtract(minimumWorld).length();\r\n this._attachedCamera.panningSensibility = 5000 / extend;\r\n this._attachedCamera.wheelPrecision = 100 / radius;\r\n }\r\n\r\n // transition to new radius\r\n if (!this._radiusTransition) {\r\n this._radiusTransition = Animation.CreateAnimation(\"radius\", Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);\r\n }\r\n\r\n animatable = Animation.TransitionTo(\"radius\", radius, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusTransition, this._framingTime, () => {\r\n this.stopAllAnimations();\r\n if (onAnimationEnd) {\r\n onAnimationEnd();\r\n }\r\n\r\n if (this._attachedCamera && this._attachedCamera.useInputToRestoreState) {\r\n this._attachedCamera.storeState();\r\n }\r\n });\r\n\r\n if (animatable) {\r\n this._animatables.push(animatable);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Calculates the lowest radius for the camera based on the bounding box of the mesh.\r\n * @param minimumWorld\r\n * @param maximumWorld\r\n * @returns The minimum distance from the primary mesh's center point at which the camera must be kept in order\r\n *\t\t to fully enclose the mesh in the viewing frustum.\r\n */\r\n protected _calculateLowerRadiusFromModelBoundingSphere(minimumWorld: Vector3, maximumWorld: Vector3): number {\r\n const size = maximumWorld.subtract(minimumWorld);\r\n const boxVectorGlobalDiagonal = size.length();\r\n const frustumSlope: Vector2 = this._getFrustumSlope();\r\n\r\n // Formula for setting distance\r\n // (Good explanation: http://stackoverflow.com/questions/2866350/move-camera-to-fit-3d-scene)\r\n const radiusWithoutFraming = boxVectorGlobalDiagonal * 0.5;\r\n\r\n // Horizon distance\r\n const radius = radiusWithoutFraming * this._radiusScale;\r\n const distanceForHorizontalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlope.x * frustumSlope.x));\r\n const distanceForVerticalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlope.y * frustumSlope.y));\r\n let distance = Math.max(distanceForHorizontalFrustum, distanceForVerticalFrustum);\r\n const camera = this._attachedCamera;\r\n\r\n if (!camera) {\r\n return 0;\r\n }\r\n\r\n if (camera.lowerRadiusLimit && this._mode === FramingBehavior.IgnoreBoundsSizeMode) {\r\n // Don't exceed the requested limit\r\n distance = distance < camera.lowerRadiusLimit ? camera.lowerRadiusLimit : distance;\r\n }\r\n\r\n // Don't exceed the upper radius limit\r\n if (camera.upperRadiusLimit) {\r\n distance = distance > camera.upperRadiusLimit ? camera.upperRadiusLimit : distance;\r\n }\r\n\r\n return distance;\r\n }\r\n\r\n /**\r\n * Keeps the camera above the ground plane. If the user pulls the camera below the ground plane, the camera\r\n * is automatically returned to its default position (expected to be above ground plane).\r\n */\r\n private _maintainCameraAboveGround(): void {\r\n if (this._elevationReturnTime < 0) {\r\n return;\r\n }\r\n\r\n const timeSinceInteraction = PrecisionDate.Now - this._lastInteractionTime;\r\n const defaultBeta = Math.PI * 0.5 - this._defaultElevation;\r\n const limitBeta = Math.PI * 0.5;\r\n\r\n // Bring the camera back up if below the ground plane\r\n if (this._attachedCamera && !this._betaIsAnimating && this._attachedCamera.beta > limitBeta && timeSinceInteraction >= this._elevationReturnWaitTime) {\r\n this._betaIsAnimating = true;\r\n\r\n //Transition to new position\r\n this.stopAllAnimations();\r\n\r\n if (!this._betaTransition) {\r\n this._betaTransition = Animation.CreateAnimation(\"beta\", Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);\r\n }\r\n\r\n const animatabe = Animation.TransitionTo(\r\n \"beta\",\r\n defaultBeta,\r\n this._attachedCamera,\r\n this._attachedCamera.getScene(),\r\n 60,\r\n this._betaTransition,\r\n this._elevationReturnTime,\r\n () => {\r\n this._clearAnimationLocks();\r\n this.stopAllAnimations();\r\n }\r\n );\r\n\r\n if (animatabe) {\r\n this._animatables.push(animatabe);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns the frustum slope based on the canvas ratio and camera FOV\r\n * @returns The frustum slope represented as a Vector2 with X and Y slopes\r\n */\r\n private _getFrustumSlope(): Vector2 {\r\n // Calculate the viewport ratio\r\n // Aspect Ratio is Height/Width.\r\n const camera = this._attachedCamera;\r\n\r\n if (!camera) {\r\n return Vector2.Zero();\r\n }\r\n\r\n const engine = camera.getScene().getEngine();\r\n const aspectRatio = engine.getAspectRatio(camera);\r\n\r\n // Camera FOV is the vertical field of view (top-bottom) in radians.\r\n // Slope of the frustum top/bottom planes in view space, relative to the forward vector.\r\n const frustumSlopeY = Math.tan(camera.fov / 2);\r\n\r\n // Slope of the frustum left/right planes in view space, relative to the forward vector.\r\n // Provides the amount that one side (e.g. left) of the frustum gets wider for every unit\r\n // along the forward vector.\r\n const frustumSlopeX = frustumSlopeY * aspectRatio;\r\n\r\n return new Vector2(frustumSlopeX, frustumSlopeY);\r\n }\r\n\r\n /**\r\n * Removes all animation locks. Allows new animations to be added to any of the arcCamera properties.\r\n */\r\n private _clearAnimationLocks(): void {\r\n this._betaIsAnimating = false;\r\n }\r\n\r\n /**\r\n * Applies any current user interaction to the camera. Takes into account maximum alpha rotation.\r\n */\r\n private _applyUserInteraction(): void {\r\n if (this.isUserIsMoving) {\r\n this._lastInteractionTime = PrecisionDate.Now;\r\n this.stopAllAnimations();\r\n this._clearAnimationLocks();\r\n }\r\n }\r\n\r\n /**\r\n * Stops and removes all animations that have been applied to the camera\r\n */\r\n public stopAllAnimations(): void {\r\n if (this._attachedCamera) {\r\n this._attachedCamera.animations = [];\r\n }\r\n\r\n while (this._animatables.length) {\r\n if (this._animatables[0]) {\r\n this._animatables[0].onAnimationEnd = null;\r\n this._animatables[0].stop();\r\n }\r\n this._animatables.shift();\r\n }\r\n }\r\n\r\n /**\r\n * Gets a value indicating if the user is moving the camera\r\n */\r\n public get isUserIsMoving(): boolean {\r\n if (!this._attachedCamera) {\r\n return false;\r\n }\r\n\r\n return (\r\n this._attachedCamera.inertialAlphaOffset !== 0 ||\r\n this._attachedCamera.inertialBetaOffset !== 0 ||\r\n this._attachedCamera.inertialRadiusOffset !== 0 ||\r\n this._attachedCamera.inertialPanningX !== 0 ||\r\n this._attachedCamera.inertialPanningY !== 0 ||\r\n this._isPointerDown\r\n );\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * The camera can move all the way towards the mesh.\r\n */\r\n public static IgnoreBoundsSizeMode = 0;\r\n\r\n /**\r\n * The camera is not allowed to zoom closer to the mesh than the point at which the adjusted bounding sphere touches the frustum sides\r\n */\r\n public static FitFrustumSidesMode = 1;\r\n}\r\n"]}
1
+ {"version":3,"file":"framingBehavior.js","sourceRoot":"","sources":["../../../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Ae,CAAC,UAAU,GAAG,EAAE,CAAC;SACxC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YAC7B,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;gBACtB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC;gBAC3C,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aAC/B;YACD,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;SAC7B;IACL,CAAC;IAED;;OAEG;IACH,IAAW,cAAc;QACrB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACvB,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,CACH,IAAI,CAAC,eAAe,CAAC,mBAAmB,KAAK,CAAC;YAC9C,IAAI,CAAC,eAAe,CAAC,kBAAkB,KAAK,CAAC;YAC7C,IAAI,CAAC,eAAe,CAAC,oBAAoB,KAAK,CAAC;YAC/C,IAAI,CAAC,eAAe,CAAC,gBAAgB,KAAK,CAAC;YAC3C,IAAI,CAAC,eAAe,CAAC,gBAAgB,KAAK,CAAC;YAC3C,IAAI,CAAC,cAAc,CACtB,CAAC;IACN,CAAC;;AAtdD;;GAEG;AACW,8BAAc,GAAG,IAAI,eAAe,EAAE,AAAxB,CAAyB;AAErD;;GAEG;AACW,0BAAU,GAAG,cAAc,CAAC,oBAAoB,AAAtC,CAAuC;AAgd/D,UAAU;AAEV;;GAEG;AACW,oCAAoB,GAAG,CAAC,AAAJ,CAAK;AAEvC;;GAEG;AACW,mCAAmB,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import type { Behavior } from \"../../Behaviors/behavior\";\r\nimport type { Camera } from \"../../Cameras/camera\";\r\nimport type { ArcRotateCamera } from \"../../Cameras/arcRotateCamera\";\r\nimport { ExponentialEase, EasingFunction } from \"../../Animations/easing\";\r\nimport type { Observer } from \"../../Misc/observable\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { PointerInfoPre } from \"../../Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"../../Events/pointerEvents\";\r\nimport { PrecisionDate } from \"../../Misc/precisionDate\";\r\n\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { Animatable } from \"../../Animations/animatable\";\r\nimport { Animation } from \"../../Animations/animation\";\r\n\r\n/**\r\n * The framing behavior (FramingBehavior) is designed to automatically position an ArcRotateCamera when its target is set to a mesh. It is also useful if you want to prevent the camera to go under a virtual horizontal plane.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior\r\n */\r\nexport class FramingBehavior implements Behavior<ArcRotateCamera> {\r\n /**\r\n * Gets the name of the behavior.\r\n */\r\n public get name(): string {\r\n return \"Framing\";\r\n }\r\n\r\n /**\r\n * An event triggered when the animation to zoom on target mesh has ended\r\n */\r\n public onTargetFramingAnimationEndObservable = new Observable<void>();\r\n\r\n private _mode = FramingBehavior.FitFrustumSidesMode;\r\n private _radiusScale = 1.0;\r\n private _positionScale = 0.5;\r\n private _defaultElevation = 0.3;\r\n private _elevationReturnTime = 1500;\r\n private _elevationReturnWaitTime = 1000;\r\n private _zoomStopsAnimation = false;\r\n private _framingTime = 1500;\r\n\r\n /**\r\n * The easing function used by animations\r\n */\r\n public static EasingFunction = new ExponentialEase();\r\n\r\n /**\r\n * The easing mode used by animations\r\n */\r\n public static EasingMode = EasingFunction.EASINGMODE_EASEINOUT;\r\n\r\n /**\r\n * Sets the current mode used by the behavior\r\n */\r\n public set mode(mode: number) {\r\n this._mode = mode;\r\n }\r\n\r\n /**\r\n * Gets current mode used by the behavior.\r\n */\r\n public get mode(): number {\r\n return this._mode;\r\n }\r\n\r\n /**\r\n * Sets the scale applied to the radius (1 by default)\r\n */\r\n public set radiusScale(radius: number) {\r\n this._radiusScale = radius;\r\n }\r\n\r\n /**\r\n * Gets the scale applied to the radius\r\n */\r\n public get radiusScale(): number {\r\n return this._radiusScale;\r\n }\r\n\r\n /**\r\n * Sets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.\r\n */\r\n public set positionScale(scale: number) {\r\n this._positionScale = scale;\r\n }\r\n\r\n /**\r\n * Gets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.\r\n */\r\n public get positionScale(): number {\r\n return this._positionScale;\r\n }\r\n\r\n /**\r\n * Sets the angle above/below the horizontal plane to return to when the return to default elevation idle\r\n * behaviour is triggered, in radians.\r\n */\r\n public set defaultElevation(elevation: number) {\r\n this._defaultElevation = elevation;\r\n }\r\n\r\n /**\r\n * Gets the angle above/below the horizontal plane to return to when the return to default elevation idle\r\n * behaviour is triggered, in radians.\r\n */\r\n public get defaultElevation() {\r\n return this._defaultElevation;\r\n }\r\n\r\n /**\r\n * Sets the time (in milliseconds) taken to return to the default beta position.\r\n * Negative value indicates camera should not return to default.\r\n */\r\n public set elevationReturnTime(speed: number) {\r\n this._elevationReturnTime = speed;\r\n }\r\n\r\n /**\r\n * Gets the time (in milliseconds) taken to return to the default beta position.\r\n * Negative value indicates camera should not return to default.\r\n */\r\n public get elevationReturnTime(): number {\r\n return this._elevationReturnTime;\r\n }\r\n\r\n /**\r\n * Sets the delay (in milliseconds) taken before the camera returns to the default beta position.\r\n */\r\n public set elevationReturnWaitTime(time: number) {\r\n this._elevationReturnWaitTime = time;\r\n }\r\n\r\n /**\r\n * Gets the delay (in milliseconds) taken before the camera returns to the default beta position.\r\n */\r\n public get elevationReturnWaitTime(): number {\r\n return this._elevationReturnWaitTime;\r\n }\r\n\r\n /**\r\n * Sets the flag that indicates if user zooming should stop animation.\r\n */\r\n public set zoomStopsAnimation(flag: boolean) {\r\n this._zoomStopsAnimation = flag;\r\n }\r\n\r\n /**\r\n * Gets the flag that indicates if user zooming should stop animation.\r\n */\r\n public get zoomStopsAnimation(): boolean {\r\n return this._zoomStopsAnimation;\r\n }\r\n\r\n /**\r\n * Sets the transition time when framing the mesh, in milliseconds\r\n */\r\n public set framingTime(time: number) {\r\n this._framingTime = time;\r\n }\r\n\r\n /**\r\n * Gets the transition time when framing the mesh, in milliseconds\r\n */\r\n public get framingTime() {\r\n return this._framingTime;\r\n }\r\n\r\n /**\r\n * Define if the behavior should automatically change the configured\r\n * camera limits and sensibilities.\r\n */\r\n public autoCorrectCameraLimitsAndSensibility = true;\r\n\r\n // Default behavior functions\r\n private _onPrePointerObservableObserver: Nullable<Observer<PointerInfoPre>>;\r\n private _onAfterCheckInputsObserver: Nullable<Observer<Camera>>;\r\n private _onMeshTargetChangedObserver: Nullable<Observer<Nullable<AbstractMesh>>>;\r\n private _attachedCamera: Nullable<ArcRotateCamera>;\r\n private _isPointerDown = false;\r\n private _lastInteractionTime = -Infinity;\r\n\r\n /**\r\n * Initializes the behavior.\r\n */\r\n public init(): void {\r\n // Do nothing\r\n }\r\n\r\n /**\r\n * Attaches the behavior to its arc rotate camera.\r\n * @param camera Defines the camera to attach the behavior to\r\n */\r\n public attach(camera: ArcRotateCamera): void {\r\n this._attachedCamera = camera;\r\n const scene = this._attachedCamera.getScene();\r\n\r\n FramingBehavior.EasingFunction.setEasingMode(FramingBehavior.EasingMode);\r\n\r\n this._onPrePointerObservableObserver = scene.onPrePointerObservable.add((pointerInfoPre) => {\r\n if (pointerInfoPre.type === PointerEventTypes.POINTERDOWN) {\r\n this._isPointerDown = true;\r\n return;\r\n }\r\n\r\n if (pointerInfoPre.type === PointerEventTypes.POINTERUP) {\r\n this._isPointerDown = false;\r\n }\r\n });\r\n\r\n this._onMeshTargetChangedObserver = camera.onMeshTargetChangedObservable.add((mesh) => {\r\n if (mesh) {\r\n this.zoomOnMesh(mesh, undefined, () => {\r\n this.onTargetFramingAnimationEndObservable.notifyObservers();\r\n });\r\n }\r\n });\r\n\r\n this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(() => {\r\n // Stop the animation if there is user interaction and the animation should stop for this interaction\r\n this._applyUserInteraction();\r\n\r\n // Maintain the camera above the ground. If the user pulls the camera beneath the ground plane, lift it\r\n // back to the default position after a given timeout\r\n this._maintainCameraAboveGround();\r\n });\r\n }\r\n\r\n /**\r\n * Detaches the behavior from its current arc rotate camera.\r\n */\r\n public detach(): void {\r\n if (!this._attachedCamera) {\r\n return;\r\n }\r\n\r\n const scene = this._attachedCamera.getScene();\r\n\r\n if (this._onPrePointerObservableObserver) {\r\n scene.onPrePointerObservable.remove(this._onPrePointerObservableObserver);\r\n }\r\n\r\n if (this._onAfterCheckInputsObserver) {\r\n this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver);\r\n }\r\n\r\n if (this._onMeshTargetChangedObserver) {\r\n this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver);\r\n }\r\n\r\n this._attachedCamera = null;\r\n }\r\n\r\n // Framing control\r\n private _animatables = new Array<Animatable>();\r\n private _betaIsAnimating = false;\r\n private _betaTransition: Animation;\r\n private _radiusTransition: Animation;\r\n private _vectorTransition: Animation;\r\n\r\n /**\r\n * Targets the given mesh and updates zoom level accordingly.\r\n * @param mesh The mesh to target.\r\n * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh\r\n * @param onAnimationEnd Callback triggered at the end of the framing animation\r\n */\r\n public zoomOnMesh(mesh: AbstractMesh, focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): void {\r\n mesh.computeWorldMatrix(true);\r\n\r\n const boundingBox = mesh.getBoundingInfo().boundingBox;\r\n this.zoomOnBoundingInfo(boundingBox.minimumWorld, boundingBox.maximumWorld, focusOnOriginXZ, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Targets the given mesh with its children and updates zoom level accordingly.\r\n * @param mesh The mesh to target.\r\n * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh\r\n * @param onAnimationEnd Callback triggered at the end of the framing animation\r\n */\r\n public zoomOnMeshHierarchy(mesh: AbstractMesh, focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): void {\r\n mesh.computeWorldMatrix(true);\r\n\r\n const boundingBox = mesh.getHierarchyBoundingVectors(true);\r\n this.zoomOnBoundingInfo(boundingBox.min, boundingBox.max, focusOnOriginXZ, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Targets the given meshes with their children and updates zoom level accordingly.\r\n * @param meshes The mesh to target.\r\n * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh\r\n * @param onAnimationEnd Callback triggered at the end of the framing animation\r\n */\r\n public zoomOnMeshesHierarchy(meshes: AbstractMesh[], focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): void {\r\n const min = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n const max = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\r\n\r\n for (let i = 0; i < meshes.length; i++) {\r\n const boundingInfo = meshes[i].getHierarchyBoundingVectors(true);\r\n Vector3.CheckExtends(boundingInfo.min, min, max);\r\n Vector3.CheckExtends(boundingInfo.max, min, max);\r\n }\r\n\r\n this.zoomOnBoundingInfo(min, max, focusOnOriginXZ, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Targets the bounding box info defined by its extends and updates zoom level accordingly.\r\n * @param minimumWorld Determines the smaller position of the bounding box extend\r\n * @param maximumWorld Determines the bigger position of the bounding box extend\r\n * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh\r\n * @param onAnimationEnd Callback triggered at the end of the framing animation\r\n * @returns true if the zoom was done\r\n */\r\n public zoomOnBoundingInfo(minimumWorld: Vector3, maximumWorld: Vector3, focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): boolean {\r\n let zoomTarget: Vector3;\r\n\r\n if (!this._attachedCamera) {\r\n return false;\r\n }\r\n\r\n // Find target by interpolating from bottom of bounding box in world-space to top via framingPositionY\r\n const bottom = minimumWorld.y;\r\n const top = maximumWorld.y;\r\n const zoomTargetY = bottom + (top - bottom) * this._positionScale;\r\n const radiusWorld = maximumWorld.subtract(minimumWorld).scale(0.5);\r\n\r\n if (focusOnOriginXZ) {\r\n zoomTarget = new Vector3(0, zoomTargetY, 0);\r\n } else {\r\n const centerWorld = minimumWorld.add(radiusWorld);\r\n zoomTarget = new Vector3(centerWorld.x, zoomTargetY, centerWorld.z);\r\n }\r\n\r\n if (!this._vectorTransition) {\r\n this._vectorTransition = Animation.CreateAnimation(\"target\", Animation.ANIMATIONTYPE_VECTOR3, 60, FramingBehavior.EasingFunction);\r\n }\r\n\r\n this._betaIsAnimating = true;\r\n let animatable = Animation.TransitionTo(\"target\", zoomTarget, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime);\r\n if (animatable) {\r\n this._animatables.push(animatable);\r\n }\r\n\r\n // sets the radius and lower radius bounds\r\n // Small delta ensures camera is not always at lower zoom limit.\r\n let radius = 0;\r\n if (this._mode === FramingBehavior.FitFrustumSidesMode) {\r\n const position = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld);\r\n if (this.autoCorrectCameraLimitsAndSensibility) {\r\n this._attachedCamera.lowerRadiusLimit = radiusWorld.length() + this._attachedCamera.minZ;\r\n }\r\n radius = position;\r\n } else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {\r\n radius = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld);\r\n if (this.autoCorrectCameraLimitsAndSensibility && this._attachedCamera.lowerRadiusLimit === null) {\r\n this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ;\r\n }\r\n }\r\n\r\n // Set sensibilities\r\n if (this.autoCorrectCameraLimitsAndSensibility) {\r\n const extend = maximumWorld.subtract(minimumWorld).length();\r\n this._attachedCamera.panningSensibility = 5000 / extend;\r\n this._attachedCamera.wheelPrecision = 100 / radius;\r\n }\r\n\r\n // transition to new radius\r\n if (!this._radiusTransition) {\r\n this._radiusTransition = Animation.CreateAnimation(\"radius\", Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);\r\n }\r\n\r\n animatable = Animation.TransitionTo(\"radius\", radius, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusTransition, this._framingTime, () => {\r\n this.stopAllAnimations();\r\n if (onAnimationEnd) {\r\n onAnimationEnd();\r\n }\r\n\r\n if (this._attachedCamera && this._attachedCamera.useInputToRestoreState) {\r\n this._attachedCamera.storeState();\r\n }\r\n });\r\n\r\n if (animatable) {\r\n this._animatables.push(animatable);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Calculates the lowest radius for the camera based on the bounding box of the mesh.\r\n * @param minimumWorld\r\n * @param maximumWorld\r\n * @returns The minimum distance from the primary mesh's center point at which the camera must be kept in order\r\n *\t\t to fully enclose the mesh in the viewing frustum.\r\n */\r\n protected _calculateLowerRadiusFromModelBoundingSphere(minimumWorld: Vector3, maximumWorld: Vector3): number {\r\n const camera = this._attachedCamera;\r\n\r\n if (!camera) {\r\n return 0;\r\n }\r\n\r\n let distance = camera._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld, this._radiusScale);\r\n if (camera.lowerRadiusLimit && this._mode === FramingBehavior.IgnoreBoundsSizeMode) {\r\n // Don't exceed the requested limit\r\n distance = distance < camera.lowerRadiusLimit ? camera.lowerRadiusLimit : distance;\r\n }\r\n\r\n // Don't exceed the upper radius limit\r\n if (camera.upperRadiusLimit) {\r\n distance = distance > camera.upperRadiusLimit ? camera.upperRadiusLimit : distance;\r\n }\r\n\r\n return distance;\r\n }\r\n\r\n /**\r\n * Keeps the camera above the ground plane. If the user pulls the camera below the ground plane, the camera\r\n * is automatically returned to its default position (expected to be above ground plane).\r\n */\r\n private _maintainCameraAboveGround(): void {\r\n if (this._elevationReturnTime < 0) {\r\n return;\r\n }\r\n\r\n const timeSinceInteraction = PrecisionDate.Now - this._lastInteractionTime;\r\n const defaultBeta = Math.PI * 0.5 - this._defaultElevation;\r\n const limitBeta = Math.PI * 0.5;\r\n\r\n // Bring the camera back up if below the ground plane\r\n if (this._attachedCamera && !this._betaIsAnimating && this._attachedCamera.beta > limitBeta && timeSinceInteraction >= this._elevationReturnWaitTime) {\r\n this._betaIsAnimating = true;\r\n\r\n //Transition to new position\r\n this.stopAllAnimations();\r\n\r\n if (!this._betaTransition) {\r\n this._betaTransition = Animation.CreateAnimation(\"beta\", Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);\r\n }\r\n\r\n const animatabe = Animation.TransitionTo(\r\n \"beta\",\r\n defaultBeta,\r\n this._attachedCamera,\r\n this._attachedCamera.getScene(),\r\n 60,\r\n this._betaTransition,\r\n this._elevationReturnTime,\r\n () => {\r\n this._clearAnimationLocks();\r\n this.stopAllAnimations();\r\n }\r\n );\r\n\r\n if (animatabe) {\r\n this._animatables.push(animatabe);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Removes all animation locks. Allows new animations to be added to any of the arcCamera properties.\r\n */\r\n private _clearAnimationLocks(): void {\r\n this._betaIsAnimating = false;\r\n }\r\n\r\n /**\r\n * Applies any current user interaction to the camera. Takes into account maximum alpha rotation.\r\n */\r\n private _applyUserInteraction(): void {\r\n if (this.isUserIsMoving) {\r\n this._lastInteractionTime = PrecisionDate.Now;\r\n this.stopAllAnimations();\r\n this._clearAnimationLocks();\r\n }\r\n }\r\n\r\n /**\r\n * Stops and removes all animations that have been applied to the camera\r\n */\r\n public stopAllAnimations(): void {\r\n if (this._attachedCamera) {\r\n this._attachedCamera.animations = [];\r\n }\r\n\r\n while (this._animatables.length) {\r\n if (this._animatables[0]) {\r\n this._animatables[0].onAnimationEnd = null;\r\n this._animatables[0].stop();\r\n }\r\n this._animatables.shift();\r\n }\r\n }\r\n\r\n /**\r\n * Gets a value indicating if the user is moving the camera\r\n */\r\n public get isUserIsMoving(): boolean {\r\n if (!this._attachedCamera) {\r\n return false;\r\n }\r\n\r\n return (\r\n this._attachedCamera.inertialAlphaOffset !== 0 ||\r\n this._attachedCamera.inertialBetaOffset !== 0 ||\r\n this._attachedCamera.inertialRadiusOffset !== 0 ||\r\n this._attachedCamera.inertialPanningX !== 0 ||\r\n this._attachedCamera.inertialPanningY !== 0 ||\r\n this._isPointerDown\r\n );\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * The camera can move all the way towards the mesh.\r\n */\r\n public static IgnoreBoundsSizeMode = 0;\r\n\r\n /**\r\n * The camera is not allowed to zoom closer to the mesh than the point at which the adjusted bounding sphere touches the frustum sides\r\n */\r\n public static FitFrustumSidesMode = 1;\r\n}\r\n"]}