@babylonjs/core 5.45.2 → 5.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (525) hide show
  1. package/Actions/condition.js +23 -23
  2. package/Actions/condition.js.map +1 -1
  3. package/Animations/animatable.js +48 -48
  4. package/Animations/animatable.js.map +1 -1
  5. package/Animations/animation.js +53 -53
  6. package/Animations/animation.js.map +1 -1
  7. package/Animations/animationGroup.js +53 -53
  8. package/Animations/animationGroup.js.map +1 -1
  9. package/Animations/runtimeAnimation.js +36 -36
  10. package/Animations/runtimeAnimation.js.map +1 -1
  11. package/Audio/audioEngine.js +14 -14
  12. package/Audio/audioEngine.js.map +1 -1
  13. package/Audio/audioSceneComponent.js +14 -14
  14. package/Audio/audioSceneComponent.js.map +1 -1
  15. package/Audio/sound.js +47 -47
  16. package/Audio/sound.js.map +1 -1
  17. package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +1 -1
  18. package/Behaviors/Meshes/fadeInOutBehavior.js +11 -11
  19. package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
  20. package/Behaviors/Meshes/pointerDragBehavior.js +34 -34
  21. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  22. package/Bones/bone.js +15 -15
  23. package/Bones/bone.js.map +1 -1
  24. package/Bones/boneIKController.js +9 -9
  25. package/Bones/boneIKController.js.map +1 -1
  26. package/Bones/boneLookController.js +50 -50
  27. package/Bones/boneLookController.js.map +1 -1
  28. package/Bones/skeleton.js +35 -35
  29. package/Bones/skeleton.js.map +1 -1
  30. package/Buffers/buffer.js +14 -14
  31. package/Buffers/buffer.js.map +1 -1
  32. package/Buffers/dataBuffer.js +6 -6
  33. package/Buffers/dataBuffer.js.map +1 -1
  34. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +42 -42
  35. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
  36. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +18 -18
  37. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
  38. package/Cameras/VR/vrExperienceHelper.js +178 -178
  39. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  40. package/Cameras/arcRotateCamera.js +176 -176
  41. package/Cameras/arcRotateCamera.js.map +1 -1
  42. package/Cameras/camera.js +90 -90
  43. package/Cameras/camera.js.map +1 -1
  44. package/Cameras/flyCamera.js +82 -82
  45. package/Cameras/flyCamera.js.map +1 -1
  46. package/Cameras/freeCamera.js +54 -54
  47. package/Cameras/freeCamera.js.map +1 -1
  48. package/Compute/computeShader.js +12 -12
  49. package/Compute/computeShader.js.map +1 -1
  50. package/Culling/ray.d.ts +1 -1
  51. package/Debug/axesViewer.js +12 -12
  52. package/Debug/axesViewer.js.map +1 -1
  53. package/Debug/debugLayer.js +21 -21
  54. package/Debug/debugLayer.js.map +1 -1
  55. package/Debug/directionalLightFrustumViewer.js +20 -20
  56. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  57. package/Debug/rayHelper.js +10 -10
  58. package/Debug/rayHelper.js.map +1 -1
  59. package/Debug/skeletonViewer.js +81 -81
  60. package/Debug/skeletonViewer.js.map +1 -1
  61. package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
  62. package/DeviceInput/InputDevices/deviceSourceManager.js +31 -31
  63. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  64. package/DeviceInput/InputDevices/deviceTypes.d.ts +1 -1
  65. package/DeviceInput/internalDeviceSourceManager.d.ts +2 -2
  66. package/Engines/Extensions/engine.computeShader.d.ts +3 -3
  67. package/Engines/Extensions/engine.multiRender.js +1 -1
  68. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  69. package/Engines/Extensions/engine.query.d.ts +1 -1
  70. package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
  71. package/Engines/Extensions/engine.renderTarget.js +1 -1
  72. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  73. package/Engines/Native/nativeDataStream.d.ts +1 -1
  74. package/Engines/Native/nativeHardwareTexture.js +3 -3
  75. package/Engines/Native/nativeHardwareTexture.js.map +1 -1
  76. package/Engines/Native/nativeInterfaces.d.ts +5 -5
  77. package/Engines/Native/nativePipelineContext.js +7 -7
  78. package/Engines/Native/nativePipelineContext.js.map +1 -1
  79. package/Engines/Native/nativeRenderTargetWrapper.js +6 -6
  80. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  81. package/Engines/Processors/shaderCodeInliner.js +4 -4
  82. package/Engines/Processors/shaderCodeInliner.js.map +1 -1
  83. package/Engines/Processors/shaderProcessingOptions.d.ts +1 -1
  84. package/Engines/WebGL/webGLHardwareTexture.js +3 -3
  85. package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
  86. package/Engines/WebGPU/webgpuBufferManager.js +3 -3
  87. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  88. package/Engines/WebGPU/webgpuCacheBindGroups.js +6 -6
  89. package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
  90. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js +5 -5
  91. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
  92. package/Engines/WebGPU/webgpuClearQuad.js +11 -11
  93. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  94. package/Engines/WebGPU/webgpuComputeContext.js +7 -7
  95. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  96. package/Engines/WebGPU/webgpuComputePipelineContext.js +4 -4
  97. package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
  98. package/Engines/WebGPU/webgpuDrawContext.js +7 -7
  99. package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
  100. package/Engines/WebGPU/webgpuHardwareTexture.js +9 -9
  101. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  102. package/Engines/WebGPU/webgpuMaterialContext.js +5 -5
  103. package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
  104. package/Engines/WebGPU/webgpuOcclusionQuery.js +10 -10
  105. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  106. package/Engines/WebGPU/webgpuPipelineContext.js +6 -6
  107. package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
  108. package/Engines/WebGPU/webgpuQuerySet.js +3 -3
  109. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  110. package/Engines/WebGPU/webgpuShaderProcessingContext.js +3 -3
  111. package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
  112. package/Engines/WebGPU/webgpuTextureHelper.js +3 -3
  113. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  114. package/Engines/WebGPU/webgpuTimestampQuery.js +3 -3
  115. package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
  116. package/Engines/engine.js +134 -134
  117. package/Engines/engine.js.map +1 -1
  118. package/Engines/nativeEngine.js +6 -6
  119. package/Engines/nativeEngine.js.map +1 -1
  120. package/Engines/nullEngine.js +25 -25
  121. package/Engines/nullEngine.js.map +1 -1
  122. package/Engines/renderTargetWrapper.js +25 -25
  123. package/Engines/renderTargetWrapper.js.map +1 -1
  124. package/Engines/thinEngine.js +243 -243
  125. package/Engines/thinEngine.js.map +1 -1
  126. package/Engines/webgpuEngine.js +132 -132
  127. package/Engines/webgpuEngine.js.map +1 -1
  128. package/Events/keyboardEvents.js +10 -10
  129. package/Events/keyboardEvents.js.map +1 -1
  130. package/Events/pointerEvents.js +9 -9
  131. package/Events/pointerEvents.js.map +1 -1
  132. package/Gamepads/Controllers/poseEnabledController.js +9 -9
  133. package/Gamepads/Controllers/poseEnabledController.js.map +1 -1
  134. package/Gamepads/Controllers/webVRController.js +13 -13
  135. package/Gamepads/Controllers/webVRController.js.map +1 -1
  136. package/Gamepads/gamepad.js +20 -20
  137. package/Gamepads/gamepad.js.map +1 -1
  138. package/Gizmos/axisDragGizmo.js +45 -45
  139. package/Gizmos/axisDragGizmo.js.map +1 -1
  140. package/Gizmos/axisScaleGizmo.js +12 -12
  141. package/Gizmos/axisScaleGizmo.js.map +1 -1
  142. package/Gizmos/boundingBoxGizmo.js +74 -74
  143. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  144. package/Gizmos/gizmo.js +34 -34
  145. package/Gizmos/gizmo.js.map +1 -1
  146. package/Gizmos/gizmoManager.js +40 -40
  147. package/Gizmos/gizmoManager.js.map +1 -1
  148. package/Gizmos/planeDragGizmo.js +23 -23
  149. package/Gizmos/planeDragGizmo.js.map +1 -1
  150. package/Gizmos/planeRotationGizmo.js +12 -12
  151. package/Gizmos/planeRotationGizmo.js.map +1 -1
  152. package/Gizmos/positionGizmo.js +40 -40
  153. package/Gizmos/positionGizmo.js.map +1 -1
  154. package/Gizmos/rotationGizmo.js +47 -47
  155. package/Gizmos/rotationGizmo.js.map +1 -1
  156. package/Gizmos/scaleGizmo.js +41 -41
  157. package/Gizmos/scaleGizmo.js.map +1 -1
  158. package/Helpers/environmentHelper.js +18 -18
  159. package/Helpers/environmentHelper.js.map +1 -1
  160. package/Helpers/textureDome.js +96 -96
  161. package/Helpers/textureDome.js.map +1 -1
  162. package/IAccessibilityTag.d.ts +2 -2
  163. package/Instrumentation/engineInstrumentation.js +21 -21
  164. package/Instrumentation/engineInstrumentation.js.map +1 -1
  165. package/Instrumentation/sceneInstrumentation.js +90 -90
  166. package/Instrumentation/sceneInstrumentation.js.map +1 -1
  167. package/Layers/effectLayer.js +48 -48
  168. package/Layers/effectLayer.js.map +1 -1
  169. package/Layers/glowLayer.js +32 -32
  170. package/Layers/glowLayer.js.map +1 -1
  171. package/Layers/highlightLayer.js +26 -26
  172. package/Layers/highlightLayer.js.map +1 -1
  173. package/Layers/layer.js +40 -40
  174. package/Layers/layer.js.map +1 -1
  175. package/LensFlares/lensFlare.js +15 -15
  176. package/LensFlares/lensFlare.js.map +1 -1
  177. package/LensFlares/lensFlareSystem.js +4 -4
  178. package/LensFlares/lensFlareSystem.js.map +1 -1
  179. package/Lights/Shadows/cascadedShadowGenerator.js +18 -18
  180. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  181. package/Lights/Shadows/shadowGenerator.js +115 -115
  182. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  183. package/Lights/directionalLight.js +31 -31
  184. package/Lights/directionalLight.js.map +1 -1
  185. package/Lights/light.js +72 -72
  186. package/Lights/light.js.map +1 -1
  187. package/Lights/pointLight.js +18 -18
  188. package/Lights/pointLight.js.map +1 -1
  189. package/Lights/spotLight.js +30 -30
  190. package/Lights/spotLight.js.map +1 -1
  191. package/Loading/sceneLoader.d.ts +1 -1
  192. package/Materials/Background/backgroundMaterial.js +124 -124
  193. package/Materials/Background/backgroundMaterial.js.map +1 -1
  194. package/Materials/Node/Blocks/Dual/imageSourceBlock.js +8 -8
  195. package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
  196. package/Materials/Node/Blocks/Dual/lightBlock.js +14 -14
  197. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  198. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +9 -9
  199. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  200. package/Materials/Node/Blocks/Dual/textureBlock.js +26 -26
  201. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  202. package/Materials/Node/Blocks/Input/inputBlock.js +34 -34
  203. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  204. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +14 -14
  205. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  206. package/Materials/Node/Blocks/PBR/reflectionBlock.js +16 -16
  207. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  208. package/Materials/Node/Blocks/customBlock.js +7 -7
  209. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  210. package/Materials/Node/Blocks/gradientBlock.js +13 -13
  211. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  212. package/Materials/Node/Blocks/triPlanarBlock.js +30 -30
  213. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  214. package/Materials/Node/nodeMaterial.d.ts +1 -1
  215. package/Materials/Node/nodeMaterial.js +60 -60
  216. package/Materials/Node/nodeMaterial.js.map +1 -1
  217. package/Materials/Node/nodeMaterialBlock.js +35 -35
  218. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  219. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +50 -50
  220. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  221. package/Materials/PBR/pbrAnisotropicConfiguration.js +5 -5
  222. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  223. package/Materials/PBR/pbrBRDFConfiguration.js +4 -4
  224. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  225. package/Materials/PBR/pbrBaseMaterial.js +52 -52
  226. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  227. package/Materials/PBR/pbrBaseSimpleMaterial.js +17 -17
  228. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  229. package/Materials/PBR/pbrClearCoatConfiguration.js +5 -5
  230. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  231. package/Materials/PBR/pbrIridescenceConfiguration.js +5 -5
  232. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  233. package/Materials/PBR/pbrMaterial.js +209 -209
  234. package/Materials/PBR/pbrMaterial.js.map +1 -1
  235. package/Materials/PBR/pbrSheenConfiguration.js +5 -5
  236. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  237. package/Materials/PBR/pbrSpecularGlossinessMaterial.js +6 -6
  238. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  239. package/Materials/PBR/pbrSubSurfaceConfiguration.js +51 -51
  240. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  241. package/Materials/Textures/baseTexture.js +99 -99
  242. package/Materials/Textures/baseTexture.js.map +1 -1
  243. package/Materials/Textures/cubeTexture.js +61 -61
  244. package/Materials/Textures/cubeTexture.js.map +1 -1
  245. package/Materials/Textures/externalTexture.js +16 -16
  246. package/Materials/Textures/externalTexture.js.map +1 -1
  247. package/Materials/Textures/hdrCubeTexture.js +44 -44
  248. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  249. package/Materials/Textures/internalTexture.js +31 -31
  250. package/Materials/Textures/internalTexture.js.map +1 -1
  251. package/Materials/Textures/mirrorTexture.js +73 -73
  252. package/Materials/Textures/mirrorTexture.js.map +1 -1
  253. package/Materials/Textures/multiRenderTarget.js +47 -47
  254. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  255. package/Materials/Textures/rawTexture2DArray.js +6 -6
  256. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  257. package/Materials/Textures/renderTargetTexture.js +142 -142
  258. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  259. package/Materials/Textures/texture.d.ts +1 -1
  260. package/Materials/Textures/texture.js +26 -26
  261. package/Materials/Textures/texture.js.map +1 -1
  262. package/Materials/Textures/textureCreationOptions.d.ts +1 -1
  263. package/Materials/Textures/textureSampler.js +20 -20
  264. package/Materials/Textures/textureSampler.js.map +1 -1
  265. package/Materials/Textures/thinRenderTargetTexture.js +6 -6
  266. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  267. package/Materials/Textures/thinTexture.js +39 -39
  268. package/Materials/Textures/thinTexture.js.map +1 -1
  269. package/Materials/Textures/videoTexture.js +40 -40
  270. package/Materials/Textures/videoTexture.js.map +1 -1
  271. package/Materials/drawWrapper.js +6 -6
  272. package/Materials/drawWrapper.js.map +1 -1
  273. package/Materials/effect.js +18 -18
  274. package/Materials/effect.js.map +1 -1
  275. package/Materials/effectRenderer.js +9 -9
  276. package/Materials/effectRenderer.js.map +1 -1
  277. package/Materials/fresnelParameters.d.ts +2 -2
  278. package/Materials/fresnelParameters.js +13 -13
  279. package/Materials/fresnelParameters.js.map +1 -1
  280. package/Materials/material.detailMapConfiguration.js +5 -5
  281. package/Materials/material.detailMapConfiguration.js.map +1 -1
  282. package/Materials/material.js +223 -223
  283. package/Materials/material.js.map +1 -1
  284. package/Materials/materialPluginBase.js +5 -5
  285. package/Materials/materialPluginBase.js.map +1 -1
  286. package/Materials/materialPluginEvent.d.ts +14 -14
  287. package/Materials/materialPluginManager.d.ts +1 -1
  288. package/Materials/multiMaterial.js +16 -16
  289. package/Materials/multiMaterial.js.map +1 -1
  290. package/Materials/shadowDepthWrapper.js +14 -14
  291. package/Materials/shadowDepthWrapper.js.map +1 -1
  292. package/Materials/standardMaterial.js +100 -100
  293. package/Materials/standardMaterial.js.map +1 -1
  294. package/Materials/uniformBufferEffectCommonAccessor.js +3 -3
  295. package/Materials/uniformBufferEffectCommonAccessor.js.map +1 -1
  296. package/Maths/math.functions.js +2 -0
  297. package/Maths/math.functions.js.map +1 -1
  298. package/Maths/math.path.js +11 -11
  299. package/Maths/math.path.js.map +1 -1
  300. package/Maths/math.vector.d.ts +6 -7
  301. package/Maths/math.vector.js +48 -48
  302. package/Maths/math.vector.js.map +1 -1
  303. package/Meshes/Builders/goldbergBuilder.d.ts +2 -2
  304. package/Meshes/Compression/dracoCompression.js +23 -23
  305. package/Meshes/Compression/dracoCompression.js.map +1 -1
  306. package/Meshes/Compression/meshoptCompression.js +9 -9
  307. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  308. package/Meshes/abstractMesh.js +179 -179
  309. package/Meshes/abstractMesh.js.map +1 -1
  310. package/Meshes/geometry.js +32 -32
  311. package/Meshes/geometry.js.map +1 -1
  312. package/Meshes/goldbergMesh.d.ts +1 -1
  313. package/Meshes/linesMesh.js +3 -3
  314. package/Meshes/linesMesh.js.map +1 -1
  315. package/Meshes/mesh.js +165 -165
  316. package/Meshes/mesh.js.map +1 -1
  317. package/Meshes/mesh.vertexData.js.map +1 -1
  318. package/Meshes/polygonMesh.js +5 -5
  319. package/Meshes/polygonMesh.js.map +1 -1
  320. package/Meshes/subMesh.js +59 -59
  321. package/Meshes/subMesh.js.map +1 -1
  322. package/Meshes/transformNode.js +52 -52
  323. package/Meshes/transformNode.js.map +1 -1
  324. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +1 -1
  325. package/Misc/PerformanceViewer/performanceViewerCollector.js +12 -12
  326. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  327. package/Misc/arrayTools.d.ts +1 -1
  328. package/Misc/copyTextureToTexture.js +3 -3
  329. package/Misc/copyTextureToTexture.js.map +1 -1
  330. package/Misc/coroutine.d.ts +5 -5
  331. package/Misc/deferred.js +9 -9
  332. package/Misc/deferred.js.map +1 -1
  333. package/Misc/depthReducer.js +7 -7
  334. package/Misc/depthReducer.js.map +1 -1
  335. package/Misc/environmentTextureTools.d.ts +1 -1
  336. package/Misc/error.d.ts +1 -1
  337. package/Misc/fileTools.d.ts +5 -5
  338. package/Misc/filesInput.js +6 -6
  339. package/Misc/filesInput.js.map +1 -1
  340. package/Misc/khronosTextureContainer2.js +9 -9
  341. package/Misc/khronosTextureContainer2.js.map +1 -1
  342. package/Misc/observable.js +12 -12
  343. package/Misc/observable.js.map +1 -1
  344. package/Misc/perfCounter.js +16 -16
  345. package/Misc/perfCounter.js.map +1 -1
  346. package/Misc/sceneOptimizer.js +76 -76
  347. package/Misc/sceneOptimizer.js.map +1 -1
  348. package/Misc/stringDictionary.d.ts +1 -1
  349. package/Misc/trajectoryClassifier.js +67 -67
  350. package/Misc/trajectoryClassifier.js.map +1 -1
  351. package/Misc/videoRecorder.js +15 -15
  352. package/Misc/videoRecorder.js.map +1 -1
  353. package/Misc/virtualJoystick.js +12 -12
  354. package/Misc/virtualJoystick.js.map +1 -1
  355. package/Morph/morphTarget.js +28 -28
  356. package/Morph/morphTarget.js.map +1 -1
  357. package/Morph/morphTargetManager.js +18 -18
  358. package/Morph/morphTargetManager.js.map +1 -1
  359. package/Offline/database.js +12 -12
  360. package/Offline/database.js.map +1 -1
  361. package/Particles/EmitterTypes/coneParticleEmitter.js +25 -25
  362. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  363. package/Particles/EmitterTypes/meshParticleEmitter.js +20 -20
  364. package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
  365. package/Particles/baseParticleSystem.js +232 -232
  366. package/Particles/baseParticleSystem.js.map +1 -1
  367. package/Particles/cloudPoint.js +9 -9
  368. package/Particles/cloudPoint.js.map +1 -1
  369. package/Particles/gpuParticleSystem.js +123 -123
  370. package/Particles/gpuParticleSystem.js.map +1 -1
  371. package/Particles/particleSystem.js +102 -102
  372. package/Particles/particleSystem.js.map +1 -1
  373. package/Particles/pointsCloudSystem.js +18 -18
  374. package/Particles/pointsCloudSystem.js.map +1 -1
  375. package/Particles/solidParticle.js +23 -23
  376. package/Particles/solidParticle.js.map +1 -1
  377. package/Physics/v1/physicsEngine.js +14 -14
  378. package/Physics/v1/physicsEngine.js.map +1 -1
  379. package/Physics/v1/physicsImpostor.js +149 -149
  380. package/Physics/v1/physicsImpostor.js.map +1 -1
  381. package/Physics/v2/physicsEngine.js +14 -14
  382. package/Physics/v2/physicsEngine.js.map +1 -1
  383. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +129 -129
  384. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  385. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +68 -68
  386. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  387. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +6 -6
  388. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  389. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +226 -225
  390. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  391. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +10 -10
  392. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  393. package/PostProcesses/anaglyphPostProcess.js +7 -7
  394. package/PostProcesses/anaglyphPostProcess.js.map +1 -1
  395. package/PostProcesses/blackAndWhitePostProcess.js +7 -7
  396. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  397. package/PostProcesses/bloomEffect.js +28 -28
  398. package/PostProcesses/bloomEffect.js.map +1 -1
  399. package/PostProcesses/bloomMergePostProcess.js +7 -7
  400. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  401. package/PostProcesses/blurPostProcess.js +32 -32
  402. package/PostProcesses/blurPostProcess.js.map +1 -1
  403. package/PostProcesses/chromaticAberrationPostProcess.js +7 -7
  404. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  405. package/PostProcesses/circleOfConfusionPostProcess.js +7 -7
  406. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  407. package/PostProcesses/colorCorrectionPostProcess.js +7 -7
  408. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  409. package/PostProcesses/convolutionPostProcess.js +7 -7
  410. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  411. package/PostProcesses/depthOfFieldBlurPostProcess.js +7 -7
  412. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  413. package/PostProcesses/depthOfFieldEffect.js +36 -36
  414. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  415. package/PostProcesses/depthOfFieldMergePostProcess.js +7 -7
  416. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  417. package/PostProcesses/extractHighlightsPostProcess.js +7 -7
  418. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  419. package/PostProcesses/filterPostProcess.js +7 -7
  420. package/PostProcesses/filterPostProcess.js.map +1 -1
  421. package/PostProcesses/grainPostProcess.js +7 -7
  422. package/PostProcesses/grainPostProcess.js.map +1 -1
  423. package/PostProcesses/imageProcessingPostProcess.js +42 -42
  424. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  425. package/PostProcesses/motionBlurPostProcess.js +41 -41
  426. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  427. package/PostProcesses/passPostProcess.js +15 -15
  428. package/PostProcesses/passPostProcess.js.map +1 -1
  429. package/PostProcesses/postProcess.d.ts +2 -2
  430. package/PostProcesses/postProcess.js +123 -123
  431. package/PostProcesses/postProcess.js.map +1 -1
  432. package/PostProcesses/refractionPostProcess.js +21 -21
  433. package/PostProcesses/refractionPostProcess.js.map +1 -1
  434. package/PostProcesses/screenSpaceCurvaturePostProcess.js +7 -7
  435. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  436. package/PostProcesses/screenSpaceReflectionPostProcess.js +19 -19
  437. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  438. package/PostProcesses/sharpenPostProcess.js +7 -7
  439. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  440. package/PostProcesses/stereoscopicInterlacePostProcess.js +14 -14
  441. package/PostProcesses/stereoscopicInterlacePostProcess.js.map +1 -1
  442. package/PostProcesses/tonemapPostProcess.js +7 -7
  443. package/PostProcesses/tonemapPostProcess.js.map +1 -1
  444. package/PostProcesses/volumetricLightScatteringPostProcess.js +11 -11
  445. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  446. package/PostProcesses/vrDistortionCorrectionPostProcess.js +7 -7
  447. package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
  448. package/Rendering/depthPeelingRenderer.js +36 -36
  449. package/Rendering/depthPeelingRenderer.js.map +1 -1
  450. package/Rendering/depthRenderer.js +8 -8
  451. package/Rendering/depthRenderer.js.map +1 -1
  452. package/Rendering/edgesRenderer.js +34 -34
  453. package/Rendering/edgesRenderer.js.map +1 -1
  454. package/Rendering/fluidRenderer/fluidRenderer.js +8 -8
  455. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  456. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +3 -3
  457. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
  458. package/Rendering/fluidRenderer/fluidRenderingObject.js +19 -19
  459. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  460. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +12 -12
  461. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  462. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +18 -18
  463. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  464. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +68 -68
  465. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  466. package/Rendering/fluidRenderer/fluidRenderingTextures.js +29 -29
  467. package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
  468. package/Rendering/geometryBufferRenderer.js +44 -44
  469. package/Rendering/geometryBufferRenderer.js.map +1 -1
  470. package/Rendering/prePassRenderer.js +51 -51
  471. package/Rendering/prePassRenderer.js.map +1 -1
  472. package/Rendering/renderingGroup.js +25 -25
  473. package/Rendering/renderingGroup.js.map +1 -1
  474. package/Rendering/renderingManager.js +21 -21
  475. package/Rendering/renderingManager.js.map +1 -1
  476. package/Rendering/subSurfaceConfiguration.js +18 -18
  477. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  478. package/Rendering/utilityLayerRenderer.js +76 -76
  479. package/Rendering/utilityLayerRenderer.js.map +1 -1
  480. package/Sprites/sprite.js +16 -16
  481. package/Sprites/sprite.js.map +1 -1
  482. package/Sprites/spriteManager.js +81 -81
  483. package/Sprites/spriteManager.js.map +1 -1
  484. package/Sprites/spriteMap.js +32 -32
  485. package/Sprites/spriteMap.js.map +1 -1
  486. package/Sprites/spriteRenderer.js +6 -6
  487. package/Sprites/spriteRenderer.js.map +1 -1
  488. package/Sprites/thinSprite.js +22 -22
  489. package/Sprites/thinSprite.js.map +1 -1
  490. package/States/stencilStateComposer.js +10 -10
  491. package/States/stencilStateComposer.js.map +1 -1
  492. package/XR/features/WebXRAnchorSystem.js +7 -7
  493. package/XR/features/WebXRAnchorSystem.js.map +1 -1
  494. package/XR/features/WebXRControllerMovement.d.ts +3 -3
  495. package/XR/features/WebXRControllerMovement.js +97 -97
  496. package/XR/features/WebXRControllerMovement.js.map +1 -1
  497. package/XR/features/WebXRControllerPhysics.js +24 -24
  498. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  499. package/XR/features/WebXRControllerTeleportation.js +26 -26
  500. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  501. package/XR/features/WebXRDOMOverlay.d.ts +1 -1
  502. package/XR/features/WebXRFeaturePointSystem.js +6 -6
  503. package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
  504. package/XR/features/WebXRHandTracking.d.ts +1 -1
  505. package/XR/features/WebXRHandTracking.js +95 -95
  506. package/XR/features/WebXRHandTracking.js.map +1 -1
  507. package/XR/features/WebXRWalkingLocomotion.js +21 -21
  508. package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
  509. package/XR/motionController/webXRAbstractMotionController.d.ts +3 -3
  510. package/XR/motionController/webXRMotionControllerManager.d.ts +1 -1
  511. package/XR/native/nativeXRFrame.js +3 -3
  512. package/XR/native/nativeXRFrame.js.map +1 -1
  513. package/XR/webXRFeaturesManager.d.ts +1 -1
  514. package/XR/webXRLayerWrapper.d.ts +2 -2
  515. package/XR/webXRLayerWrapper.js +17 -17
  516. package/XR/webXRLayerWrapper.js.map +1 -1
  517. package/abstractScene.d.ts +2 -2
  518. package/node.d.ts +1 -1
  519. package/node.js +71 -71
  520. package/node.js.map +1 -1
  521. package/package.json +1 -1
  522. package/scene.js +777 -777
  523. package/scene.js.map +1 -1
  524. package/sceneComponent.d.ts +12 -12
  525. package/types.d.ts +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"physicsImpostor.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v1/physicsImpostor.ts"],"names":[],"mappings":"AACA,O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G,GAAG,CAAC","sourcesContent":["import type { Nullable, IndicesArray } from \"../../types\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { ArrayTools } from \"../../Misc/arrayTools\";\r\nimport type { Matrix } from \"../../Maths/math.vector\";\r\nimport { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\nimport type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Bone } from \"../../Bones/bone\";\r\nimport type { BoundingInfo } from \"../../Culling/boundingInfo\";\r\nimport type { PhysicsEngine as PhysicsEngineV1 } from \"./physicsEngine\";\r\n\r\nimport type { PhysicsJointData } from \"./physicsJoint\";\r\nimport { PhysicsJoint } from \"./physicsJoint\";\r\nimport { Space } from \"../../Maths/math.axis\";\r\n\r\n/**\r\n * The interface for the physics imposter parameters\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface PhysicsImpostorParameters {\r\n /**\r\n * The mass of the physics imposter\r\n */\r\n mass: number;\r\n /**\r\n * The friction of the physics imposter\r\n */\r\n friction?: number;\r\n /**\r\n * The coefficient of restitution of the physics imposter\r\n */\r\n restitution?: number;\r\n /**\r\n * The native options of the physics imposter\r\n */\r\n nativeOptions?: any;\r\n /**\r\n * Specifies if the parent should be ignored\r\n */\r\n ignoreParent?: boolean;\r\n /**\r\n * Specifies if bi-directional transformations should be disabled\r\n */\r\n disableBidirectionalTransformation?: boolean;\r\n /**\r\n * The pressure inside the physics imposter, soft object only\r\n */\r\n pressure?: number;\r\n /**\r\n * The stiffness the physics imposter, soft object only\r\n */\r\n stiffness?: number;\r\n /**\r\n * The number of iterations used in maintaining consistent vertex velocities, soft object only\r\n */\r\n velocityIterations?: number;\r\n /**\r\n * The number of iterations used in maintaining consistent vertex positions, soft object only\r\n */\r\n positionIterations?: number;\r\n /**\r\n * The number used to fix points on a cloth (0, 1, 2, 4, 8) or rope (0, 1, 2) only\r\n * 0 None, 1, back left or top, 2, back right or bottom, 4, front left, 8, front right\r\n * Add to fix multiple points\r\n */\r\n fixedPoints?: number;\r\n /**\r\n * The collision margin around a soft object\r\n */\r\n margin?: number;\r\n /**\r\n * The collision margin around a soft object\r\n */\r\n damping?: number;\r\n /**\r\n * The path for a rope based on an extrusion\r\n */\r\n path?: any;\r\n /**\r\n * The shape of an extrusion used for a rope based on an extrusion\r\n */\r\n shape?: any;\r\n}\r\n\r\n/**\r\n * Interface for a physics-enabled object\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface IPhysicsEnabledObject {\r\n /**\r\n * The position of the physics-enabled object\r\n */\r\n position: Vector3;\r\n /**\r\n * The rotation of the physics-enabled object\r\n */\r\n rotationQuaternion: Nullable<Quaternion>;\r\n /**\r\n * The scale of the physics-enabled object\r\n */\r\n scaling: Vector3;\r\n /**\r\n * The rotation of the physics-enabled object\r\n */\r\n rotation?: Vector3;\r\n /**\r\n * The parent of the physics-enabled object\r\n */\r\n parent?: any;\r\n /**\r\n * The bounding info of the physics-enabled object\r\n * @returns The bounding info of the physics-enabled object\r\n */\r\n getBoundingInfo(): BoundingInfo;\r\n /**\r\n * Computes the world matrix\r\n * @param force Specifies if the world matrix should be computed by force\r\n * @returns A world matrix\r\n */\r\n computeWorldMatrix(force: boolean): Matrix;\r\n /**\r\n * Gets the world matrix\r\n * @returns A world matrix\r\n */\r\n getWorldMatrix?(): Matrix;\r\n /**\r\n * Gets the child meshes\r\n * @param directDescendantsOnly Specifies if only direct-descendants should be obtained\r\n * @returns An array of abstract meshes\r\n */\r\n getChildMeshes?(directDescendantsOnly?: boolean): Array<AbstractMesh>;\r\n /**\r\n * Gets the vertex data\r\n * @param kind The type of vertex data\r\n * @returns A nullable array of numbers, or a float32 array\r\n */\r\n getVerticesData(kind: string): Nullable<Array<number> | Float32Array>;\r\n /**\r\n * Gets the indices from the mesh\r\n * @returns A nullable array of index arrays\r\n */\r\n getIndices?(): Nullable<IndicesArray>;\r\n /**\r\n * Gets the scene from the mesh\r\n * @returns the indices array or null\r\n */\r\n getScene?(): Scene;\r\n /**\r\n * Gets the absolute position from the mesh\r\n * @returns the absolute position\r\n */\r\n getAbsolutePosition(): Vector3;\r\n /**\r\n * Gets the absolute pivot point from the mesh\r\n * @returns the absolute pivot point\r\n */\r\n getAbsolutePivotPoint(): Vector3;\r\n /**\r\n * Rotates the mesh\r\n * @param axis The axis of rotation\r\n * @param amount The amount of rotation\r\n * @param space The space of the rotation\r\n * @returns The rotation transform node\r\n */\r\n rotate(axis: Vector3, amount: number, space?: Space): TransformNode;\r\n /**\r\n * Translates the mesh\r\n * @param axis The axis of translation\r\n * @param distance The distance of translation\r\n * @param space The space of the translation\r\n * @returns The transform node\r\n */\r\n translate(axis: Vector3, distance: number, space?: Space): TransformNode;\r\n /**\r\n * Sets the absolute position of the mesh\r\n * @param absolutePosition The absolute position of the mesh\r\n * @returns The transform node\r\n */\r\n setAbsolutePosition(absolutePosition: Vector3): TransformNode;\r\n /**\r\n * Gets the class name of the mesh\r\n * @returns The class name\r\n */\r\n getClassName(): string;\r\n}\r\n\r\nMesh._PhysicsImpostorParser = function (scene: Scene, physicObject: IPhysicsEnabledObject, jsonObject: any): PhysicsImpostor {\r\n return new PhysicsImpostor(\r\n physicObject,\r\n jsonObject.physicsImpostor,\r\n {\r\n mass: jsonObject.physicsMass,\r\n friction: jsonObject.physicsFriction,\r\n restitution: jsonObject.physicsRestitution,\r\n },\r\n scene\r\n );\r\n};\r\n\r\n/**\r\n * Represents a physics imposter\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class PhysicsImpostor {\r\n /**\r\n * The default object size of the imposter\r\n */\r\n public static DEFAULT_OBJECT_SIZE: Vector3 = new Vector3(1, 1, 1);\r\n\r\n /**\r\n * The identity quaternion of the imposter\r\n */\r\n public static IDENTITY_QUATERNION = Quaternion.Identity();\r\n\r\n /** @internal */\r\n public _pluginData: any = {};\r\n\r\n private _physicsEngine: Nullable<PhysicsEngineV1>;\r\n //The native cannon/oimo/energy physics body object.\r\n private _physicsBody: any;\r\n private _bodyUpdateRequired: boolean = false;\r\n\r\n private _onBeforePhysicsStepCallbacks = new Array<(impostor: PhysicsImpostor) => void>();\r\n private _onAfterPhysicsStepCallbacks = new Array<(impostor: PhysicsImpostor) => void>();\r\n /** @internal */\r\n public _onPhysicsCollideCallbacks: Array<{\r\n callback: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor, point: Nullable<Vector3>, distance: number, impulse: number, normal: Nullable<Vector3>) => void;\r\n otherImpostors: Array<PhysicsImpostor>;\r\n }> = [];\r\n\r\n private _deltaPosition: Vector3 = Vector3.Zero();\r\n private _deltaRotation: Quaternion;\r\n private _deltaRotationConjugated: Quaternion;\r\n\r\n /** @internal */\r\n public _isFromLine: boolean;\r\n\r\n //If set, this is this impostor's parent\r\n private _parent: Nullable<PhysicsImpostor>;\r\n\r\n private _isDisposed = false;\r\n\r\n private static _TmpVecs: Vector3[] = ArrayTools.BuildArray(3, Vector3.Zero);\r\n private static _TmpQuat: Quaternion = Quaternion.Identity();\r\n\r\n /**\r\n * Specifies if the physics imposter is disposed\r\n */\r\n get isDisposed(): boolean {\r\n return this._isDisposed;\r\n }\r\n\r\n /**\r\n * Gets the mass of the physics imposter\r\n */\r\n get mass(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;\r\n }\r\n\r\n set mass(value: number) {\r\n this.setMass(value);\r\n }\r\n\r\n /**\r\n * Gets the coefficient of friction\r\n */\r\n get friction(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;\r\n }\r\n\r\n /**\r\n * Sets the coefficient of friction\r\n */\r\n set friction(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, value);\r\n }\r\n\r\n /**\r\n * Gets the coefficient of restitution\r\n */\r\n get restitution(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;\r\n }\r\n\r\n /**\r\n * Sets the coefficient of restitution\r\n */\r\n set restitution(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, value);\r\n }\r\n\r\n /**\r\n * Gets the pressure of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get pressure(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPressure) {\r\n return 0;\r\n }\r\n return plugin.getBodyPressure!(this);\r\n }\r\n\r\n /**\r\n * Sets the pressure of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set pressure(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPressure) {\r\n return;\r\n }\r\n plugin.setBodyPressure!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the stiffness of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get stiffness(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyStiffness) {\r\n return 0;\r\n }\r\n return plugin.getBodyStiffness!(this);\r\n }\r\n\r\n /**\r\n * Sets the stiffness of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set stiffness(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyStiffness) {\r\n return;\r\n }\r\n plugin.setBodyStiffness!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the velocityIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get velocityIterations(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyVelocityIterations) {\r\n return 0;\r\n }\r\n return plugin.getBodyVelocityIterations!(this);\r\n }\r\n\r\n /**\r\n * Sets the velocityIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set velocityIterations(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyVelocityIterations) {\r\n return;\r\n }\r\n plugin.setBodyVelocityIterations!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the positionIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get positionIterations(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyPositionIterations) {\r\n return 0;\r\n }\r\n return plugin.getBodyPositionIterations!(this);\r\n }\r\n\r\n /**\r\n * Sets the positionIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set positionIterations(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPositionIterations) {\r\n return;\r\n }\r\n plugin.setBodyPositionIterations!(this, value);\r\n }\r\n\r\n /**\r\n * The unique id of the physics imposter\r\n * set by the physics engine when adding this impostor to the array\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n public soft: boolean = false;\r\n\r\n /**\r\n * @internal\r\n */\r\n public segments: number = 0;\r\n\r\n private _joints: Array<{\r\n joint: PhysicsJoint;\r\n otherImpostor: PhysicsImpostor;\r\n }>;\r\n\r\n /**\r\n * Initializes the physics imposter\r\n * @param object The physics-enabled object used as the physics imposter\r\n * @param type The type of the physics imposter. Types are available as static members of this class.\r\n * @param _options The options for the physics imposter\r\n * @param _scene The Babylon scene\r\n */\r\n constructor(\r\n /**\r\n * The physics-enabled object used as the physics imposter\r\n */\r\n public object: IPhysicsEnabledObject,\r\n /**\r\n * The type of the physics imposter\r\n */\r\n public type: number,\r\n private _options: PhysicsImpostorParameters = { mass: 0 },\r\n private _scene?: Scene\r\n ) {\r\n //sanity check!\r\n if (!this.object) {\r\n Logger.Error(\"No object was provided. A physics object is obligatory\");\r\n return;\r\n }\r\n if (this.object.parent && _options.mass !== 0) {\r\n Logger.Warn(\"A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur.\");\r\n }\r\n\r\n // Legacy support for old syntax.\r\n if (!this._scene && object.getScene) {\r\n this._scene = object.getScene();\r\n }\r\n\r\n if (!this._scene) {\r\n return;\r\n }\r\n\r\n if (this.type > 100) {\r\n this.soft = true;\r\n }\r\n\r\n this._physicsEngine = this._scene.getPhysicsEngine() as any;\r\n if (!this._physicsEngine) {\r\n Logger.Error(\"Physics not enabled. Please use scene.enablePhysics(...) before creating impostors.\");\r\n } else {\r\n //set the object's quaternion, if not set\r\n if (!this.object.rotationQuaternion) {\r\n if (this.object.rotation) {\r\n this.object.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z);\r\n } else {\r\n this.object.rotationQuaternion = new Quaternion();\r\n }\r\n }\r\n //default options params\r\n this._options.mass = _options.mass === void 0 ? 0 : _options.mass;\r\n this._options.friction = _options.friction === void 0 ? 0.2 : _options.friction;\r\n this._options.restitution = _options.restitution === void 0 ? 0.2 : _options.restitution;\r\n if (this.soft) {\r\n //softbody mass must be above 0;\r\n this._options.mass = this._options.mass > 0 ? this._options.mass : 1;\r\n this._options.pressure = _options.pressure === void 0 ? 200 : _options.pressure;\r\n this._options.stiffness = _options.stiffness === void 0 ? 1 : _options.stiffness;\r\n this._options.velocityIterations = _options.velocityIterations === void 0 ? 20 : _options.velocityIterations;\r\n this._options.positionIterations = _options.positionIterations === void 0 ? 20 : _options.positionIterations;\r\n this._options.fixedPoints = _options.fixedPoints === void 0 ? 0 : _options.fixedPoints;\r\n this._options.margin = _options.margin === void 0 ? 0 : _options.margin;\r\n this._options.damping = _options.damping === void 0 ? 0 : _options.damping;\r\n this._options.path = _options.path === void 0 ? null : _options.path;\r\n this._options.shape = _options.shape === void 0 ? null : _options.shape;\r\n }\r\n this._joints = [];\r\n //If the mesh has a parent, don't initialize the physicsBody. Instead wait for the parent to do that.\r\n if (!this.object.parent || this._options.ignoreParent) {\r\n this._init();\r\n } else if (this.object.parent.physicsImpostor) {\r\n Logger.Warn(\"You must affect impostors to children before affecting impostor to parent.\");\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This function will completely initialize this impostor.\r\n * It will create a new body - but only if this mesh has no parent.\r\n * If it has, this impostor will not be used other than to define the impostor\r\n * of the child mesh.\r\n * @internal\r\n */\r\n public _init() {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._physicsEngine.removeImpostor(this);\r\n this.physicsBody = null;\r\n this._parent = this._parent || this._getPhysicsParent();\r\n if (!this._isDisposed && (!this.parent || this._options.ignoreParent)) {\r\n this._physicsEngine.addImpostor(this);\r\n }\r\n }\r\n\r\n private _getPhysicsParent(): Nullable<PhysicsImpostor> {\r\n if (this.object.parent instanceof AbstractMesh) {\r\n const parentMesh: AbstractMesh = <AbstractMesh>this.object.parent;\r\n return parentMesh.physicsImpostor;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Should a new body be generated.\r\n * @returns boolean specifying if body initialization is required\r\n */\r\n public isBodyInitRequired(): boolean {\r\n return this._bodyUpdateRequired || (!this._physicsBody && (!this._parent || !!this._options.ignoreParent));\r\n }\r\n\r\n /**\r\n * Sets the updated scaling\r\n */\r\n public setScalingUpdated() {\r\n this.forceUpdate();\r\n }\r\n\r\n /**\r\n * Force a regeneration of this or the parent's impostor's body.\r\n * Use with caution - This will remove all previously-instantiated joints.\r\n */\r\n public forceUpdate() {\r\n this._init();\r\n if (this.parent && !this._options.ignoreParent) {\r\n this.parent.forceUpdate();\r\n }\r\n }\r\n\r\n /*public get mesh(): AbstractMesh {\r\n return this._mesh;\r\n }*/\r\n\r\n /**\r\n * Gets the body that holds this impostor. Either its own, or its parent.\r\n */\r\n public get physicsBody(): any {\r\n return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;\r\n }\r\n\r\n /**\r\n * Get the parent of the physics imposter\r\n * @returns Physics imposter or null\r\n */\r\n public get parent(): Nullable<PhysicsImpostor> {\r\n return !this._options.ignoreParent && this._parent ? this._parent : null;\r\n }\r\n\r\n /**\r\n * Sets the parent of the physics imposter\r\n */\r\n public set parent(value: Nullable<PhysicsImpostor>) {\r\n this._parent = value;\r\n }\r\n\r\n /**\r\n * Set the physics body. Used mainly by the physics engine/plugin\r\n */\r\n public set physicsBody(physicsBody: any) {\r\n if (this._physicsBody && this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this);\r\n }\r\n this._physicsBody = physicsBody;\r\n this.resetUpdateFlags();\r\n }\r\n\r\n /**\r\n * Resets the update flags\r\n */\r\n public resetUpdateFlags() {\r\n this._bodyUpdateRequired = false;\r\n }\r\n\r\n /**\r\n * Gets the object extents\r\n * @returns the object extents\r\n */\r\n public getObjectExtents(): Vector3 {\r\n if (this.object.getBoundingInfo) {\r\n const q = this.object.rotationQuaternion;\r\n const scaling = this.object.scaling.clone();\r\n //reset rotation\r\n this.object.rotationQuaternion = PhysicsImpostor.IDENTITY_QUATERNION;\r\n //calculate the world matrix with no rotation\r\n const worldMatrix = this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);\r\n if (worldMatrix) {\r\n worldMatrix.decompose(scaling, undefined, undefined);\r\n }\r\n const boundingInfo = this.object.getBoundingInfo();\r\n // get the global scaling of the object\r\n const size = boundingInfo.boundingBox.extendSize.scale(2).multiplyInPlace(scaling);\r\n size.x = Math.abs(size.x);\r\n size.y = Math.abs(size.y);\r\n size.z = Math.abs(size.z);\r\n //bring back the rotation\r\n this.object.rotationQuaternion = q;\r\n //calculate the world matrix with the new rotation\r\n this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);\r\n return size;\r\n } else {\r\n return PhysicsImpostor.DEFAULT_OBJECT_SIZE;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the object center\r\n * @returns The object center\r\n */\r\n public getObjectCenter(): Vector3 {\r\n if (this.object.getBoundingInfo) {\r\n const boundingInfo = this.object.getBoundingInfo();\r\n return boundingInfo.boundingBox.centerWorld;\r\n } else {\r\n return this.object.position;\r\n }\r\n }\r\n\r\n /**\r\n * Get a specific parameter from the options parameters\r\n * @param paramName The object parameter name\r\n * @returns The object parameter\r\n */\r\n public getParam(paramName: string): any {\r\n return (<any>this._options)[paramName];\r\n }\r\n\r\n /**\r\n * Sets a specific parameter in the options given to the physics plugin\r\n * @param paramName The parameter name\r\n * @param value The value of the parameter\r\n */\r\n public setParam(paramName: string, value: number) {\r\n (<any>this._options)[paramName] = value;\r\n this._bodyUpdateRequired = true;\r\n }\r\n\r\n /**\r\n * Specifically change the body's mass. Won't recreate the physics body object\r\n * @param mass The mass of the physics imposter\r\n */\r\n public setMass(mass: number) {\r\n if (this.getParam(\"mass\") !== mass) {\r\n this.setParam(\"mass\", mass);\r\n }\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setBodyMass(this, mass);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the linear velocity\r\n * @returns linear velocity or null\r\n */\r\n public getLinearVelocity(): Nullable<Vector3> {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : Vector3.Zero();\r\n }\r\n\r\n /**\r\n * Sets the linear velocity\r\n * @param velocity linear velocity or null\r\n */\r\n public setLinearVelocity(velocity: Nullable<Vector3>) {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, velocity);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the angular velocity\r\n * @returns angular velocity or null\r\n */\r\n public getAngularVelocity(): Nullable<Vector3> {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : Vector3.Zero();\r\n }\r\n\r\n /**\r\n * Sets the angular velocity\r\n * @param velocity The velocity or null\r\n */\r\n public setAngularVelocity(velocity: Nullable<Vector3>) {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, velocity);\r\n }\r\n }\r\n\r\n /**\r\n * Execute a function with the physics plugin native code\r\n * Provide a function the will have two variables - the world object and the physics body object\r\n * @param func The function to execute with the physics plugin native code\r\n */\r\n public executeNativeFunction(func: (world: any, physicsBody: any) => void) {\r\n if (this._physicsEngine) {\r\n func(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);\r\n }\r\n }\r\n\r\n /**\r\n * Register a function that will be executed before the physics world is stepping forward\r\n * @param func The function to execute before the physics world is stepped forward\r\n */\r\n public registerBeforePhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n this._onBeforePhysicsStepCallbacks.push(func);\r\n }\r\n\r\n /**\r\n * Unregister a function that will be executed before the physics world is stepping forward\r\n * @param func The function to execute before the physics world is stepped forward\r\n */\r\n public unregisterBeforePhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n const index = this._onBeforePhysicsStepCallbacks.indexOf(func);\r\n\r\n if (index > -1) {\r\n this._onBeforePhysicsStepCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n /**\r\n * Register a function that will be executed after the physics step\r\n * @param func The function to execute after physics step\r\n */\r\n public registerAfterPhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n this._onAfterPhysicsStepCallbacks.push(func);\r\n }\r\n\r\n /**\r\n * Unregisters a function that will be executed after the physics step\r\n * @param func The function to execute after physics step\r\n */\r\n public unregisterAfterPhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n const index = this._onAfterPhysicsStepCallbacks.indexOf(func);\r\n\r\n if (index > -1) {\r\n this._onAfterPhysicsStepCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n /**\r\n * register a function that will be executed when this impostor collides against a different body\r\n * @param collideAgainst Physics imposter, or array of physics imposters to collide against\r\n * @param func Callback that is executed on collision\r\n */\r\n public registerOnPhysicsCollide(\r\n collideAgainst: PhysicsImpostor | Array<PhysicsImpostor>,\r\n func: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor, point: Nullable<Vector3>) => void\r\n ): void {\r\n const collidedAgainstList: Array<PhysicsImpostor> = collideAgainst instanceof Array ? <Array<PhysicsImpostor>>collideAgainst : [<PhysicsImpostor>collideAgainst];\r\n this._onPhysicsCollideCallbacks.push({ callback: func, otherImpostors: collidedAgainstList });\r\n }\r\n\r\n /**\r\n * Unregisters the physics imposter's collision callback\r\n * @param collideAgainst The physics object to collide against\r\n * @param func Callback to execute on collision\r\n */\r\n public unregisterOnPhysicsCollide(\r\n collideAgainst: PhysicsImpostor | Array<PhysicsImpostor>,\r\n func: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor | Array<PhysicsImpostor>, point: Nullable<Vector3>) => void\r\n ): void {\r\n const collidedAgainstList: Array<PhysicsImpostor> = collideAgainst instanceof Array ? <Array<PhysicsImpostor>>collideAgainst : [<PhysicsImpostor>collideAgainst];\r\n let index = -1;\r\n const found = this._onPhysicsCollideCallbacks.some((cbDef, idx) => {\r\n if (cbDef.callback === func && cbDef.otherImpostors.length === collidedAgainstList.length) {\r\n // chcek the arrays match\r\n const sameList = cbDef.otherImpostors.every((impostor) => {\r\n return collidedAgainstList.indexOf(impostor) > -1;\r\n });\r\n if (sameList) {\r\n index = idx;\r\n }\r\n return sameList;\r\n }\r\n return false;\r\n });\r\n\r\n if (found) {\r\n this._onPhysicsCollideCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n //temp variables for parent rotation calculations\r\n //private _mats: Array<Matrix> = [new Matrix(), new Matrix()];\r\n private _tmpQuat: Quaternion = new Quaternion();\r\n private _tmpQuat2: Quaternion = new Quaternion();\r\n\r\n /**\r\n * Get the parent rotation\r\n * @returns The parent rotation\r\n */\r\n public getParentsRotation(): Quaternion {\r\n let parent = this.object.parent;\r\n this._tmpQuat.copyFromFloats(0, 0, 0, 1);\r\n while (parent) {\r\n if (parent.rotationQuaternion) {\r\n this._tmpQuat2.copyFrom(parent.rotationQuaternion);\r\n } else {\r\n Quaternion.RotationYawPitchRollToRef(parent.rotation.y, parent.rotation.x, parent.rotation.z, this._tmpQuat2);\r\n }\r\n this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat);\r\n parent = parent.parent;\r\n }\r\n return this._tmpQuat;\r\n }\r\n\r\n /**\r\n * this function is executed by the physics engine.\r\n */\r\n public beforeStep = () => {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this.object.translate(this._deltaPosition, -1);\r\n this._deltaRotationConjugated &&\r\n this.object.rotationQuaternion &&\r\n this.object.rotationQuaternion.multiplyToRef(this._deltaRotationConjugated, this.object.rotationQuaternion);\r\n this.object.computeWorldMatrix(false);\r\n if (this.object.parent && this.object.rotationQuaternion) {\r\n this.getParentsRotation();\r\n this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this._tmpQuat);\r\n } else {\r\n this._tmpQuat.copyFrom(this.object.rotationQuaternion || new Quaternion());\r\n }\r\n if (!this._options.disableBidirectionalTransformation) {\r\n this.object.rotationQuaternion &&\r\n this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(this, /*bInfo.boundingBox.centerWorld*/ this.object.getAbsolutePosition(), this._tmpQuat);\r\n }\r\n\r\n this._onBeforePhysicsStepCallbacks.forEach((func) => {\r\n func(this);\r\n });\r\n };\r\n\r\n /**\r\n * this function is executed by the physics engine\r\n */\r\n public afterStep = () => {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._onAfterPhysicsStepCallbacks.forEach((func) => {\r\n func(this);\r\n });\r\n\r\n this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(this);\r\n // object has now its world rotation. needs to be converted to local.\r\n if (this.object.parent && this.object.rotationQuaternion) {\r\n this.getParentsRotation();\r\n this._tmpQuat.conjugateInPlace();\r\n this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this.object.rotationQuaternion);\r\n }\r\n // take the position set and make it the absolute position of this object.\r\n this.object.setAbsolutePosition(this.object.position);\r\n if (this._deltaRotation) {\r\n this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotation, this.object.rotationQuaternion);\r\n this._deltaPosition.applyRotationQuaternionToRef(this._deltaRotation, PhysicsImpostor._TmpVecs[0]);\r\n this.object.translate(PhysicsImpostor._TmpVecs[0], 1);\r\n } else {\r\n this.object.translate(this._deltaPosition, 1);\r\n }\r\n this.object.computeWorldMatrix(true);\r\n };\r\n\r\n /**\r\n * Legacy collision detection event support\r\n */\r\n public onCollideEvent: Nullable<(collider: PhysicsImpostor, collidedWith: PhysicsImpostor) => void> = null;\r\n\r\n /**\r\n *\r\n * @param e\r\n * @returns\r\n */\r\n public onCollide = (e: { body: any; point: Nullable<Vector3>; distance: number; impulse: number; normal: Nullable<Vector3> }) => {\r\n if (!this._onPhysicsCollideCallbacks.length && !this.onCollideEvent) {\r\n return;\r\n }\r\n\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const otherImpostor = this._physicsEngine.getImpostorWithPhysicsBody(e.body);\r\n if (otherImpostor) {\r\n // Legacy collision detection event support\r\n if (this.onCollideEvent) {\r\n this.onCollideEvent(this, otherImpostor);\r\n }\r\n this._onPhysicsCollideCallbacks\r\n .filter((obj) => {\r\n return obj.otherImpostors.indexOf(<PhysicsImpostor>otherImpostor) !== -1;\r\n })\r\n .forEach((obj) => {\r\n obj.callback(this, <PhysicsImpostor>otherImpostor, e.point, e.distance, e.impulse, e.normal);\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Apply a force\r\n * @param force The force to apply\r\n * @param contactPoint The contact point for the force\r\n * @returns The physics imposter\r\n */\r\n public applyForce(force: Vector3, contactPoint: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().applyForce(this, force, contactPoint);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Apply an impulse\r\n * @param force The impulse force\r\n * @param contactPoint The contact point for the impulse force\r\n * @returns The physics imposter\r\n */\r\n public applyImpulse(force: Vector3, contactPoint: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().applyImpulse(this, force, contactPoint);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * A help function to create a joint\r\n * @param otherImpostor A physics imposter used to create a joint\r\n * @param jointType The type of joint\r\n * @param jointData The data for the joint\r\n * @returns The physics imposter\r\n */\r\n public createJoint(otherImpostor: PhysicsImpostor, jointType: number, jointData: PhysicsJointData): PhysicsImpostor {\r\n const joint = new PhysicsJoint(jointType, jointData);\r\n this.addJoint(otherImpostor, joint);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a joint to this impostor with a different impostor\r\n * @param otherImpostor A physics imposter used to add a joint\r\n * @param joint The joint to add\r\n * @returns The physics imposter\r\n */\r\n public addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor {\r\n this._joints.push({\r\n otherImpostor: otherImpostor,\r\n joint: joint,\r\n });\r\n\r\n if (this._physicsEngine) {\r\n this._physicsEngine.addJoint(this, otherImpostor, joint);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add an anchor to a cloth impostor\r\n * @param otherImpostor rigid impostor to anchor to\r\n * @param width ratio across width from 0 to 1\r\n * @param height ratio up height from 0 to 1\r\n * @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch\r\n * @param noCollisionBetweenLinkedBodies when true collisions between cloth impostor and anchor are ignored; default false\r\n * @returns impostor the soft imposter\r\n */\r\n public addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor {\r\n if (!this._physicsEngine) {\r\n return this;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.appendAnchor) {\r\n return this;\r\n }\r\n if (this._physicsEngine) {\r\n plugin.appendAnchor!(this, otherImpostor, width, height, influence, noCollisionBetweenLinkedBodies);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a hook to a rope impostor\r\n * @param otherImpostor rigid impostor to anchor to\r\n * @param length ratio across rope from 0 to 1\r\n * @param influence the elasticity between rope impostor and anchor from 0, very stretchy to 1, little stretch\r\n * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false\r\n * @returns impostor the rope imposter\r\n */\r\n public addHook(otherImpostor: PhysicsImpostor, length: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor {\r\n if (!this._physicsEngine) {\r\n return this;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.appendAnchor) {\r\n return this;\r\n }\r\n if (this._physicsEngine) {\r\n plugin.appendHook!(this, otherImpostor, length, influence, noCollisionBetweenLinkedBodies);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Will keep this body still, in a sleep mode.\r\n * @returns the physics imposter\r\n */\r\n public sleep(): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().sleepBody(this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Wake the body up.\r\n * @returns The physics imposter\r\n */\r\n public wakeUp(): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().wakeUpBody(this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Clones the physics imposter\r\n * @param newObject The physics imposter clones to this physics-enabled object\r\n * @returns A nullable physics imposter\r\n */\r\n public clone(newObject: IPhysicsEnabledObject): Nullable<PhysicsImpostor> {\r\n if (!newObject) {\r\n return null;\r\n }\r\n return new PhysicsImpostor(newObject, this.type, this._options, this._scene);\r\n }\r\n\r\n /**\r\n * Disposes the physics imposter\r\n */\r\n public dispose(/*disposeChildren: boolean = true*/) {\r\n //no dispose if no physics engine is available.\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._joints.forEach((j) => {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.removeJoint(this, j.otherImpostor, j.joint);\r\n }\r\n });\r\n //dispose the physics body\r\n this._physicsEngine.removeImpostor(this);\r\n if (this.parent) {\r\n this.parent.forceUpdate();\r\n } else {\r\n /*this._object.getChildMeshes().forEach(function(mesh) {\r\n if (mesh.physicsImpostor) {\r\n if (disposeChildren) {\r\n mesh.physicsImpostor.dispose();\r\n mesh.physicsImpostor = null;\r\n }\r\n }\r\n })*/\r\n }\r\n\r\n this._isDisposed = true;\r\n }\r\n\r\n /**\r\n * Sets the delta position\r\n * @param position The delta position amount\r\n */\r\n public setDeltaPosition(position: Vector3) {\r\n this._deltaPosition.copyFrom(position);\r\n }\r\n\r\n /**\r\n * Sets the delta rotation\r\n * @param rotation The delta rotation amount\r\n */\r\n public setDeltaRotation(rotation: Quaternion) {\r\n if (!this._deltaRotation) {\r\n this._deltaRotation = new Quaternion();\r\n }\r\n this._deltaRotation.copyFrom(rotation);\r\n this._deltaRotationConjugated = this._deltaRotation.conjugate();\r\n }\r\n\r\n /**\r\n * Gets the box size of the physics imposter and stores the result in the input parameter\r\n * @param result Stores the box size\r\n * @returns The physics imposter\r\n */\r\n public getBoxSizeToRef(result: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, result);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the radius of the physics imposter\r\n * @returns Radius of the physics imposter\r\n */\r\n public getRadius(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;\r\n }\r\n\r\n /**\r\n * Sync a bone with this impostor\r\n * @param bone The bone to sync to the impostor.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n */\r\n public syncBoneWithImpostor(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion) {\r\n const tempVec = PhysicsImpostor._TmpVecs[0];\r\n const mesh = <AbstractMesh>this.object;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = PhysicsImpostor._TmpQuat;\r\n mesh.rotationQuaternion.multiplyToRef(adjustRotation, tempQuat);\r\n bone.setRotationQuaternion(tempQuat, Space.WORLD, boneMesh);\r\n } else {\r\n bone.setRotationQuaternion(mesh.rotationQuaternion, Space.WORLD, boneMesh);\r\n }\r\n }\r\n\r\n tempVec.x = 0;\r\n tempVec.y = 0;\r\n tempVec.z = 0;\r\n\r\n if (jointPivot) {\r\n tempVec.x = jointPivot.x;\r\n tempVec.y = jointPivot.y;\r\n tempVec.z = jointPivot.z;\r\n\r\n bone.getDirectionToRef(tempVec, boneMesh, tempVec);\r\n\r\n if (distToJoint === undefined || distToJoint === null) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n tempVec.x *= distToJoint;\r\n tempVec.y *= distToJoint;\r\n tempVec.z *= distToJoint;\r\n }\r\n\r\n if (bone.getParent()) {\r\n tempVec.addInPlace(mesh.getAbsolutePosition());\r\n bone.setAbsolutePosition(tempVec, boneMesh);\r\n } else {\r\n boneMesh.setAbsolutePosition(mesh.getAbsolutePosition());\r\n boneMesh.position.x -= tempVec.x;\r\n boneMesh.position.y -= tempVec.y;\r\n boneMesh.position.z -= tempVec.z;\r\n }\r\n }\r\n\r\n /**\r\n * Sync impostor to a bone\r\n * @param bone The bone that the impostor will be synced to.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n * @param boneAxis Optional vector3 axis the bone is aligned with\r\n */\r\n public syncImpostorWithBone(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion, boneAxis?: Vector3) {\r\n const mesh = <AbstractMesh>this.object;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = PhysicsImpostor._TmpQuat;\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, tempQuat);\r\n tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);\r\n } else {\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, mesh.rotationQuaternion);\r\n }\r\n }\r\n\r\n const pos = PhysicsImpostor._TmpVecs[0];\r\n const boneDir = PhysicsImpostor._TmpVecs[1];\r\n\r\n if (!boneAxis) {\r\n boneAxis = PhysicsImpostor._TmpVecs[2];\r\n boneAxis.x = 0;\r\n boneAxis.y = 1;\r\n boneAxis.z = 0;\r\n }\r\n\r\n bone.getDirectionToRef(boneAxis, boneMesh, boneDir);\r\n bone.getAbsolutePositionToRef(boneMesh, pos);\r\n\r\n if ((distToJoint === undefined || distToJoint === null) && jointPivot) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n if (distToJoint !== undefined && distToJoint !== null) {\r\n pos.x += boneDir.x * distToJoint;\r\n pos.y += boneDir.y * distToJoint;\r\n pos.z += boneDir.z * distToJoint;\r\n }\r\n\r\n mesh.setAbsolutePosition(pos);\r\n }\r\n\r\n //Impostor types\r\n /**\r\n * No-Imposter type\r\n */\r\n public static NoImpostor = 0;\r\n /**\r\n * Sphere-Imposter type\r\n */\r\n public static SphereImpostor = 1;\r\n /**\r\n * Box-Imposter type\r\n */\r\n public static BoxImpostor = 2;\r\n /**\r\n * Plane-Imposter type\r\n */\r\n public static PlaneImpostor = 3;\r\n /**\r\n * Mesh-imposter type (Only available to objects with vertices data)\r\n */\r\n public static MeshImpostor = 4;\r\n /**\r\n * Capsule-Impostor type (Ammo.js plugin only)\r\n */\r\n public static CapsuleImpostor = 6;\r\n /**\r\n * Cylinder-Imposter type\r\n */\r\n public static CylinderImpostor = 7;\r\n /**\r\n * Particle-Imposter type\r\n */\r\n public static ParticleImpostor = 8;\r\n /**\r\n * Heightmap-Imposter type\r\n */\r\n public static HeightmapImpostor = 9;\r\n /**\r\n * ConvexHull-Impostor type (Ammo.js plugin only)\r\n */\r\n public static ConvexHullImpostor = 10;\r\n /**\r\n * Custom-Imposter type (Ammo.js plugin only)\r\n */\r\n public static CustomImpostor = 100;\r\n /**\r\n * Rope-Imposter type\r\n */\r\n public static RopeImpostor = 101;\r\n /**\r\n * Cloth-Imposter type\r\n */\r\n public static ClothImpostor = 102;\r\n /**\r\n * Softbody-Imposter type\r\n */\r\n public static SoftbodyImpostor = 103;\r\n}\r\n"]}
1
+ {"version":3,"file":"physicsImpostor.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v1/physicsImpostor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAOzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AA6K9C,IAAI,CAAC,sBAAsB,GAAG,UAAU,KAAY,EAAE,YAAmC,EAAE,UAAe;IACtG,OAAO,IAAI,eAAe,CACtB,YAAY,EACZ,UAAU,CAAC,eAAe,EAC1B;QACI,IAAI,EA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AC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7D,wBAAQ,GAAe,UAAU,CAAC,QAAQ,EAAE,CAAC;AAk/B5D,gBAAgB;AAChB;;GAEG;AACW,0BAAU,GAAG,CAAC,CAAC;AAC7B;;GAEG;AACW,8BAAc,GAAG,CAAC,CAAC;AACjC;;GAEG;AACW,2BAAW,GAAG,CAAC,CAAC;AAC9B;;GAEG;AACW,6BAAa,GAAG,CAAC,CAAC;AAChC;;GAEG;AACW,4BAAY,GAAG,CAAC,CAAC;AAC/B;;GAEG;AACW,+BAAe,GAAG,CAAC,CAAC;AAClC;;GAEG;AACW,gCAAgB,GAAG,CAAC,CAAC;AACnC;;GAEG;AACW,gCAAgB,GAAG,CAAC,CAAC;AACnC;;GAEG;AACW,iCAAiB,GAAG,CAAC,CAAC;AACpC;;GAEG;AACW,kCAAkB,GAAG,EAAE,CAAC;AACtC;;GAEG;AACW,8BAAc,GAAG,GAAG,CAAC;AACnC;;GAEG;AACW,4BAAY,GAAG,GAAG,CAAC;AACjC;;GAEG;AACW,6BAAa,GAAG,GAAG,CAAC;AAClC;;GAEG;AACW,gCAAgB,GAAG,GAAG,CAAC","sourcesContent":["import type { Nullable, IndicesArray } from \"../../types\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { ArrayTools } from \"../../Misc/arrayTools\";\r\nimport type { Matrix } from \"../../Maths/math.vector\";\r\nimport { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\nimport type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Bone } from \"../../Bones/bone\";\r\nimport type { BoundingInfo } from \"../../Culling/boundingInfo\";\r\nimport type { PhysicsEngine as PhysicsEngineV1 } from \"./physicsEngine\";\r\n\r\nimport type { PhysicsJointData } from \"./physicsJoint\";\r\nimport { PhysicsJoint } from \"./physicsJoint\";\r\nimport { Space } from \"../../Maths/math.axis\";\r\n\r\n/**\r\n * The interface for the physics imposter parameters\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface PhysicsImpostorParameters {\r\n /**\r\n * The mass of the physics imposter\r\n */\r\n mass: number;\r\n /**\r\n * The friction of the physics imposter\r\n */\r\n friction?: number;\r\n /**\r\n * The coefficient of restitution of the physics imposter\r\n */\r\n restitution?: number;\r\n /**\r\n * The native options of the physics imposter\r\n */\r\n nativeOptions?: any;\r\n /**\r\n * Specifies if the parent should be ignored\r\n */\r\n ignoreParent?: boolean;\r\n /**\r\n * Specifies if bi-directional transformations should be disabled\r\n */\r\n disableBidirectionalTransformation?: boolean;\r\n /**\r\n * The pressure inside the physics imposter, soft object only\r\n */\r\n pressure?: number;\r\n /**\r\n * The stiffness the physics imposter, soft object only\r\n */\r\n stiffness?: number;\r\n /**\r\n * The number of iterations used in maintaining consistent vertex velocities, soft object only\r\n */\r\n velocityIterations?: number;\r\n /**\r\n * The number of iterations used in maintaining consistent vertex positions, soft object only\r\n */\r\n positionIterations?: number;\r\n /**\r\n * The number used to fix points on a cloth (0, 1, 2, 4, 8) or rope (0, 1, 2) only\r\n * 0 None, 1, back left or top, 2, back right or bottom, 4, front left, 8, front right\r\n * Add to fix multiple points\r\n */\r\n fixedPoints?: number;\r\n /**\r\n * The collision margin around a soft object\r\n */\r\n margin?: number;\r\n /**\r\n * The collision margin around a soft object\r\n */\r\n damping?: number;\r\n /**\r\n * The path for a rope based on an extrusion\r\n */\r\n path?: any;\r\n /**\r\n * The shape of an extrusion used for a rope based on an extrusion\r\n */\r\n shape?: any;\r\n}\r\n\r\n/**\r\n * Interface for a physics-enabled object\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface IPhysicsEnabledObject {\r\n /**\r\n * The position of the physics-enabled object\r\n */\r\n position: Vector3;\r\n /**\r\n * The rotation of the physics-enabled object\r\n */\r\n rotationQuaternion: Nullable<Quaternion>;\r\n /**\r\n * The scale of the physics-enabled object\r\n */\r\n scaling: Vector3;\r\n /**\r\n * The rotation of the physics-enabled object\r\n */\r\n rotation?: Vector3;\r\n /**\r\n * The parent of the physics-enabled object\r\n */\r\n parent?: any;\r\n /**\r\n * The bounding info of the physics-enabled object\r\n * @returns The bounding info of the physics-enabled object\r\n */\r\n getBoundingInfo(): BoundingInfo;\r\n /**\r\n * Computes the world matrix\r\n * @param force Specifies if the world matrix should be computed by force\r\n * @returns A world matrix\r\n */\r\n computeWorldMatrix(force: boolean): Matrix;\r\n /**\r\n * Gets the world matrix\r\n * @returns A world matrix\r\n */\r\n getWorldMatrix?(): Matrix;\r\n /**\r\n * Gets the child meshes\r\n * @param directDescendantsOnly Specifies if only direct-descendants should be obtained\r\n * @returns An array of abstract meshes\r\n */\r\n getChildMeshes?(directDescendantsOnly?: boolean): Array<AbstractMesh>;\r\n /**\r\n * Gets the vertex data\r\n * @param kind The type of vertex data\r\n * @returns A nullable array of numbers, or a float32 array\r\n */\r\n getVerticesData(kind: string): Nullable<Array<number> | Float32Array>;\r\n /**\r\n * Gets the indices from the mesh\r\n * @returns A nullable array of index arrays\r\n */\r\n getIndices?(): Nullable<IndicesArray>;\r\n /**\r\n * Gets the scene from the mesh\r\n * @returns the indices array or null\r\n */\r\n getScene?(): Scene;\r\n /**\r\n * Gets the absolute position from the mesh\r\n * @returns the absolute position\r\n */\r\n getAbsolutePosition(): Vector3;\r\n /**\r\n * Gets the absolute pivot point from the mesh\r\n * @returns the absolute pivot point\r\n */\r\n getAbsolutePivotPoint(): Vector3;\r\n /**\r\n * Rotates the mesh\r\n * @param axis The axis of rotation\r\n * @param amount The amount of rotation\r\n * @param space The space of the rotation\r\n * @returns The rotation transform node\r\n */\r\n rotate(axis: Vector3, amount: number, space?: Space): TransformNode;\r\n /**\r\n * Translates the mesh\r\n * @param axis The axis of translation\r\n * @param distance The distance of translation\r\n * @param space The space of the translation\r\n * @returns The transform node\r\n */\r\n translate(axis: Vector3, distance: number, space?: Space): TransformNode;\r\n /**\r\n * Sets the absolute position of the mesh\r\n * @param absolutePosition The absolute position of the mesh\r\n * @returns The transform node\r\n */\r\n setAbsolutePosition(absolutePosition: Vector3): TransformNode;\r\n /**\r\n * Gets the class name of the mesh\r\n * @returns The class name\r\n */\r\n getClassName(): string;\r\n}\r\n\r\nMesh._PhysicsImpostorParser = function (scene: Scene, physicObject: IPhysicsEnabledObject, jsonObject: any): PhysicsImpostor {\r\n return new PhysicsImpostor(\r\n physicObject,\r\n jsonObject.physicsImpostor,\r\n {\r\n mass: jsonObject.physicsMass,\r\n friction: jsonObject.physicsFriction,\r\n restitution: jsonObject.physicsRestitution,\r\n },\r\n scene\r\n );\r\n};\r\n\r\n/**\r\n * Represents a physics imposter\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class PhysicsImpostor {\r\n /**\r\n * The default object size of the imposter\r\n */\r\n public static DEFAULT_OBJECT_SIZE: Vector3 = new Vector3(1, 1, 1);\r\n\r\n /**\r\n * The identity quaternion of the imposter\r\n */\r\n public static IDENTITY_QUATERNION = Quaternion.Identity();\r\n\r\n /** @internal */\r\n public _pluginData: any = {};\r\n\r\n private _physicsEngine: Nullable<PhysicsEngineV1>;\r\n //The native cannon/oimo/energy physics body object.\r\n private _physicsBody: any;\r\n private _bodyUpdateRequired: boolean = false;\r\n\r\n private _onBeforePhysicsStepCallbacks = new Array<(impostor: PhysicsImpostor) => void>();\r\n private _onAfterPhysicsStepCallbacks = new Array<(impostor: PhysicsImpostor) => void>();\r\n /** @internal */\r\n public _onPhysicsCollideCallbacks: Array<{\r\n callback: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor, point: Nullable<Vector3>, distance: number, impulse: number, normal: Nullable<Vector3>) => void;\r\n otherImpostors: Array<PhysicsImpostor>;\r\n }> = [];\r\n\r\n private _deltaPosition: Vector3 = Vector3.Zero();\r\n private _deltaRotation: Quaternion;\r\n private _deltaRotationConjugated: Quaternion;\r\n\r\n /** @internal */\r\n public _isFromLine: boolean;\r\n\r\n //If set, this is this impostor's parent\r\n private _parent: Nullable<PhysicsImpostor>;\r\n\r\n private _isDisposed = false;\r\n\r\n private static _TmpVecs: Vector3[] = ArrayTools.BuildArray(3, Vector3.Zero);\r\n private static _TmpQuat: Quaternion = Quaternion.Identity();\r\n\r\n /**\r\n * Specifies if the physics imposter is disposed\r\n */\r\n get isDisposed(): boolean {\r\n return this._isDisposed;\r\n }\r\n\r\n /**\r\n * Gets the mass of the physics imposter\r\n */\r\n get mass(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;\r\n }\r\n\r\n set mass(value: number) {\r\n this.setMass(value);\r\n }\r\n\r\n /**\r\n * Gets the coefficient of friction\r\n */\r\n get friction(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;\r\n }\r\n\r\n /**\r\n * Sets the coefficient of friction\r\n */\r\n set friction(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, value);\r\n }\r\n\r\n /**\r\n * Gets the coefficient of restitution\r\n */\r\n get restitution(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;\r\n }\r\n\r\n /**\r\n * Sets the coefficient of restitution\r\n */\r\n set restitution(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, value);\r\n }\r\n\r\n /**\r\n * Gets the pressure of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get pressure(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPressure) {\r\n return 0;\r\n }\r\n return plugin.getBodyPressure!(this);\r\n }\r\n\r\n /**\r\n * Sets the pressure of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set pressure(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPressure) {\r\n return;\r\n }\r\n plugin.setBodyPressure!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the stiffness of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get stiffness(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyStiffness) {\r\n return 0;\r\n }\r\n return plugin.getBodyStiffness!(this);\r\n }\r\n\r\n /**\r\n * Sets the stiffness of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set stiffness(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyStiffness) {\r\n return;\r\n }\r\n plugin.setBodyStiffness!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the velocityIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get velocityIterations(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyVelocityIterations) {\r\n return 0;\r\n }\r\n return plugin.getBodyVelocityIterations!(this);\r\n }\r\n\r\n /**\r\n * Sets the velocityIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set velocityIterations(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyVelocityIterations) {\r\n return;\r\n }\r\n plugin.setBodyVelocityIterations!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the positionIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get positionIterations(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyPositionIterations) {\r\n return 0;\r\n }\r\n return plugin.getBodyPositionIterations!(this);\r\n }\r\n\r\n /**\r\n * Sets the positionIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set positionIterations(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPositionIterations) {\r\n return;\r\n }\r\n plugin.setBodyPositionIterations!(this, value);\r\n }\r\n\r\n /**\r\n * The unique id of the physics imposter\r\n * set by the physics engine when adding this impostor to the array\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n public soft: boolean = false;\r\n\r\n /**\r\n * @internal\r\n */\r\n public segments: number = 0;\r\n\r\n private _joints: Array<{\r\n joint: PhysicsJoint;\r\n otherImpostor: PhysicsImpostor;\r\n }>;\r\n\r\n /**\r\n * Initializes the physics imposter\r\n * @param object The physics-enabled object used as the physics imposter\r\n * @param type The type of the physics imposter. Types are available as static members of this class.\r\n * @param _options The options for the physics imposter\r\n * @param _scene The Babylon scene\r\n */\r\n constructor(\r\n /**\r\n * The physics-enabled object used as the physics imposter\r\n */\r\n public object: IPhysicsEnabledObject,\r\n /**\r\n * The type of the physics imposter\r\n */\r\n public type: number,\r\n private _options: PhysicsImpostorParameters = { mass: 0 },\r\n private _scene?: Scene\r\n ) {\r\n //sanity check!\r\n if (!this.object) {\r\n Logger.Error(\"No object was provided. A physics object is obligatory\");\r\n return;\r\n }\r\n if (this.object.parent && _options.mass !== 0) {\r\n Logger.Warn(\"A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur.\");\r\n }\r\n\r\n // Legacy support for old syntax.\r\n if (!this._scene && object.getScene) {\r\n this._scene = object.getScene();\r\n }\r\n\r\n if (!this._scene) {\r\n return;\r\n }\r\n\r\n if (this.type > 100) {\r\n this.soft = true;\r\n }\r\n\r\n this._physicsEngine = this._scene.getPhysicsEngine() as any;\r\n if (!this._physicsEngine) {\r\n Logger.Error(\"Physics not enabled. Please use scene.enablePhysics(...) before creating impostors.\");\r\n } else {\r\n //set the object's quaternion, if not set\r\n if (!this.object.rotationQuaternion) {\r\n if (this.object.rotation) {\r\n this.object.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z);\r\n } else {\r\n this.object.rotationQuaternion = new Quaternion();\r\n }\r\n }\r\n //default options params\r\n this._options.mass = _options.mass === void 0 ? 0 : _options.mass;\r\n this._options.friction = _options.friction === void 0 ? 0.2 : _options.friction;\r\n this._options.restitution = _options.restitution === void 0 ? 0.2 : _options.restitution;\r\n if (this.soft) {\r\n //softbody mass must be above 0;\r\n this._options.mass = this._options.mass > 0 ? this._options.mass : 1;\r\n this._options.pressure = _options.pressure === void 0 ? 200 : _options.pressure;\r\n this._options.stiffness = _options.stiffness === void 0 ? 1 : _options.stiffness;\r\n this._options.velocityIterations = _options.velocityIterations === void 0 ? 20 : _options.velocityIterations;\r\n this._options.positionIterations = _options.positionIterations === void 0 ? 20 : _options.positionIterations;\r\n this._options.fixedPoints = _options.fixedPoints === void 0 ? 0 : _options.fixedPoints;\r\n this._options.margin = _options.margin === void 0 ? 0 : _options.margin;\r\n this._options.damping = _options.damping === void 0 ? 0 : _options.damping;\r\n this._options.path = _options.path === void 0 ? null : _options.path;\r\n this._options.shape = _options.shape === void 0 ? null : _options.shape;\r\n }\r\n this._joints = [];\r\n //If the mesh has a parent, don't initialize the physicsBody. Instead wait for the parent to do that.\r\n if (!this.object.parent || this._options.ignoreParent) {\r\n this._init();\r\n } else if (this.object.parent.physicsImpostor) {\r\n Logger.Warn(\"You must affect impostors to children before affecting impostor to parent.\");\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This function will completely initialize this impostor.\r\n * It will create a new body - but only if this mesh has no parent.\r\n * If it has, this impostor will not be used other than to define the impostor\r\n * of the child mesh.\r\n * @internal\r\n */\r\n public _init() {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._physicsEngine.removeImpostor(this);\r\n this.physicsBody = null;\r\n this._parent = this._parent || this._getPhysicsParent();\r\n if (!this._isDisposed && (!this.parent || this._options.ignoreParent)) {\r\n this._physicsEngine.addImpostor(this);\r\n }\r\n }\r\n\r\n private _getPhysicsParent(): Nullable<PhysicsImpostor> {\r\n if (this.object.parent instanceof AbstractMesh) {\r\n const parentMesh: AbstractMesh = <AbstractMesh>this.object.parent;\r\n return parentMesh.physicsImpostor;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Should a new body be generated.\r\n * @returns boolean specifying if body initialization is required\r\n */\r\n public isBodyInitRequired(): boolean {\r\n return this._bodyUpdateRequired || (!this._physicsBody && (!this._parent || !!this._options.ignoreParent));\r\n }\r\n\r\n /**\r\n * Sets the updated scaling\r\n */\r\n public setScalingUpdated() {\r\n this.forceUpdate();\r\n }\r\n\r\n /**\r\n * Force a regeneration of this or the parent's impostor's body.\r\n * Use with caution - This will remove all previously-instantiated joints.\r\n */\r\n public forceUpdate() {\r\n this._init();\r\n if (this.parent && !this._options.ignoreParent) {\r\n this.parent.forceUpdate();\r\n }\r\n }\r\n\r\n /*public get mesh(): AbstractMesh {\r\n return this._mesh;\r\n }*/\r\n\r\n /**\r\n * Gets the body that holds this impostor. Either its own, or its parent.\r\n */\r\n public get physicsBody(): any {\r\n return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;\r\n }\r\n\r\n /**\r\n * Get the parent of the physics imposter\r\n * @returns Physics imposter or null\r\n */\r\n public get parent(): Nullable<PhysicsImpostor> {\r\n return !this._options.ignoreParent && this._parent ? this._parent : null;\r\n }\r\n\r\n /**\r\n * Sets the parent of the physics imposter\r\n */\r\n public set parent(value: Nullable<PhysicsImpostor>) {\r\n this._parent = value;\r\n }\r\n\r\n /**\r\n * Set the physics body. Used mainly by the physics engine/plugin\r\n */\r\n public set physicsBody(physicsBody: any) {\r\n if (this._physicsBody && this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this);\r\n }\r\n this._physicsBody = physicsBody;\r\n this.resetUpdateFlags();\r\n }\r\n\r\n /**\r\n * Resets the update flags\r\n */\r\n public resetUpdateFlags() {\r\n this._bodyUpdateRequired = false;\r\n }\r\n\r\n /**\r\n * Gets the object extents\r\n * @returns the object extents\r\n */\r\n public getObjectExtents(): Vector3 {\r\n if (this.object.getBoundingInfo) {\r\n const q = this.object.rotationQuaternion;\r\n const scaling = this.object.scaling.clone();\r\n //reset rotation\r\n this.object.rotationQuaternion = PhysicsImpostor.IDENTITY_QUATERNION;\r\n //calculate the world matrix with no rotation\r\n const worldMatrix = this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);\r\n if (worldMatrix) {\r\n worldMatrix.decompose(scaling, undefined, undefined);\r\n }\r\n const boundingInfo = this.object.getBoundingInfo();\r\n // get the global scaling of the object\r\n const size = boundingInfo.boundingBox.extendSize.scale(2).multiplyInPlace(scaling);\r\n size.x = Math.abs(size.x);\r\n size.y = Math.abs(size.y);\r\n size.z = Math.abs(size.z);\r\n //bring back the rotation\r\n this.object.rotationQuaternion = q;\r\n //calculate the world matrix with the new rotation\r\n this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);\r\n return size;\r\n } else {\r\n return PhysicsImpostor.DEFAULT_OBJECT_SIZE;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the object center\r\n * @returns The object center\r\n */\r\n public getObjectCenter(): Vector3 {\r\n if (this.object.getBoundingInfo) {\r\n const boundingInfo = this.object.getBoundingInfo();\r\n return boundingInfo.boundingBox.centerWorld;\r\n } else {\r\n return this.object.position;\r\n }\r\n }\r\n\r\n /**\r\n * Get a specific parameter from the options parameters\r\n * @param paramName The object parameter name\r\n * @returns The object parameter\r\n */\r\n public getParam(paramName: string): any {\r\n return (<any>this._options)[paramName];\r\n }\r\n\r\n /**\r\n * Sets a specific parameter in the options given to the physics plugin\r\n * @param paramName The parameter name\r\n * @param value The value of the parameter\r\n */\r\n public setParam(paramName: string, value: number) {\r\n (<any>this._options)[paramName] = value;\r\n this._bodyUpdateRequired = true;\r\n }\r\n\r\n /**\r\n * Specifically change the body's mass. Won't recreate the physics body object\r\n * @param mass The mass of the physics imposter\r\n */\r\n public setMass(mass: number) {\r\n if (this.getParam(\"mass\") !== mass) {\r\n this.setParam(\"mass\", mass);\r\n }\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setBodyMass(this, mass);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the linear velocity\r\n * @returns linear velocity or null\r\n */\r\n public getLinearVelocity(): Nullable<Vector3> {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : Vector3.Zero();\r\n }\r\n\r\n /**\r\n * Sets the linear velocity\r\n * @param velocity linear velocity or null\r\n */\r\n public setLinearVelocity(velocity: Nullable<Vector3>) {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, velocity);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the angular velocity\r\n * @returns angular velocity or null\r\n */\r\n public getAngularVelocity(): Nullable<Vector3> {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : Vector3.Zero();\r\n }\r\n\r\n /**\r\n * Sets the angular velocity\r\n * @param velocity The velocity or null\r\n */\r\n public setAngularVelocity(velocity: Nullable<Vector3>) {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, velocity);\r\n }\r\n }\r\n\r\n /**\r\n * Execute a function with the physics plugin native code\r\n * Provide a function the will have two variables - the world object and the physics body object\r\n * @param func The function to execute with the physics plugin native code\r\n */\r\n public executeNativeFunction(func: (world: any, physicsBody: any) => void) {\r\n if (this._physicsEngine) {\r\n func(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);\r\n }\r\n }\r\n\r\n /**\r\n * Register a function that will be executed before the physics world is stepping forward\r\n * @param func The function to execute before the physics world is stepped forward\r\n */\r\n public registerBeforePhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n this._onBeforePhysicsStepCallbacks.push(func);\r\n }\r\n\r\n /**\r\n * Unregister a function that will be executed before the physics world is stepping forward\r\n * @param func The function to execute before the physics world is stepped forward\r\n */\r\n public unregisterBeforePhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n const index = this._onBeforePhysicsStepCallbacks.indexOf(func);\r\n\r\n if (index > -1) {\r\n this._onBeforePhysicsStepCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n /**\r\n * Register a function that will be executed after the physics step\r\n * @param func The function to execute after physics step\r\n */\r\n public registerAfterPhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n this._onAfterPhysicsStepCallbacks.push(func);\r\n }\r\n\r\n /**\r\n * Unregisters a function that will be executed after the physics step\r\n * @param func The function to execute after physics step\r\n */\r\n public unregisterAfterPhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n const index = this._onAfterPhysicsStepCallbacks.indexOf(func);\r\n\r\n if (index > -1) {\r\n this._onAfterPhysicsStepCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n /**\r\n * register a function that will be executed when this impostor collides against a different body\r\n * @param collideAgainst Physics imposter, or array of physics imposters to collide against\r\n * @param func Callback that is executed on collision\r\n */\r\n public registerOnPhysicsCollide(\r\n collideAgainst: PhysicsImpostor | Array<PhysicsImpostor>,\r\n func: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor, point: Nullable<Vector3>) => void\r\n ): void {\r\n const collidedAgainstList: Array<PhysicsImpostor> = collideAgainst instanceof Array ? <Array<PhysicsImpostor>>collideAgainst : [<PhysicsImpostor>collideAgainst];\r\n this._onPhysicsCollideCallbacks.push({ callback: func, otherImpostors: collidedAgainstList });\r\n }\r\n\r\n /**\r\n * Unregisters the physics imposter's collision callback\r\n * @param collideAgainst The physics object to collide against\r\n * @param func Callback to execute on collision\r\n */\r\n public unregisterOnPhysicsCollide(\r\n collideAgainst: PhysicsImpostor | Array<PhysicsImpostor>,\r\n func: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor | Array<PhysicsImpostor>, point: Nullable<Vector3>) => void\r\n ): void {\r\n const collidedAgainstList: Array<PhysicsImpostor> = collideAgainst instanceof Array ? <Array<PhysicsImpostor>>collideAgainst : [<PhysicsImpostor>collideAgainst];\r\n let index = -1;\r\n const found = this._onPhysicsCollideCallbacks.some((cbDef, idx) => {\r\n if (cbDef.callback === func && cbDef.otherImpostors.length === collidedAgainstList.length) {\r\n // chcek the arrays match\r\n const sameList = cbDef.otherImpostors.every((impostor) => {\r\n return collidedAgainstList.indexOf(impostor) > -1;\r\n });\r\n if (sameList) {\r\n index = idx;\r\n }\r\n return sameList;\r\n }\r\n return false;\r\n });\r\n\r\n if (found) {\r\n this._onPhysicsCollideCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n //temp variables for parent rotation calculations\r\n //private _mats: Array<Matrix> = [new Matrix(), new Matrix()];\r\n private _tmpQuat: Quaternion = new Quaternion();\r\n private _tmpQuat2: Quaternion = new Quaternion();\r\n\r\n /**\r\n * Get the parent rotation\r\n * @returns The parent rotation\r\n */\r\n public getParentsRotation(): Quaternion {\r\n let parent = this.object.parent;\r\n this._tmpQuat.copyFromFloats(0, 0, 0, 1);\r\n while (parent) {\r\n if (parent.rotationQuaternion) {\r\n this._tmpQuat2.copyFrom(parent.rotationQuaternion);\r\n } else {\r\n Quaternion.RotationYawPitchRollToRef(parent.rotation.y, parent.rotation.x, parent.rotation.z, this._tmpQuat2);\r\n }\r\n this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat);\r\n parent = parent.parent;\r\n }\r\n return this._tmpQuat;\r\n }\r\n\r\n /**\r\n * this function is executed by the physics engine.\r\n */\r\n public beforeStep = () => {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this.object.translate(this._deltaPosition, -1);\r\n this._deltaRotationConjugated &&\r\n this.object.rotationQuaternion &&\r\n this.object.rotationQuaternion.multiplyToRef(this._deltaRotationConjugated, this.object.rotationQuaternion);\r\n this.object.computeWorldMatrix(false);\r\n if (this.object.parent && this.object.rotationQuaternion) {\r\n this.getParentsRotation();\r\n this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this._tmpQuat);\r\n } else {\r\n this._tmpQuat.copyFrom(this.object.rotationQuaternion || new Quaternion());\r\n }\r\n if (!this._options.disableBidirectionalTransformation) {\r\n this.object.rotationQuaternion &&\r\n this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(this, /*bInfo.boundingBox.centerWorld*/ this.object.getAbsolutePosition(), this._tmpQuat);\r\n }\r\n\r\n this._onBeforePhysicsStepCallbacks.forEach((func) => {\r\n func(this);\r\n });\r\n };\r\n\r\n /**\r\n * this function is executed by the physics engine\r\n */\r\n public afterStep = () => {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._onAfterPhysicsStepCallbacks.forEach((func) => {\r\n func(this);\r\n });\r\n\r\n this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(this);\r\n // object has now its world rotation. needs to be converted to local.\r\n if (this.object.parent && this.object.rotationQuaternion) {\r\n this.getParentsRotation();\r\n this._tmpQuat.conjugateInPlace();\r\n this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this.object.rotationQuaternion);\r\n }\r\n // take the position set and make it the absolute position of this object.\r\n this.object.setAbsolutePosition(this.object.position);\r\n if (this._deltaRotation) {\r\n this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotation, this.object.rotationQuaternion);\r\n this._deltaPosition.applyRotationQuaternionToRef(this._deltaRotation, PhysicsImpostor._TmpVecs[0]);\r\n this.object.translate(PhysicsImpostor._TmpVecs[0], 1);\r\n } else {\r\n this.object.translate(this._deltaPosition, 1);\r\n }\r\n this.object.computeWorldMatrix(true);\r\n };\r\n\r\n /**\r\n * Legacy collision detection event support\r\n */\r\n public onCollideEvent: Nullable<(collider: PhysicsImpostor, collidedWith: PhysicsImpostor) => void> = null;\r\n\r\n /**\r\n *\r\n * @param e\r\n * @returns\r\n */\r\n public onCollide = (e: { body: any; point: Nullable<Vector3>; distance: number; impulse: number; normal: Nullable<Vector3> }) => {\r\n if (!this._onPhysicsCollideCallbacks.length && !this.onCollideEvent) {\r\n return;\r\n }\r\n\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const otherImpostor = this._physicsEngine.getImpostorWithPhysicsBody(e.body);\r\n if (otherImpostor) {\r\n // Legacy collision detection event support\r\n if (this.onCollideEvent) {\r\n this.onCollideEvent(this, otherImpostor);\r\n }\r\n this._onPhysicsCollideCallbacks\r\n .filter((obj) => {\r\n return obj.otherImpostors.indexOf(<PhysicsImpostor>otherImpostor) !== -1;\r\n })\r\n .forEach((obj) => {\r\n obj.callback(this, <PhysicsImpostor>otherImpostor, e.point, e.distance, e.impulse, e.normal);\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Apply a force\r\n * @param force The force to apply\r\n * @param contactPoint The contact point for the force\r\n * @returns The physics imposter\r\n */\r\n public applyForce(force: Vector3, contactPoint: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().applyForce(this, force, contactPoint);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Apply an impulse\r\n * @param force The impulse force\r\n * @param contactPoint The contact point for the impulse force\r\n * @returns The physics imposter\r\n */\r\n public applyImpulse(force: Vector3, contactPoint: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().applyImpulse(this, force, contactPoint);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * A help function to create a joint\r\n * @param otherImpostor A physics imposter used to create a joint\r\n * @param jointType The type of joint\r\n * @param jointData The data for the joint\r\n * @returns The physics imposter\r\n */\r\n public createJoint(otherImpostor: PhysicsImpostor, jointType: number, jointData: PhysicsJointData): PhysicsImpostor {\r\n const joint = new PhysicsJoint(jointType, jointData);\r\n this.addJoint(otherImpostor, joint);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a joint to this impostor with a different impostor\r\n * @param otherImpostor A physics imposter used to add a joint\r\n * @param joint The joint to add\r\n * @returns The physics imposter\r\n */\r\n public addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor {\r\n this._joints.push({\r\n otherImpostor: otherImpostor,\r\n joint: joint,\r\n });\r\n\r\n if (this._physicsEngine) {\r\n this._physicsEngine.addJoint(this, otherImpostor, joint);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add an anchor to a cloth impostor\r\n * @param otherImpostor rigid impostor to anchor to\r\n * @param width ratio across width from 0 to 1\r\n * @param height ratio up height from 0 to 1\r\n * @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch\r\n * @param noCollisionBetweenLinkedBodies when true collisions between cloth impostor and anchor are ignored; default false\r\n * @returns impostor the soft imposter\r\n */\r\n public addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor {\r\n if (!this._physicsEngine) {\r\n return this;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.appendAnchor) {\r\n return this;\r\n }\r\n if (this._physicsEngine) {\r\n plugin.appendAnchor!(this, otherImpostor, width, height, influence, noCollisionBetweenLinkedBodies);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a hook to a rope impostor\r\n * @param otherImpostor rigid impostor to anchor to\r\n * @param length ratio across rope from 0 to 1\r\n * @param influence the elasticity between rope impostor and anchor from 0, very stretchy to 1, little stretch\r\n * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false\r\n * @returns impostor the rope imposter\r\n */\r\n public addHook(otherImpostor: PhysicsImpostor, length: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor {\r\n if (!this._physicsEngine) {\r\n return this;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.appendAnchor) {\r\n return this;\r\n }\r\n if (this._physicsEngine) {\r\n plugin.appendHook!(this, otherImpostor, length, influence, noCollisionBetweenLinkedBodies);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Will keep this body still, in a sleep mode.\r\n * @returns the physics imposter\r\n */\r\n public sleep(): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().sleepBody(this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Wake the body up.\r\n * @returns The physics imposter\r\n */\r\n public wakeUp(): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().wakeUpBody(this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Clones the physics imposter\r\n * @param newObject The physics imposter clones to this physics-enabled object\r\n * @returns A nullable physics imposter\r\n */\r\n public clone(newObject: IPhysicsEnabledObject): Nullable<PhysicsImpostor> {\r\n if (!newObject) {\r\n return null;\r\n }\r\n return new PhysicsImpostor(newObject, this.type, this._options, this._scene);\r\n }\r\n\r\n /**\r\n * Disposes the physics imposter\r\n */\r\n public dispose(/*disposeChildren: boolean = true*/) {\r\n //no dispose if no physics engine is available.\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._joints.forEach((j) => {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.removeJoint(this, j.otherImpostor, j.joint);\r\n }\r\n });\r\n //dispose the physics body\r\n this._physicsEngine.removeImpostor(this);\r\n if (this.parent) {\r\n this.parent.forceUpdate();\r\n } else {\r\n /*this._object.getChildMeshes().forEach(function(mesh) {\r\n if (mesh.physicsImpostor) {\r\n if (disposeChildren) {\r\n mesh.physicsImpostor.dispose();\r\n mesh.physicsImpostor = null;\r\n }\r\n }\r\n })*/\r\n }\r\n\r\n this._isDisposed = true;\r\n }\r\n\r\n /**\r\n * Sets the delta position\r\n * @param position The delta position amount\r\n */\r\n public setDeltaPosition(position: Vector3) {\r\n this._deltaPosition.copyFrom(position);\r\n }\r\n\r\n /**\r\n * Sets the delta rotation\r\n * @param rotation The delta rotation amount\r\n */\r\n public setDeltaRotation(rotation: Quaternion) {\r\n if (!this._deltaRotation) {\r\n this._deltaRotation = new Quaternion();\r\n }\r\n this._deltaRotation.copyFrom(rotation);\r\n this._deltaRotationConjugated = this._deltaRotation.conjugate();\r\n }\r\n\r\n /**\r\n * Gets the box size of the physics imposter and stores the result in the input parameter\r\n * @param result Stores the box size\r\n * @returns The physics imposter\r\n */\r\n public getBoxSizeToRef(result: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, result);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the radius of the physics imposter\r\n * @returns Radius of the physics imposter\r\n */\r\n public getRadius(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;\r\n }\r\n\r\n /**\r\n * Sync a bone with this impostor\r\n * @param bone The bone to sync to the impostor.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n */\r\n public syncBoneWithImpostor(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion) {\r\n const tempVec = PhysicsImpostor._TmpVecs[0];\r\n const mesh = <AbstractMesh>this.object;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = PhysicsImpostor._TmpQuat;\r\n mesh.rotationQuaternion.multiplyToRef(adjustRotation, tempQuat);\r\n bone.setRotationQuaternion(tempQuat, Space.WORLD, boneMesh);\r\n } else {\r\n bone.setRotationQuaternion(mesh.rotationQuaternion, Space.WORLD, boneMesh);\r\n }\r\n }\r\n\r\n tempVec.x = 0;\r\n tempVec.y = 0;\r\n tempVec.z = 0;\r\n\r\n if (jointPivot) {\r\n tempVec.x = jointPivot.x;\r\n tempVec.y = jointPivot.y;\r\n tempVec.z = jointPivot.z;\r\n\r\n bone.getDirectionToRef(tempVec, boneMesh, tempVec);\r\n\r\n if (distToJoint === undefined || distToJoint === null) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n tempVec.x *= distToJoint;\r\n tempVec.y *= distToJoint;\r\n tempVec.z *= distToJoint;\r\n }\r\n\r\n if (bone.getParent()) {\r\n tempVec.addInPlace(mesh.getAbsolutePosition());\r\n bone.setAbsolutePosition(tempVec, boneMesh);\r\n } else {\r\n boneMesh.setAbsolutePosition(mesh.getAbsolutePosition());\r\n boneMesh.position.x -= tempVec.x;\r\n boneMesh.position.y -= tempVec.y;\r\n boneMesh.position.z -= tempVec.z;\r\n }\r\n }\r\n\r\n /**\r\n * Sync impostor to a bone\r\n * @param bone The bone that the impostor will be synced to.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n * @param boneAxis Optional vector3 axis the bone is aligned with\r\n */\r\n public syncImpostorWithBone(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion, boneAxis?: Vector3) {\r\n const mesh = <AbstractMesh>this.object;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = PhysicsImpostor._TmpQuat;\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, tempQuat);\r\n tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);\r\n } else {\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, mesh.rotationQuaternion);\r\n }\r\n }\r\n\r\n const pos = PhysicsImpostor._TmpVecs[0];\r\n const boneDir = PhysicsImpostor._TmpVecs[1];\r\n\r\n if (!boneAxis) {\r\n boneAxis = PhysicsImpostor._TmpVecs[2];\r\n boneAxis.x = 0;\r\n boneAxis.y = 1;\r\n boneAxis.z = 0;\r\n }\r\n\r\n bone.getDirectionToRef(boneAxis, boneMesh, boneDir);\r\n bone.getAbsolutePositionToRef(boneMesh, pos);\r\n\r\n if ((distToJoint === undefined || distToJoint === null) && jointPivot) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n if (distToJoint !== undefined && distToJoint !== null) {\r\n pos.x += boneDir.x * distToJoint;\r\n pos.y += boneDir.y * distToJoint;\r\n pos.z += boneDir.z * distToJoint;\r\n }\r\n\r\n mesh.setAbsolutePosition(pos);\r\n }\r\n\r\n //Impostor types\r\n /**\r\n * No-Imposter type\r\n */\r\n public static NoImpostor = 0;\r\n /**\r\n * Sphere-Imposter type\r\n */\r\n public static SphereImpostor = 1;\r\n /**\r\n * Box-Imposter type\r\n */\r\n public static BoxImpostor = 2;\r\n /**\r\n * Plane-Imposter type\r\n */\r\n public static PlaneImpostor = 3;\r\n /**\r\n * Mesh-imposter type (Only available to objects with vertices data)\r\n */\r\n public static MeshImpostor = 4;\r\n /**\r\n * Capsule-Impostor type (Ammo.js plugin only)\r\n */\r\n public static CapsuleImpostor = 6;\r\n /**\r\n * Cylinder-Imposter type\r\n */\r\n public static CylinderImpostor = 7;\r\n /**\r\n * Particle-Imposter type\r\n */\r\n public static ParticleImpostor = 8;\r\n /**\r\n * Heightmap-Imposter type\r\n */\r\n public static HeightmapImpostor = 9;\r\n /**\r\n * ConvexHull-Impostor type (Ammo.js plugin only)\r\n */\r\n public static ConvexHullImpostor = 10;\r\n /**\r\n * Custom-Imposter type (Ammo.js plugin only)\r\n */\r\n public static CustomImpostor = 100;\r\n /**\r\n * Rope-Imposter type\r\n */\r\n public static RopeImpostor = 101;\r\n /**\r\n * Cloth-Imposter type\r\n */\r\n public static ClothImpostor = 102;\r\n /**\r\n * Softbody-Imposter type\r\n */\r\n public static SoftbodyImpostor = 103;\r\n}\r\n"]}
@@ -7,20 +7,6 @@ import { _WarnImport } from "../../Misc/devTools.js";
7
7
  */
8
8
  /** @internal */
9
9
  export class PhysicsEngine {
10
- /**
11
- * Creates a new Physics Engine
12
- * @param gravity defines the gravity vector used by the simulation
13
- * @param _physicsPlugin defines the plugin to use (CannonJS by default)
14
- */
15
- constructor(gravity, _physicsPlugin = PhysicsEngine.DefaultPluginFactory()) {
16
- this._physicsPlugin = _physicsPlugin;
17
- /** @internal */
18
- this._physicsBodies = [];
19
- this._subTimeStep = 0;
20
- gravity = gravity || new Vector3(0, -9.807, 0);
21
- this.setGravity(gravity);
22
- this.setTimeStep();
23
- }
24
10
  /**
25
11
  *
26
12
  * @returns physics plugin version
@@ -35,6 +21,20 @@ export class PhysicsEngine {
35
21
  static DefaultPluginFactory() {
36
22
  throw _WarnImport("");
37
23
  }
24
+ /**
25
+ * Creates a new Physics Engine
26
+ * @param gravity defines the gravity vector used by the simulation
27
+ * @param _physicsPlugin defines the plugin to use (CannonJS by default)
28
+ */
29
+ constructor(gravity, _physicsPlugin = PhysicsEngine.DefaultPluginFactory()) {
30
+ this._physicsPlugin = _physicsPlugin;
31
+ /** @internal */
32
+ this._physicsBodies = [];
33
+ this._subTimeStep = 0;
34
+ gravity = gravity || new Vector3(0, -9.807, 0);
35
+ this.setGravity(gravity);
36
+ this.setTimeStep();
37
+ }
38
38
  /**
39
39
  * Sets the gravity vector used by the simulation
40
40
  * @param gravity defines the gravity vector to use
@@ -1 +1 @@
1
- {"version":3,"file":"physicsEngine.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v2/physicsEngine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,M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QAC1C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { IPhysicsEngine } from \"../IPhysicsEngine\";\r\nimport type { IPhysicsEnginePluginV2 } from \"./IPhysicsEnginePlugin\";\r\nimport { PhysicsRaycastResult } from \"../physicsRaycastResult\";\r\nimport { _WarnImport } from \"../../Misc/devTools\";\r\nimport type { PhysicsBody } from \"./physicsBody\";\r\n\r\n/**\r\n * Class used to control physics engine\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\n/** @internal */\r\nexport class PhysicsEngine implements IPhysicsEngine {\r\n /** @internal */\r\n private _physicsBodies: Array<PhysicsBody> = [];\r\n private _subTimeStep: number = 0;\r\n //private _uniqueIdCounter = 0;\r\n\r\n /**\r\n * Gets the gravity vector used by the simulation\r\n */\r\n public gravity: Vector3;\r\n\r\n /**\r\n *\r\n * @returns physics plugin version\r\n */\r\n public getPluginVersion(): number {\r\n return this._physicsPlugin.getPluginVersion();\r\n }\r\n /**\r\n * Factory used to create the default physics plugin.\r\n * @returns The default physics plugin\r\n */\r\n public static DefaultPluginFactory(): IPhysicsEnginePluginV2 {\r\n throw _WarnImport(\"\");\r\n }\r\n\r\n /**\r\n * Creates a new Physics Engine\r\n * @param gravity defines the gravity vector used by the simulation\r\n * @param _physicsPlugin defines the plugin to use (CannonJS by default)\r\n */\r\n constructor(gravity: Nullable<Vector3>, private _physicsPlugin: IPhysicsEnginePluginV2 = PhysicsEngine.DefaultPluginFactory()) {\r\n gravity = gravity || new Vector3(0, -9.807, 0);\r\n this.setGravity(gravity);\r\n this.setTimeStep();\r\n }\r\n\r\n /**\r\n * Sets the gravity vector used by the simulation\r\n * @param gravity defines the gravity vector to use\r\n */\r\n public setGravity(gravity: Vector3): void {\r\n this.gravity = gravity;\r\n this._physicsPlugin.setGravity(this.gravity);\r\n }\r\n\r\n /**\r\n * Set the time step of the physics engine.\r\n * Default is 1/60.\r\n * To slow it down, enter 1/600 for example.\r\n * To speed it up, 1/30\r\n * @param newTimeStep defines the new timestep to apply to this world.\r\n */\r\n public setTimeStep(newTimeStep: number = 1 / 60) {\r\n this._physicsPlugin.setTimeStep(newTimeStep);\r\n }\r\n\r\n /**\r\n * Get the time step of the physics engine.\r\n * @returns the current time step\r\n */\r\n public getTimeStep(): number {\r\n return this._physicsPlugin.getTimeStep();\r\n }\r\n\r\n /**\r\n * Set the sub time step of the physics engine.\r\n * Default is 0 meaning there is no sub steps\r\n * To increase physics resolution precision, set a small value (like 1 ms)\r\n * @param subTimeStep defines the new sub timestep used for physics resolution.\r\n */\r\n public setSubTimeStep(subTimeStep: number = 0) {\r\n this._subTimeStep = subTimeStep;\r\n }\r\n\r\n /**\r\n * Get the sub time step of the physics engine.\r\n * @returns the current sub time step\r\n */\r\n public getSubTimeStep() {\r\n return this._subTimeStep;\r\n }\r\n\r\n /**\r\n * Release all resources\r\n */\r\n public dispose(): void {\r\n this._physicsPlugin.dispose();\r\n }\r\n\r\n /**\r\n * Gets the name of the current physics plugin\r\n * @returns the name of the plugin\r\n */\r\n public getPhysicsPluginName(): string {\r\n return this._physicsPlugin.name;\r\n }\r\n\r\n /**\r\n * Adding a new impostor for the impostor tracking.\r\n * This will be done by the impostor itself.\r\n * @param impostor the impostor to add\r\n */\r\n\r\n /**\r\n * Called by the scene. No need to call it.\r\n * @param delta defines the timespan between frames\r\n */\r\n public _step(delta: number) {\r\n if (delta > 0.1) {\r\n delta = 0.1;\r\n } else if (delta <= 0) {\r\n delta = 1.0 / 60.0;\r\n }\r\n\r\n this._physicsPlugin.executeStep(delta, this._physicsBodies);\r\n }\r\n\r\n /**\r\n * Add a body as an active component of this engine\r\n * @param body\r\n */\r\n public addBody(physicsBody: PhysicsBody): void {\r\n this._physicsBodies.push(physicsBody);\r\n }\r\n /**\r\n * Removes a particular body from this engine\r\n */\r\n public removeBody(physicsBody: PhysicsBody): void {\r\n const index = this._physicsBodies.indexOf(physicsBody);\r\n if (index > -1) {\r\n /*const removed =*/ this._physicsBodies.splice(index, 1);\r\n }\r\n }\r\n /**\r\n * Returns an array of bodies added to this engine\r\n\r\n */\r\n public getBodies(): Array<PhysicsBody> {\r\n return this._physicsBodies;\r\n }\r\n\r\n /**\r\n * Gets the current plugin used to run the simulation\r\n * @returns current plugin\r\n */\r\n public getPhysicsPlugin(): IPhysicsEnginePluginV2 {\r\n return this._physicsPlugin;\r\n }\r\n\r\n /**\r\n * Does a raycast in the physics world\r\n * @param from when should the ray start?\r\n * @param to when should the ray end?\r\n * @param result resulting PhysicsRaycastResult\r\n */\r\n public raycastToRef(from: Vector3, to: Vector3, result: PhysicsRaycastResult): void {\r\n this._physicsPlugin.raycast(from, to, result);\r\n }\r\n\r\n /**\r\n * Does a raycast in the physics world\r\n * @param from when should the ray start?\r\n * @param to when should the ray end?\r\n * @returns PhysicsRaycastResult\r\n */\r\n public raycast(from: Vector3, to: Vector3): PhysicsRaycastResult {\r\n const result = new PhysicsRaycastResult();\r\n this._physicsPlugin.raycast(from, to, result);\r\n return result;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"physicsEngine.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v2/physicsEngine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;;;GAGG;AACH,gBAAgB;AAChB,MAAM,OAAO,aAAa;IAWtB;;;OAGG;IACI,gBAAgB;QACnB,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC;IAClD,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,oBAAoB;QA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AK,GAAG,GAAG,EAAE;YACb,KAAK,GAAG,GAAG,CAAC;SACf;aAAM,IAAI,KAAK,IAAI,CAAC,EAAE;YACnB,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC;SACtB;QAED,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,WAAwB;QACnC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IACD;;OAEG;IACI,UAAU,CAAC,WAAwB;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACvD,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;YACZ,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAC5D;IACL,CAAC;IACD;;;OAGG;IACI,SAAS;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACI,gBAAgB;QACnB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;;;;OAKG;IACI,YAAY,CAAC,IAAa,EAAE,EAAW,EAAE,MAA4B;QACxE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACI,OAAO,CAAC,IAAa,EAAE,EAAW;QACrC,MAAM,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC1C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { IPhysicsEngine } from \"../IPhysicsEngine\";\r\nimport type { IPhysicsEnginePluginV2 } from \"./IPhysicsEnginePlugin\";\r\nimport { PhysicsRaycastResult } from \"../physicsRaycastResult\";\r\nimport { _WarnImport } from \"../../Misc/devTools\";\r\nimport type { PhysicsBody } from \"./physicsBody\";\r\n\r\n/**\r\n * Class used to control physics engine\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\n/** @internal */\r\nexport class PhysicsEngine implements IPhysicsEngine {\r\n /** @internal */\r\n private _physicsBodies: Array<PhysicsBody> = [];\r\n private _subTimeStep: number = 0;\r\n //private _uniqueIdCounter = 0;\r\n\r\n /**\r\n * Gets the gravity vector used by the simulation\r\n */\r\n public gravity: Vector3;\r\n\r\n /**\r\n *\r\n * @returns physics plugin version\r\n */\r\n public getPluginVersion(): number {\r\n return this._physicsPlugin.getPluginVersion();\r\n }\r\n /**\r\n * Factory used to create the default physics plugin.\r\n * @returns The default physics plugin\r\n */\r\n public static DefaultPluginFactory(): IPhysicsEnginePluginV2 {\r\n throw _WarnImport(\"\");\r\n }\r\n\r\n /**\r\n * Creates a new Physics Engine\r\n * @param gravity defines the gravity vector used by the simulation\r\n * @param _physicsPlugin defines the plugin to use (CannonJS by default)\r\n */\r\n constructor(gravity: Nullable<Vector3>, private _physicsPlugin: IPhysicsEnginePluginV2 = PhysicsEngine.DefaultPluginFactory()) {\r\n gravity = gravity || new Vector3(0, -9.807, 0);\r\n this.setGravity(gravity);\r\n this.setTimeStep();\r\n }\r\n\r\n /**\r\n * Sets the gravity vector used by the simulation\r\n * @param gravity defines the gravity vector to use\r\n */\r\n public setGravity(gravity: Vector3): void {\r\n this.gravity = gravity;\r\n this._physicsPlugin.setGravity(this.gravity);\r\n }\r\n\r\n /**\r\n * Set the time step of the physics engine.\r\n * Default is 1/60.\r\n * To slow it down, enter 1/600 for example.\r\n * To speed it up, 1/30\r\n * @param newTimeStep defines the new timestep to apply to this world.\r\n */\r\n public setTimeStep(newTimeStep: number = 1 / 60) {\r\n this._physicsPlugin.setTimeStep(newTimeStep);\r\n }\r\n\r\n /**\r\n * Get the time step of the physics engine.\r\n * @returns the current time step\r\n */\r\n public getTimeStep(): number {\r\n return this._physicsPlugin.getTimeStep();\r\n }\r\n\r\n /**\r\n * Set the sub time step of the physics engine.\r\n * Default is 0 meaning there is no sub steps\r\n * To increase physics resolution precision, set a small value (like 1 ms)\r\n * @param subTimeStep defines the new sub timestep used for physics resolution.\r\n */\r\n public setSubTimeStep(subTimeStep: number = 0) {\r\n this._subTimeStep = subTimeStep;\r\n }\r\n\r\n /**\r\n * Get the sub time step of the physics engine.\r\n * @returns the current sub time step\r\n */\r\n public getSubTimeStep() {\r\n return this._subTimeStep;\r\n }\r\n\r\n /**\r\n * Release all resources\r\n */\r\n public dispose(): void {\r\n this._physicsPlugin.dispose();\r\n }\r\n\r\n /**\r\n * Gets the name of the current physics plugin\r\n * @returns the name of the plugin\r\n */\r\n public getPhysicsPluginName(): string {\r\n return this._physicsPlugin.name;\r\n }\r\n\r\n /**\r\n * Adding a new impostor for the impostor tracking.\r\n * This will be done by the impostor itself.\r\n * @param impostor the impostor to add\r\n */\r\n\r\n /**\r\n * Called by the scene. No need to call it.\r\n * @param delta defines the timespan between frames\r\n */\r\n public _step(delta: number) {\r\n if (delta > 0.1) {\r\n delta = 0.1;\r\n } else if (delta <= 0) {\r\n delta = 1.0 / 60.0;\r\n }\r\n\r\n this._physicsPlugin.executeStep(delta, this._physicsBodies);\r\n }\r\n\r\n /**\r\n * Add a body as an active component of this engine\r\n * @param body\r\n */\r\n public addBody(physicsBody: PhysicsBody): void {\r\n this._physicsBodies.push(physicsBody);\r\n }\r\n /**\r\n * Removes a particular body from this engine\r\n */\r\n public removeBody(physicsBody: PhysicsBody): void {\r\n const index = this._physicsBodies.indexOf(physicsBody);\r\n if (index > -1) {\r\n /*const removed =*/ this._physicsBodies.splice(index, 1);\r\n }\r\n }\r\n /**\r\n * Returns an array of bodies added to this engine\r\n\r\n */\r\n public getBodies(): Array<PhysicsBody> {\r\n return this._physicsBodies;\r\n }\r\n\r\n /**\r\n * Gets the current plugin used to run the simulation\r\n * @returns current plugin\r\n */\r\n public getPhysicsPlugin(): IPhysicsEnginePluginV2 {\r\n return this._physicsPlugin;\r\n }\r\n\r\n /**\r\n * Does a raycast in the physics world\r\n * @param from when should the ray start?\r\n * @param to when should the ray end?\r\n * @param result resulting PhysicsRaycastResult\r\n */\r\n public raycastToRef(from: Vector3, to: Vector3, result: PhysicsRaycastResult): void {\r\n this._physicsPlugin.raycast(from, to, result);\r\n }\r\n\r\n /**\r\n * Does a raycast in the physics world\r\n * @param from when should the ray start?\r\n * @param to when should the ray end?\r\n * @returns PhysicsRaycastResult\r\n */\r\n public raycast(from: Vector3, to: Vector3): PhysicsRaycastResult {\r\n const result = new PhysicsRaycastResult();\r\n this._physicsPlugin.raycast(from, to, result);\r\n return result;\r\n }\r\n}\r\n"]}