@babylonjs/core 5.22.1 → 5.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/Actions/abstractActionManager.d.ts +6 -6
  2. package/Actions/abstractActionManager.js +1 -1
  3. package/Actions/abstractActionManager.js.map +1 -1
  4. package/Actions/actionManager.d.ts +5 -5
  5. package/Actions/actionManager.js +5 -5
  6. package/Actions/actionManager.js.map +1 -1
  7. package/Animations/animatable.js +2 -1
  8. package/Animations/animatable.js.map +1 -1
  9. package/Animations/animation.js +137 -139
  10. package/Animations/animation.js.map +1 -1
  11. package/Animations/animationGroup.d.ts +3 -3
  12. package/Animations/animationGroup.js +3 -3
  13. package/Animations/animationGroup.js.map +1 -1
  14. package/Animations/runtimeAnimation.js +6 -7
  15. package/Animations/runtimeAnimation.js.map +1 -1
  16. package/Audio/audioSceneComponent.d.ts +1 -1
  17. package/Audio/audioSceneComponent.js.map +1 -1
  18. package/Audio/sound.d.ts +2 -1
  19. package/Audio/sound.js +21 -9
  20. package/Audio/sound.js.map +1 -1
  21. package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
  22. package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
  23. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  24. package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
  25. package/Behaviors/Cameras/bouncingBehavior.js +1 -1
  26. package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
  27. package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
  28. package/Behaviors/Cameras/framingBehavior.js +1 -1
  29. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  30. package/Bones/bone.d.ts +1 -1
  31. package/Bones/bone.js +1 -1
  32. package/Bones/bone.js.map +1 -1
  33. package/Bones/skeleton.d.ts +2 -2
  34. package/Bones/skeleton.js +11 -5
  35. package/Bones/skeleton.js.map +1 -1
  36. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +3 -22
  37. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  38. package/Cameras/Inputs/BaseCameraPointersInput.js +3 -3
  39. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  40. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +1 -11
  41. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  42. package/Cameras/Inputs/flyCameraMouseInput.js +3 -3
  43. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  44. package/Cameras/Inputs/followCameraMouseWheelInput.js +1 -4
  45. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  46. package/Cameras/Inputs/freeCameraMouseInput.js +3 -3
  47. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  48. package/Cameras/arcRotateCamera.d.ts +1 -1
  49. package/Cameras/arcRotateCamera.js +1 -1
  50. package/Cameras/arcRotateCamera.js.map +1 -1
  51. package/Cameras/camera.d.ts +2 -2
  52. package/Cameras/camera.js +2 -2
  53. package/Cameras/camera.js.map +1 -1
  54. package/Cameras/freeCamera.d.ts +1 -1
  55. package/Cameras/freeCamera.js +1 -1
  56. package/Cameras/freeCamera.js.map +1 -1
  57. package/Cameras/gamepadCamera.d.ts +1 -1
  58. package/Cameras/gamepadCamera.js +1 -1
  59. package/Cameras/gamepadCamera.js.map +1 -1
  60. package/Cameras/targetCamera.d.ts +1 -1
  61. package/Cameras/targetCamera.js +1 -1
  62. package/Cameras/targetCamera.js.map +1 -1
  63. package/Cameras/touchCamera.d.ts +1 -1
  64. package/Cameras/touchCamera.js +1 -1
  65. package/Cameras/touchCamera.js.map +1 -1
  66. package/Cameras/universalCamera.d.ts +1 -1
  67. package/Cameras/universalCamera.js +1 -1
  68. package/Cameras/universalCamera.js.map +1 -1
  69. package/Cameras/virtualJoysticksCamera.d.ts +1 -1
  70. package/Cameras/virtualJoysticksCamera.js +1 -1
  71. package/Cameras/virtualJoysticksCamera.js.map +1 -1
  72. package/Culling/boundingBox.d.ts +2 -2
  73. package/Culling/boundingBox.js +2 -2
  74. package/Culling/boundingBox.js.map +1 -1
  75. package/Culling/ray.d.ts +1 -1
  76. package/Culling/ray.js +1 -1
  77. package/Culling/ray.js.map +1 -1
  78. package/Debug/debugLayer.d.ts +1 -1
  79. package/Debug/debugLayer.js +1 -1
  80. package/Debug/debugLayer.js.map +1 -1
  81. package/DeviceInput/webDeviceInputSystem.js +20 -2
  82. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  83. package/Engines/Extensions/engine.multiRender.js +8 -10
  84. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  85. package/Engines/Extensions/engine.query.d.ts +2 -2
  86. package/Engines/Extensions/engine.query.js.map +1 -1
  87. package/Engines/ICanvas.d.ts +11 -0
  88. package/Engines/ICanvas.js.map +1 -1
  89. package/Engines/WebGL/webGLPipelineContext.d.ts +29 -19
  90. package/Engines/WebGL/webGLPipelineContext.js +99 -311
  91. package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
  92. package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
  93. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  94. package/Engines/engine.d.ts +2 -2
  95. package/Engines/engine.js +2 -2
  96. package/Engines/engine.js.map +1 -1
  97. package/Engines/nativeEngine.d.ts +2 -2
  98. package/Engines/nativeEngine.js +2 -2
  99. package/Engines/nativeEngine.js.map +1 -1
  100. package/Engines/renderTargetWrapper.d.ts +1 -0
  101. package/Engines/renderTargetWrapper.js +5 -2
  102. package/Engines/renderTargetWrapper.js.map +1 -1
  103. package/Engines/thinEngine.d.ts +6 -5
  104. package/Engines/thinEngine.js +11 -7
  105. package/Engines/thinEngine.js.map +1 -1
  106. package/Engines/webgpuEngine.js +4 -1
  107. package/Engines/webgpuEngine.js.map +1 -1
  108. package/Events/clipboardEvents.d.ts +1 -1
  109. package/Events/clipboardEvents.js +1 -1
  110. package/Events/clipboardEvents.js.map +1 -1
  111. package/Events/deviceInputEvents.d.ts +11 -4
  112. package/Events/deviceInputEvents.js.map +1 -1
  113. package/Gamepads/Controllers/windowsMotionController.d.ts +1 -1
  114. package/Gamepads/Controllers/windowsMotionController.js +1 -1
  115. package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
  116. package/Gizmos/boundingBoxGizmo.d.ts +4 -0
  117. package/Gizmos/boundingBoxGizmo.js +6 -0
  118. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  119. package/Inputs/scene.inputManager.js +4 -4
  120. package/Inputs/scene.inputManager.js.map +1 -1
  121. package/Layers/effectLayer.d.ts +3 -3
  122. package/Layers/effectLayer.js +1 -1
  123. package/Layers/effectLayer.js.map +1 -1
  124. package/Layers/glowLayer.d.ts +3 -3
  125. package/Layers/glowLayer.js +2 -2
  126. package/Layers/glowLayer.js.map +1 -1
  127. package/Layers/highlightLayer.d.ts +3 -3
  128. package/Layers/highlightLayer.js +2 -2
  129. package/Layers/highlightLayer.js.map +1 -1
  130. package/Lights/directionalLight.d.ts +2 -2
  131. package/Lights/directionalLight.js +2 -2
  132. package/Lights/directionalLight.js.map +1 -1
  133. package/Lights/hemisphericLight.d.ts +3 -3
  134. package/Lights/hemisphericLight.js +3 -3
  135. package/Lights/hemisphericLight.js.map +1 -1
  136. package/Lights/light.d.ts +2 -2
  137. package/Lights/light.js +2 -2
  138. package/Lights/light.js.map +1 -1
  139. package/Lights/lightConstants.d.ts +1 -1
  140. package/Lights/lightConstants.js +1 -1
  141. package/Lights/lightConstants.js.map +1 -1
  142. package/Loading/Plugins/babylonFileLoader.js +3 -0
  143. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  144. package/Loading/sceneLoader.d.ts +1 -1
  145. package/Loading/sceneLoader.js.map +1 -1
  146. package/Materials/Background/backgroundMaterial.js +4 -0
  147. package/Materials/Background/backgroundMaterial.js.map +1 -1
  148. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -1
  149. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  150. package/Materials/Node/nodeMaterial.d.ts +1 -1
  151. package/Materials/Node/nodeMaterial.js +5 -1
  152. package/Materials/Node/nodeMaterial.js.map +1 -1
  153. package/Materials/PBR/pbrBaseMaterial.js +4 -1
  154. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  155. package/Materials/Textures/Filtering/hdrFiltering.d.ts +1 -1
  156. package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
  157. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  158. package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
  159. package/Materials/Textures/Procedurals/customProceduralTexture.js +9 -3
  160. package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
  161. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -9
  162. package/Materials/Textures/Procedurals/proceduralTexture.js +9 -9
  163. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  164. package/Materials/Textures/colorGradingTexture.d.ts +1 -1
  165. package/Materials/Textures/colorGradingTexture.js +1 -1
  166. package/Materials/Textures/colorGradingTexture.js.map +1 -1
  167. package/Materials/Textures/cubeTexture.d.ts +2 -2
  168. package/Materials/Textures/cubeTexture.js +2 -2
  169. package/Materials/Textures/cubeTexture.js.map +1 -1
  170. package/Materials/Textures/rawCubeTexture.d.ts +1 -1
  171. package/Materials/Textures/rawCubeTexture.js +1 -1
  172. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  173. package/Materials/Textures/renderTargetTexture.d.ts +3 -5
  174. package/Materials/Textures/renderTargetTexture.js +19 -19
  175. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  176. package/Materials/colorCurves.d.ts +3 -3
  177. package/Materials/colorCurves.js +3 -3
  178. package/Materials/colorCurves.js.map +1 -1
  179. package/Materials/effect.d.ts +27 -27
  180. package/Materials/effect.js +22 -288
  181. package/Materials/effect.js.map +1 -1
  182. package/Materials/fresnelParameters.d.ts +1 -1
  183. package/Materials/fresnelParameters.js +1 -1
  184. package/Materials/fresnelParameters.js.map +1 -1
  185. package/Materials/imageProcessingConfiguration.d.ts +4 -4
  186. package/Materials/imageProcessingConfiguration.js +4 -4
  187. package/Materials/imageProcessingConfiguration.js.map +1 -1
  188. package/Materials/shaderMaterial.d.ts +25 -25
  189. package/Materials/shaderMaterial.js +25 -25
  190. package/Materials/shaderMaterial.js.map +1 -1
  191. package/Materials/standardMaterial.js +4 -1
  192. package/Materials/standardMaterial.js.map +1 -1
  193. package/Maths/index.d.ts +1 -0
  194. package/Maths/index.js +1 -0
  195. package/Maths/index.js.map +1 -1
  196. package/Maths/math.functions.d.ts +2 -2
  197. package/Maths/math.functions.js +2 -2
  198. package/Maths/math.functions.js.map +1 -1
  199. package/Maths/math.polar.d.ts +77 -0
  200. package/Maths/math.polar.js +114 -0
  201. package/Maths/math.polar.js.map +1 -0
  202. package/Maths/math.scalar.d.ts +2 -2
  203. package/Maths/math.scalar.js +2 -2
  204. package/Maths/math.scalar.js.map +1 -1
  205. package/Maths/math.vector.d.ts +13 -12
  206. package/Maths/math.vector.js +13 -12
  207. package/Maths/math.vector.js.map +1 -1
  208. package/Meshes/abstractMesh.d.ts +1 -1
  209. package/Meshes/abstractMesh.js +13 -2
  210. package/Meshes/abstractMesh.js.map +1 -1
  211. package/Meshes/geometry.d.ts +3 -3
  212. package/Meshes/geometry.js +3 -3
  213. package/Meshes/geometry.js.map +1 -1
  214. package/Meshes/groundMesh.d.ts +5 -4
  215. package/Meshes/groundMesh.js +5 -4
  216. package/Meshes/groundMesh.js.map +1 -1
  217. package/Meshes/instancedMesh.d.ts +1 -1
  218. package/Meshes/instancedMesh.js +1 -1
  219. package/Meshes/instancedMesh.js.map +1 -1
  220. package/Meshes/mesh.d.ts +3 -3
  221. package/Meshes/mesh.js +7 -3
  222. package/Meshes/mesh.js.map +1 -1
  223. package/Meshes/subMesh.d.ts +1 -1
  224. package/Meshes/subMesh.js +1 -1
  225. package/Meshes/subMesh.js.map +1 -1
  226. package/Meshes/thinInstanceMesh.d.ts +1 -1
  227. package/Meshes/thinInstanceMesh.js.map +1 -1
  228. package/Meshes/transformNode.js +6 -0
  229. package/Meshes/transformNode.js.map +1 -1
  230. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +2 -2
  231. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
  232. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  233. package/Misc/HighDynamicRange/hdr.d.ts +3 -3
  234. package/Misc/HighDynamicRange/hdr.js +3 -3
  235. package/Misc/HighDynamicRange/hdr.js.map +1 -1
  236. package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -1
  237. package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
  238. package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
  239. package/Misc/arrayTools.d.ts +13 -12
  240. package/Misc/arrayTools.js +70 -39
  241. package/Misc/arrayTools.js.map +1 -1
  242. package/Misc/assetsManager.d.ts +3 -3
  243. package/Misc/assetsManager.js +3 -3
  244. package/Misc/assetsManager.js.map +1 -1
  245. package/Misc/basis.js +17 -3
  246. package/Misc/basis.js.map +1 -1
  247. package/Misc/environmentTextureTools.d.ts +4 -4
  248. package/Misc/environmentTextureTools.js +5 -5
  249. package/Misc/environmentTextureTools.js.map +1 -1
  250. package/Misc/fileTools.d.ts +3 -3
  251. package/Misc/fileTools.js +19 -12
  252. package/Misc/fileTools.js.map +1 -1
  253. package/Misc/logger.js +1 -1
  254. package/Misc/logger.js.map +1 -1
  255. package/Misc/observable.d.ts +1 -1
  256. package/Misc/observable.js +1 -1
  257. package/Misc/observable.js.map +1 -1
  258. package/Misc/performanceMonitor.d.ts +3 -3
  259. package/Misc/performanceMonitor.js +3 -3
  260. package/Misc/performanceMonitor.js.map +1 -1
  261. package/Misc/rgbdTextureTools.d.ts +1 -1
  262. package/Misc/rgbdTextureTools.js +1 -1
  263. package/Misc/rgbdTextureTools.js.map +1 -1
  264. package/Misc/sceneOptimizer.d.ts +7 -7
  265. package/Misc/sceneOptimizer.js +7 -7
  266. package/Misc/sceneOptimizer.js.map +1 -1
  267. package/Misc/stringDictionary.d.ts +6 -6
  268. package/Misc/stringDictionary.js +6 -6
  269. package/Misc/stringDictionary.js.map +1 -1
  270. package/Misc/textureTools.d.ts +4 -4
  271. package/Misc/textureTools.js +4 -4
  272. package/Misc/textureTools.js.map +1 -1
  273. package/Misc/tools.d.ts +6 -6
  274. package/Misc/tools.js +6 -6
  275. package/Misc/tools.js.map +1 -1
  276. package/Misc/videoRecorder.d.ts +1 -1
  277. package/Misc/videoRecorder.js +1 -1
  278. package/Misc/videoRecorder.js.map +1 -1
  279. package/Offline/database.js +3 -3
  280. package/Offline/database.js.map +1 -1
  281. package/Particles/IParticleSystem.d.ts +1 -1
  282. package/Particles/IParticleSystem.js.map +1 -1
  283. package/Particles/gpuParticleSystem.d.ts +1 -1
  284. package/Particles/gpuParticleSystem.js +1 -1
  285. package/Particles/gpuParticleSystem.js.map +1 -1
  286. package/Particles/particleSystem.d.ts +1 -1
  287. package/Particles/particleSystem.js +1 -1
  288. package/Particles/particleSystem.js.map +1 -1
  289. package/Particles/solidParticleSystem.d.ts +4 -0
  290. package/Particles/solidParticleSystem.js +25 -3
  291. package/Particles/solidParticleSystem.js.map +1 -1
  292. package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
  293. package/Physics/Plugins/ammoJSPlugin.js +1 -1
  294. package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
  295. package/Physics/Plugins/oimoJSPlugin.js +1 -1
  296. package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
  297. package/Physics/physicsEngineComponent.d.ts +1 -1
  298. package/Physics/physicsEngineComponent.js +1 -1
  299. package/Physics/physicsEngineComponent.js.map +1 -1
  300. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +3 -3
  301. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  302. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +1 -2
  303. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  304. package/PostProcesses/blurPostProcess.d.ts +3 -3
  305. package/PostProcesses/blurPostProcess.js +3 -3
  306. package/PostProcesses/blurPostProcess.js.map +1 -1
  307. package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +3 -3
  308. package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -3
  309. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  310. package/Rendering/depthPeelingRenderer.d.ts +1 -0
  311. package/Rendering/depthPeelingRenderer.js +32 -5
  312. package/Rendering/depthPeelingRenderer.js.map +1 -1
  313. package/Rendering/edgesRenderer.d.ts +2 -2
  314. package/Rendering/edgesRenderer.js +1 -1
  315. package/Rendering/edgesRenderer.js.map +1 -1
  316. package/Rendering/geometryBufferRenderer.d.ts +4 -2
  317. package/Rendering/geometryBufferRenderer.js +5 -3
  318. package/Rendering/geometryBufferRenderer.js.map +1 -1
  319. package/Rendering/geometryBufferRendererSceneComponent.d.ts +2 -1
  320. package/Rendering/geometryBufferRendererSceneComponent.js +3 -2
  321. package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
  322. package/Rendering/prePassRenderer.d.ts +11 -3
  323. package/Rendering/prePassRenderer.js +18 -3
  324. package/Rendering/prePassRenderer.js.map +1 -1
  325. package/Rendering/subSurfaceConfiguration.d.ts +2 -2
  326. package/Rendering/subSurfaceConfiguration.js +2 -2
  327. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  328. package/Sprites/spriteSceneComponent.js +4 -1
  329. package/Sprites/spriteSceneComponent.js.map +1 -1
  330. package/XR/features/WebXRControllerTeleportation.d.ts +4 -0
  331. package/XR/features/WebXRControllerTeleportation.js +24 -19
  332. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  333. package/XR/motionController/webXRAbstractMotionController.d.ts +2 -2
  334. package/XR/motionController/webXRAbstractMotionController.js +2 -2
  335. package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
  336. package/XR/motionController/webXRControllerComponent.d.ts +1 -1
  337. package/XR/motionController/webXRControllerComponent.js +1 -1
  338. package/XR/motionController/webXRControllerComponent.js.map +1 -1
  339. package/XR/motionController/webXRMotionControllerManager.d.ts +3 -3
  340. package/XR/motionController/webXRMotionControllerManager.js +3 -3
  341. package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
  342. package/node.d.ts +4 -4
  343. package/node.js +3 -3
  344. package/node.js.map +1 -1
  345. package/package.json +1 -1
  346. package/readme.md +0 -4
  347. package/scene.d.ts +80 -63
  348. package/scene.js +92 -46
  349. package/scene.js.map +1 -1
  350. package/sceneComponent.d.ts +1 -1
  351. package/sceneComponent.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"engine.query.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Engines/Extensions/engine.query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,cAAc;AACd,gEAAgE;AAChE,MAAM,OAAO,qBAAqB;IAAlC;QACI,cAAc;QACP,kCAA6B,GAAG,CAAC,CAAC;QAEzC,cAAc;QACP,+BAA0B,GAAG,KAAK,CAAC;QAE1C,cAAc;QACP,eAAU,GAAG,KAAK,CAAC;QAE1B,cAAc;QACP,wBAAmB,GAAG,CAAC,CAAC,CAAC;QAEhC,cAAc;QACP,kBAAa,GAAG,YAAY,CAAC,mBAAmB,CAAC;QAExD,cAAc;QACP,gCAA2B,GAAG,YAAY,CAAC,qCAAqC,CAAC;QAExF,cAAc;QACP,+BAA0B,GAAG,KAAK,CAAC;IAC9C,CAAC;CAAA;AAwGD,MAAM,CAAC,SAAS,CAAC,WAAW,GAAG;IAC3B,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gBACH,OAAO,WAAW,CAAC,aAAa,KAAK,YAAY,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC;aAChH;SACJ;KACJ;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9B,IAAI,KAAK,CAAC,sBAAsB,EAAE;QAC9B,MAAM,4BAA4B,GAAG,KAAK,CAAC,sBAAsB,EAAE,CAAC;QAEpE,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,EAAE;YAC/B,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;SAC/C;QAED,IAAI,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,2BAA2B,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE;YAC3F,4BAA4B,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC;YAC9D,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;YAClE,IAAI,CAAC,qBAAqB,CAAC,0BAA0B,GAAG,IAAI,CAAC;SAChE;KACJ;IAED,OAAO,WAAW,CAAC,UAAU,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import type { Nullable, int } from \"../../types\";\r\nimport { Engine } from \"../../Engines/engine\";\r\nimport { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { _TimeToken } from \"../../Instrumentation/timeToken\";\r\nimport { PerfCounter } from \"../../Misc/perfCounter\";\r\nimport type { Observer } from \"../../Misc/observable\";\r\n\r\n/** @hidden */\r\nexport type OcclusionQuery = WebGLQuery | number;\r\n\r\n/** @hidden */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _OcclusionDataStorage {\r\n /** @hidden */\r\n public occlusionInternalRetryCounter = 0;\r\n\r\n /** @hidden */\r\n public isOcclusionQueryInProgress = false;\r\n\r\n /** @hidden */\r\n public isOccluded = false;\r\n\r\n /** @hidden */\r\n public occlusionRetryCount = -1;\r\n\r\n /** @hidden */\r\n public occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;\r\n\r\n /** @hidden */\r\n public occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;\r\n\r\n /** @hidden */\r\n public forceRenderingWhenOccluded = false;\r\n}\r\n\r\ndeclare module \"../../Engines/engine\" {\r\n export interface Engine {\r\n /**\r\n * Create a new webGL query (you must be sure that queries are supported by checking getCaps() function)\r\n * @return the new query\r\n */\r\n createQuery(): OcclusionQuery;\r\n\r\n /**\r\n * Delete and release a webGL query\r\n * @param query defines the query to delete\r\n * @return the current engine\r\n */\r\n deleteQuery(query: OcclusionQuery): Engine;\r\n\r\n /**\r\n * Check if a given query has resolved and got its value\r\n * @param query defines the query to check\r\n * @returns true if the query got its value\r\n */\r\n isQueryResultAvailable(query: OcclusionQuery): boolean;\r\n\r\n /**\r\n * Gets the value of a given query\r\n * @param query defines the query to check\r\n * @returns the value of the query\r\n */\r\n getQueryResult(query: OcclusionQuery): number;\r\n\r\n /**\r\n * Initiates an occlusion query\r\n * @param algorithmType defines the algorithm to use\r\n * @param query defines the query to use\r\n * @returns the current engine\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n beginOcclusionQuery(algorithmType: number, query: OcclusionQuery): boolean;\r\n\r\n /**\r\n * Ends an occlusion query\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n * @param algorithmType defines the algorithm to use\r\n * @returns the current engine\r\n */\r\n endOcclusionQuery(algorithmType: number): Engine;\r\n\r\n /**\r\n * Starts a time query (used to measure time spent by the GPU on a specific frame)\r\n * Please note that only one query can be issued at a time\r\n * @returns a time token used to track the time span\r\n */\r\n startTimeQuery(): Nullable<_TimeToken>;\r\n\r\n /**\r\n * Ends a time query\r\n * @param token defines the token used to measure the time span\r\n * @returns the time spent (in ns)\r\n */\r\n endTimeQuery(token: _TimeToken): int;\r\n\r\n /**\r\n * Get the performance counter associated with the frame time computation\r\n * @returns the perf counter\r\n */\r\n getGPUFrameTimeCounter(): PerfCounter;\r\n\r\n /**\r\n * Enable or disable the GPU frame time capture\r\n * @param value True to enable, false to disable\r\n */\r\n captureGPUFrameTime(value: boolean): void;\r\n\r\n /** @hidden */\r\n _currentNonTimestampToken: Nullable<_TimeToken>;\r\n /** @hidden */\r\n _captureGPUFrameTime: boolean;\r\n /** @hidden */\r\n _gpuFrameTimeToken: Nullable<_TimeToken>;\r\n /** @hidden */\r\n _gpuFrameTime: PerfCounter;\r\n /** @hidden */\r\n _onBeginFrameObserver: Nullable<Observer<Engine>>;\r\n /** @hidden */\r\n _onEndFrameObserver: Nullable<Observer<Engine>>;\r\n\r\n /** @hidden */\r\n _createTimeQuery(): WebGLQuery;\r\n\r\n /** @hidden */\r\n _deleteTimeQuery(query: WebGLQuery): void;\r\n\r\n /** @hidden */\r\n _getGlAlgorithmType(algorithmType: number): number;\r\n\r\n /** @hidden */\r\n _getTimeQueryResult(query: WebGLQuery): any;\r\n\r\n /** @hidden */\r\n _getTimeQueryAvailability(query: WebGLQuery): any;\r\n }\r\n}\r\n\r\nEngine.prototype.createQuery = function (): OcclusionQuery {\r\n const query = this._gl.createQuery();\r\n if (!query) {\r\n throw new Error(\"Unable to create Occlusion Query\");\r\n }\r\n return query;\r\n};\r\n\r\nEngine.prototype.deleteQuery = function (query: OcclusionQuery): Engine {\r\n this._gl.deleteQuery(query);\r\n\r\n return this;\r\n};\r\n\r\nEngine.prototype.isQueryResultAvailable = function (query: OcclusionQuery): boolean {\r\n return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT_AVAILABLE) as boolean;\r\n};\r\n\r\nEngine.prototype.getQueryResult = function (query: OcclusionQuery): number {\r\n return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT) as number;\r\n};\r\n\r\nEngine.prototype.beginOcclusionQuery = function (algorithmType: number, query: OcclusionQuery): boolean {\r\n const glAlgorithm = this._getGlAlgorithmType(algorithmType);\r\n this._gl.beginQuery(glAlgorithm, query);\r\n\r\n return true;\r\n};\r\n\r\nEngine.prototype.endOcclusionQuery = function (algorithmType: number): Engine {\r\n const glAlgorithm = this._getGlAlgorithmType(algorithmType);\r\n this._gl.endQuery(glAlgorithm);\r\n\r\n return this;\r\n};\r\n\r\nEngine.prototype._createTimeQuery = function (): WebGLQuery {\r\n const timerQuery = <EXT_disjoint_timer_query>this.getCaps().timerQuery;\r\n\r\n if (timerQuery.createQueryEXT) {\r\n return timerQuery.createQueryEXT();\r\n }\r\n\r\n return this.createQuery();\r\n};\r\n\r\nEngine.prototype._deleteTimeQuery = function (query: WebGLQuery): void {\r\n const timerQuery = <EXT_disjoint_timer_query>this.getCaps().timerQuery;\r\n\r\n if (timerQuery.deleteQueryEXT) {\r\n timerQuery.deleteQueryEXT(query);\r\n return;\r\n }\r\n\r\n this.deleteQuery(query);\r\n};\r\n\r\nEngine.prototype._getTimeQueryResult = function (query: WebGLQuery): any {\r\n const timerQuery = <EXT_disjoint_timer_query>this.getCaps().timerQuery;\r\n\r\n if (timerQuery.getQueryObjectEXT) {\r\n return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_EXT);\r\n }\r\n return this.getQueryResult(query);\r\n};\r\n\r\nEngine.prototype._getTimeQueryAvailability = function (query: WebGLQuery): any {\r\n const timerQuery = <EXT_disjoint_timer_query>this.getCaps().timerQuery;\r\n\r\n if (timerQuery.getQueryObjectEXT) {\r\n return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_AVAILABLE_EXT);\r\n }\r\n return this.isQueryResultAvailable(query);\r\n};\r\n\r\nEngine.prototype.startTimeQuery = function (): Nullable<_TimeToken> {\r\n const caps = this.getCaps();\r\n const timerQuery = caps.timerQuery;\r\n if (!timerQuery) {\r\n return null;\r\n }\r\n\r\n const token = new _TimeToken();\r\n this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT);\r\n if (caps.canUseTimestampForTimerQuery) {\r\n token._startTimeQuery = this._createTimeQuery();\r\n\r\n timerQuery.queryCounterEXT(token._startTimeQuery, timerQuery.TIMESTAMP_EXT);\r\n } else {\r\n if (this._currentNonTimestampToken) {\r\n return this._currentNonTimestampToken;\r\n }\r\n\r\n token._timeElapsedQuery = this._createTimeQuery();\r\n if (timerQuery.beginQueryEXT) {\r\n timerQuery.beginQueryEXT(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery);\r\n } else {\r\n this._gl.beginQuery(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery);\r\n }\r\n\r\n this._currentNonTimestampToken = token;\r\n }\r\n return token;\r\n};\r\n\r\nEngine.prototype.endTimeQuery = function (token: _TimeToken): int {\r\n const caps = this.getCaps();\r\n const timerQuery = caps.timerQuery;\r\n if (!timerQuery || !token) {\r\n return -1;\r\n }\r\n\r\n if (caps.canUseTimestampForTimerQuery) {\r\n if (!token._startTimeQuery) {\r\n return -1;\r\n }\r\n if (!token._endTimeQuery) {\r\n token._endTimeQuery = this._createTimeQuery();\r\n timerQuery.queryCounterEXT(token._endTimeQuery, timerQuery.TIMESTAMP_EXT);\r\n }\r\n } else if (!token._timeElapsedQueryEnded) {\r\n if (!token._timeElapsedQuery) {\r\n return -1;\r\n }\r\n if (timerQuery.endQueryEXT) {\r\n timerQuery.endQueryEXT(timerQuery.TIME_ELAPSED_EXT);\r\n } else {\r\n this._gl.endQuery(timerQuery.TIME_ELAPSED_EXT);\r\n this._currentNonTimestampToken = null;\r\n }\r\n token._timeElapsedQueryEnded = true;\r\n }\r\n\r\n const disjoint = this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT);\r\n let available: boolean = false;\r\n if (token._endTimeQuery) {\r\n available = this._getTimeQueryAvailability(token._endTimeQuery);\r\n } else if (token._timeElapsedQuery) {\r\n available = this._getTimeQueryAvailability(token._timeElapsedQuery);\r\n }\r\n\r\n if (available && !disjoint) {\r\n let result = 0;\r\n if (caps.canUseTimestampForTimerQuery) {\r\n if (!token._startTimeQuery || !token._endTimeQuery) {\r\n return -1;\r\n }\r\n const timeStart = this._getTimeQueryResult(token._startTimeQuery);\r\n const timeEnd = this._getTimeQueryResult(token._endTimeQuery);\r\n\r\n result = timeEnd - timeStart;\r\n this._deleteTimeQuery(token._startTimeQuery);\r\n this._deleteTimeQuery(token._endTimeQuery);\r\n token._startTimeQuery = null;\r\n token._endTimeQuery = null;\r\n } else {\r\n if (!token._timeElapsedQuery) {\r\n return -1;\r\n }\r\n\r\n result = this._getTimeQueryResult(token._timeElapsedQuery);\r\n this._deleteTimeQuery(token._timeElapsedQuery);\r\n token._timeElapsedQuery = null;\r\n token._timeElapsedQueryEnded = false;\r\n }\r\n return result;\r\n }\r\n\r\n return -1;\r\n};\r\n\r\nEngine.prototype._captureGPUFrameTime = false;\r\nEngine.prototype._gpuFrameTime = new PerfCounter();\r\n\r\nEngine.prototype.getGPUFrameTimeCounter = function () {\r\n return this._gpuFrameTime;\r\n};\r\n\r\nEngine.prototype.captureGPUFrameTime = function (value: boolean) {\r\n if (value === this._captureGPUFrameTime) {\r\n return;\r\n }\r\n\r\n this._captureGPUFrameTime = value;\r\n\r\n if (value) {\r\n this._onBeginFrameObserver = this.onBeginFrameObservable.add(() => {\r\n if (!this._gpuFrameTimeToken) {\r\n this._gpuFrameTimeToken = this.startTimeQuery();\r\n }\r\n });\r\n\r\n this._onEndFrameObserver = this.onEndFrameObservable.add(() => {\r\n if (!this._gpuFrameTimeToken) {\r\n return;\r\n }\r\n const time = this.endTimeQuery(this._gpuFrameTimeToken);\r\n\r\n if (time > -1) {\r\n this._gpuFrameTimeToken = null;\r\n this._gpuFrameTime.fetchNewFrame();\r\n this._gpuFrameTime.addCount(time, true);\r\n }\r\n });\r\n } else {\r\n this.onBeginFrameObservable.remove(this._onBeginFrameObserver);\r\n this._onBeginFrameObserver = null;\r\n this.onEndFrameObservable.remove(this._onEndFrameObserver);\r\n this._onEndFrameObserver = null;\r\n }\r\n};\r\n\r\nEngine.prototype._getGlAlgorithmType = function (algorithmType: number): number {\r\n return algorithmType === AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;\r\n};\r\n\r\ndeclare module \"../../Meshes/abstractMesh\" {\r\n export interface AbstractMesh {\r\n /**\r\n * Backing filed\r\n * @hidden\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n __occlusionDataStorage: _OcclusionDataStorage;\r\n\r\n /**\r\n * Access property\r\n * @hidden\r\n */\r\n _occlusionDataStorage: _OcclusionDataStorage;\r\n\r\n /**\r\n * This number indicates the number of allowed retries before stop the occlusion query, this is useful if the occlusion query is taking long time before to the query result is retrieved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decides to show or hide the object.\r\n * The default value is -1 which means don't break the query and wait till the result\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n occlusionRetryCount: number;\r\n\r\n /**\r\n * This property is responsible for starting the occlusion query within the Mesh or not, this property is also used to determine what should happen when the occlusionRetryCount is reached. It has supports 3 values:\r\n * * OCCLUSION_TYPE_NONE (Default Value): this option means no occlusion query within the Mesh.\r\n * * OCCLUSION_TYPE_OPTIMISTIC: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken show the mesh.\r\n * * OCCLUSION_TYPE_STRICT: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken restore the last state of the mesh occlusion if the mesh was visible then show the mesh if was hidden then hide don't show.\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n occlusionType: number;\r\n\r\n /**\r\n * This property determines the type of occlusion query algorithm to run in WebGl, you can use:\r\n * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE which is mapped to GL_ANY_SAMPLES_PASSED.\r\n * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE (Default Value) which is mapped to GL_ANY_SAMPLES_PASSED_CONSERVATIVE which is a false positive algorithm that is faster than GL_ANY_SAMPLES_PASSED but less accurate.\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n occlusionQueryAlgorithmType: number;\r\n\r\n /**\r\n * Gets or sets whether the mesh is occluded or not, it is used also to set the initial state of the mesh to be occluded or not\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n isOccluded: boolean;\r\n\r\n /**\r\n * Flag to check the progress status of the query\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n isOcclusionQueryInProgress: boolean;\r\n\r\n /**\r\n * Flag to force rendering the mesh even if occluded\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n forceRenderingWhenOccluded: boolean;\r\n }\r\n}\r\nObject.defineProperty(AbstractMesh.prototype, \"isOcclusionQueryInProgress\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.isOcclusionQueryInProgress;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.isOcclusionQueryInProgress = value;\r\n },\r\n enumerable: false,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"_occlusionDataStorage\", {\r\n get: function (this: AbstractMesh) {\r\n if (!this.__occlusionDataStorage) {\r\n this.__occlusionDataStorage = new _OcclusionDataStorage();\r\n }\r\n return this.__occlusionDataStorage;\r\n },\r\n enumerable: false,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"isOccluded\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.isOccluded;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.isOccluded = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionQueryAlgorithmType\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionQueryAlgorithmType;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionQueryAlgorithmType = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionType\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionType;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionType = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionRetryCount\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionRetryCount;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionRetryCount = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"forceRenderingWhenOccluded\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.forceRenderingWhenOccluded;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.forceRenderingWhenOccluded = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\n// We also need to update AbstractMesh as there is a portion of the code there\r\nAbstractMesh.prototype._checkOcclusionQuery = function () {\r\n const dataStorage = this._occlusionDataStorage;\r\n\r\n if (dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n const engine = this.getEngine();\r\n\r\n if (!engine.getCaps().supportOcclusionQuery) {\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n if (!engine.isQueryResultAvailable) {\r\n // Occlusion query where not referenced\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n if (this.isOcclusionQueryInProgress && this._occlusionQuery) {\r\n const isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);\r\n if (isOcclusionQueryAvailable) {\r\n const occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);\r\n\r\n dataStorage.isOcclusionQueryInProgress = false;\r\n dataStorage.occlusionInternalRetryCounter = 0;\r\n dataStorage.isOccluded = occlusionQueryResult > 0 ? false : true;\r\n } else {\r\n dataStorage.occlusionInternalRetryCounter++;\r\n\r\n if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {\r\n dataStorage.isOcclusionQueryInProgress = false;\r\n dataStorage.occlusionInternalRetryCounter = 0;\r\n\r\n // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)\r\n // if strict continue the last state of the object.\r\n dataStorage.isOccluded = dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;\r\n } else {\r\n return dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;\r\n }\r\n }\r\n }\r\n\r\n const scene = this.getScene();\r\n if (scene.getBoundingBoxRenderer) {\r\n const occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();\r\n\r\n if (this._occlusionQuery === null) {\r\n this._occlusionQuery = engine.createQuery();\r\n }\r\n\r\n if (engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery)) {\r\n occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);\r\n engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);\r\n this._occlusionDataStorage.isOcclusionQueryInProgress = true;\r\n }\r\n }\r\n\r\n return dataStorage.isOccluded;\r\n};\r\n"]}
1
+ {"version":3,"file":"engine.query.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Engines/Extensions/engine.query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,cAAc;AAC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\";\r\nimport { Engine } from \"../../Engines/engine\";\r\nimport { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { _TimeToken } from \"../../Instrumentation/timeToken\";\r\nimport { PerfCounter } from \"../../Misc/perfCounter\";\r\nimport type { Observer } from \"../../Misc/observable\";\r\n\r\n/** @hidden */\r\nexport type OcclusionQuery = WebGLQuery | number;\r\n\r\n/** @hidden */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _OcclusionDataStorage {\r\n /** @hidden */\r\n public occlusionInternalRetryCounter = 0;\r\n\r\n /** @hidden */\r\n public isOcclusionQueryInProgress = false;\r\n\r\n /** @hidden */\r\n public isOccluded = false;\r\n\r\n /** @hidden */\r\n public occlusionRetryCount = -1;\r\n\r\n /** @hidden */\r\n public occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;\r\n\r\n /** @hidden */\r\n public occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;\r\n\r\n /** @hidden */\r\n public forceRenderingWhenOccluded = false;\r\n}\r\n\r\ndeclare module \"../../Engines/engine\" {\r\n export interface Engine {\r\n /**\r\n * Create a new webGL query (you must be sure that queries are supported by checking getCaps() function)\r\n * @returns the new query\r\n */\r\n createQuery(): OcclusionQuery;\r\n\r\n /**\r\n * Delete and release a webGL query\r\n * @param query defines the query to delete\r\n * @returns the current engine\r\n */\r\n deleteQuery(query: OcclusionQuery): Engine;\r\n\r\n /**\r\n * Check if a given query has resolved and got its value\r\n * @param query defines the query to check\r\n * @returns true if the query got its value\r\n */\r\n isQueryResultAvailable(query: OcclusionQuery): boolean;\r\n\r\n /**\r\n * Gets the value of a given query\r\n * @param query defines the query to check\r\n * @returns the value of the query\r\n */\r\n getQueryResult(query: OcclusionQuery): number;\r\n\r\n /**\r\n * Initiates an occlusion query\r\n * @param algorithmType defines the algorithm to use\r\n * @param query defines the query to use\r\n * @returns the current engine\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n beginOcclusionQuery(algorithmType: number, query: OcclusionQuery): boolean;\r\n\r\n /**\r\n * Ends an occlusion query\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n * @param algorithmType defines the algorithm to use\r\n * @returns the current engine\r\n */\r\n endOcclusionQuery(algorithmType: number): Engine;\r\n\r\n /**\r\n * Starts a time query (used to measure time spent by the GPU on a specific frame)\r\n * Please note that only one query can be issued at a time\r\n * @returns a time token used to track the time span\r\n */\r\n startTimeQuery(): Nullable<_TimeToken>;\r\n\r\n /**\r\n * Ends a time query\r\n * @param token defines the token used to measure the time span\r\n * @returns the time spent (in ns)\r\n */\r\n endTimeQuery(token: _TimeToken): int;\r\n\r\n /**\r\n * Get the performance counter associated with the frame time computation\r\n * @returns the perf counter\r\n */\r\n getGPUFrameTimeCounter(): PerfCounter;\r\n\r\n /**\r\n * Enable or disable the GPU frame time capture\r\n * @param value True to enable, false to disable\r\n */\r\n captureGPUFrameTime(value: boolean): void;\r\n\r\n /** @hidden */\r\n _currentNonTimestampToken: Nullable<_TimeToken>;\r\n /** @hidden */\r\n _captureGPUFrameTime: boolean;\r\n /** @hidden */\r\n _gpuFrameTimeToken: Nullable<_TimeToken>;\r\n /** @hidden */\r\n _gpuFrameTime: PerfCounter;\r\n /** @hidden */\r\n _onBeginFrameObserver: Nullable<Observer<Engine>>;\r\n /** @hidden */\r\n _onEndFrameObserver: Nullable<Observer<Engine>>;\r\n\r\n /** @hidden */\r\n _createTimeQuery(): WebGLQuery;\r\n\r\n /** @hidden */\r\n _deleteTimeQuery(query: WebGLQuery): void;\r\n\r\n /** @hidden */\r\n _getGlAlgorithmType(algorithmType: number): number;\r\n\r\n /** @hidden */\r\n _getTimeQueryResult(query: WebGLQuery): any;\r\n\r\n /** @hidden */\r\n _getTimeQueryAvailability(query: WebGLQuery): any;\r\n }\r\n}\r\n\r\nEngine.prototype.createQuery = function (): OcclusionQuery {\r\n const query = this._gl.createQuery();\r\n if (!query) {\r\n throw new Error(\"Unable to create Occlusion Query\");\r\n }\r\n return query;\r\n};\r\n\r\nEngine.prototype.deleteQuery = function (query: OcclusionQuery): Engine {\r\n this._gl.deleteQuery(query);\r\n\r\n return this;\r\n};\r\n\r\nEngine.prototype.isQueryResultAvailable = function (query: OcclusionQuery): boolean {\r\n return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT_AVAILABLE) as boolean;\r\n};\r\n\r\nEngine.prototype.getQueryResult = function (query: OcclusionQuery): number {\r\n return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT) as number;\r\n};\r\n\r\nEngine.prototype.beginOcclusionQuery = function (algorithmType: number, query: OcclusionQuery): boolean {\r\n const glAlgorithm = this._getGlAlgorithmType(algorithmType);\r\n this._gl.beginQuery(glAlgorithm, query);\r\n\r\n return true;\r\n};\r\n\r\nEngine.prototype.endOcclusionQuery = function (algorithmType: number): Engine {\r\n const glAlgorithm = this._getGlAlgorithmType(algorithmType);\r\n this._gl.endQuery(glAlgorithm);\r\n\r\n return this;\r\n};\r\n\r\nEngine.prototype._createTimeQuery = function (): WebGLQuery {\r\n const timerQuery = <EXT_disjoint_timer_query>this.getCaps().timerQuery;\r\n\r\n if (timerQuery.createQueryEXT) {\r\n return timerQuery.createQueryEXT();\r\n }\r\n\r\n return this.createQuery();\r\n};\r\n\r\nEngine.prototype._deleteTimeQuery = function (query: WebGLQuery): void {\r\n const timerQuery = <EXT_disjoint_timer_query>this.getCaps().timerQuery;\r\n\r\n if (timerQuery.deleteQueryEXT) {\r\n timerQuery.deleteQueryEXT(query);\r\n return;\r\n }\r\n\r\n this.deleteQuery(query);\r\n};\r\n\r\nEngine.prototype._getTimeQueryResult = function (query: WebGLQuery): any {\r\n const timerQuery = <EXT_disjoint_timer_query>this.getCaps().timerQuery;\r\n\r\n if (timerQuery.getQueryObjectEXT) {\r\n return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_EXT);\r\n }\r\n return this.getQueryResult(query);\r\n};\r\n\r\nEngine.prototype._getTimeQueryAvailability = function (query: WebGLQuery): any {\r\n const timerQuery = <EXT_disjoint_timer_query>this.getCaps().timerQuery;\r\n\r\n if (timerQuery.getQueryObjectEXT) {\r\n return timerQuery.getQueryObjectEXT(query, timerQuery.QUERY_RESULT_AVAILABLE_EXT);\r\n }\r\n return this.isQueryResultAvailable(query);\r\n};\r\n\r\nEngine.prototype.startTimeQuery = function (): Nullable<_TimeToken> {\r\n const caps = this.getCaps();\r\n const timerQuery = caps.timerQuery;\r\n if (!timerQuery) {\r\n return null;\r\n }\r\n\r\n const token = new _TimeToken();\r\n this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT);\r\n if (caps.canUseTimestampForTimerQuery) {\r\n token._startTimeQuery = this._createTimeQuery();\r\n\r\n timerQuery.queryCounterEXT(token._startTimeQuery, timerQuery.TIMESTAMP_EXT);\r\n } else {\r\n if (this._currentNonTimestampToken) {\r\n return this._currentNonTimestampToken;\r\n }\r\n\r\n token._timeElapsedQuery = this._createTimeQuery();\r\n if (timerQuery.beginQueryEXT) {\r\n timerQuery.beginQueryEXT(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery);\r\n } else {\r\n this._gl.beginQuery(timerQuery.TIME_ELAPSED_EXT, token._timeElapsedQuery);\r\n }\r\n\r\n this._currentNonTimestampToken = token;\r\n }\r\n return token;\r\n};\r\n\r\nEngine.prototype.endTimeQuery = function (token: _TimeToken): int {\r\n const caps = this.getCaps();\r\n const timerQuery = caps.timerQuery;\r\n if (!timerQuery || !token) {\r\n return -1;\r\n }\r\n\r\n if (caps.canUseTimestampForTimerQuery) {\r\n if (!token._startTimeQuery) {\r\n return -1;\r\n }\r\n if (!token._endTimeQuery) {\r\n token._endTimeQuery = this._createTimeQuery();\r\n timerQuery.queryCounterEXT(token._endTimeQuery, timerQuery.TIMESTAMP_EXT);\r\n }\r\n } else if (!token._timeElapsedQueryEnded) {\r\n if (!token._timeElapsedQuery) {\r\n return -1;\r\n }\r\n if (timerQuery.endQueryEXT) {\r\n timerQuery.endQueryEXT(timerQuery.TIME_ELAPSED_EXT);\r\n } else {\r\n this._gl.endQuery(timerQuery.TIME_ELAPSED_EXT);\r\n this._currentNonTimestampToken = null;\r\n }\r\n token._timeElapsedQueryEnded = true;\r\n }\r\n\r\n const disjoint = this._gl.getParameter(timerQuery.GPU_DISJOINT_EXT);\r\n let available: boolean = false;\r\n if (token._endTimeQuery) {\r\n available = this._getTimeQueryAvailability(token._endTimeQuery);\r\n } else if (token._timeElapsedQuery) {\r\n available = this._getTimeQueryAvailability(token._timeElapsedQuery);\r\n }\r\n\r\n if (available && !disjoint) {\r\n let result = 0;\r\n if (caps.canUseTimestampForTimerQuery) {\r\n if (!token._startTimeQuery || !token._endTimeQuery) {\r\n return -1;\r\n }\r\n const timeStart = this._getTimeQueryResult(token._startTimeQuery);\r\n const timeEnd = this._getTimeQueryResult(token._endTimeQuery);\r\n\r\n result = timeEnd - timeStart;\r\n this._deleteTimeQuery(token._startTimeQuery);\r\n this._deleteTimeQuery(token._endTimeQuery);\r\n token._startTimeQuery = null;\r\n token._endTimeQuery = null;\r\n } else {\r\n if (!token._timeElapsedQuery) {\r\n return -1;\r\n }\r\n\r\n result = this._getTimeQueryResult(token._timeElapsedQuery);\r\n this._deleteTimeQuery(token._timeElapsedQuery);\r\n token._timeElapsedQuery = null;\r\n token._timeElapsedQueryEnded = false;\r\n }\r\n return result;\r\n }\r\n\r\n return -1;\r\n};\r\n\r\nEngine.prototype._captureGPUFrameTime = false;\r\nEngine.prototype._gpuFrameTime = new PerfCounter();\r\n\r\nEngine.prototype.getGPUFrameTimeCounter = function () {\r\n return this._gpuFrameTime;\r\n};\r\n\r\nEngine.prototype.captureGPUFrameTime = function (value: boolean) {\r\n if (value === this._captureGPUFrameTime) {\r\n return;\r\n }\r\n\r\n this._captureGPUFrameTime = value;\r\n\r\n if (value) {\r\n this._onBeginFrameObserver = this.onBeginFrameObservable.add(() => {\r\n if (!this._gpuFrameTimeToken) {\r\n this._gpuFrameTimeToken = this.startTimeQuery();\r\n }\r\n });\r\n\r\n this._onEndFrameObserver = this.onEndFrameObservable.add(() => {\r\n if (!this._gpuFrameTimeToken) {\r\n return;\r\n }\r\n const time = this.endTimeQuery(this._gpuFrameTimeToken);\r\n\r\n if (time > -1) {\r\n this._gpuFrameTimeToken = null;\r\n this._gpuFrameTime.fetchNewFrame();\r\n this._gpuFrameTime.addCount(time, true);\r\n }\r\n });\r\n } else {\r\n this.onBeginFrameObservable.remove(this._onBeginFrameObserver);\r\n this._onBeginFrameObserver = null;\r\n this.onEndFrameObservable.remove(this._onEndFrameObserver);\r\n this._onEndFrameObserver = null;\r\n }\r\n};\r\n\r\nEngine.prototype._getGlAlgorithmType = function (algorithmType: number): number {\r\n return algorithmType === AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;\r\n};\r\n\r\ndeclare module \"../../Meshes/abstractMesh\" {\r\n export interface AbstractMesh {\r\n /**\r\n * Backing filed\r\n * @hidden\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n __occlusionDataStorage: _OcclusionDataStorage;\r\n\r\n /**\r\n * Access property\r\n * @hidden\r\n */\r\n _occlusionDataStorage: _OcclusionDataStorage;\r\n\r\n /**\r\n * This number indicates the number of allowed retries before stop the occlusion query, this is useful if the occlusion query is taking long time before to the query result is retrieved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decides to show or hide the object.\r\n * The default value is -1 which means don't break the query and wait till the result\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n occlusionRetryCount: number;\r\n\r\n /**\r\n * This property is responsible for starting the occlusion query within the Mesh or not, this property is also used to determine what should happen when the occlusionRetryCount is reached. It has supports 3 values:\r\n * * OCCLUSION_TYPE_NONE (Default Value): this option means no occlusion query within the Mesh.\r\n * * OCCLUSION_TYPE_OPTIMISTIC: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken show the mesh.\r\n * * OCCLUSION_TYPE_STRICT: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken restore the last state of the mesh occlusion if the mesh was visible then show the mesh if was hidden then hide don't show.\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n occlusionType: number;\r\n\r\n /**\r\n * This property determines the type of occlusion query algorithm to run in WebGl, you can use:\r\n * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE which is mapped to GL_ANY_SAMPLES_PASSED.\r\n * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE (Default Value) which is mapped to GL_ANY_SAMPLES_PASSED_CONSERVATIVE which is a false positive algorithm that is faster than GL_ANY_SAMPLES_PASSED but less accurate.\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n occlusionQueryAlgorithmType: number;\r\n\r\n /**\r\n * Gets or sets whether the mesh is occluded or not, it is used also to set the initial state of the mesh to be occluded or not\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n isOccluded: boolean;\r\n\r\n /**\r\n * Flag to check the progress status of the query\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n isOcclusionQueryInProgress: boolean;\r\n\r\n /**\r\n * Flag to force rendering the mesh even if occluded\r\n * @see https://doc.babylonjs.com/features/occlusionquery\r\n */\r\n forceRenderingWhenOccluded: boolean;\r\n }\r\n}\r\nObject.defineProperty(AbstractMesh.prototype, \"isOcclusionQueryInProgress\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.isOcclusionQueryInProgress;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.isOcclusionQueryInProgress = value;\r\n },\r\n enumerable: false,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"_occlusionDataStorage\", {\r\n get: function (this: AbstractMesh) {\r\n if (!this.__occlusionDataStorage) {\r\n this.__occlusionDataStorage = new _OcclusionDataStorage();\r\n }\r\n return this.__occlusionDataStorage;\r\n },\r\n enumerable: false,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"isOccluded\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.isOccluded;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.isOccluded = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionQueryAlgorithmType\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionQueryAlgorithmType;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionQueryAlgorithmType = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionType\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionType;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionType = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionRetryCount\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionRetryCount;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionRetryCount = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"forceRenderingWhenOccluded\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.forceRenderingWhenOccluded;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.forceRenderingWhenOccluded = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\n// We also need to update AbstractMesh as there is a portion of the code there\r\nAbstractMesh.prototype._checkOcclusionQuery = function () {\r\n const dataStorage = this._occlusionDataStorage;\r\n\r\n if (dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n const engine = this.getEngine();\r\n\r\n if (!engine.getCaps().supportOcclusionQuery) {\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n if (!engine.isQueryResultAvailable) {\r\n // Occlusion query where not referenced\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n if (this.isOcclusionQueryInProgress && this._occlusionQuery) {\r\n const isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);\r\n if (isOcclusionQueryAvailable) {\r\n const occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);\r\n\r\n dataStorage.isOcclusionQueryInProgress = false;\r\n dataStorage.occlusionInternalRetryCounter = 0;\r\n dataStorage.isOccluded = occlusionQueryResult > 0 ? false : true;\r\n } else {\r\n dataStorage.occlusionInternalRetryCounter++;\r\n\r\n if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {\r\n dataStorage.isOcclusionQueryInProgress = false;\r\n dataStorage.occlusionInternalRetryCounter = 0;\r\n\r\n // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)\r\n // if strict continue the last state of the object.\r\n dataStorage.isOccluded = dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;\r\n } else {\r\n return dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;\r\n }\r\n }\r\n }\r\n\r\n const scene = this.getScene();\r\n if (scene.getBoundingBoxRenderer) {\r\n const occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();\r\n\r\n if (this._occlusionQuery === null) {\r\n this._occlusionQuery = engine.createQuery();\r\n }\r\n\r\n if (engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery)) {\r\n occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);\r\n engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);\r\n this._occlusionDataStorage.isOcclusionQueryInProgress = true;\r\n }\r\n }\r\n\r\n return dataStorage.isOccluded;\r\n};\r\n"]}
@@ -338,6 +338,17 @@ export interface ICanvasRenderingContext {
338
338
  * @returns ICanvasGradient A linear ICanvasGradient initialized with the specified line.
339
339
  */
340
340
  createLinearGradient(x0: number, y0: number, x1: number, y1: number): ICanvasGradient;
341
+ /**
342
+ * Creates a linear gradient along the line given by the coordinates represented by the parameters.
343
+ * @param x0 The x-axis coordinate of the start circle.
344
+ * @param y0 The y-axis coordinate of the start circle.
345
+ * @param r0 The radius of the start circle. Must be non-negative and finite.
346
+ * @param x1 The x-axis coordinate of the end point.
347
+ * @param y1 The y-axis coordinate of the end point.
348
+ * @param r1 The radius of the end circle. Must be non-negative and finite.
349
+ * @returns ICanvasGradient A linear ICanvasGradient initialized with the two specified circles.
350
+ */
351
+ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): ICanvasGradient;
341
352
  /**
342
353
  * Resets the current transform to matrix composed with a, b, c, d, e, f.
343
354
  * @param a Horizontal scaling. A value of 1 results in no scaling.
@@ -1 +1 @@
1
- {"version":3,"file":"ICanvas.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/ICanvas.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Class used to abstract a canvas\r\n */\r\nexport interface ICanvas {\r\n /**\r\n * Canvas width.\r\n */\r\n width: number;\r\n\r\n /**\r\n * Canvas height.\r\n */\r\n height: number;\r\n\r\n /**\r\n * returns a drawing context on the canvas.\r\n * @param contextType context identifier.\r\n * @param contextAttributes context attributes.\r\n * @returns ICanvasRenderingContext object.\r\n */\r\n getContext(contextType: string, contextAttributes?: any): ICanvasRenderingContext;\r\n\r\n /**\r\n * returns a data URI containing a representation of the image in the format specified by the type parameter.\r\n * @param mime the image format.\r\n * @returns string containing the requested data URI.\r\n */\r\n toDataURL(mime: string): string;\r\n}\r\n\r\n/**\r\n * Class used to abstract am image to use with the canvas and its context\r\n */\r\nexport interface IImage {\r\n /**\r\n * onload callback.\r\n */\r\n onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;\r\n\r\n /**\r\n * Error callback.\r\n */\r\n onerror: ((this: GlobalEventHandlers, ev: Event) => any) | null;\r\n\r\n /**\r\n * Image source.\r\n */\r\n src: string;\r\n\r\n /**\r\n * Image width.\r\n */\r\n readonly width: number;\r\n\r\n /**\r\n * Image height.\r\n */\r\n readonly height: number;\r\n\r\n /**\r\n * The original height of the image resource before sizing.\r\n */\r\n readonly naturalHeight: number;\r\n\r\n /**\r\n * The original width of the image resource before sizing.\r\n */\r\n readonly naturalWidth: number;\r\n\r\n /**\r\n * provides support for CORS, defining how the element handles crossorigin requests,\r\n * thereby enabling the configuration of the CORS requests for the element's fetched data.\r\n */\r\n crossOrigin: string | null;\r\n\r\n /**\r\n * provides support for referrer policy on xhr load request,\r\n * it is used to control the request header.\r\n */\r\n referrerPolicy: string;\r\n}\r\n\r\n/**\r\n * Class used to abstract a canvas gradient\r\n */\r\nexport interface ICanvasGradient {\r\n /**\r\n * adds a new color stop, defined by an offset and a color, to a given canvas gradient.\r\n * @param offset A number between 0 and 1, inclusive, representing the position of the color stop. 0 represents the start of the gradient and 1 represents the end.\r\n * @param color value representing the color of the stop.\r\n */\r\n addColorStop(offset: number, color: string): void;\r\n}\r\n\r\n/**\r\n * Class used to abstract a text measurement\r\n */\r\nexport interface ITextMetrics {\r\n /**\r\n * Text width.\r\n */\r\n readonly width: number;\r\n /**\r\n * distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign\r\n * property to the left side of the bounding rectangle of the given text\r\n */\r\n readonly actualBoundingBoxLeft: number;\r\n /**\r\n * distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign\r\n * property to the right side of the bounding rectangle of the given text\r\n */\r\n readonly actualBoundingBoxRight: number;\r\n}\r\n\r\n/**\r\n * Class used to abstract canvas rendering\r\n */\r\nexport interface ICanvasRenderingContext {\r\n /**\r\n * Defines the type of corners where two lines meet. Possible values: round, bevel, miter (default).\r\n */\r\n lineJoin: string;\r\n\r\n /**\r\n * Miter limit ratio. Default 10.\r\n */\r\n miterLimit: number;\r\n\r\n /**\r\n * Font setting. Default value 10px sans-serif.\r\n */\r\n font: string;\r\n\r\n /**\r\n * Color or style to use for the lines around shapes. Default #000 (black).\r\n */\r\n strokeStyle: string;\r\n\r\n /**\r\n * Color or style to use inside shapes. Default #000 (black).\r\n */\r\n fillStyle: string | ICanvasGradient;\r\n\r\n /**\r\n * Alpha value that is applied to shapes and images before they are composited onto the canvas. Default 1.0 (opaque).\r\n */\r\n globalAlpha: number;\r\n\r\n /**\r\n * Color of the shadow. Default: fully-transparent black.\r\n */\r\n shadowColor: string;\r\n\r\n /**\r\n * Specifies the blurring effect. Default: 0.\r\n */\r\n shadowBlur: number;\r\n\r\n /**\r\n * Horizontal distance the shadow will be offset. Default: 0.\r\n */\r\n shadowOffsetX: number;\r\n\r\n /**\r\n * Vertical distance the shadow will be offset. Default: 0.\r\n */\r\n shadowOffsetY: number;\r\n\r\n /**\r\n * Width of lines. Default 1.0.\r\n */\r\n lineWidth: number;\r\n\r\n /**\r\n * canvas is a read-only reference to ICanvas.\r\n */\r\n readonly canvas: ICanvas;\r\n\r\n /**\r\n * Sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n clearRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Saves the current drawing style state using a stack so you can revert any change you make to it using restore().\r\n */\r\n save(): void;\r\n\r\n /**\r\n * Restores the drawing style state to the last element on the 'state stack' saved by save().\r\n */\r\n restore(): void;\r\n\r\n /**\r\n * Draws a filled rectangle at (x, y) position whose size is determined by width and height.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n fillRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Adds a scaling transformation to the canvas units by x horizontally and by y vertically.\r\n * @param x Scaling factor in the horizontal direction. A negative value flips pixels across the vertical axis. A value of 1 results in no horizontal scaling.\r\n * @param y Scaling factor in the vertical direction. A negative value flips pixels across the horizontal axis. A value of 1 results in no vertical scaling.\r\n */\r\n scale(x: number, y: number): void;\r\n\r\n /**\r\n * Adds a rotation to the transformation matrix. The angle argument represents a clockwise rotation angle and is expressed in radians.\r\n * @param angle The rotation angle, clockwise in radians. You can use degree * Math.PI / 180 to calculate a radian from a degree.\r\n */\r\n rotate(angle: number): void;\r\n\r\n /**\r\n * Adds a translation transformation by moving the canvas and its origin x horizontally and y vertically on the grid.\r\n * @param x Distance to move in the horizontal direction. Positive values are to the right, and negative to the left.\r\n * @param y Distance to move in the vertical direction. Positive values are down, and negative are up.\r\n */\r\n translate(x: number, y: number): void;\r\n\r\n /**\r\n * Paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n strokeRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Creates a path for a rectangle at position (x, y) with a size that is determined by width and height.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n rect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the clipping path only.\r\n */\r\n clip(): void;\r\n\r\n /**\r\n * Paints data from the given ImageData object onto the bitmap. If a dirty rectangle is provided, only the pixels from that rectangle are painted.\r\n * @param imageData An ImageData object containing the array of pixel values.\r\n * @param dx Horizontal position (x coordinate) at which to place the image data in the destination canvas.\r\n * @param dy Vertical position (y coordinate) at which to place the image data in the destination canvas.\r\n */\r\n putImageData(imageData: ImageData, dx: number, dy: number): void;\r\n\r\n /**\r\n * Adds a circular arc to the current path.\r\n * @param x The horizontal coordinate of the arc's center.\r\n * @param y The vertical coordinate of the arc's center.\r\n * @param radius The arc's radius. Must be positive.\r\n * @param startAngle The angle at which the arc starts in radians, measured from the positive x-axis.\r\n * @param endAngle The angle at which the arc ends in radians, measured from the positive x-axis.\r\n * @param anticlockwise An optional Boolean. If true, draws the arc counter-clockwise between the start and end angles. The default is false (clockwise).\r\n */\r\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\r\n\r\n /**\r\n * Starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path.\r\n */\r\n beginPath(): void;\r\n\r\n /**\r\n * Causes the point of the pen to move back to the start of the current sub-path. It tries to draw a straight line from the current point to the start.\r\n * If the shape has already been closed or has only one point, this function does nothing.\r\n */\r\n closePath(): void;\r\n\r\n /**\r\n * Moves the starting point of a new sub-path to the (x, y) coordinates.\r\n * @param x The x-axis (horizontal) coordinate of the point.\r\n * @param y The y-axis (vertical) coordinate of the point.\r\n */\r\n moveTo(x: number, y: number): void;\r\n\r\n /**\r\n * Connects the last point in the current sub-path to the specified (x, y) coordinates with a straight line.\r\n * @param x The x-axis coordinate of the line's end point.\r\n * @param y The y-axis coordinate of the line's end point.\r\n */\r\n lineTo(x: number, y: number): void;\r\n\r\n /**\r\n * Adds a quadratic Bézier curve to the current path.\r\n * @param cpx The x-axis coordinate of the control point.\r\n * @param cpy The y-axis coordinate of the control point.\r\n * @param x The x-axis coordinate of the end point.\r\n * @param y The y-axis coordinate of the end point.\r\n */\r\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\r\n\r\n /**\r\n * Returns a TextMetrics object.\r\n * @param text The text String to measure.\r\n * @returns ITextMetrics A ITextMetrics object.\r\n */\r\n measureText(text: string): ITextMetrics;\r\n\r\n /**\r\n * Strokes the current sub-paths with the current stroke style.\r\n */\r\n stroke(): void;\r\n\r\n /**\r\n * Fills the current sub-paths with the current fill style.\r\n */\r\n fill(): void;\r\n\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param sx The x-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.\r\n * @param sy The y-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.\r\n * @param sWidth The width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.\r\n * @param sHeight The height of the sub-rectangle of the source image to draw into the destination context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.\r\n * @param dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.\r\n */\r\n\r\n drawImage(image: any, sx: number, sy: number, sWidth: number, sHeight: number, dx: number, dy: number, dWidth: number, dHeight: number): void;\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.\r\n * @param dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.\r\n */\r\n drawImage(image: any, dx: number, dy: number, dWidth: number, dHeight: number): void;\r\n\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n */\r\n drawImage(image: any, dx: number, dy: number): void;\r\n\r\n /**\r\n * Returns an ImageData object representing the underlying pixel data for the area of the canvas denoted by the rectangle which starts at (sx, sy) and has an sw width and sh height.\r\n * @param sx The x-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted.\r\n * @param sy The y-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted.\r\n * @param sw The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left.\r\n * @param sh The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up.\r\n * @returns ImageData An ImageData object containing the image data for the rectangle of the canvas specified.\r\n */\r\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\r\n\r\n /**\r\n * Sets the current line dash pattern.\r\n * @param segments An Array of numbers that specify distances to alternately draw a line and a gap (in coordinate space units).\r\n */\r\n setLineDash(segments: Array<number>): void;\r\n\r\n /**\r\n * Draws (fills) a given text at the given (x, y) position.\r\n * @param text A String specifying the text string to render into the context. The text is rendered using the settings specified by font, textAlign, textBaseline, and direction.\r\n * @param x The x-axis coordinate of the point at which to begin drawing the text, in pixels.\r\n * @param y The y-axis coordinate of the baseline on which to begin drawing the text, in pixels.\r\n * @param maxWidth The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text.\r\n */\r\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\r\n\r\n /**\r\n * Draws (strokes) a given text at the given (x, y) position.\r\n * @param text A String specifying the text string to render into the context. The text is rendered using the settings specified by font, textAlign, textBaseline, and direction.\r\n * @param x The x-axis coordinate of the point at which to begin drawing the text, in pixels.\r\n * @param y The y-axis coordinate of the baseline on which to begin drawing the text, in pixels.\r\n * @param maxWidth The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text.\r\n */\r\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\r\n\r\n /**\r\n * Creates a linear gradient along the line given by the coordinates represented by the parameters.\r\n * @param x0 The x-axis coordinate of the start point.\r\n * @param y0 The y-axis coordinate of the start point.\r\n * @param x1 The x-axis coordinate of the end point.\r\n * @param y1 The y-axis coordinate of the end point.\r\n * @returns ICanvasGradient A linear ICanvasGradient initialized with the specified line.\r\n */\r\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): ICanvasGradient;\r\n\r\n /**\r\n * Resets the current transform to matrix composed with a, b, c, d, e, f.\r\n * @param a Horizontal scaling. A value of 1 results in no scaling.\r\n * @param b Vertical skewing.\r\n * @param c Horizontal skewing.\r\n * @param d Vertical scaling. A value of 1 results in no scaling.\r\n * @param e Horizontal translation (moving).\r\n * @param f Vertical translation (moving).\r\n */\r\n setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"ICanvas.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/ICanvas.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Class used to abstract a canvas\r\n */\r\nexport interface ICanvas {\r\n /**\r\n * Canvas width.\r\n */\r\n width: number;\r\n\r\n /**\r\n * Canvas height.\r\n */\r\n height: number;\r\n\r\n /**\r\n * returns a drawing context on the canvas.\r\n * @param contextType context identifier.\r\n * @param contextAttributes context attributes.\r\n * @returns ICanvasRenderingContext object.\r\n */\r\n getContext(contextType: string, contextAttributes?: any): ICanvasRenderingContext;\r\n\r\n /**\r\n * returns a data URI containing a representation of the image in the format specified by the type parameter.\r\n * @param mime the image format.\r\n * @returns string containing the requested data URI.\r\n */\r\n toDataURL(mime: string): string;\r\n}\r\n\r\n/**\r\n * Class used to abstract am image to use with the canvas and its context\r\n */\r\nexport interface IImage {\r\n /**\r\n * onload callback.\r\n */\r\n onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;\r\n\r\n /**\r\n * Error callback.\r\n */\r\n onerror: ((this: GlobalEventHandlers, ev: Event) => any) | null;\r\n\r\n /**\r\n * Image source.\r\n */\r\n src: string;\r\n\r\n /**\r\n * Image width.\r\n */\r\n readonly width: number;\r\n\r\n /**\r\n * Image height.\r\n */\r\n readonly height: number;\r\n\r\n /**\r\n * The original height of the image resource before sizing.\r\n */\r\n readonly naturalHeight: number;\r\n\r\n /**\r\n * The original width of the image resource before sizing.\r\n */\r\n readonly naturalWidth: number;\r\n\r\n /**\r\n * provides support for CORS, defining how the element handles crossorigin requests,\r\n * thereby enabling the configuration of the CORS requests for the element's fetched data.\r\n */\r\n crossOrigin: string | null;\r\n\r\n /**\r\n * provides support for referrer policy on xhr load request,\r\n * it is used to control the request header.\r\n */\r\n referrerPolicy: string;\r\n}\r\n\r\n/**\r\n * Class used to abstract a canvas gradient\r\n */\r\nexport interface ICanvasGradient {\r\n /**\r\n * adds a new color stop, defined by an offset and a color, to a given canvas gradient.\r\n * @param offset A number between 0 and 1, inclusive, representing the position of the color stop. 0 represents the start of the gradient and 1 represents the end.\r\n * @param color value representing the color of the stop.\r\n */\r\n addColorStop(offset: number, color: string): void;\r\n}\r\n\r\n/**\r\n * Class used to abstract a text measurement\r\n */\r\nexport interface ITextMetrics {\r\n /**\r\n * Text width.\r\n */\r\n readonly width: number;\r\n /**\r\n * distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign\r\n * property to the left side of the bounding rectangle of the given text\r\n */\r\n readonly actualBoundingBoxLeft: number;\r\n /**\r\n * distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign\r\n * property to the right side of the bounding rectangle of the given text\r\n */\r\n readonly actualBoundingBoxRight: number;\r\n}\r\n\r\n/**\r\n * Class used to abstract canvas rendering\r\n */\r\nexport interface ICanvasRenderingContext {\r\n /**\r\n * Defines the type of corners where two lines meet. Possible values: round, bevel, miter (default).\r\n */\r\n lineJoin: string;\r\n\r\n /**\r\n * Miter limit ratio. Default 10.\r\n */\r\n miterLimit: number;\r\n\r\n /**\r\n * Font setting. Default value 10px sans-serif.\r\n */\r\n font: string;\r\n\r\n /**\r\n * Color or style to use for the lines around shapes. Default #000 (black).\r\n */\r\n strokeStyle: string;\r\n\r\n /**\r\n * Color or style to use inside shapes. Default #000 (black).\r\n */\r\n fillStyle: string | ICanvasGradient;\r\n\r\n /**\r\n * Alpha value that is applied to shapes and images before they are composited onto the canvas. Default 1.0 (opaque).\r\n */\r\n globalAlpha: number;\r\n\r\n /**\r\n * Color of the shadow. Default: fully-transparent black.\r\n */\r\n shadowColor: string;\r\n\r\n /**\r\n * Specifies the blurring effect. Default: 0.\r\n */\r\n shadowBlur: number;\r\n\r\n /**\r\n * Horizontal distance the shadow will be offset. Default: 0.\r\n */\r\n shadowOffsetX: number;\r\n\r\n /**\r\n * Vertical distance the shadow will be offset. Default: 0.\r\n */\r\n shadowOffsetY: number;\r\n\r\n /**\r\n * Width of lines. Default 1.0.\r\n */\r\n lineWidth: number;\r\n\r\n /**\r\n * canvas is a read-only reference to ICanvas.\r\n */\r\n readonly canvas: ICanvas;\r\n\r\n /**\r\n * Sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n clearRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Saves the current drawing style state using a stack so you can revert any change you make to it using restore().\r\n */\r\n save(): void;\r\n\r\n /**\r\n * Restores the drawing style state to the last element on the 'state stack' saved by save().\r\n */\r\n restore(): void;\r\n\r\n /**\r\n * Draws a filled rectangle at (x, y) position whose size is determined by width and height.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n fillRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Adds a scaling transformation to the canvas units by x horizontally and by y vertically.\r\n * @param x Scaling factor in the horizontal direction. A negative value flips pixels across the vertical axis. A value of 1 results in no horizontal scaling.\r\n * @param y Scaling factor in the vertical direction. A negative value flips pixels across the horizontal axis. A value of 1 results in no vertical scaling.\r\n */\r\n scale(x: number, y: number): void;\r\n\r\n /**\r\n * Adds a rotation to the transformation matrix. The angle argument represents a clockwise rotation angle and is expressed in radians.\r\n * @param angle The rotation angle, clockwise in radians. You can use degree * Math.PI / 180 to calculate a radian from a degree.\r\n */\r\n rotate(angle: number): void;\r\n\r\n /**\r\n * Adds a translation transformation by moving the canvas and its origin x horizontally and y vertically on the grid.\r\n * @param x Distance to move in the horizontal direction. Positive values are to the right, and negative to the left.\r\n * @param y Distance to move in the vertical direction. Positive values are down, and negative are up.\r\n */\r\n translate(x: number, y: number): void;\r\n\r\n /**\r\n * Paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n strokeRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Creates a path for a rectangle at position (x, y) with a size that is determined by width and height.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n rect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the clipping path only.\r\n */\r\n clip(): void;\r\n\r\n /**\r\n * Paints data from the given ImageData object onto the bitmap. If a dirty rectangle is provided, only the pixels from that rectangle are painted.\r\n * @param imageData An ImageData object containing the array of pixel values.\r\n * @param dx Horizontal position (x coordinate) at which to place the image data in the destination canvas.\r\n * @param dy Vertical position (y coordinate) at which to place the image data in the destination canvas.\r\n */\r\n putImageData(imageData: ImageData, dx: number, dy: number): void;\r\n\r\n /**\r\n * Adds a circular arc to the current path.\r\n * @param x The horizontal coordinate of the arc's center.\r\n * @param y The vertical coordinate of the arc's center.\r\n * @param radius The arc's radius. Must be positive.\r\n * @param startAngle The angle at which the arc starts in radians, measured from the positive x-axis.\r\n * @param endAngle The angle at which the arc ends in radians, measured from the positive x-axis.\r\n * @param anticlockwise An optional Boolean. If true, draws the arc counter-clockwise between the start and end angles. The default is false (clockwise).\r\n */\r\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\r\n\r\n /**\r\n * Starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path.\r\n */\r\n beginPath(): void;\r\n\r\n /**\r\n * Causes the point of the pen to move back to the start of the current sub-path. It tries to draw a straight line from the current point to the start.\r\n * If the shape has already been closed or has only one point, this function does nothing.\r\n */\r\n closePath(): void;\r\n\r\n /**\r\n * Moves the starting point of a new sub-path to the (x, y) coordinates.\r\n * @param x The x-axis (horizontal) coordinate of the point.\r\n * @param y The y-axis (vertical) coordinate of the point.\r\n */\r\n moveTo(x: number, y: number): void;\r\n\r\n /**\r\n * Connects the last point in the current sub-path to the specified (x, y) coordinates with a straight line.\r\n * @param x The x-axis coordinate of the line's end point.\r\n * @param y The y-axis coordinate of the line's end point.\r\n */\r\n lineTo(x: number, y: number): void;\r\n\r\n /**\r\n * Adds a quadratic Bézier curve to the current path.\r\n * @param cpx The x-axis coordinate of the control point.\r\n * @param cpy The y-axis coordinate of the control point.\r\n * @param x The x-axis coordinate of the end point.\r\n * @param y The y-axis coordinate of the end point.\r\n */\r\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\r\n\r\n /**\r\n * Returns a TextMetrics object.\r\n * @param text The text String to measure.\r\n * @returns ITextMetrics A ITextMetrics object.\r\n */\r\n measureText(text: string): ITextMetrics;\r\n\r\n /**\r\n * Strokes the current sub-paths with the current stroke style.\r\n */\r\n stroke(): void;\r\n\r\n /**\r\n * Fills the current sub-paths with the current fill style.\r\n */\r\n fill(): void;\r\n\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param sx The x-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.\r\n * @param sy The y-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.\r\n * @param sWidth The width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.\r\n * @param sHeight The height of the sub-rectangle of the source image to draw into the destination context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.\r\n * @param dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.\r\n */\r\n\r\n drawImage(image: any, sx: number, sy: number, sWidth: number, sHeight: number, dx: number, dy: number, dWidth: number, dHeight: number): void;\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.\r\n * @param dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.\r\n */\r\n drawImage(image: any, dx: number, dy: number, dWidth: number, dHeight: number): void;\r\n\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n */\r\n drawImage(image: any, dx: number, dy: number): void;\r\n\r\n /**\r\n * Returns an ImageData object representing the underlying pixel data for the area of the canvas denoted by the rectangle which starts at (sx, sy) and has an sw width and sh height.\r\n * @param sx The x-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted.\r\n * @param sy The y-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted.\r\n * @param sw The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left.\r\n * @param sh The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up.\r\n * @returns ImageData An ImageData object containing the image data for the rectangle of the canvas specified.\r\n */\r\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\r\n\r\n /**\r\n * Sets the current line dash pattern.\r\n * @param segments An Array of numbers that specify distances to alternately draw a line and a gap (in coordinate space units).\r\n */\r\n setLineDash(segments: Array<number>): void;\r\n\r\n /**\r\n * Draws (fills) a given text at the given (x, y) position.\r\n * @param text A String specifying the text string to render into the context. The text is rendered using the settings specified by font, textAlign, textBaseline, and direction.\r\n * @param x The x-axis coordinate of the point at which to begin drawing the text, in pixels.\r\n * @param y The y-axis coordinate of the baseline on which to begin drawing the text, in pixels.\r\n * @param maxWidth The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text.\r\n */\r\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\r\n\r\n /**\r\n * Draws (strokes) a given text at the given (x, y) position.\r\n * @param text A String specifying the text string to render into the context. The text is rendered using the settings specified by font, textAlign, textBaseline, and direction.\r\n * @param x The x-axis coordinate of the point at which to begin drawing the text, in pixels.\r\n * @param y The y-axis coordinate of the baseline on which to begin drawing the text, in pixels.\r\n * @param maxWidth The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text.\r\n */\r\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\r\n\r\n /**\r\n * Creates a linear gradient along the line given by the coordinates represented by the parameters.\r\n * @param x0 The x-axis coordinate of the start point.\r\n * @param y0 The y-axis coordinate of the start point.\r\n * @param x1 The x-axis coordinate of the end point.\r\n * @param y1 The y-axis coordinate of the end point.\r\n * @returns ICanvasGradient A linear ICanvasGradient initialized with the specified line.\r\n */\r\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): ICanvasGradient;\r\n\r\n /**\r\n * Creates a linear gradient along the line given by the coordinates represented by the parameters.\r\n * @param x0 The x-axis coordinate of the start circle.\r\n * @param y0 The y-axis coordinate of the start circle.\r\n * @param r0 The radius of the start circle. Must be non-negative and finite.\r\n * @param x1 The x-axis coordinate of the end point.\r\n * @param y1 The y-axis coordinate of the end point.\r\n * @param r1 The radius of the end circle. Must be non-negative and finite.\r\n * @returns ICanvasGradient A linear ICanvasGradient initialized with the two specified circles.\r\n */\r\n createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): ICanvasGradient;\r\n\r\n /**\r\n * Resets the current transform to matrix composed with a, b, c, d, e, f.\r\n * @param a Horizontal scaling. A value of 1 results in no scaling.\r\n * @param b Vertical skewing.\r\n * @param c Horizontal skewing.\r\n * @param d Vertical scaling. A value of 1 results in no scaling.\r\n * @param e Horizontal translation (moving).\r\n * @param f Vertical translation (moving).\r\n */\r\n setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;\r\n}\r\n"]}
@@ -19,6 +19,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
19
19
  fragmentCompilationError: Nullable<string>;
20
20
  programLinkError: Nullable<string>;
21
21
  programValidationError: Nullable<string>;
22
+ constructor();
22
23
  get isAsync(): boolean;
23
24
  get isReady(): boolean;
24
25
  _handlesSpectorRebuildCallback(onCompiled: (program: WebGLProgram) => void): void;
@@ -39,6 +40,15 @@ export declare class WebGLPipelineContext implements IPipelineContext {
39
40
  * @hidden
40
41
  */
41
42
  _cacheMatrix(uniformName: string, matrix: IMatrixLike): boolean;
43
+ /**
44
+ * @param _uniformName
45
+ * @param _x
46
+ * @param _y
47
+ * @param _z
48
+ * @param _w
49
+ * @hidden
50
+ */
51
+ _cacheFloatN(_uniformName: string, _x: number, _y?: number, _z?: number, _w?: number): boolean;
42
52
  /**
43
53
  * @param uniformName
44
54
  * @param x
@@ -68,14 +78,14 @@ export declare class WebGLPipelineContext implements IPipelineContext {
68
78
  * @param uniformName Name of the variable.
69
79
  * @param value Value to be set.
70
80
  */
71
- setInt(uniformName: string, value: number): void;
81
+ setInt: (uniformName: string, value: number) => void;
72
82
  /**
73
83
  * Sets a int2 on a uniform variable.
74
84
  * @param uniformName Name of the variable.
75
85
  * @param x First int in int2.
76
86
  * @param y Second int in int2.
77
87
  */
78
- setInt2(uniformName: string, x: number, y: number): void;
88
+ setInt2: (uniformName: string, x: number, y: number) => void;
79
89
  /**
80
90
  * Sets a int3 on a uniform variable.
81
91
  * @param uniformName Name of the variable.
@@ -83,7 +93,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
83
93
  * @param y Second int in int3.
84
94
  * @param z Third int in int3.
85
95
  */
86
- setInt3(uniformName: string, x: number, y: number, z: number): void;
96
+ setInt3: (uniformName: string, x: number, y: number, z: number) => void;
87
97
  /**
88
98
  * Sets a int4 on a uniform variable.
89
99
  * @param uniformName Name of the variable.
@@ -92,62 +102,62 @@ export declare class WebGLPipelineContext implements IPipelineContext {
92
102
  * @param z Third int in int4.
93
103
  * @param w Fourth int in int4.
94
104
  */
95
- setInt4(uniformName: string, x: number, y: number, z: number, w: number): void;
105
+ setInt4: (uniformName: string, x: number, y: number, z: number, w: number) => void;
96
106
  /**
97
107
  * Sets an int array on a uniform variable.
98
108
  * @param uniformName Name of the variable.
99
109
  * @param array array to be set.
100
110
  */
101
- setIntArray(uniformName: string, array: Int32Array): void;
111
+ setIntArray: (uniformName: string, array: Int32Array) => void;
102
112
  /**
103
113
  * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
104
114
  * @param uniformName Name of the variable.
105
115
  * @param array array to be set.
106
116
  */
107
- setIntArray2(uniformName: string, array: Int32Array): void;
117
+ setIntArray2: (uniformName: string, array: Int32Array) => void;
108
118
  /**
109
119
  * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
110
120
  * @param uniformName Name of the variable.
111
121
  * @param array array to be set.
112
122
  */
113
- setIntArray3(uniformName: string, array: Int32Array): void;
123
+ setIntArray3: (uniformName: string, array: Int32Array) => void;
114
124
  /**
115
125
  * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
116
126
  * @param uniformName Name of the variable.
117
127
  * @param array array to be set.
118
128
  */
119
- setIntArray4(uniformName: string, array: Int32Array): void;
129
+ setIntArray4: (uniformName: string, array: Int32Array) => void;
120
130
  /**
121
131
  * Sets an array on a uniform variable.
122
132
  * @param uniformName Name of the variable.
123
133
  * @param array array to be set.
124
134
  */
125
- setArray(uniformName: string, array: number[]): void;
135
+ setArray: (uniformName: string, array: number[]) => void;
126
136
  /**
127
137
  * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
128
138
  * @param uniformName Name of the variable.
129
139
  * @param array array to be set.
130
140
  */
131
- setArray2(uniformName: string, array: number[]): void;
141
+ setArray2: (uniformName: string, array: number[]) => void;
132
142
  /**
133
143
  * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
134
144
  * @param uniformName Name of the variable.
135
145
  * @param array array to be set.
136
146
  * @returns this effect.
137
147
  */
138
- setArray3(uniformName: string, array: number[]): void;
148
+ setArray3: (uniformName: string, array: number[]) => void;
139
149
  /**
140
150
  * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
141
151
  * @param uniformName Name of the variable.
142
152
  * @param array array to be set.
143
153
  */
144
- setArray4(uniformName: string, array: number[]): void;
154
+ setArray4: (uniformName: string, array: number[]) => void;
145
155
  /**
146
156
  * Sets matrices on a uniform variable.
147
157
  * @param uniformName Name of the variable.
148
158
  * @param matrices matrices to be set.
149
159
  */
150
- setMatrices(uniformName: string, matrices: Float32Array): void;
160
+ setMatrices: (uniformName: string, matrices: Float32Array) => void;
151
161
  /**
152
162
  * Sets matrix on a uniform variable.
153
163
  * @param uniformName Name of the variable.
@@ -159,20 +169,20 @@ export declare class WebGLPipelineContext implements IPipelineContext {
159
169
  * @param uniformName Name of the variable.
160
170
  * @param matrix matrix to be set.
161
171
  */
162
- setMatrix3x3(uniformName: string, matrix: Float32Array): void;
172
+ setMatrix3x3: (uniformName: string, matrix: Float32Array) => void;
163
173
  /**
164
174
  * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
165
175
  * @param uniformName Name of the variable.
166
176
  * @param matrix matrix to be set.
167
177
  */
168
- setMatrix2x2(uniformName: string, matrix: Float32Array): void;
178
+ setMatrix2x2: (uniformName: string, matrix: Float32Array) => void;
169
179
  /**
170
180
  * Sets a float on a uniform variable.
171
181
  * @param uniformName Name of the variable.
172
182
  * @param value value to be set.
173
183
  * @returns this effect.
174
184
  */
175
- setFloat(uniformName: string, value: number): void;
185
+ setFloat: (uniformName: string, value: number) => void;
176
186
  /**
177
187
  * Sets a Vector2 on a uniform variable.
178
188
  * @param uniformName Name of the variable.
@@ -185,7 +195,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
185
195
  * @param x First float in float2.
186
196
  * @param y Second float in float2.
187
197
  */
188
- setFloat2(uniformName: string, x: number, y: number): void;
198
+ setFloat2: (uniformName: string, x: number, y: number) => void;
189
199
  /**
190
200
  * Sets a Vector3 on a uniform variable.
191
201
  * @param uniformName Name of the variable.
@@ -199,7 +209,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
199
209
  * @param y Second float in float3.
200
210
  * @param z Third float in float3.
201
211
  */
202
- setFloat3(uniformName: string, x: number, y: number, z: number): void;
212
+ setFloat3: (uniformName: string, x: number, y: number, z: number) => void;
203
213
  /**
204
214
  * Sets a Vector4 on a uniform variable.
205
215
  * @param uniformName Name of the variable.
@@ -221,7 +231,7 @@ export declare class WebGLPipelineContext implements IPipelineContext {
221
231
  * @param w Fourth float in float4.
222
232
  * @returns this effect.
223
233
  */
224
- setFloat4(uniformName: string, x: number, y: number, z: number, w: number): void;
234
+ setFloat4: (uniformName: string, x: number, y: number, z: number, w: number) => void;
225
235
  /**
226
236
  * Sets a Color3 on a uniform variable.
227
237
  * @param uniformName Name of the variable.