@babylonjs/core 5.22.1 → 5.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/Actions/abstractActionManager.d.ts +6 -6
  2. package/Actions/abstractActionManager.js +1 -1
  3. package/Actions/abstractActionManager.js.map +1 -1
  4. package/Actions/actionManager.d.ts +5 -5
  5. package/Actions/actionManager.js +5 -5
  6. package/Actions/actionManager.js.map +1 -1
  7. package/Animations/animatable.js +2 -1
  8. package/Animations/animatable.js.map +1 -1
  9. package/Animations/animation.js +137 -139
  10. package/Animations/animation.js.map +1 -1
  11. package/Animations/animationGroup.d.ts +3 -3
  12. package/Animations/animationGroup.js +3 -3
  13. package/Animations/animationGroup.js.map +1 -1
  14. package/Animations/runtimeAnimation.js +6 -7
  15. package/Animations/runtimeAnimation.js.map +1 -1
  16. package/Audio/audioSceneComponent.d.ts +1 -1
  17. package/Audio/audioSceneComponent.js.map +1 -1
  18. package/Audio/sound.d.ts +2 -1
  19. package/Audio/sound.js +21 -9
  20. package/Audio/sound.js.map +1 -1
  21. package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
  22. package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
  23. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  24. package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
  25. package/Behaviors/Cameras/bouncingBehavior.js +1 -1
  26. package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
  27. package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
  28. package/Behaviors/Cameras/framingBehavior.js +1 -1
  29. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  30. package/Bones/bone.d.ts +1 -1
  31. package/Bones/bone.js +1 -1
  32. package/Bones/bone.js.map +1 -1
  33. package/Bones/skeleton.d.ts +2 -2
  34. package/Bones/skeleton.js +11 -5
  35. package/Bones/skeleton.js.map +1 -1
  36. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +3 -22
  37. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  38. package/Cameras/Inputs/BaseCameraPointersInput.js +3 -3
  39. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  40. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +1 -11
  41. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  42. package/Cameras/Inputs/flyCameraMouseInput.js +3 -3
  43. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  44. package/Cameras/Inputs/followCameraMouseWheelInput.js +1 -4
  45. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  46. package/Cameras/Inputs/freeCameraMouseInput.js +3 -3
  47. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  48. package/Cameras/arcRotateCamera.d.ts +1 -1
  49. package/Cameras/arcRotateCamera.js +1 -1
  50. package/Cameras/arcRotateCamera.js.map +1 -1
  51. package/Cameras/camera.d.ts +2 -2
  52. package/Cameras/camera.js +2 -2
  53. package/Cameras/camera.js.map +1 -1
  54. package/Cameras/freeCamera.d.ts +1 -1
  55. package/Cameras/freeCamera.js +1 -1
  56. package/Cameras/freeCamera.js.map +1 -1
  57. package/Cameras/gamepadCamera.d.ts +1 -1
  58. package/Cameras/gamepadCamera.js +1 -1
  59. package/Cameras/gamepadCamera.js.map +1 -1
  60. package/Cameras/targetCamera.d.ts +1 -1
  61. package/Cameras/targetCamera.js +1 -1
  62. package/Cameras/targetCamera.js.map +1 -1
  63. package/Cameras/touchCamera.d.ts +1 -1
  64. package/Cameras/touchCamera.js +1 -1
  65. package/Cameras/touchCamera.js.map +1 -1
  66. package/Cameras/universalCamera.d.ts +1 -1
  67. package/Cameras/universalCamera.js +1 -1
  68. package/Cameras/universalCamera.js.map +1 -1
  69. package/Cameras/virtualJoysticksCamera.d.ts +1 -1
  70. package/Cameras/virtualJoysticksCamera.js +1 -1
  71. package/Cameras/virtualJoysticksCamera.js.map +1 -1
  72. package/Culling/boundingBox.d.ts +2 -2
  73. package/Culling/boundingBox.js +2 -2
  74. package/Culling/boundingBox.js.map +1 -1
  75. package/Culling/ray.d.ts +1 -1
  76. package/Culling/ray.js +1 -1
  77. package/Culling/ray.js.map +1 -1
  78. package/Debug/debugLayer.d.ts +1 -1
  79. package/Debug/debugLayer.js +1 -1
  80. package/Debug/debugLayer.js.map +1 -1
  81. package/DeviceInput/webDeviceInputSystem.js +20 -2
  82. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  83. package/Engines/Extensions/engine.multiRender.js +8 -10
  84. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  85. package/Engines/Extensions/engine.query.d.ts +2 -2
  86. package/Engines/Extensions/engine.query.js.map +1 -1
  87. package/Engines/ICanvas.d.ts +11 -0
  88. package/Engines/ICanvas.js.map +1 -1
  89. package/Engines/WebGL/webGLPipelineContext.d.ts +29 -19
  90. package/Engines/WebGL/webGLPipelineContext.js +99 -311
  91. package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
  92. package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
  93. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  94. package/Engines/engine.d.ts +2 -2
  95. package/Engines/engine.js +2 -2
  96. package/Engines/engine.js.map +1 -1
  97. package/Engines/nativeEngine.d.ts +2 -2
  98. package/Engines/nativeEngine.js +2 -2
  99. package/Engines/nativeEngine.js.map +1 -1
  100. package/Engines/renderTargetWrapper.d.ts +1 -0
  101. package/Engines/renderTargetWrapper.js +5 -2
  102. package/Engines/renderTargetWrapper.js.map +1 -1
  103. package/Engines/thinEngine.d.ts +6 -5
  104. package/Engines/thinEngine.js +11 -7
  105. package/Engines/thinEngine.js.map +1 -1
  106. package/Engines/webgpuEngine.js +4 -1
  107. package/Engines/webgpuEngine.js.map +1 -1
  108. package/Events/clipboardEvents.d.ts +1 -1
  109. package/Events/clipboardEvents.js +1 -1
  110. package/Events/clipboardEvents.js.map +1 -1
  111. package/Events/deviceInputEvents.d.ts +11 -4
  112. package/Events/deviceInputEvents.js.map +1 -1
  113. package/Gamepads/Controllers/windowsMotionController.d.ts +1 -1
  114. package/Gamepads/Controllers/windowsMotionController.js +1 -1
  115. package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
  116. package/Gizmos/boundingBoxGizmo.d.ts +4 -0
  117. package/Gizmos/boundingBoxGizmo.js +6 -0
  118. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  119. package/Inputs/scene.inputManager.js +4 -4
  120. package/Inputs/scene.inputManager.js.map +1 -1
  121. package/Layers/effectLayer.d.ts +3 -3
  122. package/Layers/effectLayer.js +1 -1
  123. package/Layers/effectLayer.js.map +1 -1
  124. package/Layers/glowLayer.d.ts +3 -3
  125. package/Layers/glowLayer.js +2 -2
  126. package/Layers/glowLayer.js.map +1 -1
  127. package/Layers/highlightLayer.d.ts +3 -3
  128. package/Layers/highlightLayer.js +2 -2
  129. package/Layers/highlightLayer.js.map +1 -1
  130. package/Lights/directionalLight.d.ts +2 -2
  131. package/Lights/directionalLight.js +2 -2
  132. package/Lights/directionalLight.js.map +1 -1
  133. package/Lights/hemisphericLight.d.ts +3 -3
  134. package/Lights/hemisphericLight.js +3 -3
  135. package/Lights/hemisphericLight.js.map +1 -1
  136. package/Lights/light.d.ts +2 -2
  137. package/Lights/light.js +2 -2
  138. package/Lights/light.js.map +1 -1
  139. package/Lights/lightConstants.d.ts +1 -1
  140. package/Lights/lightConstants.js +1 -1
  141. package/Lights/lightConstants.js.map +1 -1
  142. package/Loading/Plugins/babylonFileLoader.js +3 -0
  143. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  144. package/Loading/sceneLoader.d.ts +1 -1
  145. package/Loading/sceneLoader.js.map +1 -1
  146. package/Materials/Background/backgroundMaterial.js +4 -0
  147. package/Materials/Background/backgroundMaterial.js.map +1 -1
  148. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -1
  149. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  150. package/Materials/Node/nodeMaterial.d.ts +1 -1
  151. package/Materials/Node/nodeMaterial.js +5 -1
  152. package/Materials/Node/nodeMaterial.js.map +1 -1
  153. package/Materials/PBR/pbrBaseMaterial.js +4 -1
  154. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  155. package/Materials/Textures/Filtering/hdrFiltering.d.ts +1 -1
  156. package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
  157. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  158. package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
  159. package/Materials/Textures/Procedurals/customProceduralTexture.js +9 -3
  160. package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
  161. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -9
  162. package/Materials/Textures/Procedurals/proceduralTexture.js +9 -9
  163. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  164. package/Materials/Textures/colorGradingTexture.d.ts +1 -1
  165. package/Materials/Textures/colorGradingTexture.js +1 -1
  166. package/Materials/Textures/colorGradingTexture.js.map +1 -1
  167. package/Materials/Textures/cubeTexture.d.ts +2 -2
  168. package/Materials/Textures/cubeTexture.js +2 -2
  169. package/Materials/Textures/cubeTexture.js.map +1 -1
  170. package/Materials/Textures/rawCubeTexture.d.ts +1 -1
  171. package/Materials/Textures/rawCubeTexture.js +1 -1
  172. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  173. package/Materials/Textures/renderTargetTexture.d.ts +3 -5
  174. package/Materials/Textures/renderTargetTexture.js +19 -19
  175. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  176. package/Materials/colorCurves.d.ts +3 -3
  177. package/Materials/colorCurves.js +3 -3
  178. package/Materials/colorCurves.js.map +1 -1
  179. package/Materials/effect.d.ts +27 -27
  180. package/Materials/effect.js +22 -288
  181. package/Materials/effect.js.map +1 -1
  182. package/Materials/fresnelParameters.d.ts +1 -1
  183. package/Materials/fresnelParameters.js +1 -1
  184. package/Materials/fresnelParameters.js.map +1 -1
  185. package/Materials/imageProcessingConfiguration.d.ts +4 -4
  186. package/Materials/imageProcessingConfiguration.js +4 -4
  187. package/Materials/imageProcessingConfiguration.js.map +1 -1
  188. package/Materials/shaderMaterial.d.ts +25 -25
  189. package/Materials/shaderMaterial.js +25 -25
  190. package/Materials/shaderMaterial.js.map +1 -1
  191. package/Materials/standardMaterial.js +4 -1
  192. package/Materials/standardMaterial.js.map +1 -1
  193. package/Maths/index.d.ts +1 -0
  194. package/Maths/index.js +1 -0
  195. package/Maths/index.js.map +1 -1
  196. package/Maths/math.functions.d.ts +2 -2
  197. package/Maths/math.functions.js +2 -2
  198. package/Maths/math.functions.js.map +1 -1
  199. package/Maths/math.polar.d.ts +77 -0
  200. package/Maths/math.polar.js +114 -0
  201. package/Maths/math.polar.js.map +1 -0
  202. package/Maths/math.scalar.d.ts +2 -2
  203. package/Maths/math.scalar.js +2 -2
  204. package/Maths/math.scalar.js.map +1 -1
  205. package/Maths/math.vector.d.ts +13 -12
  206. package/Maths/math.vector.js +13 -12
  207. package/Maths/math.vector.js.map +1 -1
  208. package/Meshes/abstractMesh.d.ts +1 -1
  209. package/Meshes/abstractMesh.js +13 -2
  210. package/Meshes/abstractMesh.js.map +1 -1
  211. package/Meshes/geometry.d.ts +3 -3
  212. package/Meshes/geometry.js +3 -3
  213. package/Meshes/geometry.js.map +1 -1
  214. package/Meshes/groundMesh.d.ts +5 -4
  215. package/Meshes/groundMesh.js +5 -4
  216. package/Meshes/groundMesh.js.map +1 -1
  217. package/Meshes/instancedMesh.d.ts +1 -1
  218. package/Meshes/instancedMesh.js +1 -1
  219. package/Meshes/instancedMesh.js.map +1 -1
  220. package/Meshes/mesh.d.ts +3 -3
  221. package/Meshes/mesh.js +7 -3
  222. package/Meshes/mesh.js.map +1 -1
  223. package/Meshes/subMesh.d.ts +1 -1
  224. package/Meshes/subMesh.js +1 -1
  225. package/Meshes/subMesh.js.map +1 -1
  226. package/Meshes/thinInstanceMesh.d.ts +1 -1
  227. package/Meshes/thinInstanceMesh.js.map +1 -1
  228. package/Meshes/transformNode.js +6 -0
  229. package/Meshes/transformNode.js.map +1 -1
  230. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +2 -2
  231. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
  232. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  233. package/Misc/HighDynamicRange/hdr.d.ts +3 -3
  234. package/Misc/HighDynamicRange/hdr.js +3 -3
  235. package/Misc/HighDynamicRange/hdr.js.map +1 -1
  236. package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -1
  237. package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
  238. package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
  239. package/Misc/arrayTools.d.ts +13 -12
  240. package/Misc/arrayTools.js +70 -39
  241. package/Misc/arrayTools.js.map +1 -1
  242. package/Misc/assetsManager.d.ts +3 -3
  243. package/Misc/assetsManager.js +3 -3
  244. package/Misc/assetsManager.js.map +1 -1
  245. package/Misc/basis.js +17 -3
  246. package/Misc/basis.js.map +1 -1
  247. package/Misc/environmentTextureTools.d.ts +4 -4
  248. package/Misc/environmentTextureTools.js +5 -5
  249. package/Misc/environmentTextureTools.js.map +1 -1
  250. package/Misc/fileTools.d.ts +3 -3
  251. package/Misc/fileTools.js +19 -12
  252. package/Misc/fileTools.js.map +1 -1
  253. package/Misc/logger.js +1 -1
  254. package/Misc/logger.js.map +1 -1
  255. package/Misc/observable.d.ts +1 -1
  256. package/Misc/observable.js +1 -1
  257. package/Misc/observable.js.map +1 -1
  258. package/Misc/performanceMonitor.d.ts +3 -3
  259. package/Misc/performanceMonitor.js +3 -3
  260. package/Misc/performanceMonitor.js.map +1 -1
  261. package/Misc/rgbdTextureTools.d.ts +1 -1
  262. package/Misc/rgbdTextureTools.js +1 -1
  263. package/Misc/rgbdTextureTools.js.map +1 -1
  264. package/Misc/sceneOptimizer.d.ts +7 -7
  265. package/Misc/sceneOptimizer.js +7 -7
  266. package/Misc/sceneOptimizer.js.map +1 -1
  267. package/Misc/stringDictionary.d.ts +6 -6
  268. package/Misc/stringDictionary.js +6 -6
  269. package/Misc/stringDictionary.js.map +1 -1
  270. package/Misc/textureTools.d.ts +4 -4
  271. package/Misc/textureTools.js +4 -4
  272. package/Misc/textureTools.js.map +1 -1
  273. package/Misc/tools.d.ts +6 -6
  274. package/Misc/tools.js +6 -6
  275. package/Misc/tools.js.map +1 -1
  276. package/Misc/videoRecorder.d.ts +1 -1
  277. package/Misc/videoRecorder.js +1 -1
  278. package/Misc/videoRecorder.js.map +1 -1
  279. package/Offline/database.js +3 -3
  280. package/Offline/database.js.map +1 -1
  281. package/Particles/IParticleSystem.d.ts +1 -1
  282. package/Particles/IParticleSystem.js.map +1 -1
  283. package/Particles/gpuParticleSystem.d.ts +1 -1
  284. package/Particles/gpuParticleSystem.js +1 -1
  285. package/Particles/gpuParticleSystem.js.map +1 -1
  286. package/Particles/particleSystem.d.ts +1 -1
  287. package/Particles/particleSystem.js +1 -1
  288. package/Particles/particleSystem.js.map +1 -1
  289. package/Particles/solidParticleSystem.d.ts +4 -0
  290. package/Particles/solidParticleSystem.js +25 -3
  291. package/Particles/solidParticleSystem.js.map +1 -1
  292. package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
  293. package/Physics/Plugins/ammoJSPlugin.js +1 -1
  294. package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
  295. package/Physics/Plugins/oimoJSPlugin.js +1 -1
  296. package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
  297. package/Physics/physicsEngineComponent.d.ts +1 -1
  298. package/Physics/physicsEngineComponent.js +1 -1
  299. package/Physics/physicsEngineComponent.js.map +1 -1
  300. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +3 -3
  301. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  302. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +1 -2
  303. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  304. package/PostProcesses/blurPostProcess.d.ts +3 -3
  305. package/PostProcesses/blurPostProcess.js +3 -3
  306. package/PostProcesses/blurPostProcess.js.map +1 -1
  307. package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +3 -3
  308. package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -3
  309. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  310. package/Rendering/depthPeelingRenderer.d.ts +1 -0
  311. package/Rendering/depthPeelingRenderer.js +32 -5
  312. package/Rendering/depthPeelingRenderer.js.map +1 -1
  313. package/Rendering/edgesRenderer.d.ts +2 -2
  314. package/Rendering/edgesRenderer.js +1 -1
  315. package/Rendering/edgesRenderer.js.map +1 -1
  316. package/Rendering/geometryBufferRenderer.d.ts +4 -2
  317. package/Rendering/geometryBufferRenderer.js +5 -3
  318. package/Rendering/geometryBufferRenderer.js.map +1 -1
  319. package/Rendering/geometryBufferRendererSceneComponent.d.ts +2 -1
  320. package/Rendering/geometryBufferRendererSceneComponent.js +3 -2
  321. package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
  322. package/Rendering/prePassRenderer.d.ts +11 -3
  323. package/Rendering/prePassRenderer.js +18 -3
  324. package/Rendering/prePassRenderer.js.map +1 -1
  325. package/Rendering/subSurfaceConfiguration.d.ts +2 -2
  326. package/Rendering/subSurfaceConfiguration.js +2 -2
  327. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  328. package/Sprites/spriteSceneComponent.js +4 -1
  329. package/Sprites/spriteSceneComponent.js.map +1 -1
  330. package/XR/features/WebXRControllerTeleportation.d.ts +4 -0
  331. package/XR/features/WebXRControllerTeleportation.js +24 -19
  332. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  333. package/XR/motionController/webXRAbstractMotionController.d.ts +2 -2
  334. package/XR/motionController/webXRAbstractMotionController.js +2 -2
  335. package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
  336. package/XR/motionController/webXRControllerComponent.d.ts +1 -1
  337. package/XR/motionController/webXRControllerComponent.js +1 -1
  338. package/XR/motionController/webXRControllerComponent.js.map +1 -1
  339. package/XR/motionController/webXRMotionControllerManager.d.ts +3 -3
  340. package/XR/motionController/webXRMotionControllerManager.js +3 -3
  341. package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
  342. package/node.d.ts +4 -4
  343. package/node.js +3 -3
  344. package/node.js.map +1 -1
  345. package/package.json +1 -1
  346. package/readme.md +0 -4
  347. package/scene.d.ts +80 -63
  348. package/scene.js +92 -46
  349. package/scene.js.map +1 -1
  350. package/sceneComponent.d.ts +1 -1
  351. package/sceneComponent.js.map +1 -1
@@ -164,7 +164,7 @@ export declare class FramingBehavior implements Behavior<ArcRotateCamera> {
164
164
  * Calculates the lowest radius for the camera based on the bounding box of the mesh.
165
165
  * @param minimumWorld
166
166
  * @param maximumWorld
167
- * @return The minimum distance from the primary mesh's center point at which the camera must be kept in order
167
+ * @returns The minimum distance from the primary mesh's center point at which the camera must be kept in order
168
168
  * to fully enclose the mesh in the viewing frustum.
169
169
  */
170
170
  protected _calculateLowerRadiusFromModelBoundingSphere(minimumWorld: Vector3, maximumWorld: Vector3): number;
@@ -309,7 +309,7 @@ export class FramingBehavior {
309
309
  * Calculates the lowest radius for the camera based on the bounding box of the mesh.
310
310
  * @param minimumWorld
311
311
  * @param maximumWorld
312
- * @return The minimum distance from the primary mesh's center point at which the camera must be kept in order
312
+ * @returns The minimum distance from the primary mesh's center point at which the camera must be kept in order
313
313
  * to fully enclose the mesh in the viewing frustum.
314
314
  */
315
315
  _calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld) {
@@ -1 +1 @@
1
- {"version":3,"file":"framingBehavior.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Behaviors/Cameras/framingBehavior.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAA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,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;;AA3fD;;GAEG;AACW,8BAAc,GAAG,IAAI,eAAe,EAAE,CAAC;AAErD;;GAEG;AACW,0BAAU,GAAG,cAAc,CAAC,oBAAoB,CAAC;AAqf/D,UAAU;AAEV;;GAEG;AACW,oCAAoB,GAAG,CAAC,CAAC;AAEvC;;GAEG;AACW,mCAAmB,GAAG,CAAC,CAAC","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/how_to/camera_behaviors#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 */\r\n public zoomOnBoundingInfo(minimumWorld: Vector3, maximumWorld: Vector3, focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): void {\r\n let zoomTarget: Vector3;\r\n\r\n if (!this._attachedCamera) {\r\n return;\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\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 * @return 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":["../../../../../../lts/core/generated/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AC;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;;AA3fD;;GAEG;AACW,8BAAc,GAAG,IAAI,eAAe,EAAE,CAAC;AAErD;;GAEG;AACW,0BAAU,GAAG,cAAc,CAAC,oBAAoB,CAAC;AAqf/D,UAAU;AAEV;;GAEG;AACW,oCAAoB,GAAG,CAAC,CAAC;AAEvC;;GAEG;AACW,mCAAmB,GAAG,CAAC,CAAC","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/how_to/camera_behaviors#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 */\r\n public zoomOnBoundingInfo(minimumWorld: Vector3, maximumWorld: Vector3, focusOnOriginXZ: boolean = false, onAnimationEnd: Nullable<() => void> = null): void {\r\n let zoomTarget: Vector3;\r\n\r\n if (!this._attachedCamera) {\r\n return;\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\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"]}
package/Bones/bone.d.ts CHANGED
@@ -71,7 +71,7 @@ export declare class Bone extends Node {
71
71
  name: string, skeleton: Skeleton, parentBone?: Nullable<Bone>, localMatrix?: Nullable<Matrix>, restPose?: Nullable<Matrix>, baseMatrix?: Nullable<Matrix>, index?: Nullable<number>);
72
72
  /**
73
73
  * Gets the current object class name.
74
- * @return the class name
74
+ * @returns the class name
75
75
  */
76
76
  getClassName(): string;
77
77
  /**
package/Bones/bone.js CHANGED
@@ -74,7 +74,7 @@ export class Bone extends Node {
74
74
  }
75
75
  /**
76
76
  * Gets the current object class name.
77
- * @return the class name
77
+ * @returns the class name
78
78
  */
79
79
  getClassName() {
80
80
  return "Bone";
package/Bones/bone.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bone.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Bones/bone.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAK3C;;;GAGG;AACH,MAAM,OAAO,IAAK,SAAQ,IAAI;IAiE1B;;;;;;;;;OASG;IACH;IACI;;OAEG;IACI,IAAY,EACnB,QAAkB,EAClB,aAA6B,IAAI,EACjC,cAAgC,IAAI,EACpC,WAA6B,IAAI,EACjC,aAA+B,IAAI,EACnC,QAA0B,IAAI;QAE9B,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAR1B,SAAI,GAAJ,IAAI,CAAQ;QA1EvB;;WAEG;QACI,aAAQ,GAAG,IAAI,KAAK,EAAQ,CAAC;QAEpC,oDAAoD;QAC7C,eAAU,GAAG,IAAI,KAAK,E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U,CAAC,QAAQ,EAAE,CAAC;AACjC,aAAQ,GAAa,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import type { Skeleton } from \"./skeleton\";\r\nimport { Vector3, Quaternion, Matrix, TmpVectors } from \"../Maths/math.vector\";\r\nimport { ArrayTools } from \"../Misc/arrayTools\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport { Node } from \"../node\";\r\nimport { Space } from \"../Maths/math.axis\";\r\n\r\ndeclare type Animation = import(\"../Animations/animation\").Animation;\r\ndeclare type AnimationPropertiesOverride = import(\"../Animations/animationPropertiesOverride\").AnimationPropertiesOverride;\r\n\r\n/**\r\n * Class used to store bone information\r\n * @see https://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons\r\n */\r\nexport class Bone extends Node {\r\n private static _TmpVecs: Vector3[] = ArrayTools.BuildArray(2, Vector3.Zero);\r\n private static _TmpQuat = Quaternion.Identity();\r\n private static _TmpMats: Matrix[] = ArrayTools.BuildArray(5, Matrix.Identity);\r\n\r\n /**\r\n * Gets the list of child bones\r\n */\r\n public children = new Array<Bone>();\r\n\r\n /** Gets the animations associated with this bone */\r\n public animations = new Array<Animation>();\r\n\r\n /**\r\n * Gets or sets bone length\r\n */\r\n public length: number;\r\n\r\n /**\r\n * @hidden Internal only\r\n * Set this value to map this bone to a different index in the transform matrices\r\n * Set this value to -1 to exclude the bone from the transform matrices\r\n */\r\n public _index: Nullable<number> = null;\r\n\r\n private _skeleton: Skeleton;\r\n private _localMatrix: Matrix;\r\n private _restPose: Matrix;\r\n private _baseMatrix: Matrix;\r\n private _absoluteTransform = new Matrix();\r\n private _invertedAbsoluteTransform = new Matrix();\r\n private _scalingDeterminant = 1;\r\n private _worldTransform = new Matrix();\r\n\r\n private _localScaling: Vector3;\r\n private _localRotation: Quaternion;\r\n private _localPosition: Vector3;\r\n private _needToDecompose = true;\r\n private _needToCompose = false;\r\n\r\n /** @hidden */\r\n public _linkedTransformNode: Nullable<TransformNode> = null;\r\n\r\n /** @hidden */\r\n public _waitingTransformNodeId: Nullable<string> = null;\r\n\r\n /** @hidden */\r\n get _matrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /** @hidden */\r\n set _matrix(value: Matrix) {\r\n this._needToCompose = false; // in case there was a pending compose\r\n\r\n // skip if the matrices are the same\r\n if (value.updateFlag === this._localMatrix.updateFlag) {\r\n return;\r\n }\r\n\r\n this._localMatrix.copyFrom(value);\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Create a new bone\r\n * @param name defines the bone name\r\n * @param skeleton defines the parent skeleton\r\n * @param parentBone defines the parent (can be null if the bone is the root)\r\n * @param localMatrix defines the local matrix\r\n * @param restPose defines the rest pose matrix\r\n * @param baseMatrix defines the base matrix\r\n * @param index defines index of the bone in the hierarchy\r\n */\r\n constructor(\r\n /**\r\n * defines the bone name\r\n */\r\n public name: string,\r\n skeleton: Skeleton,\r\n parentBone: Nullable<Bone> = null,\r\n localMatrix: Nullable<Matrix> = null,\r\n restPose: Nullable<Matrix> = null,\r\n baseMatrix: Nullable<Matrix> = null,\r\n index: Nullable<number> = null\r\n ) {\r\n super(name, skeleton.getScene());\r\n this._skeleton = skeleton;\r\n this._localMatrix = localMatrix ? localMatrix.clone() : Matrix.Identity();\r\n this._restPose = restPose ? restPose : this._localMatrix.clone();\r\n this._baseMatrix = baseMatrix ? baseMatrix : this._localMatrix.clone();\r\n this._index = index;\r\n\r\n skeleton.bones.push(this);\r\n\r\n this.setParent(parentBone, false);\r\n\r\n if (baseMatrix || localMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current object class name.\r\n * @return the class name\r\n */\r\n public getClassName(): string {\r\n return \"Bone\";\r\n }\r\n\r\n // Members\r\n\r\n /**\r\n * Gets the parent skeleton\r\n * @returns a skeleton\r\n */\r\n public getSkeleton(): Skeleton {\r\n return this._skeleton;\r\n }\r\n\r\n public get parent(): Bone {\r\n return this._parentNode as Bone;\r\n }\r\n\r\n /**\r\n * Gets parent bone\r\n * @returns a bone or null if the bone is the root of the bone hierarchy\r\n */\r\n public getParent(): Nullable<Bone> {\r\n return this.parent;\r\n }\r\n\r\n /**\r\n * Returns an array containing the root bones\r\n * @returns an array containing the root bones\r\n */\r\n public getChildren(): Array<Bone> {\r\n return this.children;\r\n }\r\n\r\n /**\r\n * Gets the node index in matrix array generated for rendering\r\n * @returns the node index\r\n */\r\n public getIndex(): number {\r\n return this._index === null ? this.getSkeleton().bones.indexOf(this) : this._index;\r\n }\r\n\r\n public set parent(newParent: Nullable<Bone>) {\r\n this.setParent(newParent);\r\n }\r\n\r\n /**\r\n * Sets the parent bone\r\n * @param parent defines the parent (can be null if the bone is the root)\r\n * @param updateDifferenceMatrix defines if the difference matrix must be updated\r\n */\r\n public setParent(parent: Nullable<Bone>, updateDifferenceMatrix: boolean = true): void {\r\n if (this.parent === parent) {\r\n return;\r\n }\r\n\r\n if (this.parent) {\r\n const index = this.parent.children.indexOf(this);\r\n if (index !== -1) {\r\n this.parent.children.splice(index, 1);\r\n }\r\n }\r\n\r\n this._parentNode = parent;\r\n\r\n if (this.parent) {\r\n this.parent.children.push(this);\r\n }\r\n\r\n if (updateDifferenceMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the local matrix\r\n * @returns a matrix\r\n */\r\n public getLocalMatrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /**\r\n * Gets the base matrix (initial matrix which remains unchanged)\r\n * @returns the base matrix (as known as bind pose matrix)\r\n */\r\n public getBaseMatrix(): Matrix {\r\n return this._baseMatrix;\r\n }\r\n\r\n /**\r\n * Gets the rest pose matrix\r\n * @returns a matrix\r\n */\r\n public getRestPose(): Matrix {\r\n return this._restPose;\r\n }\r\n\r\n /**\r\n * Sets the rest pose matrix\r\n * @param matrix the local-space rest pose to set for this bone\r\n */\r\n public setRestPose(matrix: Matrix): void {\r\n this._restPose.copyFrom(matrix);\r\n }\r\n\r\n /**\r\n * Gets the bind pose matrix\r\n * @returns the bind pose matrix\r\n * @deprecated Please use getBaseMatrix instead\r\n */\r\n public getBindPose(): Matrix {\r\n return this._baseMatrix;\r\n }\r\n\r\n /**\r\n * Sets the bind pose matrix\r\n * @param matrix the local-space bind pose to set for this bone\r\n * @deprecated Please use updateMatrix instead\r\n */\r\n public setBindPose(matrix: Matrix): void {\r\n this.updateMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets a matrix used to store world matrix (ie. the matrix sent to shaders)\r\n */\r\n public getWorldMatrix(): Matrix {\r\n return this._worldTransform;\r\n }\r\n\r\n /**\r\n * Sets the local matrix to rest pose matrix\r\n */\r\n public returnToRest(): void {\r\n if (this._linkedTransformNode) {\r\n const localScaling = TmpVectors.Vector3[0];\r\n const localRotation = TmpVectors.Quaternion[0];\r\n const localPosition = TmpVectors.Vector3[1];\r\n\r\n this.getRestPose().decompose(localScaling, localRotation, localPosition);\r\n\r\n this._linkedTransformNode.position.copyFrom(localPosition);\r\n this._linkedTransformNode.rotationQuaternion = this._linkedTransformNode.rotationQuaternion ?? Quaternion.Identity();\r\n this._linkedTransformNode.rotationQuaternion.copyFrom(localRotation);\r\n this._linkedTransformNode.scaling.copyFrom(localScaling);\r\n } else {\r\n this._matrix = this._restPose;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the inverse of the absolute transform matrix.\r\n * This matrix will be multiplied by local matrix to get the difference matrix (ie. the difference between original state and current state)\r\n * @returns a matrix\r\n */\r\n public getInvertedAbsoluteTransform(): Matrix {\r\n return this._invertedAbsoluteTransform;\r\n }\r\n\r\n /**\r\n * Gets the absolute transform matrix (ie base matrix * parent world matrix)\r\n * @returns a matrix\r\n */\r\n public getAbsoluteTransform(): Matrix {\r\n return this._absoluteTransform;\r\n }\r\n\r\n /**\r\n * Links with the given transform node.\r\n * The local matrix of this bone is copied from the transform node every frame.\r\n * @param transformNode defines the transform node to link to\r\n */\r\n public linkTransformNode(transformNode: Nullable<TransformNode>): void {\r\n if (this._linkedTransformNode) {\r\n this._skeleton._numBonesWithLinkedTransformNode--;\r\n }\r\n\r\n this._linkedTransformNode = transformNode;\r\n\r\n if (this._linkedTransformNode) {\r\n this._skeleton._numBonesWithLinkedTransformNode++;\r\n }\r\n }\r\n\r\n // Properties (matches TransformNode properties)\r\n\r\n /**\r\n * Gets the node used to drive the bone's transformation\r\n * @returns a transform node or null\r\n */\r\n public getTransformNode() {\r\n return this._linkedTransformNode;\r\n }\r\n\r\n /** Gets or sets current position (in local space) */\r\n public get position(): Vector3 {\r\n this._decompose();\r\n return this._localPosition;\r\n }\r\n\r\n public set position(newPosition: Vector3) {\r\n this._decompose();\r\n this._localPosition.copyFrom(newPosition);\r\n\r\n this._markAsDirtyAndCompose();\r\n }\r\n\r\n /** Gets or sets current rotation (in local space) */\r\n public get rotation(): Vector3 {\r\n return this.getRotation();\r\n }\r\n\r\n public set rotation(newRotation: Vector3) {\r\n this.setRotation(newRotation);\r\n }\r\n\r\n /** Gets or sets current rotation quaternion (in local space) */\r\n public get rotationQuaternion() {\r\n this._decompose();\r\n return this._localRotation;\r\n }\r\n\r\n public set rotationQuaternion(newRotation: Quaternion) {\r\n this.setRotationQuaternion(newRotation);\r\n }\r\n\r\n /** Gets or sets current scaling (in local space) */\r\n public get scaling(): Vector3 {\r\n return this.getScale();\r\n }\r\n\r\n public set scaling(newScaling: Vector3) {\r\n this.setScale(newScaling);\r\n }\r\n\r\n /**\r\n * Gets the animation properties override\r\n */\r\n public get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride> {\r\n return this._skeleton.animationPropertiesOverride;\r\n }\r\n\r\n // Methods\r\n private _decompose() {\r\n if (!this._needToDecompose) {\r\n return;\r\n }\r\n\r\n this._needToDecompose = false;\r\n\r\n if (!this._localScaling) {\r\n this._localScaling = Vector3.Zero();\r\n this._localRotation = Quaternion.Zero();\r\n this._localPosition = Vector3.Zero();\r\n }\r\n this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition);\r\n }\r\n\r\n private _compose() {\r\n if (!this._needToCompose) {\r\n return;\r\n }\r\n\r\n if (!this._localScaling) {\r\n this._needToCompose = false;\r\n return;\r\n }\r\n\r\n this._needToCompose = false;\r\n Matrix.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix);\r\n }\r\n\r\n /**\r\n * Update the base and local matrices\r\n * @param matrix defines the new base or local matrix\r\n * @param updateDifferenceMatrix defines if the difference matrix must be updated\r\n * @param updateLocalMatrix defines if the local matrix should be updated\r\n */\r\n public updateMatrix(matrix: Matrix, updateDifferenceMatrix = true, updateLocalMatrix = true): void {\r\n this._baseMatrix.copyFrom(matrix);\r\n\r\n if (updateDifferenceMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n\r\n if (updateLocalMatrix) {\r\n this._matrix = matrix;\r\n } else {\r\n this.markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * @param rootMatrix\r\n * @param updateChildren\r\n * @hidden\r\n */\r\n public _updateDifferenceMatrix(rootMatrix?: Matrix, updateChildren = true): void {\r\n if (!rootMatrix) {\r\n rootMatrix = this._baseMatrix;\r\n }\r\n\r\n if (this.parent) {\r\n rootMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);\r\n } else {\r\n this._absoluteTransform.copyFrom(rootMatrix);\r\n }\r\n\r\n this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform);\r\n\r\n if (updateChildren) {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._updateDifferenceMatrix();\r\n }\r\n }\r\n\r\n this._scalingDeterminant = this._absoluteTransform.determinant() < 0 ? -1 : 1;\r\n }\r\n\r\n /**\r\n * Flag the bone as dirty (Forcing it to update everything)\r\n * @returns this bone\r\n */\r\n public markAsDirty(): Bone {\r\n this._currentRenderId++;\r\n this._childUpdateId++;\r\n this._skeleton._markAsDirty();\r\n return this;\r\n }\r\n\r\n /** @hidden */\r\n public _markAsDirtyAndCompose() {\r\n this.markAsDirty();\r\n this._needToCompose = true;\r\n }\r\n\r\n private _markAsDirtyAndDecompose() {\r\n this.markAsDirty();\r\n this._needToDecompose = true;\r\n }\r\n\r\n /**\r\n * Translate the bone in local or world space\r\n * @param vec The amount to translate the bone\r\n * @param space The space that the translation is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public translate(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n lm.addAtIndex(12, vec.x);\r\n lm.addAtIndex(13, vec.y);\r\n lm.addAtIndex(14, vec.z);\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n const tmat = Bone._TmpMats[0];\r\n const tvec = Bone._TmpVecs[0];\r\n\r\n if (this.parent) {\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n }\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n tmat.setTranslationFromFloats(0, 0, 0);\r\n tmat.invert();\r\n Vector3.TransformCoordinatesToRef(vec, tmat, tvec);\r\n\r\n lm.addAtIndex(12, tvec.x);\r\n lm.addAtIndex(13, tvec.y);\r\n lm.addAtIndex(14, tvec.z);\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Set the position of the bone in local or world space\r\n * @param position The position to set the bone\r\n * @param space The space that the position is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setPosition(position: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n lm.setTranslationFromFloats(position.x, position.y, position.z);\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n const vec = Bone._TmpVecs[0];\r\n\r\n if (this.parent) {\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n }\r\n tmat.invert();\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, vec);\r\n lm.setTranslationFromFloats(vec.x, vec.y, vec.z);\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Set the absolute position of the bone (world space)\r\n * @param position The position to set the bone\r\n * @param tNode The TransformNode that this bone is attached to\r\n */\r\n public setAbsolutePosition(position: Vector3, tNode?: TransformNode) {\r\n this.setPosition(position, Space.WORLD, tNode);\r\n }\r\n\r\n /**\r\n * Scale the bone on the x, y and z axes (in local space)\r\n * @param x The amount to scale the bone on the x axis\r\n * @param y The amount to scale the bone on the y axis\r\n * @param z The amount to scale the bone on the z axis\r\n * @param scaleChildren sets this to true if children of the bone should be scaled as well (false by default)\r\n */\r\n public scale(x: number, y: number, z: number, scaleChildren = false): void {\r\n const locMat = this.getLocalMatrix();\r\n\r\n // Apply new scaling on top of current local matrix\r\n const scaleMat = Bone._TmpMats[0];\r\n Matrix.ScalingToRef(x, y, z, scaleMat);\r\n scaleMat.multiplyToRef(locMat, locMat);\r\n\r\n // Invert scaling matrix and apply the inverse to all children\r\n scaleMat.invert();\r\n\r\n for (const child of this.children) {\r\n const cm = child.getLocalMatrix();\r\n cm.multiplyToRef(scaleMat, cm);\r\n cm.multiplyAtIndex(12, x);\r\n cm.multiplyAtIndex(13, y);\r\n cm.multiplyAtIndex(14, z);\r\n\r\n child._markAsDirtyAndDecompose();\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n\r\n if (scaleChildren) {\r\n for (const child of this.children) {\r\n child.scale(x, y, z, scaleChildren);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Set the bone scaling in local space\r\n * @param scale defines the scaling vector\r\n */\r\n public setScale(scale: Vector3): void {\r\n this._decompose();\r\n this._localScaling.copyFrom(scale);\r\n this._markAsDirtyAndCompose();\r\n }\r\n\r\n /**\r\n * Gets the current scaling in local space\r\n * @returns the current scaling vector\r\n */\r\n public getScale(): Vector3 {\r\n this._decompose();\r\n return this._localScaling;\r\n }\r\n\r\n /**\r\n * Gets the current scaling in local space and stores it in a target vector\r\n * @param result defines the target vector\r\n */\r\n public getScaleToRef(result: Vector3) {\r\n this._decompose();\r\n result.copyFrom(this._localScaling);\r\n }\r\n\r\n /**\r\n * Set the yaw, pitch, and roll of the bone in local or world space\r\n * @param yaw The rotation of the bone on the y axis\r\n * @param pitch The rotation of the bone on the x axis\r\n * @param roll The rotation of the bone on the z axis\r\n * @param space The space that the axes of rotation are in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setYawPitchRoll(yaw: number, pitch: number, roll: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, quat);\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getNegativeRotationToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Add a rotation to the bone on an axis in local or world space\r\n * @param axis The axis to rotate the bone on\r\n * @param amount The amount to rotate the bone\r\n * @param space The space that the axis is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public rotate(axis: Vector3, amount: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const rmat = Bone._TmpMats[0];\r\n rmat.setTranslationFromFloats(0, 0, 0);\r\n Matrix.RotationAxisToRef(axis, amount, rmat);\r\n this._rotateWithMatrix(rmat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the rotation of the bone to a particular axis angle in local or world space\r\n * @param axis The axis to rotate the bone on\r\n * @param angle The angle that the bone should be rotated to\r\n * @param space The space that the axis is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setAxisAngle(axis: Vector3, angle: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.RotationAxisToRef(axis, angle, quat);\r\n\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getNegativeRotationToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.RotationAxisToRef(axis, angle, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the euler rotation of the bone in local or world space\r\n * @param rotation The euler rotation that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setRotation(rotation: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this.setYawPitchRoll(rotation.y, rotation.x, rotation.z, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the quaternion rotation of the bone in local or world space\r\n * @param quat The quaternion rotation that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setRotationQuaternion(quat: Quaternion, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n this._decompose();\r\n this._localRotation.copyFrom(quat);\r\n\r\n this._markAsDirtyAndCompose();\r\n\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getNegativeRotationToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.FromQuaternionToRef(quat, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the rotation matrix of the bone in local or world space\r\n * @param rotMat The rotation matrix that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setRotationMatrix(rotMat: Matrix, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.FromRotationMatrixToRef(rotMat, quat);\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getNegativeRotationToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat2 = Bone._TmpMats[1];\r\n rotMat2.copyFrom(rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat2);\r\n\r\n this._rotateWithMatrix(rotMat2, space, tNode);\r\n }\r\n\r\n private _rotateWithMatrix(rmat: Matrix, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lmat = this.getLocalMatrix();\r\n const lx = lmat.m[12];\r\n const ly = lmat.m[13];\r\n const lz = lmat.m[14];\r\n const parent = this.getParent();\r\n const parentScale = Bone._TmpMats[3];\r\n const parentScaleInv = Bone._TmpMats[4];\r\n\r\n if (parent && space == Space.WORLD) {\r\n if (tNode) {\r\n parentScale.copyFrom(tNode.getWorldMatrix());\r\n parent.getAbsoluteTransform().multiplyToRef(parentScale, parentScale);\r\n } else {\r\n parentScale.copyFrom(parent.getAbsoluteTransform());\r\n }\r\n parentScaleInv.copyFrom(parentScale);\r\n parentScaleInv.invert();\r\n lmat.multiplyToRef(parentScale, lmat);\r\n lmat.multiplyToRef(rmat, lmat);\r\n lmat.multiplyToRef(parentScaleInv, lmat);\r\n } else {\r\n if (space == Space.WORLD && tNode) {\r\n parentScale.copyFrom(tNode.getWorldMatrix());\r\n parentScaleInv.copyFrom(parentScale);\r\n parentScaleInv.invert();\r\n lmat.multiplyToRef(parentScale, lmat);\r\n lmat.multiplyToRef(rmat, lmat);\r\n lmat.multiplyToRef(parentScaleInv, lmat);\r\n } else {\r\n lmat.multiplyToRef(rmat, lmat);\r\n }\r\n }\r\n\r\n lmat.setTranslationFromFloats(lx, ly, lz);\r\n\r\n this.computeAbsoluteTransforms();\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n private _getNegativeRotationToRef(rotMatInv: Matrix, tNode?: TransformNode): boolean {\r\n const scaleMatrix = Bone._TmpMats[2];\r\n rotMatInv.copyFrom(this.getAbsoluteTransform());\r\n\r\n if (tNode) {\r\n rotMatInv.multiplyToRef(tNode.getWorldMatrix(), rotMatInv);\r\n Matrix.ScalingToRef(tNode.scaling.x, tNode.scaling.y, tNode.scaling.z, scaleMatrix);\r\n } else {\r\n Matrix.IdentityToRef(scaleMatrix);\r\n }\r\n\r\n rotMatInv.invert();\r\n if (isNaN(rotMatInv.m[0])) {\r\n // Matrix failed to invert.\r\n // This can happen if scale is zero for example.\r\n return false;\r\n }\r\n\r\n scaleMatrix.multiplyAtIndex(0, this._scalingDeterminant);\r\n rotMatInv.multiplyToRef(scaleMatrix, rotMatInv);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Get the position of the bone in local or world space\r\n * @param space The space that the returned position is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @returns The position of the bone\r\n */\r\n public getPosition(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const pos = Vector3.Zero();\r\n\r\n this.getPositionToRef(space, tNode, pos);\r\n\r\n return pos;\r\n }\r\n\r\n /**\r\n * Copy the position of the bone to a vector3 in local or world space\r\n * @param space The space that the returned position is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @param result The vector3 to copy the position to\r\n */\r\n public getPositionToRef(space = Space.LOCAL, tNode: Nullable<TransformNode>, result: Vector3): void {\r\n if (space == Space.LOCAL) {\r\n const lm = this.getLocalMatrix();\r\n\r\n result.x = lm.m[12];\r\n result.y = lm.m[13];\r\n result.z = lm.m[14];\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteTransform();\r\n }\r\n\r\n result.x = tmat.m[12];\r\n result.y = tmat.m[13];\r\n result.z = tmat.m[14];\r\n }\r\n }\r\n\r\n /**\r\n * Get the absolute position of the bone (world space)\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @returns The absolute position of the bone\r\n */\r\n public getAbsolutePosition(tNode: Nullable<TransformNode> = null): Vector3 {\r\n const pos = Vector3.Zero();\r\n\r\n this.getPositionToRef(Space.WORLD, tNode, pos);\r\n\r\n return pos;\r\n }\r\n\r\n /**\r\n * Copy the absolute position of the bone (world space) to the result param\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @param result The vector3 to copy the absolute position to\r\n */\r\n public getAbsolutePositionToRef(tNode: TransformNode, result: Vector3) {\r\n this.getPositionToRef(Space.WORLD, tNode, result);\r\n }\r\n\r\n /**\r\n * Compute the absolute transforms of this bone and its children\r\n */\r\n public computeAbsoluteTransforms(): void {\r\n this._compose();\r\n\r\n if (this.parent) {\r\n this._localMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);\r\n } else {\r\n this._absoluteTransform.copyFrom(this._localMatrix);\r\n\r\n const poseMatrix = this._skeleton.getPoseMatrix();\r\n\r\n if (poseMatrix) {\r\n this._absoluteTransform.multiplyToRef(poseMatrix, this._absoluteTransform);\r\n }\r\n }\r\n\r\n const children = this.children;\r\n const len = children.length;\r\n\r\n for (let i = 0; i < len; i++) {\r\n children[i].computeAbsoluteTransforms();\r\n }\r\n }\r\n\r\n /**\r\n * Get the world direction from an axis that is in the local space of the bone\r\n * @param localAxis The local direction that is used to compute the world direction\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @returns The world direction\r\n */\r\n public getDirection(localAxis: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getDirectionToRef(localAxis, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the world direction to a vector3 from an axis that is in the local space of the bone\r\n * @param localAxis The local direction that is used to compute the world direction\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @param result The vector3 that the world direction will be copied to\r\n */\r\n public getDirectionToRef(localAxis: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const mat = Bone._TmpMats[0];\r\n\r\n mat.copyFrom(this.getAbsoluteTransform());\r\n\r\n if (tNode && wm) {\r\n mat.multiplyToRef(wm, mat);\r\n }\r\n\r\n Vector3.TransformNormalToRef(localAxis, mat, result);\r\n\r\n result.normalize();\r\n }\r\n\r\n /**\r\n * Get the euler rotation of the bone in local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @returns The euler rotation\r\n */\r\n public getRotation(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getRotationToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the euler rotation of the bone to a vector3. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @param result The vector3 that the rotation should be copied to\r\n */\r\n public getRotationToRef(space = Space.LOCAL, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n const quat = Bone._TmpQuat;\r\n\r\n this.getRotationQuaternionToRef(space, tNode, quat);\r\n\r\n quat.toEulerAnglesToRef(result);\r\n }\r\n\r\n /**\r\n * Get the quaternion rotation of the bone in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @returns The quaternion rotation\r\n */\r\n public getRotationQuaternion(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Quaternion {\r\n const result = Quaternion.Identity();\r\n\r\n this.getRotationQuaternionToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the quaternion rotation of the bone to a quaternion. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @param result The quaternion that the rotation should be copied to\r\n */\r\n public getRotationQuaternionToRef(space = Space.LOCAL, tNode: Nullable<TransformNode> = null, result: Quaternion): void {\r\n if (space == Space.LOCAL) {\r\n this._decompose();\r\n result.copyFrom(this._localRotation);\r\n } else {\r\n const mat = Bone._TmpMats[0];\r\n const amat = this.getAbsoluteTransform();\r\n\r\n if (tNode) {\r\n amat.multiplyToRef(tNode.getWorldMatrix(), mat);\r\n } else {\r\n mat.copyFrom(amat);\r\n }\r\n\r\n mat.multiplyAtIndex(0, this._scalingDeterminant);\r\n mat.multiplyAtIndex(1, this._scalingDeterminant);\r\n mat.multiplyAtIndex(2, this._scalingDeterminant);\r\n\r\n mat.decompose(undefined, result, undefined);\r\n }\r\n }\r\n\r\n /**\r\n * Get the rotation matrix of the bone in local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @returns The rotation matrix\r\n */\r\n public getRotationMatrix(space = Space.LOCAL, tNode: TransformNode): Matrix {\r\n const result = Matrix.Identity();\r\n\r\n this.getRotationMatrixToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the rotation matrix of the bone to a matrix. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @param result The quaternion that the rotation should be copied to\r\n */\r\n public getRotationMatrixToRef(space = Space.LOCAL, tNode: TransformNode, result: Matrix): void {\r\n if (space == Space.LOCAL) {\r\n this.getLocalMatrix().getRotationMatrixToRef(result);\r\n } else {\r\n const mat = Bone._TmpMats[0];\r\n const amat = this.getAbsoluteTransform();\r\n\r\n if (tNode) {\r\n amat.multiplyToRef(tNode.getWorldMatrix(), mat);\r\n } else {\r\n mat.copyFrom(amat);\r\n }\r\n\r\n mat.multiplyAtIndex(0, this._scalingDeterminant);\r\n mat.multiplyAtIndex(1, this._scalingDeterminant);\r\n mat.multiplyAtIndex(2, this._scalingDeterminant);\r\n\r\n mat.getRotationMatrixToRef(result);\r\n }\r\n }\r\n\r\n /**\r\n * Get the world position of a point that is in the local space of the bone\r\n * @param position The local position\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @returns The world position\r\n */\r\n public getAbsolutePositionFromLocal(position: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getAbsolutePositionFromLocalToRef(position, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get the world position of a point that is in the local space of the bone and copy it to the result param\r\n * @param position The local position\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @param result The vector3 that the world position should be copied to\r\n */\r\n public getAbsolutePositionFromLocalToRef(position: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteTransform();\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, result);\r\n }\r\n\r\n /**\r\n * Get the local position of a point that is in world space\r\n * @param position The world position\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @returns The local position\r\n */\r\n public getLocalPositionFromAbsolute(position: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getLocalPositionFromAbsoluteToRef(position, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get the local position of a point that is in world space and copy it to the result param\r\n * @param position The world position\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @param result The vector3 that the local position should be copied to\r\n */\r\n public getLocalPositionFromAbsoluteToRef(position: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n\r\n if (tNode && wm) {\r\n tmat.multiplyToRef(wm, tmat);\r\n }\r\n\r\n tmat.invert();\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, result);\r\n }\r\n\r\n /**\r\n * Set the current local matrix as the restPose for this bone.\r\n */\r\n public setCurrentPoseAsRest(): void {\r\n this.setRestPose(this.getLocalMatrix());\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"bone.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Bones/bone.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAK3C;;;GAGG;AACH,MAAM,OAAO,IAAK,SAAQ,IAAI;IAiE1B;;;;;;;;;OASG;IACH;IACI;;OAEG;IACI,IAAY,EACnB,QAAkB,EAClB,aAA6B,IAAI,EACjC,cAAgC,IAAI,EACpC,WAA6B,IAAI,EACjC,aAA+B,IAAI,EACnC,QAA0B,IAAI;QAE9B,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAR1B,SAAI,GAAJ,IAAI,CAAQ;QA1EvB;;WAEG;QACI,aAAQ,GAAG,IAAI,KAAK,EAAQ,CAAC;QAEpC,oDAAoD;QAC7C,eAAU,GAAG,IAAI,KAAK,EAAa,CAAC;QAO3C;;;;WAIG;QACI,WAAM,GAAqB,IAAI,CAAC;QAM/B,uBAAkB,GAAG,IAAI,MAAM,EAAE,CAAC;QAClC,+BAA0B,GAAG,IAAI,MAAM,EAAE,CAAC;QAC1C,wBAAmB,GAAG,CAAC,CAAC;QACxB,oBAAe,GAAG,I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\nimport { ArrayTools } from \"../Misc/arrayTools\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport { Node } from \"../node\";\r\nimport { Space } from \"../Maths/math.axis\";\r\n\r\ndeclare type Animation = import(\"../Animations/animation\").Animation;\r\ndeclare type AnimationPropertiesOverride = import(\"../Animations/animationPropertiesOverride\").AnimationPropertiesOverride;\r\n\r\n/**\r\n * Class used to store bone information\r\n * @see https://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons\r\n */\r\nexport class Bone extends Node {\r\n private static _TmpVecs: Vector3[] = ArrayTools.BuildArray(2, Vector3.Zero);\r\n private static _TmpQuat = Quaternion.Identity();\r\n private static _TmpMats: Matrix[] = ArrayTools.BuildArray(5, Matrix.Identity);\r\n\r\n /**\r\n * Gets the list of child bones\r\n */\r\n public children = new Array<Bone>();\r\n\r\n /** Gets the animations associated with this bone */\r\n public animations = new Array<Animation>();\r\n\r\n /**\r\n * Gets or sets bone length\r\n */\r\n public length: number;\r\n\r\n /**\r\n * @hidden Internal only\r\n * Set this value to map this bone to a different index in the transform matrices\r\n * Set this value to -1 to exclude the bone from the transform matrices\r\n */\r\n public _index: Nullable<number> = null;\r\n\r\n private _skeleton: Skeleton;\r\n private _localMatrix: Matrix;\r\n private _restPose: Matrix;\r\n private _baseMatrix: Matrix;\r\n private _absoluteTransform = new Matrix();\r\n private _invertedAbsoluteTransform = new Matrix();\r\n private _scalingDeterminant = 1;\r\n private _worldTransform = new Matrix();\r\n\r\n private _localScaling: Vector3;\r\n private _localRotation: Quaternion;\r\n private _localPosition: Vector3;\r\n private _needToDecompose = true;\r\n private _needToCompose = false;\r\n\r\n /** @hidden */\r\n public _linkedTransformNode: Nullable<TransformNode> = null;\r\n\r\n /** @hidden */\r\n public _waitingTransformNodeId: Nullable<string> = null;\r\n\r\n /** @hidden */\r\n get _matrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /** @hidden */\r\n set _matrix(value: Matrix) {\r\n this._needToCompose = false; // in case there was a pending compose\r\n\r\n // skip if the matrices are the same\r\n if (value.updateFlag === this._localMatrix.updateFlag) {\r\n return;\r\n }\r\n\r\n this._localMatrix.copyFrom(value);\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Create a new bone\r\n * @param name defines the bone name\r\n * @param skeleton defines the parent skeleton\r\n * @param parentBone defines the parent (can be null if the bone is the root)\r\n * @param localMatrix defines the local matrix\r\n * @param restPose defines the rest pose matrix\r\n * @param baseMatrix defines the base matrix\r\n * @param index defines index of the bone in the hierarchy\r\n */\r\n constructor(\r\n /**\r\n * defines the bone name\r\n */\r\n public name: string,\r\n skeleton: Skeleton,\r\n parentBone: Nullable<Bone> = null,\r\n localMatrix: Nullable<Matrix> = null,\r\n restPose: Nullable<Matrix> = null,\r\n baseMatrix: Nullable<Matrix> = null,\r\n index: Nullable<number> = null\r\n ) {\r\n super(name, skeleton.getScene());\r\n this._skeleton = skeleton;\r\n this._localMatrix = localMatrix ? localMatrix.clone() : Matrix.Identity();\r\n this._restPose = restPose ? restPose : this._localMatrix.clone();\r\n this._baseMatrix = baseMatrix ? baseMatrix : this._localMatrix.clone();\r\n this._index = index;\r\n\r\n skeleton.bones.push(this);\r\n\r\n this.setParent(parentBone, false);\r\n\r\n if (baseMatrix || localMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current object class name.\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"Bone\";\r\n }\r\n\r\n // Members\r\n\r\n /**\r\n * Gets the parent skeleton\r\n * @returns a skeleton\r\n */\r\n public getSkeleton(): Skeleton {\r\n return this._skeleton;\r\n }\r\n\r\n public get parent(): Bone {\r\n return this._parentNode as Bone;\r\n }\r\n\r\n /**\r\n * Gets parent bone\r\n * @returns a bone or null if the bone is the root of the bone hierarchy\r\n */\r\n public getParent(): Nullable<Bone> {\r\n return this.parent;\r\n }\r\n\r\n /**\r\n * Returns an array containing the root bones\r\n * @returns an array containing the root bones\r\n */\r\n public getChildren(): Array<Bone> {\r\n return this.children;\r\n }\r\n\r\n /**\r\n * Gets the node index in matrix array generated for rendering\r\n * @returns the node index\r\n */\r\n public getIndex(): number {\r\n return this._index === null ? this.getSkeleton().bones.indexOf(this) : this._index;\r\n }\r\n\r\n public set parent(newParent: Nullable<Bone>) {\r\n this.setParent(newParent);\r\n }\r\n\r\n /**\r\n * Sets the parent bone\r\n * @param parent defines the parent (can be null if the bone is the root)\r\n * @param updateDifferenceMatrix defines if the difference matrix must be updated\r\n */\r\n public setParent(parent: Nullable<Bone>, updateDifferenceMatrix: boolean = true): void {\r\n if (this.parent === parent) {\r\n return;\r\n }\r\n\r\n if (this.parent) {\r\n const index = this.parent.children.indexOf(this);\r\n if (index !== -1) {\r\n this.parent.children.splice(index, 1);\r\n }\r\n }\r\n\r\n this._parentNode = parent;\r\n\r\n if (this.parent) {\r\n this.parent.children.push(this);\r\n }\r\n\r\n if (updateDifferenceMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the local matrix\r\n * @returns a matrix\r\n */\r\n public getLocalMatrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /**\r\n * Gets the base matrix (initial matrix which remains unchanged)\r\n * @returns the base matrix (as known as bind pose matrix)\r\n */\r\n public getBaseMatrix(): Matrix {\r\n return this._baseMatrix;\r\n }\r\n\r\n /**\r\n * Gets the rest pose matrix\r\n * @returns a matrix\r\n */\r\n public getRestPose(): Matrix {\r\n return this._restPose;\r\n }\r\n\r\n /**\r\n * Sets the rest pose matrix\r\n * @param matrix the local-space rest pose to set for this bone\r\n */\r\n public setRestPose(matrix: Matrix): void {\r\n this._restPose.copyFrom(matrix);\r\n }\r\n\r\n /**\r\n * Gets the bind pose matrix\r\n * @returns the bind pose matrix\r\n * @deprecated Please use getBaseMatrix instead\r\n */\r\n public getBindPose(): Matrix {\r\n return this._baseMatrix;\r\n }\r\n\r\n /**\r\n * Sets the bind pose matrix\r\n * @param matrix the local-space bind pose to set for this bone\r\n * @deprecated Please use updateMatrix instead\r\n */\r\n public setBindPose(matrix: Matrix): void {\r\n this.updateMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets a matrix used to store world matrix (ie. the matrix sent to shaders)\r\n */\r\n public getWorldMatrix(): Matrix {\r\n return this._worldTransform;\r\n }\r\n\r\n /**\r\n * Sets the local matrix to rest pose matrix\r\n */\r\n public returnToRest(): void {\r\n if (this._linkedTransformNode) {\r\n const localScaling = TmpVectors.Vector3[0];\r\n const localRotation = TmpVectors.Quaternion[0];\r\n const localPosition = TmpVectors.Vector3[1];\r\n\r\n this.getRestPose().decompose(localScaling, localRotation, localPosition);\r\n\r\n this._linkedTransformNode.position.copyFrom(localPosition);\r\n this._linkedTransformNode.rotationQuaternion = this._linkedTransformNode.rotationQuaternion ?? Quaternion.Identity();\r\n this._linkedTransformNode.rotationQuaternion.copyFrom(localRotation);\r\n this._linkedTransformNode.scaling.copyFrom(localScaling);\r\n } else {\r\n this._matrix = this._restPose;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the inverse of the absolute transform matrix.\r\n * This matrix will be multiplied by local matrix to get the difference matrix (ie. the difference between original state and current state)\r\n * @returns a matrix\r\n */\r\n public getInvertedAbsoluteTransform(): Matrix {\r\n return this._invertedAbsoluteTransform;\r\n }\r\n\r\n /**\r\n * Gets the absolute transform matrix (ie base matrix * parent world matrix)\r\n * @returns a matrix\r\n */\r\n public getAbsoluteTransform(): Matrix {\r\n return this._absoluteTransform;\r\n }\r\n\r\n /**\r\n * Links with the given transform node.\r\n * The local matrix of this bone is copied from the transform node every frame.\r\n * @param transformNode defines the transform node to link to\r\n */\r\n public linkTransformNode(transformNode: Nullable<TransformNode>): void {\r\n if (this._linkedTransformNode) {\r\n this._skeleton._numBonesWithLinkedTransformNode--;\r\n }\r\n\r\n this._linkedTransformNode = transformNode;\r\n\r\n if (this._linkedTransformNode) {\r\n this._skeleton._numBonesWithLinkedTransformNode++;\r\n }\r\n }\r\n\r\n // Properties (matches TransformNode properties)\r\n\r\n /**\r\n * Gets the node used to drive the bone's transformation\r\n * @returns a transform node or null\r\n */\r\n public getTransformNode() {\r\n return this._linkedTransformNode;\r\n }\r\n\r\n /** Gets or sets current position (in local space) */\r\n public get position(): Vector3 {\r\n this._decompose();\r\n return this._localPosition;\r\n }\r\n\r\n public set position(newPosition: Vector3) {\r\n this._decompose();\r\n this._localPosition.copyFrom(newPosition);\r\n\r\n this._markAsDirtyAndCompose();\r\n }\r\n\r\n /** Gets or sets current rotation (in local space) */\r\n public get rotation(): Vector3 {\r\n return this.getRotation();\r\n }\r\n\r\n public set rotation(newRotation: Vector3) {\r\n this.setRotation(newRotation);\r\n }\r\n\r\n /** Gets or sets current rotation quaternion (in local space) */\r\n public get rotationQuaternion() {\r\n this._decompose();\r\n return this._localRotation;\r\n }\r\n\r\n public set rotationQuaternion(newRotation: Quaternion) {\r\n this.setRotationQuaternion(newRotation);\r\n }\r\n\r\n /** Gets or sets current scaling (in local space) */\r\n public get scaling(): Vector3 {\r\n return this.getScale();\r\n }\r\n\r\n public set scaling(newScaling: Vector3) {\r\n this.setScale(newScaling);\r\n }\r\n\r\n /**\r\n * Gets the animation properties override\r\n */\r\n public get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride> {\r\n return this._skeleton.animationPropertiesOverride;\r\n }\r\n\r\n // Methods\r\n private _decompose() {\r\n if (!this._needToDecompose) {\r\n return;\r\n }\r\n\r\n this._needToDecompose = false;\r\n\r\n if (!this._localScaling) {\r\n this._localScaling = Vector3.Zero();\r\n this._localRotation = Quaternion.Zero();\r\n this._localPosition = Vector3.Zero();\r\n }\r\n this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition);\r\n }\r\n\r\n private _compose() {\r\n if (!this._needToCompose) {\r\n return;\r\n }\r\n\r\n if (!this._localScaling) {\r\n this._needToCompose = false;\r\n return;\r\n }\r\n\r\n this._needToCompose = false;\r\n Matrix.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix);\r\n }\r\n\r\n /**\r\n * Update the base and local matrices\r\n * @param matrix defines the new base or local matrix\r\n * @param updateDifferenceMatrix defines if the difference matrix must be updated\r\n * @param updateLocalMatrix defines if the local matrix should be updated\r\n */\r\n public updateMatrix(matrix: Matrix, updateDifferenceMatrix = true, updateLocalMatrix = true): void {\r\n this._baseMatrix.copyFrom(matrix);\r\n\r\n if (updateDifferenceMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n\r\n if (updateLocalMatrix) {\r\n this._matrix = matrix;\r\n } else {\r\n this.markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * @param rootMatrix\r\n * @param updateChildren\r\n * @hidden\r\n */\r\n public _updateDifferenceMatrix(rootMatrix?: Matrix, updateChildren = true): void {\r\n if (!rootMatrix) {\r\n rootMatrix = this._baseMatrix;\r\n }\r\n\r\n if (this.parent) {\r\n rootMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);\r\n } else {\r\n this._absoluteTransform.copyFrom(rootMatrix);\r\n }\r\n\r\n this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform);\r\n\r\n if (updateChildren) {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._updateDifferenceMatrix();\r\n }\r\n }\r\n\r\n this._scalingDeterminant = this._absoluteTransform.determinant() < 0 ? -1 : 1;\r\n }\r\n\r\n /**\r\n * Flag the bone as dirty (Forcing it to update everything)\r\n * @returns this bone\r\n */\r\n public markAsDirty(): Bone {\r\n this._currentRenderId++;\r\n this._childUpdateId++;\r\n this._skeleton._markAsDirty();\r\n return this;\r\n }\r\n\r\n /** @hidden */\r\n public _markAsDirtyAndCompose() {\r\n this.markAsDirty();\r\n this._needToCompose = true;\r\n }\r\n\r\n private _markAsDirtyAndDecompose() {\r\n this.markAsDirty();\r\n this._needToDecompose = true;\r\n }\r\n\r\n /**\r\n * Translate the bone in local or world space\r\n * @param vec The amount to translate the bone\r\n * @param space The space that the translation is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public translate(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n lm.addAtIndex(12, vec.x);\r\n lm.addAtIndex(13, vec.y);\r\n lm.addAtIndex(14, vec.z);\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n const tmat = Bone._TmpMats[0];\r\n const tvec = Bone._TmpVecs[0];\r\n\r\n if (this.parent) {\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n }\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n tmat.setTranslationFromFloats(0, 0, 0);\r\n tmat.invert();\r\n Vector3.TransformCoordinatesToRef(vec, tmat, tvec);\r\n\r\n lm.addAtIndex(12, tvec.x);\r\n lm.addAtIndex(13, tvec.y);\r\n lm.addAtIndex(14, tvec.z);\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Set the position of the bone in local or world space\r\n * @param position The position to set the bone\r\n * @param space The space that the position is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setPosition(position: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n lm.setTranslationFromFloats(position.x, position.y, position.z);\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n const vec = Bone._TmpVecs[0];\r\n\r\n if (this.parent) {\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n }\r\n tmat.invert();\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, vec);\r\n lm.setTranslationFromFloats(vec.x, vec.y, vec.z);\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Set the absolute position of the bone (world space)\r\n * @param position The position to set the bone\r\n * @param tNode The TransformNode that this bone is attached to\r\n */\r\n public setAbsolutePosition(position: Vector3, tNode?: TransformNode) {\r\n this.setPosition(position, Space.WORLD, tNode);\r\n }\r\n\r\n /**\r\n * Scale the bone on the x, y and z axes (in local space)\r\n * @param x The amount to scale the bone on the x axis\r\n * @param y The amount to scale the bone on the y axis\r\n * @param z The amount to scale the bone on the z axis\r\n * @param scaleChildren sets this to true if children of the bone should be scaled as well (false by default)\r\n */\r\n public scale(x: number, y: number, z: number, scaleChildren = false): void {\r\n const locMat = this.getLocalMatrix();\r\n\r\n // Apply new scaling on top of current local matrix\r\n const scaleMat = Bone._TmpMats[0];\r\n Matrix.ScalingToRef(x, y, z, scaleMat);\r\n scaleMat.multiplyToRef(locMat, locMat);\r\n\r\n // Invert scaling matrix and apply the inverse to all children\r\n scaleMat.invert();\r\n\r\n for (const child of this.children) {\r\n const cm = child.getLocalMatrix();\r\n cm.multiplyToRef(scaleMat, cm);\r\n cm.multiplyAtIndex(12, x);\r\n cm.multiplyAtIndex(13, y);\r\n cm.multiplyAtIndex(14, z);\r\n\r\n child._markAsDirtyAndDecompose();\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n\r\n if (scaleChildren) {\r\n for (const child of this.children) {\r\n child.scale(x, y, z, scaleChildren);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Set the bone scaling in local space\r\n * @param scale defines the scaling vector\r\n */\r\n public setScale(scale: Vector3): void {\r\n this._decompose();\r\n this._localScaling.copyFrom(scale);\r\n this._markAsDirtyAndCompose();\r\n }\r\n\r\n /**\r\n * Gets the current scaling in local space\r\n * @returns the current scaling vector\r\n */\r\n public getScale(): Vector3 {\r\n this._decompose();\r\n return this._localScaling;\r\n }\r\n\r\n /**\r\n * Gets the current scaling in local space and stores it in a target vector\r\n * @param result defines the target vector\r\n */\r\n public getScaleToRef(result: Vector3) {\r\n this._decompose();\r\n result.copyFrom(this._localScaling);\r\n }\r\n\r\n /**\r\n * Set the yaw, pitch, and roll of the bone in local or world space\r\n * @param yaw The rotation of the bone on the y axis\r\n * @param pitch The rotation of the bone on the x axis\r\n * @param roll The rotation of the bone on the z axis\r\n * @param space The space that the axes of rotation are in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setYawPitchRoll(yaw: number, pitch: number, roll: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, quat);\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getNegativeRotationToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Add a rotation to the bone on an axis in local or world space\r\n * @param axis The axis to rotate the bone on\r\n * @param amount The amount to rotate the bone\r\n * @param space The space that the axis is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public rotate(axis: Vector3, amount: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const rmat = Bone._TmpMats[0];\r\n rmat.setTranslationFromFloats(0, 0, 0);\r\n Matrix.RotationAxisToRef(axis, amount, rmat);\r\n this._rotateWithMatrix(rmat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the rotation of the bone to a particular axis angle in local or world space\r\n * @param axis The axis to rotate the bone on\r\n * @param angle The angle that the bone should be rotated to\r\n * @param space The space that the axis is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setAxisAngle(axis: Vector3, angle: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.RotationAxisToRef(axis, angle, quat);\r\n\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getNegativeRotationToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.RotationAxisToRef(axis, angle, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the euler rotation of the bone in local or world space\r\n * @param rotation The euler rotation that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setRotation(rotation: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this.setYawPitchRoll(rotation.y, rotation.x, rotation.z, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the quaternion rotation of the bone in local or world space\r\n * @param quat The quaternion rotation that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setRotationQuaternion(quat: Quaternion, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n this._decompose();\r\n this._localRotation.copyFrom(quat);\r\n\r\n this._markAsDirtyAndCompose();\r\n\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getNegativeRotationToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.FromQuaternionToRef(quat, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the rotation matrix of the bone in local or world space\r\n * @param rotMat The rotation matrix that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setRotationMatrix(rotMat: Matrix, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.FromRotationMatrixToRef(rotMat, quat);\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getNegativeRotationToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat2 = Bone._TmpMats[1];\r\n rotMat2.copyFrom(rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat2);\r\n\r\n this._rotateWithMatrix(rotMat2, space, tNode);\r\n }\r\n\r\n private _rotateWithMatrix(rmat: Matrix, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lmat = this.getLocalMatrix();\r\n const lx = lmat.m[12];\r\n const ly = lmat.m[13];\r\n const lz = lmat.m[14];\r\n const parent = this.getParent();\r\n const parentScale = Bone._TmpMats[3];\r\n const parentScaleInv = Bone._TmpMats[4];\r\n\r\n if (parent && space == Space.WORLD) {\r\n if (tNode) {\r\n parentScale.copyFrom(tNode.getWorldMatrix());\r\n parent.getAbsoluteTransform().multiplyToRef(parentScale, parentScale);\r\n } else {\r\n parentScale.copyFrom(parent.getAbsoluteTransform());\r\n }\r\n parentScaleInv.copyFrom(parentScale);\r\n parentScaleInv.invert();\r\n lmat.multiplyToRef(parentScale, lmat);\r\n lmat.multiplyToRef(rmat, lmat);\r\n lmat.multiplyToRef(parentScaleInv, lmat);\r\n } else {\r\n if (space == Space.WORLD && tNode) {\r\n parentScale.copyFrom(tNode.getWorldMatrix());\r\n parentScaleInv.copyFrom(parentScale);\r\n parentScaleInv.invert();\r\n lmat.multiplyToRef(parentScale, lmat);\r\n lmat.multiplyToRef(rmat, lmat);\r\n lmat.multiplyToRef(parentScaleInv, lmat);\r\n } else {\r\n lmat.multiplyToRef(rmat, lmat);\r\n }\r\n }\r\n\r\n lmat.setTranslationFromFloats(lx, ly, lz);\r\n\r\n this.computeAbsoluteTransforms();\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n private _getNegativeRotationToRef(rotMatInv: Matrix, tNode?: TransformNode): boolean {\r\n const scaleMatrix = Bone._TmpMats[2];\r\n rotMatInv.copyFrom(this.getAbsoluteTransform());\r\n\r\n if (tNode) {\r\n rotMatInv.multiplyToRef(tNode.getWorldMatrix(), rotMatInv);\r\n Matrix.ScalingToRef(tNode.scaling.x, tNode.scaling.y, tNode.scaling.z, scaleMatrix);\r\n } else {\r\n Matrix.IdentityToRef(scaleMatrix);\r\n }\r\n\r\n rotMatInv.invert();\r\n if (isNaN(rotMatInv.m[0])) {\r\n // Matrix failed to invert.\r\n // This can happen if scale is zero for example.\r\n return false;\r\n }\r\n\r\n scaleMatrix.multiplyAtIndex(0, this._scalingDeterminant);\r\n rotMatInv.multiplyToRef(scaleMatrix, rotMatInv);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Get the position of the bone in local or world space\r\n * @param space The space that the returned position is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @returns The position of the bone\r\n */\r\n public getPosition(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const pos = Vector3.Zero();\r\n\r\n this.getPositionToRef(space, tNode, pos);\r\n\r\n return pos;\r\n }\r\n\r\n /**\r\n * Copy the position of the bone to a vector3 in local or world space\r\n * @param space The space that the returned position is in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @param result The vector3 to copy the position to\r\n */\r\n public getPositionToRef(space = Space.LOCAL, tNode: Nullable<TransformNode>, result: Vector3): void {\r\n if (space == Space.LOCAL) {\r\n const lm = this.getLocalMatrix();\r\n\r\n result.x = lm.m[12];\r\n result.y = lm.m[13];\r\n result.z = lm.m[14];\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteTransform();\r\n }\r\n\r\n result.x = tmat.m[12];\r\n result.y = tmat.m[13];\r\n result.z = tmat.m[14];\r\n }\r\n }\r\n\r\n /**\r\n * Get the absolute position of the bone (world space)\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @returns The absolute position of the bone\r\n */\r\n public getAbsolutePosition(tNode: Nullable<TransformNode> = null): Vector3 {\r\n const pos = Vector3.Zero();\r\n\r\n this.getPositionToRef(Space.WORLD, tNode, pos);\r\n\r\n return pos;\r\n }\r\n\r\n /**\r\n * Copy the absolute position of the bone (world space) to the result param\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @param result The vector3 to copy the absolute position to\r\n */\r\n public getAbsolutePositionToRef(tNode: TransformNode, result: Vector3) {\r\n this.getPositionToRef(Space.WORLD, tNode, result);\r\n }\r\n\r\n /**\r\n * Compute the absolute transforms of this bone and its children\r\n */\r\n public computeAbsoluteTransforms(): void {\r\n this._compose();\r\n\r\n if (this.parent) {\r\n this._localMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);\r\n } else {\r\n this._absoluteTransform.copyFrom(this._localMatrix);\r\n\r\n const poseMatrix = this._skeleton.getPoseMatrix();\r\n\r\n if (poseMatrix) {\r\n this._absoluteTransform.multiplyToRef(poseMatrix, this._absoluteTransform);\r\n }\r\n }\r\n\r\n const children = this.children;\r\n const len = children.length;\r\n\r\n for (let i = 0; i < len; i++) {\r\n children[i].computeAbsoluteTransforms();\r\n }\r\n }\r\n\r\n /**\r\n * Get the world direction from an axis that is in the local space of the bone\r\n * @param localAxis The local direction that is used to compute the world direction\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @returns The world direction\r\n */\r\n public getDirection(localAxis: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getDirectionToRef(localAxis, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the world direction to a vector3 from an axis that is in the local space of the bone\r\n * @param localAxis The local direction that is used to compute the world direction\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @param result The vector3 that the world direction will be copied to\r\n */\r\n public getDirectionToRef(localAxis: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const mat = Bone._TmpMats[0];\r\n\r\n mat.copyFrom(this.getAbsoluteTransform());\r\n\r\n if (tNode && wm) {\r\n mat.multiplyToRef(wm, mat);\r\n }\r\n\r\n Vector3.TransformNormalToRef(localAxis, mat, result);\r\n\r\n result.normalize();\r\n }\r\n\r\n /**\r\n * Get the euler rotation of the bone in local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @returns The euler rotation\r\n */\r\n public getRotation(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getRotationToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the euler rotation of the bone to a vector3. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @param result The vector3 that the rotation should be copied to\r\n */\r\n public getRotationToRef(space = Space.LOCAL, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n const quat = Bone._TmpQuat;\r\n\r\n this.getRotationQuaternionToRef(space, tNode, quat);\r\n\r\n quat.toEulerAnglesToRef(result);\r\n }\r\n\r\n /**\r\n * Get the quaternion rotation of the bone in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @returns The quaternion rotation\r\n */\r\n public getRotationQuaternion(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Quaternion {\r\n const result = Quaternion.Identity();\r\n\r\n this.getRotationQuaternionToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the quaternion rotation of the bone to a quaternion. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @param result The quaternion that the rotation should be copied to\r\n */\r\n public getRotationQuaternionToRef(space = Space.LOCAL, tNode: Nullable<TransformNode> = null, result: Quaternion): void {\r\n if (space == Space.LOCAL) {\r\n this._decompose();\r\n result.copyFrom(this._localRotation);\r\n } else {\r\n const mat = Bone._TmpMats[0];\r\n const amat = this.getAbsoluteTransform();\r\n\r\n if (tNode) {\r\n amat.multiplyToRef(tNode.getWorldMatrix(), mat);\r\n } else {\r\n mat.copyFrom(amat);\r\n }\r\n\r\n mat.multiplyAtIndex(0, this._scalingDeterminant);\r\n mat.multiplyAtIndex(1, this._scalingDeterminant);\r\n mat.multiplyAtIndex(2, this._scalingDeterminant);\r\n\r\n mat.decompose(undefined, result, undefined);\r\n }\r\n }\r\n\r\n /**\r\n * Get the rotation matrix of the bone in local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @returns The rotation matrix\r\n */\r\n public getRotationMatrix(space = Space.LOCAL, tNode: TransformNode): Matrix {\r\n const result = Matrix.Identity();\r\n\r\n this.getRotationMatrixToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the rotation matrix of the bone to a matrix. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n * @param result The quaternion that the rotation should be copied to\r\n */\r\n public getRotationMatrixToRef(space = Space.LOCAL, tNode: TransformNode, result: Matrix): void {\r\n if (space == Space.LOCAL) {\r\n this.getLocalMatrix().getRotationMatrixToRef(result);\r\n } else {\r\n const mat = Bone._TmpMats[0];\r\n const amat = this.getAbsoluteTransform();\r\n\r\n if (tNode) {\r\n amat.multiplyToRef(tNode.getWorldMatrix(), mat);\r\n } else {\r\n mat.copyFrom(amat);\r\n }\r\n\r\n mat.multiplyAtIndex(0, this._scalingDeterminant);\r\n mat.multiplyAtIndex(1, this._scalingDeterminant);\r\n mat.multiplyAtIndex(2, this._scalingDeterminant);\r\n\r\n mat.getRotationMatrixToRef(result);\r\n }\r\n }\r\n\r\n /**\r\n * Get the world position of a point that is in the local space of the bone\r\n * @param position The local position\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @returns The world position\r\n */\r\n public getAbsolutePositionFromLocal(position: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getAbsolutePositionFromLocalToRef(position, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get the world position of a point that is in the local space of the bone and copy it to the result param\r\n * @param position The local position\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @param result The vector3 that the world position should be copied to\r\n */\r\n public getAbsolutePositionFromLocalToRef(position: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteTransform();\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, result);\r\n }\r\n\r\n /**\r\n * Get the local position of a point that is in world space\r\n * @param position The world position\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @returns The local position\r\n */\r\n public getLocalPositionFromAbsolute(position: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getLocalPositionFromAbsoluteToRef(position, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get the local position of a point that is in world space and copy it to the result param\r\n * @param position The world position\r\n * @param tNode The TransformNode that this bone is attached to\r\n * @param result The vector3 that the local position should be copied to\r\n */\r\n public getLocalPositionFromAbsoluteToRef(position: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n\r\n if (tNode && wm) {\r\n tmat.multiplyToRef(wm, tmat);\r\n }\r\n\r\n tmat.invert();\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, result);\r\n }\r\n\r\n /**\r\n * Set the current local matrix as the restPose for this bone.\r\n */\r\n public setCurrentPoseAsRest(): void {\r\n this.setRestPose(this.getLocalMatrix());\r\n }\r\n}\r\n"]}
@@ -102,7 +102,7 @@ export declare class Skeleton implements IAnimatable {
102
102
  id: string, scene: Scene);
103
103
  /**
104
104
  * Gets the current object class name.
105
- * @return the class name
105
+ * @returns the class name
106
106
  */
107
107
  getClassName(): string;
108
108
  /**
@@ -136,7 +136,7 @@ export declare class Skeleton implements IAnimatable {
136
136
  /**
137
137
  * Get bone's index searching by name
138
138
  * @param name defines bone's name to search for
139
- * @return the indice of the bone. Returns -1 if not found
139
+ * @returns the indice of the bone. Returns -1 if not found
140
140
  */
141
141
  getBoneIndexByName(name: string): number;
142
142
  /**
package/Bones/skeleton.js CHANGED
@@ -104,7 +104,7 @@ export class Skeleton {
104
104
  }
105
105
  /**
106
106
  * Gets the current object class name.
107
- * @return the class name
107
+ * @returns the class name
108
108
  */
109
109
  getClassName() {
110
110
  return "Skeleton";
@@ -178,7 +178,7 @@ export class Skeleton {
178
178
  /**
179
179
  * Get bone's index searching by name
180
180
  * @param name defines bone's name to search for
181
- * @return the indice of the bone. Returns -1 if not found
181
+ * @returns the indice of the bone. Returns -1 if not found
182
182
  */
183
183
  getBoneIndexByName(name) {
184
184
  for (let boneIndex = 0, cache = this.bones.length; boneIndex < cache; boneIndex++) {
@@ -415,9 +415,15 @@ export class Skeleton {
415
415
  if (this._numBonesWithLinkedTransformNode > 0) {
416
416
  for (const bone of this.bones) {
417
417
  if (bone._linkedTransformNode) {
418
- // Computing the world matrix also computes the local matrix.
419
- bone._linkedTransformNode.computeWorldMatrix();
420
- bone._matrix = bone._linkedTransformNode._localMatrix;
418
+ const node = bone._linkedTransformNode;
419
+ bone.position = node.position;
420
+ if (node.rotationQuaternion) {
421
+ bone.rotationQuaternion = node.rotationQuaternion;
422
+ }
423
+ else {
424
+ bone.rotation = node.rotation;
425
+ }
426
+ bone.scaling = node.scaling;
421
427
  }
422
428
  }
423
429
  }