@babylonjs/core 5.32.0 → 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 (636) 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/effectRenderer.js +1 -0
  377. package/Materials/effectRenderer.js.map +1 -1
  378. package/Materials/fresnelParameters.d.ts +1 -1
  379. package/Materials/fresnelParameters.js +1 -1
  380. package/Materials/fresnelParameters.js.map +1 -1
  381. package/Materials/material.d.ts +1 -1
  382. package/Materials/material.js.map +1 -1
  383. package/Materials/multiMaterial.d.ts +2 -2
  384. package/Materials/multiMaterial.js +2 -2
  385. package/Materials/multiMaterial.js.map +1 -1
  386. package/Materials/shaderMaterial.d.ts +2 -2
  387. package/Materials/shaderMaterial.js +2 -2
  388. package/Materials/shaderMaterial.js.map +1 -1
  389. package/Materials/shadowDepthWrapper.d.ts +1 -1
  390. package/Materials/shadowDepthWrapper.js +2 -2
  391. package/Materials/shadowDepthWrapper.js.map +1 -1
  392. package/Materials/standardMaterial.d.ts +18 -18
  393. package/Materials/standardMaterial.js +6 -6
  394. package/Materials/standardMaterial.js.map +1 -1
  395. package/Maths/math.path.d.ts +7 -7
  396. package/Maths/math.path.js +7 -7
  397. package/Maths/math.path.js.map +1 -1
  398. package/Maths/math.vector.d.ts +4 -4
  399. package/Maths/math.vector.js +4 -4
  400. package/Maths/math.vector.js.map +1 -1
  401. package/Meshes/Builders/boxBuilder.d.ts +3 -3
  402. package/Meshes/Builders/boxBuilder.js +3 -3
  403. package/Meshes/Builders/boxBuilder.js.map +1 -1
  404. package/Meshes/Builders/capsuleBuilder.d.ts +1 -1
  405. package/Meshes/Builders/capsuleBuilder.js +1 -1
  406. package/Meshes/Builders/capsuleBuilder.js.map +1 -1
  407. package/Meshes/Builders/cylinderBuilder.d.ts +2 -2
  408. package/Meshes/Builders/cylinderBuilder.js +2 -2
  409. package/Meshes/Builders/cylinderBuilder.js.map +1 -1
  410. package/Meshes/Builders/decalBuilder.d.ts +1 -1
  411. package/Meshes/Builders/decalBuilder.js +1 -1
  412. package/Meshes/Builders/decalBuilder.js.map +1 -1
  413. package/Meshes/Builders/discBuilder.d.ts +2 -2
  414. package/Meshes/Builders/discBuilder.js +2 -2
  415. package/Meshes/Builders/discBuilder.js.map +1 -1
  416. package/Meshes/Builders/geodesicBuilder.d.ts +1 -1
  417. package/Meshes/Builders/geodesicBuilder.js +1 -1
  418. package/Meshes/Builders/geodesicBuilder.js.map +1 -1
  419. package/Meshes/Builders/goldbergBuilder.d.ts +1 -1
  420. package/Meshes/Builders/goldbergBuilder.js +1 -1
  421. package/Meshes/Builders/goldbergBuilder.js.map +1 -1
  422. package/Meshes/Builders/groundBuilder.d.ts +4 -4
  423. package/Meshes/Builders/groundBuilder.js +4 -4
  424. package/Meshes/Builders/groundBuilder.js.map +1 -1
  425. package/Meshes/Builders/icoSphereBuilder.d.ts +2 -2
  426. package/Meshes/Builders/icoSphereBuilder.js +2 -2
  427. package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
  428. package/Meshes/Builders/latheBuilder.d.ts +2 -2
  429. package/Meshes/Builders/latheBuilder.js +2 -2
  430. package/Meshes/Builders/latheBuilder.js.map +1 -1
  431. package/Meshes/Builders/linesBuilder.d.ts +6 -6
  432. package/Meshes/Builders/linesBuilder.js +6 -6
  433. package/Meshes/Builders/linesBuilder.js.map +1 -1
  434. package/Meshes/Builders/planeBuilder.d.ts +2 -2
  435. package/Meshes/Builders/planeBuilder.js +2 -2
  436. package/Meshes/Builders/planeBuilder.js.map +1 -1
  437. package/Meshes/Builders/polygonBuilder.d.ts +1 -1
  438. package/Meshes/Builders/polygonBuilder.js +1 -1
  439. package/Meshes/Builders/polygonBuilder.js.map +1 -1
  440. package/Meshes/Builders/polyhedronBuilder.d.ts +3 -3
  441. package/Meshes/Builders/polyhedronBuilder.js +3 -3
  442. package/Meshes/Builders/polyhedronBuilder.js.map +1 -1
  443. package/Meshes/Builders/ribbonBuilder.d.ts +4 -4
  444. package/Meshes/Builders/ribbonBuilder.js +4 -4
  445. package/Meshes/Builders/ribbonBuilder.js.map +1 -1
  446. package/Meshes/Builders/shapeBuilder.d.ts +9 -9
  447. package/Meshes/Builders/shapeBuilder.js +9 -9
  448. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  449. package/Meshes/Builders/sphereBuilder.d.ts +2 -2
  450. package/Meshes/Builders/sphereBuilder.js +2 -2
  451. package/Meshes/Builders/sphereBuilder.js.map +1 -1
  452. package/Meshes/Builders/tiledBoxBuilder.d.ts +2 -2
  453. package/Meshes/Builders/tiledBoxBuilder.js +2 -2
  454. package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
  455. package/Meshes/Builders/tiledPlaneBuilder.d.ts +2 -2
  456. package/Meshes/Builders/tiledPlaneBuilder.js +2 -2
  457. package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
  458. package/Meshes/Builders/torusBuilder.d.ts +2 -2
  459. package/Meshes/Builders/torusBuilder.js +2 -2
  460. package/Meshes/Builders/torusBuilder.js.map +1 -1
  461. package/Meshes/Builders/torusKnotBuilder.d.ts +2 -2
  462. package/Meshes/Builders/torusKnotBuilder.js +2 -2
  463. package/Meshes/Builders/torusKnotBuilder.js.map +1 -1
  464. package/Meshes/Builders/tubeBuilder.d.ts +4 -4
  465. package/Meshes/Builders/tubeBuilder.js +4 -4
  466. package/Meshes/Builders/tubeBuilder.js.map +1 -1
  467. package/Meshes/abstractMesh.d.ts +35 -35
  468. package/Meshes/abstractMesh.js +34 -34
  469. package/Meshes/abstractMesh.js.map +1 -1
  470. package/Meshes/instancedMesh.d.ts +3 -3
  471. package/Meshes/instancedMesh.js +1 -1
  472. package/Meshes/instancedMesh.js.map +1 -1
  473. package/Meshes/linesMesh.d.ts +2 -2
  474. package/Meshes/linesMesh.js +2 -2
  475. package/Meshes/linesMesh.js.map +1 -1
  476. package/Meshes/mesh.d.ts +36 -36
  477. package/Meshes/mesh.js +9 -17
  478. package/Meshes/mesh.js.map +1 -1
  479. package/Meshes/meshLODLevel.d.ts +1 -1
  480. package/Meshes/meshLODLevel.js +1 -1
  481. package/Meshes/meshLODLevel.js.map +1 -1
  482. package/Meshes/meshSimplification.d.ts +6 -6
  483. package/Meshes/meshSimplification.js +4 -4
  484. package/Meshes/meshSimplification.js.map +1 -1
  485. package/Meshes/meshSimplificationSceneComponent.d.ts +1 -1
  486. package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
  487. package/Meshes/polygonMesh.d.ts +2 -2
  488. package/Meshes/polygonMesh.js +2 -2
  489. package/Meshes/polygonMesh.js.map +1 -1
  490. package/Meshes/transformNode.d.ts +1 -1
  491. package/Meshes/transformNode.js +1 -1
  492. package/Meshes/transformNode.js.map +1 -1
  493. package/Misc/assetsManager.d.ts +2 -2
  494. package/Misc/assetsManager.js +2 -2
  495. package/Misc/assetsManager.js.map +1 -1
  496. package/Misc/iInspectable.d.ts +1 -1
  497. package/Misc/iInspectable.js.map +1 -1
  498. package/Misc/sceneOptimizer.d.ts +12 -12
  499. package/Misc/sceneOptimizer.js +12 -12
  500. package/Misc/sceneOptimizer.js.map +1 -1
  501. package/Misc/screenshotTools.d.ts +10 -10
  502. package/Misc/screenshotTools.js +10 -10
  503. package/Misc/screenshotTools.js.map +1 -1
  504. package/Misc/tools.d.ts +4 -4
  505. package/Misc/tools.js +4 -4
  506. package/Misc/tools.js.map +1 -1
  507. package/Misc/videoRecorder.d.ts +1 -1
  508. package/Misc/videoRecorder.js +1 -1
  509. package/Misc/videoRecorder.js.map +1 -1
  510. package/Morph/morphTarget.d.ts +1 -1
  511. package/Morph/morphTarget.js +1 -1
  512. package/Morph/morphTarget.js.map +1 -1
  513. package/Morph/morphTargetManager.d.ts +1 -1
  514. package/Morph/morphTargetManager.js +1 -1
  515. package/Morph/morphTargetManager.js.map +1 -1
  516. package/Offline/IOfflineProvider.d.ts +1 -1
  517. package/Offline/IOfflineProvider.js.map +1 -1
  518. package/Offline/database.d.ts +1 -1
  519. package/Offline/database.js +1 -1
  520. package/Offline/database.js.map +1 -1
  521. package/Particles/IParticleSystem.d.ts +1 -1
  522. package/Particles/IParticleSystem.js.map +1 -1
  523. package/Particles/baseParticleSystem.d.ts +1 -1
  524. package/Particles/baseParticleSystem.js +1 -1
  525. package/Particles/baseParticleSystem.js.map +1 -1
  526. package/Particles/gpuParticleSystem.d.ts +1 -1
  527. package/Particles/gpuParticleSystem.js +1 -1
  528. package/Particles/gpuParticleSystem.js.map +1 -1
  529. package/Particles/particleSystem.d.ts +2 -2
  530. package/Particles/particleSystem.js +2 -2
  531. package/Particles/particleSystem.js.map +1 -1
  532. package/Particles/solidParticleSystem.d.ts +15 -15
  533. package/Particles/solidParticleSystem.js +13 -13
  534. package/Particles/solidParticleSystem.js.map +1 -1
  535. package/Physics/IPhysicsEngine.d.ts +1 -1
  536. package/Physics/IPhysicsEngine.js.map +1 -1
  537. package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
  538. package/Physics/Plugins/ammoJSPlugin.js +1 -1
  539. package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
  540. package/Physics/physicsEngine.d.ts +1 -1
  541. package/Physics/physicsEngine.js +1 -1
  542. package/Physics/physicsEngine.js.map +1 -1
  543. package/Physics/physicsEngineComponent.d.ts +3 -3
  544. package/Physics/physicsEngineComponent.js +2 -2
  545. package/Physics/physicsEngineComponent.js.map +1 -1
  546. package/Physics/physicsHelper.d.ts +12 -12
  547. package/Physics/physicsHelper.js +6 -6
  548. package/Physics/physicsHelper.js.map +1 -1
  549. package/Physics/physicsImpostor.d.ts +3 -3
  550. package/Physics/physicsImpostor.js +1 -1
  551. package/Physics/physicsImpostor.js.map +1 -1
  552. package/Physics/physicsJoint.d.ts +9 -9
  553. package/Physics/physicsJoint.js +5 -5
  554. package/Physics/physicsJoint.js.map +1 -1
  555. package/Physics/physicsRaycastResult.d.ts +1 -1
  556. package/Physics/physicsRaycastResult.js +1 -1
  557. package/Physics/physicsRaycastResult.js.map +1 -1
  558. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +1 -1
  559. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +1 -1
  560. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  561. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.d.ts +1 -1
  562. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +1 -1
  563. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  564. package/PostProcesses/RenderPipeline/postProcessRenderEffect.d.ts +1 -1
  565. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js +1 -1
  566. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js.map +1 -1
  567. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +2 -2
  568. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +1 -1
  569. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  570. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.d.ts +2 -2
  571. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js +2 -2
  572. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js.map +1 -1
  573. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.d.ts +2 -2
  574. package/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js.map +1 -1
  575. package/PostProcesses/blackAndWhitePostProcess.d.ts +1 -1
  576. package/PostProcesses/blackAndWhitePostProcess.js +1 -1
  577. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  578. package/PostProcesses/fxaaPostProcess.d.ts +1 -1
  579. package/PostProcesses/fxaaPostProcess.js +1 -1
  580. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  581. package/PostProcesses/highlightsPostProcess.d.ts +2 -2
  582. package/PostProcesses/highlightsPostProcess.js +2 -2
  583. package/PostProcesses/highlightsPostProcess.js.map +1 -1
  584. package/PostProcesses/imageProcessingPostProcess.d.ts +1 -1
  585. package/PostProcesses/imageProcessingPostProcess.js +1 -1
  586. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  587. package/PostProcesses/postProcess.d.ts +2 -2
  588. package/PostProcesses/postProcess.js +1 -1
  589. package/PostProcesses/postProcess.js.map +1 -1
  590. package/PostProcesses/postProcessManager.d.ts +1 -1
  591. package/PostProcesses/postProcessManager.js +1 -1
  592. package/PostProcesses/postProcessManager.js.map +1 -1
  593. package/PostProcesses/refractionPostProcess.d.ts +2 -2
  594. package/PostProcesses/refractionPostProcess.js +2 -2
  595. package/PostProcesses/refractionPostProcess.js.map +1 -1
  596. package/Probes/reflectionProbe.d.ts +2 -2
  597. package/Probes/reflectionProbe.js +1 -1
  598. package/Probes/reflectionProbe.js.map +1 -1
  599. package/Rendering/geometryBufferRenderer.js +2 -2
  600. package/Rendering/geometryBufferRenderer.js.map +1 -1
  601. package/Sprites/sprite.d.ts +1 -1
  602. package/Sprites/sprite.js +1 -1
  603. package/Sprites/sprite.js.map +1 -1
  604. package/Sprites/spriteManager.d.ts +2 -2
  605. package/Sprites/spriteManager.js +1 -1
  606. package/Sprites/spriteManager.js.map +1 -1
  607. package/Sprites/spritePackedManager.d.ts +1 -1
  608. package/Sprites/spritePackedManager.js +1 -1
  609. package/Sprites/spritePackedManager.js.map +1 -1
  610. package/Sprites/spriteSceneComponent.d.ts +1 -1
  611. package/Sprites/spriteSceneComponent.js.map +1 -1
  612. package/Sprites/thinSprite.d.ts +1 -1
  613. package/Sprites/thinSprite.js +1 -1
  614. package/Sprites/thinSprite.js.map +1 -1
  615. package/XR/webXRCamera.d.ts +1 -1
  616. package/XR/webXRCamera.js +1 -1
  617. package/XR/webXRCamera.js.map +1 -1
  618. package/XR/webXRExperienceHelper.d.ts +1 -1
  619. package/XR/webXRExperienceHelper.js +1 -1
  620. package/XR/webXRExperienceHelper.js.map +1 -1
  621. package/XR/webXRInputSource.d.ts +1 -1
  622. package/XR/webXRInputSource.js +1 -1
  623. package/XR/webXRInputSource.js.map +1 -1
  624. package/XR/webXRSessionManager.d.ts +1 -1
  625. package/XR/webXRSessionManager.js +1 -1
  626. package/XR/webXRSessionManager.js.map +1 -1
  627. package/abstractScene.d.ts +9 -9
  628. package/abstractScene.js +9 -9
  629. package/abstractScene.js.map +1 -1
  630. package/node.d.ts +6 -6
  631. package/node.js +5 -5
  632. package/node.js.map +1 -1
  633. package/package.json +1 -1
  634. package/scene.d.ts +29 -24
  635. package/scene.js +24 -18
  636. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"shapeBuilder.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Meshes/Builders/shapeBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,YAAY,CACxB,IAAY,EACZ,OAgBC,EACD,QAAyB,IAAI;IAE7B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC;IAC/D,MAAM,SAAS,GAAG,O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EAAE,gBAAgB;QAClC,eAAe,EAAE,eAAe;QAChC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM;QACvC,eAAe,EAAE,eAAe;QAChC,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,SAAS;KACvB,CAAC;IAEF,OAAO,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACpD,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3, TmpVectors, Matrix } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { CreateRibbon } from \"./ribbonBuilder\";\r\nimport { Path3D } from \"../../Maths/math.path\";\r\n\r\n/**\r\n * Creates an extruded shape mesh. The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.\r\n * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis.\r\n * * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.\r\n * * The parameter `rotation` (float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve.\r\n * * The parameter `scale` (float, default 1) is the value to scale the shape.\r\n * * The parameter `closeShape` (boolean, default false) closes the shape when true, since v5.0.0.\r\n * * The parameter `closePath` (boolean, default false) closes the path when true and no caps, since v5.0.0.\r\n * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL\r\n * * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : https://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh#extruded-shape\r\n * * Remember you can only change the shape or path point positions, not their number when updating an extruded shape.\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation\r\n * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.\r\n * * The optional parameter `firstNormal` (Vector3) defines the direction of the first normal of the supplied path. Consider using this for any path that is straight, and particular for paths in the xy plane.\r\n * * The optional `adjustFrame` (boolean, default false) will cause the internally generated Path3D tangents, normals, and binormals to be adjusted so that a) they are always well-defined, and b) they do not reverse from one path point to the next. This prevents the extruded shape from being flipped and/or rotated with resulting mesh self-intersections. This is primarily useful for straight paths that can reverse direction.\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.shape\r\n * @param options.path\r\n * @param options.scale\r\n * @param options.rotation\r\n * @param options.closeShape\r\n * @param options.closePath\r\n * @param options.cap\r\n * @param options.updatable\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.instance\r\n * @param options.invertUV\r\n * @param options.firstNormal\r\n * @param options.adjustFrame\r\n * @param scene defines the hosting scene\r\n * @returns the extruded shape mesh\r\n * @see https://doc.babylonjs.com/how_to/parametric_shapes\r\n * @see https://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes\r\n */\r\nexport function ExtrudeShape(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n path: Vector3[];\r\n scale?: number;\r\n rotation?: number;\r\n closeShape?: boolean;\r\n closePath?: boolean;\r\n cap?: number;\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n instance?: Mesh;\r\n invertUV?: boolean;\r\n firstNormal?: Vector3;\r\n adjustFrame?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const path = options.path;\r\n const shape = options.shape;\r\n const scale = options.scale || 1;\r\n const rotation = options.rotation || 0;\r\n const cap = options.cap === 0 ? 0 : options.cap || Mesh.NO_CAP;\r\n const updatable = options.updatable;\r\n const sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const instance = options.instance || null;\r\n const invertUV = options.invertUV || false;\r\n const closeShape = options.closeShape || false;\r\n const closePath = options.closePath || false;\r\n\r\n return _ExtrudeShapeGeneric(\r\n name,\r\n shape,\r\n path,\r\n scale,\r\n rotation,\r\n null,\r\n null,\r\n closePath,\r\n closeShape,\r\n cap,\r\n false,\r\n scene,\r\n updatable ? true : false,\r\n sideOrientation,\r\n instance,\r\n invertUV,\r\n options.frontUVs || null,\r\n options.backUVs || null,\r\n options.firstNormal || null,\r\n options.adjustFrame ? true : false\r\n );\r\n}\r\n\r\n/**\r\n * Creates an custom extruded shape mesh.\r\n * The custom extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.\r\n * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis.\r\n * * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.\r\n * * The parameter `rotationFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path and the distance of this point from the beginning of the path\r\n * * It must returns a float value that will be the rotation in radians applied to the shape on each path point.\r\n * * The parameter `scaleFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path and the distance of this point from the beginning of the path\r\n * * It must returns a float value that will be the scale value applied to the shape on each path point\r\n * * The parameter `closeShape` (boolean, default false) closes the shape when true, since v5.0.0.\r\n * * The parameter `closePath` (boolean, default false) closes the path when true and no caps, since v5.0.0.\r\n * * The parameter `ribbonClosePath` (boolean, default false) forces the extrusion underlying ribbon to close all the paths in its `pathArray` - depreciated in favor of closeShape\r\n * * The parameter `ribbonCloseArray` (boolean, default false) forces the extrusion underlying ribbon to close its `pathArray` - depreciated in favor of closePath\r\n * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL\r\n * * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : https://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh#extruded-shape\r\n * * Remember you can only change the shape or path point positions, not their number when updating an extruded shape\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation\r\n * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * * The optional parameter `firstNormal` (Vector3) defines the direction of the first normal of the supplied path. It should be supplied when the path is in the xy plane, and particularly if these sections are straight, because the underlying Path3D object will pick a normal in the xy plane that causes the extrusion to be collapsed into the plane. This should be used for any path that is straight.\r\n * * The optional `adjustFrame` (boolean, default false) will cause the internally generated Path3D tangents, normals, and binormals to be adjusted so that a) they are always well-defined, and b) they do not reverse from one path point to the next. This prevents the extruded shape from being flipped and/or rotated with resulting mesh self-intersections. This is primarily useful for straight paths that can reverse direction.\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.shape\r\n * @param options.path\r\n * @param options.scaleFunction\r\n * @param options.rotationFunction\r\n * @param options.ribbonCloseArray\r\n * @param options.ribbonClosePath\r\n * @param options.closeShape\r\n * @param options.closePath\r\n * @param options.cap\r\n * @param options.updatable\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.instance\r\n * @param options.invertUV\r\n * @param options.firstNormal\r\n * @param options.adjustFrame\r\n * @param scene defines the hosting scene\r\n * @returns the custom extruded shape mesh\r\n * @see https://doc.babylonjs.com/how_to/parametric_shapes#custom-extruded-shapes\r\n * @see https://doc.babylonjs.com/how_to/parametric_shapes\r\n * @see https://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes\r\n */\r\nexport function ExtrudeShapeCustom(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n path: Vector3[];\r\n scaleFunction?: Nullable<{ (i: number, distance: number): number }>;\r\n rotationFunction?: Nullable<{ (i: number, distance: number): number }>;\r\n ribbonCloseArray?: boolean;\r\n ribbonClosePath?: boolean;\r\n closeShape?: boolean;\r\n closePath?: boolean;\r\n cap?: number;\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n instance?: Mesh;\r\n invertUV?: boolean;\r\n firstNormal?: Vector3;\r\n adjustFrame?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const path = options.path;\r\n const shape = options.shape;\r\n const scaleFunction =\r\n options.scaleFunction ||\r\n (() => {\r\n return 1;\r\n });\r\n const rotationFunction =\r\n options.rotationFunction ||\r\n (() => {\r\n return 0;\r\n });\r\n const ribbonCloseArray = options.closePath || options.ribbonCloseArray || false;\r\n const ribbonClosePath = options.closeShape || options.ribbonClosePath || false;\r\n const cap = options.cap === 0 ? 0 : options.cap || Mesh.NO_CAP;\r\n const updatable = options.updatable;\r\n const firstNormal = options.firstNormal || null;\r\n const adjustFrame = options.adjustFrame || false;\r\n const sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const instance = options.instance;\r\n const invertUV = options.invertUV || false;\r\n return _ExtrudeShapeGeneric(\r\n name,\r\n shape,\r\n path,\r\n null,\r\n null,\r\n scaleFunction,\r\n rotationFunction,\r\n ribbonCloseArray,\r\n ribbonClosePath,\r\n cap,\r\n true,\r\n scene,\r\n updatable ? true : false,\r\n sideOrientation,\r\n instance || null,\r\n invertUV,\r\n options.frontUVs || null,\r\n options.backUVs || null,\r\n firstNormal,\r\n adjustFrame\r\n );\r\n}\r\n\r\nfunction _ExtrudeShapeGeneric(\r\n name: string,\r\n shape: Vector3[],\r\n curve: Vector3[],\r\n scale: Nullable<number>,\r\n rotation: Nullable<number>,\r\n scaleFunction: Nullable<{ (i: number, distance: number): number }>,\r\n rotateFunction: Nullable<{ (i: number, distance: number): number }>,\r\n rbCA: boolean,\r\n rbCP: boolean,\r\n cap: number,\r\n custom: boolean,\r\n scene: Nullable<Scene>,\r\n updtbl: boolean,\r\n side: number,\r\n instance: Nullable<Mesh>,\r\n invertUV: boolean,\r\n frontUVs: Nullable<Vector4>,\r\n backUVs: Nullable<Vector4>,\r\n firstNormal: Nullable<Vector3>,\r\n adjustFrame: boolean\r\n): Mesh {\r\n // extrusion geometry\r\n const extrusionPathArray = (\r\n shape: Vector3[],\r\n curve: Vector3[],\r\n path3D: Path3D,\r\n shapePaths: Vector3[][],\r\n scale: Nullable<number>,\r\n rotation: Nullable<number>,\r\n scaleFunction: Nullable<{ (i: number, distance: number): number }>,\r\n rotateFunction: Nullable<{ (i: number, distance: number): number }>,\r\n cap: number,\r\n custom: boolean,\r\n adjustFrame: boolean\r\n ) => {\r\n const tangents = path3D.getTangents();\r\n const normals = path3D.getNormals();\r\n const binormals = path3D.getBinormals();\r\n const distances = path3D.getDistances();\r\n if (adjustFrame) {\r\n /* fix tangents,normals, binormals */\r\n for (let i = 0; i < tangents.length; i++) {\r\n if (tangents[i].x == 0 && tangents[i].y == 0 && tangents[i].z == 0) {\r\n tangents[i].copyFrom(tangents[i - 1]);\r\n }\r\n if (normals[i].x == 0 && normals[i].y == 0 && normals[i].z == 0) {\r\n normals[i].copyFrom(normals[i - 1]);\r\n }\r\n if (binormals[i].x == 0 && binormals[i].y == 0 && binormals[i].z == 0) {\r\n binormals[i].copyFrom(binormals[i - 1]);\r\n }\r\n if (i > 0) {\r\n let v = tangents[i - 1];\r\n if (Vector3.Dot(v, tangents[i]) < 0) {\r\n tangents[i].scaleInPlace(-1);\r\n }\r\n v = normals[i - 1];\r\n if (Vector3.Dot(v, normals[i]) < 0) {\r\n normals[i].scaleInPlace(-1);\r\n }\r\n v = binormals[i - 1];\r\n if (Vector3.Dot(v, binormals[i]) < 0) {\r\n binormals[i].scaleInPlace(-1);\r\n }\r\n }\r\n }\r\n }\r\n let angle = 0;\r\n const returnScale = () => {\r\n return scale !== null ? scale : 1;\r\n };\r\n const returnRotation = () => {\r\n return rotation !== null ? rotation : 0;\r\n };\r\n const rotate: { (i: number, distance: number): number } = custom && rotateFunction ? rotateFunction : returnRotation;\r\n const scl: { (i: number, distance: number): number } = custom && scaleFunction ? scaleFunction : returnScale;\r\n let index = cap === Mesh.NO_CAP || cap === Mesh.CAP_END ? 0 : 2;\r\n const rotationMatrix: Matrix = TmpVectors.Matrix[0];\r\n\r\n for (let i = 0; i < curve.length; i++) {\r\n const shapePath = new Array<Vector3>();\r\n const angleStep = rotate(i, distances[i]);\r\n const scaleRatio = scl(i, distances[i]);\r\n Matrix.RotationAxisToRef(tangents[i], angle, rotationMatrix);\r\n for (let p = 0; p < shape.length; p++) {\r\n const planed = tangents[i].scale(shape[p].z).add(normals[i].scale(shape[p].x)).add(binormals[i].scale(shape[p].y));\r\n const rotated = Vector3.Zero();\r\n Vector3.TransformCoordinatesToRef(planed, rotationMatrix, rotated);\r\n rotated.scaleInPlace(scaleRatio).addInPlace(curve[i]);\r\n shapePath[p] = rotated;\r\n }\r\n shapePaths[index] = shapePath;\r\n angle += angleStep;\r\n index++;\r\n }\r\n // cap\r\n const capPath = (shapePath: Vector3[]) => {\r\n const pointCap = Array<Vector3>();\r\n const barycenter = Vector3.Zero();\r\n let i: number;\r\n for (i = 0; i < shapePath.length; i++) {\r\n barycenter.addInPlace(shapePath[i]);\r\n }\r\n barycenter.scaleInPlace(1.0 / shapePath.length);\r\n for (i = 0; i < shapePath.length; i++) {\r\n pointCap.push(barycenter);\r\n }\r\n return pointCap;\r\n };\r\n switch (cap) {\r\n case Mesh.NO_CAP:\r\n break;\r\n case Mesh.CAP_START:\r\n shapePaths[0] = capPath(shapePaths[2]);\r\n shapePaths[1] = shapePaths[2];\r\n break;\r\n case Mesh.CAP_END:\r\n shapePaths[index] = shapePaths[index - 1];\r\n shapePaths[index + 1] = capPath(shapePaths[index - 1]);\r\n break;\r\n case Mesh.CAP_ALL:\r\n shapePaths[0] = capPath(shapePaths[2]);\r\n shapePaths[1] = shapePaths[2];\r\n shapePaths[index] = shapePaths[index - 1];\r\n shapePaths[index + 1] = capPath(shapePaths[index - 1]);\r\n break;\r\n default:\r\n break;\r\n }\r\n return shapePaths;\r\n };\r\n let path3D;\r\n let pathArray;\r\n if (instance) {\r\n // instance update\r\n const storage = instance._creationDataStorage!;\r\n path3D = firstNormal ? storage.path3D.update(curve, firstNormal) : storage.path3D.update(curve);\r\n pathArray = extrusionPathArray(shape, curve, storage.path3D, storage.pathArray, scale, rotation, scaleFunction, rotateFunction, storage.cap, custom, adjustFrame);\r\n instance = CreateRibbon(\"\", { pathArray, closeArray: false, closePath: false, offset: 0, updatable: false, sideOrientation: 0, instance }, scene || undefined);\r\n\r\n return instance;\r\n }\r\n // extruded shape creation\r\n path3D = firstNormal ? new Path3D(curve, firstNormal) : new Path3D(curve);\r\n const newShapePaths = new Array<Array<Vector3>>();\r\n cap = cap < 0 || cap > 3 ? 0 : cap;\r\n pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom, adjustFrame);\r\n const extrudedGeneric = CreateRibbon(\r\n name,\r\n {\r\n pathArray: pathArray,\r\n closeArray: rbCA,\r\n closePath: rbCP,\r\n updatable: updtbl,\r\n sideOrientation: side,\r\n invertUV: invertUV,\r\n frontUVs: frontUVs || undefined,\r\n backUVs: backUVs || undefined,\r\n },\r\n scene\r\n );\r\n extrudedGeneric._creationDataStorage!.pathArray = pathArray;\r\n extrudedGeneric._creationDataStorage!.path3D = path3D;\r\n extrudedGeneric._creationDataStorage!.cap = cap;\r\n\r\n return extrudedGeneric;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated please use the functions directly from the module\r\n */\r\nexport const ShapeBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n ExtrudeShape,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n ExtrudeShapeCustom,\r\n};\r\n\r\n(Mesh as any).ExtrudeShape = (\r\n name: string,\r\n shape: Vector3[],\r\n path: Vector3[],\r\n scale: number,\r\n rotation: number,\r\n cap: number,\r\n scene: Nullable<Scene> = null,\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n instance?: Mesh\r\n): Mesh => {\r\n const options = {\r\n shape: shape,\r\n path: path,\r\n scale: scale,\r\n rotation: rotation,\r\n cap: cap === 0 ? 0 : cap || Mesh.NO_CAP,\r\n sideOrientation: sideOrientation,\r\n instance: instance,\r\n updatable: updatable,\r\n };\r\n\r\n return ExtrudeShape(name, options, scene);\r\n};\r\n\r\n(Mesh as any).ExtrudeShapeCustom = (\r\n name: string,\r\n shape: Vector3[],\r\n path: Vector3[],\r\n scaleFunction: Nullable<{ (i: number, distance: number): number }>,\r\n rotationFunction: Nullable<{ (i: number, distance: number): number }>,\r\n ribbonCloseArray: boolean,\r\n ribbonClosePath: boolean,\r\n cap: number,\r\n scene: Scene,\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n instance?: Mesh\r\n): Mesh => {\r\n const options = {\r\n shape: shape,\r\n path: path,\r\n scaleFunction: scaleFunction,\r\n rotationFunction: rotationFunction,\r\n ribbonCloseArray: ribbonCloseArray,\r\n ribbonClosePath: ribbonClosePath,\r\n cap: cap === 0 ? 0 : cap || Mesh.NO_CAP,\r\n sideOrientation: sideOrientation,\r\n instance: instance,\r\n updatable: updatable,\r\n };\r\n\r\n return ExtrudeShapeCustom(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"shapeBuilder.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Meshes/Builders/shapeBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,YAAY,CACxB,IAAY,EACZ,OAgBC,EACD,QAAyB,IAAI;IAE7B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC;IAC/D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,MAAM,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACjF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC;IAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC;IAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU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OAAO,EAAE,KAAK,CAAC,CAAC;AACpD,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3, TmpVectors, Matrix } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { CreateRibbon } from \"./ribbonBuilder\";\r\nimport { Path3D } from \"../../Maths/math.path\";\r\n\r\n/**\r\n * Creates an extruded shape mesh. The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.\r\n * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis.\r\n * * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.\r\n * * The parameter `rotation` (float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve.\r\n * * The parameter `scale` (float, default 1) is the value to scale the shape.\r\n * * The parameter `closeShape` (boolean, default false) closes the shape when true, since v5.0.0.\r\n * * The parameter `closePath` (boolean, default false) closes the path when true and no caps, since v5.0.0.\r\n * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL\r\n * * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape\r\n * * Remember you can only change the shape or path point positions, not their number when updating an extruded shape.\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.\r\n * * The optional parameter `firstNormal` (Vector3) defines the direction of the first normal of the supplied path. Consider using this for any path that is straight, and particular for paths in the xy plane.\r\n * * The optional `adjustFrame` (boolean, default false) will cause the internally generated Path3D tangents, normals, and binormals to be adjusted so that a) they are always well-defined, and b) they do not reverse from one path point to the next. This prevents the extruded shape from being flipped and/or rotated with resulting mesh self-intersections. This is primarily useful for straight paths that can reverse direction.\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.shape\r\n * @param options.path\r\n * @param options.scale\r\n * @param options.rotation\r\n * @param options.closeShape\r\n * @param options.closePath\r\n * @param options.cap\r\n * @param options.updatable\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.instance\r\n * @param options.invertUV\r\n * @param options.firstNormal\r\n * @param options.adjustFrame\r\n * @param scene defines the hosting scene\r\n * @returns the extruded shape mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes\r\n */\r\nexport function ExtrudeShape(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n path: Vector3[];\r\n scale?: number;\r\n rotation?: number;\r\n closeShape?: boolean;\r\n closePath?: boolean;\r\n cap?: number;\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n instance?: Mesh;\r\n invertUV?: boolean;\r\n firstNormal?: Vector3;\r\n adjustFrame?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const path = options.path;\r\n const shape = options.shape;\r\n const scale = options.scale || 1;\r\n const rotation = options.rotation || 0;\r\n const cap = options.cap === 0 ? 0 : options.cap || Mesh.NO_CAP;\r\n const updatable = options.updatable;\r\n const sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const instance = options.instance || null;\r\n const invertUV = options.invertUV || false;\r\n const closeShape = options.closeShape || false;\r\n const closePath = options.closePath || false;\r\n\r\n return _ExtrudeShapeGeneric(\r\n name,\r\n shape,\r\n path,\r\n scale,\r\n rotation,\r\n null,\r\n null,\r\n closePath,\r\n closeShape,\r\n cap,\r\n false,\r\n scene,\r\n updatable ? true : false,\r\n sideOrientation,\r\n instance,\r\n invertUV,\r\n options.frontUVs || null,\r\n options.backUVs || null,\r\n options.firstNormal || null,\r\n options.adjustFrame ? true : false\r\n );\r\n}\r\n\r\n/**\r\n * Creates an custom extruded shape mesh.\r\n * The custom extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.\r\n * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis.\r\n * * The parameter `path` is a required array of successive Vector3. This is the axis curve the shape is extruded along.\r\n * * The parameter `rotationFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path and the distance of this point from the beginning of the path\r\n * * It must returns a float value that will be the rotation in radians applied to the shape on each path point.\r\n * * The parameter `scaleFunction` (JS function) is a custom Javascript function called on each path point. This function is passed the position i of the point in the path and the distance of this point from the beginning of the path\r\n * * It must returns a float value that will be the scale value applied to the shape on each path point\r\n * * The parameter `closeShape` (boolean, default false) closes the shape when true, since v5.0.0.\r\n * * The parameter `closePath` (boolean, default false) closes the path when true and no caps, since v5.0.0.\r\n * * The parameter `ribbonClosePath` (boolean, default false) forces the extrusion underlying ribbon to close all the paths in its `pathArray` - depreciated in favor of closeShape\r\n * * The parameter `ribbonCloseArray` (boolean, default false) forces the extrusion underlying ribbon to close its `pathArray` - depreciated in favor of closePath\r\n * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL\r\n * * The optional parameter `instance` is an instance of an existing ExtrudedShape object to be updated with the passed `shape`, `path`, `scale` or `rotation` parameters : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shape\r\n * * Remember you can only change the shape or path point positions, not their number when updating an extruded shape\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * * The optional parameter `firstNormal` (Vector3) defines the direction of the first normal of the supplied path. It should be supplied when the path is in the xy plane, and particularly if these sections are straight, because the underlying Path3D object will pick a normal in the xy plane that causes the extrusion to be collapsed into the plane. This should be used for any path that is straight.\r\n * * The optional `adjustFrame` (boolean, default false) will cause the internally generated Path3D tangents, normals, and binormals to be adjusted so that a) they are always well-defined, and b) they do not reverse from one path point to the next. This prevents the extruded shape from being flipped and/or rotated with resulting mesh self-intersections. This is primarily useful for straight paths that can reverse direction.\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.shape\r\n * @param options.path\r\n * @param options.scaleFunction\r\n * @param options.rotationFunction\r\n * @param options.ribbonCloseArray\r\n * @param options.ribbonClosePath\r\n * @param options.closeShape\r\n * @param options.closePath\r\n * @param options.cap\r\n * @param options.updatable\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.instance\r\n * @param options.invertUV\r\n * @param options.firstNormal\r\n * @param options.adjustFrame\r\n * @param scene defines the hosting scene\r\n * @returns the custom extruded shape mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#custom-extruded-shapes\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#extruded-shapes\r\n */\r\nexport function ExtrudeShapeCustom(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n path: Vector3[];\r\n scaleFunction?: Nullable<{ (i: number, distance: number): number }>;\r\n rotationFunction?: Nullable<{ (i: number, distance: number): number }>;\r\n ribbonCloseArray?: boolean;\r\n ribbonClosePath?: boolean;\r\n closeShape?: boolean;\r\n closePath?: boolean;\r\n cap?: number;\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n instance?: Mesh;\r\n invertUV?: boolean;\r\n firstNormal?: Vector3;\r\n adjustFrame?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const path = options.path;\r\n const shape = options.shape;\r\n const scaleFunction =\r\n options.scaleFunction ||\r\n (() => {\r\n return 1;\r\n });\r\n const rotationFunction =\r\n options.rotationFunction ||\r\n (() => {\r\n return 0;\r\n });\r\n const ribbonCloseArray = options.closePath || options.ribbonCloseArray || false;\r\n const ribbonClosePath = options.closeShape || options.ribbonClosePath || false;\r\n const cap = options.cap === 0 ? 0 : options.cap || Mesh.NO_CAP;\r\n const updatable = options.updatable;\r\n const firstNormal = options.firstNormal || null;\r\n const adjustFrame = options.adjustFrame || false;\r\n const sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const instance = options.instance;\r\n const invertUV = options.invertUV || false;\r\n return _ExtrudeShapeGeneric(\r\n name,\r\n shape,\r\n path,\r\n null,\r\n null,\r\n scaleFunction,\r\n rotationFunction,\r\n ribbonCloseArray,\r\n ribbonClosePath,\r\n cap,\r\n true,\r\n scene,\r\n updatable ? true : false,\r\n sideOrientation,\r\n instance || null,\r\n invertUV,\r\n options.frontUVs || null,\r\n options.backUVs || null,\r\n firstNormal,\r\n adjustFrame\r\n );\r\n}\r\n\r\nfunction _ExtrudeShapeGeneric(\r\n name: string,\r\n shape: Vector3[],\r\n curve: Vector3[],\r\n scale: Nullable<number>,\r\n rotation: Nullable<number>,\r\n scaleFunction: Nullable<{ (i: number, distance: number): number }>,\r\n rotateFunction: Nullable<{ (i: number, distance: number): number }>,\r\n rbCA: boolean,\r\n rbCP: boolean,\r\n cap: number,\r\n custom: boolean,\r\n scene: Nullable<Scene>,\r\n updtbl: boolean,\r\n side: number,\r\n instance: Nullable<Mesh>,\r\n invertUV: boolean,\r\n frontUVs: Nullable<Vector4>,\r\n backUVs: Nullable<Vector4>,\r\n firstNormal: Nullable<Vector3>,\r\n adjustFrame: boolean\r\n): Mesh {\r\n // extrusion geometry\r\n const extrusionPathArray = (\r\n shape: Vector3[],\r\n curve: Vector3[],\r\n path3D: Path3D,\r\n shapePaths: Vector3[][],\r\n scale: Nullable<number>,\r\n rotation: Nullable<number>,\r\n scaleFunction: Nullable<{ (i: number, distance: number): number }>,\r\n rotateFunction: Nullable<{ (i: number, distance: number): number }>,\r\n cap: number,\r\n custom: boolean,\r\n adjustFrame: boolean\r\n ) => {\r\n const tangents = path3D.getTangents();\r\n const normals = path3D.getNormals();\r\n const binormals = path3D.getBinormals();\r\n const distances = path3D.getDistances();\r\n if (adjustFrame) {\r\n /* fix tangents,normals, binormals */\r\n for (let i = 0; i < tangents.length; i++) {\r\n if (tangents[i].x == 0 && tangents[i].y == 0 && tangents[i].z == 0) {\r\n tangents[i].copyFrom(tangents[i - 1]);\r\n }\r\n if (normals[i].x == 0 && normals[i].y == 0 && normals[i].z == 0) {\r\n normals[i].copyFrom(normals[i - 1]);\r\n }\r\n if (binormals[i].x == 0 && binormals[i].y == 0 && binormals[i].z == 0) {\r\n binormals[i].copyFrom(binormals[i - 1]);\r\n }\r\n if (i > 0) {\r\n let v = tangents[i - 1];\r\n if (Vector3.Dot(v, tangents[i]) < 0) {\r\n tangents[i].scaleInPlace(-1);\r\n }\r\n v = normals[i - 1];\r\n if (Vector3.Dot(v, normals[i]) < 0) {\r\n normals[i].scaleInPlace(-1);\r\n }\r\n v = binormals[i - 1];\r\n if (Vector3.Dot(v, binormals[i]) < 0) {\r\n binormals[i].scaleInPlace(-1);\r\n }\r\n }\r\n }\r\n }\r\n let angle = 0;\r\n const returnScale = () => {\r\n return scale !== null ? scale : 1;\r\n };\r\n const returnRotation = () => {\r\n return rotation !== null ? rotation : 0;\r\n };\r\n const rotate: { (i: number, distance: number): number } = custom && rotateFunction ? rotateFunction : returnRotation;\r\n const scl: { (i: number, distance: number): number } = custom && scaleFunction ? scaleFunction : returnScale;\r\n let index = cap === Mesh.NO_CAP || cap === Mesh.CAP_END ? 0 : 2;\r\n const rotationMatrix: Matrix = TmpVectors.Matrix[0];\r\n\r\n for (let i = 0; i < curve.length; i++) {\r\n const shapePath = new Array<Vector3>();\r\n const angleStep = rotate(i, distances[i]);\r\n const scaleRatio = scl(i, distances[i]);\r\n Matrix.RotationAxisToRef(tangents[i], angle, rotationMatrix);\r\n for (let p = 0; p < shape.length; p++) {\r\n const planed = tangents[i].scale(shape[p].z).add(normals[i].scale(shape[p].x)).add(binormals[i].scale(shape[p].y));\r\n const rotated = Vector3.Zero();\r\n Vector3.TransformCoordinatesToRef(planed, rotationMatrix, rotated);\r\n rotated.scaleInPlace(scaleRatio).addInPlace(curve[i]);\r\n shapePath[p] = rotated;\r\n }\r\n shapePaths[index] = shapePath;\r\n angle += angleStep;\r\n index++;\r\n }\r\n // cap\r\n const capPath = (shapePath: Vector3[]) => {\r\n const pointCap = Array<Vector3>();\r\n const barycenter = Vector3.Zero();\r\n let i: number;\r\n for (i = 0; i < shapePath.length; i++) {\r\n barycenter.addInPlace(shapePath[i]);\r\n }\r\n barycenter.scaleInPlace(1.0 / shapePath.length);\r\n for (i = 0; i < shapePath.length; i++) {\r\n pointCap.push(barycenter);\r\n }\r\n return pointCap;\r\n };\r\n switch (cap) {\r\n case Mesh.NO_CAP:\r\n break;\r\n case Mesh.CAP_START:\r\n shapePaths[0] = capPath(shapePaths[2]);\r\n shapePaths[1] = shapePaths[2];\r\n break;\r\n case Mesh.CAP_END:\r\n shapePaths[index] = shapePaths[index - 1];\r\n shapePaths[index + 1] = capPath(shapePaths[index - 1]);\r\n break;\r\n case Mesh.CAP_ALL:\r\n shapePaths[0] = capPath(shapePaths[2]);\r\n shapePaths[1] = shapePaths[2];\r\n shapePaths[index] = shapePaths[index - 1];\r\n shapePaths[index + 1] = capPath(shapePaths[index - 1]);\r\n break;\r\n default:\r\n break;\r\n }\r\n return shapePaths;\r\n };\r\n let path3D;\r\n let pathArray;\r\n if (instance) {\r\n // instance update\r\n const storage = instance._creationDataStorage!;\r\n path3D = firstNormal ? storage.path3D.update(curve, firstNormal) : storage.path3D.update(curve);\r\n pathArray = extrusionPathArray(shape, curve, storage.path3D, storage.pathArray, scale, rotation, scaleFunction, rotateFunction, storage.cap, custom, adjustFrame);\r\n instance = CreateRibbon(\"\", { pathArray, closeArray: false, closePath: false, offset: 0, updatable: false, sideOrientation: 0, instance }, scene || undefined);\r\n\r\n return instance;\r\n }\r\n // extruded shape creation\r\n path3D = firstNormal ? new Path3D(curve, firstNormal) : new Path3D(curve);\r\n const newShapePaths = new Array<Array<Vector3>>();\r\n cap = cap < 0 || cap > 3 ? 0 : cap;\r\n pathArray = extrusionPathArray(shape, curve, path3D, newShapePaths, scale, rotation, scaleFunction, rotateFunction, cap, custom, adjustFrame);\r\n const extrudedGeneric = CreateRibbon(\r\n name,\r\n {\r\n pathArray: pathArray,\r\n closeArray: rbCA,\r\n closePath: rbCP,\r\n updatable: updtbl,\r\n sideOrientation: side,\r\n invertUV: invertUV,\r\n frontUVs: frontUVs || undefined,\r\n backUVs: backUVs || undefined,\r\n },\r\n scene\r\n );\r\n extrudedGeneric._creationDataStorage!.pathArray = pathArray;\r\n extrudedGeneric._creationDataStorage!.path3D = path3D;\r\n extrudedGeneric._creationDataStorage!.cap = cap;\r\n\r\n return extrudedGeneric;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated please use the functions directly from the module\r\n */\r\nexport const ShapeBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n ExtrudeShape,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n ExtrudeShapeCustom,\r\n};\r\n\r\n(Mesh as any).ExtrudeShape = (\r\n name: string,\r\n shape: Vector3[],\r\n path: Vector3[],\r\n scale: number,\r\n rotation: number,\r\n cap: number,\r\n scene: Nullable<Scene> = null,\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n instance?: Mesh\r\n): Mesh => {\r\n const options = {\r\n shape: shape,\r\n path: path,\r\n scale: scale,\r\n rotation: rotation,\r\n cap: cap === 0 ? 0 : cap || Mesh.NO_CAP,\r\n sideOrientation: sideOrientation,\r\n instance: instance,\r\n updatable: updatable,\r\n };\r\n\r\n return ExtrudeShape(name, options, scene);\r\n};\r\n\r\n(Mesh as any).ExtrudeShapeCustom = (\r\n name: string,\r\n shape: Vector3[],\r\n path: Vector3[],\r\n scaleFunction: Nullable<{ (i: number, distance: number): number }>,\r\n rotationFunction: Nullable<{ (i: number, distance: number): number }>,\r\n ribbonCloseArray: boolean,\r\n ribbonClosePath: boolean,\r\n cap: number,\r\n scene: Scene,\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n instance?: Mesh\r\n): Mesh => {\r\n const options = {\r\n shape: shape,\r\n path: path,\r\n scaleFunction: scaleFunction,\r\n rotationFunction: rotationFunction,\r\n ribbonCloseArray: ribbonCloseArray,\r\n ribbonClosePath: ribbonClosePath,\r\n cap: cap === 0 ? 0 : cap || Mesh.NO_CAP,\r\n sideOrientation: sideOrientation,\r\n instance: instance,\r\n updatable: updatable,\r\n };\r\n\r\n return ExtrudeShapeCustom(name, options, scene);\r\n};\r\n"]}
@@ -50,7 +50,7 @@ export declare function CreateSphereVertexData(options: {
50
50
  * * You can create an unclosed sphere with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio
51
51
  * * You can create an unclosed sphere on its height with the parameter `slice` (positive float, default1), valued between 0 and 1, what is the height ratio (longitude)
52
52
  * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
53
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
53
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
54
54
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
55
55
  * @param name defines the name of the mesh
56
56
  * @param options defines the options used to create the mesh
@@ -67,7 +67,7 @@ export declare function CreateSphereVertexData(options: {
67
67
  * @param options.updatable
68
68
  * @param scene defines the hosting scene
69
69
  * @returns the sphere mesh
70
- * @see https://doc.babylonjs.com/how_to/set_shapes#sphere
70
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#sphere
71
71
  */
72
72
  export declare function CreateSphere(name: string, options?: {
73
73
  segments?: number;
@@ -104,7 +104,7 @@ export function CreateSphereVertexData(options) {
104
104
  * * You can create an unclosed sphere with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio
105
105
  * * You can create an unclosed sphere on its height with the parameter `slice` (positive float, default1), valued between 0 and 1, what is the height ratio (longitude)
106
106
  * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
107
- * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation
107
+ * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
108
108
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
109
109
  * @param name defines the name of the mesh
110
110
  * @param options defines the options used to create the mesh
@@ -121,7 +121,7 @@ export function CreateSphereVertexData(options) {
121
121
  * @param options.updatable
122
122
  * @param scene defines the hosting scene
123
123
  * @returns the sphere mesh
124
- * @see https://doc.babylonjs.com/how_to/set_shapes#sphere
124
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#sphere
125
125
  */
126
126
  export function CreateSphere(name, options = {}, scene = null) {
127
127
  const sphere = new Mesh(name, scene);
@@ -1 +1 @@
1
- {"version":3,"file":"sphereBuilder.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Meshes/Builders/sphereBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAYtC;IACG,MAAM,QAAQ,GAAW,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;IAChD,MAAM,SAAS,GAAW,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACrE,MAAM,SAAS,GAAW,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACrE,MAAM,SAAS,GAAW,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AAE,KAAK,CAAC,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["import type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3, Matrix } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData for an ellipsoid, defaults to a sphere\r\n * @param options an object used to set the following optional parameters for the box, required but can be empty\r\n * * segments sets the number of horizontal strips optional, default 32\r\n * * diameter sets the axes dimensions, diameterX, diameterY and diameterZ to the value of diameter, optional default 1\r\n * * diameterX sets the diameterX (x direction) of the ellipsoid, overwrites the diameterX set by diameter, optional, default diameter\r\n * * diameterY sets the diameterY (y direction) of the ellipsoid, overwrites the diameterY set by diameter, optional, default diameter\r\n * * diameterZ sets the diameterZ (z direction) of the ellipsoid, overwrites the diameterZ set by diameter, optional, default diameter\r\n * * arc a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the circumference (latitude) given by the arc value, optional, default 1\r\n * * slice a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the height (latitude) given by the arc value, optional, default 1\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param options.segments\r\n * @param options.diameter\r\n * @param options.diameterX\r\n * @param options.diameterY\r\n * @param options.diameterZ\r\n * @param options.arc\r\n * @param options.slice\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.dedupTopBottomIndices\r\n * @returns the VertexData of the ellipsoid\r\n */\r\nexport function CreateSphereVertexData(options: {\r\n segments?: number;\r\n diameter?: number;\r\n diameterX?: number;\r\n diameterY?: number;\r\n diameterZ?: number;\r\n arc?: number;\r\n slice?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n dedupTopBottomIndices?: boolean;\r\n}): VertexData {\r\n const segments: number = options.segments || 32;\r\n const diameterX: number = options.diameterX || options.diameter || 1;\r\n const diameterY: number = options.diameterY || options.diameter || 1;\r\n const diameterZ: number = options.diameterZ || options.diameter || 1;\r\n const arc: number = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0;\r\n const slice: number = options.slice && options.slice <= 0 ? 1.0 : options.slice || 1.0;\r\n const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n const dedupTopBottomIndices = !!options.dedupTopBottomIndices;\r\n\r\n const radius = new Vector3(diameterX / 2, diameterY / 2, diameterZ / 2);\r\n\r\n const totalZRotationSteps = 2 + segments;\r\n const totalYRotationSteps = 2 * totalZRotationSteps;\r\n\r\n const indices = [];\r\n const positions = [];\r\n const normals = [];\r\n const uvs = [];\r\n\r\n for (let zRotationStep = 0; zRotationStep <= totalZRotationSteps; zRotationStep++) {\r\n const normalizedZ = zRotationStep / totalZRotationSteps;\r\n const angleZ = normalizedZ * Math.PI * slice;\r\n\r\n for (let yRotationStep = 0; yRotationStep <= totalYRotationSteps; yRotationStep++) {\r\n const normalizedY = yRotationStep / totalYRotationSteps;\r\n\r\n const angleY = normalizedY * Math.PI * 2 * arc;\r\n\r\n const rotationZ = Matrix.RotationZ(-angleZ);\r\n const rotationY = Matrix.RotationY(angleY);\r\n const afterRotZ = Vector3.TransformCoordinates(Vector3.Up(), rotationZ);\r\n const complete = Vector3.TransformCoordinates(afterRotZ, rotationY);\r\n\r\n const vertex = complete.multiply(radius);\r\n const normal = complete.divide(radius).normalize();\r\n\r\n positions.push(vertex.x, vertex.y, vertex.z);\r\n normals.push(normal.x, normal.y, normal.z);\r\n uvs.push(normalizedY, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 - normalizedZ : normalizedZ);\r\n }\r\n\r\n if (zRotationStep > 0) {\r\n const verticesCount = positions.length / 3;\r\n for (let firstIndex = verticesCount - 2 * (totalYRotationSteps + 1); firstIndex + totalYRotationSteps + 2 < verticesCount; firstIndex++) {\r\n if (dedupTopBottomIndices) {\r\n if (zRotationStep > 1) {\r\n indices.push(firstIndex);\r\n indices.push(firstIndex + 1);\r\n indices.push(firstIndex + totalYRotationSteps + 1);\r\n }\r\n if (zRotationStep < totalZRotationSteps || slice < 1.0) {\r\n indices.push(firstIndex + totalYRotationSteps + 1);\r\n indices.push(firstIndex + 1);\r\n indices.push(firstIndex + totalYRotationSteps + 2);\r\n }\r\n } else {\r\n indices.push(firstIndex);\r\n indices.push(firstIndex + 1);\r\n indices.push(firstIndex + totalYRotationSteps + 1);\r\n\r\n indices.push(firstIndex + totalYRotationSteps + 1);\r\n indices.push(firstIndex + 1);\r\n indices.push(firstIndex + totalYRotationSteps + 2);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a sphere mesh\r\n * * The parameter `diameter` sets the diameter size (float) of the sphere (default 1)\r\n * * You can set some different sphere dimensions, for instance to build an ellipsoid, by using the parameters `diameterX`, `diameterY` and `diameterZ` (all by default have the same value of `diameter`)\r\n * * The parameter `segments` sets the sphere number of horizontal stripes (positive integer, default 32)\r\n * * You can create an unclosed sphere with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio\r\n * * You can create an unclosed sphere on its height with the parameter `slice` (positive float, default1), valued between 0 and 1, what is the height ratio (longitude)\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.segments\r\n * @param options.diameter\r\n * @param options.diameterX\r\n * @param options.diameterY\r\n * @param options.diameterZ\r\n * @param options.arc\r\n * @param options.slice\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.updatable\r\n * @param scene defines the hosting scene\r\n * @returns the sphere mesh\r\n * @see https://doc.babylonjs.com/how_to/set_shapes#sphere\r\n */\r\nexport function CreateSphere(\r\n name: string,\r\n options: {\r\n segments?: number;\r\n diameter?: number;\r\n diameterX?: number;\r\n diameterY?: number;\r\n diameterZ?: number;\r\n arc?: number;\r\n slice?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n updatable?: boolean;\r\n } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const sphere = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n sphere._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateSphereVertexData(options);\r\n\r\n vertexData.applyToMesh(sphere, options.updatable);\r\n\r\n return sphere;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use CreateSphere directly\r\n */\r\nexport const SphereBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateSphere,\r\n};\r\n\r\nVertexData.CreateSphere = CreateSphereVertexData;\r\n\r\n(Mesh as any).CreateSphere = (name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh => {\r\n const options = {\r\n segments: segments,\r\n diameterX: diameter,\r\n diameterY: diameter,\r\n diameterZ: diameter,\r\n sideOrientation: sideOrientation,\r\n updatable: updatable,\r\n };\r\n\r\n return CreateSphere(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"sphereBuilder.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Meshes/Builders/sphereBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAYtC;IACG,MAAM,QAAQ,GAAW,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;IAChD,MAAM,SAAS,GAAW,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACrE,MAAM,SAAS,GAAW,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACrE,MAAM,SAAS,GAAW,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;IACrE,MAAM,GAAG,GAAW,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC;IACpG,MAAM,KAAK,GAAW,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC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AAY,EACZ,UAYI,EAAE,EACN,QAAyB,IAAI;IAE7B,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAErC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACnF,MAAM,CAAC,+BAA+B,GAAG,OAAO,CAAC,eAAe,CAAC;IAEjE,MAAM,UAAU,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAEnD,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAElD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,gEAAgE;IAChE,YAAY;CACf,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,sBAAsB,CAAC;AAEhD,IAAY,CAAC,YAAY,GAAG,CAAC,IAAY,EAAE,QAAgB,EAAE,QAAgB,EAAE,KAAa,EAAE,SAAmB,EAAE,eAAwB,EAAQ,EAAE;IAClJ,MAAM,OAAO,GAAG;QACZ,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,QAAQ;QACnB,eAAe,EAAE,eAAe;QAChC,SAAS,EAAE,SAAS;KACvB,CAAC;IAEF,OAAO,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["import type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3, Matrix } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData for an ellipsoid, defaults to a sphere\r\n * @param options an object used to set the following optional parameters for the box, required but can be empty\r\n * * segments sets the number of horizontal strips optional, default 32\r\n * * diameter sets the axes dimensions, diameterX, diameterY and diameterZ to the value of diameter, optional default 1\r\n * * diameterX sets the diameterX (x direction) of the ellipsoid, overwrites the diameterX set by diameter, optional, default diameter\r\n * * diameterY sets the diameterY (y direction) of the ellipsoid, overwrites the diameterY set by diameter, optional, default diameter\r\n * * diameterZ sets the diameterZ (z direction) of the ellipsoid, overwrites the diameterZ set by diameter, optional, default diameter\r\n * * arc a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the circumference (latitude) given by the arc value, optional, default 1\r\n * * slice a number from 0 to 1, to create an unclosed ellipsoid based on the fraction of the height (latitude) given by the arc value, optional, default 1\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param options.segments\r\n * @param options.diameter\r\n * @param options.diameterX\r\n * @param options.diameterY\r\n * @param options.diameterZ\r\n * @param options.arc\r\n * @param options.slice\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.dedupTopBottomIndices\r\n * @returns the VertexData of the ellipsoid\r\n */\r\nexport function CreateSphereVertexData(options: {\r\n segments?: number;\r\n diameter?: number;\r\n diameterX?: number;\r\n diameterY?: number;\r\n diameterZ?: number;\r\n arc?: number;\r\n slice?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n dedupTopBottomIndices?: boolean;\r\n}): VertexData {\r\n const segments: number = options.segments || 32;\r\n const diameterX: number = options.diameterX || options.diameter || 1;\r\n const diameterY: number = options.diameterY || options.diameter || 1;\r\n const diameterZ: number = options.diameterZ || options.diameter || 1;\r\n const arc: number = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0;\r\n const slice: number = options.slice && options.slice <= 0 ? 1.0 : options.slice || 1.0;\r\n const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n const dedupTopBottomIndices = !!options.dedupTopBottomIndices;\r\n\r\n const radius = new Vector3(diameterX / 2, diameterY / 2, diameterZ / 2);\r\n\r\n const totalZRotationSteps = 2 + segments;\r\n const totalYRotationSteps = 2 * totalZRotationSteps;\r\n\r\n const indices = [];\r\n const positions = [];\r\n const normals = [];\r\n const uvs = [];\r\n\r\n for (let zRotationStep = 0; zRotationStep <= totalZRotationSteps; zRotationStep++) {\r\n const normalizedZ = zRotationStep / totalZRotationSteps;\r\n const angleZ = normalizedZ * Math.PI * slice;\r\n\r\n for (let yRotationStep = 0; yRotationStep <= totalYRotationSteps; yRotationStep++) {\r\n const normalizedY = yRotationStep / totalYRotationSteps;\r\n\r\n const angleY = normalizedY * Math.PI * 2 * arc;\r\n\r\n const rotationZ = Matrix.RotationZ(-angleZ);\r\n const rotationY = Matrix.RotationY(angleY);\r\n const afterRotZ = Vector3.TransformCoordinates(Vector3.Up(), rotationZ);\r\n const complete = Vector3.TransformCoordinates(afterRotZ, rotationY);\r\n\r\n const vertex = complete.multiply(radius);\r\n const normal = complete.divide(radius).normalize();\r\n\r\n positions.push(vertex.x, vertex.y, vertex.z);\r\n normals.push(normal.x, normal.y, normal.z);\r\n uvs.push(normalizedY, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 - normalizedZ : normalizedZ);\r\n }\r\n\r\n if (zRotationStep > 0) {\r\n const verticesCount = positions.length / 3;\r\n for (let firstIndex = verticesCount - 2 * (totalYRotationSteps + 1); firstIndex + totalYRotationSteps + 2 < verticesCount; firstIndex++) {\r\n if (dedupTopBottomIndices) {\r\n if (zRotationStep > 1) {\r\n indices.push(firstIndex);\r\n indices.push(firstIndex + 1);\r\n indices.push(firstIndex + totalYRotationSteps + 1);\r\n }\r\n if (zRotationStep < totalZRotationSteps || slice < 1.0) {\r\n indices.push(firstIndex + totalYRotationSteps + 1);\r\n indices.push(firstIndex + 1);\r\n indices.push(firstIndex + totalYRotationSteps + 2);\r\n }\r\n } else {\r\n indices.push(firstIndex);\r\n indices.push(firstIndex + 1);\r\n indices.push(firstIndex + totalYRotationSteps + 1);\r\n\r\n indices.push(firstIndex + totalYRotationSteps + 1);\r\n indices.push(firstIndex + 1);\r\n indices.push(firstIndex + totalYRotationSteps + 2);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a sphere mesh\r\n * * The parameter `diameter` sets the diameter size (float) of the sphere (default 1)\r\n * * You can set some different sphere dimensions, for instance to build an ellipsoid, by using the parameters `diameterX`, `diameterY` and `diameterZ` (all by default have the same value of `diameter`)\r\n * * The parameter `segments` sets the sphere number of horizontal stripes (positive integer, default 32)\r\n * * You can create an unclosed sphere with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference (latitude) : 2 x PI x ratio\r\n * * You can create an unclosed sphere on its height with the parameter `slice` (positive float, default1), valued between 0 and 1, what is the height ratio (longitude)\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.segments\r\n * @param options.diameter\r\n * @param options.diameterX\r\n * @param options.diameterY\r\n * @param options.diameterZ\r\n * @param options.arc\r\n * @param options.slice\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.updatable\r\n * @param scene defines the hosting scene\r\n * @returns the sphere mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#sphere\r\n */\r\nexport function CreateSphere(\r\n name: string,\r\n options: {\r\n segments?: number;\r\n diameter?: number;\r\n diameterX?: number;\r\n diameterY?: number;\r\n diameterZ?: number;\r\n arc?: number;\r\n slice?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n updatable?: boolean;\r\n } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const sphere = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n sphere._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateSphereVertexData(options);\r\n\r\n vertexData.applyToMesh(sphere, options.updatable);\r\n\r\n return sphere;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use CreateSphere directly\r\n */\r\nexport const SphereBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateSphere,\r\n};\r\n\r\nVertexData.CreateSphere = CreateSphereVertexData;\r\n\r\n(Mesh as any).CreateSphere = (name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh => {\r\n const options = {\r\n segments: segments,\r\n diameterX: diameter,\r\n diameterY: diameter,\r\n diameterZ: diameter,\r\n sideOrientation: sideOrientation,\r\n updatable: updatable,\r\n };\r\n\r\n return CreateSphere(name, options, scene);\r\n};\r\n"]}
@@ -6,7 +6,7 @@ import { Mesh } from "../mesh";
6
6
  import { VertexData } from "../mesh.vertexData";
7
7
  /**
8
8
  * Creates the VertexData for a tiled box
9
- * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_box
9
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box
10
10
  * @param options an object used to set the following optional parameters for the tiled box, required but can be empty
11
11
  * * pattern sets the rotation or reflection pattern for the tiles,
12
12
  * * size of the box
@@ -53,7 +53,7 @@ export declare function CreateTiledBoxVertexData(options: {
53
53
  }): VertexData;
54
54
  /**
55
55
  * Creates a tiled box mesh
56
- * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_box
56
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box
57
57
  * @param name defines the name of the mesh
58
58
  * @param options an object used to set the following optional parameters for the tiled box, required but can be empty
59
59
  * * pattern sets the rotation or reflection pattern for the tiles,
@@ -6,7 +6,7 @@ import { CreateTiledPlaneVertexData } from "./tiledPlaneBuilder.js";
6
6
  import { CompatibilityOptions } from "../../Compat/compatibilityOptions.js";
7
7
  /**
8
8
  * Creates the VertexData for a tiled box
9
- * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_box
9
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box
10
10
  * @param options an object used to set the following optional parameters for the tiled box, required but can be empty
11
11
  * * pattern sets the rotation or reflection pattern for the tiles,
12
12
  * * size of the box
@@ -214,7 +214,7 @@ export function CreateTiledBoxVertexData(options) {
214
214
  }
215
215
  /**
216
216
  * Creates a tiled box mesh
217
- * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_box
217
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box
218
218
  * @param name defines the name of the mesh
219
219
  * @param options an object used to set the following optional parameters for the tiled box, required but can be empty
220
220
  * * pattern sets the rotation or reflection pattern for the tiles,
@@ -1 +1 @@
1
- {"version":3,"file":"tiledBoxBuilder.js","sourceRoot":"","sources":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AAI,UAAU,EAAE,CAAC;IAEpC,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAC7B,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAC7B,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC;IAErB,IAAI,UAAU,EAAE;QACZ,MAAM,WAAW,GAAG,eAAe,KAAK,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/F,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC;KACnC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,cAAc,CAC1B,IAAY,EACZ,OAcC,EACD,QAAyB,IAAI;IAE7B,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAElC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACnF,GAAG,CAAC,+BAA+B,GAAG,OAAO,CAAC,eAAe,CAAC;IAE9D,MAAM,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAErD,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAE/C,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,gEAAgE;IAChE,cAAc;CACjB,CAAC;AAEF,UAAU,CAAC,cAAc,GAAG,wBAAwB,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Matrix, Vector3, Vector4 } from \"../../Maths/math.vector\";\r\nimport { Color4 } from \"../../Maths/math.color\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { CreateTiledPlaneVertexData } from \"./tiledPlaneBuilder\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData for a tiled box\r\n * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_box\r\n * @param options an object used to set the following optional parameters for the tiled box, required but can be empty\r\n * * pattern sets the rotation or reflection pattern for the tiles,\r\n * * size of the box\r\n * * width of the box, overwrites size\r\n * * height of the box, overwrites size\r\n * * depth of the box, overwrites size\r\n * * tileSize sets the size of a tile\r\n * * tileWidth sets the tile width and overwrites tileSize\r\n * * tileHeight sets the tile width and overwrites tileSize\r\n * * faceUV an array of 6 Vector4 elements used to set different images to each box side\r\n * * faceColors an array of 6 Color3 elements used to set different colors to each box side\r\n * * alignHorizontal places whole tiles aligned to the center, left or right of a row\r\n * * alignVertical places whole tiles aligned to the center, left or right of a column\r\n * @param options.pattern\r\n * @param options.size\r\n * @param options.width\r\n * @param options.height\r\n * @param options.depth\r\n * @param options.tileSize\r\n * @param options.tileWidth\r\n * @param options.tileHeight\r\n * @param options.faceUV\r\n * @param options.faceColors\r\n * @param options.alignHorizontal\r\n * @param options.alignVertical\r\n * @param options.sideOrientation\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @returns the VertexData of the TiledBox\r\n */\r\nexport function CreateTiledBoxVertexData(options: {\r\n pattern?: number;\r\n size?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n tileSize?: number;\r\n tileWidth?: number;\r\n tileHeight?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n alignHorizontal?: number;\r\n alignVertical?: number;\r\n sideOrientation?: number;\r\n}): VertexData {\r\n const nbFaces = 6;\r\n\r\n const faceUV: Vector4[] = options.faceUV || new Array<Vector4>(6);\r\n const faceColors = options.faceColors;\r\n\r\n const flipTile = options.pattern || Mesh.NO_FLIP;\r\n\r\n const width = options.width || options.size || 1;\r\n const height = options.height || options.size || 1;\r\n const depth = options.depth || options.size || 1;\r\n const tileWidth = options.tileWidth || options.tileSize || 1;\r\n const tileHeight = options.tileHeight || options.tileSize || 1;\r\n const alignH = options.alignHorizontal || 0;\r\n const alignV = options.alignVertical || 0;\r\n\r\n const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < nbFaces; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const halfWidth = width / 2;\r\n const halfHeight = height / 2;\r\n const halfDepth = depth / 2;\r\n\r\n const faceVertexData: Array<VertexData> = [];\r\n\r\n for (let f = 0; f < 2; f++) {\r\n //front and back\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: height,\r\n alignVertical: alignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n for (let f = 2; f < 4; f++) {\r\n //sides\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: depth,\r\n height: height,\r\n alignVertical: alignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n let baseAlignV = alignV;\r\n if (alignV === Mesh.BOTTOM) {\r\n baseAlignV = Mesh.TOP;\r\n } else if (alignV === Mesh.TOP) {\r\n baseAlignV = Mesh.BOTTOM;\r\n }\r\n\r\n for (let f = 4; f < 6; f++) {\r\n //top and bottom\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: depth,\r\n alignVertical: baseAlignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n let positions: Array<number> = [];\r\n let normals: Array<number> = [];\r\n let uvs: Array<number> = [];\r\n let indices: Array<number> = [];\r\n const colors: Array<number> = [];\r\n const facePositions: Array<Array<Vector3>> = [];\r\n const faceNormals: Array<Array<Vector3>> = [];\r\n\r\n const newFaceUV: Array<Array<number>> = [];\r\n let lu: number = 0;\r\n\r\n let li: number = 0;\r\n\r\n for (let f = 0; f < nbFaces; f++) {\r\n const len = faceVertexData[f].positions!.length;\r\n facePositions[f] = [];\r\n faceNormals[f] = [];\r\n for (let p = 0; p < len / 3; p++) {\r\n facePositions[f].push(new Vector3(faceVertexData[f].positions![3 * p], faceVertexData[f].positions![3 * p + 1], faceVertexData[f].positions![3 * p + 2]));\r\n faceNormals[f].push(new Vector3(faceVertexData[f].normals![3 * p], faceVertexData[f].normals![3 * p + 1], faceVertexData[f].normals![3 * p + 2]));\r\n }\r\n // uvs\r\n lu = faceVertexData[f].uvs!.length;\r\n newFaceUV[f] = [];\r\n for (let i = 0; i < lu; i += 2) {\r\n newFaceUV[f][i] = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * faceVertexData[f].uvs![i];\r\n newFaceUV[f][i + 1] = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * faceVertexData[f].uvs![i + 1];\r\n\r\n if (CompatibilityOptions.UseOpenGLOrientationForUV) {\r\n newFaceUV[f][i + 1] = 1.0 - newFaceUV[f][i + 1];\r\n }\r\n }\r\n uvs = uvs.concat(newFaceUV[f]);\r\n\r\n indices = indices.concat(<Array<number>>faceVertexData[f].indices!.map((x: number) => x + li));\r\n li += facePositions[f].length;\r\n if (faceColors) {\r\n for (let c = 0; c < 4; c++) {\r\n colors.push(faceColors[f].r, faceColors[f].g, faceColors[f].b, faceColors[f].a);\r\n }\r\n }\r\n }\r\n\r\n const vec0 = new Vector3(0, 0, halfDepth);\r\n const mtrx0 = Matrix.RotationY(Math.PI);\r\n positions = facePositions[0]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx0).add(vec0))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), []);\r\n normals = faceNormals[0]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx0))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), []);\r\n positions = positions.concat(\r\n facePositions[1]\r\n .map((entry) => entry.subtract(vec0))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(faceNormals[1].map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), []));\r\n\r\n const vec2 = new Vector3(halfWidth, 0, 0);\r\n const mtrx2 = Matrix.RotationY(-Math.PI / 2);\r\n positions = positions.concat(\r\n facePositions[2]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx2).add(vec2))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(\r\n faceNormals[2]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx2))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n const mtrx3 = Matrix.RotationY(Math.PI / 2);\r\n positions = positions.concat(\r\n facePositions[3]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx3).subtract(vec2))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(\r\n faceNormals[3]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx3))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n\r\n const vec4 = new Vector3(0, halfHeight, 0);\r\n const mtrx4 = Matrix.RotationX(Math.PI / 2);\r\n positions = positions.concat(\r\n facePositions[4]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx4).add(vec4))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(\r\n faceNormals[4]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx4))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n const mtrx5 = Matrix.RotationX(-Math.PI / 2);\r\n positions = positions.concat(\r\n facePositions[5]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx5).subtract(vec4))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(\r\n faceNormals[5]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx5))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n\r\n // sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a tiled box mesh\r\n * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_box\r\n * @param name defines the name of the mesh\r\n * @param options an object used to set the following optional parameters for the tiled box, required but can be empty\r\n * * pattern sets the rotation or reflection pattern for the tiles,\r\n * * size of the box\r\n * * width of the box, overwrites size\r\n * * height of the box, overwrites size\r\n * * depth of the box, overwrites size\r\n * * tileSize sets the size of a tile\r\n * * tileWidth sets the tile width and overwrites tileSize\r\n * * tileHeight sets the tile width and overwrites tileSize\r\n * * faceUV an array of 6 Vector4 elements used to set different images to each box side\r\n * * faceColors an array of 6 Color3 elements used to set different colors to each box side\r\n * * alignHorizontal places whole tiles aligned to the center, left or right of a row\r\n * * alignVertical places whole tiles aligned to the center, left or right of a column\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param options.pattern\r\n * @param options.width\r\n * @param options.height\r\n * @param options.depth\r\n * @param options.tileSize\r\n * @param options.tileWidth\r\n * @param options.tileHeight\r\n * @param options.alignHorizontal\r\n * @param options.alignVertical\r\n * @param options.faceUV\r\n * @param options.faceColors\r\n * @param options.sideOrientation\r\n * @param options.updatable\r\n * @param scene defines the hosting scene\r\n * @returns the box mesh\r\n */\r\nexport function CreateTiledBox(\r\n name: string,\r\n options: {\r\n pattern?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n tileSize?: number;\r\n tileWidth?: number;\r\n tileHeight?: number;\r\n alignHorizontal?: number;\r\n alignVertical?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n sideOrientation?: number;\r\n updatable?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const box = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n box._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateTiledBoxVertexData(options);\r\n\r\n vertexData.applyToMesh(box, options.updatable);\r\n\r\n return box;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use CreateTiledBox instead\r\n */\r\nexport const TiledBoxBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateTiledBox,\r\n};\r\n\r\nVertexData.CreateTiledBox = CreateTiledBoxVertexData;\r\n"]}
1
+ {"version":3,"file":"tiledBoxBuilder.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Meshes/Builders/tiledBoxBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAcxC;IACG,MAAM,OAAO,GAAG,CAAC,CAAC;IAElB,MAAM,MAAM,GAAc,OAAO,CAAC,MAAM,IAAI,IAAI,KAAK,CAAU,CAAC,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;IAEjD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,OAAO,CAAC,SA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c;CACjB,CAAC;AAEF,UAAU,CAAC,cAAc,GAAG,wBAAwB,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Matrix, Vector3, Vector4 } from \"../../Maths/math.vector\";\r\nimport { Color4 } from \"../../Maths/math.color\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { CreateTiledPlaneVertexData } from \"./tiledPlaneBuilder\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData for a tiled box\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box\r\n * @param options an object used to set the following optional parameters for the tiled box, required but can be empty\r\n * * pattern sets the rotation or reflection pattern for the tiles,\r\n * * size of the box\r\n * * width of the box, overwrites size\r\n * * height of the box, overwrites size\r\n * * depth of the box, overwrites size\r\n * * tileSize sets the size of a tile\r\n * * tileWidth sets the tile width and overwrites tileSize\r\n * * tileHeight sets the tile width and overwrites tileSize\r\n * * faceUV an array of 6 Vector4 elements used to set different images to each box side\r\n * * faceColors an array of 6 Color3 elements used to set different colors to each box side\r\n * * alignHorizontal places whole tiles aligned to the center, left or right of a row\r\n * * alignVertical places whole tiles aligned to the center, left or right of a column\r\n * @param options.pattern\r\n * @param options.size\r\n * @param options.width\r\n * @param options.height\r\n * @param options.depth\r\n * @param options.tileSize\r\n * @param options.tileWidth\r\n * @param options.tileHeight\r\n * @param options.faceUV\r\n * @param options.faceColors\r\n * @param options.alignHorizontal\r\n * @param options.alignVertical\r\n * @param options.sideOrientation\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @returns the VertexData of the TiledBox\r\n */\r\nexport function CreateTiledBoxVertexData(options: {\r\n pattern?: number;\r\n size?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n tileSize?: number;\r\n tileWidth?: number;\r\n tileHeight?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n alignHorizontal?: number;\r\n alignVertical?: number;\r\n sideOrientation?: number;\r\n}): VertexData {\r\n const nbFaces = 6;\r\n\r\n const faceUV: Vector4[] = options.faceUV || new Array<Vector4>(6);\r\n const faceColors = options.faceColors;\r\n\r\n const flipTile = options.pattern || Mesh.NO_FLIP;\r\n\r\n const width = options.width || options.size || 1;\r\n const height = options.height || options.size || 1;\r\n const depth = options.depth || options.size || 1;\r\n const tileWidth = options.tileWidth || options.tileSize || 1;\r\n const tileHeight = options.tileHeight || options.tileSize || 1;\r\n const alignH = options.alignHorizontal || 0;\r\n const alignV = options.alignVertical || 0;\r\n\r\n const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < nbFaces; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const halfWidth = width / 2;\r\n const halfHeight = height / 2;\r\n const halfDepth = depth / 2;\r\n\r\n const faceVertexData: Array<VertexData> = [];\r\n\r\n for (let f = 0; f < 2; f++) {\r\n //front and back\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: height,\r\n alignVertical: alignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n for (let f = 2; f < 4; f++) {\r\n //sides\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: depth,\r\n height: height,\r\n alignVertical: alignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n let baseAlignV = alignV;\r\n if (alignV === Mesh.BOTTOM) {\r\n baseAlignV = Mesh.TOP;\r\n } else if (alignV === Mesh.TOP) {\r\n baseAlignV = Mesh.BOTTOM;\r\n }\r\n\r\n for (let f = 4; f < 6; f++) {\r\n //top and bottom\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: depth,\r\n alignVertical: baseAlignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n let positions: Array<number> = [];\r\n let normals: Array<number> = [];\r\n let uvs: Array<number> = [];\r\n let indices: Array<number> = [];\r\n const colors: Array<number> = [];\r\n const facePositions: Array<Array<Vector3>> = [];\r\n const faceNormals: Array<Array<Vector3>> = [];\r\n\r\n const newFaceUV: Array<Array<number>> = [];\r\n let lu: number = 0;\r\n\r\n let li: number = 0;\r\n\r\n for (let f = 0; f < nbFaces; f++) {\r\n const len = faceVertexData[f].positions!.length;\r\n facePositions[f] = [];\r\n faceNormals[f] = [];\r\n for (let p = 0; p < len / 3; p++) {\r\n facePositions[f].push(new Vector3(faceVertexData[f].positions![3 * p], faceVertexData[f].positions![3 * p + 1], faceVertexData[f].positions![3 * p + 2]));\r\n faceNormals[f].push(new Vector3(faceVertexData[f].normals![3 * p], faceVertexData[f].normals![3 * p + 1], faceVertexData[f].normals![3 * p + 2]));\r\n }\r\n // uvs\r\n lu = faceVertexData[f].uvs!.length;\r\n newFaceUV[f] = [];\r\n for (let i = 0; i < lu; i += 2) {\r\n newFaceUV[f][i] = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * faceVertexData[f].uvs![i];\r\n newFaceUV[f][i + 1] = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * faceVertexData[f].uvs![i + 1];\r\n\r\n if (CompatibilityOptions.UseOpenGLOrientationForUV) {\r\n newFaceUV[f][i + 1] = 1.0 - newFaceUV[f][i + 1];\r\n }\r\n }\r\n uvs = uvs.concat(newFaceUV[f]);\r\n\r\n indices = indices.concat(<Array<number>>faceVertexData[f].indices!.map((x: number) => x + li));\r\n li += facePositions[f].length;\r\n if (faceColors) {\r\n for (let c = 0; c < 4; c++) {\r\n colors.push(faceColors[f].r, faceColors[f].g, faceColors[f].b, faceColors[f].a);\r\n }\r\n }\r\n }\r\n\r\n const vec0 = new Vector3(0, 0, halfDepth);\r\n const mtrx0 = Matrix.RotationY(Math.PI);\r\n positions = facePositions[0]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx0).add(vec0))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), []);\r\n normals = faceNormals[0]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx0))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), []);\r\n positions = positions.concat(\r\n facePositions[1]\r\n .map((entry) => entry.subtract(vec0))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(faceNormals[1].map((entry) => [entry.x, entry.y, entry.z]).reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), []));\r\n\r\n const vec2 = new Vector3(halfWidth, 0, 0);\r\n const mtrx2 = Matrix.RotationY(-Math.PI / 2);\r\n positions = positions.concat(\r\n facePositions[2]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx2).add(vec2))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(\r\n faceNormals[2]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx2))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n const mtrx3 = Matrix.RotationY(Math.PI / 2);\r\n positions = positions.concat(\r\n facePositions[3]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx3).subtract(vec2))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(\r\n faceNormals[3]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx3))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n\r\n const vec4 = new Vector3(0, halfHeight, 0);\r\n const mtrx4 = Matrix.RotationX(Math.PI / 2);\r\n positions = positions.concat(\r\n facePositions[4]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx4).add(vec4))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(\r\n faceNormals[4]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx4))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n const mtrx5 = Matrix.RotationX(-Math.PI / 2);\r\n positions = positions.concat(\r\n facePositions[5]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx5).subtract(vec4))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n normals = normals.concat(\r\n faceNormals[5]\r\n .map((entry) => Vector3.TransformNormal(entry, mtrx5))\r\n .map((entry) => [entry.x, entry.y, entry.z])\r\n .reduce((accumulator: Array<number>, currentValue) => accumulator.concat(currentValue), [])\r\n );\r\n\r\n // sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a tiled box mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box\r\n * @param name defines the name of the mesh\r\n * @param options an object used to set the following optional parameters for the tiled box, required but can be empty\r\n * * pattern sets the rotation or reflection pattern for the tiles,\r\n * * size of the box\r\n * * width of the box, overwrites size\r\n * * height of the box, overwrites size\r\n * * depth of the box, overwrites size\r\n * * tileSize sets the size of a tile\r\n * * tileWidth sets the tile width and overwrites tileSize\r\n * * tileHeight sets the tile width and overwrites tileSize\r\n * * faceUV an array of 6 Vector4 elements used to set different images to each box side\r\n * * faceColors an array of 6 Color3 elements used to set different colors to each box side\r\n * * alignHorizontal places whole tiles aligned to the center, left or right of a row\r\n * * alignVertical places whole tiles aligned to the center, left or right of a column\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param options.pattern\r\n * @param options.width\r\n * @param options.height\r\n * @param options.depth\r\n * @param options.tileSize\r\n * @param options.tileWidth\r\n * @param options.tileHeight\r\n * @param options.alignHorizontal\r\n * @param options.alignVertical\r\n * @param options.faceUV\r\n * @param options.faceColors\r\n * @param options.sideOrientation\r\n * @param options.updatable\r\n * @param scene defines the hosting scene\r\n * @returns the box mesh\r\n */\r\nexport function CreateTiledBox(\r\n name: string,\r\n options: {\r\n pattern?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n tileSize?: number;\r\n tileWidth?: number;\r\n tileHeight?: number;\r\n alignHorizontal?: number;\r\n alignVertical?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n sideOrientation?: number;\r\n updatable?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const box = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n box._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateTiledBoxVertexData(options);\r\n\r\n vertexData.applyToMesh(box, options.updatable);\r\n\r\n return box;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use CreateTiledBox instead\r\n */\r\nexport const TiledBoxBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateTiledBox,\r\n};\r\n\r\nVertexData.CreateTiledBox = CreateTiledBoxVertexData;\r\n"]}
@@ -5,7 +5,7 @@ import { Mesh } from "../mesh";
5
5
  import { VertexData } from "../mesh.vertexData";
6
6
  /**
7
7
  * Creates the VertexData for a tiled plane
8
- * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_plane
8
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_plane
9
9
  * @param options an object used to set the following optional parameters for the tiled plane, required but can be empty
10
10
  * * pattern a limited pattern arrangement depending on the number
11
11
  * * size of the box
@@ -49,7 +49,7 @@ export declare function CreateTiledPlaneVertexData(options: {
49
49
  }): VertexData;
50
50
  /**
51
51
  * Creates a tiled plane mesh
52
- * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_plane
52
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_plane
53
53
  * @param name defines the name of the mesh
54
54
  * @param options an object used to set the following optional parameters for the tiled plane, required but can be empty
55
55
  * * pattern a limited pattern arrangement depending on the number
@@ -2,7 +2,7 @@ import { Mesh } from "../mesh.js";
2
2
  import { VertexData } from "../mesh.vertexData.js";
3
3
  /**
4
4
  * Creates the VertexData for a tiled plane
5
- * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_plane
5
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_plane
6
6
  * @param options an object used to set the following optional parameters for the tiled plane, required but can be empty
7
7
  * * pattern a limited pattern arrangement depending on the number
8
8
  * * size of the box
@@ -404,7 +404,7 @@ export function CreateTiledPlaneVertexData(options) {
404
404
  }
405
405
  /**
406
406
  * Creates a tiled plane mesh
407
- * @see https://doc.babylonjs.com/divingDeeper/mesh/creation/set/tiled_plane
407
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_plane
408
408
  * @param name defines the name of the mesh
409
409
  * @param options an object used to set the following optional parameters for the tiled plane, required but can be empty
410
410
  * * pattern a limited pattern arrangement depending on the number