@babylonjs/core 5.32.1 → 5.32.2

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 (634) hide show
  1. package/Actions/abstractActionManager.d.ts +1 -1
  2. package/Actions/abstractActionManager.js +1 -1
  3. package/Actions/abstractActionManager.js.map +1 -1
  4. package/Actions/action.d.ts +1 -1
  5. package/Actions/action.js +1 -1
  6. package/Actions/action.js.map +1 -1
  7. package/Actions/actionManager.d.ts +18 -18
  8. package/Actions/actionManager.js +18 -18
  9. package/Actions/actionManager.js.map +1 -1
  10. package/Actions/directActions.d.ts +10 -10
  11. package/Actions/directActions.js +10 -10
  12. package/Actions/directActions.js.map +1 -1
  13. package/Actions/interpolateValueAction.d.ts +1 -1
  14. package/Actions/interpolateValueAction.js +1 -1
  15. package/Actions/interpolateValueAction.js.map +1 -1
  16. package/Animations/animatable.d.ts +2 -2
  17. package/Animations/animatable.js +2 -2
  18. package/Animations/animatable.js.map +1 -1
  19. package/Animations/animationGroup.d.ts +3 -3
  20. package/Animations/animationGroup.js +3 -3
  21. package/Animations/animationGroup.js.map +1 -1
  22. package/Animations/easing.d.ts +14 -14
  23. package/Animations/easing.js +13 -13
  24. package/Animations/easing.js.map +1 -1
  25. package/Audio/Interfaces/IAudioEngine.d.ts +2 -2
  26. package/Audio/Interfaces/IAudioEngine.js.map +1 -1
  27. package/Audio/Interfaces/ISoundOptions.d.ts +3 -3
  28. package/Audio/Interfaces/ISoundOptions.js.map +1 -1
  29. package/Audio/analyser.d.ts +1 -1
  30. package/Audio/analyser.js +1 -1
  31. package/Audio/analyser.js.map +1 -1
  32. package/Audio/audioEngine.d.ts +2 -2
  33. package/Audio/audioEngine.js +2 -2
  34. package/Audio/audioEngine.js.map +1 -1
  35. package/Audio/audioSceneComponent.d.ts +4 -4
  36. package/Audio/audioSceneComponent.js.map +1 -1
  37. package/Audio/sound.d.ts +13 -13
  38. package/Audio/sound.js +13 -13
  39. package/Audio/sound.js.map +1 -1
  40. package/Audio/soundTrack.d.ts +5 -5
  41. package/Audio/soundTrack.js +5 -5
  42. package/Audio/soundTrack.js.map +1 -1
  43. package/BakedVertexAnimation/bakedVertexAnimationManager.d.ts +1 -1
  44. package/BakedVertexAnimation/bakedVertexAnimationManager.js +1 -1
  45. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  46. package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
  47. package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
  48. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  49. package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
  50. package/Behaviors/Cameras/bouncingBehavior.js +1 -1
  51. package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
  52. package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
  53. package/Behaviors/Cameras/framingBehavior.js +1 -1
  54. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  55. package/Behaviors/Meshes/pointerDragBehavior.d.ts +8 -0
  56. package/Behaviors/Meshes/pointerDragBehavior.js +9 -3
  57. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  58. package/Bones/bone.d.ts +1 -1
  59. package/Bones/bone.js +1 -1
  60. package/Bones/bone.js.map +1 -1
  61. package/Bones/boneIKController.d.ts +1 -1
  62. package/Bones/boneIKController.js +1 -1
  63. package/Bones/boneIKController.js.map +1 -1
  64. package/Bones/boneLookController.d.ts +1 -1
  65. package/Bones/boneLookController.js +1 -1
  66. package/Bones/boneLookController.js.map +1 -1
  67. package/Bones/skeleton.d.ts +3 -3
  68. package/Bones/skeleton.js +2 -2
  69. package/Bones/skeleton.js.map +1 -1
  70. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +2 -2
  71. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  72. package/Cameras/Inputs/BaseCameraPointersInput.js +2 -2
  73. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  74. package/Cameras/Inputs/arcRotateCameraGamepadInput.d.ts +1 -1
  75. package/Cameras/Inputs/arcRotateCameraGamepadInput.js +1 -1
  76. package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
  77. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.d.ts +1 -1
  78. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +1 -1
  79. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  80. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.d.ts +1 -1
  81. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +3 -3
  82. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  83. package/Cameras/Inputs/arcRotateCameraPointersInput.d.ts +1 -1
  84. package/Cameras/Inputs/arcRotateCameraPointersInput.js +1 -1
  85. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  86. package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.d.ts +1 -1
  87. package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js +1 -1
  88. package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js.map +1 -1
  89. package/Cameras/Inputs/flyCameraKeyboardInput.d.ts +1 -1
  90. package/Cameras/Inputs/flyCameraKeyboardInput.js +1 -1
  91. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  92. package/Cameras/Inputs/flyCameraMouseInput.d.ts +2 -2
  93. package/Cameras/Inputs/flyCameraMouseInput.js +4 -4
  94. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  95. package/Cameras/Inputs/followCameraKeyboardMoveInput.d.ts +1 -1
  96. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +1 -1
  97. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  98. package/Cameras/Inputs/followCameraMouseWheelInput.d.ts +1 -1
  99. package/Cameras/Inputs/followCameraMouseWheelInput.js +3 -3
  100. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  101. package/Cameras/Inputs/followCameraPointersInput.d.ts +1 -1
  102. package/Cameras/Inputs/followCameraPointersInput.js +1 -1
  103. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  104. package/Cameras/Inputs/freeCameraDeviceOrientationInput.d.ts +2 -2
  105. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +2 -2
  106. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
  107. package/Cameras/Inputs/freeCameraGamepadInput.d.ts +1 -1
  108. package/Cameras/Inputs/freeCameraGamepadInput.js +1 -1
  109. package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
  110. package/Cameras/Inputs/freeCameraKeyboardMoveInput.d.ts +1 -1
  111. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +1 -1
  112. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  113. package/Cameras/Inputs/freeCameraMouseInput.d.ts +3 -2
  114. package/Cameras/Inputs/freeCameraMouseInput.js +10 -7
  115. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  116. package/Cameras/Inputs/freeCameraMouseWheelInput.d.ts +1 -1
  117. package/Cameras/Inputs/freeCameraMouseWheelInput.js +1 -1
  118. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  119. package/Cameras/Inputs/freeCameraTouchInput.d.ts +2 -2
  120. package/Cameras/Inputs/freeCameraTouchInput.js +4 -4
  121. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  122. package/Cameras/Inputs/freeCameraVirtualJoystickInput.d.ts +1 -1
  123. package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +1 -1
  124. package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
  125. package/Cameras/Stereoscopic/anaglyphArcRotateCamera.d.ts +1 -1
  126. package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js +1 -1
  127. package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js.map +1 -1
  128. package/Cameras/Stereoscopic/anaglyphFreeCamera.d.ts +1 -1
  129. package/Cameras/Stereoscopic/anaglyphFreeCamera.js +1 -1
  130. package/Cameras/Stereoscopic/anaglyphFreeCamera.js.map +1 -1
  131. package/Cameras/Stereoscopic/anaglyphGamepadCamera.d.ts +1 -1
  132. package/Cameras/Stereoscopic/anaglyphGamepadCamera.js +1 -1
  133. package/Cameras/Stereoscopic/anaglyphGamepadCamera.js.map +1 -1
  134. package/Cameras/Stereoscopic/anaglyphUniversalCamera.d.ts +1 -1
  135. package/Cameras/Stereoscopic/anaglyphUniversalCamera.js +1 -1
  136. package/Cameras/Stereoscopic/anaglyphUniversalCamera.js.map +1 -1
  137. package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.d.ts +1 -1
  138. package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js +1 -1
  139. package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js.map +1 -1
  140. package/Cameras/Stereoscopic/stereoscopicFreeCamera.d.ts +1 -1
  141. package/Cameras/Stereoscopic/stereoscopicFreeCamera.js +1 -1
  142. package/Cameras/Stereoscopic/stereoscopicFreeCamera.js.map +1 -1
  143. package/Cameras/Stereoscopic/stereoscopicGamepadCamera.d.ts +1 -1
  144. package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js +1 -1
  145. package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js.map +1 -1
  146. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.d.ts +1 -1
  147. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +1 -1
  148. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
  149. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.d.ts +1 -1
  150. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js +1 -1
  151. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js.map +1 -1
  152. package/Cameras/VR/vrCameraMetrics.d.ts +1 -1
  153. package/Cameras/VR/vrCameraMetrics.js +1 -1
  154. package/Cameras/VR/vrCameraMetrics.js.map +1 -1
  155. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.d.ts +1 -1
  156. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js +1 -1
  157. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js.map +1 -1
  158. package/Cameras/VR/vrDeviceOrientationFreeCamera.d.ts +1 -1
  159. package/Cameras/VR/vrDeviceOrientationFreeCamera.js +1 -1
  160. package/Cameras/VR/vrDeviceOrientationFreeCamera.js.map +1 -1
  161. package/Cameras/VR/vrDeviceOrientationGamepadCamera.d.ts +1 -1
  162. package/Cameras/VR/vrDeviceOrientationGamepadCamera.js +1 -1
  163. package/Cameras/VR/vrDeviceOrientationGamepadCamera.js.map +1 -1
  164. package/Cameras/VR/vrExperienceHelper.d.ts +2 -2
  165. package/Cameras/VR/vrExperienceHelper.js +2 -2
  166. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  167. package/Cameras/VR/webVRCamera.d.ts +2 -2
  168. package/Cameras/VR/webVRCamera.js +2 -2
  169. package/Cameras/VR/webVRCamera.js.map +1 -1
  170. package/Cameras/arcRotateCamera.d.ts +9 -9
  171. package/Cameras/arcRotateCamera.js +9 -9
  172. package/Cameras/arcRotateCamera.js.map +1 -1
  173. package/Cameras/arcRotateCameraInputsManager.d.ts +1 -1
  174. package/Cameras/arcRotateCameraInputsManager.js +1 -1
  175. package/Cameras/arcRotateCameraInputsManager.js.map +1 -1
  176. package/Cameras/camera.d.ts +4 -4
  177. package/Cameras/camera.js +4 -4
  178. package/Cameras/camera.js.map +1 -1
  179. package/Cameras/cameraInputsManager.d.ts +1 -1
  180. package/Cameras/cameraInputsManager.js +1 -1
  181. package/Cameras/cameraInputsManager.js.map +1 -1
  182. package/Cameras/flyCamera.d.ts +1 -1
  183. package/Cameras/flyCamera.js +1 -1
  184. package/Cameras/flyCamera.js.map +1 -1
  185. package/Cameras/flyCameraInputsManager.d.ts +1 -1
  186. package/Cameras/flyCameraInputsManager.js +1 -1
  187. package/Cameras/flyCameraInputsManager.js.map +1 -1
  188. package/Cameras/followCamera.d.ts +4 -4
  189. package/Cameras/followCamera.js +4 -4
  190. package/Cameras/followCamera.js.map +1 -1
  191. package/Cameras/followCameraInputsManager.d.ts +1 -1
  192. package/Cameras/followCameraInputsManager.js +1 -1
  193. package/Cameras/followCameraInputsManager.js.map +1 -1
  194. package/Cameras/freeCamera.d.ts +3 -3
  195. package/Cameras/freeCamera.js +3 -3
  196. package/Cameras/freeCamera.js.map +1 -1
  197. package/Cameras/freeCameraInputsManager.d.ts +1 -1
  198. package/Cameras/freeCameraInputsManager.js +1 -1
  199. package/Cameras/freeCameraInputsManager.js.map +1 -1
  200. package/Cameras/gamepadCamera.d.ts +2 -2
  201. package/Cameras/gamepadCamera.js +2 -2
  202. package/Cameras/gamepadCamera.js.map +1 -1
  203. package/Cameras/targetCamera.d.ts +2 -2
  204. package/Cameras/targetCamera.js +2 -2
  205. package/Cameras/targetCamera.js.map +1 -1
  206. package/Cameras/touchCamera.d.ts +2 -2
  207. package/Cameras/touchCamera.js +2 -2
  208. package/Cameras/touchCamera.js.map +1 -1
  209. package/Cameras/universalCamera.d.ts +2 -2
  210. package/Cameras/universalCamera.js +2 -2
  211. package/Cameras/universalCamera.js.map +1 -1
  212. package/Cameras/virtualJoysticksCamera.d.ts +2 -2
  213. package/Cameras/virtualJoysticksCamera.js +2 -2
  214. package/Cameras/virtualJoysticksCamera.js.map +1 -1
  215. package/Collisions/pickingInfo.d.ts +1 -1
  216. package/Collisions/pickingInfo.js +1 -1
  217. package/Collisions/pickingInfo.js.map +1 -1
  218. package/Culling/Octrees/octree.d.ts +2 -2
  219. package/Culling/Octrees/octree.js +2 -2
  220. package/Culling/Octrees/octree.js.map +1 -1
  221. package/Culling/Octrees/octreeBlock.d.ts +1 -1
  222. package/Culling/Octrees/octreeBlock.js +1 -1
  223. package/Culling/Octrees/octreeBlock.js.map +1 -1
  224. package/Culling/Octrees/octreeSceneComponent.d.ts +3 -3
  225. package/Culling/Octrees/octreeSceneComponent.js +1 -1
  226. package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
  227. package/Culling/boundingInfo.d.ts +3 -3
  228. package/Culling/boundingInfo.js +2 -2
  229. package/Culling/boundingInfo.js.map +1 -1
  230. package/Debug/debugLayer.d.ts +1 -1
  231. package/Debug/debugLayer.js.map +1 -1
  232. package/Debug/rayHelper.d.ts +2 -2
  233. package/Debug/rayHelper.js +2 -2
  234. package/Debug/rayHelper.js.map +1 -1
  235. package/Engines/Extensions/engine.alpha.d.ts +2 -2
  236. package/Engines/Extensions/engine.alpha.js.map +1 -1
  237. package/Engines/Extensions/engine.multiRender.d.ts +2 -2
  238. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  239. package/Engines/Extensions/engine.query.d.ts +8 -8
  240. package/Engines/Extensions/engine.query.js.map +1 -1
  241. package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
  242. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  243. package/Engines/Extensions/engine.uniformBuffer.d.ts +3 -3
  244. package/Engines/Extensions/engine.uniformBuffer.js.map +1 -1
  245. package/Engines/Extensions/engine.views.d.ts +2 -2
  246. package/Engines/Extensions/engine.views.js +1 -1
  247. package/Engines/Extensions/engine.views.js.map +1 -1
  248. package/Engines/Extensions/engine.webVR.d.ts +1 -1
  249. package/Engines/Extensions/engine.webVR.js.map +1 -1
  250. package/Engines/Processors/shaderProcessor.d.ts +2 -2
  251. package/Engines/Processors/shaderProcessor.js +2 -2
  252. package/Engines/Processors/shaderProcessor.js.map +1 -1
  253. package/Engines/WebGPU/webgpuShaderProcessor.js +11 -9
  254. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  255. package/Engines/constants.d.ts +17 -17
  256. package/Engines/constants.js +17 -17
  257. package/Engines/constants.js.map +1 -1
  258. package/Engines/engine.d.ts +12 -12
  259. package/Engines/engine.js +11 -11
  260. package/Engines/engine.js.map +1 -1
  261. package/Engines/nativeEngine.d.ts +2 -2
  262. package/Engines/nativeEngine.js +23 -2
  263. package/Engines/nativeEngine.js.map +1 -1
  264. package/Engines/nullEngine.d.ts +5 -5
  265. package/Engines/nullEngine.js +5 -5
  266. package/Engines/nullEngine.js.map +1 -1
  267. package/Engines/thinEngine.d.ts +8 -8
  268. package/Engines/thinEngine.js +6 -6
  269. package/Engines/thinEngine.js.map +1 -1
  270. package/Engines/webgpuEngine.d.ts +4 -4
  271. package/Engines/webgpuEngine.js +1 -1
  272. package/Engines/webgpuEngine.js.map +1 -1
  273. package/Gamepads/gamepadSceneComponent.d.ts +1 -1
  274. package/Gamepads/gamepadSceneComponent.js.map +1 -1
  275. package/Gizmos/gizmo.d.ts +6 -7
  276. package/Gizmos/gizmo.js +43 -36
  277. package/Gizmos/gizmo.js.map +1 -1
  278. package/Gizmos/planeRotationGizmo.js +17 -7
  279. package/Gizmos/planeRotationGizmo.js.map +1 -1
  280. package/Gizmos/positionGizmo.d.ts +4 -0
  281. package/Gizmos/positionGizmo.js +21 -0
  282. package/Gizmos/positionGizmo.js.map +1 -1
  283. package/Gizmos/rotationGizmo.d.ts +4 -0
  284. package/Gizmos/rotationGizmo.js +20 -0
  285. package/Gizmos/rotationGizmo.js.map +1 -1
  286. package/Gizmos/scaleGizmo.d.ts +2 -0
  287. package/Gizmos/scaleGizmo.js +10 -0
  288. package/Gizmos/scaleGizmo.js.map +1 -1
  289. package/Helpers/sceneHelpers.d.ts +7 -7
  290. package/Helpers/sceneHelpers.js.map +1 -1
  291. package/Inputs/scene.inputManager.js +34 -25
  292. package/Inputs/scene.inputManager.js.map +1 -1
  293. package/Instrumentation/engineInstrumentation.d.ts +2 -2
  294. package/Instrumentation/engineInstrumentation.js +2 -2
  295. package/Instrumentation/engineInstrumentation.js.map +1 -1
  296. package/Instrumentation/sceneInstrumentation.d.ts +2 -2
  297. package/Instrumentation/sceneInstrumentation.js +2 -2
  298. package/Instrumentation/sceneInstrumentation.js.map +1 -1
  299. package/Layers/effectLayerSceneComponent.d.ts +2 -2
  300. package/Layers/effectLayerSceneComponent.js.map +1 -1
  301. package/Layers/glowLayer.d.ts +1 -1
  302. package/Layers/glowLayer.js +1 -1
  303. package/Layers/glowLayer.js.map +1 -1
  304. package/LensFlares/lensFlare.d.ts +3 -3
  305. package/LensFlares/lensFlare.js +3 -3
  306. package/LensFlares/lensFlare.js.map +1 -1
  307. package/LensFlares/lensFlareSystem.d.ts +2 -2
  308. package/LensFlares/lensFlareSystem.js +2 -2
  309. package/LensFlares/lensFlareSystem.js.map +1 -1
  310. package/LensFlares/lensFlareSystemSceneComponent.d.ts +1 -1
  311. package/LensFlares/lensFlareSystemSceneComponent.js.map +1 -1
  312. package/Lights/Shadows/shadowGenerator.d.ts +2 -2
  313. package/Lights/Shadows/shadowGenerator.js +2 -2
  314. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  315. package/Lights/directionalLight.d.ts +2 -2
  316. package/Lights/directionalLight.js +2 -2
  317. package/Lights/directionalLight.js.map +1 -1
  318. package/Lights/hemisphericLight.d.ts +1 -1
  319. package/Lights/hemisphericLight.js +1 -1
  320. package/Lights/hemisphericLight.js.map +1 -1
  321. package/Lights/light.d.ts +1 -1
  322. package/Lights/light.js +1 -1
  323. package/Lights/light.js.map +1 -1
  324. package/Lights/pointLight.d.ts +2 -2
  325. package/Lights/pointLight.js +2 -2
  326. package/Lights/pointLight.js.map +1 -1
  327. package/Lights/spotLight.d.ts +2 -2
  328. package/Lights/spotLight.js +2 -2
  329. package/Lights/spotLight.js.map +1 -1
  330. package/Loading/loadingScreen.d.ts +2 -2
  331. package/Loading/loadingScreen.js +1 -1
  332. package/Loading/loadingScreen.js.map +1 -1
  333. package/Materials/Node/Blocks/Vertex/instancesBlock.d.ts +1 -1
  334. package/Materials/Node/Blocks/Vertex/instancesBlock.js +1 -1
  335. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  336. package/Materials/Node/Blocks/reciprocalBlock.js +6 -2
  337. package/Materials/Node/Blocks/reciprocalBlock.js.map +1 -1
  338. package/Materials/PBR/pbrBaseMaterial.d.ts +1 -1
  339. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  340. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  341. package/Materials/PBR/pbrMaterial.d.ts +1 -1
  342. package/Materials/PBR/pbrMaterial.js +1 -1
  343. package/Materials/PBR/pbrMaterial.js.map +1 -1
  344. package/Materials/Textures/Packer/packer.d.ts +1 -1
  345. package/Materials/Textures/Packer/packer.js +1 -1
  346. package/Materials/Textures/Packer/packer.js.map +1 -1
  347. package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -2
  348. package/Materials/Textures/Procedurals/customProceduralTexture.js +2 -2
  349. package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
  350. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +2 -2
  351. package/Materials/Textures/Procedurals/proceduralTexture.js +2 -2
  352. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  353. package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.d.ts +1 -1
  354. package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js.map +1 -1
  355. package/Materials/Textures/cubeTexture.d.ts +2 -2
  356. package/Materials/Textures/cubeTexture.js +2 -2
  357. package/Materials/Textures/cubeTexture.js.map +1 -1
  358. package/Materials/Textures/dynamicTexture.d.ts +1 -1
  359. package/Materials/Textures/dynamicTexture.js +1 -1
  360. package/Materials/Textures/dynamicTexture.js.map +1 -1
  361. package/Materials/Textures/mirrorTexture.d.ts +3 -3
  362. package/Materials/Textures/mirrorTexture.js +3 -3
  363. package/Materials/Textures/mirrorTexture.js.map +1 -1
  364. package/Materials/Textures/refractionTexture.d.ts +3 -3
  365. package/Materials/Textures/refractionTexture.js +3 -3
  366. package/Materials/Textures/refractionTexture.js.map +1 -1
  367. package/Materials/Textures/texture.d.ts +10 -10
  368. package/Materials/Textures/texture.js +10 -10
  369. package/Materials/Textures/texture.js.map +1 -1
  370. package/Materials/Textures/videoTexture.d.ts +2 -2
  371. package/Materials/Textures/videoTexture.js +2 -2
  372. package/Materials/Textures/videoTexture.js.map +1 -1
  373. package/Materials/effect.d.ts +20 -2
  374. package/Materials/effect.js +28 -4
  375. package/Materials/effect.js.map +1 -1
  376. package/Materials/fresnelParameters.d.ts +1 -1
  377. package/Materials/fresnelParameters.js +1 -1
  378. package/Materials/fresnelParameters.js.map +1 -1
  379. package/Materials/material.d.ts +1 -1
  380. package/Materials/material.js.map +1 -1
  381. package/Materials/multiMaterial.d.ts +2 -2
  382. package/Materials/multiMaterial.js +2 -2
  383. package/Materials/multiMaterial.js.map +1 -1
  384. package/Materials/shaderMaterial.d.ts +2 -2
  385. package/Materials/shaderMaterial.js +2 -2
  386. package/Materials/shaderMaterial.js.map +1 -1
  387. package/Materials/shadowDepthWrapper.d.ts +1 -1
  388. package/Materials/shadowDepthWrapper.js +2 -2
  389. package/Materials/shadowDepthWrapper.js.map +1 -1
  390. package/Materials/standardMaterial.d.ts +18 -18
  391. package/Materials/standardMaterial.js +6 -6
  392. package/Materials/standardMaterial.js.map +1 -1
  393. package/Maths/math.path.d.ts +7 -7
  394. package/Maths/math.path.js +7 -7
  395. package/Maths/math.path.js.map +1 -1
  396. package/Maths/math.vector.d.ts +4 -4
  397. package/Maths/math.vector.js +4 -4
  398. package/Maths/math.vector.js.map +1 -1
  399. package/Meshes/Builders/boxBuilder.d.ts +3 -3
  400. package/Meshes/Builders/boxBuilder.js +3 -3
  401. package/Meshes/Builders/boxBuilder.js.map +1 -1
  402. package/Meshes/Builders/capsuleBuilder.d.ts +1 -1
  403. package/Meshes/Builders/capsuleBuilder.js +1 -1
  404. package/Meshes/Builders/capsuleBuilder.js.map +1 -1
  405. package/Meshes/Builders/cylinderBuilder.d.ts +2 -2
  406. package/Meshes/Builders/cylinderBuilder.js +2 -2
  407. package/Meshes/Builders/cylinderBuilder.js.map +1 -1
  408. package/Meshes/Builders/decalBuilder.d.ts +1 -1
  409. package/Meshes/Builders/decalBuilder.js +1 -1
  410. package/Meshes/Builders/decalBuilder.js.map +1 -1
  411. package/Meshes/Builders/discBuilder.d.ts +2 -2
  412. package/Meshes/Builders/discBuilder.js +2 -2
  413. package/Meshes/Builders/discBuilder.js.map +1 -1
  414. package/Meshes/Builders/geodesicBuilder.d.ts +1 -1
  415. package/Meshes/Builders/geodesicBuilder.js +1 -1
  416. package/Meshes/Builders/geodesicBuilder.js.map +1 -1
  417. package/Meshes/Builders/goldbergBuilder.d.ts +1 -1
  418. package/Meshes/Builders/goldbergBuilder.js +1 -1
  419. package/Meshes/Builders/goldbergBuilder.js.map +1 -1
  420. package/Meshes/Builders/groundBuilder.d.ts +4 -4
  421. package/Meshes/Builders/groundBuilder.js +4 -4
  422. package/Meshes/Builders/groundBuilder.js.map +1 -1
  423. package/Meshes/Builders/icoSphereBuilder.d.ts +2 -2
  424. package/Meshes/Builders/icoSphereBuilder.js +2 -2
  425. package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
  426. package/Meshes/Builders/latheBuilder.d.ts +2 -2
  427. package/Meshes/Builders/latheBuilder.js +2 -2
  428. package/Meshes/Builders/latheBuilder.js.map +1 -1
  429. package/Meshes/Builders/linesBuilder.d.ts +6 -6
  430. package/Meshes/Builders/linesBuilder.js +6 -6
  431. package/Meshes/Builders/linesBuilder.js.map +1 -1
  432. package/Meshes/Builders/planeBuilder.d.ts +2 -2
  433. package/Meshes/Builders/planeBuilder.js +2 -2
  434. package/Meshes/Builders/planeBuilder.js.map +1 -1
  435. package/Meshes/Builders/polygonBuilder.d.ts +1 -1
  436. package/Meshes/Builders/polygonBuilder.js +1 -1
  437. package/Meshes/Builders/polygonBuilder.js.map +1 -1
  438. package/Meshes/Builders/polyhedronBuilder.d.ts +3 -3
  439. package/Meshes/Builders/polyhedronBuilder.js +3 -3
  440. package/Meshes/Builders/polyhedronBuilder.js.map +1 -1
  441. package/Meshes/Builders/ribbonBuilder.d.ts +4 -4
  442. package/Meshes/Builders/ribbonBuilder.js +4 -4
  443. package/Meshes/Builders/ribbonBuilder.js.map +1 -1
  444. package/Meshes/Builders/shapeBuilder.d.ts +9 -9
  445. package/Meshes/Builders/shapeBuilder.js +9 -9
  446. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  447. package/Meshes/Builders/sphereBuilder.d.ts +2 -2
  448. package/Meshes/Builders/sphereBuilder.js +2 -2
  449. package/Meshes/Builders/sphereBuilder.js.map +1 -1
  450. package/Meshes/Builders/tiledBoxBuilder.d.ts +2 -2
  451. package/Meshes/Builders/tiledBoxBuilder.js +2 -2
  452. package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
  453. package/Meshes/Builders/tiledPlaneBuilder.d.ts +2 -2
  454. package/Meshes/Builders/tiledPlaneBuilder.js +2 -2
  455. package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
  456. package/Meshes/Builders/torusBuilder.d.ts +2 -2
  457. package/Meshes/Builders/torusBuilder.js +2 -2
  458. package/Meshes/Builders/torusBuilder.js.map +1 -1
  459. package/Meshes/Builders/torusKnotBuilder.d.ts +2 -2
  460. package/Meshes/Builders/torusKnotBuilder.js +2 -2
  461. package/Meshes/Builders/torusKnotBuilder.js.map +1 -1
  462. package/Meshes/Builders/tubeBuilder.d.ts +4 -4
  463. package/Meshes/Builders/tubeBuilder.js +4 -4
  464. package/Meshes/Builders/tubeBuilder.js.map +1 -1
  465. package/Meshes/abstractMesh.d.ts +35 -35
  466. package/Meshes/abstractMesh.js +34 -34
  467. package/Meshes/abstractMesh.js.map +1 -1
  468. package/Meshes/instancedMesh.d.ts +3 -3
  469. package/Meshes/instancedMesh.js +1 -1
  470. package/Meshes/instancedMesh.js.map +1 -1
  471. package/Meshes/linesMesh.d.ts +2 -2
  472. package/Meshes/linesMesh.js +2 -2
  473. package/Meshes/linesMesh.js.map +1 -1
  474. package/Meshes/mesh.d.ts +36 -36
  475. package/Meshes/mesh.js +9 -17
  476. package/Meshes/mesh.js.map +1 -1
  477. package/Meshes/meshLODLevel.d.ts +1 -1
  478. package/Meshes/meshLODLevel.js +1 -1
  479. package/Meshes/meshLODLevel.js.map +1 -1
  480. package/Meshes/meshSimplification.d.ts +6 -6
  481. package/Meshes/meshSimplification.js +4 -4
  482. package/Meshes/meshSimplification.js.map +1 -1
  483. package/Meshes/meshSimplificationSceneComponent.d.ts +1 -1
  484. package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
  485. package/Meshes/polygonMesh.d.ts +2 -2
  486. package/Meshes/polygonMesh.js +2 -2
  487. package/Meshes/polygonMesh.js.map +1 -1
  488. package/Meshes/transformNode.d.ts +1 -1
  489. package/Meshes/transformNode.js +1 -1
  490. package/Meshes/transformNode.js.map +1 -1
  491. package/Misc/assetsManager.d.ts +2 -2
  492. package/Misc/assetsManager.js +2 -2
  493. package/Misc/assetsManager.js.map +1 -1
  494. package/Misc/iInspectable.d.ts +1 -1
  495. package/Misc/iInspectable.js.map +1 -1
  496. package/Misc/sceneOptimizer.d.ts +12 -12
  497. package/Misc/sceneOptimizer.js +12 -12
  498. package/Misc/sceneOptimizer.js.map +1 -1
  499. package/Misc/screenshotTools.d.ts +10 -10
  500. package/Misc/screenshotTools.js +10 -10
  501. package/Misc/screenshotTools.js.map +1 -1
  502. package/Misc/tools.d.ts +4 -4
  503. package/Misc/tools.js +4 -4
  504. package/Misc/tools.js.map +1 -1
  505. package/Misc/videoRecorder.d.ts +1 -1
  506. package/Misc/videoRecorder.js +1 -1
  507. package/Misc/videoRecorder.js.map +1 -1
  508. package/Morph/morphTarget.d.ts +1 -1
  509. package/Morph/morphTarget.js +1 -1
  510. package/Morph/morphTarget.js.map +1 -1
  511. package/Morph/morphTargetManager.d.ts +1 -1
  512. package/Morph/morphTargetManager.js +1 -1
  513. package/Morph/morphTargetManager.js.map +1 -1
  514. package/Offline/IOfflineProvider.d.ts +1 -1
  515. package/Offline/IOfflineProvider.js.map +1 -1
  516. package/Offline/database.d.ts +1 -1
  517. package/Offline/database.js +1 -1
  518. package/Offline/database.js.map +1 -1
  519. package/Particles/IParticleSystem.d.ts +1 -1
  520. package/Particles/IParticleSystem.js.map +1 -1
  521. package/Particles/baseParticleSystem.d.ts +1 -1
  522. package/Particles/baseParticleSystem.js +1 -1
  523. package/Particles/baseParticleSystem.js.map +1 -1
  524. package/Particles/gpuParticleSystem.d.ts +1 -1
  525. package/Particles/gpuParticleSystem.js +1 -1
  526. package/Particles/gpuParticleSystem.js.map +1 -1
  527. package/Particles/particleSystem.d.ts +2 -2
  528. package/Particles/particleSystem.js +2 -2
  529. package/Particles/particleSystem.js.map +1 -1
  530. package/Particles/solidParticleSystem.d.ts +15 -15
  531. package/Particles/solidParticleSystem.js +13 -13
  532. package/Particles/solidParticleSystem.js.map +1 -1
  533. package/Physics/IPhysicsEngine.d.ts +1 -1
  534. package/Physics/IPhysicsEngine.js.map +1 -1
  535. package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
  536. package/Physics/Plugins/ammoJSPlugin.js +1 -1
  537. package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
  538. package/Physics/physicsEngine.d.ts +1 -1
  539. package/Physics/physicsEngine.js +1 -1
  540. package/Physics/physicsEngine.js.map +1 -1
  541. package/Physics/physicsEngineComponent.d.ts +3 -3
  542. package/Physics/physicsEngineComponent.js +2 -2
  543. package/Physics/physicsEngineComponent.js.map +1 -1
  544. package/Physics/physicsHelper.d.ts +12 -12
  545. package/Physics/physicsHelper.js +6 -6
  546. package/Physics/physicsHelper.js.map +1 -1
  547. package/Physics/physicsImpostor.d.ts +3 -3
  548. package/Physics/physicsImpostor.js +1 -1
  549. package/Physics/physicsImpostor.js.map +1 -1
  550. package/Physics/physicsJoint.d.ts +9 -9
  551. package/Physics/physicsJoint.js +5 -5
  552. package/Physics/physicsJoint.js.map +1 -1
  553. package/Physics/physicsRaycastResult.d.ts +1 -1
  554. package/Physics/physicsRaycastResult.js +1 -1
  555. package/Physics/physicsRaycastResult.js.map +1 -1
  556. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +1 -1
  557. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +1 -1
  558. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  559. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.d.ts +1 -1
  560. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +1 -1
  561. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  562. package/PostProcesses/RenderPipeline/postProcessRenderEffect.d.ts +1 -1
  563. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js +1 -1
  564. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js.map +1 -1
  565. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +2 -2
  566. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +1 -1
  567. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  568. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.d.ts +2 -2
  569. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js +2 -2
  570. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js.map +1 -1
  571. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.d.ts +2 -2
  572. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js.map +1 -1
  573. package/PostProcesses/blackAndWhitePostProcess.d.ts +1 -1
  574. package/PostProcesses/blackAndWhitePostProcess.js +1 -1
  575. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  576. package/PostProcesses/fxaaPostProcess.d.ts +1 -1
  577. package/PostProcesses/fxaaPostProcess.js +1 -1
  578. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  579. package/PostProcesses/highlightsPostProcess.d.ts +2 -2
  580. package/PostProcesses/highlightsPostProcess.js +2 -2
  581. package/PostProcesses/highlightsPostProcess.js.map +1 -1
  582. package/PostProcesses/imageProcessingPostProcess.d.ts +1 -1
  583. package/PostProcesses/imageProcessingPostProcess.js +1 -1
  584. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  585. package/PostProcesses/postProcess.d.ts +2 -2
  586. package/PostProcesses/postProcess.js +1 -1
  587. package/PostProcesses/postProcess.js.map +1 -1
  588. package/PostProcesses/postProcessManager.d.ts +1 -1
  589. package/PostProcesses/postProcessManager.js +1 -1
  590. package/PostProcesses/postProcessManager.js.map +1 -1
  591. package/PostProcesses/refractionPostProcess.d.ts +2 -2
  592. package/PostProcesses/refractionPostProcess.js +2 -2
  593. package/PostProcesses/refractionPostProcess.js.map +1 -1
  594. package/Probes/reflectionProbe.d.ts +2 -2
  595. package/Probes/reflectionProbe.js +1 -1
  596. package/Probes/reflectionProbe.js.map +1 -1
  597. package/Rendering/geometryBufferRenderer.js +2 -2
  598. package/Rendering/geometryBufferRenderer.js.map +1 -1
  599. package/Sprites/sprite.d.ts +1 -1
  600. package/Sprites/sprite.js +1 -1
  601. package/Sprites/sprite.js.map +1 -1
  602. package/Sprites/spriteManager.d.ts +2 -2
  603. package/Sprites/spriteManager.js +1 -1
  604. package/Sprites/spriteManager.js.map +1 -1
  605. package/Sprites/spritePackedManager.d.ts +1 -1
  606. package/Sprites/spritePackedManager.js +1 -1
  607. package/Sprites/spritePackedManager.js.map +1 -1
  608. package/Sprites/spriteSceneComponent.d.ts +1 -1
  609. package/Sprites/spriteSceneComponent.js.map +1 -1
  610. package/Sprites/thinSprite.d.ts +1 -1
  611. package/Sprites/thinSprite.js +1 -1
  612. package/Sprites/thinSprite.js.map +1 -1
  613. package/XR/webXRCamera.d.ts +1 -1
  614. package/XR/webXRCamera.js +1 -1
  615. package/XR/webXRCamera.js.map +1 -1
  616. package/XR/webXRExperienceHelper.d.ts +1 -1
  617. package/XR/webXRExperienceHelper.js +1 -1
  618. package/XR/webXRExperienceHelper.js.map +1 -1
  619. package/XR/webXRInputSource.d.ts +1 -1
  620. package/XR/webXRInputSource.js +1 -1
  621. package/XR/webXRInputSource.js.map +1 -1
  622. package/XR/webXRSessionManager.d.ts +1 -1
  623. package/XR/webXRSessionManager.js +1 -1
  624. package/XR/webXRSessionManager.js.map +1 -1
  625. package/abstractScene.d.ts +9 -9
  626. package/abstractScene.js +9 -9
  627. package/abstractScene.js.map +1 -1
  628. package/node.d.ts +6 -6
  629. package/node.js +5 -5
  630. package/node.js.map +1 -1
  631. package/package.json +1 -1
  632. package/scene.d.ts +29 -24
  633. package/scene.js +24 -18
  634. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"physicsImpostor.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/physicsImpostor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAMtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AA6K3C,IAAI,CAAC,sBAAsB,GAAG,UAAU,KAAY,EAAE,YAAmC,EAAE,UAAe;IACtG,OAAO,IAAI,eAAe,CACtB,YAAY,EACZ,UAAU,CAAC,eAAe,EAC1B;QACI,IAAI,EAAE,UAAU,CAAC,WAAW;QAC5B,QAAQ,EAAE,UAAU,CAAC,eAAe;QACpC,WAAW,EAAE,UAAU,CAAC,kBAAkB;KAC7C,EACD,KAAK,CACR,CAAC;AACN,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,eAAe;IAmOxB;;;;;;OAMG;IACH;IACI;;OAEG;IACI,MAA6B;IACpC;;OAEG;IACI,IAAY,EACX,WAAsC,EAAE,IAAI,EAAE,CA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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 { IPhysicsEngine } from \"./IPhysicsEngine\";\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/how_to/using_the_physics_engine\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/how_to/using_the_physics_engine\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/how_to/using_the_physics_engine\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<IPhysicsEngine>;\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();\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 * event and body object due to cannon's event-based architecture.\r\n * @param e\r\n * @param e.body\r\n * @param e.point\r\n * @param e.distance\r\n * @param e.impulse\r\n * @param e.normal\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/physicsImpostor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB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import { 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 { IPhysicsEngine } from \"./IPhysicsEngine\";\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<IPhysicsEngine>;\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();\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 * event and body object due to cannon's event-based architecture.\r\n * @param e\r\n * @param e.body\r\n * @param e.point\r\n * @param e.distance\r\n * @param e.impulse\r\n * @param e.normal\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"]}
@@ -2,7 +2,7 @@ import type { Vector3 } from "../Maths/math.vector";
2
2
  import type { IPhysicsEnginePlugin } from "./IPhysicsEngine";
3
3
  /**
4
4
  * Interface for Physics-Joint data
5
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
5
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
6
6
  */
7
7
  export interface PhysicsJointData {
8
8
  /**
@@ -33,7 +33,7 @@ export interface PhysicsJointData {
33
33
  /**
34
34
  * This is a holder class for the physics joint created by the physics plugin
35
35
  * It holds a set of functions to control the underlying joint
36
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
36
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
37
37
  */
38
38
  export declare class PhysicsJoint {
39
39
  /**
@@ -126,7 +126,7 @@ export declare class PhysicsJoint {
126
126
  }
127
127
  /**
128
128
  * A class representing a physics distance joint
129
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
129
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
130
130
  */
131
131
  export declare class DistanceJoint extends PhysicsJoint {
132
132
  /**
@@ -143,7 +143,7 @@ export declare class DistanceJoint extends PhysicsJoint {
143
143
  }
144
144
  /**
145
145
  * Represents a Motor-Enabled Joint
146
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
146
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
147
147
  */
148
148
  export declare class MotorEnabledJoint extends PhysicsJoint implements IMotorEnabledJoint {
149
149
  /**
@@ -169,7 +169,7 @@ export declare class MotorEnabledJoint extends PhysicsJoint implements IMotorEna
169
169
  }
170
170
  /**
171
171
  * This class represents a single physics Hinge-Joint
172
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
172
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
173
173
  */
174
174
  export declare class HingeJoint extends MotorEnabledJoint {
175
175
  /**
@@ -194,7 +194,7 @@ export declare class HingeJoint extends MotorEnabledJoint {
194
194
  }
195
195
  /**
196
196
  * This class represents a dual hinge physics joint (same as wheel joint)
197
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
197
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
198
198
  */
199
199
  export declare class Hinge2Joint extends MotorEnabledJoint {
200
200
  /**
@@ -221,7 +221,7 @@ export declare class Hinge2Joint extends MotorEnabledJoint {
221
221
  }
222
222
  /**
223
223
  * Interface for a motor enabled joint
224
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
224
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
225
225
  */
226
226
  export interface IMotorEnabledJoint {
227
227
  /**
@@ -245,7 +245,7 @@ export interface IMotorEnabledJoint {
245
245
  }
246
246
  /**
247
247
  * Joint data for a Distance-Joint
248
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
248
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
249
249
  */
250
250
  export interface DistanceJointData extends PhysicsJointData {
251
251
  /**
@@ -255,7 +255,7 @@ export interface DistanceJointData extends PhysicsJointData {
255
255
  }
256
256
  /**
257
257
  * Joint data from a spring joint
258
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
258
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
259
259
  */
260
260
  export interface SpringJointData extends PhysicsJointData {
261
261
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This is a holder class for the physics joint created by the physics plugin
3
3
  * It holds a set of functions to control the underlying joint
4
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
4
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
5
5
  */
6
6
  export class PhysicsJoint {
7
7
  /**
@@ -105,7 +105,7 @@ PhysicsJoint.SpringJoint = 9;
105
105
  PhysicsJoint.LockJoint = 10;
106
106
  /**
107
107
  * A class representing a physics distance joint
108
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
108
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
109
109
  */
110
110
  export class DistanceJoint extends PhysicsJoint {
111
111
  /**
@@ -126,7 +126,7 @@ export class DistanceJoint extends PhysicsJoint {
126
126
  }
127
127
  /**
128
128
  * Represents a Motor-Enabled Joint
129
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
129
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
130
130
  */
131
131
  export class MotorEnabledJoint extends PhysicsJoint {
132
132
  /**
@@ -158,7 +158,7 @@ export class MotorEnabledJoint extends PhysicsJoint {
158
158
  }
159
159
  /**
160
160
  * This class represents a single physics Hinge-Joint
161
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
161
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
162
162
  */
163
163
  export class HingeJoint extends MotorEnabledJoint {
164
164
  /**
@@ -189,7 +189,7 @@ export class HingeJoint extends MotorEnabledJoint {
189
189
  }
190
190
  /**
191
191
  * This class represents a dual hinge physics joint (same as wheel joint)
192
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
192
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
193
193
  */
194
194
  export class Hinge2Joint extends MotorEnabledJoint {
195
195
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"physicsJoint.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/physicsJoint.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAIrB;;;;OAIG;IACH;IACI;;OAEG;IACI,IAAY;IACnB;;OAEG;IACI,SAA2B;QAJ3B,SAAI,GAAJ,IAAI,CAAQ;QAIZ,cAAS,GAAT,SAAS,CAAkB;QAElC,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,YAAY,CAAC,QAAa;QACjC,IAAI,IAAI,CAAC,aAAa,EAAE;YACpB,uBAAuB;SAC1B;QAED,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,aAAa,CAAC,aAAmC;QACxD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,qBAAqB,CAAC,IAA6C;QACtE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACxD,CAAC;;AAED,8CAA8C;AAE9C,aAAa;AACb;;GAEG;AACW,0BAAa,GAAG,CAAC,CAAC;AAChC;;GAEG;AACW,uBAAU,GAAG,CAAC,CAAC;AAC7B;;GAEG;AACW,+BAAkB,GAAG,CAAC,CAAC;AACrC;;GAEG;AACW,uBAAU,GAA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AAiB;IAC7C;;;OAGG;IACH,YAAY,SAA2B;QACnC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,KAAc,EAAE,QAAiB;QAC7C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,UAAkB,EAAE,UAAmB;QACnD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAC9C;;;OAGG;IACH,YAAY,SAA2B;QACnC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACI,QAAQ,CAAC,WAAoB,EAAE,QAAiB,EAAE,aAAqB,CAAC;QAC3E,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,IAAI,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;OAMG;IACI,QAAQ,CAAC,UAAkB,EAAE,UAAmB,EAAE,aAAqB,CAAC;QAC3E,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAC3E,CAAC;CACJ","sourcesContent":["import type { Vector3 } from \"../Maths/math.vector\";\r\nimport type { IPhysicsEnginePlugin } from \"./IPhysicsEngine\";\r\n/**\r\n * Interface for Physics-Joint data\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport interface PhysicsJointData {\r\n //Important for some engines, optional!\r\n /**\r\n * The main pivot of the joint\r\n */\r\n mainPivot?: Vector3;\r\n /**\r\n * The connected pivot of the joint\r\n */\r\n connectedPivot?: Vector3;\r\n /**\r\n * The main axis of the joint\r\n */\r\n mainAxis?: Vector3;\r\n /**\r\n * The connected axis of the joint\r\n */\r\n connectedAxis?: Vector3;\r\n /**\r\n * The collision of the joint\r\n */\r\n collision?: boolean;\r\n /**\r\n * Native Oimo/Cannon/Energy data\r\n */\r\n nativeParams?: any;\r\n}\r\n\r\n/**\r\n * This is a holder class for the physics joint created by the physics plugin\r\n * It holds a set of functions to control the underlying joint\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport class PhysicsJoint {\r\n private _physicsJoint: any;\r\n protected _physicsPlugin: IPhysicsEnginePlugin;\r\n\r\n /**\r\n * Initializes the physics joint\r\n * @param type The type of the physics joint\r\n * @param jointData The data for the physics joint\r\n */\r\n constructor(\r\n /**\r\n * The type of the physics joint\r\n */\r\n public type: number,\r\n /**\r\n * The data for the physics joint\r\n */\r\n public jointData: PhysicsJointData\r\n ) {\r\n jointData.nativeParams = jointData.nativeParams || {};\r\n }\r\n\r\n /**\r\n * Gets the physics joint\r\n */\r\n public get physicsJoint(): any {\r\n return this._physicsJoint;\r\n }\r\n\r\n /**\r\n * Sets the physics joint\r\n */\r\n public set physicsJoint(newJoint: any) {\r\n if (this._physicsJoint) {\r\n //remove from the world\r\n }\r\n\r\n this._physicsJoint = newJoint;\r\n }\r\n\r\n /**\r\n * Sets the physics plugin\r\n */\r\n public set physicsPlugin(physicsPlugin: IPhysicsEnginePlugin) {\r\n this._physicsPlugin = physicsPlugin;\r\n }\r\n\r\n /**\r\n * Execute a function that is physics-plugin specific.\r\n * @param {Function} func the function that will be executed.\r\n * It accepts two parameters: the physics world and the physics joint\r\n */\r\n public executeNativeFunction(func: (world: any, physicsJoint: any) => void) {\r\n func(this._physicsPlugin.world, this._physicsJoint);\r\n }\r\n\r\n //TODO check if the native joints are the same\r\n\r\n //Joint Types\r\n /**\r\n * Distance-Joint type\r\n */\r\n public static DistanceJoint = 0;\r\n /**\r\n * Hinge-Joint type\r\n */\r\n public static HingeJoint = 1;\r\n /**\r\n * Ball-and-Socket joint type\r\n */\r\n public static BallAndSocketJoint = 2;\r\n /**\r\n * Wheel-Joint type\r\n */\r\n public static WheelJoint = 3;\r\n /**\r\n * Slider-Joint type\r\n */\r\n public static SliderJoint = 4;\r\n //OIMO\r\n /**\r\n * Prismatic-Joint type\r\n */\r\n public static PrismaticJoint = 5;\r\n //\r\n /**\r\n * Universal-Joint type\r\n * ENERGY FTW! (compare with this - @see http://ode-wiki.org/wiki/index.php?title=Manual:_Joint_Types_and_Functions)\r\n */\r\n public static UniversalJoint = 6;\r\n /**\r\n * Hinge-Joint 2 type\r\n */\r\n public static Hinge2Joint = PhysicsJoint.WheelJoint;\r\n //Cannon\r\n /**\r\n * Point to Point Joint type. Similar to a Ball-Joint. Different in parameters\r\n */\r\n public static PointToPointJoint = 8;\r\n //Cannon only at the moment\r\n /**\r\n * Spring-Joint type\r\n */\r\n public static SpringJoint = 9;\r\n /**\r\n * Lock-Joint type\r\n */\r\n public static LockJoint = 10;\r\n}\r\n\r\n/**\r\n * A class representing a physics distance joint\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport class DistanceJoint extends PhysicsJoint {\r\n /**\r\n *\r\n * @param jointData The data for the Distance-Joint\r\n */\r\n constructor(jointData: DistanceJointData) {\r\n super(PhysicsJoint.DistanceJoint, jointData);\r\n }\r\n\r\n /**\r\n * Update the predefined distance.\r\n * @param maxDistance The maximum preferred distance\r\n * @param minDistance The minimum preferred distance\r\n */\r\n public updateDistance(maxDistance: number, minDistance?: number) {\r\n this._physicsPlugin.updateDistanceJoint(this, maxDistance, minDistance);\r\n }\r\n}\r\n\r\n/**\r\n * Represents a Motor-Enabled Joint\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport class MotorEnabledJoint extends PhysicsJoint implements IMotorEnabledJoint {\r\n /**\r\n * Initializes the Motor-Enabled Joint\r\n * @param type The type of the joint\r\n * @param jointData The physical joint data for the joint\r\n */\r\n constructor(type: number, jointData: PhysicsJointData) {\r\n super(type, jointData);\r\n }\r\n\r\n /**\r\n * Set the motor values.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param force the force to apply\r\n * @param maxForce max force for this motor.\r\n */\r\n public setMotor(force?: number, maxForce?: number) {\r\n this._physicsPlugin.setMotor(this, force || 0, maxForce);\r\n }\r\n\r\n /**\r\n * Set the motor's limits.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param upperLimit The upper limit of the motor\r\n * @param lowerLimit The lower limit of the motor\r\n */\r\n public setLimit(upperLimit: number, lowerLimit?: number) {\r\n this._physicsPlugin.setLimit(this, upperLimit, lowerLimit);\r\n }\r\n}\r\n\r\n/**\r\n * This class represents a single physics Hinge-Joint\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport class HingeJoint extends MotorEnabledJoint {\r\n /**\r\n * Initializes the Hinge-Joint\r\n * @param jointData The joint data for the Hinge-Joint\r\n */\r\n constructor(jointData: PhysicsJointData) {\r\n super(PhysicsJoint.HingeJoint, jointData);\r\n }\r\n\r\n /**\r\n * Set the motor values.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param {number} force the force to apply\r\n * @param {number} maxForce max force for this motor.\r\n */\r\n public setMotor(force?: number, maxForce?: number) {\r\n this._physicsPlugin.setMotor(this, force || 0, maxForce);\r\n }\r\n\r\n /**\r\n * Set the motor's limits.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param upperLimit The upper limit of the motor\r\n * @param lowerLimit The lower limit of the motor\r\n */\r\n public setLimit(upperLimit: number, lowerLimit?: number) {\r\n this._physicsPlugin.setLimit(this, upperLimit, lowerLimit);\r\n }\r\n}\r\n\r\n/**\r\n * This class represents a dual hinge physics joint (same as wheel joint)\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport class Hinge2Joint extends MotorEnabledJoint {\r\n /**\r\n * Initializes the Hinge2-Joint\r\n * @param jointData The joint data for the Hinge2-Joint\r\n */\r\n constructor(jointData: PhysicsJointData) {\r\n super(PhysicsJoint.Hinge2Joint, jointData);\r\n }\r\n\r\n /**\r\n * Set the motor values.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param targetSpeed the speed the motor is to reach\r\n * @param maxForce max force for this motor.\r\n * @param motorIndex motor's index, 0 or 1.\r\n */\r\n public setMotor(targetSpeed?: number, maxForce?: number, motorIndex: number = 0) {\r\n this._physicsPlugin.setMotor(this, targetSpeed || 0, maxForce, motorIndex);\r\n }\r\n\r\n /**\r\n * Set the motor limits.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param upperLimit the upper limit\r\n * @param lowerLimit lower limit\r\n * @param motorIndex the motor's index, 0 or 1.\r\n */\r\n public setLimit(upperLimit: number, lowerLimit?: number, motorIndex: number = 0) {\r\n this._physicsPlugin.setLimit(this, upperLimit, lowerLimit, motorIndex);\r\n }\r\n}\r\n\r\n/**\r\n * Interface for a motor enabled joint\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport interface IMotorEnabledJoint {\r\n /**\r\n * Physics joint\r\n */\r\n physicsJoint: any;\r\n /**\r\n * Sets the motor of the motor-enabled joint\r\n * @param force The force of the motor\r\n * @param maxForce The maximum force of the motor\r\n * @param motorIndex The index of the motor\r\n */\r\n setMotor(force?: number, maxForce?: number, motorIndex?: number): void;\r\n /**\r\n * Sets the limit of the motor\r\n * @param upperLimit The upper limit of the motor\r\n * @param lowerLimit The lower limit of the motor\r\n * @param motorIndex The index of the motor\r\n */\r\n setLimit(upperLimit: number, lowerLimit?: number, motorIndex?: number): void;\r\n}\r\n\r\n/**\r\n * Joint data for a Distance-Joint\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport interface DistanceJointData extends PhysicsJointData {\r\n /**\r\n * Max distance the 2 joint objects can be apart\r\n */\r\n maxDistance: number;\r\n //Oimo - minDistance\r\n //Cannon - maxForce\r\n}\r\n\r\n/**\r\n * Joint data from a spring joint\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport interface SpringJointData extends PhysicsJointData {\r\n /**\r\n * Length of the spring\r\n */\r\n length: number;\r\n /**\r\n * Stiffness of the spring\r\n */\r\n stiffness: number;\r\n /**\r\n * Damping of the spring\r\n */\r\n damping: number;\r\n /** this callback will be called when applying the force to the impostors. */\r\n forceApplicationCallback: () => void;\r\n}\r\n"]}
1
+ {"version":3,"file":"physicsJoint.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/physicsJoint.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAIrB;;;;OAIG;IACH;IACI;;OAEG;IACI,IAAY;IACnB;;OAEG;IACI,SAA2B;QAJ3B,SAAI,GAAJ,IAAI,CAAQ;QAIZ,cAAS,GAAT,SAAS,CAAkB;QAElC,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,YAAY,CAAC,QAAa;QACjC,IAAI,IAAI,CAAC,aAAa,EAAE;YACpB,uBAAuB;SAC1B;QAED,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,aAAa,CAAC,aAAmC;QACxD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,qBAAqB,CAAC,IAA6C;QACtE,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACxD,CAAC;;AAED,8CAA8C;AAE9C,aAAa;AACb;;GAEG;AACW,0BAAa,GAAG,CAAC,C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C,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAC7C;;;OAGG;IACH,YAAY,SAA2B;QACnC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,KAAc,EAAE,QAAiB;QAC7C,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,UAAkB,EAAE,UAAmB;QACnD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAC9C;;;OAGG;IACH,YAAY,SAA2B;QACnC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACI,QAAQ,CAAC,WAAoB,EAAE,QAAiB,EAAE,aAAqB,CAAC;QAC3E,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,IAAI,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;OAMG;IACI,QAAQ,CAAC,UAAkB,EAAE,UAAmB,EAAE,aAAqB,CAAC;QAC3E,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAC3E,CAAC;CACJ","sourcesContent":["import type { Vector3 } from \"../Maths/math.vector\";\r\nimport type { IPhysicsEnginePlugin } from \"./IPhysicsEngine\";\r\n/**\r\n * Interface for Physics-Joint data\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface PhysicsJointData {\r\n //Important for some engines, optional!\r\n /**\r\n * The main pivot of the joint\r\n */\r\n mainPivot?: Vector3;\r\n /**\r\n * The connected pivot of the joint\r\n */\r\n connectedPivot?: Vector3;\r\n /**\r\n * The main axis of the joint\r\n */\r\n mainAxis?: Vector3;\r\n /**\r\n * The connected axis of the joint\r\n */\r\n connectedAxis?: Vector3;\r\n /**\r\n * The collision of the joint\r\n */\r\n collision?: boolean;\r\n /**\r\n * Native Oimo/Cannon/Energy data\r\n */\r\n nativeParams?: any;\r\n}\r\n\r\n/**\r\n * This is a holder class for the physics joint created by the physics plugin\r\n * It holds a set of functions to control the underlying joint\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class PhysicsJoint {\r\n private _physicsJoint: any;\r\n protected _physicsPlugin: IPhysicsEnginePlugin;\r\n\r\n /**\r\n * Initializes the physics joint\r\n * @param type The type of the physics joint\r\n * @param jointData The data for the physics joint\r\n */\r\n constructor(\r\n /**\r\n * The type of the physics joint\r\n */\r\n public type: number,\r\n /**\r\n * The data for the physics joint\r\n */\r\n public jointData: PhysicsJointData\r\n ) {\r\n jointData.nativeParams = jointData.nativeParams || {};\r\n }\r\n\r\n /**\r\n * Gets the physics joint\r\n */\r\n public get physicsJoint(): any {\r\n return this._physicsJoint;\r\n }\r\n\r\n /**\r\n * Sets the physics joint\r\n */\r\n public set physicsJoint(newJoint: any) {\r\n if (this._physicsJoint) {\r\n //remove from the world\r\n }\r\n\r\n this._physicsJoint = newJoint;\r\n }\r\n\r\n /**\r\n * Sets the physics plugin\r\n */\r\n public set physicsPlugin(physicsPlugin: IPhysicsEnginePlugin) {\r\n this._physicsPlugin = physicsPlugin;\r\n }\r\n\r\n /**\r\n * Execute a function that is physics-plugin specific.\r\n * @param {Function} func the function that will be executed.\r\n * It accepts two parameters: the physics world and the physics joint\r\n */\r\n public executeNativeFunction(func: (world: any, physicsJoint: any) => void) {\r\n func(this._physicsPlugin.world, this._physicsJoint);\r\n }\r\n\r\n //TODO check if the native joints are the same\r\n\r\n //Joint Types\r\n /**\r\n * Distance-Joint type\r\n */\r\n public static DistanceJoint = 0;\r\n /**\r\n * Hinge-Joint type\r\n */\r\n public static HingeJoint = 1;\r\n /**\r\n * Ball-and-Socket joint type\r\n */\r\n public static BallAndSocketJoint = 2;\r\n /**\r\n * Wheel-Joint type\r\n */\r\n public static WheelJoint = 3;\r\n /**\r\n * Slider-Joint type\r\n */\r\n public static SliderJoint = 4;\r\n //OIMO\r\n /**\r\n * Prismatic-Joint type\r\n */\r\n public static PrismaticJoint = 5;\r\n //\r\n /**\r\n * Universal-Joint type\r\n * ENERGY FTW! (compare with this - @see http://ode-wiki.org/wiki/index.php?title=Manual:_Joint_Types_and_Functions)\r\n */\r\n public static UniversalJoint = 6;\r\n /**\r\n * Hinge-Joint 2 type\r\n */\r\n public static Hinge2Joint = PhysicsJoint.WheelJoint;\r\n //Cannon\r\n /**\r\n * Point to Point Joint type. Similar to a Ball-Joint. Different in parameters\r\n */\r\n public static PointToPointJoint = 8;\r\n //Cannon only at the moment\r\n /**\r\n * Spring-Joint type\r\n */\r\n public static SpringJoint = 9;\r\n /**\r\n * Lock-Joint type\r\n */\r\n public static LockJoint = 10;\r\n}\r\n\r\n/**\r\n * A class representing a physics distance joint\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class DistanceJoint extends PhysicsJoint {\r\n /**\r\n *\r\n * @param jointData The data for the Distance-Joint\r\n */\r\n constructor(jointData: DistanceJointData) {\r\n super(PhysicsJoint.DistanceJoint, jointData);\r\n }\r\n\r\n /**\r\n * Update the predefined distance.\r\n * @param maxDistance The maximum preferred distance\r\n * @param minDistance The minimum preferred distance\r\n */\r\n public updateDistance(maxDistance: number, minDistance?: number) {\r\n this._physicsPlugin.updateDistanceJoint(this, maxDistance, minDistance);\r\n }\r\n}\r\n\r\n/**\r\n * Represents a Motor-Enabled Joint\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class MotorEnabledJoint extends PhysicsJoint implements IMotorEnabledJoint {\r\n /**\r\n * Initializes the Motor-Enabled Joint\r\n * @param type The type of the joint\r\n * @param jointData The physical joint data for the joint\r\n */\r\n constructor(type: number, jointData: PhysicsJointData) {\r\n super(type, jointData);\r\n }\r\n\r\n /**\r\n * Set the motor values.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param force the force to apply\r\n * @param maxForce max force for this motor.\r\n */\r\n public setMotor(force?: number, maxForce?: number) {\r\n this._physicsPlugin.setMotor(this, force || 0, maxForce);\r\n }\r\n\r\n /**\r\n * Set the motor's limits.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param upperLimit The upper limit of the motor\r\n * @param lowerLimit The lower limit of the motor\r\n */\r\n public setLimit(upperLimit: number, lowerLimit?: number) {\r\n this._physicsPlugin.setLimit(this, upperLimit, lowerLimit);\r\n }\r\n}\r\n\r\n/**\r\n * This class represents a single physics Hinge-Joint\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class HingeJoint extends MotorEnabledJoint {\r\n /**\r\n * Initializes the Hinge-Joint\r\n * @param jointData The joint data for the Hinge-Joint\r\n */\r\n constructor(jointData: PhysicsJointData) {\r\n super(PhysicsJoint.HingeJoint, jointData);\r\n }\r\n\r\n /**\r\n * Set the motor values.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param {number} force the force to apply\r\n * @param {number} maxForce max force for this motor.\r\n */\r\n public setMotor(force?: number, maxForce?: number) {\r\n this._physicsPlugin.setMotor(this, force || 0, maxForce);\r\n }\r\n\r\n /**\r\n * Set the motor's limits.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param upperLimit The upper limit of the motor\r\n * @param lowerLimit The lower limit of the motor\r\n */\r\n public setLimit(upperLimit: number, lowerLimit?: number) {\r\n this._physicsPlugin.setLimit(this, upperLimit, lowerLimit);\r\n }\r\n}\r\n\r\n/**\r\n * This class represents a dual hinge physics joint (same as wheel joint)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class Hinge2Joint extends MotorEnabledJoint {\r\n /**\r\n * Initializes the Hinge2-Joint\r\n * @param jointData The joint data for the Hinge2-Joint\r\n */\r\n constructor(jointData: PhysicsJointData) {\r\n super(PhysicsJoint.Hinge2Joint, jointData);\r\n }\r\n\r\n /**\r\n * Set the motor values.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param targetSpeed the speed the motor is to reach\r\n * @param maxForce max force for this motor.\r\n * @param motorIndex motor's index, 0 or 1.\r\n */\r\n public setMotor(targetSpeed?: number, maxForce?: number, motorIndex: number = 0) {\r\n this._physicsPlugin.setMotor(this, targetSpeed || 0, maxForce, motorIndex);\r\n }\r\n\r\n /**\r\n * Set the motor limits.\r\n * Attention, this function is plugin specific. Engines won't react 100% the same.\r\n * @param upperLimit the upper limit\r\n * @param lowerLimit lower limit\r\n * @param motorIndex the motor's index, 0 or 1.\r\n */\r\n public setLimit(upperLimit: number, lowerLimit?: number, motorIndex: number = 0) {\r\n this._physicsPlugin.setLimit(this, upperLimit, lowerLimit, motorIndex);\r\n }\r\n}\r\n\r\n/**\r\n * Interface for a motor enabled joint\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface IMotorEnabledJoint {\r\n /**\r\n * Physics joint\r\n */\r\n physicsJoint: any;\r\n /**\r\n * Sets the motor of the motor-enabled joint\r\n * @param force The force of the motor\r\n * @param maxForce The maximum force of the motor\r\n * @param motorIndex The index of the motor\r\n */\r\n setMotor(force?: number, maxForce?: number, motorIndex?: number): void;\r\n /**\r\n * Sets the limit of the motor\r\n * @param upperLimit The upper limit of the motor\r\n * @param lowerLimit The lower limit of the motor\r\n * @param motorIndex The index of the motor\r\n */\r\n setLimit(upperLimit: number, lowerLimit?: number, motorIndex?: number): void;\r\n}\r\n\r\n/**\r\n * Joint data for a Distance-Joint\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface DistanceJointData extends PhysicsJointData {\r\n /**\r\n * Max distance the 2 joint objects can be apart\r\n */\r\n maxDistance: number;\r\n //Oimo - minDistance\r\n //Cannon - maxForce\r\n}\r\n\r\n/**\r\n * Joint data from a spring joint\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface SpringJointData extends PhysicsJointData {\r\n /**\r\n * Length of the spring\r\n */\r\n length: number;\r\n /**\r\n * Stiffness of the spring\r\n */\r\n stiffness: number;\r\n /**\r\n * Damping of the spring\r\n */\r\n damping: number;\r\n /** this callback will be called when applying the force to the impostors. */\r\n forceApplicationCallback: () => void;\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
1
  import { Vector3 } from "../Maths/math.vector";
2
2
  /**
3
3
  * Holds the data for the raycast result
4
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
4
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
5
5
  */
6
6
  export declare class PhysicsRaycastResult {
7
7
  private _hasHit;
@@ -1,7 +1,7 @@
1
1
  import { Vector3 } from "../Maths/math.vector.js";
2
2
  /**
3
3
  * Holds the data for the raycast result
4
- * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
4
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine
5
5
  */
6
6
  export class PhysicsRaycastResult {
7
7
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"physicsRaycastResult.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/physicsRaycastResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C;;;GAGG;AACH,MA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BAAoB;QACvB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAgB,OAAO,CAAC,IAAI,EAAE,EAAE,KAAc,OAAO,CAAC,IAAI,EAAE;QACrE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QAEtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QAEtB,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzC,CAAC;CACJ","sourcesContent":["import { Vector3 } from \"../Maths/math.vector\";\r\n\r\n/**\r\n * Holds the data for the raycast result\r\n * @see https://doc.babylonjs.com/how_to/using_the_physics_engine\r\n */\r\nexport class PhysicsRaycastResult {\r\n private _hasHit: boolean = false;\r\n\r\n private _hitDistance: number = 0;\r\n private _hitNormalWorld: Vector3 = Vector3.Zero();\r\n private _hitPointWorld: Vector3 = Vector3.Zero();\r\n private _rayFromWorld: Vector3 = Vector3.Zero();\r\n private _rayToWorld: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Gets if there was a hit\r\n */\r\n get hasHit(): boolean {\r\n return this._hasHit;\r\n }\r\n\r\n /**\r\n * Gets the distance from the hit\r\n */\r\n get hitDistance(): number {\r\n return this._hitDistance;\r\n }\r\n\r\n /**\r\n * Gets the hit normal/direction in the world\r\n */\r\n get hitNormalWorld(): Vector3 {\r\n return this._hitNormalWorld;\r\n }\r\n\r\n /**\r\n * Gets the hit point in the world\r\n */\r\n get hitPointWorld(): Vector3 {\r\n return this._hitPointWorld;\r\n }\r\n\r\n /**\r\n * Gets the ray \"start point\" of the ray in the world\r\n */\r\n get rayFromWorld(): Vector3 {\r\n return this._rayFromWorld;\r\n }\r\n\r\n /**\r\n * Gets the ray \"end point\" of the ray in the world\r\n */\r\n get rayToWorld(): Vector3 {\r\n return this._rayToWorld;\r\n }\r\n\r\n /**\r\n * Sets the hit data (normal & point in world space)\r\n * @param hitNormalWorld defines the normal in world space\r\n * @param hitPointWorld defines the point in world space\r\n */\r\n public setHitData(hitNormalWorld: IXYZ, hitPointWorld: IXYZ) {\r\n this._hasHit = true;\r\n this._hitNormalWorld = new Vector3(hitNormalWorld.x, hitNormalWorld.y, hitNormalWorld.z);\r\n this._hitPointWorld = new Vector3(hitPointWorld.x, hitPointWorld.y, hitPointWorld.z);\r\n }\r\n\r\n /**\r\n * Sets the distance from the start point to the hit point\r\n * @param distance\r\n */\r\n public setHitDistance(distance: number) {\r\n this._hitDistance = distance;\r\n }\r\n\r\n /**\r\n * Calculates the distance manually\r\n */\r\n public calculateHitDistance() {\r\n this._hitDistance = Vector3.Distance(this._rayFromWorld, this._hitPointWorld);\r\n }\r\n\r\n /**\r\n * Resets all the values to default\r\n * @param from The from point on world space\r\n * @param to The to point on world space\r\n */\r\n public reset(from: Vector3 = Vector3.Zero(), to: Vector3 = Vector3.Zero()) {\r\n this._rayFromWorld = from;\r\n this._rayToWorld = to;\r\n\r\n this._hasHit = false;\r\n this._hitDistance = 0;\r\n\r\n this._hitNormalWorld = Vector3.Zero();\r\n this._hitPointWorld = Vector3.Zero();\r\n }\r\n}\r\n\r\n/**\r\n * Interface for the size containing width and height\r\n */\r\ninterface IXYZ {\r\n /**\r\n * X\r\n */\r\n x: number;\r\n\r\n /**\r\n * Y\r\n */\r\n y: number;\r\n\r\n /**\r\n * Z\r\n */\r\n z: number;\r\n}\r\n"]}
1
+ {"version":3,"file":"physicsRaycastResult.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/physicsRaycastResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C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AED;;OAEG;IACI,oBAAoB;QACvB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAClF,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAgB,OAAO,CAAC,IAAI,EAAE,EAAE,KAAc,OAAO,CAAC,IAAI,EAAE;QACrE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QAEtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QAEtB,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzC,CAAC;CACJ","sourcesContent":["import { Vector3 } from \"../Maths/math.vector\";\r\n\r\n/**\r\n * Holds the data for the raycast result\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class PhysicsRaycastResult {\r\n private _hasHit: boolean = false;\r\n\r\n private _hitDistance: number = 0;\r\n private _hitNormalWorld: Vector3 = Vector3.Zero();\r\n private _hitPointWorld: Vector3 = Vector3.Zero();\r\n private _rayFromWorld: Vector3 = Vector3.Zero();\r\n private _rayToWorld: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Gets if there was a hit\r\n */\r\n get hasHit(): boolean {\r\n return this._hasHit;\r\n }\r\n\r\n /**\r\n * Gets the distance from the hit\r\n */\r\n get hitDistance(): number {\r\n return this._hitDistance;\r\n }\r\n\r\n /**\r\n * Gets the hit normal/direction in the world\r\n */\r\n get hitNormalWorld(): Vector3 {\r\n return this._hitNormalWorld;\r\n }\r\n\r\n /**\r\n * Gets the hit point in the world\r\n */\r\n get hitPointWorld(): Vector3 {\r\n return this._hitPointWorld;\r\n }\r\n\r\n /**\r\n * Gets the ray \"start point\" of the ray in the world\r\n */\r\n get rayFromWorld(): Vector3 {\r\n return this._rayFromWorld;\r\n }\r\n\r\n /**\r\n * Gets the ray \"end point\" of the ray in the world\r\n */\r\n get rayToWorld(): Vector3 {\r\n return this._rayToWorld;\r\n }\r\n\r\n /**\r\n * Sets the hit data (normal & point in world space)\r\n * @param hitNormalWorld defines the normal in world space\r\n * @param hitPointWorld defines the point in world space\r\n */\r\n public setHitData(hitNormalWorld: IXYZ, hitPointWorld: IXYZ) {\r\n this._hasHit = true;\r\n this._hitNormalWorld = new Vector3(hitNormalWorld.x, hitNormalWorld.y, hitNormalWorld.z);\r\n this._hitPointWorld = new Vector3(hitPointWorld.x, hitPointWorld.y, hitPointWorld.z);\r\n }\r\n\r\n /**\r\n * Sets the distance from the start point to the hit point\r\n * @param distance\r\n */\r\n public setHitDistance(distance: number) {\r\n this._hitDistance = distance;\r\n }\r\n\r\n /**\r\n * Calculates the distance manually\r\n */\r\n public calculateHitDistance() {\r\n this._hitDistance = Vector3.Distance(this._rayFromWorld, this._hitPointWorld);\r\n }\r\n\r\n /**\r\n * Resets all the values to default\r\n * @param from The from point on world space\r\n * @param to The to point on world space\r\n */\r\n public reset(from: Vector3 = Vector3.Zero(), to: Vector3 = Vector3.Zero()) {\r\n this._rayFromWorld = from;\r\n this._rayToWorld = to;\r\n\r\n this._hasHit = false;\r\n this._hitDistance = 0;\r\n\r\n this._hitNormalWorld = Vector3.Zero();\r\n this._hitPointWorld = Vector3.Zero();\r\n }\r\n}\r\n\r\n/**\r\n * Interface for the size containing width and height\r\n */\r\ninterface IXYZ {\r\n /**\r\n * X\r\n */\r\n x: number;\r\n\r\n /**\r\n * Y\r\n */\r\n y: number;\r\n\r\n /**\r\n * Z\r\n */\r\n z: number;\r\n}\r\n"]}
@@ -15,7 +15,7 @@ import "../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSc
15
15
  declare type Animation = import("../../../Animations/animation").Animation;
16
16
  /**
17
17
  * The default rendering pipeline can be added to a scene to apply common post processing effects such as anti-aliasing or depth of field.
18
- * See https://doc.babylonjs.com/how_to/using_default_rendering_pipeline
18
+ * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/defaultRenderingPipeline
19
19
  */
20
20
  export declare class DefaultRenderingPipeline extends PostProcessRenderPipeline implements IDisposable, IAnimatable {
21
21
  private _scene;