@babylonjs/core 7.12.0 → 7.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (526) hide show
  1. package/Animations/animation.js +1 -2
  2. package/Animations/animation.js.map +1 -1
  3. package/Animations/animationGroupMask.d.ts +1 -1
  4. package/Animations/animationGroupMask.js +2 -2
  5. package/Animations/animationGroupMask.js.map +1 -1
  6. package/Animations/animationKey.d.ts +1 -1
  7. package/Animations/animationKey.js.map +1 -1
  8. package/Behaviors/Meshes/handConstraintBehavior.d.ts +3 -3
  9. package/Behaviors/Meshes/handConstraintBehavior.js +16 -17
  10. package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
  11. package/Behaviors/Meshes/sixDofDragBehavior.js +2 -3
  12. package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
  13. package/Bones/bone.js +31 -32
  14. package/Bones/bone.js.map +1 -1
  15. package/Bones/boneIKController.js +5 -6
  16. package/Bones/boneIKController.js.map +1 -1
  17. package/Bones/boneLookController.js +13 -13
  18. package/Bones/boneLookController.js.map +1 -1
  19. package/Buffers/bufferUtils.d.ts +13 -0
  20. package/Buffers/bufferUtils.js +42 -0
  21. package/Buffers/bufferUtils.js.map +1 -0
  22. package/Buffers/index.d.ts +1 -0
  23. package/Buffers/index.js +1 -0
  24. package/Buffers/index.js.map +1 -1
  25. package/Cameras/Inputs/freeCameraMouseWheelInput.js +5 -6
  26. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  27. package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +5 -5
  28. package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
  29. package/Cameras/VR/vrExperienceHelper.js +8 -10
  30. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  31. package/Compute/computeEffect.js +2 -3
  32. package/Compute/computeEffect.js.map +1 -1
  33. package/Compute/computeShader.js +19 -20
  34. package/Compute/computeShader.js.map +1 -1
  35. package/Culling/Helper/IBoundingInfoHelperPlatform.d.ts +4 -0
  36. package/Culling/Helper/IBoundingInfoHelperPlatform.js.map +1 -1
  37. package/Culling/Helper/boundingInfoHelper.d.ts +26 -4
  38. package/Culling/Helper/boundingInfoHelper.js +41 -10
  39. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  40. package/Culling/Helper/computeShaderBoundingHelper.d.ts +12 -3
  41. package/Culling/Helper/computeShaderBoundingHelper.js +164 -76
  42. package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
  43. package/Culling/Helper/transformFeedbackBoundingHelper.d.ts +11 -0
  44. package/Culling/Helper/transformFeedbackBoundingHelper.js +46 -14
  45. package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
  46. package/Debug/debugLayer.d.ts +1 -1
  47. package/Debug/debugLayer.js.map +1 -1
  48. package/Decorators/nodeDecorator.d.ts +1 -1
  49. package/Decorators/nodeDecorator.js +1 -1
  50. package/Decorators/nodeDecorator.js.map +1 -1
  51. package/DeviceInput/InputDevices/deviceEnums.d.ts +5 -5
  52. package/DeviceInput/InputDevices/deviceEnums.js.map +1 -1
  53. package/DeviceInput/eventFactory.js +3 -3
  54. package/DeviceInput/eventFactory.js.map +1 -1
  55. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +2 -2
  56. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
  57. package/Engines/Extensions/engine.computeShader.d.ts +1 -1
  58. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  59. package/Engines/Extensions/engine.cubeTexture.js +2 -2
  60. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  61. package/Engines/Extensions/engine.dynamicTexture.js +2 -2
  62. package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
  63. package/Engines/Extensions/engine.multiRender.js +3 -3
  64. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  65. package/Engines/Extensions/engine.multiview.js +2 -2
  66. package/Engines/Extensions/engine.multiview.js.map +1 -1
  67. package/Engines/Extensions/engine.prefilteredCubeTexture.js +3 -3
  68. package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
  69. package/Engines/Extensions/engine.rawTexture.js +4 -4
  70. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  71. package/Engines/Extensions/engine.renderTarget.js +3 -3
  72. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  73. package/Engines/Extensions/engine.renderTargetCube.js +2 -2
  74. package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
  75. package/Engines/Native/nativeShaderProcessors.js +1 -2
  76. package/Engines/Native/nativeShaderProcessors.js.map +1 -1
  77. package/Engines/Processors/shaderProcessor.js +2 -3
  78. package/Engines/Processors/shaderProcessor.js.map +1 -1
  79. package/Engines/WebGL/webGL2ShaderProcessors.js +1 -2
  80. package/Engines/WebGL/webGL2ShaderProcessors.js.map +1 -1
  81. package/Engines/WebGL/webGLShaderProcessors.js +1 -2
  82. package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
  83. package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -2
  84. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  85. package/Engines/WebGPU/Extensions/engine.cubeTexture.js +2 -2
  86. package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
  87. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +2 -2
  88. package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
  89. package/Engines/WebGPU/Extensions/engine.multiRender.js +2 -2
  90. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  91. package/Engines/WebGPU/Extensions/engine.rawTexture.js +5 -5
  92. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  93. package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -3
  94. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  95. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +2 -2
  96. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
  97. package/Engines/WebGPU/webgpuBufferManager.js +1 -1
  98. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  99. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +81 -82
  100. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  101. package/Engines/WebGPU/webgpuCacheSampler.js +60 -64
  102. package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
  103. package/Engines/WebGPU/webgpuClearQuad.js +1 -2
  104. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  105. package/Engines/WebGPU/webgpuComputeContext.js +13 -15
  106. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  107. package/Engines/WebGPU/webgpuConstants.d.ts +39 -39
  108. package/Engines/WebGPU/webgpuConstants.js.map +1 -1
  109. package/Engines/WebGPU/webgpuHardwareTexture.js +6 -8
  110. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  111. package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -2
  112. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  113. package/Engines/WebGPU/webgpuQuerySet.js +3 -3
  114. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  115. package/Engines/WebGPU/webgpuShaderProcessor.js +15 -19
  116. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  117. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +8 -10
  118. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  119. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +26 -28
  120. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  121. package/Engines/WebGPU/webgpuTextureHelper.js +413 -416
  122. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  123. package/Engines/WebGPU/webgpuTextureManager.js +50 -51
  124. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  125. package/Engines/WebGPU/webgpuTimestampQuery.js +1 -2
  126. package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
  127. package/Engines/abstractEngine.js +4 -4
  128. package/Engines/abstractEngine.js.map +1 -1
  129. package/Engines/engine.js +2 -2
  130. package/Engines/engine.js.map +1 -1
  131. package/Engines/nativeEngine.js +9 -9
  132. package/Engines/nativeEngine.js.map +1 -1
  133. package/Engines/nullEngine.js +5 -5
  134. package/Engines/nullEngine.js.map +1 -1
  135. package/Engines/renderTargetWrapper.js +1 -2
  136. package/Engines/renderTargetWrapper.js.map +1 -1
  137. package/Engines/shaderStore.js +6 -7
  138. package/Engines/shaderStore.js.map +1 -1
  139. package/Engines/thinEngine.js +4 -5
  140. package/Engines/thinEngine.js.map +1 -1
  141. package/Engines/webgpuEngine.d.ts +11 -0
  142. package/Engines/webgpuEngine.js +91 -72
  143. package/Engines/webgpuEngine.js.map +1 -1
  144. package/Events/deviceInputEvents.d.ts +1 -1
  145. package/Events/deviceInputEvents.js.map +1 -1
  146. package/FlowGraph/flowGraph.d.ts +1 -1
  147. package/FlowGraph/flowGraph.js +5 -5
  148. package/FlowGraph/flowGraph.js.map +1 -1
  149. package/FlowGraph/flowGraphBlock.js +2 -3
  150. package/FlowGraph/flowGraphBlock.js.map +1 -1
  151. package/FlowGraph/flowGraphConnection.d.ts +1 -1
  152. package/FlowGraph/flowGraphConnection.js.map +1 -1
  153. package/FlowGraph/flowGraphDataConnection.js +3 -3
  154. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  155. package/FlowGraph/flowGraphExecutionBlock.js +2 -3
  156. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  157. package/FlowGraph/flowGraphSignalConnection.js +3 -3
  158. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  159. package/Gamepads/dualShockGamepad.d.ts +2 -2
  160. package/Gamepads/dualShockGamepad.js +14 -14
  161. package/Gamepads/dualShockGamepad.js.map +1 -1
  162. package/Gamepads/xboxGamepad.d.ts +2 -2
  163. package/Gamepads/xboxGamepad.js +14 -14
  164. package/Gamepads/xboxGamepad.js.map +1 -1
  165. package/Gizmos/gizmo.d.ts +2 -2
  166. package/Gizmos/gizmo.js +4 -4
  167. package/Gizmos/gizmo.js.map +1 -1
  168. package/Gizmos/gizmoManager.js +2 -2
  169. package/Gizmos/gizmoManager.js.map +1 -1
  170. package/Gizmos/scaleGizmo.js +3 -3
  171. package/Gizmos/scaleGizmo.js.map +1 -1
  172. package/Loading/sceneLoader.d.ts +1 -1
  173. package/Loading/sceneLoader.js +6 -6
  174. package/Loading/sceneLoader.js.map +1 -1
  175. package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +3 -3
  176. package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -1
  177. package/Materials/GreasedLine/greasedLinePluginMaterial.js +10 -11
  178. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  179. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +8 -9
  180. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  181. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +3 -4
  182. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  183. package/Materials/Node/Blocks/Dual/fogBlock.js +2 -3
  184. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  185. package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -2
  186. package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
  187. package/Materials/Node/Blocks/Dual/lightBlock.js +5 -6
  188. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  189. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +4 -5
  190. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  191. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +7 -8
  192. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  193. package/Materials/Node/Blocks/Dual/textureBlock.js +4 -6
  194. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  195. package/Materials/Node/Blocks/Fragment/TBNBlock.js +2 -4
  196. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  197. package/Materials/Node/Blocks/Fragment/derivativeBlock.js +1 -2
  198. package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
  199. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -2
  200. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
  201. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +1 -2
  202. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
  203. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +5 -6
  204. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  205. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -2
  206. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
  207. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +5 -6
  208. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  209. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +3 -4
  210. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  211. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +7 -9
  212. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  213. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +1 -2
  214. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
  215. package/Materials/Node/Blocks/Input/inputBlock.js +19 -21
  216. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  217. package/Materials/Node/Blocks/Input/prePassTextureBlock.js +3 -4
  218. package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
  219. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -3
  220. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  221. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +4 -5
  222. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  223. package/Materials/Node/Blocks/PBR/iridescenceBlock.js +1 -2
  224. package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
  225. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +28 -29
  226. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  227. package/Materials/Node/Blocks/PBR/reflectionBlock.js +4 -5
  228. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  229. package/Materials/Node/Blocks/PBR/refractionBlock.js +5 -6
  230. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  231. package/Materials/Node/Blocks/PBR/sheenBlock.js +4 -5
  232. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  233. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +2 -3
  234. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  235. package/Materials/Node/Blocks/Vertex/instancesBlock.js +1 -2
  236. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  237. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +1 -2
  238. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
  239. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +1 -2
  240. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  241. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +1 -2
  242. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
  243. package/Materials/Node/Blocks/arcTan2Block.js +1 -2
  244. package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
  245. package/Materials/Node/Blocks/biPlanarBlock.js +3 -4
  246. package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
  247. package/Materials/Node/Blocks/clampBlock.js +4 -5
  248. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  249. package/Materials/Node/Blocks/cloudBlock.js +3 -4
  250. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  251. package/Materials/Node/Blocks/curveBlock.js +1 -2
  252. package/Materials/Node/Blocks/curveBlock.js.map +1 -1
  253. package/Materials/Node/Blocks/customBlock.js +1 -2
  254. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  255. package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -2
  256. package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
  257. package/Materials/Node/Blocks/meshAttributeExistsBlock.d.ts +1 -1
  258. package/Materials/Node/Blocks/meshAttributeExistsBlock.js +35 -35
  259. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  260. package/Materials/Node/Blocks/modBlock.js +1 -2
  261. package/Materials/Node/Blocks/modBlock.js.map +1 -1
  262. package/Materials/Node/Blocks/remapBlock.js +3 -3
  263. package/Materials/Node/Blocks/remapBlock.js.map +1 -1
  264. package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -2
  265. package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
  266. package/Materials/Node/Blocks/transformBlock.js +1 -2
  267. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  268. package/Materials/Node/Blocks/triPlanarBlock.js +10 -12
  269. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  270. package/Materials/Node/Blocks/voronoiNoiseBlock.js +3 -4
  271. package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
  272. package/Materials/Node/Blocks/waveBlock.d.ts +1 -1
  273. package/Materials/Node/Blocks/waveBlock.js +4 -4
  274. package/Materials/Node/Blocks/waveBlock.js.map +1 -1
  275. package/Materials/Node/Blocks/worleyNoise3DBlock.js +3 -4
  276. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  277. package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.d.ts +1 -1
  278. package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.js.map +1 -1
  279. package/Materials/Node/nodeMaterial.js +3 -4
  280. package/Materials/Node/nodeMaterial.js.map +1 -1
  281. package/Materials/Node/nodeMaterialBlock.js +5 -6
  282. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  283. package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +2 -2
  284. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +10 -10
  285. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  286. package/Materials/Node/nodeMaterialBuildState.js +18 -19
  287. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  288. package/Materials/Node/nodeMaterialConnectionPointCustomObject.js +3 -3
  289. package/Materials/Node/nodeMaterialConnectionPointCustomObject.js.map +1 -1
  290. package/Materials/PBR/pbrBaseMaterial.js +3 -4
  291. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  292. package/Materials/Textures/internalTexture.d.ts +1 -1
  293. package/Materials/Textures/internalTexture.js +13 -13
  294. package/Materials/Textures/internalTexture.js.map +1 -1
  295. package/Materials/Textures/ktx2decoderTypes.d.ts +1 -1
  296. package/Materials/Textures/ktx2decoderTypes.js.map +1 -1
  297. package/Materials/Textures/rawCubeTexture.js +1 -2
  298. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  299. package/Materials/effect.functions.js +2 -3
  300. package/Materials/effect.functions.js.map +1 -1
  301. package/Materials/effect.js +3 -4
  302. package/Materials/effect.js.map +1 -1
  303. package/Materials/effect.webgl.functions.js +1 -2
  304. package/Materials/effect.webgl.functions.js.map +1 -1
  305. package/Materials/material.js +7 -9
  306. package/Materials/material.js.map +1 -1
  307. package/Materials/materialPluginEvent.d.ts +1 -1
  308. package/Materials/materialPluginEvent.js.map +1 -1
  309. package/Materials/materialPluginManager.js +9 -11
  310. package/Materials/materialPluginManager.js.map +1 -1
  311. package/Materials/meshDebugPluginMaterial.d.ts +1 -1
  312. package/Materials/meshDebugPluginMaterial.js +2 -2
  313. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  314. package/Materials/shaderLanguage.d.ts +1 -1
  315. package/Materials/shaderLanguage.js.map +1 -1
  316. package/Materials/shadowDepthWrapper.js +1 -2
  317. package/Materials/shadowDepthWrapper.js.map +1 -1
  318. package/Materials/standardMaterial.js +2 -3
  319. package/Materials/standardMaterial.js.map +1 -1
  320. package/Maths/math.axis.d.ts +2 -2
  321. package/Maths/math.axis.js.map +1 -1
  322. package/Maths/math.path.d.ts +1 -1
  323. package/Maths/math.path.js +3 -3
  324. package/Maths/math.path.js.map +1 -1
  325. package/Maths/math.vector.js +32 -6
  326. package/Maths/math.vector.js.map +1 -1
  327. package/Meshes/Builders/greasedLineBuilder.d.ts +2 -2
  328. package/Meshes/Builders/greasedLineBuilder.js +21 -23
  329. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  330. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +3 -3
  331. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  332. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +14 -14
  333. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  334. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +2 -2
  335. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  336. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +2 -2
  337. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
  338. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +3 -3
  339. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
  340. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +3 -3
  341. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
  342. package/Meshes/Node/Blocks/Set/setColorsBlock.js +2 -2
  343. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  344. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +2 -2
  345. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
  346. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +2 -2
  347. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  348. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +2 -2
  349. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  350. package/Meshes/Node/Blocks/Set/setTangentsBlock.js +2 -2
  351. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  352. package/Meshes/Node/Blocks/Set/setUVsBlock.js +3 -3
  353. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  354. package/Meshes/Node/Blocks/Sources/boxBlock.js +2 -2
  355. package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
  356. package/Meshes/Node/Blocks/Sources/capsuleBlock.js +2 -2
  357. package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
  358. package/Meshes/Node/Blocks/Sources/cylinderBlock.js +2 -2
  359. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  360. package/Meshes/Node/Blocks/Sources/discBlock.js +2 -2
  361. package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
  362. package/Meshes/Node/Blocks/Sources/gridBlock.js +2 -2
  363. package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
  364. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +2 -2
  365. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
  366. package/Meshes/Node/Blocks/Sources/meshBlock.js +2 -2
  367. package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
  368. package/Meshes/Node/Blocks/Sources/planeBlock.js +2 -2
  369. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  370. package/Meshes/Node/Blocks/Sources/sphereBlock.js +2 -2
  371. package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
  372. package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -2
  373. package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
  374. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +2 -2
  375. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
  376. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +2 -2
  377. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
  378. package/Meshes/Node/Blocks/booleanGeometryBlock.js +3 -3
  379. package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
  380. package/Meshes/Node/Blocks/conditionBlock.js +2 -2
  381. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  382. package/Meshes/Node/Blocks/geometryClampBlock.js +3 -3
  383. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  384. package/Meshes/Node/Blocks/geometryCollectionBlock.js +2 -2
  385. package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
  386. package/Meshes/Node/Blocks/geometryCurveBlock.js +2 -2
  387. package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
  388. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +3 -3
  389. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  390. package/Meshes/Node/Blocks/geometryTransformBlock.js +2 -2
  391. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  392. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +2 -2
  393. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
  394. package/Meshes/Node/Blocks/mappingBlock.js +2 -2
  395. package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
  396. package/Meshes/Node/Blocks/mathBlock.js +2 -2
  397. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  398. package/Meshes/Node/Blocks/mergeGeometryBlock.js +2 -2
  399. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  400. package/Meshes/Node/Blocks/randomBlock.js +2 -2
  401. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  402. package/Meshes/Node/nodeGeometryBlock.js +3 -3
  403. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  404. package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +2 -2
  405. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +7 -7
  406. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  407. package/Meshes/abstractMesh.d.ts +49 -17
  408. package/Meshes/abstractMesh.js +128 -133
  409. package/Meshes/abstractMesh.js.map +1 -1
  410. package/Meshes/geometry.d.ts +8 -0
  411. package/Meshes/geometry.js +17 -0
  412. package/Meshes/geometry.js.map +1 -1
  413. package/Meshes/instancedMesh.d.ts +5 -8
  414. package/Meshes/instancedMesh.js +15 -9
  415. package/Meshes/instancedMesh.js.map +1 -1
  416. package/Meshes/mesh.d.ts +7 -3
  417. package/Meshes/mesh.js +21 -13
  418. package/Meshes/mesh.js.map +1 -1
  419. package/Meshes/meshSimplification.d.ts +1 -1
  420. package/Meshes/meshSimplification.js +1 -1
  421. package/Meshes/meshSimplification.js.map +1 -1
  422. package/Meshes/meshSimplificationSceneComponent.js +2 -2
  423. package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
  424. package/Meshes/transformNode.js +7 -8
  425. package/Meshes/transformNode.js.map +1 -1
  426. package/Misc/assetsManager.d.ts +1 -1
  427. package/Misc/assetsManager.js +9 -9
  428. package/Misc/assetsManager.js.map +1 -1
  429. package/Misc/basis.js +2 -2
  430. package/Misc/basis.js.map +1 -1
  431. package/Misc/copyTextureToTexture.d.ts +1 -1
  432. package/Misc/copyTextureToTexture.js +1 -1
  433. package/Misc/copyTextureToTexture.js.map +1 -1
  434. package/Misc/environmentTextureTools.js +3 -3
  435. package/Misc/environmentTextureTools.js.map +1 -1
  436. package/Misc/iInspectable.d.ts +1 -1
  437. package/Misc/iInspectable.js.map +1 -1
  438. package/Misc/khronosTextureContainer2.js +2 -2
  439. package/Misc/khronosTextureContainer2.js.map +1 -1
  440. package/Misc/timer.d.ts +1 -1
  441. package/Misc/timer.js +5 -5
  442. package/Misc/timer.js.map +1 -1
  443. package/Misc/virtualJoystick.d.ts +1 -1
  444. package/Misc/virtualJoystick.js +16 -16
  445. package/Misc/virtualJoystick.js.map +1 -1
  446. package/Particles/particleSystem.js +3 -3
  447. package/Particles/particleSystem.js.map +1 -1
  448. package/Particles/particleSystemComponent.js +1 -2
  449. package/Particles/particleSystemComponent.js.map +1 -1
  450. package/Particles/pointsCloudSystem.d.ts +1 -1
  451. package/Particles/pointsCloudSystem.js +14 -14
  452. package/Particles/pointsCloudSystem.js.map +1 -1
  453. package/Particles/subEmitter.d.ts +1 -1
  454. package/Particles/subEmitter.js +1 -1
  455. package/Particles/subEmitter.js.map +1 -1
  456. package/Physics/physicsHelper.d.ts +2 -2
  457. package/Physics/physicsHelper.js +6 -7
  458. package/Physics/physicsHelper.js.map +1 -1
  459. package/Physics/v1/physicsImpostor.js +4 -5
  460. package/Physics/v1/physicsImpostor.js.map +1 -1
  461. package/Physics/v2/IPhysicsEnginePlugin.d.ts +16 -8
  462. package/Physics/v2/IPhysicsEnginePlugin.js +9 -0
  463. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  464. package/Physics/v2/Plugins/havokPlugin.js +96 -79
  465. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  466. package/Physics/v2/physicsAggregate.js +8 -9
  467. package/Physics/v2/physicsAggregate.js.map +1 -1
  468. package/Physics/v2/physicsBody.d.ts +14 -2
  469. package/Physics/v2/physicsBody.js +30 -11
  470. package/Physics/v2/physicsBody.js.map +1 -1
  471. package/Physics/v2/physicsConstraint.js +8 -9
  472. package/Physics/v2/physicsConstraint.js.map +1 -1
  473. package/Physics/v2/physicsMaterial.d.ts +1 -1
  474. package/Physics/v2/physicsMaterial.js.map +1 -1
  475. package/Physics/v2/physicsShape.js +9 -10
  476. package/Physics/v2/physicsShape.js.map +1 -1
  477. package/Physics/v2/ragdoll.js +11 -12
  478. package/Physics/v2/ragdoll.js.map +1 -1
  479. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +2 -2
  480. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  481. package/PostProcesses/depthOfFieldEffect.d.ts +1 -1
  482. package/PostProcesses/depthOfFieldEffect.js +3 -3
  483. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  484. package/PostProcesses/postProcess.js +2 -3
  485. package/PostProcesses/postProcess.js.map +1 -1
  486. package/PostProcesses/tonemapPostProcess.d.ts +1 -1
  487. package/PostProcesses/tonemapPostProcess.js +4 -4
  488. package/PostProcesses/tonemapPostProcess.js.map +1 -1
  489. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +1 -1
  490. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +10 -10
  491. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  492. package/Shaders/spriteMap.fragment.js +3 -2
  493. package/Shaders/spriteMap.fragment.js.map +1 -1
  494. package/ShadersWGSL/boundingInfo.compute.js +8 -8
  495. package/ShadersWGSL/boundingInfo.compute.js.map +1 -1
  496. package/XR/features/WebXRDepthSensing.js +2 -2
  497. package/XR/features/WebXRDepthSensing.js.map +1 -1
  498. package/XR/features/WebXRHandTracking.d.ts +2 -2
  499. package/XR/features/WebXRHandTracking.js +76 -76
  500. package/XR/features/WebXRHandTracking.js.map +1 -1
  501. package/XR/features/WebXRLightEstimation.js +2 -2
  502. package/XR/features/WebXRLightEstimation.js.map +1 -1
  503. package/XR/features/WebXRNearInteraction.d.ts +1 -1
  504. package/XR/features/WebXRNearInteraction.js +5 -5
  505. package/XR/features/WebXRNearInteraction.js.map +1 -1
  506. package/XR/features/WebXRRawCameraAccess.js +2 -2
  507. package/XR/features/WebXRRawCameraAccess.js.map +1 -1
  508. package/XR/motionController/webXRProfiledMotionController.js +2 -2
  509. package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
  510. package/XR/webXRCamera.js +3 -4
  511. package/XR/webXRCamera.js.map +1 -1
  512. package/XR/webXREnterExitUI.js +3 -4
  513. package/XR/webXREnterExitUI.js.map +1 -1
  514. package/XR/webXRExperienceHelper.js +12 -13
  515. package/XR/webXRExperienceHelper.js.map +1 -1
  516. package/XR/webXRManagedOutputCanvas.d.ts +1 -1
  517. package/XR/webXRManagedOutputCanvas.js +15 -6
  518. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  519. package/XR/webXRRenderTargetTextureProvider.js +2 -2
  520. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  521. package/XR/webXRTypes.d.ts +2 -2
  522. package/XR/webXRTypes.js.map +1 -1
  523. package/package.json +1 -1
  524. package/scene.d.ts +1 -1
  525. package/scene.js +4 -4
  526. package/scene.js.map +1 -1
package/Bones/bone.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Vector3, Quaternion, Matrix, TmpVectors } from "../Maths/math.vector.js";
2
2
  import { ArrayTools } from "../Misc/arrayTools.js";
3
3
  import { Node } from "../node.js";
4
- import { Space } from "../Maths/math.axis.js";
5
4
  /**
6
5
  * Class used to store bone information
7
6
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
@@ -420,9 +419,9 @@ export class Bone extends Node {
420
419
  this.markAsDirty();
421
420
  this._needToDecompose = true;
422
421
  }
423
- _updatePosition(vec, space = Space.LOCAL, tNode, translationMode = true) {
422
+ _updatePosition(vec, space = 0 /* Space.LOCAL */, tNode, translationMode = true) {
424
423
  const lm = this.getLocalMatrix();
425
- if (space == Space.LOCAL) {
424
+ if (space == 0 /* Space.LOCAL */) {
426
425
  if (translationMode) {
427
426
  lm.addAtIndex(12, vec.x);
428
427
  lm.addAtIndex(13, vec.y);
@@ -475,7 +474,7 @@ export class Bone extends Node {
475
474
  * @param space The space that the translation is in (default: Space.LOCAL)
476
475
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
477
476
  */
478
- translate(vec, space = Space.LOCAL, tNode) {
477
+ translate(vec, space = 0 /* Space.LOCAL */, tNode) {
479
478
  this._updatePosition(vec, space, tNode, true);
480
479
  }
481
480
  /**
@@ -484,7 +483,7 @@ export class Bone extends Node {
484
483
  * @param space The space that the position is in (default: Space.LOCAL)
485
484
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
486
485
  */
487
- setPosition(position, space = Space.LOCAL, tNode) {
486
+ setPosition(position, space = 0 /* Space.LOCAL */, tNode) {
488
487
  this._updatePosition(position, space, tNode, false);
489
488
  }
490
489
  /**
@@ -493,7 +492,7 @@ export class Bone extends Node {
493
492
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
494
493
  */
495
494
  setAbsolutePosition(position, tNode) {
496
- this.setPosition(position, Space.WORLD, tNode);
495
+ this.setPosition(position, 1 /* Space.WORLD */, tNode);
497
496
  }
498
497
  /**
499
498
  * Scale the bone on the x, y and z axes (in local space)
@@ -558,8 +557,8 @@ export class Bone extends Node {
558
557
  * @param space The space that the axes of rotation are in
559
558
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
560
559
  */
561
- setYawPitchRoll(yaw, pitch, roll, space = Space.LOCAL, tNode) {
562
- if (space === Space.LOCAL) {
560
+ setYawPitchRoll(yaw, pitch, roll, space = 0 /* Space.LOCAL */, tNode) {
561
+ if (space === 0 /* Space.LOCAL */) {
563
562
  const quat = Bone._TmpQuat;
564
563
  Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, quat);
565
564
  this.setRotationQuaternion(quat, space, tNode);
@@ -581,7 +580,7 @@ export class Bone extends Node {
581
580
  * @param space The space that the axis is in
582
581
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
583
582
  */
584
- rotate(axis, amount, space = Space.LOCAL, tNode) {
583
+ rotate(axis, amount, space = 0 /* Space.LOCAL */, tNode) {
585
584
  const rmat = Bone._TmpMats[0];
586
585
  rmat.setTranslationFromFloats(0, 0, 0);
587
586
  Matrix.RotationAxisToRef(axis, amount, rmat);
@@ -594,8 +593,8 @@ export class Bone extends Node {
594
593
  * @param space The space that the axis is in
595
594
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
596
595
  */
597
- setAxisAngle(axis, angle, space = Space.LOCAL, tNode) {
598
- if (space === Space.LOCAL) {
596
+ setAxisAngle(axis, angle, space = 0 /* Space.LOCAL */, tNode) {
597
+ if (space === 0 /* Space.LOCAL */) {
599
598
  const quat = Bone._TmpQuat;
600
599
  Quaternion.RotationAxisToRef(axis, angle, quat);
601
600
  this.setRotationQuaternion(quat, space, tNode);
@@ -616,7 +615,7 @@ export class Bone extends Node {
616
615
  * @param space The space that the rotation is in
617
616
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
618
617
  */
619
- setRotation(rotation, space = Space.LOCAL, tNode) {
618
+ setRotation(rotation, space = 0 /* Space.LOCAL */, tNode) {
620
619
  this.setYawPitchRoll(rotation.y, rotation.x, rotation.z, space, tNode);
621
620
  }
622
621
  /**
@@ -625,8 +624,8 @@ export class Bone extends Node {
625
624
  * @param space The space that the rotation is in
626
625
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
627
626
  */
628
- setRotationQuaternion(quat, space = Space.LOCAL, tNode) {
629
- if (space === Space.LOCAL) {
627
+ setRotationQuaternion(quat, space = 0 /* Space.LOCAL */, tNode) {
628
+ if (space === 0 /* Space.LOCAL */) {
630
629
  this._decompose();
631
630
  this._localRotation.copyFrom(quat);
632
631
  this._markAsDirtyAndCompose();
@@ -647,8 +646,8 @@ export class Bone extends Node {
647
646
  * @param space The space that the rotation is in
648
647
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
649
648
  */
650
- setRotationMatrix(rotMat, space = Space.LOCAL, tNode) {
651
- if (space === Space.LOCAL) {
649
+ setRotationMatrix(rotMat, space = 0 /* Space.LOCAL */, tNode) {
650
+ if (space === 0 /* Space.LOCAL */) {
652
651
  const quat = Bone._TmpQuat;
653
652
  Quaternion.FromRotationMatrixToRef(rotMat, quat);
654
653
  this.setRotationQuaternion(quat, space, tNode);
@@ -663,7 +662,7 @@ export class Bone extends Node {
663
662
  rotMatInv.multiplyToRef(rotMat, rotMat2);
664
663
  this._rotateWithMatrix(rotMat2, space, tNode);
665
664
  }
666
- _rotateWithMatrix(rmat, space = Space.LOCAL, tNode) {
665
+ _rotateWithMatrix(rmat, space = 0 /* Space.LOCAL */, tNode) {
667
666
  const lmat = this.getLocalMatrix();
668
667
  const lx = lmat.m[12];
669
668
  const ly = lmat.m[13];
@@ -671,7 +670,7 @@ export class Bone extends Node {
671
670
  const parent = this.getParent();
672
671
  const parentScale = Bone._TmpMats[3];
673
672
  const parentScaleInv = Bone._TmpMats[4];
674
- if (parent && space == Space.WORLD) {
673
+ if (parent && space == 1 /* Space.WORLD */) {
675
674
  if (tNode) {
676
675
  parentScale.copyFrom(tNode.getWorldMatrix());
677
676
  parent.getAbsoluteMatrix().multiplyToRef(parentScale, parentScale);
@@ -686,7 +685,7 @@ export class Bone extends Node {
686
685
  lmat.multiplyToRef(parentScaleInv, lmat);
687
686
  }
688
687
  else {
689
- if (space == Space.WORLD && tNode) {
688
+ if (space == 1 /* Space.WORLD */ && tNode) {
690
689
  parentScale.copyFrom(tNode.getWorldMatrix());
691
690
  parentScaleInv.copyFrom(parentScale);
692
691
  parentScaleInv.invert();
@@ -728,7 +727,7 @@ export class Bone extends Node {
728
727
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
729
728
  * @returns The position of the bone
730
729
  */
731
- getPosition(space = Space.LOCAL, tNode = null) {
730
+ getPosition(space = 0 /* Space.LOCAL */, tNode = null) {
732
731
  const pos = Vector3.Zero();
733
732
  this.getPositionToRef(space, tNode, pos);
734
733
  return pos;
@@ -739,8 +738,8 @@ export class Bone extends Node {
739
738
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
740
739
  * @param result The vector3 to copy the position to
741
740
  */
742
- getPositionToRef(space = Space.LOCAL, tNode, result) {
743
- if (space == Space.LOCAL) {
741
+ getPositionToRef(space = 0 /* Space.LOCAL */, tNode, result) {
742
+ if (space == 0 /* Space.LOCAL */) {
744
743
  const lm = this.getLocalMatrix();
745
744
  result.x = lm.m[12];
746
745
  result.y = lm.m[13];
@@ -773,7 +772,7 @@ export class Bone extends Node {
773
772
  */
774
773
  getAbsolutePosition(tNode = null) {
775
774
  const pos = Vector3.Zero();
776
- this.getPositionToRef(Space.WORLD, tNode, pos);
775
+ this.getPositionToRef(1 /* Space.WORLD */, tNode, pos);
777
776
  return pos;
778
777
  }
779
778
  /**
@@ -782,7 +781,7 @@ export class Bone extends Node {
782
781
  * @param result The vector3 to copy the absolute position to
783
782
  */
784
783
  getAbsolutePositionToRef(tNode, result) {
785
- this.getPositionToRef(Space.WORLD, tNode, result);
784
+ this.getPositionToRef(1 /* Space.WORLD */, tNode, result);
786
785
  }
787
786
  /**
788
787
  * Compute the absolute matrices of this bone and its children
@@ -850,7 +849,7 @@ export class Bone extends Node {
850
849
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
851
850
  * @returns The euler rotation
852
851
  */
853
- getRotation(space = Space.LOCAL, tNode = null) {
852
+ getRotation(space = 0 /* Space.LOCAL */, tNode = null) {
854
853
  const result = Vector3.Zero();
855
854
  this.getRotationToRef(space, tNode, result);
856
855
  return result;
@@ -861,7 +860,7 @@ export class Bone extends Node {
861
860
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
862
861
  * @param result The vector3 that the rotation should be copied to
863
862
  */
864
- getRotationToRef(space = Space.LOCAL, tNode = null, result) {
863
+ getRotationToRef(space = 0 /* Space.LOCAL */, tNode = null, result) {
865
864
  const quat = Bone._TmpQuat;
866
865
  this.getRotationQuaternionToRef(space, tNode, quat);
867
866
  quat.toEulerAnglesToRef(result);
@@ -872,7 +871,7 @@ export class Bone extends Node {
872
871
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
873
872
  * @returns The quaternion rotation
874
873
  */
875
- getRotationQuaternion(space = Space.LOCAL, tNode = null) {
874
+ getRotationQuaternion(space = 0 /* Space.LOCAL */, tNode = null) {
876
875
  const result = Quaternion.Identity();
877
876
  this.getRotationQuaternionToRef(space, tNode, result);
878
877
  return result;
@@ -883,8 +882,8 @@ export class Bone extends Node {
883
882
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
884
883
  * @param result The quaternion that the rotation should be copied to
885
884
  */
886
- getRotationQuaternionToRef(space = Space.LOCAL, tNode = null, result) {
887
- if (space == Space.LOCAL) {
885
+ getRotationQuaternionToRef(space = 0 /* Space.LOCAL */, tNode = null, result) {
886
+ if (space == 0 /* Space.LOCAL */) {
888
887
  this._decompose();
889
888
  result.copyFrom(this._localRotation);
890
889
  }
@@ -909,7 +908,7 @@ export class Bone extends Node {
909
908
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
910
909
  * @returns The rotation matrix
911
910
  */
912
- getRotationMatrix(space = Space.LOCAL, tNode) {
911
+ getRotationMatrix(space = 0 /* Space.LOCAL */, tNode) {
913
912
  const result = Matrix.Identity();
914
913
  this.getRotationMatrixToRef(space, tNode, result);
915
914
  return result;
@@ -920,8 +919,8 @@ export class Bone extends Node {
920
919
  * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD
921
920
  * @param result The quaternion that the rotation should be copied to
922
921
  */
923
- getRotationMatrixToRef(space = Space.LOCAL, tNode, result) {
924
- if (space == Space.LOCAL) {
922
+ getRotationMatrixToRef(space = 0 /* Space.LOCAL */, tNode, result) {
923
+ if (space == 0 /* Space.LOCAL */) {
925
924
  this.getLocalMatrix().getRotationMatrixToRef(result);
926
925
  }
927
926
  else {
package/Bones/bone.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bone.js","sourceRoot":"","sources":["../../../../dev/core/src/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;IA+C1B,gB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E,EAAE,IAAI,CAAC,CAAC;SAChC;QAED,IAAI,CAAC,MAAM,EAAE,CAAC;QAEd,OAAO,CAAC,yBAAyB,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,oBAAoB;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9C,CAAC;;AA/rCc,aAAQ,GAAc,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,AAApD,CAAqD;AAC7D,aAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,AAAxB,CAAyB;AACjC,aAAQ,GAAa,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,AAAtD,CAAuD","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\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { AnimationPropertiesOverride } from \"../Animations/animationPropertiesOverride\";\r\n\r\n/**\r\n * Class used to store bone information\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\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: Bone[] = [];\r\n\r\n /** Gets the animations associated with this bone */\r\n public override animations: 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 * @internal 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; // transformation of the bone, in local space\r\n private _absoluteMatrix: Matrix; // transformation of the bone, in world space (relative to the skeleton root)\r\n private _bindMatrix: Matrix; // the bind matrix, in local space\r\n private _absoluteBindMatrix: Matrix; // the bind matrix, in world space (relative to the skeleton root)\r\n private _absoluteInverseBindMatrix: Matrix; // the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n private _finalMatrix: Matrix; // the final matrix used to transform vertices of the mesh according to the bone, in world space (relative to the skeleton root). It is the multiplication of _absoluteInverseBindMatrix with _absoluteMatrix.\r\n private _restMatrix: Matrix; // a matrix for the exclusive use of the end user (not used internally by the framework), in local space\r\n private _scalingDeterminant = 1;\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 /** @internal */\r\n public _linkedTransformNode: Nullable<TransformNode> = null;\r\n\r\n /** @internal */\r\n public _waitingTransformNodeId: Nullable<string> = null;\r\n\r\n /** @internal */\r\n get _matrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /** @internal */\r\n set _matrix(value: Matrix) {\r\n // skip if the matrices are the same\r\n if (value.updateFlag === this._localMatrix.updateFlag && !this._needToCompose) {\r\n return;\r\n }\r\n\r\n this._needToCompose = false; // in case there was a pending compose\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 (default: identity)\r\n * @param restMatrix defines the rest matrix (default: localMatrix)\r\n * @param bindMatrix defines the bind matrix (default: localMatrix)\r\n * @param index defines index of the bone in the hierarchy (default: null)\r\n */\r\n constructor(\r\n /**\r\n * defines the bone name\r\n */\r\n public override name: string,\r\n skeleton: Skeleton,\r\n parentBone: Nullable<Bone> = null,\r\n localMatrix: Nullable<Matrix> = null,\r\n restMatrix: Nullable<Matrix> = null,\r\n bindMatrix: Nullable<Matrix> = null,\r\n index: Nullable<number> = null\r\n ) {\r\n super(name, skeleton.getScene(), false);\r\n this._skeleton = skeleton;\r\n this._localMatrix = localMatrix?.clone() ?? Matrix.Identity();\r\n this._restMatrix = restMatrix ?? this._localMatrix.clone();\r\n this._bindMatrix = bindMatrix ?? this._localMatrix.clone();\r\n this._index = index;\r\n\r\n this._absoluteMatrix = new Matrix();\r\n this._absoluteBindMatrix = new Matrix();\r\n this._absoluteInverseBindMatrix = new Matrix();\r\n this._finalMatrix = new Matrix();\r\n\r\n skeleton.bones.push(this);\r\n\r\n this.setParent(parentBone, false);\r\n\r\n this._updateAbsoluteBindMatrices();\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 override 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 override 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 children of the bone\r\n * @returns an array containing the children of the bone (can be empty if the bone has no children)\r\n */\r\n public override 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 override 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 updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be updated\r\n */\r\n public setParent(parent: Nullable<Bone>, updateAbsoluteBindMatrices: 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 (updateAbsoluteBindMatrices) {\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the local matrix\r\n * @returns the local 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 bind matrix\r\n * @returns the bind matrix\r\n */\r\n public getBindMatrix(): Matrix {\r\n return this._bindMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bind matrix.\r\n * @returns the bind matrix\r\n * @deprecated Please use getBindMatrix instead\r\n */\r\n public getBaseMatrix(): Matrix {\r\n return this.getBindMatrix();\r\n }\r\n\r\n /**\r\n * Gets the rest matrix\r\n * @returns the rest matrix\r\n */\r\n public getRestMatrix(): Matrix {\r\n return this._restMatrix;\r\n }\r\n\r\n /**\r\n * Gets the rest matrix\r\n * @returns the rest matrix\r\n * @deprecated Please use getRestMatrix instead\r\n */\r\n public getRestPose(): Matrix {\r\n return this.getRestMatrix();\r\n }\r\n\r\n /**\r\n * Sets the rest matrix\r\n * @param matrix the local-space rest matrix to set for this bone\r\n */\r\n public setRestMatrix(matrix: Matrix): void {\r\n this._restMatrix.copyFrom(matrix);\r\n }\r\n\r\n /**\r\n * Sets the rest matrix\r\n * @param matrix the local-space rest to set for this bone\r\n * @deprecated Please use setRestMatrix instead\r\n */\r\n public setRestPose(matrix: Matrix): void {\r\n this.setRestMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets the bind matrix\r\n * @returns the bind matrix\r\n * @deprecated Please use getBindMatrix instead\r\n */\r\n public getBindPose(): Matrix {\r\n return this.getBindMatrix();\r\n }\r\n\r\n /**\r\n * Sets the bind matrix\r\n * This will trigger a recomputation of the absolute bind and absolute inverse bind matrices for this bone and its children\r\n * Note that the local matrix will also be set with the matrix passed in parameter!\r\n * @param matrix the local-space bind matrix to set for this bone\r\n */\r\n public setBindMatrix(matrix: Matrix): void {\r\n this.updateMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Sets the bind matrix\r\n * @param matrix the local-space bind to set for this bone\r\n * @deprecated Please use setBindMatrix instead\r\n */\r\n public setBindPose(matrix: Matrix): void {\r\n this.setBindMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)\r\n * @returns the final world matrix\r\n */\r\n public getFinalMatrix(): Matrix {\r\n return this._finalMatrix;\r\n }\r\n\r\n /**\r\n * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)\r\n * @deprecated Please use getFinalMatrix instead\r\n * @returns the final world matrix\r\n */\r\n public override getWorldMatrix(): Matrix {\r\n return this.getFinalMatrix();\r\n }\r\n\r\n /**\r\n * Sets the local matrix to the rest 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.getRestMatrix().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._restMatrix;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n * @returns the inverse bind matrix, in world space\r\n */\r\n public getAbsoluteInverseBindMatrix(): Matrix {\r\n return this._absoluteInverseBindMatrix;\r\n }\r\n\r\n /**\r\n * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n * @returns the inverse bind matrix, in world space\r\n * @deprecated Please use getAbsoluteInverseBindMatrix instead\r\n */\r\n public getInvertedAbsoluteTransform(): Matrix {\r\n return this.getAbsoluteInverseBindMatrix();\r\n }\r\n\r\n /**\r\n * Gets the bone matrix, in world space (relative to the skeleton root)\r\n * @returns the bone matrix, in world space\r\n */\r\n public getAbsoluteMatrix(): Matrix {\r\n return this._absoluteMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bone matrix, in world space (relative to the skeleton root)\r\n * @returns the bone matrix, in world space\r\n * @deprecated Please use getAbsoluteMatrix instead\r\n */\r\n public getAbsoluteTransform(): Matrix {\r\n return this._absoluteMatrix;\r\n }\r\n\r\n /**\r\n * Links with the given transform node.\r\n * The local matrix of this bone is overwritten by the transform of the 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 override 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 bind (and optionally the local) matrix\r\n * @param bindMatrix defines the new matrix to set to the bind/local matrix, in local space\r\n * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be recomputed (default: true)\r\n * @param updateLocalMatrix defines if the local matrix should also be updated with the matrix passed in parameter (default: true)\r\n */\r\n public updateMatrix(bindMatrix: Matrix, updateAbsoluteBindMatrices = true, updateLocalMatrix = true): void {\r\n this._bindMatrix.copyFrom(bindMatrix);\r\n\r\n if (updateAbsoluteBindMatrices) {\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n if (updateLocalMatrix) {\r\n this._matrix = bindMatrix;\r\n } else {\r\n this.markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateAbsoluteBindMatrices(bindMatrix?: Matrix, updateChildren = true): void {\r\n if (!bindMatrix) {\r\n bindMatrix = this._bindMatrix;\r\n }\r\n\r\n if (this.parent) {\r\n bindMatrix.multiplyToRef(this.parent._absoluteBindMatrix, this._absoluteBindMatrix);\r\n } else {\r\n this._absoluteBindMatrix.copyFrom(bindMatrix);\r\n }\r\n\r\n this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix);\r\n\r\n if (updateChildren) {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._updateAbsoluteBindMatrices();\r\n }\r\n }\r\n\r\n this._scalingDeterminant = this._absoluteBindMatrix.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 override 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 /** @internal */\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 private _updatePosition(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode, translationMode = true): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n if (translationMode) {\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 lm.setTranslationFromFloats(vec.x, vec.y, vec.z);\r\n }\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\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.getAbsoluteMatrix());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteMatrix());\r\n }\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n if (translationMode) {\r\n tmat.setTranslationFromFloats(0, 0, 0);\r\n }\r\n tmat.invert();\r\n Vector3.TransformCoordinatesToRef(vec, tmat, tvec);\r\n\r\n if (translationMode) {\r\n lm.addAtIndex(12, tvec.x);\r\n lm.addAtIndex(13, tvec.y);\r\n lm.addAtIndex(14, tvec.z);\r\n } else {\r\n lm.setTranslationFromFloats(tvec.x, tvec.y, tvec.z);\r\n }\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\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 (default: Space.LOCAL)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public translate(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this._updatePosition(vec, space, tNode, true);\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 (default: Space.LOCAL)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setPosition(position: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this._updatePosition(position, space, tNode, false);\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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._getAbsoluteInverseMatrixUnscaledToRef(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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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._getAbsoluteInverseMatrixUnscaledToRef(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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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._getAbsoluteInverseMatrixUnscaledToRef(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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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._getAbsoluteInverseMatrixUnscaledToRef(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.getAbsoluteMatrix().multiplyToRef(parentScale, parentScale);\r\n } else {\r\n parentScale.copyFrom(parent.getAbsoluteMatrix());\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.computeAbsoluteMatrices();\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n private _getAbsoluteInverseMatrixUnscaledToRef(rotMatInv: Matrix, tNode?: TransformNode): boolean {\r\n const scaleMatrix = Bone._TmpMats[2];\r\n rotMatInv.copyFrom(this.getAbsoluteMatrix());\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteMatrix();\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 matrices of this bone and its children\r\n */\r\n public computeAbsoluteMatrices(): void {\r\n this._compose();\r\n\r\n if (this.parent) {\r\n this._localMatrix.multiplyToRef(this.parent._absoluteMatrix, this._absoluteMatrix);\r\n } else {\r\n this._absoluteMatrix.copyFrom(this._localMatrix);\r\n\r\n const poseMatrix = this._skeleton.getPoseMatrix();\r\n\r\n if (poseMatrix) {\r\n this._absoluteMatrix.multiplyToRef(poseMatrix, this._absoluteMatrix);\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].computeAbsoluteMatrices();\r\n }\r\n }\r\n\r\n /**\r\n * Compute the absolute matrices of this bone and its children\r\n * @deprecated Please use computeAbsoluteMatrices instead\r\n */\r\n public computeAbsoluteTransforms(): void {\r\n this.computeAbsoluteMatrices();\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const mat = Bone._TmpMats[0];\r\n\r\n mat.copyFrom(this.getAbsoluteMatrix());\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.getAbsoluteMatrix();\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.getAbsoluteMatrix();\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode && wm) {\r\n tmat.multiplyToRef(wm, tmat);\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteMatrix());\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 restMatrix for this bone.\r\n */\r\n public setCurrentPoseAsRest(): void {\r\n this.setRestMatrix(this.getLocalMatrix());\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"bone.js","sourceRoot":"","sources":["../../../../dev/core/src/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;AAM/B;;;GAGG;AACH,MAAM,OAAO,IAAK,SAAQ,IAAI;IA+C1B,gBAAgB;IAChB,IAAI,OAAO;QACP,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,gBAAgB;IAChB,IAAI,OAAO,CAAC,KAAa;QACrB,oCAAoC;QACpC,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YAC3E,OAAO;SACV;QAED,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC,sCAAsC;QAEnE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;IAED;;;;;;;;;OASG;IACH;IACI;;OAEG;IACa,IAAY,EAC5B,QAAkB,EAClB,aAA6B,IAAI,EACjC,cAAgC,IAAI,EACpC,aAA+B,IAAI,EACnC,aAA+B,IAAI,EACnC,QAA0B,IAAI;QAE9B,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;QARxB,SAAI,GAAJ,IAAI,CAAQ;QA3EhC;;WAEG;QACI,aAAQ,GAAW,EAAE,CAA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AAO,CAAC,yBAAyB,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,oBAAoB;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9C,CAAC;;AA/rCc,aAAQ,GAAc,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,AAApD,CAAqD;AAC7D,aAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,AAAxB,CAAyB;AACjC,aAAQ,GAAa,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,AAAtD,CAAuD","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\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { AnimationPropertiesOverride } from \"../Animations/animationPropertiesOverride\";\r\n\r\n/**\r\n * Class used to store bone information\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\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: Bone[] = [];\r\n\r\n /** Gets the animations associated with this bone */\r\n public override animations: 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 * @internal 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; // transformation of the bone, in local space\r\n private _absoluteMatrix: Matrix; // transformation of the bone, in world space (relative to the skeleton root)\r\n private _bindMatrix: Matrix; // the bind matrix, in local space\r\n private _absoluteBindMatrix: Matrix; // the bind matrix, in world space (relative to the skeleton root)\r\n private _absoluteInverseBindMatrix: Matrix; // the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n private _finalMatrix: Matrix; // the final matrix used to transform vertices of the mesh according to the bone, in world space (relative to the skeleton root). It is the multiplication of _absoluteInverseBindMatrix with _absoluteMatrix.\r\n private _restMatrix: Matrix; // a matrix for the exclusive use of the end user (not used internally by the framework), in local space\r\n private _scalingDeterminant = 1;\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 /** @internal */\r\n public _linkedTransformNode: Nullable<TransformNode> = null;\r\n\r\n /** @internal */\r\n public _waitingTransformNodeId: Nullable<string> = null;\r\n\r\n /** @internal */\r\n get _matrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /** @internal */\r\n set _matrix(value: Matrix) {\r\n // skip if the matrices are the same\r\n if (value.updateFlag === this._localMatrix.updateFlag && !this._needToCompose) {\r\n return;\r\n }\r\n\r\n this._needToCompose = false; // in case there was a pending compose\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 (default: identity)\r\n * @param restMatrix defines the rest matrix (default: localMatrix)\r\n * @param bindMatrix defines the bind matrix (default: localMatrix)\r\n * @param index defines index of the bone in the hierarchy (default: null)\r\n */\r\n constructor(\r\n /**\r\n * defines the bone name\r\n */\r\n public override name: string,\r\n skeleton: Skeleton,\r\n parentBone: Nullable<Bone> = null,\r\n localMatrix: Nullable<Matrix> = null,\r\n restMatrix: Nullable<Matrix> = null,\r\n bindMatrix: Nullable<Matrix> = null,\r\n index: Nullable<number> = null\r\n ) {\r\n super(name, skeleton.getScene(), false);\r\n this._skeleton = skeleton;\r\n this._localMatrix = localMatrix?.clone() ?? Matrix.Identity();\r\n this._restMatrix = restMatrix ?? this._localMatrix.clone();\r\n this._bindMatrix = bindMatrix ?? this._localMatrix.clone();\r\n this._index = index;\r\n\r\n this._absoluteMatrix = new Matrix();\r\n this._absoluteBindMatrix = new Matrix();\r\n this._absoluteInverseBindMatrix = new Matrix();\r\n this._finalMatrix = new Matrix();\r\n\r\n skeleton.bones.push(this);\r\n\r\n this.setParent(parentBone, false);\r\n\r\n this._updateAbsoluteBindMatrices();\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 override 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 override 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 children of the bone\r\n * @returns an array containing the children of the bone (can be empty if the bone has no children)\r\n */\r\n public override 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 override 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 updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be updated\r\n */\r\n public setParent(parent: Nullable<Bone>, updateAbsoluteBindMatrices: 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 (updateAbsoluteBindMatrices) {\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the local matrix\r\n * @returns the local 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 bind matrix\r\n * @returns the bind matrix\r\n */\r\n public getBindMatrix(): Matrix {\r\n return this._bindMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bind matrix.\r\n * @returns the bind matrix\r\n * @deprecated Please use getBindMatrix instead\r\n */\r\n public getBaseMatrix(): Matrix {\r\n return this.getBindMatrix();\r\n }\r\n\r\n /**\r\n * Gets the rest matrix\r\n * @returns the rest matrix\r\n */\r\n public getRestMatrix(): Matrix {\r\n return this._restMatrix;\r\n }\r\n\r\n /**\r\n * Gets the rest matrix\r\n * @returns the rest matrix\r\n * @deprecated Please use getRestMatrix instead\r\n */\r\n public getRestPose(): Matrix {\r\n return this.getRestMatrix();\r\n }\r\n\r\n /**\r\n * Sets the rest matrix\r\n * @param matrix the local-space rest matrix to set for this bone\r\n */\r\n public setRestMatrix(matrix: Matrix): void {\r\n this._restMatrix.copyFrom(matrix);\r\n }\r\n\r\n /**\r\n * Sets the rest matrix\r\n * @param matrix the local-space rest to set for this bone\r\n * @deprecated Please use setRestMatrix instead\r\n */\r\n public setRestPose(matrix: Matrix): void {\r\n this.setRestMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets the bind matrix\r\n * @returns the bind matrix\r\n * @deprecated Please use getBindMatrix instead\r\n */\r\n public getBindPose(): Matrix {\r\n return this.getBindMatrix();\r\n }\r\n\r\n /**\r\n * Sets the bind matrix\r\n * This will trigger a recomputation of the absolute bind and absolute inverse bind matrices for this bone and its children\r\n * Note that the local matrix will also be set with the matrix passed in parameter!\r\n * @param matrix the local-space bind matrix to set for this bone\r\n */\r\n public setBindMatrix(matrix: Matrix): void {\r\n this.updateMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Sets the bind matrix\r\n * @param matrix the local-space bind to set for this bone\r\n * @deprecated Please use setBindMatrix instead\r\n */\r\n public setBindPose(matrix: Matrix): void {\r\n this.setBindMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)\r\n * @returns the final world matrix\r\n */\r\n public getFinalMatrix(): Matrix {\r\n return this._finalMatrix;\r\n }\r\n\r\n /**\r\n * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)\r\n * @deprecated Please use getFinalMatrix instead\r\n * @returns the final world matrix\r\n */\r\n public override getWorldMatrix(): Matrix {\r\n return this.getFinalMatrix();\r\n }\r\n\r\n /**\r\n * Sets the local matrix to the rest 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.getRestMatrix().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._restMatrix;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n * @returns the inverse bind matrix, in world space\r\n */\r\n public getAbsoluteInverseBindMatrix(): Matrix {\r\n return this._absoluteInverseBindMatrix;\r\n }\r\n\r\n /**\r\n * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n * @returns the inverse bind matrix, in world space\r\n * @deprecated Please use getAbsoluteInverseBindMatrix instead\r\n */\r\n public getInvertedAbsoluteTransform(): Matrix {\r\n return this.getAbsoluteInverseBindMatrix();\r\n }\r\n\r\n /**\r\n * Gets the bone matrix, in world space (relative to the skeleton root)\r\n * @returns the bone matrix, in world space\r\n */\r\n public getAbsoluteMatrix(): Matrix {\r\n return this._absoluteMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bone matrix, in world space (relative to the skeleton root)\r\n * @returns the bone matrix, in world space\r\n * @deprecated Please use getAbsoluteMatrix instead\r\n */\r\n public getAbsoluteTransform(): Matrix {\r\n return this._absoluteMatrix;\r\n }\r\n\r\n /**\r\n * Links with the given transform node.\r\n * The local matrix of this bone is overwritten by the transform of the 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 override 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 bind (and optionally the local) matrix\r\n * @param bindMatrix defines the new matrix to set to the bind/local matrix, in local space\r\n * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be recomputed (default: true)\r\n * @param updateLocalMatrix defines if the local matrix should also be updated with the matrix passed in parameter (default: true)\r\n */\r\n public updateMatrix(bindMatrix: Matrix, updateAbsoluteBindMatrices = true, updateLocalMatrix = true): void {\r\n this._bindMatrix.copyFrom(bindMatrix);\r\n\r\n if (updateAbsoluteBindMatrices) {\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n if (updateLocalMatrix) {\r\n this._matrix = bindMatrix;\r\n } else {\r\n this.markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateAbsoluteBindMatrices(bindMatrix?: Matrix, updateChildren = true): void {\r\n if (!bindMatrix) {\r\n bindMatrix = this._bindMatrix;\r\n }\r\n\r\n if (this.parent) {\r\n bindMatrix.multiplyToRef(this.parent._absoluteBindMatrix, this._absoluteBindMatrix);\r\n } else {\r\n this._absoluteBindMatrix.copyFrom(bindMatrix);\r\n }\r\n\r\n this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix);\r\n\r\n if (updateChildren) {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._updateAbsoluteBindMatrices();\r\n }\r\n }\r\n\r\n this._scalingDeterminant = this._absoluteBindMatrix.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 override 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 /** @internal */\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 private _updatePosition(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode, translationMode = true): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n if (translationMode) {\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 lm.setTranslationFromFloats(vec.x, vec.y, vec.z);\r\n }\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\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.getAbsoluteMatrix());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteMatrix());\r\n }\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n if (translationMode) {\r\n tmat.setTranslationFromFloats(0, 0, 0);\r\n }\r\n tmat.invert();\r\n Vector3.TransformCoordinatesToRef(vec, tmat, tvec);\r\n\r\n if (translationMode) {\r\n lm.addAtIndex(12, tvec.x);\r\n lm.addAtIndex(13, tvec.y);\r\n lm.addAtIndex(14, tvec.z);\r\n } else {\r\n lm.setTranslationFromFloats(tvec.x, tvec.y, tvec.z);\r\n }\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\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 (default: Space.LOCAL)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public translate(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this._updatePosition(vec, space, tNode, true);\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 (default: Space.LOCAL)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setPosition(position: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this._updatePosition(position, space, tNode, false);\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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._getAbsoluteInverseMatrixUnscaledToRef(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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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._getAbsoluteInverseMatrixUnscaledToRef(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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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._getAbsoluteInverseMatrixUnscaledToRef(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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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._getAbsoluteInverseMatrixUnscaledToRef(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.getAbsoluteMatrix().multiplyToRef(parentScale, parentScale);\r\n } else {\r\n parentScale.copyFrom(parent.getAbsoluteMatrix());\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.computeAbsoluteMatrices();\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n private _getAbsoluteInverseMatrixUnscaledToRef(rotMatInv: Matrix, tNode?: TransformNode): boolean {\r\n const scaleMatrix = Bone._TmpMats[2];\r\n rotMatInv.copyFrom(this.getAbsoluteMatrix());\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteMatrix();\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 matrices of this bone and its children\r\n */\r\n public computeAbsoluteMatrices(): void {\r\n this._compose();\r\n\r\n if (this.parent) {\r\n this._localMatrix.multiplyToRef(this.parent._absoluteMatrix, this._absoluteMatrix);\r\n } else {\r\n this._absoluteMatrix.copyFrom(this._localMatrix);\r\n\r\n const poseMatrix = this._skeleton.getPoseMatrix();\r\n\r\n if (poseMatrix) {\r\n this._absoluteMatrix.multiplyToRef(poseMatrix, this._absoluteMatrix);\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].computeAbsoluteMatrices();\r\n }\r\n }\r\n\r\n /**\r\n * Compute the absolute matrices of this bone and its children\r\n * @deprecated Please use computeAbsoluteMatrices instead\r\n */\r\n public computeAbsoluteTransforms(): void {\r\n this.computeAbsoluteMatrices();\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const mat = Bone._TmpMats[0];\r\n\r\n mat.copyFrom(this.getAbsoluteMatrix());\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.getAbsoluteMatrix();\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.getAbsoluteMatrix();\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode && wm) {\r\n tmat.multiplyToRef(wm, tmat);\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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 A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\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.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteMatrix());\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 restMatrix for this bone.\r\n */\r\n public setCurrentPoseAsRest(): void {\r\n this.setRestMatrix(this.getLocalMatrix());\r\n }\r\n}\r\n"]}
@@ -1,5 +1,4 @@
1
1
  import { Vector3, Quaternion, Matrix } from "../Maths/math.vector.js";
2
- import { Space } from "../Maths/math.axis.js";
3
2
  import { Logger } from "../Misc/logger.js";
4
3
  /**
5
4
  * Class used to apply inverse kinematics to bones
@@ -107,7 +106,7 @@ export class BoneIKController {
107
106
  const pos3 = this._bone1.getAbsolutePosition(mesh);
108
107
  this._bone1Length = Vector3.Distance(pos2, pos3);
109
108
  }
110
- this._bone1.getRotationMatrixToRef(Space.WORLD, mesh, this._bone1Mat);
109
+ this._bone1.getRotationMatrixToRef(1 /* Space.WORLD */, mesh, this._bone1Mat);
111
110
  this.maxAngle = Math.PI;
112
111
  if (options) {
113
112
  if (options.targetMesh) {
@@ -242,17 +241,17 @@ export class BoneIKController {
242
241
  Quaternion.FromRotationMatrixToRef(mat1, tmpQuat);
243
242
  Quaternion.SlerpToRef(this._bone1Quat, tmpQuat, this.slerpAmount, this._bone1Quat);
244
243
  angC = this._bone2Ang * (1.0 - this.slerpAmount) + angC * this.slerpAmount;
245
- this._bone1.setRotationQuaternion(this._bone1Quat, Space.WORLD, this.mesh);
244
+ this._bone1.setRotationQuaternion(this._bone1Quat, 1 /* Space.WORLD */, this.mesh);
246
245
  this._slerping = true;
247
246
  }
248
247
  else {
249
- this._bone1.setRotationMatrix(mat1, Space.WORLD, this.mesh);
248
+ this._bone1.setRotationMatrix(mat1, 1 /* Space.WORLD */, this.mesh);
250
249
  this._bone1Mat.copyFrom(mat1);
251
250
  this._slerping = false;
252
251
  }
253
252
  this._updateLinkedTransformRotation(this._bone1);
254
253
  }
255
- this._bone2.setAxisAngle(this._bendAxis, angC, Space.LOCAL);
254
+ this._bone2.setAxisAngle(this._bendAxis, angC, 0 /* Space.LOCAL */);
256
255
  this._updateLinkedTransformRotation(this._bone2);
257
256
  this._bone2Ang = angC;
258
257
  }
@@ -261,7 +260,7 @@ export class BoneIKController {
261
260
  if (!bone._linkedTransformNode.rotationQuaternion) {
262
261
  bone._linkedTransformNode.rotationQuaternion = new Quaternion();
263
262
  }
264
- bone.getRotationQuaternionToRef(Space.LOCAL, null, bone._linkedTransformNode.rotationQuaternion);
263
+ bone.getRotationQuaternionToRef(0 /* Space.LOCAL */, null, bone._linkedTransformNode.rotationQuaternion);
265
264
  }
266
265
  }
267
266
  }