@onerjs/core 8.53.5 → 8.53.7

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 (841) hide show
  1. package/Animations/animationGroup.d.ts +0 -1
  2. package/Animations/animationGroup.js +0 -1
  3. package/Animations/animationGroup.js.map +1 -1
  4. package/Animations/animationGroup.pure.js +2 -0
  5. package/Animations/animationGroup.pure.js.map +1 -1
  6. package/Animations/runtimeAnimation.js +11 -0
  7. package/Animations/runtimeAnimation.js.map +1 -1
  8. package/Audio/audioSceneComponent.pure.js +1 -1
  9. package/AudioV2/abstractAudio/abstractSound.d.ts +2 -1
  10. package/AudioV2/abstractAudio/abstractSound.js +7 -2
  11. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  12. package/AudioV2/abstractAudio/abstractSoundInstance.d.ts +3 -1
  13. package/AudioV2/abstractAudio/abstractSoundInstance.js.map +1 -1
  14. package/AudioV2/abstractAudio/staticSound.d.ts +6 -0
  15. package/AudioV2/abstractAudio/staticSound.js +17 -1
  16. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  17. package/AudioV2/abstractAudio/staticSoundInstance.d.ts +4 -2
  18. package/AudioV2/abstractAudio/staticSoundInstance.js.map +1 -1
  19. package/AudioV2/abstractAudio/streamingSound.d.ts +6 -0
  20. package/AudioV2/abstractAudio/streamingSound.js +9 -1
  21. package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
  22. package/AudioV2/webAudio/webAudioStaticSound.d.ts +7 -1
  23. package/AudioV2/webAudio/webAudioStaticSound.js +56 -8
  24. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  25. package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -1
  26. package/AudioV2/webAudio/webAudioStreamingSound.js +16 -4
  27. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  28. package/BakedVertexAnimation/bakedVertexAnimationManager.d.ts +2 -2
  29. package/BakedVertexAnimation/bakedVertexAnimationManager.js +151 -121
  30. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  31. package/Behaviors/Cameras/interpolatingBehavior.d.ts +17 -2
  32. package/Behaviors/Cameras/interpolatingBehavior.js +53 -23
  33. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
  34. package/Bones/bone.pure.js +3 -3
  35. package/Buffers/buffer.pure.js +0 -12
  36. package/Buffers/buffer.pure.js.map +1 -1
  37. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +141 -126
  38. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  39. package/Cameras/Inputs/BaseCameraPointersInput.d.ts +2 -1
  40. package/Cameras/Inputs/BaseCameraPointersInput.js +290 -277
  41. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  42. package/Cameras/Inputs/arcRotateCameraGamepadInput.js +115 -102
  43. package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
  44. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.d.ts +3 -0
  45. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +334 -273
  46. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  47. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +273 -258
  48. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  49. package/Cameras/Inputs/arcRotateCameraPointersInput.js +237 -213
  50. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  51. package/Cameras/Inputs/flyCameraKeyboardInput.js +199 -168
  52. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  53. package/Cameras/Inputs/flyCameraMouseInput.js +243 -229
  54. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  55. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +311 -266
  56. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  57. package/Cameras/Inputs/followCameraMouseWheelInput.js +139 -119
  58. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  59. package/Cameras/Inputs/followCameraPointersInput.js +239 -203
  60. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  61. package/Cameras/Inputs/freeCameraGamepadInput.js +127 -114
  62. package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
  63. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +278 -244
  64. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  65. package/Cameras/Inputs/freeCameraMouseInput.js +216 -202
  66. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  67. package/Cameras/Inputs/freeCameraMouseWheelInput.js +368 -353
  68. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  69. package/Cameras/Inputs/freeCameraTouchInput.js +185 -172
  70. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  71. package/Cameras/Inputs/geospatialCameraKeyboardInput.d.ts +2 -0
  72. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +291 -246
  73. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
  74. package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +11 -1
  75. package/Cameras/Inputs/geospatialCameraPointersInput.js +18 -2
  76. package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
  77. package/Cameras/Inputs/orbitCameraPointersInput.js +112 -96
  78. package/Cameras/Inputs/orbitCameraPointersInput.js.map +1 -1
  79. package/Cameras/VR/vrExperienceHelper.d.ts +0 -2
  80. package/Cameras/VR/vrExperienceHelper.js +0 -2
  81. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  82. package/Cameras/VR/vrExperienceHelper.pure.js +5 -0
  83. package/Cameras/VR/vrExperienceHelper.pure.js.map +1 -1
  84. package/Cameras/arcRotateCamera.pure.js +1559 -1479
  85. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  86. package/Cameras/camera.pure.js +1225 -1178
  87. package/Cameras/camera.pure.js.map +1 -1
  88. package/Cameras/flyCamera.pure.js +369 -351
  89. package/Cameras/flyCamera.pure.js.map +1 -1
  90. package/Cameras/followCamera.pure.js +229 -192
  91. package/Cameras/followCamera.pure.js.map +1 -1
  92. package/Cameras/freeCamera.pure.js +373 -351
  93. package/Cameras/freeCamera.pure.js.map +1 -1
  94. package/Cameras/geospatialCamera.pure.d.ts +30 -7
  95. package/Cameras/geospatialCamera.pure.js +502 -457
  96. package/Cameras/geospatialCamera.pure.js.map +1 -1
  97. package/Cameras/geospatialCameraMovement.js +2 -2
  98. package/Cameras/geospatialCameraMovement.js.map +1 -1
  99. package/Cameras/targetCamera.pure.d.ts +7 -0
  100. package/Cameras/targetCamera.pure.js +550 -509
  101. package/Cameras/targetCamera.pure.js.map +1 -1
  102. package/Cameras/universalCamera.pure.js +98 -85
  103. package/Cameras/universalCamera.pure.js.map +1 -1
  104. package/Collisions/gpuPicker.d.ts +111 -4
  105. package/Collisions/gpuPicker.js +696 -119
  106. package/Collisions/gpuPicker.js.map +1 -1
  107. package/Compute/computeShader.pure.js +372 -355
  108. package/Compute/computeShader.pure.js.map +1 -1
  109. package/Culling/Helper/transformFeedbackBoundingHelper.pure.js +2 -2
  110. package/Decorators/nodeDecorator.d.ts +11 -1
  111. package/Decorators/nodeDecorator.js +43 -6
  112. package/Decorators/nodeDecorator.js.map +1 -1
  113. package/Engines/AbstractEngine/abstractEngine.loadFile.pure.js +8 -0
  114. package/Engines/AbstractEngine/abstractEngine.loadFile.pure.js.map +1 -1
  115. package/Engines/Native/nativeHelpers.js +15 -0
  116. package/Engines/Native/nativeHelpers.js.map +1 -1
  117. package/Engines/Native/nativeInterfaces.d.ts +7 -2
  118. package/Engines/Native/nativeInterfaces.js.map +1 -1
  119. package/Engines/Native/nativeRenderTargetWrapper.d.ts +5 -0
  120. package/Engines/Native/nativeRenderTargetWrapper.js +35 -1
  121. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  122. package/Engines/Processors/shaderProcessor.js +5 -3
  123. package/Engines/Processors/shaderProcessor.js.map +1 -1
  124. package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js +16 -3
  125. package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js.map +1 -1
  126. package/Engines/WebGPU/webgpuClearQuad.pure.js +7 -1
  127. package/Engines/WebGPU/webgpuClearQuad.pure.js.map +1 -1
  128. package/Engines/abstractEngine.functions.d.ts +8 -2
  129. package/Engines/abstractEngine.functions.js +12 -4
  130. package/Engines/abstractEngine.functions.js.map +1 -1
  131. package/Engines/abstractEngine.pure.d.ts +20 -1
  132. package/Engines/abstractEngine.pure.js +21 -134
  133. package/Engines/abstractEngine.pure.js.map +1 -1
  134. package/Engines/engine.d.ts +208 -0
  135. package/Engines/engine.pure.js +0 -15
  136. package/Engines/engine.pure.js.map +1 -1
  137. package/Engines/nullEngine.pure.d.ts +66 -0
  138. package/Engines/nullEngine.pure.js +97 -0
  139. package/Engines/nullEngine.pure.js.map +1 -1
  140. package/Engines/thinEngine.pure.d.ts +0 -13
  141. package/Engines/thinEngine.pure.js +4 -23
  142. package/Engines/thinEngine.pure.js.map +1 -1
  143. package/Engines/thinNativeEngine.d.ts +0 -1
  144. package/Engines/thinNativeEngine.js +0 -1
  145. package/Engines/thinNativeEngine.js.map +1 -1
  146. package/Engines/thinNativeEngine.pure.d.ts +27 -0
  147. package/Engines/thinNativeEngine.pure.js +383 -17
  148. package/Engines/thinNativeEngine.pure.js.map +1 -1
  149. package/Engines/webgpuEngine.d.ts +1 -0
  150. package/Engines/webgpuEngine.js +1 -0
  151. package/Engines/webgpuEngine.js.map +1 -1
  152. package/Engines/webgpuEngine.pure.d.ts +9 -0
  153. package/Engines/webgpuEngine.pure.js +7 -0
  154. package/Engines/webgpuEngine.pure.js.map +1 -1
  155. package/FlowGraph/flowGraph.js +9 -0
  156. package/FlowGraph/flowGraph.js.map +1 -1
  157. package/FlowGraph/flowGraphContext.js +597 -584
  158. package/FlowGraph/flowGraphContext.js.map +1 -1
  159. package/FlowGraph/flowGraphDataConnection.pure.d.ts +14 -0
  160. package/FlowGraph/flowGraphDataConnection.pure.js +38 -1
  161. package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
  162. package/FlowGraph/serialization.d.ts +11 -0
  163. package/FlowGraph/serialization.js +11 -1
  164. package/FlowGraph/serialization.js.map +1 -1
  165. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.pure.js +182 -170
  166. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.pure.js.map +1 -1
  167. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.pure.js +196 -184
  168. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.pure.js.map +1 -1
  169. package/FrameGraph/Node/Blocks/Layers/selectionOutlineLayerBlock.pure.js +222 -210
  170. package/FrameGraph/Node/Blocks/Layers/selectionOutlineLayerBlock.pure.js.map +1 -1
  171. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +123 -111
  172. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
  173. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js +158 -146
  174. package/FrameGraph/Node/Blocks/PostProcesses/baseWithPropertiesPostProcessBlock.js.map +1 -1
  175. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.pure.js +63 -51
  176. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.pure.js.map +1 -1
  177. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.pure.js +122 -110
  178. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.pure.js.map +1 -1
  179. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.pure.js +76 -64
  180. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.pure.js.map +1 -1
  181. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.pure.js +89 -77
  182. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.pure.js.map +1 -1
  183. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.pure.js +134 -122
  184. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.pure.js.map +1 -1
  185. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.pure.js +58 -46
  186. package/FrameGraph/Node/Blocks/PostProcesses/colorCorrectionPostProcessBlock.pure.js.map +1 -1
  187. package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.pure.js +107 -95
  188. package/FrameGraph/Node/Blocks/PostProcesses/convolutionPostProcessBlock.pure.js.map +1 -1
  189. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.pure.js +181 -169
  190. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.pure.js.map +1 -1
  191. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.pure.js +63 -51
  192. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.pure.js.map +1 -1
  193. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.pure.js +63 -51
  194. package/FrameGraph/Node/Blocks/PostProcesses/filterPostProcessBlock.pure.js.map +1 -1
  195. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.pure.js +76 -64
  196. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.pure.js.map +1 -1
  197. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.pure.js +246 -234
  198. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.pure.js.map +1 -1
  199. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.pure.js +108 -96
  200. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.pure.js.map +1 -1
  201. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.pure.js +87 -75
  202. package/FrameGraph/Node/Blocks/PostProcesses/screenSpaceCurvaturePostProcessBlock.pure.js.map +1 -1
  203. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.pure.js +76 -64
  204. package/FrameGraph/Node/Blocks/PostProcesses/sharpenPostProcessBlock.pure.js.map +1 -1
  205. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.pure.js +313 -301
  206. package/FrameGraph/Node/Blocks/PostProcesses/ssao2PostProcessBlock.pure.js.map +1 -1
  207. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.js +502 -490
  208. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.pure.js.map +1 -1
  209. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.pure.js +147 -135
  210. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.pure.js.map +1 -1
  211. package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.pure.js +90 -78
  212. package/FrameGraph/Node/Blocks/PostProcesses/tonemapPostProcessBlock.pure.js.map +1 -1
  213. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.pure.js +179 -167
  214. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.pure.js.map +1 -1
  215. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +462 -451
  216. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  217. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +265 -253
  218. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
  219. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.pure.js +204 -192
  220. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.pure.js.map +1 -1
  221. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +611 -550
  222. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
  223. package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.pure.js +320 -308
  224. package/FrameGraph/Node/Blocks/Rendering/iblShadowsRendererBlock.pure.js.map +1 -1
  225. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.pure.js +87 -75
  226. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.pure.js.map +1 -1
  227. package/FrameGraph/Node/Blocks/Textures/clearBlock.pure.js +154 -142
  228. package/FrameGraph/Node/Blocks/Textures/clearBlock.pure.js.map +1 -1
  229. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.pure.js +150 -138
  230. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.pure.js.map +1 -1
  231. package/FrameGraph/Node/Blocks/inputBlock.pure.js +270 -256
  232. package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
  233. package/FrameGraph/Node/Blocks/lightingVolumeBlock.pure.js +95 -83
  234. package/FrameGraph/Node/Blocks/lightingVolumeBlock.pure.js.map +1 -1
  235. package/FrameGraph/Node/nodeRenderGraph.js +715 -693
  236. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  237. package/FrameGraph/Node/nodeRenderGraphBlock.js +548 -533
  238. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  239. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.d.ts +2 -2
  240. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js +43 -51
  241. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js.map +1 -1
  242. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.d.ts +0 -1
  243. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js +0 -1
  244. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.js.map +1 -1
  245. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.d.ts +0 -1
  246. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js +66 -35
  247. package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js.map +1 -1
  248. package/Helpers/environmentHelper.js +2 -2
  249. package/Helpers/environmentHelper.js.map +1 -1
  250. package/Layers/effectLayer.js +529 -519
  251. package/Layers/effectLayer.js.map +1 -1
  252. package/Layers/glowLayer.pure.js +428 -413
  253. package/Layers/glowLayer.pure.js.map +1 -1
  254. package/Layers/highlightLayer.pure.js +473 -458
  255. package/Layers/highlightLayer.pure.js.map +1 -1
  256. package/Layers/selectionOutlineLayer.pure.js +360 -345
  257. package/Layers/selectionOutlineLayer.pure.js.map +1 -1
  258. package/Lights/Clustered/clusteredLightContainer.pure.d.ts +1 -1
  259. package/Lights/Clustered/clusteredLightContainer.pure.js +583 -558
  260. package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
  261. package/Lights/Shadows/shadowGenerator.js +6 -1
  262. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  263. package/Lights/areaLight.pure.js +61 -39
  264. package/Lights/areaLight.pure.js.map +1 -1
  265. package/Lights/directionalLight.pure.js +308 -284
  266. package/Lights/directionalLight.pure.js.map +1 -1
  267. package/Lights/hemisphericLight.pure.js +123 -104
  268. package/Lights/hemisphericLight.pure.js.map +1 -1
  269. package/Lights/light.d.ts +5 -3
  270. package/Lights/light.js +869 -827
  271. package/Lights/light.js.map +1 -1
  272. package/Lights/pointLight.pure.js +185 -174
  273. package/Lights/pointLight.pure.js.map +1 -1
  274. package/Lights/rectAreaLight.pure.d.ts +17 -0
  275. package/Lights/rectAreaLight.pure.js +238 -159
  276. package/Lights/rectAreaLight.pure.js.map +1 -1
  277. package/Lights/shadowLight.js +280 -268
  278. package/Lights/shadowLight.js.map +1 -1
  279. package/Lights/spotLight.pure.js +460 -427
  280. package/Lights/spotLight.pure.js.map +1 -1
  281. package/Loading/Plugins/babylonFileLoader.pure.js +17 -5
  282. package/Loading/Plugins/babylonFileLoader.pure.js.map +1 -1
  283. package/Loading/sceneLoader.d.ts +5 -1
  284. package/Loading/sceneLoader.js +299 -402
  285. package/Loading/sceneLoader.js.map +1 -1
  286. package/Materials/Background/backgroundMaterial.pure.d.ts +18 -18
  287. package/Materials/Background/backgroundMaterial.pure.js +949 -794
  288. package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
  289. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.d.ts +15 -0
  290. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +34 -1
  291. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
  292. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +9 -0
  293. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +26 -2
  294. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  295. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.d.ts +2 -1
  296. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +169 -149
  297. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
  298. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +1 -1
  299. package/Materials/Node/Blocks/Dual/lightBlock.pure.js +442 -429
  300. package/Materials/Node/Blocks/Dual/lightBlock.pure.js.map +1 -1
  301. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.pure.js +396 -383
  302. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.pure.js.map +1 -1
  303. package/Materials/Node/Blocks/Dual/sceneDepthBlock.pure.js +237 -220
  304. package/Materials/Node/Blocks/Dual/sceneDepthBlock.pure.js.map +1 -1
  305. package/Materials/Node/Blocks/Dual/textureBlock.pure.js +1 -1
  306. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.pure.js +150 -133
  307. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.pure.js.map +1 -1
  308. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +265 -250
  309. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
  310. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.pure.js +159 -142
  311. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.pure.js.map +1 -1
  312. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js +214 -201
  313. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js.map +1 -1
  314. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.pure.js +419 -400
  315. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.pure.js.map +1 -1
  316. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +3 -1
  317. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
  318. package/Materials/Node/Blocks/PBR/clearCoatBlock.pure.js +302 -289
  319. package/Materials/Node/Blocks/PBR/clearCoatBlock.pure.js.map +1 -1
  320. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +1327 -1272
  321. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
  322. package/Materials/Node/Blocks/PBR/reflectionBlock.pure.js +352 -337
  323. package/Materials/Node/Blocks/PBR/reflectionBlock.pure.js.map +1 -1
  324. package/Materials/Node/Blocks/PBR/refractionBlock.pure.js +297 -277
  325. package/Materials/Node/Blocks/PBR/refractionBlock.pure.js.map +1 -1
  326. package/Materials/Node/Blocks/PBR/sheenBlock.pure.js +146 -131
  327. package/Materials/Node/Blocks/PBR/sheenBlock.pure.js.map +1 -1
  328. package/Materials/Node/Blocks/PBR/subSurfaceBlock.pure.js +158 -145
  329. package/Materials/Node/Blocks/PBR/subSurfaceBlock.pure.js.map +1 -1
  330. package/Materials/Node/Blocks/clampBlock.pure.js +92 -77
  331. package/Materials/Node/Blocks/clampBlock.pure.js.map +1 -1
  332. package/Materials/Node/Blocks/cloudBlock.pure.js +145 -132
  333. package/Materials/Node/Blocks/cloudBlock.pure.js.map +1 -1
  334. package/Materials/Node/Blocks/conditionalBlock.pure.js +182 -169
  335. package/Materials/Node/Blocks/conditionalBlock.pure.js.map +1 -1
  336. package/Materials/Node/Blocks/curveBlock.pure.js +259 -246
  337. package/Materials/Node/Blocks/curveBlock.pure.js.map +1 -1
  338. package/Materials/Node/Blocks/debugBlock.pure.js +119 -106
  339. package/Materials/Node/Blocks/debugBlock.pure.js.map +1 -1
  340. package/Materials/Node/Blocks/loopBlock.pure.js +123 -110
  341. package/Materials/Node/Blocks/loopBlock.pure.js.map +1 -1
  342. package/Materials/Node/Blocks/meshAttributeExistsBlock.pure.js +185 -172
  343. package/Materials/Node/Blocks/meshAttributeExistsBlock.pure.js.map +1 -1
  344. package/Materials/Node/Blocks/remapBlock.pure.js +127 -112
  345. package/Materials/Node/Blocks/remapBlock.pure.js.map +1 -1
  346. package/Materials/Node/Blocks/transformBlock.pure.js +196 -185
  347. package/Materials/Node/Blocks/transformBlock.pure.js.map +1 -1
  348. package/Materials/Node/Blocks/triPlanarBlock.pure.js +451 -438
  349. package/Materials/Node/Blocks/triPlanarBlock.pure.js.map +1 -1
  350. package/Materials/Node/Blocks/trigonometryBlock.pure.js +184 -171
  351. package/Materials/Node/Blocks/trigonometryBlock.pure.js.map +1 -1
  352. package/Materials/Node/Blocks/waveBlock.pure.js +97 -84
  353. package/Materials/Node/Blocks/waveBlock.pure.js.map +1 -1
  354. package/Materials/Node/Blocks/worleyNoise3DBlock.pure.js +276 -263
  355. package/Materials/Node/Blocks/worleyNoise3DBlock.pure.js.map +1 -1
  356. package/Materials/Node/nodeMaterial.pure.js +1765 -1737
  357. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  358. package/Materials/Node/nodeMaterialBuildState.d.ts +3 -3
  359. package/Materials/PBR/openpbrMaterial.pure.d.ts +102 -102
  360. package/Materials/PBR/openpbrMaterial.pure.js +3115 -2243
  361. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  362. package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +3 -3
  363. package/Materials/PBR/pbrAnisotropicConfiguration.js +255 -227
  364. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  365. package/Materials/PBR/pbrBRDFConfiguration.d.ts +9 -9
  366. package/Materials/PBR/pbrBRDFConfiguration.js +203 -155
  367. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  368. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +1 -1
  369. package/Materials/PBR/pbrBaseMaterial.pure.js +1751 -1736
  370. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  371. package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +13 -13
  372. package/Materials/PBR/pbrBaseSimpleMaterial.js +205 -117
  373. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  374. package/Materials/PBR/pbrClearCoatConfiguration.d.ts +9 -9
  375. package/Materials/PBR/pbrClearCoatConfiguration.js +464 -406
  376. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  377. package/Materials/PBR/pbrIridescenceConfiguration.d.ts +3 -3
  378. package/Materials/PBR/pbrIridescenceConfiguration.js +271 -239
  379. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  380. package/Materials/PBR/pbrMaterial.pure.d.ts +66 -66
  381. package/Materials/PBR/pbrMaterial.pure.js +1041 -685
  382. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  383. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.d.ts +5 -5
  384. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.js +176 -115
  385. package/Materials/PBR/pbrMetallicRoughnessMaterial.pure.js.map +1 -1
  386. package/Materials/PBR/pbrSheenConfiguration.d.ts +7 -7
  387. package/Materials/PBR/pbrSheenConfiguration.js +314 -270
  388. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  389. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.d.ts +5 -5
  390. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.js +172 -117
  391. package/Materials/PBR/pbrSpecularGlossinessMaterial.pure.js.map +1 -1
  392. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +16 -16
  393. package/Materials/PBR/pbrSubSurfaceConfiguration.js +864 -764
  394. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  395. package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +43 -0
  396. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +64 -0
  397. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -0
  398. package/Materials/Textures/HTML/htmlInteractionManager.d.ts +69 -0
  399. package/Materials/Textures/HTML/htmlInteractionManager.js +130 -0
  400. package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -0
  401. package/Materials/Textures/HTML/htmlRaycastInteractionManager.d.ts +84 -0
  402. package/Materials/Textures/HTML/htmlRaycastInteractionManager.js +246 -0
  403. package/Materials/Textures/HTML/htmlRaycastInteractionManager.js.map +1 -0
  404. package/Materials/Textures/HTML/htmlTexture.d.ts +148 -0
  405. package/Materials/Textures/HTML/htmlTexture.js +455 -0
  406. package/Materials/Textures/HTML/htmlTexture.js.map +1 -0
  407. package/Materials/Textures/HTML/index.d.ts +4 -0
  408. package/Materials/Textures/HTML/index.js +5 -0
  409. package/Materials/Textures/HTML/index.js.map +1 -0
  410. package/Materials/Textures/HTML/pure.d.ts +5 -0
  411. package/Materials/Textures/HTML/pure.js +6 -0
  412. package/Materials/Textures/HTML/pure.js.map +1 -0
  413. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +671 -643
  414. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  415. package/Materials/Textures/baseTexture.pure.js +880 -825
  416. package/Materials/Textures/baseTexture.pure.js.map +1 -1
  417. package/Materials/Textures/cubeTexture.d.ts +0 -1
  418. package/Materials/Textures/cubeTexture.js +0 -1
  419. package/Materials/Textures/cubeTexture.js.map +1 -1
  420. package/Materials/Textures/cubeTexture.pure.js +368 -333
  421. package/Materials/Textures/cubeTexture.pure.js.map +1 -1
  422. package/Materials/Textures/dynamicTexture.d.ts +0 -1
  423. package/Materials/Textures/dynamicTexture.js +0 -1
  424. package/Materials/Textures/dynamicTexture.js.map +1 -1
  425. package/Materials/Textures/dynamicTexture.pure.js +2 -0
  426. package/Materials/Textures/dynamicTexture.pure.js.map +1 -1
  427. package/Materials/Textures/htmlElementTexture.d.ts +0 -2
  428. package/Materials/Textures/htmlElementTexture.js +0 -2
  429. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  430. package/Materials/Textures/htmlElementTexture.pure.js +4 -0
  431. package/Materials/Textures/htmlElementTexture.pure.js.map +1 -1
  432. package/Materials/Textures/index.d.ts +1 -0
  433. package/Materials/Textures/index.js +1 -1
  434. package/Materials/Textures/index.js.map +1 -1
  435. package/Materials/Textures/multiRenderTarget.d.ts +0 -1
  436. package/Materials/Textures/multiRenderTarget.js +0 -1
  437. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  438. package/Materials/Textures/multiRenderTarget.pure.js +2 -0
  439. package/Materials/Textures/multiRenderTarget.pure.js.map +1 -1
  440. package/Materials/Textures/pure.d.ts +1 -0
  441. package/Materials/Textures/pure.js +1 -0
  442. package/Materials/Textures/pure.js.map +1 -1
  443. package/Materials/Textures/texture.pure.js +961 -923
  444. package/Materials/Textures/texture.pure.js.map +1 -1
  445. package/Materials/Textures/videoTexture.pure.d.ts +3 -0
  446. package/Materials/Textures/videoTexture.pure.js +450 -401
  447. package/Materials/Textures/videoTexture.pure.js.map +1 -1
  448. package/Materials/colorCurves.pure.js +510 -477
  449. package/Materials/colorCurves.pure.js.map +1 -1
  450. package/Materials/effect.pure.js +0 -7
  451. package/Materials/effect.pure.js.map +1 -1
  452. package/Materials/imageProcessing.js +12 -4
  453. package/Materials/imageProcessing.js.map +1 -1
  454. package/Materials/imageProcessingConfiguration.pure.js +647 -587
  455. package/Materials/imageProcessingConfiguration.pure.js.map +1 -1
  456. package/Materials/material.decalMapConfiguration.pure.d.ts +2 -2
  457. package/Materials/material.decalMapConfiguration.pure.js +149 -130
  458. package/Materials/material.decalMapConfiguration.pure.js.map +1 -1
  459. package/Materials/material.detailMapConfiguration.d.ts +3 -3
  460. package/Materials/material.detailMapConfiguration.js +213 -175
  461. package/Materials/material.detailMapConfiguration.js.map +1 -1
  462. package/Materials/material.pure.js +1815 -1721
  463. package/Materials/material.pure.js.map +1 -1
  464. package/Materials/materialPluginBase.pure.js +270 -249
  465. package/Materials/materialPluginBase.pure.js.map +1 -1
  466. package/Materials/materialPluginManager.pure.js +18 -8
  467. package/Materials/materialPluginManager.pure.js.map +1 -1
  468. package/Materials/materialStencilState.js +211 -200
  469. package/Materials/materialStencilState.js.map +1 -1
  470. package/Materials/meshDebugPluginMaterial.pure.d.ts +2 -2
  471. package/Materials/meshDebugPluginMaterial.pure.js +397 -275
  472. package/Materials/meshDebugPluginMaterial.pure.js.map +1 -1
  473. package/Materials/standardMaterial.pure.d.ts +32 -32
  474. package/Materials/standardMaterial.pure.js +1804 -1394
  475. package/Materials/standardMaterial.pure.js.map +1 -1
  476. package/Maths/math.color.pure.js +5 -5
  477. package/Maths/math.functions.js +38 -30
  478. package/Maths/math.functions.js.map +1 -1
  479. package/Maths/math.vector.pure.js +25 -25
  480. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +18 -8
  481. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  482. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +86 -1
  483. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +255 -104
  484. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  485. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.d.ts +39 -0
  486. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +322 -0
  487. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -0
  488. package/Meshes/GreasedLine/greasedLineMesh.pure.js +4 -4
  489. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +3 -3
  490. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +107 -94
  491. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  492. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.pure.js +276 -263
  493. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.pure.js.map +1 -1
  494. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.pure.js +247 -232
  495. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.pure.js.map +1 -1
  496. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js +299 -284
  497. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js.map +1 -1
  498. package/Meshes/Node/Blocks/Set/aggregatorBlock.pure.js +196 -181
  499. package/Meshes/Node/Blocks/Set/aggregatorBlock.pure.js.map +1 -1
  500. package/Meshes/Node/Blocks/Set/latticeBlock.pure.js +198 -179
  501. package/Meshes/Node/Blocks/Set/latticeBlock.pure.js.map +1 -1
  502. package/Meshes/Node/Blocks/Set/setColorsBlock.pure.js +151 -138
  503. package/Meshes/Node/Blocks/Set/setColorsBlock.pure.js.map +1 -1
  504. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.pure.js +107 -94
  505. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.pure.js.map +1 -1
  506. package/Meshes/Node/Blocks/Set/setNormalsBlock.pure.js +138 -125
  507. package/Meshes/Node/Blocks/Set/setNormalsBlock.pure.js.map +1 -1
  508. package/Meshes/Node/Blocks/Set/setPositionsBlock.pure.js +213 -200
  509. package/Meshes/Node/Blocks/Set/setPositionsBlock.pure.js.map +1 -1
  510. package/Meshes/Node/Blocks/Set/setTangentsBlock.pure.js +138 -125
  511. package/Meshes/Node/Blocks/Set/setTangentsBlock.pure.js.map +1 -1
  512. package/Meshes/Node/Blocks/Set/setUVsBlock.pure.js +179 -164
  513. package/Meshes/Node/Blocks/Set/setUVsBlock.pure.js.map +1 -1
  514. package/Meshes/Node/Blocks/Sources/boxBlock.pure.js +183 -170
  515. package/Meshes/Node/Blocks/Sources/boxBlock.pure.js.map +1 -1
  516. package/Meshes/Node/Blocks/Sources/capsuleBlock.pure.js +125 -112
  517. package/Meshes/Node/Blocks/Sources/capsuleBlock.pure.js.map +1 -1
  518. package/Meshes/Node/Blocks/Sources/cylinderBlock.pure.js +153 -140
  519. package/Meshes/Node/Blocks/Sources/cylinderBlock.pure.js.map +1 -1
  520. package/Meshes/Node/Blocks/Sources/discBlock.pure.js +112 -99
  521. package/Meshes/Node/Blocks/Sources/discBlock.pure.js.map +1 -1
  522. package/Meshes/Node/Blocks/Sources/gridBlock.pure.js +133 -120
  523. package/Meshes/Node/Blocks/Sources/gridBlock.pure.js.map +1 -1
  524. package/Meshes/Node/Blocks/Sources/icoSphereBlock.pure.js +128 -115
  525. package/Meshes/Node/Blocks/Sources/icoSphereBlock.pure.js.map +1 -1
  526. package/Meshes/Node/Blocks/Sources/meshBlock.pure.js +116 -103
  527. package/Meshes/Node/Blocks/Sources/meshBlock.pure.js.map +1 -1
  528. package/Meshes/Node/Blocks/Sources/planeBlock.pure.js +160 -147
  529. package/Meshes/Node/Blocks/Sources/planeBlock.pure.js.map +1 -1
  530. package/Meshes/Node/Blocks/Sources/sphereBlock.pure.js +144 -131
  531. package/Meshes/Node/Blocks/Sources/sphereBlock.pure.js.map +1 -1
  532. package/Meshes/Node/Blocks/Sources/torusBlock.pure.js +112 -99
  533. package/Meshes/Node/Blocks/Sources/torusBlock.pure.js.map +1 -1
  534. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.pure.js +200 -185
  535. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.pure.js.map +1 -1
  536. package/Meshes/Node/Blocks/bevelBlock.pure.js +111 -98
  537. package/Meshes/Node/Blocks/bevelBlock.pure.js.map +1 -1
  538. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +182 -165
  539. package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
  540. package/Meshes/Node/Blocks/cleanGeometryBlock.pure.js +89 -76
  541. package/Meshes/Node/Blocks/cleanGeometryBlock.pure.js.map +1 -1
  542. package/Meshes/Node/Blocks/conditionBlock.pure.js +184 -169
  543. package/Meshes/Node/Blocks/conditionBlock.pure.js.map +1 -1
  544. package/Meshes/Node/Blocks/extrudeGeometryBlock.pure.js +270 -255
  545. package/Meshes/Node/Blocks/extrudeGeometryBlock.pure.js.map +1 -1
  546. package/Meshes/Node/Blocks/geometryCollectionBlock.pure.js +172 -159
  547. package/Meshes/Node/Blocks/geometryCollectionBlock.pure.js.map +1 -1
  548. package/Meshes/Node/Blocks/geometryCurveBlock.pure.js +230 -217
  549. package/Meshes/Node/Blocks/geometryCurveBlock.pure.js.map +1 -1
  550. package/Meshes/Node/Blocks/geometryEaseBlock.pure.js +256 -245
  551. package/Meshes/Node/Blocks/geometryEaseBlock.pure.js.map +1 -1
  552. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js +206 -189
  553. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js.map +1 -1
  554. package/Meshes/Node/Blocks/geometryTransformBlock.pure.js +166 -153
  555. package/Meshes/Node/Blocks/geometryTransformBlock.pure.js.map +1 -1
  556. package/Meshes/Node/Blocks/geometryTrigonometryBlock.pure.js +221 -208
  557. package/Meshes/Node/Blocks/geometryTrigonometryBlock.pure.js.map +1 -1
  558. package/Meshes/Node/Blocks/mappingBlock.pure.js +150 -137
  559. package/Meshes/Node/Blocks/mappingBlock.pure.js.map +1 -1
  560. package/Meshes/Node/Blocks/mathBlock.pure.js +269 -256
  561. package/Meshes/Node/Blocks/mathBlock.pure.js.map +1 -1
  562. package/Meshes/Node/Blocks/mergeGeometryBlock.pure.js +141 -128
  563. package/Meshes/Node/Blocks/mergeGeometryBlock.pure.js.map +1 -1
  564. package/Meshes/Node/Blocks/randomBlock.pure.js +161 -148
  565. package/Meshes/Node/Blocks/randomBlock.pure.js.map +1 -1
  566. package/Meshes/Node/Blocks/subdivideBlock.pure.js +102 -87
  567. package/Meshes/Node/Blocks/subdivideBlock.pure.js.map +1 -1
  568. package/Meshes/Node/nodeGeometry.js +560 -538
  569. package/Meshes/Node/nodeGeometry.js.map +1 -1
  570. package/Meshes/Node/nodeGeometryBlock.js +473 -458
  571. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  572. package/Meshes/abstractMesh.pure.js +2218 -2207
  573. package/Meshes/abstractMesh.pure.js.map +1 -1
  574. package/Meshes/geometry.js +30 -15
  575. package/Meshes/geometry.js.map +1 -1
  576. package/Meshes/mesh.pure.js +26 -14
  577. package/Meshes/mesh.pure.js.map +1 -1
  578. package/Meshes/mesh.vertexData.js +1665 -1655
  579. package/Meshes/mesh.vertexData.js.map +1 -1
  580. package/Meshes/transformNode.pure.js +1400 -1372
  581. package/Meshes/transformNode.pure.js.map +1 -1
  582. package/Misc/decorators.d.ts +34 -19
  583. package/Misc/decorators.functions.d.ts +33 -2
  584. package/Misc/decorators.functions.js +114 -35
  585. package/Misc/decorators.functions.js.map +1 -1
  586. package/Misc/decorators.js +96 -68
  587. package/Misc/decorators.js.map +1 -1
  588. package/Misc/decorators.serialization.js +47 -40
  589. package/Misc/decorators.serialization.js.map +1 -1
  590. package/Misc/decorators.serializationUtilities.d.ts +24 -0
  591. package/Misc/decorators.serializationUtilities.js +20 -0
  592. package/Misc/decorators.serializationUtilities.js.map +1 -0
  593. package/Misc/dumpTools.pure.js +43 -33
  594. package/Misc/dumpTools.pure.js.map +1 -1
  595. package/Misc/fileTools.pure.js +8 -0
  596. package/Misc/fileTools.pure.js.map +1 -1
  597. package/Misc/observable.pure.js +0 -7
  598. package/Misc/observable.pure.js.map +1 -1
  599. package/Misc/snapshotRenderingHelper.d.ts +4 -1
  600. package/Misc/snapshotRenderingHelper.js.map +1 -1
  601. package/Misc/symbolMetadataPolyfill.d.ts +11 -0
  602. package/Misc/symbolMetadataPolyfill.js +22 -0
  603. package/Misc/symbolMetadataPolyfill.js.map +1 -0
  604. package/Misc/tools.pure.js +2 -2
  605. package/Misc/tools.pure.js.map +1 -1
  606. package/Morph/morphTarget.js +382 -365
  607. package/Morph/morphTarget.js.map +1 -1
  608. package/Particles/Node/Blocks/Conditions/particleConditionBlock.pure.js +160 -145
  609. package/Particles/Node/Blocks/Conditions/particleConditionBlock.pure.js.map +1 -1
  610. package/Particles/Node/Blocks/Emitters/coneShapeBlock.pure.js +187 -174
  611. package/Particles/Node/Blocks/Emitters/coneShapeBlock.pure.js.map +1 -1
  612. package/Particles/Node/Blocks/Emitters/meshShapeBlock.pure.js +238 -219
  613. package/Particles/Node/Blocks/Emitters/meshShapeBlock.pure.js.map +1 -1
  614. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.pure.js +140 -115
  615. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.pure.js.map +1 -1
  616. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.pure.js +157 -144
  617. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.pure.js.map +1 -1
  618. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.pure.js +133 -119
  619. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.pure.js.map +1 -1
  620. package/Particles/Node/Blocks/Update/alignAngleBlock.pure.js +93 -80
  621. package/Particles/Node/Blocks/Update/alignAngleBlock.pure.js.map +1 -1
  622. package/Particles/Node/Blocks/particleDebugBlock.pure.js +117 -105
  623. package/Particles/Node/Blocks/particleDebugBlock.pure.js.map +1 -1
  624. package/Particles/Node/Blocks/particleFloatToIntBlock.pure.js +105 -92
  625. package/Particles/Node/Blocks/particleFloatToIntBlock.pure.js.map +1 -1
  626. package/Particles/Node/Blocks/particleGradientValueBlock.pure.js +82 -69
  627. package/Particles/Node/Blocks/particleGradientValueBlock.pure.js.map +1 -1
  628. package/Particles/Node/Blocks/particleLocalVariableBlock.pure.js +113 -101
  629. package/Particles/Node/Blocks/particleLocalVariableBlock.pure.js.map +1 -1
  630. package/Particles/Node/Blocks/particleMathBlock.pure.js +278 -265
  631. package/Particles/Node/Blocks/particleMathBlock.pure.js.map +1 -1
  632. package/Particles/Node/Blocks/particleNumberMathBlock.pure.js +155 -142
  633. package/Particles/Node/Blocks/particleNumberMathBlock.pure.js.map +1 -1
  634. package/Particles/Node/Blocks/particleRandomBlock.pure.js +156 -143
  635. package/Particles/Node/Blocks/particleRandomBlock.pure.js.map +1 -1
  636. package/Particles/Node/Blocks/particleTrigonometryBlock.pure.js +217 -204
  637. package/Particles/Node/Blocks/particleTrigonometryBlock.pure.js.map +1 -1
  638. package/Particles/Node/Blocks/particleVectorMathBlock.pure.js +106 -93
  639. package/Particles/Node/Blocks/particleVectorMathBlock.pure.js.map +1 -1
  640. package/Particles/Node/Blocks/systemBlock.pure.js +366 -330
  641. package/Particles/Node/Blocks/systemBlock.pure.js.map +1 -1
  642. package/Particles/Node/nodeParticleBlock.js +339 -324
  643. package/Particles/Node/nodeParticleBlock.js.map +1 -1
  644. package/Particles/Node/nodeParticleSystemSet.js +494 -473
  645. package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
  646. package/Particles/gpuParticleSystem.d.ts +0 -1
  647. package/Particles/gpuParticleSystem.js +0 -1
  648. package/Particles/gpuParticleSystem.js.map +1 -1
  649. package/Particles/gpuParticleSystem.pure.d.ts +4 -3
  650. package/Particles/gpuParticleSystem.pure.js +27 -16
  651. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  652. package/Particles/particleSystem.pure.js +57 -2
  653. package/Particles/particleSystem.pure.js.map +1 -1
  654. package/Particles/thinParticleSystem.d.ts +0 -1
  655. package/Particles/thinParticleSystem.js +0 -1
  656. package/Particles/thinParticleSystem.js.map +1 -1
  657. package/Particles/thinParticleSystem.pure.js +2 -0
  658. package/Particles/thinParticleSystem.pure.js.map +1 -1
  659. package/Particles/webgl2ParticleSystem.pure.js +2 -0
  660. package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
  661. package/Physics/v1/physicsImpostor.pure.js +4 -4
  662. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js +675 -656
  663. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js.map +1 -1
  664. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.d.ts +0 -1
  665. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js +0 -1
  666. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js.map +1 -1
  667. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js +521 -486
  668. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js.map +1 -1
  669. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.d.ts +0 -1
  670. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +0 -1
  671. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  672. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.pure.js +241 -220
  673. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.pure.js.map +1 -1
  674. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.pure.js +852 -835
  675. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.pure.js.map +1 -1
  676. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.pure.js +1135 -1073
  677. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.pure.js.map +1 -1
  678. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.pure.js +319 -303
  679. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.pure.js.map +1 -1
  680. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +212 -199
  681. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  682. package/PostProcesses/blackAndWhitePostProcess.pure.js +67 -55
  683. package/PostProcesses/blackAndWhitePostProcess.pure.js.map +1 -1
  684. package/PostProcesses/bloomMergePostProcess.pure.js +74 -62
  685. package/PostProcesses/bloomMergePostProcess.pure.js.map +1 -1
  686. package/PostProcesses/blurPostProcess.pure.js +127 -115
  687. package/PostProcesses/blurPostProcess.pure.js.map +1 -1
  688. package/PostProcesses/chromaticAberrationPostProcess.pure.js +130 -118
  689. package/PostProcesses/chromaticAberrationPostProcess.pure.js.map +1 -1
  690. package/PostProcesses/circleOfConfusionPostProcess.pure.js +115 -104
  691. package/PostProcesses/circleOfConfusionPostProcess.pure.js.map +1 -1
  692. package/PostProcesses/colorCorrectionPostProcess.pure.js +55 -43
  693. package/PostProcesses/colorCorrectionPostProcess.pure.js.map +1 -1
  694. package/PostProcesses/convolutionPostProcess.pure.js +96 -84
  695. package/PostProcesses/convolutionPostProcess.pure.js.map +1 -1
  696. package/PostProcesses/extractHighlightsPostProcess.pure.js +68 -57
  697. package/PostProcesses/extractHighlightsPostProcess.pure.js.map +1 -1
  698. package/PostProcesses/filterPostProcess.pure.js +66 -54
  699. package/PostProcesses/filterPostProcess.pure.js.map +1 -1
  700. package/PostProcesses/fxaaPostProcess.pure.js.map +1 -1
  701. package/PostProcesses/grainPostProcess.pure.js +82 -70
  702. package/PostProcesses/grainPostProcess.pure.js.map +1 -1
  703. package/PostProcesses/imageProcessingPostProcess.js +334 -322
  704. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  705. package/PostProcesses/motionBlurPostProcess.pure.js +246 -235
  706. package/PostProcesses/motionBlurPostProcess.pure.js.map +1 -1
  707. package/PostProcesses/passPostProcess.pure.js +75 -63
  708. package/PostProcesses/passPostProcess.pure.js.map +1 -1
  709. package/PostProcesses/postProcess.pure.js +899 -835
  710. package/PostProcesses/postProcess.pure.js.map +1 -1
  711. package/PostProcesses/refractionPostProcess.pure.js +114 -87
  712. package/PostProcesses/refractionPostProcess.pure.js.map +1 -1
  713. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js +108 -96
  714. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js.map +1 -1
  715. package/PostProcesses/screenSpaceReflectionPostProcess.pure.js +241 -220
  716. package/PostProcesses/screenSpaceReflectionPostProcess.pure.js.map +1 -1
  717. package/PostProcesses/sharpenPostProcess.pure.js +86 -74
  718. package/PostProcesses/sharpenPostProcess.pure.js.map +1 -1
  719. package/PostProcesses/tonemapPostProcess.pure.js +82 -70
  720. package/PostProcesses/tonemapPostProcess.pure.js.map +1 -1
  721. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js +500 -465
  722. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js.map +1 -1
  723. package/PostProcesses/vrMultiviewToSingleviewPostProcess.d.ts +0 -1
  724. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js +0 -1
  725. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
  726. package/PostProcesses/vrMultiviewToSingleviewPostProcess.pure.js +2 -0
  727. package/PostProcesses/vrMultiviewToSingleviewPostProcess.pure.js.map +1 -1
  728. package/Probes/reflectionProbe.pure.js +238 -224
  729. package/Probes/reflectionProbe.pure.js.map +1 -1
  730. package/Rendering/GlobalIllumination/giRSMManager.pure.d.ts +1 -1
  731. package/Rendering/GlobalIllumination/giRSMManager.pure.js +138 -105
  732. package/Rendering/GlobalIllumination/giRSMManager.pure.js.map +1 -1
  733. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.d.ts +1 -1
  734. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js +155 -138
  735. package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js.map +1 -1
  736. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +0 -2
  737. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +0 -2
  738. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  739. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +5 -0
  740. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  741. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +0 -1
  742. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +0 -1
  743. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
  744. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +1 -0
  745. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +34 -0
  746. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  747. package/Rendering/edgesRenderer.pure.js.map +1 -1
  748. package/Rendering/prePassRenderer.d.ts +0 -2
  749. package/Rendering/prePassRenderer.js +0 -2
  750. package/Rendering/prePassRenderer.js.map +1 -1
  751. package/Rendering/prePassRenderer.pure.js +2 -0
  752. package/Rendering/prePassRenderer.pure.js.map +1 -1
  753. package/Rendering/reflectiveShadowMap.pure.d.ts +1 -1
  754. package/Rendering/reflectiveShadowMap.pure.js +151 -130
  755. package/Rendering/reflectiveShadowMap.pure.js.map +1 -1
  756. package/Rendering/thinDepthPeelingRenderer.d.ts +0 -1
  757. package/Rendering/thinDepthPeelingRenderer.js +0 -1
  758. package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
  759. package/Shaders/ShadersInclude/gaussianSplatting.js +1 -0
  760. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  761. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +35 -5
  762. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  763. package/Shaders/gaussianSplatting.fragment.js +17 -1
  764. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  765. package/Shaders/gaussianSplatting.vertex.js +1 -1
  766. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  767. package/Shaders/gaussianSplattingDepth.vertex.js +1 -1
  768. package/Shaders/gaussianSplattingDepth.vertex.js.map +1 -1
  769. package/Shaders/picking.fragment.js +39 -3
  770. package/Shaders/picking.fragment.js.map +1 -1
  771. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +3 -1
  772. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  773. package/ShadersWGSL/ShadersInclude/helperFunctions.js +2 -2
  774. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
  775. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +39 -7
  776. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  777. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +4 -3
  778. package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
  779. package/ShadersWGSL/gaussianSplatting.fragment.js +14 -1
  780. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  781. package/ShadersWGSL/gaussianSplatting.vertex.js +2 -2
  782. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  783. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -2
  784. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
  785. package/ShadersWGSL/lightingVolume.compute.js +2 -2
  786. package/ShadersWGSL/lightingVolume.compute.js.map +1 -1
  787. package/ShadersWGSL/picking.fragment.js +22 -1
  788. package/ShadersWGSL/picking.fragment.js.map +1 -1
  789. package/XR/features/Layers/WebXRCompositionLayer.d.ts +3 -2
  790. package/XR/features/Layers/WebXRCompositionLayer.js +2 -2
  791. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
  792. package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +59 -0
  793. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js +120 -0
  794. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -0
  795. package/XR/features/Layers/WebXRWebGPUProjectionLayer.d.ts +25 -0
  796. package/XR/features/Layers/WebXRWebGPUProjectionLayer.js +69 -0
  797. package/XR/features/Layers/WebXRWebGPUProjectionLayer.js.map +1 -0
  798. package/XR/features/WebXRLayers.pure.d.ts +8 -0
  799. package/XR/features/WebXRLayers.pure.js +43 -6
  800. package/XR/features/WebXRLayers.pure.js.map +1 -1
  801. package/XR/native/nativeXRRenderTarget.d.ts +2 -2
  802. package/XR/native/nativeXRRenderTarget.js +2 -2
  803. package/XR/native/nativeXRRenderTarget.js.map +1 -1
  804. package/XR/webXRExperienceHelper.js +10 -1
  805. package/XR/webXRExperienceHelper.js.map +1 -1
  806. package/XR/webXRGraphicsBinding.d.ts +90 -0
  807. package/XR/webXRGraphicsBinding.js +85 -0
  808. package/XR/webXRGraphicsBinding.js.map +1 -0
  809. package/XR/webXRLayerRenderTargetTexture.d.ts +24 -0
  810. package/XR/webXRLayerRenderTargetTexture.js +30 -0
  811. package/XR/webXRLayerRenderTargetTexture.js.map +1 -0
  812. package/XR/webXRManagedOutputCanvas.d.ts +14 -0
  813. package/XR/webXRManagedOutputCanvas.js +24 -5
  814. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  815. package/XR/webXRRenderTargetTextureProvider.d.ts +25 -4
  816. package/XR/webXRRenderTargetTextureProvider.js +33 -35
  817. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  818. package/XR/webXRSessionManager.d.ts +11 -0
  819. package/XR/webXRSessionManager.js +37 -0
  820. package/XR/webXRSessionManager.js.map +1 -1
  821. package/XR/webXRTypes.d.ts +9 -6
  822. package/XR/webXRTypes.js.map +1 -1
  823. package/XR/webXRWebGLLayer.d.ts +2 -2
  824. package/XR/webXRWebGLLayer.js +2 -2
  825. package/XR/webXRWebGLLayer.js.map +1 -1
  826. package/XR/webXRWebGLRenderTargetTextureProvider.d.ts +12 -0
  827. package/XR/webXRWebGLRenderTargetTextureProvider.js +58 -0
  828. package/XR/webXRWebGLRenderTargetTextureProvider.js.map +1 -0
  829. package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +69 -0
  830. package/XR/webXRWebGPURenderTargetTextureProvider.js +148 -0
  831. package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -0
  832. package/index.d.ts +1 -0
  833. package/index.js +1 -0
  834. package/index.js.map +1 -1
  835. package/node.js +878 -845
  836. package/node.js.map +1 -1
  837. package/package.json +8 -14
  838. package/scene.pure.d.ts +12 -0
  839. package/scene.pure.js +36 -0
  840. package/scene.pure.js.map +1 -1
  841. package/tslib.es6.js +304 -150
@@ -1,5 +1,5 @@
1
1
  /** This file must only contain pure code and pure imports */
2
- import { __decorate } from "../tslib.es6.js";
2
+ import { __esDecorate, __runInitializers } from "../tslib.es6.js";
3
3
  import { serialize, serializeAsVector3, serializeAsMeshReference, serializeAsVector2 } from "../Misc/decorators.js";
4
4
  import { Observable } from "../Misc/observable.pure.js";
5
5
  import { Matrix, Vector3, Vector2, TmpVectors, Quaternion } from "../Maths/math.vector.pure.js";
@@ -53,1512 +53,1592 @@ function CheckNaN(value, fallback) {
53
53
  * Think of this camera as one orbiting its target position, or more imaginatively as a spy satellite orbiting the earth. Its position relative to the target (earth) can be set by three parameters, alpha (radians) the longitudinal rotation, beta (radians) the latitudinal rotation and radius the distance from the target position.
54
54
  * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#arc-rotate-camera
55
55
  */
56
- export class ArcRotateCamera extends TargetCamera {
57
- /**
58
- * Defines the rotation angle of the camera along the latitudinal axis.
59
- */
60
- get beta() {
61
- return this._beta;
62
- }
63
- set beta(value) {
64
- if (!value) {
65
- if (this._beta > value) {
66
- this._beta = Epsilon;
67
- }
68
- else {
69
- this._beta = -Epsilon;
70
- }
71
- }
72
- else {
73
- this._beta = value;
74
- }
75
- this._checkLimits();
76
- }
77
- /**
78
- * Defines the offset of the camera target;
79
- */
80
- get targetOffset() {
81
- return this._targetOffset;
82
- }
83
- set targetOffset(offset) {
84
- this._targetOffset = offset;
85
- }
86
- /**
87
- * Defines the target point of the camera.
88
- * The camera looks towards it from the radius distance.
89
- */
90
- get target() {
91
- return this._target;
92
- }
93
- set target(value) {
94
- this.setTarget(value);
95
- }
96
- /**
97
- * Defines the target transform node of the camera.
98
- * The camera looks towards it from the radius distance.
99
- * Please note that setting a target host will disable panning.
100
- */
101
- get targetHost() {
102
- return this._targetHost;
103
- }
104
- set targetHost(value) {
105
- if (value) {
106
- this.setTarget(value);
107
- }
108
- }
109
- /**
110
- * Return the current target position of the camera. This value is expressed in local space.
111
- * @returns the target position
112
- */
113
- getTarget() {
114
- return this.target;
115
- }
116
- /**
117
- * Define the current local position of the camera in the scene
118
- */
119
- get position() {
120
- return this._position;
121
- }
122
- set position(newPosition) {
123
- this.setPosition(newPosition);
124
- }
125
- /**
126
- * The vector the camera should consider as up. (default is Vector3(0, 1, 0) as returned by Vector3.Up())
127
- * Setting this will copy the given vector to the camera's upVector, and set rotation matrices to and from Y up.
128
- * DO NOT set the up vector using copyFrom or copyFromFloats, as this bypasses setting the above matrices.
129
- */
130
- set upVector(vec) {
131
- if (!this._upToYMatrix) {
132
- this._yToUpMatrix = new Matrix();
133
- this._upToYMatrix = new Matrix();
134
- this._upVector = Vector3.Zero();
135
- }
136
- vec.normalize();
137
- this._upVector.copyFrom(vec);
138
- this.setMatUp();
139
- }
140
- get upVector() {
141
- return this._upVector;
142
- }
143
- /**
144
- * Sets the Y-up to camera up-vector rotation matrix, and the up-vector to Y-up rotation matrix.
145
- */
146
- setMatUp() {
147
- // from y-up to custom-up (used in _getViewMatrix)
148
- Matrix.RotationAlignToRef(Vector3.UpReadOnly, this._upVector, this._yToUpMatrix);
149
- // from custom-up to y-up (used in rebuildAnglesAndRadius)
150
- Matrix.RotationAlignToRef(this._upVector, Vector3.UpReadOnly, this._upToYMatrix);
151
- }
152
- /**
153
- * Current inertia value on the longitudinal axis.
154
- * When nonzero, represents the per-frame angular offset (in radians) applied to `alpha`.
155
- * Each frame, this value is multiplied by {@link inertia} (a decay coefficient where
156
- * 0 = instant stop, 0.9 = smooth glide, 1 = never stops).
157
- * Reading this value also reflects the rotation delta the movement system will apply this frame
158
- * (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks.
159
- * Setting this to 0 also stops the movement system's rotation velocity for backward compatibility.
160
- */
161
- get inertialAlphaOffset() {
162
- if (this._inertialAlphaOffset !== 0) {
163
- return this._inertialAlphaOffset;
164
- }
165
- if (this.movement.rotationAccumulatedPixels.x !== 0) {
166
- return this.movement.rotationAccumulatedPixels.x;
167
- }
168
- const delta = this.movement.rotationDeltaCurrentFrame.x;
169
- return Math.abs(delta) < this._rotationEpsilon ? 0 : delta;
170
- }
171
- set inertialAlphaOffset(value) {
172
- this._inertialAlphaOffset = value;
173
- if (value === 0) {
174
- this.movement.resetRotationVelocity();
175
- }
176
- }
177
- /**
178
- * Current inertia value on the latitudinal axis.
179
- * When nonzero, represents the per-frame angular offset (in radians) applied to `beta`.
180
- * Each frame, this value is multiplied by {@link inertia} (a decay coefficient where
181
- * 0 = instant stop, 0.9 = smooth glide, 1 = never stops).
182
- * Reading this value also reflects the rotation delta the movement system will apply this frame
183
- * (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks.
184
- * Setting this to 0 also stops the movement system's rotation velocity for backward compatibility.
185
- */
186
- get inertialBetaOffset() {
187
- if (this._inertialBetaOffset !== 0) {
188
- return this._inertialBetaOffset;
189
- }
190
- if (this.movement.rotationAccumulatedPixels.y !== 0) {
191
- return this.movement.rotationAccumulatedPixels.y;
192
- }
193
- const delta = this.movement.rotationDeltaCurrentFrame.y;
194
- return Math.abs(delta) < this._rotationEpsilon ? 0 : delta;
195
- }
196
- set inertialBetaOffset(value) {
197
- this._inertialBetaOffset = value;
198
- if (value === 0) {
199
- this.movement.resetRotationVelocity();
200
- }
201
- }
202
- /**
203
- * Current inertia value on the radius axis.
204
- * When nonzero, represents the per-frame offset (in scene units) applied to `radius`.
205
- * Each frame, this value is multiplied by {@link inertia} (a decay coefficient where
206
- * 0 = instant stop, 0.9 = smooth glide, 1 = never stops).
207
- * Reading this value also reflects the zoom delta the movement system will apply this frame
208
- * (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks.
209
- * Setting this to 0 also stops the movement system's zoom velocity for backward compatibility.
210
- */
211
- get inertialRadiusOffset() {
212
- if (this._inertialRadiusOffset !== 0) {
213
- return this._inertialRadiusOffset;
214
- }
215
- if (this.movement.zoomAccumulatedPixels !== 0) {
216
- return this.movement.zoomAccumulatedPixels;
217
- }
218
- const delta = this.movement.zoomDeltaCurrentFrame;
219
- return Math.abs(delta) < this.speed * this._rotationEpsilon ? 0 : delta;
220
- }
221
- set inertialRadiusOffset(value) {
222
- this._inertialRadiusOffset = value;
223
- if (value === 0) {
224
- this.movement.resetZoomVelocity();
225
- }
226
- }
227
- /**
228
- * Defines the value of the inertia used during panning.
229
- * A decay coefficient applied per reference frame at 60fps:
230
- * 0 means stop instantly, 0.9 means smooth glide, 1 means never stop.
231
- * Setting this also updates the movement system's pan inertia.
232
- */
233
- get panningInertia() {
234
- return this._panningInertia;
235
- }
236
- set panningInertia(value) {
237
- this._panningInertia = value;
238
- if (this.movement) {
239
- this.movement.panInertia = value;
240
- }
241
- }
242
- /**
243
- * Defines the rotation/zoom inertia (decay coefficient applied per reference frame at 60fps).
244
- * Override of {@link Camera.inertia} that automatically syncs to the movement system
245
- * (rotation and zoom). Panning inertia is controlled separately via {@link panningInertia}.
246
- */
247
- get inertia() {
248
- return this._inertia;
249
- }
250
- set inertia(value) {
251
- this._inertia = value;
252
- if (this.movement) {
253
- this.movement.rotationInertia = value;
254
- this.movement.zoomInertia = value;
255
- }
256
- }
257
- //-- begin properties for backward compatibility for inputs
258
- /**
259
- * Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating.
260
- */
261
- get angularSensibilityX() {
262
- const pointers = this.inputs.attached["pointers"];
263
- if (pointers) {
264
- return pointers.angularSensibilityX;
265
- }
266
- return 0;
267
- }
268
- set angularSensibilityX(value) {
269
- const pointers = this.inputs.attached["pointers"];
270
- if (pointers) {
271
- pointers.angularSensibilityX = value;
272
- }
273
- }
274
- /**
275
- * Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.
276
- */
277
- get angularSensibilityY() {
278
- const pointers = this.inputs.attached["pointers"];
279
- if (pointers) {
280
- return pointers.angularSensibilityY;
281
- }
282
- return 0;
283
- }
284
- set angularSensibilityY(value) {
285
- const pointers = this.inputs.attached["pointers"];
286
- if (pointers) {
287
- pointers.angularSensibilityY = value;
288
- }
289
- }
290
- /**
291
- * Gets or Set the pointer pinch precision or how fast is the camera zooming.
292
- */
293
- get pinchPrecision() {
294
- const pointers = this.inputs.attached["pointers"];
295
- if (pointers) {
296
- return pointers.pinchPrecision;
297
- }
298
- return 0;
299
- }
300
- set pinchPrecision(value) {
301
- const pointers = this.inputs.attached["pointers"];
302
- if (pointers) {
303
- pointers.pinchPrecision = value;
304
- }
305
- }
306
- /**
307
- * Gets or Set the pointer pinch delta percentage or how fast is the camera zooming.
308
- * It will be used instead of pinchPrecision if different from 0.
309
- * It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
310
- */
311
- get pinchDeltaPercentage() {
312
- const pointers = this.inputs.attached["pointers"];
313
- if (pointers) {
314
- return pointers.pinchDeltaPercentage;
315
- }
316
- return 0;
317
- }
318
- set pinchDeltaPercentage(value) {
319
- const pointers = this.inputs.attached["pointers"];
320
- if (pointers) {
321
- pointers.pinchDeltaPercentage = value;
322
- }
323
- }
324
- /**
325
- * Gets or Set the pointer use natural pinch zoom to override the pinch precision
326
- * and pinch delta percentage.
327
- * When useNaturalPinchZoom is true, multi touch zoom will zoom in such
328
- * that any object in the plane at the camera's target point will scale
329
- * perfectly with finger motion.
330
- */
331
- get useNaturalPinchZoom() {
332
- const pointers = this.inputs.attached["pointers"];
333
- if (pointers) {
334
- return pointers.useNaturalPinchZoom;
335
- }
336
- return false;
337
- }
338
- set useNaturalPinchZoom(value) {
339
- const pointers = this.inputs.attached["pointers"];
340
- if (pointers) {
341
- pointers.useNaturalPinchZoom = value;
342
- }
343
- }
344
- /**
345
- * Gets or Set the pointer panning sensibility or how fast is the camera moving.
346
- */
347
- get panningSensibility() {
348
- const pointers = this.inputs.attached["pointers"];
349
- if (pointers) {
350
- return pointers.panningSensibility;
351
- }
352
- return 0;
353
- }
354
- set panningSensibility(value) {
355
- const pointers = this.inputs.attached["pointers"];
356
- if (pointers) {
357
- pointers.panningSensibility = value;
358
- }
359
- }
360
- /**
361
- * Gets or Set the list of keyboard keys used to control beta angle in a positive direction.
362
- */
363
- get keysUp() {
364
- const keyboard = this.inputs.attached["keyboard"];
365
- if (keyboard) {
366
- return keyboard.keysUp;
367
- }
368
- return [];
369
- }
370
- set keysUp(value) {
371
- const keyboard = this.inputs.attached["keyboard"];
372
- if (keyboard) {
373
- keyboard.keysUp = value;
374
- }
375
- }
376
- /**
377
- * Gets or Set the list of keyboard keys used to control beta angle in a negative direction.
378
- */
379
- get keysDown() {
380
- const keyboard = this.inputs.attached["keyboard"];
381
- if (keyboard) {
382
- return keyboard.keysDown;
383
- }
384
- return [];
385
- }
386
- set keysDown(value) {
387
- const keyboard = this.inputs.attached["keyboard"];
388
- if (keyboard) {
389
- keyboard.keysDown = value;
390
- }
391
- }
392
- /**
393
- * Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.
394
- */
395
- get keysLeft() {
396
- const keyboard = this.inputs.attached["keyboard"];
397
- if (keyboard) {
398
- return keyboard.keysLeft;
399
- }
400
- return [];
401
- }
402
- set keysLeft(value) {
403
- const keyboard = this.inputs.attached["keyboard"];
404
- if (keyboard) {
405
- keyboard.keysLeft = value;
406
- }
407
- }
408
- /**
409
- * Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.
410
- */
411
- get keysRight() {
412
- const keyboard = this.inputs.attached["keyboard"];
413
- if (keyboard) {
414
- return keyboard.keysRight;
415
- }
416
- return [];
417
- }
418
- set keysRight(value) {
419
- const keyboard = this.inputs.attached["keyboard"];
420
- if (keyboard) {
421
- keyboard.keysRight = value;
422
- }
423
- }
424
- /**
425
- * Gets or Set the mouse wheel precision or how fast is the camera zooming.
426
- */
427
- get wheelPrecision() {
428
- const mousewheel = this.inputs.attached["mousewheel"];
429
- if (mousewheel) {
430
- return mousewheel.wheelPrecision;
431
- }
432
- return 0;
433
- }
434
- set wheelPrecision(value) {
435
- const mousewheel = this.inputs.attached["mousewheel"];
436
- if (mousewheel) {
437
- mousewheel.wheelPrecision = value;
438
- }
439
- }
440
- /**
441
- * Gets or Set the boolean value that controls whether or not the mouse wheel
442
- * zooms to the location of the mouse pointer or not. The default is false.
443
- */
444
- get zoomToMouseLocation() {
445
- const mousewheel = this.inputs.attached["mousewheel"];
446
- if (mousewheel) {
447
- return mousewheel.zoomToMouseLocation;
448
- }
449
- return false;
450
- }
451
- set zoomToMouseLocation(value) {
452
- const mousewheel = this.inputs.attached["mousewheel"];
453
- if (mousewheel) {
454
- mousewheel.zoomToMouseLocation = value;
455
- }
456
- }
457
- /**
458
- * Gets or Set the mouse wheel delta percentage or how fast is the camera zooming.
459
- * It will be used instead of wheelPrecision if different from 0.
460
- * It defines the percentage of current camera.radius to use as delta when wheel zoom is used.
461
- */
462
- get wheelDeltaPercentage() {
463
- const mousewheel = this.inputs.attached["mousewheel"];
464
- if (mousewheel) {
465
- return mousewheel.wheelDeltaPercentage;
466
- }
467
- return 0;
468
- }
469
- set wheelDeltaPercentage(value) {
470
- const mousewheel = this.inputs.attached["mousewheel"];
471
- if (mousewheel) {
472
- mousewheel.wheelDeltaPercentage = value;
473
- }
474
- }
475
- /**
476
- * Gets or sets whether ctrl+keyboard triggers panning.
477
- * Setting this updates the keyboard→pan inputMap entry.
478
- * @internal kept for backward compatibility
479
- */
480
- get _useCtrlForPanning() {
481
- return this._useCtrlForPanningInternal;
482
- }
483
- set _useCtrlForPanning(value) {
484
- this._useCtrlForPanningInternal = value;
485
- const input = this.movement.input;
486
- // Manage keyboard ctrl → pan entry
487
- const keyboardEntry = input.getEntry("keyboard", "pan", { modifiers: { ctrl: true } });
488
- if (!value && keyboardEntry) {
489
- input.inputMap.splice(input.inputMap.indexOf(keyboardEntry), 1);
490
- }
491
- else if (value && !keyboardEntry) {
492
- input.addEntry({ source: "keyboard", modifiers: { ctrl: true }, interaction: "pan" });
493
- }
494
- // Manage pointer ctrl+left-drag → pan entry (matches legacy ArcRotateCameraPointersInput behavior)
495
- const pointerEntry = input.getEntry("pointer", "pan", { modifiers: { ctrl: true } });
496
- if (!value && pointerEntry) {
497
- input.inputMap.splice(input.inputMap.indexOf(pointerEntry), 1);
498
- }
499
- else if (value && !pointerEntry) {
500
- input.addEntry({ source: "pointer", button: 0, modifiers: { ctrl: true }, interaction: "pan" });
501
- }
502
- }
503
- /**
504
- * Gets or sets which mouse button triggers panning (0=left, 1=middle, 2=right).
505
- * Setting this updates the pointer→pan inputMap entry.
506
- * @internal kept for backward compatibility with attachControl signature
507
- */
508
- get _panningMouseButton() {
509
- return this._panningMouseButtonInternal;
510
- }
511
- set _panningMouseButton(value) {
512
- this._panningMouseButtonInternal = value;
513
- const entry = this.movement.input.getEntry("pointer", "pan", { modifiers: {} });
514
- if (entry) {
515
- entry.button = value;
516
- }
517
- }
518
- /**
519
- * If true, indicates the camera is currently interpolating to a new pose.
520
- */
521
- get isInterpolating() {
522
- return this._isInterpolating;
523
- }
524
- /**
525
- * Gets the bouncing behavior of the camera if it has been enabled.
526
- * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
527
- */
528
- get bouncingBehavior() {
529
- return this._bouncingBehavior;
530
- }
531
- /**
532
- * Defines if the bouncing behavior of the camera is enabled on the camera.
533
- * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
534
- */
535
- get useBouncingBehavior() {
536
- return this._bouncingBehavior != null;
537
- }
538
- set useBouncingBehavior(value) {
539
- if (value === this.useBouncingBehavior) {
540
- return;
541
- }
542
- if (value) {
543
- this._bouncingBehavior = new BouncingBehavior();
544
- this.addBehavior(this._bouncingBehavior);
545
- }
546
- else if (this._bouncingBehavior) {
547
- this.removeBehavior(this._bouncingBehavior);
548
- this._bouncingBehavior = null;
549
- }
550
- }
551
- /**
552
- * Gets the framing behavior of the camera if it has been enabled.
553
- * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
554
- */
555
- get framingBehavior() {
556
- return this._framingBehavior;
557
- }
558
- /**
559
- * Defines if the framing behavior of the camera is enabled on the camera.
560
- * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
561
- */
562
- get useFramingBehavior() {
563
- return this._framingBehavior != null;
564
- }
565
- set useFramingBehavior(value) {
566
- if (value === this.useFramingBehavior) {
567
- return;
568
- }
569
- if (value) {
570
- this._framingBehavior = new FramingBehavior();
571
- this.addBehavior(this._framingBehavior);
572
- }
573
- else if (this._framingBehavior) {
574
- this.removeBehavior(this._framingBehavior);
575
- this._framingBehavior = null;
576
- }
577
- }
578
- /**
579
- * Gets the auto rotation behavior of the camera if it has been enabled.
580
- * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
581
- */
582
- get autoRotationBehavior() {
583
- return this._autoRotationBehavior;
584
- }
585
- /**
586
- * Defines if the auto rotation behavior of the camera is enabled on the camera.
587
- * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
588
- */
589
- get useAutoRotationBehavior() {
590
- return this._autoRotationBehavior != null;
591
- }
592
- set useAutoRotationBehavior(value) {
593
- if (value === this.useAutoRotationBehavior) {
594
- return;
595
- }
596
- if (value) {
597
- this._autoRotationBehavior = new AutoRotationBehavior();
598
- this.addBehavior(this._autoRotationBehavior);
599
- }
600
- else if (this._autoRotationBehavior) {
601
- this.removeBehavior(this._autoRotationBehavior);
602
- this._autoRotationBehavior = null;
603
- }
604
- }
605
- /**
606
- * Instantiates a new ArcRotateCamera in a given scene
607
- * @param name Defines the name of the camera
608
- * @param alpha Defines the camera rotation along the longitudinal axis
609
- * @param beta Defines the camera rotation along the latitudinal axis
610
- * @param radius Defines the camera distance from its target
611
- * @param target Defines the camera target
612
- * @param scene Defines the scene the camera belongs to
613
- * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
614
- */
615
- constructor(name, alpha, beta, radius, target, scene, setActiveOnSceneIfNoneActive = true) {
616
- super(name, Vector3.Zero(), scene, setActiveOnSceneIfNoneActive);
617
- /**
618
- * If camera has parent,then recognize target as world target if set true.
619
- */
620
- this.useWorldTargetIfParentExists = true;
621
- this._targetOffset = Vector3.Zero();
622
- this._inertialAlphaOffset = 0;
623
- this._inertialBetaOffset = 0;
624
- this._inertialRadiusOffset = 0;
625
- /**
626
- * Minimum allowed angle on the longitudinal axis.
627
- * This can help limiting how the Camera is able to move in the scene.
628
- */
629
- this.lowerAlphaLimit = null;
630
- /**
631
- * Maximum allowed angle on the longitudinal axis.
632
- * This can help limiting how the Camera is able to move in the scene.
633
- */
634
- this.upperAlphaLimit = null;
635
- /**
636
- * Minimum allowed angle on the latitudinal axis.
637
- * This can help limiting how the Camera is able to move in the scene.
638
- */
639
- this.lowerBetaLimit = 0.01;
640
- /**
641
- * Maximum allowed angle on the latitudinal axis.
642
- * This can help limiting how the Camera is able to move in the scene.
643
- */
644
- this.upperBetaLimit = Math.PI - 0.01;
645
- /**
646
- * Minimum allowed distance of the camera to the target (The camera can not get closer).
647
- * This can help limiting how the Camera is able to move in the scene.
648
- */
649
- this.lowerRadiusLimit = null;
650
- /**
651
- * Maximum allowed distance of the camera to the target (The camera can not get further).
652
- * This can help limiting how the Camera is able to move in the scene.
653
- */
654
- this.upperRadiusLimit = null;
655
- /**
656
- * Minimum allowed vertical target position of the camera.
657
- * Use this setting in combination with `upperRadiusLimit` to set a global limit for the Cameras vertical position.
658
- */
659
- this.lowerTargetYLimit = -Infinity;
660
- /**
661
- * Defines the current inertia value used during panning of the camera along the X axis.
662
- */
663
- this.inertialPanningX = 0;
664
- /**
665
- * Defines the current inertia value used during panning of the camera along the Y axis.
666
- */
667
- this.inertialPanningY = 0;
668
- /**
669
- * Defines the distance used to consider the camera in pan mode vs pinch/zoom.
670
- * Basically if your fingers moves away from more than this distance you will be considered
671
- * in pinch mode.
672
- */
673
- this.pinchToPanMaxDistance = 20;
674
- /**
675
- * Defines the maximum distance the camera can pan.
676
- * This could help keeping the camera always in your scene.
677
- */
678
- this.panningDistanceLimit = null;
679
- /**
680
- * Defines the target of the camera before panning.
681
- */
682
- this.panningOriginTarget = Vector3.Zero();
683
- this._panningInertia = 0.9;
684
- this._inertia = 0.9;
685
- //-- end properties for backward compatibility for inputs
686
- /**
687
- * Defines how much the radius should be scaled while zooming on a particular mesh (through the zoomOn function)
688
- */
689
- this.zoomOnFactor = 1;
690
- /**
691
- * Defines a screen offset for the camera position.
692
- */
693
- this.targetScreenOffset = Vector2.Zero();
694
- /**
695
- * Allows the camera to be completely reversed.
696
- * If false the camera can not arrive upside down.
697
- */
698
- this.allowUpsideDown = true;
699
- /**
700
- * Define if double tap/click is used to restore the previously saved state of the camera.
701
- */
702
- this.useInputToRestoreState = true;
703
- /**
704
- * Factor for restoring information interpolation. default is 0 = off. Any value \< 0 or \> 1 will disable interpolation.
705
- */
706
- this.restoreStateInterpolationFactor = 0;
707
- this._currentInterpolationFactor = 0;
708
- /** @internal */
709
- this._viewMatrix = new Matrix();
710
- this._useCtrlForPanningInternal = true;
711
- this._panningMouseButtonInternal = 2;
712
- /**
713
- * Defines the allowed panning axis.
714
- */
715
- this.panningAxis = new Vector3(1, 1, 0);
716
- this._transformedDirection = new Vector3();
717
- /**
718
- * Defines if camera will eliminate transform on y axis.
719
- */
720
- this.mapPanning = false;
721
- // This is redundant with all _goal* properties being NaN, but we track it anyway because we check for active interpolation in the hot path.
722
- this._isInterpolating = false;
723
- /**
724
- * Observable triggered when the transform node target has been changed on the camera.
725
- */
726
- this.onMeshTargetChangedObservable = new Observable();
727
- /**
728
- * Defines whether the camera should check collision with the objects oh the scene.
729
- * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#how-can-i-do-this-
730
- */
731
- this.checkCollisions = false;
732
- /**
733
- * Defines the collision radius of the camera.
734
- * This simulates a sphere around the camera.
735
- * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#arcrotatecamera
736
- */
737
- this.collisionRadius = new Vector3(0.5, 0.5, 0.5);
738
- this._previousPosition = Vector3.Zero();
739
- this._collisionVelocity = Vector3.Zero();
740
- this._newPosition = Vector3.Zero();
741
- this._computationVector = Vector3.Zero();
742
- this._goalAlpha = NaN;
743
- this._goalBeta = NaN;
744
- this._goalRadius = NaN;
745
- this._goalTarget = new Vector3(NaN, NaN, NaN);
746
- this._goalTargetScreenOffset = new Vector2(NaN, NaN);
747
- this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {
748
- if (!collidedMesh) {
749
- this._previousPosition.copyFrom(this._position);
750
- }
751
- else {
752
- this.setPosition(newPosition);
753
- if (this.onCollide) {
754
- this.onCollide(collidedMesh);
755
- }
756
- }
757
- // Recompute because of constraints
758
- const cosa = Math.cos(this.alpha);
759
- const sina = Math.sin(this.alpha);
760
- const cosb = Math.cos(this.beta);
761
- let sinb = Math.sin(this.beta);
762
- if (sinb === 0) {
763
- sinb = 0.0001;
764
- }
765
- const target = this._getTargetPosition();
766
- this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
767
- target.addToRef(this._computationVector, this._newPosition);
768
- this._position.copyFrom(this._newPosition);
769
- let up = this.upVector;
770
- if (this.allowUpsideDown && this.beta < 0) {
771
- up = up.clone();
772
- up = up.negate();
773
- }
774
- this._computeViewMatrix(this._position, target, up);
775
- this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x);
776
- this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);
777
- this._collisionTriggered = false;
778
- };
779
- this._target = Vector3.Zero();
780
- if (target) {
781
- this.setTarget(target);
782
- }
783
- this.alpha = alpha;
784
- this.beta = beta;
785
- this.radius = radius;
786
- this.getViewMatrix();
787
- this.inputs = new ArcRotateCameraInputsManager(this);
788
- this.inputs.addKeyboard().addMouseWheel().addPointers();
789
- this.movement = new ArcRotateCameraMovement(this.getScene(), this._position);
790
- // Seed movement-system inertia from the values set during base/subclass construction.
791
- // After this point, the inertia/panningInertia setters on this class push directly to movement.
792
- this.movement.rotationInertia = this._inertia;
793
- this.movement.zoomInertia = this._inertia;
794
- this.movement.panInertia = this._panningInertia;
795
- }
796
- // Cache
797
- /** @internal */
798
- _initCache() {
799
- super._initCache();
800
- this._cache._target = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
801
- this._cache.alpha = undefined;
802
- this._cache.beta = undefined;
803
- this._cache.radius = undefined;
804
- this._cache.targetScreenOffset = Vector2.Zero();
805
- }
806
- /**
807
- * @internal
808
- */
809
- _updateCache(ignoreParentClass) {
810
- if (!ignoreParentClass) {
811
- super._updateCache();
812
- }
813
- this._cache._target.copyFrom(this._getTargetPosition());
814
- this._cache.alpha = this.alpha;
815
- this._cache.beta = this.beta;
816
- this._cache.radius = this.radius;
817
- this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset);
818
- }
819
- _getTargetPosition() {
820
- const getPosition = () => {
821
- if (this._targetHost && this._targetHost.getAbsolutePosition) {
822
- const pos = this._targetHost.getAbsolutePosition();
823
- if (this._targetBoundingCenter) {
824
- pos.addToRef(this._targetBoundingCenter, this._target);
56
+ let ArcRotateCamera = (() => {
57
+ var _a;
58
+ let _classSuper = TargetCamera;
59
+ let _instanceExtraInitializers = [];
60
+ let _useWorldTargetIfParentExists_decorators;
61
+ let _useWorldTargetIfParentExists_initializers = [];
62
+ let _useWorldTargetIfParentExists_extraInitializers = [];
63
+ let _alpha_decorators;
64
+ let _alpha_initializers = [];
65
+ let _alpha_extraInitializers = [];
66
+ let _get_beta_decorators;
67
+ let _radius_decorators;
68
+ let _radius_initializers = [];
69
+ let _radius_extraInitializers = [];
70
+ let _overrideCloneAlphaBetaRadius_decorators;
71
+ let _overrideCloneAlphaBetaRadius_initializers = [];
72
+ let _overrideCloneAlphaBetaRadius_extraInitializers = [];
73
+ let __target_decorators;
74
+ let __target_initializers = [];
75
+ let __target_extraInitializers = [];
76
+ let __targetHost_decorators;
77
+ let __targetHost_initializers = [];
78
+ let __targetHost_extraInitializers = [];
79
+ let _get_inertialAlphaOffset_decorators;
80
+ let _get_inertialBetaOffset_decorators;
81
+ let _get_inertialRadiusOffset_decorators;
82
+ let _lowerAlphaLimit_decorators;
83
+ let _lowerAlphaLimit_initializers = [];
84
+ let _lowerAlphaLimit_extraInitializers = [];
85
+ let _upperAlphaLimit_decorators;
86
+ let _upperAlphaLimit_initializers = [];
87
+ let _upperAlphaLimit_extraInitializers = [];
88
+ let _lowerBetaLimit_decorators;
89
+ let _lowerBetaLimit_initializers = [];
90
+ let _lowerBetaLimit_extraInitializers = [];
91
+ let _upperBetaLimit_decorators;
92
+ let _upperBetaLimit_initializers = [];
93
+ let _upperBetaLimit_extraInitializers = [];
94
+ let _lowerRadiusLimit_decorators;
95
+ let _lowerRadiusLimit_initializers = [];
96
+ let _lowerRadiusLimit_extraInitializers = [];
97
+ let _upperRadiusLimit_decorators;
98
+ let _upperRadiusLimit_initializers = [];
99
+ let _upperRadiusLimit_extraInitializers = [];
100
+ let _lowerTargetYLimit_decorators;
101
+ let _lowerTargetYLimit_initializers = [];
102
+ let _lowerTargetYLimit_extraInitializers = [];
103
+ let _inertialPanningX_decorators;
104
+ let _inertialPanningX_initializers = [];
105
+ let _inertialPanningX_extraInitializers = [];
106
+ let _inertialPanningY_decorators;
107
+ let _inertialPanningY_initializers = [];
108
+ let _inertialPanningY_extraInitializers = [];
109
+ let _pinchToPanMaxDistance_decorators;
110
+ let _pinchToPanMaxDistance_initializers = [];
111
+ let _pinchToPanMaxDistance_extraInitializers = [];
112
+ let _panningDistanceLimit_decorators;
113
+ let _panningDistanceLimit_initializers = [];
114
+ let _panningDistanceLimit_extraInitializers = [];
115
+ let _panningOriginTarget_decorators;
116
+ let _panningOriginTarget_initializers = [];
117
+ let _panningOriginTarget_extraInitializers = [];
118
+ let _get_panningInertia_decorators;
119
+ let _get_zoomToMouseLocation_decorators;
120
+ let _zoomOnFactor_decorators;
121
+ let _zoomOnFactor_initializers = [];
122
+ let _zoomOnFactor_extraInitializers = [];
123
+ let _targetScreenOffset_decorators;
124
+ let _targetScreenOffset_initializers = [];
125
+ let _targetScreenOffset_extraInitializers = [];
126
+ let _allowUpsideDown_decorators;
127
+ let _allowUpsideDown_initializers = [];
128
+ let _allowUpsideDown_extraInitializers = [];
129
+ let _useInputToRestoreState_decorators;
130
+ let _useInputToRestoreState_initializers = [];
131
+ let _useInputToRestoreState_extraInitializers = [];
132
+ let _restoreStateInterpolationFactor_decorators;
133
+ let _restoreStateInterpolationFactor_initializers = [];
134
+ let _restoreStateInterpolationFactor_extraInitializers = [];
135
+ return _a = class ArcRotateCamera extends _classSuper {
136
+ /**
137
+ * Defines the rotation angle of the camera along the latitudinal axis.
138
+ */
139
+ get beta() {
140
+ return this._beta;
141
+ }
142
+ set beta(value) {
143
+ if (!value) {
144
+ if (this._beta > value) {
145
+ this._beta = Epsilon;
146
+ }
147
+ else {
148
+ this._beta = -Epsilon;
149
+ }
825
150
  }
826
151
  else {
827
- this._target.copyFrom(pos);
828
- }
829
- this._target.addInPlace(this._targetOffset);
830
- }
831
- const lockedTargetPosition = this._getLockedTargetPosition();
832
- if (lockedTargetPosition) {
833
- this._target.copyFrom(lockedTargetPosition);
834
- this._target.addInPlace(this._targetOffset);
835
- return lockedTargetPosition;
836
- }
837
- return this._target;
838
- };
839
- const position = getPosition();
840
- if (this.parent && this.parent.getAbsolutePosition && this.useWorldTargetIfParentExists) {
841
- return position.subtract(this.parent.getAbsolutePosition());
842
- }
843
- else {
844
- return position;
845
- }
846
- }
847
- /**
848
- * Stores the current state of the camera (alpha, beta, radius and target)
849
- * @returns the camera itself
850
- */
851
- storeState() {
852
- this._storedAlpha = this.alpha;
853
- this._storedBeta = this.beta;
854
- this._storedRadius = this.radius;
855
- this._storedTarget = this._getTargetPosition().clone();
856
- this._storedTargetScreenOffset = this.targetScreenOffset.clone();
857
- return super.storeState();
858
- }
859
- /**
860
- * @internal
861
- * Restored camera state. You must call storeState() first
862
- */
863
- _restoreStateValues() {
864
- if (this.hasStateStored() && this.restoreStateInterpolationFactor > Epsilon && this.restoreStateInterpolationFactor < 1) {
865
- this.interpolateTo(this._storedAlpha, this._storedBeta, this._storedRadius, this._storedTarget, this._storedTargetScreenOffset, this.restoreStateInterpolationFactor);
866
- return true;
867
- }
868
- if (!super._restoreStateValues()) {
869
- return false;
870
- }
871
- this.setTarget(this._storedTarget.clone());
872
- this.alpha = this._storedAlpha;
873
- this.beta = this._storedBeta;
874
- this.radius = this._storedRadius;
875
- this.targetScreenOffset = this._storedTargetScreenOffset.clone();
876
- this.inertialAlphaOffset = 0;
877
- this.inertialBetaOffset = 0;
878
- this.inertialRadiusOffset = 0;
879
- this.inertialPanningX = 0;
880
- this.inertialPanningY = 0;
881
- return true;
882
- }
883
- /**
884
- * Stops any in-progress interpolation.
885
- */
886
- stopInterpolation() {
887
- this._goalAlpha = NaN;
888
- this._goalBeta = NaN;
889
- this._goalRadius = NaN;
890
- this._goalTarget.set(NaN, NaN, NaN);
891
- this._goalTargetScreenOffset.set(NaN, NaN);
892
- }
893
- /**
894
- * Interpolates the camera to a goal state.
895
- * @param alpha Defines the goal alpha.
896
- * @param beta Defines the goal beta.
897
- * @param radius Defines the goal radius.
898
- * @param target Defines the goal target.
899
- * @param targetScreenOffset Defines the goal target screen offset.
900
- * @param interpolationFactor A value between 0 and 1 that determines the speed of the interpolation.
901
- * @remarks Passing undefined for any of the parameters will use the current value (effectively stopping any in-progress interpolation for that parameter).
902
- * Passing NaN will not start or stop any interpolation for that parameter (effectively allowing multiple interpolations of different parameters to overlap).
903
- */
904
- interpolateTo(alpha = this.alpha, beta = this.beta, radius = this.radius, target = this.target, targetScreenOffset = this.targetScreenOffset, interpolationFactor) {
905
- this.inertialAlphaOffset = 0;
906
- this.inertialBetaOffset = 0;
907
- this.inertialRadiusOffset = 0;
908
- this.inertialPanningX = 0;
909
- this.inertialPanningY = 0;
910
- if (interpolationFactor != null) {
911
- this._currentInterpolationFactor = interpolationFactor;
912
- }
913
- else if (this.restoreStateInterpolationFactor !== 0) {
914
- this._currentInterpolationFactor = this.restoreStateInterpolationFactor;
915
- }
916
- else {
917
- this._currentInterpolationFactor = 0.1;
918
- }
919
- // If NaN is passed in for a goal value, keep the current goal value.
920
- this._goalAlpha = CheckNaN(alpha, this._goalAlpha);
921
- this._goalBeta = CheckNaN(beta, this._goalBeta);
922
- this._goalRadius = CheckNaN(radius, this._goalRadius);
923
- this._goalTarget.set(CheckNaN(target.x, this._goalTarget.x), CheckNaN(target.y, this._goalTarget.y), CheckNaN(target.z, this._goalTarget.z));
924
- this._goalTargetScreenOffset.set(CheckNaN(targetScreenOffset.x, this._goalTargetScreenOffset.x), CheckNaN(targetScreenOffset.y, this._goalTargetScreenOffset.y));
925
- this._goalAlpha = Clamp(this._goalAlpha, this.lowerAlphaLimit ?? -Infinity, this.upperAlphaLimit ?? Infinity);
926
- this._goalBeta = Clamp(this._goalBeta, this.lowerBetaLimit ?? -Infinity, this.upperBetaLimit ?? Infinity);
927
- this._goalRadius = Clamp(this._goalRadius, this.lowerRadiusLimit ?? -Infinity, this.upperRadiusLimit ?? Infinity);
928
- this._goalTarget.y = Clamp(this._goalTarget.y, this.lowerTargetYLimit ?? -Infinity, Infinity);
929
- this._isInterpolating = true;
930
- }
931
- // Synchronized
932
- /** @internal */
933
- _isSynchronizedViewMatrix() {
934
- if (!super._isSynchronizedViewMatrix()) {
935
- return false;
936
- }
937
- return (this._cache._target.equals(this._getTargetPosition()) &&
938
- this._cache.alpha === this.alpha &&
939
- this._cache.beta === this.beta &&
940
- this._cache.radius === this.radius &&
941
- this._cache.targetScreenOffset.equals(this.targetScreenOffset));
942
- }
943
- /**
944
- * Attached controls to the current camera.
945
- * @param ignored defines an ignored parameter kept for backward compatibility.
946
- * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
947
- * @param useCtrlForPanning Defines whether ctrl is used for panning within the controls
948
- * @param panningMouseButton Defines whether panning is allowed through mouse click button
949
- */
950
- attachControl(ignored, noPreventDefault, useCtrlForPanning = true, panningMouseButton = 2) {
951
- const args = arguments;
952
- noPreventDefault = Tools.BackCompatCameraNoPreventDefault(args);
953
- this._useCtrlForPanning = useCtrlForPanning;
954
- this._panningMouseButton = panningMouseButton;
955
- // backwards compatibility
956
- if (typeof args[0] === "boolean") {
957
- if (args.length > 1) {
958
- this._useCtrlForPanning = args[1];
959
- }
960
- if (args.length > 2) {
961
- this._panningMouseButton = args[2];
962
- }
963
- }
964
- this.inputs.attachElement(noPreventDefault);
965
- this._reset = () => {
966
- this.inertialAlphaOffset = 0;
967
- this.inertialBetaOffset = 0;
968
- this.inertialRadiusOffset = 0;
969
- this.inertialPanningX = 0;
970
- this.inertialPanningY = 0;
971
- };
972
- }
973
- /**
974
- * Detach the current controls from the specified dom element.
975
- */
976
- detachControl() {
977
- this.inputs.detachElement();
978
- if (this._reset) {
979
- this._reset();
980
- }
981
- }
982
- /**
983
- * Applies rotation and zoom deltas to the camera, handling invertRotation, handedness, and beta-flip.
984
- * Shared by both the movement system and legacy inertia paths.
985
- * @param alphaOffset - Alpha (horizontal orbit) delta
986
- * @param betaOffset - Beta (vertical orbit) delta
987
- * @param radiusOffset - Radius (zoom) delta
988
- */
989
- _applyRotationAndZoomDelta(alphaOffset, betaOffset, radiusOffset) {
990
- const directionModifier = this.invertRotation ? -1 : 1;
991
- const handednessMultiplier = this._calculateHandednessMultiplier();
992
- let adjustedAlpha = alphaOffset * handednessMultiplier;
993
- if (this.beta < 0) {
994
- adjustedAlpha *= -1;
995
- }
996
- this.alpha += adjustedAlpha * directionModifier;
997
- this.beta += betaOffset * directionModifier;
998
- this.radius -= radiusOffset;
999
- }
1000
- /**
1001
- * Applies a pan delta to the camera target in screen space.
1002
- * Shared by both the movement system and legacy inertia paths.
1003
- * @param panX - Horizontal pan delta
1004
- * @param panY - Vertical pan delta
1005
- */
1006
- _applyPanDelta(panX, panY) {
1007
- const localDirection = TmpVectors.Vector3[0].copyFromFloats(panX, panY, panY);
1008
- this._viewMatrix.invertToRef(this._cameraTransformMatrix);
1009
- localDirection.multiplyInPlace(this.panningAxis);
1010
- Vector3.TransformNormalToRef(localDirection, this._cameraTransformMatrix, this._transformedDirection);
1011
- if (this.mapPanning) {
1012
- const up = this.upVector;
1013
- const right = Vector3.CrossToRef(this._transformedDirection, up, this._transformedDirection);
1014
- Vector3.CrossToRef(up, right, this._transformedDirection);
1015
- }
1016
- else if (!this.panningAxis.y) {
1017
- this._transformedDirection.y = 0;
1018
- }
1019
- if (!this._targetHost) {
1020
- if (this.panningDistanceLimit) {
1021
- this._transformedDirection.addInPlace(this._target);
1022
- const distanceSquared = Vector3.DistanceSquared(this._transformedDirection, this.panningOriginTarget);
1023
- if (distanceSquared <= this.panningDistanceLimit * this.panningDistanceLimit) {
1024
- this._target.copyFrom(this._transformedDirection);
1025
- }
1026
- }
1027
- else {
1028
- if (this.parent) {
1029
- const m = TmpVectors.Matrix[0];
1030
- this.parent.getWorldMatrix().getRotationMatrixToRef(m);
1031
- m.transposeToRef(m);
1032
- Vector3.TransformCoordinatesToRef(this._transformedDirection, m, this._transformedDirection);
1033
- }
1034
- this._target.addInPlace(this._transformedDirection);
1035
- }
1036
- }
1037
- }
1038
- /** @internal */
1039
- _checkInputs() {
1040
- //if (async) collision inspection was triggered, don't update the camera's position - until the collision callback was called.
1041
- if (this._collisionTriggered) {
1042
- return;
1043
- }
1044
- this.inputs.checkInputs();
1045
- let hasUserInteractions = false;
1046
- this.movement.computeCurrentFrameDeltas();
1047
- const rotDelta = this.movement.rotationDeltaCurrentFrame;
1048
- const zoomDelta = this.movement.zoomDeltaCurrentFrame;
1049
- const panDelta = this.movement.panDeltaCurrentFrame;
1050
- if (rotDelta.x !== 0 || rotDelta.y !== 0 || zoomDelta !== 0 || panDelta.x !== 0 || panDelta.y !== 0) {
1051
- hasUserInteractions = true;
1052
- if (rotDelta.x !== 0 || rotDelta.y !== 0 || zoomDelta !== 0) {
1053
- this._applyRotationAndZoomDelta(rotDelta.x, rotDelta.y, zoomDelta);
1054
- }
1055
- if (panDelta.x !== 0 || panDelta.y !== 0) {
1056
- this._applyPanDelta(panDelta.x, panDelta.y);
1057
- }
1058
- }
1059
- // Legacy inertial offsets — backward compat path. Handles direct writes to inertialAlphaOffset
1060
- // etc. (including zoomToMouseLocation which writes to inertialRadiusOffset).
1061
- // Only activates when these values are nonzero, so it is free when unused.
1062
- // We check the private fields here instead of the public getters because the getters fall back
1063
- // to the movement system's current-frame deltas (for back-compat polling), which would cause
1064
- // double-application of the rotation/zoom that movement.computeCurrentFrameDeltas just produced.
1065
- if (this._inertialAlphaOffset !== 0 || this._inertialBetaOffset !== 0 || this._inertialRadiusOffset !== 0) {
1066
- this._applyRotationAndZoomDelta(this._inertialAlphaOffset, this._inertialBetaOffset, this._inertialRadiusOffset);
1067
- this._inertialAlphaOffset *= this.inertia;
1068
- this._inertialBetaOffset *= this.inertia;
1069
- this._inertialRadiusOffset *= this.inertia;
1070
- if (Math.abs(this._inertialAlphaOffset) < this._rotationEpsilon) {
1071
- this._inertialAlphaOffset = 0;
152
+ this._beta = value;
153
+ }
154
+ this._checkLimits();
1072
155
  }
1073
- if (Math.abs(this._inertialBetaOffset) < this._rotationEpsilon) {
1074
- this._inertialBetaOffset = 0;
156
+ /**
157
+ * Defines the offset of the camera target;
158
+ */
159
+ get targetOffset() {
160
+ return this._targetOffset;
161
+ }
162
+ set targetOffset(offset) {
163
+ this._targetOffset = offset;
164
+ }
165
+ /**
166
+ * Defines the target point of the camera.
167
+ * The camera looks towards it from the radius distance.
168
+ */
169
+ get target() {
170
+ return this._target;
171
+ }
172
+ set target(value) {
173
+ this.setTarget(value);
174
+ }
175
+ /**
176
+ * Defines the target transform node of the camera.
177
+ * The camera looks towards it from the radius distance.
178
+ * Please note that setting a target host will disable panning.
179
+ */
180
+ get targetHost() {
181
+ return this._targetHost;
182
+ }
183
+ set targetHost(value) {
184
+ if (value) {
185
+ this.setTarget(value);
186
+ }
187
+ }
188
+ /**
189
+ * Return the current target position of the camera. This value is expressed in local space.
190
+ * @returns the target position
191
+ */
192
+ getTarget() {
193
+ return this.target;
194
+ }
195
+ /**
196
+ * Define the current local position of the camera in the scene
197
+ */
198
+ get position() {
199
+ return this._position;
200
+ }
201
+ set position(newPosition) {
202
+ this.setPosition(newPosition);
203
+ }
204
+ /**
205
+ * The vector the camera should consider as up. (default is Vector3(0, 1, 0) as returned by Vector3.Up())
206
+ * Setting this will copy the given vector to the camera's upVector, and set rotation matrices to and from Y up.
207
+ * DO NOT set the up vector using copyFrom or copyFromFloats, as this bypasses setting the above matrices.
208
+ */
209
+ set upVector(vec) {
210
+ if (!this._upToYMatrix) {
211
+ this._yToUpMatrix = new Matrix();
212
+ this._upToYMatrix = new Matrix();
213
+ this._upVector = Vector3.Zero();
214
+ }
215
+ vec.normalize();
216
+ this._upVector.copyFrom(vec);
217
+ this.setMatUp();
218
+ }
219
+ get upVector() {
220
+ return this._upVector;
221
+ }
222
+ /**
223
+ * Sets the Y-up to camera up-vector rotation matrix, and the up-vector to Y-up rotation matrix.
224
+ */
225
+ setMatUp() {
226
+ // from y-up to custom-up (used in _getViewMatrix)
227
+ Matrix.RotationAlignToRef(Vector3.UpReadOnly, this._upVector, this._yToUpMatrix);
228
+ // from custom-up to y-up (used in rebuildAnglesAndRadius)
229
+ Matrix.RotationAlignToRef(this._upVector, Vector3.UpReadOnly, this._upToYMatrix);
230
+ }
231
+ /**
232
+ * Current inertia value on the longitudinal axis.
233
+ * When nonzero, represents the per-frame angular offset (in radians) applied to `alpha`.
234
+ * Each frame, this value is multiplied by {@link inertia} (a decay coefficient where
235
+ * 0 = instant stop, 0.9 = smooth glide, 1 = never stops).
236
+ * Reading this value also reflects the rotation delta the movement system will apply this frame
237
+ * (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks.
238
+ * Setting this to 0 also stops the movement system's rotation velocity for backward compatibility.
239
+ */
240
+ get inertialAlphaOffset() {
241
+ if (this._inertialAlphaOffset !== 0) {
242
+ return this._inertialAlphaOffset;
243
+ }
244
+ if (this.movement.rotationAccumulatedPixels.x !== 0) {
245
+ return this.movement.rotationAccumulatedPixels.x;
246
+ }
247
+ const delta = this.movement.rotationDeltaCurrentFrame.x;
248
+ return Math.abs(delta) < this._rotationEpsilon ? 0 : delta;
249
+ }
250
+ set inertialAlphaOffset(value) {
251
+ this._inertialAlphaOffset = value;
252
+ if (value === 0) {
253
+ this.movement.resetRotationVelocity();
254
+ }
255
+ }
256
+ /**
257
+ * Current inertia value on the latitudinal axis.
258
+ * When nonzero, represents the per-frame angular offset (in radians) applied to `beta`.
259
+ * Each frame, this value is multiplied by {@link inertia} (a decay coefficient where
260
+ * 0 = instant stop, 0.9 = smooth glide, 1 = never stops).
261
+ * Reading this value also reflects the rotation delta the movement system will apply this frame
262
+ * (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks.
263
+ * Setting this to 0 also stops the movement system's rotation velocity for backward compatibility.
264
+ */
265
+ get inertialBetaOffset() {
266
+ if (this._inertialBetaOffset !== 0) {
267
+ return this._inertialBetaOffset;
268
+ }
269
+ if (this.movement.rotationAccumulatedPixels.y !== 0) {
270
+ return this.movement.rotationAccumulatedPixels.y;
271
+ }
272
+ const delta = this.movement.rotationDeltaCurrentFrame.y;
273
+ return Math.abs(delta) < this._rotationEpsilon ? 0 : delta;
274
+ }
275
+ set inertialBetaOffset(value) {
276
+ this._inertialBetaOffset = value;
277
+ if (value === 0) {
278
+ this.movement.resetRotationVelocity();
279
+ }
280
+ }
281
+ /**
282
+ * Current inertia value on the radius axis.
283
+ * When nonzero, represents the per-frame offset (in scene units) applied to `radius`.
284
+ * Each frame, this value is multiplied by {@link inertia} (a decay coefficient where
285
+ * 0 = instant stop, 0.9 = smooth glide, 1 = never stops).
286
+ * Reading this value also reflects the zoom delta the movement system will apply this frame
287
+ * (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks.
288
+ * Setting this to 0 also stops the movement system's zoom velocity for backward compatibility.
289
+ */
290
+ get inertialRadiusOffset() {
291
+ if (this._inertialRadiusOffset !== 0) {
292
+ return this._inertialRadiusOffset;
293
+ }
294
+ if (this.movement.zoomAccumulatedPixels !== 0) {
295
+ return this.movement.zoomAccumulatedPixels;
296
+ }
297
+ const delta = this.movement.zoomDeltaCurrentFrame;
298
+ return Math.abs(delta) < this._rotationEpsilon ? 0 : delta;
299
+ }
300
+ set inertialRadiusOffset(value) {
301
+ this._inertialRadiusOffset = value;
302
+ if (value === 0) {
303
+ this.movement.resetZoomVelocity();
304
+ }
305
+ }
306
+ /**
307
+ * Defines the value of the inertia used during panning.
308
+ * A decay coefficient applied per reference frame at 60fps:
309
+ * 0 means stop instantly, 0.9 means smooth glide, 1 means never stop.
310
+ * Setting this also updates the movement system's pan inertia.
311
+ */
312
+ get panningInertia() {
313
+ return this._panningInertia;
314
+ }
315
+ set panningInertia(value) {
316
+ this._panningInertia = value;
317
+ if (this.movement) {
318
+ this.movement.panInertia = value;
319
+ }
320
+ }
321
+ /**
322
+ * Defines the rotation/zoom inertia (decay coefficient applied per reference frame at 60fps).
323
+ * Override of {@link Camera.inertia} that automatically syncs to the movement system
324
+ * (rotation and zoom). Panning inertia is controlled separately via {@link panningInertia}.
325
+ */
326
+ get inertia() {
327
+ return this._inertia;
328
+ }
329
+ set inertia(value) {
330
+ this._inertia = value;
331
+ if (this.movement) {
332
+ this.movement.rotationInertia = value;
333
+ this.movement.zoomInertia = value;
334
+ }
335
+ }
336
+ //-- begin properties for backward compatibility for inputs
337
+ /**
338
+ * Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating.
339
+ */
340
+ get angularSensibilityX() {
341
+ const pointers = this.inputs.attached["pointers"];
342
+ if (pointers) {
343
+ return pointers.angularSensibilityX;
344
+ }
345
+ return 0;
346
+ }
347
+ set angularSensibilityX(value) {
348
+ const pointers = this.inputs.attached["pointers"];
349
+ if (pointers) {
350
+ pointers.angularSensibilityX = value;
351
+ }
352
+ }
353
+ /**
354
+ * Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.
355
+ */
356
+ get angularSensibilityY() {
357
+ const pointers = this.inputs.attached["pointers"];
358
+ if (pointers) {
359
+ return pointers.angularSensibilityY;
360
+ }
361
+ return 0;
362
+ }
363
+ set angularSensibilityY(value) {
364
+ const pointers = this.inputs.attached["pointers"];
365
+ if (pointers) {
366
+ pointers.angularSensibilityY = value;
367
+ }
368
+ }
369
+ /**
370
+ * Gets or Set the pointer pinch precision or how fast is the camera zooming.
371
+ */
372
+ get pinchPrecision() {
373
+ const pointers = this.inputs.attached["pointers"];
374
+ if (pointers) {
375
+ return pointers.pinchPrecision;
376
+ }
377
+ return 0;
378
+ }
379
+ set pinchPrecision(value) {
380
+ const pointers = this.inputs.attached["pointers"];
381
+ if (pointers) {
382
+ pointers.pinchPrecision = value;
383
+ }
384
+ }
385
+ /**
386
+ * Gets or Set the pointer pinch delta percentage or how fast is the camera zooming.
387
+ * It will be used instead of pinchPrecision if different from 0.
388
+ * It defines the percentage of current camera.radius to use as delta when pinch zoom is used.
389
+ */
390
+ get pinchDeltaPercentage() {
391
+ const pointers = this.inputs.attached["pointers"];
392
+ if (pointers) {
393
+ return pointers.pinchDeltaPercentage;
394
+ }
395
+ return 0;
396
+ }
397
+ set pinchDeltaPercentage(value) {
398
+ const pointers = this.inputs.attached["pointers"];
399
+ if (pointers) {
400
+ pointers.pinchDeltaPercentage = value;
401
+ }
402
+ }
403
+ /**
404
+ * Gets or Set the pointer use natural pinch zoom to override the pinch precision
405
+ * and pinch delta percentage.
406
+ * When useNaturalPinchZoom is true, multi touch zoom will zoom in such
407
+ * that any object in the plane at the camera's target point will scale
408
+ * perfectly with finger motion.
409
+ */
410
+ get useNaturalPinchZoom() {
411
+ const pointers = this.inputs.attached["pointers"];
412
+ if (pointers) {
413
+ return pointers.useNaturalPinchZoom;
414
+ }
415
+ return false;
416
+ }
417
+ set useNaturalPinchZoom(value) {
418
+ const pointers = this.inputs.attached["pointers"];
419
+ if (pointers) {
420
+ pointers.useNaturalPinchZoom = value;
421
+ }
422
+ }
423
+ /**
424
+ * Gets or Set the pointer panning sensibility or how fast is the camera moving.
425
+ */
426
+ get panningSensibility() {
427
+ const pointers = this.inputs.attached["pointers"];
428
+ if (pointers) {
429
+ return pointers.panningSensibility;
430
+ }
431
+ return 0;
432
+ }
433
+ set panningSensibility(value) {
434
+ const pointers = this.inputs.attached["pointers"];
435
+ if (pointers) {
436
+ pointers.panningSensibility = value;
437
+ }
438
+ }
439
+ /**
440
+ * Gets or Set the list of keyboard keys used to control beta angle in a positive direction.
441
+ */
442
+ get keysUp() {
443
+ const keyboard = this.inputs.attached["keyboard"];
444
+ if (keyboard) {
445
+ return keyboard.keysUp;
446
+ }
447
+ return [];
448
+ }
449
+ set keysUp(value) {
450
+ const keyboard = this.inputs.attached["keyboard"];
451
+ if (keyboard) {
452
+ keyboard.keysUp = value;
453
+ }
454
+ }
455
+ /**
456
+ * Gets or Set the list of keyboard keys used to control beta angle in a negative direction.
457
+ */
458
+ get keysDown() {
459
+ const keyboard = this.inputs.attached["keyboard"];
460
+ if (keyboard) {
461
+ return keyboard.keysDown;
462
+ }
463
+ return [];
1075
464
  }
1076
- if (Math.abs(this._inertialRadiusOffset) < this.speed * this._rotationEpsilon) {
465
+ set keysDown(value) {
466
+ const keyboard = this.inputs.attached["keyboard"];
467
+ if (keyboard) {
468
+ keyboard.keysDown = value;
469
+ }
470
+ }
471
+ /**
472
+ * Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.
473
+ */
474
+ get keysLeft() {
475
+ const keyboard = this.inputs.attached["keyboard"];
476
+ if (keyboard) {
477
+ return keyboard.keysLeft;
478
+ }
479
+ return [];
480
+ }
481
+ set keysLeft(value) {
482
+ const keyboard = this.inputs.attached["keyboard"];
483
+ if (keyboard) {
484
+ keyboard.keysLeft = value;
485
+ }
486
+ }
487
+ /**
488
+ * Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.
489
+ */
490
+ get keysRight() {
491
+ const keyboard = this.inputs.attached["keyboard"];
492
+ if (keyboard) {
493
+ return keyboard.keysRight;
494
+ }
495
+ return [];
496
+ }
497
+ set keysRight(value) {
498
+ const keyboard = this.inputs.attached["keyboard"];
499
+ if (keyboard) {
500
+ keyboard.keysRight = value;
501
+ }
502
+ }
503
+ /**
504
+ * Gets or Set the mouse wheel precision or how fast is the camera zooming.
505
+ */
506
+ get wheelPrecision() {
507
+ const mousewheel = this.inputs.attached["mousewheel"];
508
+ if (mousewheel) {
509
+ return mousewheel.wheelPrecision;
510
+ }
511
+ return 0;
512
+ }
513
+ set wheelPrecision(value) {
514
+ const mousewheel = this.inputs.attached["mousewheel"];
515
+ if (mousewheel) {
516
+ mousewheel.wheelPrecision = value;
517
+ }
518
+ }
519
+ /**
520
+ * Gets or Set the boolean value that controls whether or not the mouse wheel
521
+ * zooms to the location of the mouse pointer or not. The default is false.
522
+ */
523
+ get zoomToMouseLocation() {
524
+ const mousewheel = this.inputs.attached["mousewheel"];
525
+ if (mousewheel) {
526
+ return mousewheel.zoomToMouseLocation;
527
+ }
528
+ return false;
529
+ }
530
+ set zoomToMouseLocation(value) {
531
+ const mousewheel = this.inputs.attached["mousewheel"];
532
+ if (mousewheel) {
533
+ mousewheel.zoomToMouseLocation = value;
534
+ }
535
+ }
536
+ /**
537
+ * Gets or Set the mouse wheel delta percentage or how fast is the camera zooming.
538
+ * It will be used instead of wheelPrecision if different from 0.
539
+ * It defines the percentage of current camera.radius to use as delta when wheel zoom is used.
540
+ */
541
+ get wheelDeltaPercentage() {
542
+ const mousewheel = this.inputs.attached["mousewheel"];
543
+ if (mousewheel) {
544
+ return mousewheel.wheelDeltaPercentage;
545
+ }
546
+ return 0;
547
+ }
548
+ set wheelDeltaPercentage(value) {
549
+ const mousewheel = this.inputs.attached["mousewheel"];
550
+ if (mousewheel) {
551
+ mousewheel.wheelDeltaPercentage = value;
552
+ }
553
+ }
554
+ /**
555
+ * Gets or sets whether ctrl+keyboard triggers panning.
556
+ * Setting this updates the keyboard→pan inputMap entry.
557
+ * @internal kept for backward compatibility
558
+ */
559
+ get _useCtrlForPanning() {
560
+ return this._useCtrlForPanningInternal;
561
+ }
562
+ set _useCtrlForPanning(value) {
563
+ this._useCtrlForPanningInternal = value;
564
+ const input = this.movement.input;
565
+ // Manage keyboard ctrl → pan entry
566
+ const keyboardEntry = input.getEntry("keyboard", "pan", { modifiers: { ctrl: true } });
567
+ if (!value && keyboardEntry) {
568
+ input.inputMap.splice(input.inputMap.indexOf(keyboardEntry), 1);
569
+ }
570
+ else if (value && !keyboardEntry) {
571
+ input.addEntry({ source: "keyboard", modifiers: { ctrl: true }, interaction: "pan" });
572
+ }
573
+ // Manage pointer ctrl+left-drag → pan entry (matches legacy ArcRotateCameraPointersInput behavior)
574
+ const pointerEntry = input.getEntry("pointer", "pan", { modifiers: { ctrl: true } });
575
+ if (!value && pointerEntry) {
576
+ input.inputMap.splice(input.inputMap.indexOf(pointerEntry), 1);
577
+ }
578
+ else if (value && !pointerEntry) {
579
+ input.addEntry({ source: "pointer", button: 0, modifiers: { ctrl: true }, interaction: "pan" });
580
+ }
581
+ }
582
+ /**
583
+ * Gets or sets which mouse button triggers panning (0=left, 1=middle, 2=right).
584
+ * Setting this updates the pointer→pan inputMap entry.
585
+ * @internal kept for backward compatibility with attachControl signature
586
+ */
587
+ get _panningMouseButton() {
588
+ return this._panningMouseButtonInternal;
589
+ }
590
+ set _panningMouseButton(value) {
591
+ this._panningMouseButtonInternal = value;
592
+ const entry = this.movement.input.getEntry("pointer", "pan", { modifiers: {} });
593
+ if (entry) {
594
+ entry.button = value;
595
+ }
596
+ }
597
+ /**
598
+ * If true, indicates the camera is currently interpolating to a new pose.
599
+ */
600
+ get isInterpolating() {
601
+ return this._isInterpolating;
602
+ }
603
+ /**
604
+ * Gets the bouncing behavior of the camera if it has been enabled.
605
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
606
+ */
607
+ get bouncingBehavior() {
608
+ return this._bouncingBehavior;
609
+ }
610
+ /**
611
+ * Defines if the bouncing behavior of the camera is enabled on the camera.
612
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#bouncing-behavior
613
+ */
614
+ get useBouncingBehavior() {
615
+ return this._bouncingBehavior != null;
616
+ }
617
+ set useBouncingBehavior(value) {
618
+ if (value === this.useBouncingBehavior) {
619
+ return;
620
+ }
621
+ if (value) {
622
+ this._bouncingBehavior = new BouncingBehavior();
623
+ this.addBehavior(this._bouncingBehavior);
624
+ }
625
+ else if (this._bouncingBehavior) {
626
+ this.removeBehavior(this._bouncingBehavior);
627
+ this._bouncingBehavior = null;
628
+ }
629
+ }
630
+ /**
631
+ * Gets the framing behavior of the camera if it has been enabled.
632
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
633
+ */
634
+ get framingBehavior() {
635
+ return this._framingBehavior;
636
+ }
637
+ /**
638
+ * Defines if the framing behavior of the camera is enabled on the camera.
639
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior
640
+ */
641
+ get useFramingBehavior() {
642
+ return this._framingBehavior != null;
643
+ }
644
+ set useFramingBehavior(value) {
645
+ if (value === this.useFramingBehavior) {
646
+ return;
647
+ }
648
+ if (value) {
649
+ this._framingBehavior = new FramingBehavior();
650
+ this.addBehavior(this._framingBehavior);
651
+ }
652
+ else if (this._framingBehavior) {
653
+ this.removeBehavior(this._framingBehavior);
654
+ this._framingBehavior = null;
655
+ }
656
+ }
657
+ /**
658
+ * Gets the auto rotation behavior of the camera if it has been enabled.
659
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
660
+ */
661
+ get autoRotationBehavior() {
662
+ return this._autoRotationBehavior;
663
+ }
664
+ /**
665
+ * Defines if the auto rotation behavior of the camera is enabled on the camera.
666
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#autorotation-behavior
667
+ */
668
+ get useAutoRotationBehavior() {
669
+ return this._autoRotationBehavior != null;
670
+ }
671
+ set useAutoRotationBehavior(value) {
672
+ if (value === this.useAutoRotationBehavior) {
673
+ return;
674
+ }
675
+ if (value) {
676
+ this._autoRotationBehavior = new AutoRotationBehavior();
677
+ this.addBehavior(this._autoRotationBehavior);
678
+ }
679
+ else if (this._autoRotationBehavior) {
680
+ this.removeBehavior(this._autoRotationBehavior);
681
+ this._autoRotationBehavior = null;
682
+ }
683
+ }
684
+ /**
685
+ * Instantiates a new ArcRotateCamera in a given scene
686
+ * @param name Defines the name of the camera
687
+ * @param alpha Defines the camera rotation along the longitudinal axis
688
+ * @param beta Defines the camera rotation along the latitudinal axis
689
+ * @param radius Defines the camera distance from its target
690
+ * @param target Defines the camera target
691
+ * @param scene Defines the scene the camera belongs to
692
+ * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
693
+ */
694
+ constructor(name, alpha, beta, radius, target, scene, setActiveOnSceneIfNoneActive = true) {
695
+ super(name, Vector3.Zero(), scene, setActiveOnSceneIfNoneActive);
696
+ /**
697
+ * If camera has parent,then recognize target as world target if set true.
698
+ */
699
+ this.useWorldTargetIfParentExists = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _useWorldTargetIfParentExists_initializers, true));
700
+ /**
701
+ * Defines the rotation angle of the camera along the longitudinal axis.
702
+ */
703
+ this.alpha = (__runInitializers(this, _useWorldTargetIfParentExists_extraInitializers), __runInitializers(this, _alpha_initializers, void 0));
704
+ this._beta = __runInitializers(this, _alpha_extraInitializers);
705
+ /**
706
+ * Defines the radius of the camera from its target point.
707
+ */
708
+ this.radius = __runInitializers(this, _radius_initializers, void 0);
709
+ /**
710
+ * Defines an override value to use as the parameter to setTarget.
711
+ * This allows the parameter to be specified when animating the target (e.g. using FramingBehavior).
712
+ */
713
+ this.overrideCloneAlphaBetaRadius = (__runInitializers(this, _radius_extraInitializers), __runInitializers(this, _overrideCloneAlphaBetaRadius_initializers, void 0));
714
+ this._targetOffset = (__runInitializers(this, _overrideCloneAlphaBetaRadius_extraInitializers), Vector3.Zero());
715
+ this._target = __runInitializers(this, __target_initializers, void 0);
716
+ this._targetHost = (__runInitializers(this, __target_extraInitializers), __runInitializers(this, __targetHost_initializers, void 0));
717
+ // eslint-disable-next-line @typescript-eslint/naming-convention
718
+ this._upToYMatrix = __runInitializers(this, __targetHost_extraInitializers);
719
+ this._inertialAlphaOffset = 0;
720
+ this._inertialBetaOffset = 0;
1077
721
  this._inertialRadiusOffset = 0;
722
+ /**
723
+ * Minimum allowed angle on the longitudinal axis.
724
+ * This can help limiting how the Camera is able to move in the scene.
725
+ */
726
+ this.lowerAlphaLimit = __runInitializers(this, _lowerAlphaLimit_initializers, null);
727
+ /**
728
+ * Maximum allowed angle on the longitudinal axis.
729
+ * This can help limiting how the Camera is able to move in the scene.
730
+ */
731
+ this.upperAlphaLimit = (__runInitializers(this, _lowerAlphaLimit_extraInitializers), __runInitializers(this, _upperAlphaLimit_initializers, null));
732
+ /**
733
+ * Minimum allowed angle on the latitudinal axis.
734
+ * This can help limiting how the Camera is able to move in the scene.
735
+ */
736
+ this.lowerBetaLimit = (__runInitializers(this, _upperAlphaLimit_extraInitializers), __runInitializers(this, _lowerBetaLimit_initializers, 0.01));
737
+ /**
738
+ * Maximum allowed angle on the latitudinal axis.
739
+ * This can help limiting how the Camera is able to move in the scene.
740
+ */
741
+ this.upperBetaLimit = (__runInitializers(this, _lowerBetaLimit_extraInitializers), __runInitializers(this, _upperBetaLimit_initializers, Math.PI - 0.01));
742
+ /**
743
+ * Minimum allowed distance of the camera to the target (The camera can not get closer).
744
+ * This can help limiting how the Camera is able to move in the scene.
745
+ */
746
+ this.lowerRadiusLimit = (__runInitializers(this, _upperBetaLimit_extraInitializers), __runInitializers(this, _lowerRadiusLimit_initializers, null));
747
+ /**
748
+ * Maximum allowed distance of the camera to the target (The camera can not get further).
749
+ * This can help limiting how the Camera is able to move in the scene.
750
+ */
751
+ this.upperRadiusLimit = (__runInitializers(this, _lowerRadiusLimit_extraInitializers), __runInitializers(this, _upperRadiusLimit_initializers, null));
752
+ /**
753
+ * Minimum allowed vertical target position of the camera.
754
+ * Use this setting in combination with `upperRadiusLimit` to set a global limit for the Cameras vertical position.
755
+ */
756
+ this.lowerTargetYLimit = (__runInitializers(this, _upperRadiusLimit_extraInitializers), __runInitializers(this, _lowerTargetYLimit_initializers, -Infinity));
757
+ /**
758
+ * Defines the current inertia value used during panning of the camera along the X axis.
759
+ */
760
+ this.inertialPanningX = (__runInitializers(this, _lowerTargetYLimit_extraInitializers), __runInitializers(this, _inertialPanningX_initializers, 0));
761
+ /**
762
+ * Defines the current inertia value used during panning of the camera along the Y axis.
763
+ */
764
+ this.inertialPanningY = (__runInitializers(this, _inertialPanningX_extraInitializers), __runInitializers(this, _inertialPanningY_initializers, 0));
765
+ /**
766
+ * Defines the distance used to consider the camera in pan mode vs pinch/zoom.
767
+ * Basically if your fingers moves away from more than this distance you will be considered
768
+ * in pinch mode.
769
+ */
770
+ this.pinchToPanMaxDistance = (__runInitializers(this, _inertialPanningY_extraInitializers), __runInitializers(this, _pinchToPanMaxDistance_initializers, 20));
771
+ /**
772
+ * Defines the maximum distance the camera can pan.
773
+ * This could help keeping the camera always in your scene.
774
+ */
775
+ this.panningDistanceLimit = (__runInitializers(this, _pinchToPanMaxDistance_extraInitializers), __runInitializers(this, _panningDistanceLimit_initializers, null));
776
+ /**
777
+ * Defines the target of the camera before panning.
778
+ */
779
+ this.panningOriginTarget = (__runInitializers(this, _panningDistanceLimit_extraInitializers), __runInitializers(this, _panningOriginTarget_initializers, Vector3.Zero()));
780
+ this._panningInertia = (__runInitializers(this, _panningOriginTarget_extraInitializers), 0.9);
781
+ this._inertia = 0.9;
782
+ //-- end properties for backward compatibility for inputs
783
+ /**
784
+ * Defines how much the radius should be scaled while zooming on a particular mesh (through the zoomOn function)
785
+ */
786
+ this.zoomOnFactor = __runInitializers(this, _zoomOnFactor_initializers, 1);
787
+ /**
788
+ * Defines a screen offset for the camera position.
789
+ */
790
+ this.targetScreenOffset = (__runInitializers(this, _zoomOnFactor_extraInitializers), __runInitializers(this, _targetScreenOffset_initializers, Vector2.Zero()));
791
+ /**
792
+ * Allows the camera to be completely reversed.
793
+ * If false the camera can not arrive upside down.
794
+ */
795
+ this.allowUpsideDown = (__runInitializers(this, _targetScreenOffset_extraInitializers), __runInitializers(this, _allowUpsideDown_initializers, true));
796
+ /**
797
+ * Define if double tap/click is used to restore the previously saved state of the camera.
798
+ */
799
+ this.useInputToRestoreState = (__runInitializers(this, _allowUpsideDown_extraInitializers), __runInitializers(this, _useInputToRestoreState_initializers, true));
800
+ /**
801
+ * Factor for restoring information interpolation. default is 0 = off. Any value \< 0 or \> 1 will disable interpolation.
802
+ */
803
+ this.restoreStateInterpolationFactor = (__runInitializers(this, _useInputToRestoreState_extraInitializers), __runInitializers(this, _restoreStateInterpolationFactor_initializers, 0));
804
+ this._currentInterpolationFactor = (__runInitializers(this, _restoreStateInterpolationFactor_extraInitializers), 0);
805
+ /** @internal */
806
+ this._viewMatrix = new Matrix();
807
+ this._useCtrlForPanningInternal = true;
808
+ this._panningMouseButtonInternal = 2;
809
+ /**
810
+ * Defines the allowed panning axis.
811
+ */
812
+ this.panningAxis = new Vector3(1, 1, 0);
813
+ this._transformedDirection = new Vector3();
814
+ /**
815
+ * Defines if camera will eliminate transform on y axis.
816
+ */
817
+ this.mapPanning = false;
818
+ // This is redundant with all _goal* properties being NaN, but we track it anyway because we check for active interpolation in the hot path.
819
+ this._isInterpolating = false;
820
+ /**
821
+ * Observable triggered when the transform node target has been changed on the camera.
822
+ */
823
+ this.onMeshTargetChangedObservable = new Observable();
824
+ /**
825
+ * Defines whether the camera should check collision with the objects oh the scene.
826
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#how-can-i-do-this-
827
+ */
828
+ this.checkCollisions = false;
829
+ /**
830
+ * Defines the collision radius of the camera.
831
+ * This simulates a sphere around the camera.
832
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#arcrotatecamera
833
+ */
834
+ this.collisionRadius = new Vector3(0.5, 0.5, 0.5);
835
+ this._previousPosition = Vector3.Zero();
836
+ this._collisionVelocity = Vector3.Zero();
837
+ this._newPosition = Vector3.Zero();
838
+ this._computationVector = Vector3.Zero();
839
+ this._goalAlpha = NaN;
840
+ this._goalBeta = NaN;
841
+ this._goalRadius = NaN;
842
+ this._goalTarget = new Vector3(NaN, NaN, NaN);
843
+ this._goalTargetScreenOffset = new Vector2(NaN, NaN);
844
+ this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {
845
+ if (!collidedMesh) {
846
+ this._previousPosition.copyFrom(this._position);
847
+ }
848
+ else {
849
+ this.setPosition(newPosition);
850
+ if (this.onCollide) {
851
+ this.onCollide(collidedMesh);
852
+ }
853
+ }
854
+ // Recompute because of constraints
855
+ const cosa = Math.cos(this.alpha);
856
+ const sina = Math.sin(this.alpha);
857
+ const cosb = Math.cos(this.beta);
858
+ let sinb = Math.sin(this.beta);
859
+ if (sinb === 0) {
860
+ sinb = 0.0001;
861
+ }
862
+ const target = this._getTargetPosition();
863
+ this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
864
+ target.addToRef(this._computationVector, this._newPosition);
865
+ this._position.copyFrom(this._newPosition);
866
+ let up = this.upVector;
867
+ if (this.allowUpsideDown && this.beta < 0) {
868
+ up = up.clone();
869
+ up = up.negate();
870
+ }
871
+ this._computeViewMatrix(this._position, target, up);
872
+ this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x);
873
+ this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);
874
+ this._collisionTriggered = false;
875
+ };
876
+ this._target = Vector3.Zero();
877
+ if (target) {
878
+ this.setTarget(target);
879
+ }
880
+ this.alpha = alpha;
881
+ this.beta = beta;
882
+ this.radius = radius;
883
+ this.getViewMatrix();
884
+ this.inputs = new ArcRotateCameraInputsManager(this);
885
+ this.inputs.addKeyboard().addMouseWheel().addPointers();
886
+ this.movement = new ArcRotateCameraMovement(this.getScene(), this._position);
887
+ // Seed movement-system inertia from the values set during base/subclass construction.
888
+ // After this point, the inertia/panningInertia setters on this class push directly to movement.
889
+ this.movement.rotationInertia = this._inertia;
890
+ this.movement.zoomInertia = this._inertia;
891
+ this.movement.panInertia = this._panningInertia;
892
+ }
893
+ // Cache
894
+ /** @internal */
895
+ _initCache() {
896
+ super._initCache();
897
+ this._cache._target = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
898
+ this._cache.alpha = undefined;
899
+ this._cache.beta = undefined;
900
+ this._cache.radius = undefined;
901
+ this._cache.targetScreenOffset = Vector2.Zero();
902
+ }
903
+ /**
904
+ * @internal
905
+ */
906
+ _updateCache(ignoreParentClass) {
907
+ if (!ignoreParentClass) {
908
+ super._updateCache();
909
+ }
910
+ this._cache._target.copyFrom(this._getTargetPosition());
911
+ this._cache.alpha = this.alpha;
912
+ this._cache.beta = this.beta;
913
+ this._cache.radius = this.radius;
914
+ this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset);
915
+ }
916
+ _getTargetPosition() {
917
+ const getPosition = () => {
918
+ if (this._targetHost && this._targetHost.getAbsolutePosition) {
919
+ const pos = this._targetHost.getAbsolutePosition();
920
+ if (this._targetBoundingCenter) {
921
+ pos.addToRef(this._targetBoundingCenter, this._target);
922
+ }
923
+ else {
924
+ this._target.copyFrom(pos);
925
+ }
926
+ this._target.addInPlace(this._targetOffset);
927
+ }
928
+ const lockedTargetPosition = this._getLockedTargetPosition();
929
+ if (lockedTargetPosition) {
930
+ this._target.copyFrom(lockedTargetPosition);
931
+ this._target.addInPlace(this._targetOffset);
932
+ return lockedTargetPosition;
933
+ }
934
+ return this._target;
935
+ };
936
+ const position = getPosition();
937
+ if (this.parent && this.parent.getAbsolutePosition && this.useWorldTargetIfParentExists) {
938
+ return position.subtract(this.parent.getAbsolutePosition());
939
+ }
940
+ else {
941
+ return position;
942
+ }
1078
943
  }
1079
- hasUserInteractions = true;
1080
- }
1081
- if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) {
1082
- this._applyPanDelta(this.inertialPanningX, this.inertialPanningY);
1083
- this.inertialPanningX *= this.panningInertia;
1084
- this.inertialPanningY *= this.panningInertia;
1085
- const inertialPanningLimit = this.speed * this._panningEpsilon;
1086
- if (Math.abs(this.inertialPanningX) < inertialPanningLimit) {
944
+ /**
945
+ * Stores the current state of the camera (alpha, beta, radius and target)
946
+ * @returns the camera itself
947
+ */
948
+ storeState() {
949
+ this._storedAlpha = this.alpha;
950
+ this._storedBeta = this.beta;
951
+ this._storedRadius = this.radius;
952
+ this._storedTarget = this._getTargetPosition().clone();
953
+ this._storedTargetScreenOffset = this.targetScreenOffset.clone();
954
+ return super.storeState();
955
+ }
956
+ /**
957
+ * @internal
958
+ * Restored camera state. You must call storeState() first
959
+ */
960
+ _restoreStateValues() {
961
+ if (this.hasStateStored() && this.restoreStateInterpolationFactor > Epsilon && this.restoreStateInterpolationFactor < 1) {
962
+ this.interpolateTo(this._storedAlpha, this._storedBeta, this._storedRadius, this._storedTarget, this._storedTargetScreenOffset, this.restoreStateInterpolationFactor);
963
+ return true;
964
+ }
965
+ if (!super._restoreStateValues()) {
966
+ return false;
967
+ }
968
+ this.setTarget(this._storedTarget.clone());
969
+ this.alpha = this._storedAlpha;
970
+ this.beta = this._storedBeta;
971
+ this.radius = this._storedRadius;
972
+ this.targetScreenOffset = this._storedTargetScreenOffset.clone();
973
+ this.inertialAlphaOffset = 0;
974
+ this.inertialBetaOffset = 0;
975
+ this.inertialRadiusOffset = 0;
1087
976
  this.inertialPanningX = 0;
977
+ this.inertialPanningY = 0;
978
+ return true;
979
+ }
980
+ /**
981
+ * Stops any in-progress interpolation.
982
+ */
983
+ stopInterpolation() {
984
+ this._goalAlpha = NaN;
985
+ this._goalBeta = NaN;
986
+ this._goalRadius = NaN;
987
+ this._goalTarget.set(NaN, NaN, NaN);
988
+ this._goalTargetScreenOffset.set(NaN, NaN);
1088
989
  }
1089
- if (Math.abs(this.inertialPanningY) < inertialPanningLimit) {
990
+ /**
991
+ * Interpolates the camera to a goal state.
992
+ * @param alpha Defines the goal alpha.
993
+ * @param beta Defines the goal beta.
994
+ * @param radius Defines the goal radius.
995
+ * @param target Defines the goal target.
996
+ * @param targetScreenOffset Defines the goal target screen offset.
997
+ * @param interpolationFactor A value between 0 and 1 that determines the speed of the interpolation.
998
+ * @remarks Passing undefined for any of the parameters will use the current value (effectively stopping any in-progress interpolation for that parameter).
999
+ * Passing NaN will not start or stop any interpolation for that parameter (effectively allowing multiple interpolations of different parameters to overlap).
1000
+ */
1001
+ interpolateTo(alpha = this.alpha, beta = this.beta, radius = this.radius, target = this.target, targetScreenOffset = this.targetScreenOffset, interpolationFactor) {
1002
+ this.inertialAlphaOffset = 0;
1003
+ this.inertialBetaOffset = 0;
1004
+ this.inertialRadiusOffset = 0;
1005
+ this.inertialPanningX = 0;
1090
1006
  this.inertialPanningY = 0;
1007
+ if (interpolationFactor != null) {
1008
+ this._currentInterpolationFactor = interpolationFactor;
1009
+ }
1010
+ else if (this.restoreStateInterpolationFactor !== 0) {
1011
+ this._currentInterpolationFactor = this.restoreStateInterpolationFactor;
1012
+ }
1013
+ else {
1014
+ this._currentInterpolationFactor = 0.1;
1015
+ }
1016
+ // If NaN is passed in for a goal value, keep the current goal value.
1017
+ this._goalAlpha = CheckNaN(alpha, this._goalAlpha);
1018
+ this._goalBeta = CheckNaN(beta, this._goalBeta);
1019
+ this._goalRadius = CheckNaN(radius, this._goalRadius);
1020
+ this._goalTarget.set(CheckNaN(target.x, this._goalTarget.x), CheckNaN(target.y, this._goalTarget.y), CheckNaN(target.z, this._goalTarget.z));
1021
+ this._goalTargetScreenOffset.set(CheckNaN(targetScreenOffset.x, this._goalTargetScreenOffset.x), CheckNaN(targetScreenOffset.y, this._goalTargetScreenOffset.y));
1022
+ this._goalAlpha = Clamp(this._goalAlpha, this.lowerAlphaLimit ?? -Infinity, this.upperAlphaLimit ?? Infinity);
1023
+ this._goalBeta = Clamp(this._goalBeta, this.lowerBetaLimit ?? -Infinity, this.upperBetaLimit ?? Infinity);
1024
+ this._goalRadius = Clamp(this._goalRadius, this.lowerRadiusLimit ?? -Infinity, this.upperRadiusLimit ?? Infinity);
1025
+ this._goalTarget.y = Clamp(this._goalTarget.y, this.lowerTargetYLimit ?? -Infinity, Infinity);
1026
+ this._isInterpolating = true;
1027
+ }
1028
+ // Synchronized
1029
+ /** @internal */
1030
+ _isSynchronizedViewMatrix() {
1031
+ if (!super._isSynchronizedViewMatrix()) {
1032
+ return false;
1033
+ }
1034
+ return (this._cache._target.equals(this._getTargetPosition()) &&
1035
+ this._cache.alpha === this.alpha &&
1036
+ this._cache.beta === this.beta &&
1037
+ this._cache.radius === this.radius &&
1038
+ this._cache.targetScreenOffset.equals(this.targetScreenOffset));
1039
+ }
1040
+ /**
1041
+ * Attached controls to the current camera.
1042
+ * @param ignored defines an ignored parameter kept for backward compatibility.
1043
+ * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
1044
+ * @param useCtrlForPanning Defines whether ctrl is used for panning within the controls
1045
+ * @param panningMouseButton Defines whether panning is allowed through mouse click button
1046
+ */
1047
+ attachControl(ignored, noPreventDefault, useCtrlForPanning = true, panningMouseButton = 2) {
1048
+ const args = arguments;
1049
+ noPreventDefault = Tools.BackCompatCameraNoPreventDefault(args);
1050
+ this._useCtrlForPanning = useCtrlForPanning;
1051
+ this._panningMouseButton = panningMouseButton;
1052
+ // backwards compatibility
1053
+ if (typeof args[0] === "boolean") {
1054
+ if (args.length > 1) {
1055
+ this._useCtrlForPanning = args[1];
1056
+ }
1057
+ if (args.length > 2) {
1058
+ this._panningMouseButton = args[2];
1059
+ }
1060
+ }
1061
+ this.inputs.attachElement(noPreventDefault);
1062
+ this._reset = () => {
1063
+ this.inertialAlphaOffset = 0;
1064
+ this.inertialBetaOffset = 0;
1065
+ this.inertialRadiusOffset = 0;
1066
+ this.inertialPanningX = 0;
1067
+ this.inertialPanningY = 0;
1068
+ };
1069
+ }
1070
+ /**
1071
+ * Detach the current controls from the specified dom element.
1072
+ */
1073
+ detachControl() {
1074
+ this.inputs.detachElement();
1075
+ if (this._reset) {
1076
+ this._reset();
1077
+ }
1078
+ }
1079
+ /**
1080
+ * Applies rotation and zoom deltas to the camera, handling invertRotation, handedness, and beta-flip.
1081
+ * Shared by both the movement system and legacy inertia paths.
1082
+ * @param alphaOffset - Alpha (horizontal orbit) delta
1083
+ * @param betaOffset - Beta (vertical orbit) delta
1084
+ * @param radiusOffset - Radius (zoom) delta
1085
+ */
1086
+ _applyRotationAndZoomDelta(alphaOffset, betaOffset, radiusOffset) {
1087
+ const directionModifier = this.invertRotation ? -1 : 1;
1088
+ const handednessMultiplier = this._calculateHandednessMultiplier();
1089
+ let adjustedAlpha = alphaOffset * handednessMultiplier;
1090
+ if (this.beta < 0) {
1091
+ adjustedAlpha *= -1;
1092
+ }
1093
+ this.alpha += adjustedAlpha * directionModifier;
1094
+ this.beta += betaOffset * directionModifier;
1095
+ this.radius -= radiusOffset;
1091
1096
  }
1092
- hasUserInteractions = true;
1093
- }
1094
- if (hasUserInteractions) {
1095
- this.stopInterpolation();
1096
- }
1097
- else if (this._isInterpolating) {
1098
- let isInterpolating = false;
1099
- const dt = this._scene.getEngine().getDeltaTime() / 1000;
1100
- const t = 1 - Math.pow(2, -dt / this._currentInterpolationFactor);
1101
- // NOTE: If the goal is NaN, it means we are not interpolating to a new value, so we can use the current value. Hence the calls to checkNaN.
1102
- // Get the goal radius immediately as we'll need it for determining interpolation termination for the target.
1103
- const goalRadius = CheckNaN(this._goalRadius, this.radius);
1104
- // Interpolate the target if we haven't reached the goal yet.
1105
- if (!isNaN(this._goalTarget.x) || !isNaN(this._goalTarget.y) || !isNaN(this._goalTarget.z)) {
1106
- const goalTarget = TmpVectors.Vector3[0].set(CheckNaN(this._goalTarget.x, this._target.x), CheckNaN(this._goalTarget.y, this._target.y), CheckNaN(this._goalTarget.z, this._target.z));
1107
- Vector3.LerpToRef(this.target, goalTarget, t, this._target);
1108
- // Terminate the target interpolation if we the target is close relative to the radius.
1109
- // This is when visually (regardless of scale) the target appears close to its final goal position.
1110
- if ((Vector3.Distance(this.target, goalTarget) * 10) / goalRadius < Epsilon) {
1111
- this._goalTarget.set(NaN, NaN, NaN);
1112
- this.target.copyFrom(goalTarget);
1113
- // Call setTarget to trigger side effects like onMeshTargetChangedObservable.
1114
- // NOTE: We pass in true for allowSamePosition because we already checked that the goal target is different from the current target,
1115
- // but since we are updating the existing target Vector3 instance, it will otherwise look like the value has not changed.
1116
- this.setTarget(this.target, false, true, true);
1097
+ /**
1098
+ * Applies a pan delta to the camera target in screen space.
1099
+ * Shared by both the movement system and legacy inertia paths.
1100
+ * @param panX - Horizontal pan delta
1101
+ * @param panY - Vertical pan delta
1102
+ */
1103
+ _applyPanDelta(panX, panY) {
1104
+ const localDirection = TmpVectors.Vector3[0].copyFromFloats(panX, panY, panY);
1105
+ this._viewMatrix.invertToRef(this._cameraTransformMatrix);
1106
+ localDirection.multiplyInPlace(this.panningAxis);
1107
+ Vector3.TransformNormalToRef(localDirection, this._cameraTransformMatrix, this._transformedDirection);
1108
+ if (this.mapPanning) {
1109
+ const up = this.upVector;
1110
+ const right = Vector3.CrossToRef(this._transformedDirection, up, this._transformedDirection);
1111
+ Vector3.CrossToRef(up, right, this._transformedDirection);
1112
+ }
1113
+ else if (!this.panningAxis.y) {
1114
+ this._transformedDirection.y = 0;
1115
+ }
1116
+ if (!this._targetHost) {
1117
+ if (this.panningDistanceLimit) {
1118
+ this._transformedDirection.addInPlace(this._target);
1119
+ const distanceSquared = Vector3.DistanceSquared(this._transformedDirection, this.panningOriginTarget);
1120
+ if (distanceSquared <= this.panningDistanceLimit * this.panningDistanceLimit) {
1121
+ this._target.copyFrom(this._transformedDirection);
1122
+ }
1123
+ }
1124
+ else {
1125
+ if (this.parent) {
1126
+ const m = TmpVectors.Matrix[0];
1127
+ this.parent.getWorldMatrix().getRotationMatrixToRef(m);
1128
+ m.transposeToRef(m);
1129
+ Vector3.TransformCoordinatesToRef(this._transformedDirection, m, this._transformedDirection);
1130
+ }
1131
+ this._target.addInPlace(this._transformedDirection);
1132
+ }
1133
+ }
1134
+ }
1135
+ /** @internal */
1136
+ _checkInputs() {
1137
+ //if (async) collision inspection was triggered, don't update the camera's position - until the collision callback was called.
1138
+ if (this._collisionTriggered) {
1139
+ return;
1140
+ }
1141
+ this.inputs.checkInputs();
1142
+ let hasUserInteractions = false;
1143
+ this.movement.computeCurrentFrameDeltas();
1144
+ const rotDelta = this.movement.rotationDeltaCurrentFrame;
1145
+ const zoomDelta = this.movement.zoomDeltaCurrentFrame;
1146
+ const panDelta = this.movement.panDeltaCurrentFrame;
1147
+ if (rotDelta.x !== 0 || rotDelta.y !== 0 || zoomDelta !== 0 || panDelta.x !== 0 || panDelta.y !== 0) {
1148
+ hasUserInteractions = true;
1149
+ if (rotDelta.x !== 0 || rotDelta.y !== 0 || zoomDelta !== 0) {
1150
+ this._applyRotationAndZoomDelta(rotDelta.x, rotDelta.y, zoomDelta);
1151
+ }
1152
+ if (panDelta.x !== 0 || panDelta.y !== 0) {
1153
+ this._applyPanDelta(panDelta.x, panDelta.y);
1154
+ }
1155
+ }
1156
+ // Legacy inertial offsets — backward compat path. Handles direct writes to inertialAlphaOffset
1157
+ // etc. (including zoomToMouseLocation which writes to inertialRadiusOffset).
1158
+ // Only activates when these values are nonzero, so it is free when unused.
1159
+ // We check the private fields here instead of the public getters because the getters fall back
1160
+ // to the movement system's current-frame deltas (for back-compat polling), which would cause
1161
+ // double-application of the rotation/zoom that movement.computeCurrentFrameDeltas just produced.
1162
+ //
1163
+ // Note: unlike TargetCamera, none of ArcRotateCamera's channels (rotate/zoom/pan) scale their
1164
+ // magnitude by `this.speed` (movement.speed stays 1; inputs use angularSensibility / wheel
1165
+ // precision / panningSensibility). So the glide cutoffs below must NOT be scaled by `speed` —
1166
+ // doing so only truncated the inertia tail earlier at higher speeds without making the camera
1167
+ // any faster (forum 61001).
1168
+ if (this._inertialAlphaOffset !== 0 || this._inertialBetaOffset !== 0 || this._inertialRadiusOffset !== 0) {
1169
+ this._applyRotationAndZoomDelta(this._inertialAlphaOffset, this._inertialBetaOffset, this._inertialRadiusOffset);
1170
+ this._inertialAlphaOffset *= this.inertia;
1171
+ this._inertialBetaOffset *= this.inertia;
1172
+ this._inertialRadiusOffset *= this.inertia;
1173
+ if (Math.abs(this._inertialAlphaOffset) < this._rotationEpsilon) {
1174
+ this._inertialAlphaOffset = 0;
1175
+ }
1176
+ if (Math.abs(this._inertialBetaOffset) < this._rotationEpsilon) {
1177
+ this._inertialBetaOffset = 0;
1178
+ }
1179
+ if (Math.abs(this._inertialRadiusOffset) < this._rotationEpsilon) {
1180
+ this._inertialRadiusOffset = 0;
1181
+ }
1182
+ hasUserInteractions = true;
1183
+ }
1184
+ if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) {
1185
+ this._applyPanDelta(this.inertialPanningX, this.inertialPanningY);
1186
+ this.inertialPanningX *= this.panningInertia;
1187
+ this.inertialPanningY *= this.panningInertia;
1188
+ const inertialPanningLimit = this._panningEpsilon;
1189
+ if (Math.abs(this.inertialPanningX) < inertialPanningLimit) {
1190
+ this.inertialPanningX = 0;
1191
+ }
1192
+ if (Math.abs(this.inertialPanningY) < inertialPanningLimit) {
1193
+ this.inertialPanningY = 0;
1194
+ }
1195
+ hasUserInteractions = true;
1196
+ }
1197
+ if (hasUserInteractions) {
1198
+ this.stopInterpolation();
1199
+ }
1200
+ else if (this._isInterpolating) {
1201
+ let isInterpolating = false;
1202
+ const dt = this._scene.getEngine().getDeltaTime() / 1000;
1203
+ const t = 1 - Math.pow(2, -dt / this._currentInterpolationFactor);
1204
+ // NOTE: If the goal is NaN, it means we are not interpolating to a new value, so we can use the current value. Hence the calls to checkNaN.
1205
+ // Get the goal radius immediately as we'll need it for determining interpolation termination for the target.
1206
+ const goalRadius = CheckNaN(this._goalRadius, this.radius);
1207
+ // Interpolate the target if we haven't reached the goal yet.
1208
+ if (!isNaN(this._goalTarget.x) || !isNaN(this._goalTarget.y) || !isNaN(this._goalTarget.z)) {
1209
+ const goalTarget = TmpVectors.Vector3[0].set(CheckNaN(this._goalTarget.x, this._target.x), CheckNaN(this._goalTarget.y, this._target.y), CheckNaN(this._goalTarget.z, this._target.z));
1210
+ Vector3.LerpToRef(this.target, goalTarget, t, this._target);
1211
+ // Terminate the target interpolation if we the target is close relative to the radius.
1212
+ // This is when visually (regardless of scale) the target appears close to its final goal position.
1213
+ if ((Vector3.Distance(this.target, goalTarget) * 10) / goalRadius < Epsilon) {
1214
+ this._goalTarget.set(NaN, NaN, NaN);
1215
+ this.target.copyFrom(goalTarget);
1216
+ // Call setTarget to trigger side effects like onMeshTargetChangedObservable.
1217
+ // NOTE: We pass in true for allowSamePosition because we already checked that the goal target is different from the current target,
1218
+ // but since we are updating the existing target Vector3 instance, it will otherwise look like the value has not changed.
1219
+ this.setTarget(this.target, false, true, true);
1220
+ }
1221
+ else {
1222
+ isInterpolating = true;
1223
+ }
1224
+ }
1225
+ // Interpolate the rotation if we haven't reached the goal yet.
1226
+ if (!isNaN(this._goalAlpha) || !isNaN(this._goalBeta)) {
1227
+ // Using quaternion for smoother interpolation (and no Euler angles modulo)
1228
+ const goalRotation = Quaternion.RotationAlphaBetaGammaToRef(CheckNaN(this._goalAlpha, this.alpha), CheckNaN(this._goalBeta, this.beta), 0, TmpVectors.Quaternion[0]);
1229
+ const currentRotation = Quaternion.RotationAlphaBetaGammaToRef(this.alpha, this.beta, 0, TmpVectors.Quaternion[1]);
1230
+ const newRotation = Quaternion.SlerpToRef(currentRotation, goalRotation, t, TmpVectors.Quaternion[2]);
1231
+ newRotation.normalize();
1232
+ const newAlphaBetaGamma = newRotation.toAlphaBetaGammaToRef(TmpVectors.Vector3[0]);
1233
+ this.alpha = newAlphaBetaGamma.x;
1234
+ this.beta = newAlphaBetaGamma.y;
1235
+ // Terminate the rotation interpolation when the rotation appears visually close to the final goal rotation.
1236
+ if (newRotation.isApprox(goalRotation, Epsilon / 5)) {
1237
+ this._goalAlpha = NaN;
1238
+ this._goalBeta = NaN;
1239
+ const goalAlphaBetaGamma = goalRotation.toAlphaBetaGammaToRef(TmpVectors.Vector3[0]);
1240
+ this.alpha = goalAlphaBetaGamma.x;
1241
+ this.beta = goalAlphaBetaGamma.y;
1242
+ }
1243
+ else {
1244
+ isInterpolating = true;
1245
+ }
1246
+ }
1247
+ // Interpolate the radius if we haven't reached the goal yet.
1248
+ if (!isNaN(this._goalRadius)) {
1249
+ this.radius += (goalRadius - this.radius) * t;
1250
+ // Terminate the radius interpolation when we are 99.9% of the way to the goal radius, at which point it is visually indistinguishable from the goal.
1251
+ if (Math.abs(goalRadius / this.radius - 1) < Epsilon) {
1252
+ this._goalRadius = NaN;
1253
+ this.radius = goalRadius;
1254
+ }
1255
+ else {
1256
+ isInterpolating = true;
1257
+ }
1258
+ }
1259
+ // Interpolate the target screen offset if we haven't reached the goal yet.
1260
+ if (!isNaN(this._goalTargetScreenOffset.x) || !isNaN(this._goalTargetScreenOffset.y)) {
1261
+ const goalTargetScreenOffset = TmpVectors.Vector2[0].set(CheckNaN(this._goalTargetScreenOffset.x, this.targetScreenOffset.x), CheckNaN(this._goalTargetScreenOffset.y, this.targetScreenOffset.y));
1262
+ Vector2.LerpToRef(this.targetScreenOffset, goalTargetScreenOffset, t, this.targetScreenOffset);
1263
+ // Terminate the target screen offset interpolation when the target screen offset appears visually close to the final goal target screen offset.
1264
+ if (Vector2.Distance(this.targetScreenOffset, goalTargetScreenOffset) < Epsilon) {
1265
+ this._goalTargetScreenOffset.set(NaN, NaN);
1266
+ this.targetScreenOffset.copyFrom(goalTargetScreenOffset);
1267
+ }
1268
+ else {
1269
+ isInterpolating = true;
1270
+ }
1271
+ }
1272
+ this._isInterpolating = isInterpolating;
1273
+ }
1274
+ // Limits
1275
+ this._checkLimits();
1276
+ super._checkInputs();
1277
+ }
1278
+ _checkLimits() {
1279
+ if (this.lowerBetaLimit === null || this.lowerBetaLimit === undefined) {
1280
+ if (this.allowUpsideDown && this.beta > Math.PI) {
1281
+ this.beta = this.beta - 2 * Math.PI;
1282
+ }
1117
1283
  }
1118
1284
  else {
1119
- isInterpolating = true;
1120
- }
1121
- }
1122
- // Interpolate the rotation if we haven't reached the goal yet.
1123
- if (!isNaN(this._goalAlpha) || !isNaN(this._goalBeta)) {
1124
- // Using quaternion for smoother interpolation (and no Euler angles modulo)
1125
- const goalRotation = Quaternion.RotationAlphaBetaGammaToRef(CheckNaN(this._goalAlpha, this.alpha), CheckNaN(this._goalBeta, this.beta), 0, TmpVectors.Quaternion[0]);
1126
- const currentRotation = Quaternion.RotationAlphaBetaGammaToRef(this.alpha, this.beta, 0, TmpVectors.Quaternion[1]);
1127
- const newRotation = Quaternion.SlerpToRef(currentRotation, goalRotation, t, TmpVectors.Quaternion[2]);
1128
- newRotation.normalize();
1129
- const newAlphaBetaGamma = newRotation.toAlphaBetaGammaToRef(TmpVectors.Vector3[0]);
1130
- this.alpha = newAlphaBetaGamma.x;
1131
- this.beta = newAlphaBetaGamma.y;
1132
- // Terminate the rotation interpolation when the rotation appears visually close to the final goal rotation.
1133
- if (newRotation.isApprox(goalRotation, Epsilon / 5)) {
1134
- this._goalAlpha = NaN;
1135
- this._goalBeta = NaN;
1136
- const goalAlphaBetaGamma = goalRotation.toAlphaBetaGammaToRef(TmpVectors.Vector3[0]);
1137
- this.alpha = goalAlphaBetaGamma.x;
1138
- this.beta = goalAlphaBetaGamma.y;
1285
+ if (this.beta < this.lowerBetaLimit) {
1286
+ this.beta = this.lowerBetaLimit;
1287
+ }
1288
+ }
1289
+ if (this.upperBetaLimit === null || this.upperBetaLimit === undefined) {
1290
+ if (this.allowUpsideDown && this.beta < -Math.PI) {
1291
+ this.beta = this.beta + 2 * Math.PI;
1292
+ }
1139
1293
  }
1140
1294
  else {
1141
- isInterpolating = true;
1295
+ if (this.beta > this.upperBetaLimit) {
1296
+ this.beta = this.upperBetaLimit;
1297
+ }
1298
+ }
1299
+ if (this.lowerAlphaLimit !== null && this.alpha < this.lowerAlphaLimit) {
1300
+ this.alpha = this.lowerAlphaLimit;
1142
1301
  }
1302
+ if (this.upperAlphaLimit !== null && this.alpha > this.upperAlphaLimit) {
1303
+ this.alpha = this.upperAlphaLimit;
1304
+ }
1305
+ if (this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit) {
1306
+ this.radius = this.lowerRadiusLimit;
1307
+ this.inertialRadiusOffset = 0;
1308
+ }
1309
+ if (this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit) {
1310
+ this.radius = this.upperRadiusLimit;
1311
+ this.inertialRadiusOffset = 0;
1312
+ }
1313
+ this.target.y = Math.max(this.target.y, this.lowerTargetYLimit);
1143
1314
  }
1144
- // Interpolate the radius if we haven't reached the goal yet.
1145
- if (!isNaN(this._goalRadius)) {
1146
- this.radius += (goalRadius - this.radius) * t;
1147
- // Terminate the radius interpolation when we are 99.9% of the way to the goal radius, at which point it is visually indistinguishable from the goal.
1148
- if (Math.abs(goalRadius / this.radius - 1) < Epsilon) {
1149
- this._goalRadius = NaN;
1150
- this.radius = goalRadius;
1315
+ /**
1316
+ * Rebuilds angles (alpha, beta) and radius from the give position and target
1317
+ */
1318
+ rebuildAnglesAndRadius() {
1319
+ this._position.subtractToRef(this._getTargetPosition(), this._computationVector);
1320
+ // need to rotate to Y up equivalent if up vector not Axis.Y
1321
+ if (this._upVector.x !== 0 || this._upVector.y !== 1.0 || this._upVector.z !== 0) {
1322
+ Vector3.TransformCoordinatesToRef(this._computationVector, this._upToYMatrix, this._computationVector);
1323
+ }
1324
+ this.radius = this._computationVector.length();
1325
+ if (this.radius === 0) {
1326
+ this.radius = 0.0001; // Just to avoid division by zero
1327
+ }
1328
+ // Alpha and Beta
1329
+ const previousAlpha = this.alpha;
1330
+ this.alpha = ComputeAlpha(this._computationVector);
1331
+ this.beta = ComputeBeta(this._computationVector.y, this.radius);
1332
+ // Calculate the number of revolutions between the new and old alpha values.
1333
+ const alphaCorrectionTurns = Math.round((previousAlpha - this.alpha) / (2.0 * Math.PI));
1334
+ // Adjust alpha so that its numerical representation is the closest one to the old value.
1335
+ this.alpha += alphaCorrectionTurns * 2.0 * Math.PI;
1336
+ this._checkLimits();
1337
+ }
1338
+ /**
1339
+ * Use a position to define the current camera related information like alpha, beta and radius
1340
+ * @param position Defines the position to set the camera at
1341
+ */
1342
+ setPosition(position) {
1343
+ if (this._position.equals(position)) {
1344
+ return;
1345
+ }
1346
+ this._position.copyFrom(position);
1347
+ this.rebuildAnglesAndRadius();
1348
+ }
1349
+ /**
1350
+ * Defines the target the camera should look at.
1351
+ * This will automatically adapt alpha beta and radius to fit within the new target.
1352
+ * Please note that setting a target as a mesh will disable panning.
1353
+ * @param target Defines the new target as a Vector or a transform node
1354
+ * @param toBoundingCenter In case of a mesh target, defines whether to target the mesh position or its bounding information center
1355
+ * @param allowSamePosition If false, prevents reapplying the new computed position if it is identical to the current one (optim)
1356
+ * @param cloneAlphaBetaRadius If true, replicate the current setup (alpha, beta, radius) on the new target
1357
+ * @param hierarchyBounding If true,use hierarchyBounding to compute boundingCenter
1358
+ */
1359
+ setTarget(target, toBoundingCenter = false, allowSamePosition = false, cloneAlphaBetaRadius = false, hierarchyBounding) {
1360
+ cloneAlphaBetaRadius = this.overrideCloneAlphaBetaRadius ?? cloneAlphaBetaRadius;
1361
+ if (target.computeWorldMatrix) {
1362
+ if (hierarchyBounding) {
1363
+ const boundingVectors = target.getHierarchyBoundingVectors();
1364
+ const boundingInfo = new BoundingInfo(boundingVectors.min, boundingVectors.max);
1365
+ this._targetBoundingCenter = boundingInfo.boundingBox.center.clone().subtract(target.getAbsolutePosition());
1366
+ }
1367
+ else {
1368
+ if (toBoundingCenter && target.getBoundingInfo) {
1369
+ this._targetBoundingCenter = target.getBoundingInfo().boundingBox.center.clone();
1370
+ }
1371
+ else {
1372
+ this._targetBoundingCenter = null;
1373
+ }
1374
+ }
1375
+ target.computeWorldMatrix();
1376
+ this._targetHost = target;
1377
+ this._target = this._getTargetPosition();
1378
+ this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);
1151
1379
  }
1152
1380
  else {
1153
- isInterpolating = true;
1381
+ const newTarget = target;
1382
+ const currentTarget = this._getTargetPosition();
1383
+ if (currentTarget && !allowSamePosition && currentTarget.equals(newTarget)) {
1384
+ return;
1385
+ }
1386
+ this._targetHost = null;
1387
+ this._target = newTarget;
1388
+ this._targetBoundingCenter = null;
1389
+ this.onMeshTargetChangedObservable.notifyObservers(null);
1390
+ }
1391
+ if (!cloneAlphaBetaRadius) {
1392
+ this.rebuildAnglesAndRadius();
1154
1393
  }
1155
1394
  }
1156
- // Interpolate the target screen offset if we haven't reached the goal yet.
1157
- if (!isNaN(this._goalTargetScreenOffset.x) || !isNaN(this._goalTargetScreenOffset.y)) {
1158
- const goalTargetScreenOffset = TmpVectors.Vector2[0].set(CheckNaN(this._goalTargetScreenOffset.x, this.targetScreenOffset.x), CheckNaN(this._goalTargetScreenOffset.y, this.targetScreenOffset.y));
1159
- Vector2.LerpToRef(this.targetScreenOffset, goalTargetScreenOffset, t, this.targetScreenOffset);
1160
- // Terminate the target screen offset interpolation when the target screen offset appears visually close to the final goal target screen offset.
1161
- if (Vector2.Distance(this.targetScreenOffset, goalTargetScreenOffset) < Epsilon) {
1162
- this._goalTargetScreenOffset.set(NaN, NaN);
1163
- this.targetScreenOffset.copyFrom(goalTargetScreenOffset);
1395
+ /** @internal */
1396
+ _getViewMatrix() {
1397
+ // Compute
1398
+ const cosa = Math.cos(this.alpha);
1399
+ const sina = Math.sin(this.alpha);
1400
+ const cosb = Math.cos(this.beta);
1401
+ let sinb = Math.sin(this.beta);
1402
+ if (sinb === 0) {
1403
+ sinb = 0.0001;
1404
+ }
1405
+ if (this.radius === 0) {
1406
+ this.radius = 0.0001; // Just to avoid division by zero
1407
+ }
1408
+ const target = this._getTargetPosition();
1409
+ this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
1410
+ // Rotate according to up vector
1411
+ if (this._upVector.x !== 0 || this._upVector.y !== 1.0 || this._upVector.z !== 0) {
1412
+ Vector3.TransformCoordinatesToRef(this._computationVector, this._yToUpMatrix, this._computationVector);
1413
+ }
1414
+ target.addToRef(this._computationVector, this._newPosition);
1415
+ if (this.getScene().collisionsEnabled && this.checkCollisions) {
1416
+ const coordinator = this.getScene().collisionCoordinator;
1417
+ if (!this._collider) {
1418
+ this._collider = coordinator.createCollider();
1419
+ }
1420
+ this._collider._radius = this.collisionRadius;
1421
+ this._newPosition.subtractToRef(this._position, this._collisionVelocity);
1422
+ this._collisionTriggered = true;
1423
+ coordinator.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
1164
1424
  }
1165
1425
  else {
1166
- isInterpolating = true;
1426
+ this._position.copyFrom(this._newPosition);
1427
+ let up = this.upVector;
1428
+ if (this.allowUpsideDown && sinb < 0) {
1429
+ up = up.negate();
1430
+ }
1431
+ this._computeViewMatrix(this._position, target, up);
1432
+ this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x);
1433
+ this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);
1167
1434
  }
1435
+ this._currentTarget.copyFrom(target);
1436
+ return this._viewMatrix;
1168
1437
  }
1169
- this._isInterpolating = isInterpolating;
1170
- }
1171
- // Limits
1172
- this._checkLimits();
1173
- super._checkInputs();
1174
- }
1175
- _checkLimits() {
1176
- if (this.lowerBetaLimit === null || this.lowerBetaLimit === undefined) {
1177
- if (this.allowUpsideDown && this.beta > Math.PI) {
1178
- this.beta = this.beta - 2 * Math.PI;
1179
- }
1180
- }
1181
- else {
1182
- if (this.beta < this.lowerBetaLimit) {
1183
- this.beta = this.lowerBetaLimit;
1184
- }
1185
- }
1186
- if (this.upperBetaLimit === null || this.upperBetaLimit === undefined) {
1187
- if (this.allowUpsideDown && this.beta < -Math.PI) {
1188
- this.beta = this.beta + 2 * Math.PI;
1189
- }
1190
- }
1191
- else {
1192
- if (this.beta > this.upperBetaLimit) {
1193
- this.beta = this.upperBetaLimit;
1194
- }
1195
- }
1196
- if (this.lowerAlphaLimit !== null && this.alpha < this.lowerAlphaLimit) {
1197
- this.alpha = this.lowerAlphaLimit;
1198
- }
1199
- if (this.upperAlphaLimit !== null && this.alpha > this.upperAlphaLimit) {
1200
- this.alpha = this.upperAlphaLimit;
1201
- }
1202
- if (this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit) {
1203
- this.radius = this.lowerRadiusLimit;
1204
- this.inertialRadiusOffset = 0;
1205
- }
1206
- if (this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit) {
1207
- this.radius = this.upperRadiusLimit;
1208
- this.inertialRadiusOffset = 0;
1209
- }
1210
- this.target.y = Math.max(this.target.y, this.lowerTargetYLimit);
1211
- }
1212
- /**
1213
- * Rebuilds angles (alpha, beta) and radius from the give position and target
1214
- */
1215
- rebuildAnglesAndRadius() {
1216
- this._position.subtractToRef(this._getTargetPosition(), this._computationVector);
1217
- // need to rotate to Y up equivalent if up vector not Axis.Y
1218
- if (this._upVector.x !== 0 || this._upVector.y !== 1.0 || this._upVector.z !== 0) {
1219
- Vector3.TransformCoordinatesToRef(this._computationVector, this._upToYMatrix, this._computationVector);
1220
- }
1221
- this.radius = this._computationVector.length();
1222
- if (this.radius === 0) {
1223
- this.radius = 0.0001; // Just to avoid division by zero
1224
- }
1225
- // Alpha and Beta
1226
- const previousAlpha = this.alpha;
1227
- this.alpha = ComputeAlpha(this._computationVector);
1228
- this.beta = ComputeBeta(this._computationVector.y, this.radius);
1229
- // Calculate the number of revolutions between the new and old alpha values.
1230
- const alphaCorrectionTurns = Math.round((previousAlpha - this.alpha) / (2.0 * Math.PI));
1231
- // Adjust alpha so that its numerical representation is the closest one to the old value.
1232
- this.alpha += alphaCorrectionTurns * 2.0 * Math.PI;
1233
- this._checkLimits();
1234
- }
1235
- /**
1236
- * Use a position to define the current camera related information like alpha, beta and radius
1237
- * @param position Defines the position to set the camera at
1238
- */
1239
- setPosition(position) {
1240
- if (this._position.equals(position)) {
1241
- return;
1242
- }
1243
- this._position.copyFrom(position);
1244
- this.rebuildAnglesAndRadius();
1245
- }
1246
- /**
1247
- * Defines the target the camera should look at.
1248
- * This will automatically adapt alpha beta and radius to fit within the new target.
1249
- * Please note that setting a target as a mesh will disable panning.
1250
- * @param target Defines the new target as a Vector or a transform node
1251
- * @param toBoundingCenter In case of a mesh target, defines whether to target the mesh position or its bounding information center
1252
- * @param allowSamePosition If false, prevents reapplying the new computed position if it is identical to the current one (optim)
1253
- * @param cloneAlphaBetaRadius If true, replicate the current setup (alpha, beta, radius) on the new target
1254
- * @param hierarchyBounding If true,use hierarchyBounding to compute boundingCenter
1255
- */
1256
- setTarget(target, toBoundingCenter = false, allowSamePosition = false, cloneAlphaBetaRadius = false, hierarchyBounding) {
1257
- cloneAlphaBetaRadius = this.overrideCloneAlphaBetaRadius ?? cloneAlphaBetaRadius;
1258
- if (target.computeWorldMatrix) {
1259
- if (hierarchyBounding) {
1260
- const boundingVectors = target.getHierarchyBoundingVectors();
1261
- const boundingInfo = new BoundingInfo(boundingVectors.min, boundingVectors.max);
1262
- this._targetBoundingCenter = boundingInfo.boundingBox.center.clone().subtract(target.getAbsolutePosition());
1263
- }
1264
- else {
1265
- if (toBoundingCenter && target.getBoundingInfo) {
1266
- this._targetBoundingCenter = target.getBoundingInfo().boundingBox.center.clone();
1438
+ /**
1439
+ * Zooms on a mesh to be at the min distance where we could see it fully in the current viewport.
1440
+ * @param meshes Defines the mesh to zoom on
1441
+ * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
1442
+ */
1443
+ zoomOn(meshes, doNotUpdateMaxZ = false) {
1444
+ meshes = meshes || this.getScene().meshes;
1445
+ const minMaxVector = Mesh.MinMax(meshes);
1446
+ let distance = this._calculateLowerRadiusFromModelBoundingSphere(minMaxVector.min, minMaxVector.max);
1447
+ // If there are defined limits, we need to take them into account
1448
+ distance = Math.max(Math.min(distance, this.upperRadiusLimit || Number.MAX_VALUE), this.lowerRadiusLimit || 0);
1449
+ this.radius = distance * this.zoomOnFactor;
1450
+ if (this.mode === Camera.ORTHOGRAPHIC_CAMERA) {
1451
+ const aspectRatio = this.getScene().getEngine().getAspectRatio(this);
1452
+ const orthoExtent = (distance * this.zoomOnFactor) / 2;
1453
+ this.orthoLeft = -orthoExtent * aspectRatio;
1454
+ this.orthoRight = orthoExtent * aspectRatio;
1455
+ this.orthoBottom = -orthoExtent;
1456
+ this.orthoTop = orthoExtent;
1457
+ }
1458
+ this.focusOn({ min: minMaxVector.min, max: minMaxVector.max, distance: distance }, doNotUpdateMaxZ);
1459
+ }
1460
+ /**
1461
+ * Focus on a mesh or a bounding box. This adapts the target and maxRadius if necessary but does not update the current radius.
1462
+ * The target will be changed but the radius
1463
+ * @param meshesOrMinMaxVectorAndDistance Defines the mesh or bounding info to focus on
1464
+ * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
1465
+ */
1466
+ focusOn(meshesOrMinMaxVectorAndDistance, doNotUpdateMaxZ = false) {
1467
+ let meshesOrMinMaxVector;
1468
+ let distance;
1469
+ if (meshesOrMinMaxVectorAndDistance.min === undefined) {
1470
+ // meshes
1471
+ const meshes = meshesOrMinMaxVectorAndDistance || this.getScene().meshes;
1472
+ meshesOrMinMaxVector = Mesh.MinMax(meshes);
1473
+ distance = Vector3.Distance(meshesOrMinMaxVector.min, meshesOrMinMaxVector.max);
1267
1474
  }
1268
1475
  else {
1269
- this._targetBoundingCenter = null;
1476
+ //minMaxVector and distance
1477
+ const minMaxVectorAndDistance = meshesOrMinMaxVectorAndDistance;
1478
+ meshesOrMinMaxVector = minMaxVectorAndDistance;
1479
+ distance = minMaxVectorAndDistance.distance;
1480
+ }
1481
+ this._target = Mesh.Center(meshesOrMinMaxVector);
1482
+ if (!doNotUpdateMaxZ) {
1483
+ this.maxZ = distance * 2;
1270
1484
  }
1271
1485
  }
1272
- target.computeWorldMatrix();
1273
- this._targetHost = target;
1274
- this._target = this._getTargetPosition();
1275
- this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);
1276
- }
1277
- else {
1278
- const newTarget = target;
1279
- const currentTarget = this._getTargetPosition();
1280
- if (currentTarget && !allowSamePosition && currentTarget.equals(newTarget)) {
1281
- return;
1282
- }
1283
- this._targetHost = null;
1284
- this._target = newTarget;
1285
- this._targetBoundingCenter = null;
1286
- this.onMeshTargetChangedObservable.notifyObservers(null);
1287
- }
1288
- if (!cloneAlphaBetaRadius) {
1289
- this.rebuildAnglesAndRadius();
1290
- }
1291
- }
1292
- /** @internal */
1293
- _getViewMatrix() {
1294
- // Compute
1295
- const cosa = Math.cos(this.alpha);
1296
- const sina = Math.sin(this.alpha);
1297
- const cosb = Math.cos(this.beta);
1298
- let sinb = Math.sin(this.beta);
1299
- if (sinb === 0) {
1300
- sinb = 0.0001;
1301
- }
1302
- if (this.radius === 0) {
1303
- this.radius = 0.0001; // Just to avoid division by zero
1304
- }
1305
- const target = this._getTargetPosition();
1306
- this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
1307
- // Rotate according to up vector
1308
- if (this._upVector.x !== 0 || this._upVector.y !== 1.0 || this._upVector.z !== 0) {
1309
- Vector3.TransformCoordinatesToRef(this._computationVector, this._yToUpMatrix, this._computationVector);
1310
- }
1311
- target.addToRef(this._computationVector, this._newPosition);
1312
- if (this.getScene().collisionsEnabled && this.checkCollisions) {
1313
- const coordinator = this.getScene().collisionCoordinator;
1314
- if (!this._collider) {
1315
- this._collider = coordinator.createCollider();
1316
- }
1317
- this._collider._radius = this.collisionRadius;
1318
- this._newPosition.subtractToRef(this._position, this._collisionVelocity);
1319
- this._collisionTriggered = true;
1320
- coordinator.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
1321
- }
1322
- else {
1323
- this._position.copyFrom(this._newPosition);
1324
- let up = this.upVector;
1325
- if (this.allowUpsideDown && sinb < 0) {
1326
- up = up.negate();
1327
- }
1328
- this._computeViewMatrix(this._position, target, up);
1329
- this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x);
1330
- this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);
1331
- }
1332
- this._currentTarget.copyFrom(target);
1333
- return this._viewMatrix;
1334
- }
1335
- /**
1336
- * Zooms on a mesh to be at the min distance where we could see it fully in the current viewport.
1337
- * @param meshes Defines the mesh to zoom on
1338
- * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
1339
- */
1340
- zoomOn(meshes, doNotUpdateMaxZ = false) {
1341
- meshes = meshes || this.getScene().meshes;
1342
- const minMaxVector = Mesh.MinMax(meshes);
1343
- let distance = this._calculateLowerRadiusFromModelBoundingSphere(minMaxVector.min, minMaxVector.max);
1344
- // If there are defined limits, we need to take them into account
1345
- distance = Math.max(Math.min(distance, this.upperRadiusLimit || Number.MAX_VALUE), this.lowerRadiusLimit || 0);
1346
- this.radius = distance * this.zoomOnFactor;
1347
- if (this.mode === Camera.ORTHOGRAPHIC_CAMERA) {
1348
- const aspectRatio = this.getScene().getEngine().getAspectRatio(this);
1349
- const orthoExtent = (distance * this.zoomOnFactor) / 2;
1350
- this.orthoLeft = -orthoExtent * aspectRatio;
1351
- this.orthoRight = orthoExtent * aspectRatio;
1352
- this.orthoBottom = -orthoExtent;
1353
- this.orthoTop = orthoExtent;
1354
- }
1355
- this.focusOn({ min: minMaxVector.min, max: minMaxVector.max, distance: distance }, doNotUpdateMaxZ);
1356
- }
1357
- /**
1358
- * Focus on a mesh or a bounding box. This adapts the target and maxRadius if necessary but does not update the current radius.
1359
- * The target will be changed but the radius
1360
- * @param meshesOrMinMaxVectorAndDistance Defines the mesh or bounding info to focus on
1361
- * @param doNotUpdateMaxZ Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)
1362
- */
1363
- focusOn(meshesOrMinMaxVectorAndDistance, doNotUpdateMaxZ = false) {
1364
- let meshesOrMinMaxVector;
1365
- let distance;
1366
- if (meshesOrMinMaxVectorAndDistance.min === undefined) {
1367
- // meshes
1368
- const meshes = meshesOrMinMaxVectorAndDistance || this.getScene().meshes;
1369
- meshesOrMinMaxVector = Mesh.MinMax(meshes);
1370
- distance = Vector3.Distance(meshesOrMinMaxVector.min, meshesOrMinMaxVector.max);
1371
- }
1372
- else {
1373
- //minMaxVector and distance
1374
- const minMaxVectorAndDistance = meshesOrMinMaxVectorAndDistance;
1375
- meshesOrMinMaxVector = minMaxVectorAndDistance;
1376
- distance = minMaxVectorAndDistance.distance;
1377
- }
1378
- this._target = Mesh.Center(meshesOrMinMaxVector);
1379
- if (!doNotUpdateMaxZ) {
1380
- this.maxZ = distance * 2;
1381
- }
1382
- }
1383
- /**
1384
- * @override
1385
- * Override Camera.createRigCamera
1386
- * @param name the name of the camera
1387
- * @param cameraIndex the index of the camera in the rig cameras array
1388
- */
1389
- createRigCamera(name, cameraIndex) {
1390
- let alphaShift = 0;
1391
- switch (this.cameraRigMode) {
1392
- case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
1393
- case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
1394
- case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
1395
- case Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:
1396
- case Camera.RIG_MODE_VR:
1397
- alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? 1 : -1);
1398
- break;
1399
- case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
1400
- alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? -1 : 1);
1401
- break;
1402
- }
1403
- const rigCam = new ArcRotateCamera(name, this.alpha + alphaShift, this.beta, this.radius, this._target, this.getScene());
1404
- rigCam._cameraRigParams = {};
1405
- rigCam.isRigCamera = true;
1406
- rigCam.rigParent = this;
1407
- rigCam.upVector = this.upVector;
1408
- rigCam.mode = this.mode;
1409
- rigCam.orthoLeft = this.orthoLeft;
1410
- rigCam.orthoRight = this.orthoRight;
1411
- rigCam.orthoBottom = this.orthoBottom;
1412
- rigCam.orthoTop = this.orthoTop;
1413
- return rigCam;
1414
- }
1415
- /**
1416
- * @internal
1417
- * @override
1418
- * Override Camera._updateRigCameras
1419
- */
1420
- _updateRigCameras() {
1421
- const camLeft = this._rigCameras[0];
1422
- const camRight = this._rigCameras[1];
1423
- camLeft.beta = camRight.beta = this.beta;
1424
- switch (this.cameraRigMode) {
1425
- case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
1426
- case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
1427
- case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
1428
- case Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:
1429
- case Camera.RIG_MODE_VR:
1430
- camLeft.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;
1431
- camRight.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;
1432
- break;
1433
- case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
1434
- camLeft.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;
1435
- camRight.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;
1436
- break;
1437
- }
1438
- super._updateRigCameras();
1439
- }
1440
- /**
1441
- * @internal
1442
- */
1443
- _calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld, radiusScale = 1) {
1444
- const boxVectorGlobalDiagonal = Vector3.Distance(minimumWorld, maximumWorld);
1445
- // Get aspect ratio in order to calculate frustum slope
1446
- const engine = this.getScene().getEngine();
1447
- const aspectRatio = engine.getAspectRatio(this);
1448
- const frustumSlopeY = Math.tan(this.fov / 2);
1449
- const frustumSlopeX = frustumSlopeY * aspectRatio;
1450
- // Formula for setting distance
1451
- // (Good explanation: http://stackoverflow.com/questions/2866350/move-camera-to-fit-3d-scene)
1452
- const radiusWithoutFraming = boxVectorGlobalDiagonal * 0.5;
1453
- // Horizon distance
1454
- const radius = radiusWithoutFraming * radiusScale;
1455
- const distanceForHorizontalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlopeX * frustumSlopeX));
1456
- const distanceForVerticalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlopeY * frustumSlopeY));
1457
- return Math.max(distanceForHorizontalFrustum, distanceForVerticalFrustum);
1458
- }
1459
- /**
1460
- * Destroy the camera and release the current resources hold by it.
1461
- */
1462
- dispose() {
1463
- this.inputs.clear();
1464
- super.dispose();
1465
- }
1466
- /**
1467
- * Gets the current object class name.
1468
- * @returns the class name
1469
- */
1470
- getClassName() {
1471
- return "ArcRotateCamera";
1472
- }
1473
- }
1474
- __decorate([
1475
- serialize()
1476
- ], ArcRotateCamera.prototype, "useWorldTargetIfParentExists", void 0);
1477
- __decorate([
1478
- serialize()
1479
- ], ArcRotateCamera.prototype, "alpha", void 0);
1480
- __decorate([
1481
- serialize()
1482
- ], ArcRotateCamera.prototype, "beta", null);
1483
- __decorate([
1484
- serialize()
1485
- ], ArcRotateCamera.prototype, "radius", void 0);
1486
- __decorate([
1487
- serialize()
1488
- ], ArcRotateCamera.prototype, "overrideCloneAlphaBetaRadius", void 0);
1489
- __decorate([
1490
- serializeAsVector3("target")
1491
- ], ArcRotateCamera.prototype, "_target", void 0);
1492
- __decorate([
1493
- serializeAsMeshReference("targetHost")
1494
- ], ArcRotateCamera.prototype, "_targetHost", void 0);
1495
- __decorate([
1496
- serialize()
1497
- ], ArcRotateCamera.prototype, "inertialAlphaOffset", null);
1498
- __decorate([
1499
- serialize()
1500
- ], ArcRotateCamera.prototype, "inertialBetaOffset", null);
1501
- __decorate([
1502
- serialize()
1503
- ], ArcRotateCamera.prototype, "inertialRadiusOffset", null);
1504
- __decorate([
1505
- serialize()
1506
- ], ArcRotateCamera.prototype, "lowerAlphaLimit", void 0);
1507
- __decorate([
1508
- serialize()
1509
- ], ArcRotateCamera.prototype, "upperAlphaLimit", void 0);
1510
- __decorate([
1511
- serialize()
1512
- ], ArcRotateCamera.prototype, "lowerBetaLimit", void 0);
1513
- __decorate([
1514
- serialize()
1515
- ], ArcRotateCamera.prototype, "upperBetaLimit", void 0);
1516
- __decorate([
1517
- serialize()
1518
- ], ArcRotateCamera.prototype, "lowerRadiusLimit", void 0);
1519
- __decorate([
1520
- serialize()
1521
- ], ArcRotateCamera.prototype, "upperRadiusLimit", void 0);
1522
- __decorate([
1523
- serialize()
1524
- // eslint-disable-next-line @typescript-eslint/naming-convention
1525
- ], ArcRotateCamera.prototype, "lowerTargetYLimit", void 0);
1526
- __decorate([
1527
- serialize()
1528
- ], ArcRotateCamera.prototype, "inertialPanningX", void 0);
1529
- __decorate([
1530
- serialize()
1531
- ], ArcRotateCamera.prototype, "inertialPanningY", void 0);
1532
- __decorate([
1533
- serialize()
1534
- ], ArcRotateCamera.prototype, "pinchToPanMaxDistance", void 0);
1535
- __decorate([
1536
- serialize()
1537
- ], ArcRotateCamera.prototype, "panningDistanceLimit", void 0);
1538
- __decorate([
1539
- serializeAsVector3()
1540
- ], ArcRotateCamera.prototype, "panningOriginTarget", void 0);
1541
- __decorate([
1542
- serialize()
1543
- ], ArcRotateCamera.prototype, "panningInertia", null);
1544
- __decorate([
1545
- serialize()
1546
- ], ArcRotateCamera.prototype, "zoomToMouseLocation", null);
1547
- __decorate([
1548
- serialize()
1549
- ], ArcRotateCamera.prototype, "zoomOnFactor", void 0);
1550
- __decorate([
1551
- serializeAsVector2()
1552
- ], ArcRotateCamera.prototype, "targetScreenOffset", void 0);
1553
- __decorate([
1554
- serialize()
1555
- ], ArcRotateCamera.prototype, "allowUpsideDown", void 0);
1556
- __decorate([
1557
- serialize()
1558
- ], ArcRotateCamera.prototype, "useInputToRestoreState", void 0);
1559
- __decorate([
1560
- serialize()
1561
- ], ArcRotateCamera.prototype, "restoreStateInterpolationFactor", void 0);
1486
+ /**
1487
+ * @override
1488
+ * Override Camera.createRigCamera
1489
+ * @param name the name of the camera
1490
+ * @param cameraIndex the index of the camera in the rig cameras array
1491
+ */
1492
+ createRigCamera(name, cameraIndex) {
1493
+ let alphaShift = 0;
1494
+ switch (this.cameraRigMode) {
1495
+ case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
1496
+ case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
1497
+ case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
1498
+ case Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:
1499
+ case Camera.RIG_MODE_VR:
1500
+ alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? 1 : -1);
1501
+ break;
1502
+ case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
1503
+ alphaShift = this._cameraRigParams.stereoHalfAngle * (cameraIndex === 0 ? -1 : 1);
1504
+ break;
1505
+ }
1506
+ const rigCam = new _a(name, this.alpha + alphaShift, this.beta, this.radius, this._target, this.getScene());
1507
+ rigCam._cameraRigParams = {};
1508
+ rigCam.isRigCamera = true;
1509
+ rigCam.rigParent = this;
1510
+ rigCam.upVector = this.upVector;
1511
+ rigCam.mode = this.mode;
1512
+ rigCam.orthoLeft = this.orthoLeft;
1513
+ rigCam.orthoRight = this.orthoRight;
1514
+ rigCam.orthoBottom = this.orthoBottom;
1515
+ rigCam.orthoTop = this.orthoTop;
1516
+ return rigCam;
1517
+ }
1518
+ /**
1519
+ * @internal
1520
+ * @override
1521
+ * Override Camera._updateRigCameras
1522
+ */
1523
+ _updateRigCameras() {
1524
+ const camLeft = this._rigCameras[0];
1525
+ const camRight = this._rigCameras[1];
1526
+ camLeft.beta = camRight.beta = this.beta;
1527
+ switch (this.cameraRigMode) {
1528
+ case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:
1529
+ case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:
1530
+ case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:
1531
+ case Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:
1532
+ case Camera.RIG_MODE_VR:
1533
+ camLeft.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;
1534
+ camRight.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;
1535
+ break;
1536
+ case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:
1537
+ camLeft.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;
1538
+ camRight.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;
1539
+ break;
1540
+ }
1541
+ super._updateRigCameras();
1542
+ }
1543
+ /**
1544
+ * @internal
1545
+ */
1546
+ _calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld, radiusScale = 1) {
1547
+ const boxVectorGlobalDiagonal = Vector3.Distance(minimumWorld, maximumWorld);
1548
+ // Get aspect ratio in order to calculate frustum slope
1549
+ const engine = this.getScene().getEngine();
1550
+ const aspectRatio = engine.getAspectRatio(this);
1551
+ const frustumSlopeY = Math.tan(this.fov / 2);
1552
+ const frustumSlopeX = frustumSlopeY * aspectRatio;
1553
+ // Formula for setting distance
1554
+ // (Good explanation: http://stackoverflow.com/questions/2866350/move-camera-to-fit-3d-scene)
1555
+ const radiusWithoutFraming = boxVectorGlobalDiagonal * 0.5;
1556
+ // Horizon distance
1557
+ const radius = radiusWithoutFraming * radiusScale;
1558
+ const distanceForHorizontalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlopeX * frustumSlopeX));
1559
+ const distanceForVerticalFrustum = radius * Math.sqrt(1.0 + 1.0 / (frustumSlopeY * frustumSlopeY));
1560
+ return Math.max(distanceForHorizontalFrustum, distanceForVerticalFrustum);
1561
+ }
1562
+ /**
1563
+ * Destroy the camera and release the current resources hold by it.
1564
+ */
1565
+ dispose() {
1566
+ this.inputs.clear();
1567
+ super.dispose();
1568
+ }
1569
+ /**
1570
+ * Gets the current object class name.
1571
+ * @returns the class name
1572
+ */
1573
+ getClassName() {
1574
+ return "ArcRotateCamera";
1575
+ }
1576
+ },
1577
+ (() => {
1578
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1579
+ _useWorldTargetIfParentExists_decorators = [serialize()];
1580
+ _alpha_decorators = [serialize()];
1581
+ _get_beta_decorators = [serialize()];
1582
+ _radius_decorators = [serialize()];
1583
+ _overrideCloneAlphaBetaRadius_decorators = [serialize()];
1584
+ __target_decorators = [serializeAsVector3("target")];
1585
+ __targetHost_decorators = [serializeAsMeshReference("targetHost")];
1586
+ _get_inertialAlphaOffset_decorators = [serialize()];
1587
+ _get_inertialBetaOffset_decorators = [serialize()];
1588
+ _get_inertialRadiusOffset_decorators = [serialize()];
1589
+ _lowerAlphaLimit_decorators = [serialize()];
1590
+ _upperAlphaLimit_decorators = [serialize()];
1591
+ _lowerBetaLimit_decorators = [serialize()];
1592
+ _upperBetaLimit_decorators = [serialize()];
1593
+ _lowerRadiusLimit_decorators = [serialize()];
1594
+ _upperRadiusLimit_decorators = [serialize()];
1595
+ _lowerTargetYLimit_decorators = [serialize()];
1596
+ _inertialPanningX_decorators = [serialize()];
1597
+ _inertialPanningY_decorators = [serialize()];
1598
+ _pinchToPanMaxDistance_decorators = [serialize()];
1599
+ _panningDistanceLimit_decorators = [serialize()];
1600
+ _panningOriginTarget_decorators = [serializeAsVector3()];
1601
+ _get_panningInertia_decorators = [serialize()];
1602
+ _get_zoomToMouseLocation_decorators = [serialize()];
1603
+ _zoomOnFactor_decorators = [serialize()];
1604
+ _targetScreenOffset_decorators = [serializeAsVector2()];
1605
+ _allowUpsideDown_decorators = [serialize()];
1606
+ _useInputToRestoreState_decorators = [serialize()];
1607
+ _restoreStateInterpolationFactor_decorators = [serialize()];
1608
+ __esDecorate(_a, null, _get_beta_decorators, { kind: "getter", name: "beta", static: false, private: false, access: { has: obj => "beta" in obj, get: obj => obj.beta }, metadata: _metadata }, null, _instanceExtraInitializers);
1609
+ __esDecorate(_a, null, _get_inertialAlphaOffset_decorators, { kind: "getter", name: "inertialAlphaOffset", static: false, private: false, access: { has: obj => "inertialAlphaOffset" in obj, get: obj => obj.inertialAlphaOffset }, metadata: _metadata }, null, _instanceExtraInitializers);
1610
+ __esDecorate(_a, null, _get_inertialBetaOffset_decorators, { kind: "getter", name: "inertialBetaOffset", static: false, private: false, access: { has: obj => "inertialBetaOffset" in obj, get: obj => obj.inertialBetaOffset }, metadata: _metadata }, null, _instanceExtraInitializers);
1611
+ __esDecorate(_a, null, _get_inertialRadiusOffset_decorators, { kind: "getter", name: "inertialRadiusOffset", static: false, private: false, access: { has: obj => "inertialRadiusOffset" in obj, get: obj => obj.inertialRadiusOffset }, metadata: _metadata }, null, _instanceExtraInitializers);
1612
+ __esDecorate(_a, null, _get_panningInertia_decorators, { kind: "getter", name: "panningInertia", static: false, private: false, access: { has: obj => "panningInertia" in obj, get: obj => obj.panningInertia }, metadata: _metadata }, null, _instanceExtraInitializers);
1613
+ __esDecorate(_a, null, _get_zoomToMouseLocation_decorators, { kind: "getter", name: "zoomToMouseLocation", static: false, private: false, access: { has: obj => "zoomToMouseLocation" in obj, get: obj => obj.zoomToMouseLocation }, metadata: _metadata }, null, _instanceExtraInitializers);
1614
+ __esDecorate(null, null, _useWorldTargetIfParentExists_decorators, { kind: "field", name: "useWorldTargetIfParentExists", static: false, private: false, access: { has: obj => "useWorldTargetIfParentExists" in obj, get: obj => obj.useWorldTargetIfParentExists, set: (obj, value) => { obj.useWorldTargetIfParentExists = value; } }, metadata: _metadata }, _useWorldTargetIfParentExists_initializers, _useWorldTargetIfParentExists_extraInitializers);
1615
+ __esDecorate(null, null, _alpha_decorators, { kind: "field", name: "alpha", static: false, private: false, access: { has: obj => "alpha" in obj, get: obj => obj.alpha, set: (obj, value) => { obj.alpha = value; } }, metadata: _metadata }, _alpha_initializers, _alpha_extraInitializers);
1616
+ __esDecorate(null, null, _radius_decorators, { kind: "field", name: "radius", static: false, private: false, access: { has: obj => "radius" in obj, get: obj => obj.radius, set: (obj, value) => { obj.radius = value; } }, metadata: _metadata }, _radius_initializers, _radius_extraInitializers);
1617
+ __esDecorate(null, null, _overrideCloneAlphaBetaRadius_decorators, { kind: "field", name: "overrideCloneAlphaBetaRadius", static: false, private: false, access: { has: obj => "overrideCloneAlphaBetaRadius" in obj, get: obj => obj.overrideCloneAlphaBetaRadius, set: (obj, value) => { obj.overrideCloneAlphaBetaRadius = value; } }, metadata: _metadata }, _overrideCloneAlphaBetaRadius_initializers, _overrideCloneAlphaBetaRadius_extraInitializers);
1618
+ __esDecorate(null, null, __target_decorators, { kind: "field", name: "_target", static: false, private: false, access: { has: obj => "_target" in obj, get: obj => obj._target, set: (obj, value) => { obj._target = value; } }, metadata: _metadata }, __target_initializers, __target_extraInitializers);
1619
+ __esDecorate(null, null, __targetHost_decorators, { kind: "field", name: "_targetHost", static: false, private: false, access: { has: obj => "_targetHost" in obj, get: obj => obj._targetHost, set: (obj, value) => { obj._targetHost = value; } }, metadata: _metadata }, __targetHost_initializers, __targetHost_extraInitializers);
1620
+ __esDecorate(null, null, _lowerAlphaLimit_decorators, { kind: "field", name: "lowerAlphaLimit", static: false, private: false, access: { has: obj => "lowerAlphaLimit" in obj, get: obj => obj.lowerAlphaLimit, set: (obj, value) => { obj.lowerAlphaLimit = value; } }, metadata: _metadata }, _lowerAlphaLimit_initializers, _lowerAlphaLimit_extraInitializers);
1621
+ __esDecorate(null, null, _upperAlphaLimit_decorators, { kind: "field", name: "upperAlphaLimit", static: false, private: false, access: { has: obj => "upperAlphaLimit" in obj, get: obj => obj.upperAlphaLimit, set: (obj, value) => { obj.upperAlphaLimit = value; } }, metadata: _metadata }, _upperAlphaLimit_initializers, _upperAlphaLimit_extraInitializers);
1622
+ __esDecorate(null, null, _lowerBetaLimit_decorators, { kind: "field", name: "lowerBetaLimit", static: false, private: false, access: { has: obj => "lowerBetaLimit" in obj, get: obj => obj.lowerBetaLimit, set: (obj, value) => { obj.lowerBetaLimit = value; } }, metadata: _metadata }, _lowerBetaLimit_initializers, _lowerBetaLimit_extraInitializers);
1623
+ __esDecorate(null, null, _upperBetaLimit_decorators, { kind: "field", name: "upperBetaLimit", static: false, private: false, access: { has: obj => "upperBetaLimit" in obj, get: obj => obj.upperBetaLimit, set: (obj, value) => { obj.upperBetaLimit = value; } }, metadata: _metadata }, _upperBetaLimit_initializers, _upperBetaLimit_extraInitializers);
1624
+ __esDecorate(null, null, _lowerRadiusLimit_decorators, { kind: "field", name: "lowerRadiusLimit", static: false, private: false, access: { has: obj => "lowerRadiusLimit" in obj, get: obj => obj.lowerRadiusLimit, set: (obj, value) => { obj.lowerRadiusLimit = value; } }, metadata: _metadata }, _lowerRadiusLimit_initializers, _lowerRadiusLimit_extraInitializers);
1625
+ __esDecorate(null, null, _upperRadiusLimit_decorators, { kind: "field", name: "upperRadiusLimit", static: false, private: false, access: { has: obj => "upperRadiusLimit" in obj, get: obj => obj.upperRadiusLimit, set: (obj, value) => { obj.upperRadiusLimit = value; } }, metadata: _metadata }, _upperRadiusLimit_initializers, _upperRadiusLimit_extraInitializers);
1626
+ __esDecorate(null, null, _lowerTargetYLimit_decorators, { kind: "field", name: "lowerTargetYLimit", static: false, private: false, access: { has: obj => "lowerTargetYLimit" in obj, get: obj => obj.lowerTargetYLimit, set: (obj, value) => { obj.lowerTargetYLimit = value; } }, metadata: _metadata }, _lowerTargetYLimit_initializers, _lowerTargetYLimit_extraInitializers);
1627
+ __esDecorate(null, null, _inertialPanningX_decorators, { kind: "field", name: "inertialPanningX", static: false, private: false, access: { has: obj => "inertialPanningX" in obj, get: obj => obj.inertialPanningX, set: (obj, value) => { obj.inertialPanningX = value; } }, metadata: _metadata }, _inertialPanningX_initializers, _inertialPanningX_extraInitializers);
1628
+ __esDecorate(null, null, _inertialPanningY_decorators, { kind: "field", name: "inertialPanningY", static: false, private: false, access: { has: obj => "inertialPanningY" in obj, get: obj => obj.inertialPanningY, set: (obj, value) => { obj.inertialPanningY = value; } }, metadata: _metadata }, _inertialPanningY_initializers, _inertialPanningY_extraInitializers);
1629
+ __esDecorate(null, null, _pinchToPanMaxDistance_decorators, { kind: "field", name: "pinchToPanMaxDistance", static: false, private: false, access: { has: obj => "pinchToPanMaxDistance" in obj, get: obj => obj.pinchToPanMaxDistance, set: (obj, value) => { obj.pinchToPanMaxDistance = value; } }, metadata: _metadata }, _pinchToPanMaxDistance_initializers, _pinchToPanMaxDistance_extraInitializers);
1630
+ __esDecorate(null, null, _panningDistanceLimit_decorators, { kind: "field", name: "panningDistanceLimit", static: false, private: false, access: { has: obj => "panningDistanceLimit" in obj, get: obj => obj.panningDistanceLimit, set: (obj, value) => { obj.panningDistanceLimit = value; } }, metadata: _metadata }, _panningDistanceLimit_initializers, _panningDistanceLimit_extraInitializers);
1631
+ __esDecorate(null, null, _panningOriginTarget_decorators, { kind: "field", name: "panningOriginTarget", static: false, private: false, access: { has: obj => "panningOriginTarget" in obj, get: obj => obj.panningOriginTarget, set: (obj, value) => { obj.panningOriginTarget = value; } }, metadata: _metadata }, _panningOriginTarget_initializers, _panningOriginTarget_extraInitializers);
1632
+ __esDecorate(null, null, _zoomOnFactor_decorators, { kind: "field", name: "zoomOnFactor", static: false, private: false, access: { has: obj => "zoomOnFactor" in obj, get: obj => obj.zoomOnFactor, set: (obj, value) => { obj.zoomOnFactor = value; } }, metadata: _metadata }, _zoomOnFactor_initializers, _zoomOnFactor_extraInitializers);
1633
+ __esDecorate(null, null, _targetScreenOffset_decorators, { kind: "field", name: "targetScreenOffset", static: false, private: false, access: { has: obj => "targetScreenOffset" in obj, get: obj => obj.targetScreenOffset, set: (obj, value) => { obj.targetScreenOffset = value; } }, metadata: _metadata }, _targetScreenOffset_initializers, _targetScreenOffset_extraInitializers);
1634
+ __esDecorate(null, null, _allowUpsideDown_decorators, { kind: "field", name: "allowUpsideDown", static: false, private: false, access: { has: obj => "allowUpsideDown" in obj, get: obj => obj.allowUpsideDown, set: (obj, value) => { obj.allowUpsideDown = value; } }, metadata: _metadata }, _allowUpsideDown_initializers, _allowUpsideDown_extraInitializers);
1635
+ __esDecorate(null, null, _useInputToRestoreState_decorators, { kind: "field", name: "useInputToRestoreState", static: false, private: false, access: { has: obj => "useInputToRestoreState" in obj, get: obj => obj.useInputToRestoreState, set: (obj, value) => { obj.useInputToRestoreState = value; } }, metadata: _metadata }, _useInputToRestoreState_initializers, _useInputToRestoreState_extraInitializers);
1636
+ __esDecorate(null, null, _restoreStateInterpolationFactor_decorators, { kind: "field", name: "restoreStateInterpolationFactor", static: false, private: false, access: { has: obj => "restoreStateInterpolationFactor" in obj, get: obj => obj.restoreStateInterpolationFactor, set: (obj, value) => { obj.restoreStateInterpolationFactor = value; } }, metadata: _metadata }, _restoreStateInterpolationFactor_initializers, _restoreStateInterpolationFactor_extraInitializers);
1637
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1638
+ })(),
1639
+ _a;
1640
+ })();
1641
+ export { ArcRotateCamera };
1562
1642
  let _Registered = false;
1563
1643
  /**
1564
1644
  * Register side effects for arcRotateCamera.