@babylonjs/core 8.14.0 → 8.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/AudioV2/abstractAudio/index.js +1 -1
  2. package/AudioV2/abstractAudio/index.js.map +1 -1
  3. package/AudioV2/audioUtils.js +12 -3
  4. package/AudioV2/audioUtils.js.map +1 -1
  5. package/AudioV2/index.js +1 -1
  6. package/AudioV2/index.js.map +1 -1
  7. package/Behaviors/index.js +1 -1
  8. package/Behaviors/index.js.map +1 -1
  9. package/Cameras/index.js +1 -1
  10. package/Cameras/index.js.map +1 -1
  11. package/Culling/index.js +1 -1
  12. package/Culling/index.js.map +1 -1
  13. package/Culling/ray.core.js +2 -2
  14. package/Culling/ray.core.js.map +1 -1
  15. package/Debug/skeletonViewer.d.ts +1 -1
  16. package/Debug/skeletonViewer.js.map +1 -1
  17. package/Engines/Processors/Expressions/index.js +1 -1
  18. package/Engines/Processors/Expressions/index.js.map +1 -1
  19. package/Engines/Processors/index.js +1 -1
  20. package/Engines/Processors/index.js.map +1 -1
  21. package/Engines/abstractEngine.js +2 -2
  22. package/Engines/abstractEngine.js.map +1 -1
  23. package/Engines/engine.d.ts +1 -1
  24. package/Engines/index.js +1 -1
  25. package/Engines/index.js.map +1 -1
  26. package/FlowGraph/Blocks/Data/index.js +3 -3
  27. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  28. package/FlowGraph/Blocks/Execution/index.js +2 -2
  29. package/FlowGraph/Blocks/Execution/index.js.map +1 -1
  30. package/FlowGraph/Blocks/index.js +1 -1
  31. package/FlowGraph/Blocks/index.js.map +1 -1
  32. package/FlowGraph/index.js +2 -2
  33. package/FlowGraph/index.js.map +1 -1
  34. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  35. package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
  36. package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js.map +1 -1
  37. package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
  38. package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
  39. package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
  40. package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
  41. package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js.map +1 -1
  42. package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
  43. package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
  44. package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
  45. package/FrameGraph/Node/Blocks/PostProcesses/fxaaPostProcessBlock.js.map +1 -1
  46. package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.js.map +1 -1
  47. package/FrameGraph/Node/Blocks/PostProcesses/imageProcessingPostProcessBlock.js.map +1 -1
  48. package/FrameGraph/Node/Blocks/PostProcesses/motionBlurPostProcessBlock.js.map +1 -1
  49. package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js.map +1 -1
  50. package/FrameGraph/Node/Blocks/PostProcesses/ssrPostProcessBlock.js.map +1 -1
  51. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  52. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
  53. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -1
  54. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  55. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
  56. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -1
  57. package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js.map +1 -1
  58. package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js.map +1 -1
  59. package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  60. package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  61. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  62. package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
  63. package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
  64. package/FrameGraph/Node/Blocks/cullObjectsBlock.js.map +1 -1
  65. package/FrameGraph/Node/Blocks/elbowBlock.js.map +1 -1
  66. package/FrameGraph/Node/Blocks/executeBlock.js.map +1 -1
  67. package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
  68. package/FrameGraph/Node/Blocks/outputBlock.js.map +1 -1
  69. package/FrameGraph/Node/Blocks/resourceContainerBlock.js.map +1 -1
  70. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  71. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  72. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  73. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
  74. package/FrameGraph/Node/nodeRenderGraphBuildState.js.map +1 -1
  75. package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js.map +1 -1
  76. package/FrameGraph/Passes/cullPass.js.map +1 -1
  77. package/FrameGraph/Passes/pass.js.map +1 -1
  78. package/FrameGraph/Passes/renderPass.js.map +1 -1
  79. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
  80. package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -1
  81. package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -1
  82. package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
  83. package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -1
  84. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -1
  85. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
  86. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  87. package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -1
  88. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -1
  89. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
  90. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
  91. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
  92. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  93. package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js.map +1 -1
  94. package/FrameGraph/Tasks/PostProcesses/fxaaTask.js.map +1 -1
  95. package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js.map +1 -1
  96. package/FrameGraph/Tasks/PostProcesses/motionBlurTask.js.map +1 -1
  97. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  98. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js.map +1 -1
  99. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
  100. package/FrameGraph/Tasks/PostProcesses/ssrTask.js.map +1 -1
  101. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
  102. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  103. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  104. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
  105. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  106. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
  107. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  108. package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -1
  109. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  110. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
  111. package/FrameGraph/frameGraph.js.map +1 -1
  112. package/FrameGraph/frameGraphContext.js.map +1 -1
  113. package/FrameGraph/frameGraphObjectList.js.map +1 -1
  114. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  115. package/FrameGraph/frameGraphRenderTarget.js.map +1 -1
  116. package/FrameGraph/frameGraphTask.js.map +1 -1
  117. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  118. package/FrameGraph/frameGraphTypes.js.map +1 -1
  119. package/FrameGraph/index.js +1 -1
  120. package/FrameGraph/index.js.map +1 -1
  121. package/Layers/thinHighlightLayer.js.map +1 -1
  122. package/Legacy/legacy.js +1 -1
  123. package/Legacy/legacy.js.map +1 -1
  124. package/Lights/index.js +1 -1
  125. package/Lights/index.js.map +1 -1
  126. package/Loading/index.js +1 -1
  127. package/Loading/index.js.map +1 -1
  128. package/Materials/Node/Blocks/index.js +1 -1
  129. package/Materials/Node/Blocks/index.js.map +1 -1
  130. package/Materials/Node/index.js +1 -1
  131. package/Materials/Node/index.js.map +1 -1
  132. package/Materials/Textures/Loaders/index.js +1 -1
  133. package/Materials/Textures/Loaders/index.js.map +1 -1
  134. package/Materials/Textures/index.js +1 -1
  135. package/Materials/Textures/index.js.map +1 -1
  136. package/Materials/index.js +1 -1
  137. package/Materials/index.js.map +1 -1
  138. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  139. package/Maths/index.js +1 -1
  140. package/Maths/index.js.map +1 -1
  141. package/Maths/math.vector.d.ts +0 -4
  142. package/Maths/math.vector.js +1 -13
  143. package/Maths/math.vector.js.map +1 -1
  144. package/Meshes/abstractMesh.hotSpot.js.map +1 -1
  145. package/Meshes/index.js +1 -1
  146. package/Meshes/index.js.map +1 -1
  147. package/Meshes/linesMesh.d.ts +7 -0
  148. package/Meshes/linesMesh.js +13 -0
  149. package/Meshes/linesMesh.js.map +1 -1
  150. package/Meshes/transformNode.d.ts +1 -0
  151. package/Meshes/transformNode.js +10 -2
  152. package/Meshes/transformNode.js.map +1 -1
  153. package/Misc/index.js +1 -1
  154. package/Misc/index.js.map +1 -1
  155. package/Misc/pressureObserverWrapper.js +4 -1
  156. package/Misc/pressureObserverWrapper.js.map +1 -1
  157. package/Misc/snapshotRenderingHelper.js.map +1 -1
  158. package/Misc/thinMinMaxReducer.js.map +1 -1
  159. package/Navigation/index.js +1 -1
  160. package/Navigation/index.js.map +1 -1
  161. package/Particles/IParticleSystem.js.map +1 -1
  162. package/Particles/Node/Blocks/index.d.ts +0 -1
  163. package/Particles/Node/Blocks/index.js +1 -2
  164. package/Particles/Node/Blocks/index.js.map +1 -1
  165. package/Particles/Node/Blocks/particleGradientBlock.d.ts +3 -0
  166. package/Particles/Node/Blocks/particleGradientBlock.js +20 -4
  167. package/Particles/Node/Blocks/particleGradientBlock.js.map +1 -1
  168. package/Particles/Node/Blocks/particleRandomBlock.js +1 -1
  169. package/Particles/Node/Blocks/particleRandomBlock.js.map +1 -1
  170. package/Particles/Node/index.js +1 -1
  171. package/Particles/Node/index.js.map +1 -1
  172. package/Particles/Node/nodeParticleSystemSet.d.ts +2 -2
  173. package/Particles/Node/nodeParticleSystemSet.js +2 -2
  174. package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
  175. package/Particles/baseParticleSystem.js.map +1 -1
  176. package/Particles/gpuParticleSystem.js +5 -0
  177. package/Particles/gpuParticleSystem.js.map +1 -1
  178. package/Particles/index.js +1 -1
  179. package/Particles/index.js.map +1 -1
  180. package/Particles/thinParticleSystem.js.map +1 -1
  181. package/Physics/index.js +1 -1
  182. package/Physics/index.js.map +1 -1
  183. package/Physics/v1/index.js +1 -1
  184. package/Physics/v1/index.js.map +1 -1
  185. package/Physics/v2/index.js +2 -2
  186. package/Physics/v2/index.js.map +1 -1
  187. package/Physics/v2/physicsBody.d.ts +0 -1
  188. package/Physics/v2/physicsBody.js +1 -2
  189. package/Physics/v2/physicsBody.js.map +1 -1
  190. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js.map +1 -1
  191. package/PostProcesses/RenderPipeline/index.js +1 -1
  192. package/PostProcesses/RenderPipeline/index.js.map +1 -1
  193. package/PostProcesses/index.js +1 -1
  194. package/PostProcesses/index.js.map +1 -1
  195. package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -1
  196. package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -1
  197. package/PostProcesses/thinBloomEffect.js.map +1 -1
  198. package/PostProcesses/thinBloomMergePostProcess.js.map +1 -1
  199. package/PostProcesses/thinBlurPostProcess.js.map +1 -1
  200. package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -1
  201. package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -1
  202. package/PostProcesses/thinDepthOfFieldBlurPostProcess.js.map +1 -1
  203. package/PostProcesses/thinDepthOfFieldMergePostProcess.js.map +1 -1
  204. package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -1
  205. package/PostProcesses/thinFXAAPostProcess.js.map +1 -1
  206. package/PostProcesses/thinGrainPostProcess.js.map +1 -1
  207. package/PostProcesses/thinImageProcessingPostProcess.js.map +1 -1
  208. package/PostProcesses/thinMotionBlurPostProcess.js.map +1 -1
  209. package/PostProcesses/thinPassPostProcess.js.map +1 -1
  210. package/PostProcesses/thinSSRBlurCombinerPostProcess.js.map +1 -1
  211. package/PostProcesses/thinSSRBlurPostProcess.js.map +1 -1
  212. package/PostProcesses/thinSSRPostProcess.js.map +1 -1
  213. package/PostProcesses/thinTAAPostProcess.js.map +1 -1
  214. package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +1 -4
  215. package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
  216. package/Rendering/index.js +1 -1
  217. package/Rendering/index.js.map +1 -1
  218. package/Rendering/objectRenderer.js.map +1 -1
  219. package/Sprites/spriteManager.d.ts +6 -1
  220. package/Sprites/spriteManager.js +2 -0
  221. package/Sprites/spriteManager.js.map +1 -1
  222. package/Sprites/spriteSceneComponent.d.ts +14 -0
  223. package/Sprites/spriteSceneComponent.js +23 -0
  224. package/Sprites/spriteSceneComponent.js.map +1 -1
  225. package/XR/index.js +1 -1
  226. package/XR/index.js.map +1 -1
  227. package/index.js +1 -1
  228. package/index.js.map +1 -1
  229. package/package.json +1 -1
  230. package/Particles/Node/Blocks/randomRangeBlock.d.ts +0 -45
  231. package/Particles/Node/Blocks/randomRangeBlock.js +0 -151
  232. package/Particles/Node/Blocks/randomRangeBlock.js.map +0 -1
package/Physics/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* eslint-disable import/no-internal-modules */
1
+ /* eslint-disable @typescript-eslint/no-restricted-imports */
2
2
  export * from "./v1/index.js";
3
3
  export * from "./v2/index.js";
4
4
  export * from "./physicsEngineComponent.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Physics/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./v1/index\";\r\nexport * from \"./v2/index\";\r\nexport * from \"./physicsEngineComponent\";\r\nexport * from \"./v1/physicsEngineComponent\";\r\nexport * from \"./physicsHelper\";\r\nexport * from \"./physicsRaycastResult\";\r\nexport * from \"./proximityCastResult\";\r\nexport * from \"./physicsPointProximityQuery\";\r\nexport * from \"./physicsShapeProximityCastQuery\";\r\nexport * from \"./shapeCastResult\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Physics/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport * from \"./v1/index\";\r\nexport * from \"./v2/index\";\r\nexport * from \"./physicsEngineComponent\";\r\nexport * from \"./v1/physicsEngineComponent\";\r\nexport * from \"./physicsHelper\";\r\nexport * from \"./physicsRaycastResult\";\r\nexport * from \"./proximityCastResult\";\r\nexport * from \"./physicsPointProximityQuery\";\r\nexport * from \"./physicsShapeProximityCastQuery\";\r\nexport * from \"./shapeCastResult\";\r\n"]}
@@ -1,4 +1,4 @@
1
- /* eslint-disable import/no-internal-modules */
1
+ /* eslint-disable @typescript-eslint/no-restricted-imports */
2
2
  export * from "./IPhysicsEnginePlugin.js";
3
3
  export * from "./physicsEngine.js";
4
4
  export * from "./physicsEngineComponent.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v1/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./IPhysicsEnginePlugin\";\r\nexport * from \"./physicsEngine\";\r\nexport * from \"./physicsEngineComponent\";\r\nexport * from \"./physicsImpostor\";\r\nexport * from \"./physicsJoint\";\r\nexport * from \"./Plugins/index\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v1/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport * from \"./IPhysicsEnginePlugin\";\r\nexport * from \"./physicsEngine\";\r\nexport * from \"./physicsEngineComponent\";\r\nexport * from \"./physicsImpostor\";\r\nexport * from \"./physicsJoint\";\r\nexport * from \"./Plugins/index\";\r\n"]}
@@ -1,4 +1,4 @@
1
- /* eslint-disable import/no-internal-modules */
1
+ /* eslint-disable @typescript-eslint/no-restricted-imports */
2
2
  export { PhysicsEngine as PhysicsEngineV2 } from "./physicsEngine.js";
3
3
  export * from "./physicsBody.js";
4
4
  export * from "./physicsShape.js";
@@ -8,6 +8,6 @@ export * from "./physicsAggregate.js";
8
8
  export * from "./ragdoll.js";
9
9
  export * from "./IPhysicsEnginePlugin.js";
10
10
  export * from "./characterController.js";
11
- /* eslint-disable import/no-internal-modules */
11
+ /* eslint-disable @typescript-eslint/no-restricted-imports */
12
12
  export * from "./Plugins/index.js";
13
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v2/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,+CAA+C;AAC/C,cAAc,iBAAiB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport { PhysicsEngine as PhysicsEngineV2 } from \"./physicsEngine\";\r\nexport * from \"./physicsBody\";\r\nexport * from \"./physicsShape\";\r\nexport * from \"./physicsConstraint\";\r\nexport * from \"./physicsMaterial\";\r\nexport * from \"./physicsAggregate\";\r\nexport * from \"./ragdoll\";\r\nexport * from \"./IPhysicsEnginePlugin\";\r\nexport * from \"./characterController\";\r\n/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Plugins/index\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v2/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACnE,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,6DAA6D;AAC7D,cAAc,iBAAiB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport { PhysicsEngine as PhysicsEngineV2 } from \"./physicsEngine\";\r\nexport * from \"./physicsBody\";\r\nexport * from \"./physicsShape\";\r\nexport * from \"./physicsConstraint\";\r\nexport * from \"./physicsMaterial\";\r\nexport * from \"./physicsAggregate\";\r\nexport * from \"./ragdoll\";\r\nexport * from \"./IPhysicsEnginePlugin\";\r\nexport * from \"./characterController\";\r\n/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport * from \"./Plugins/index\";\r\n"]}
@@ -61,7 +61,6 @@ export declare class PhysicsBody {
61
61
  private _nodeDisposeObserver;
62
62
  private _isDisposed;
63
63
  private _shape;
64
- private _motionType;
65
64
  private _prestepType;
66
65
  /**
67
66
  * Constructs a new physics body for the given node.
@@ -74,7 +74,6 @@ export class PhysicsBody {
74
74
  transformNode.rotationQuaternion = Quaternion.FromEulerAngles(transformNode.rotation.x, transformNode.rotation.y, transformNode.rotation.z);
75
75
  }
76
76
  this.startAsleep = startsAsleep;
77
- this._motionType = motionType;
78
77
  // only dynamic and animated body needs sync from physics to transformNode
79
78
  this.disableSync = motionType == 0 /* PhysicsMotionType.STATIC */;
80
79
  // instances?
@@ -136,7 +135,7 @@ export class PhysicsBody {
136
135
  * Get the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.
137
136
  */
138
137
  get motionType() {
139
- return this._motionType;
138
+ return this._physicsPlugin.getMotionType(this);
140
139
  }
141
140
  /**
142
141
  * Sets the shape of the physics body.
@@ -1 +1 @@
1
- {"version":3,"file":"physicsBody.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v2/physicsBody.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAc1E;;;;GAIG;AACH,MAAM,OAAO,WAAW;IA8BpB;;;OAGG;IACH,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,YAAY,IAAI,kBAAkB,CAAC,QAAQ,CAAC;IAC5D,CAAC;IAED,IAAW,cAAc,CAAC,KAAc;QACpC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC;IAC1F,CAAC;IAqBD;;;;;;;;;;;;;OAaG;IACH,YAAY,aAA4B,EAAE,UAA6B,EAAE,YAAqB,EAAE,KAAY;QA1E5G;;WAEG;QACI,gBAAW,GAAQ,SAAS,CAAC;QACpC;;WAEG;QACI,yBAAoB,G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C;QACD,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAChC,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC5B,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YACzE,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;QACrC,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;CACJ","sourcesContent":["import type { IBasePhysicsCollisionEvent, IPhysicsCollisionEvent, IPhysicsEnginePluginV2, PhysicsMassProperties } from \"./IPhysicsEnginePlugin\";\r\nimport { PhysicsMotionType, PhysicsPrestepType } from \"./IPhysicsEnginePlugin\";\r\nimport type { PhysicsShape } from \"./physicsShape\";\r\nimport { Vector3, Quaternion, TmpVectors } from \"../../Maths/math.vector\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { PhysicsEngine } from \"./physicsEngine\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { PhysicsConstraint } from \"./physicsConstraint\";\r\nimport type { Bone } from \"core/Bones/bone\";\r\nimport { Space } from \"core/Maths/math.axis\";\r\nimport type { Observable, Observer } from \"../../Misc/observable\";\r\nimport type { Node } from \"../../node\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport type { BoundingBox } from \"core/Culling/boundingBox\";\r\n\r\n/**\r\n * PhysicsBody is useful for creating a physics body that can be used in a physics engine. It allows\r\n * the user to set the mass and velocity of the body, which can then be used to calculate the\r\n * motion of the body in the physics engine.\r\n */\r\nexport class PhysicsBody {\r\n /**\r\n * V2 Physics plugin private data for single Transform\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * V2 Physics plugin private data for instances\r\n */\r\n public _pluginDataInstances: Array<any> = [];\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n private _physicsPlugin: IPhysicsEnginePluginV2;\r\n /**\r\n * The engine used to create and manage this Physics Body\r\n */\r\n private _physicsEngine: PhysicsEngine;\r\n /**\r\n * If the collision callback is enabled\r\n */\r\n private _collisionCBEnabled: boolean = false;\r\n /**\r\n * If the collision ended callback is enabled\r\n */\r\n private _collisionEndedCBEnabled: boolean = false;\r\n /**\r\n * The transform node associated with this Physics Body\r\n */\r\n transformNode: TransformNode;\r\n\r\n /**\r\n * Disable pre-step that consists in updating Physics Body from Transform Node Translation/Orientation.\r\n * True by default for maximum performance.\r\n */\r\n public get disablePreStep(): boolean {\r\n return this._prestepType == PhysicsPrestepType.DISABLED;\r\n }\r\n\r\n public set disablePreStep(value: boolean) {\r\n this._prestepType = value ? PhysicsPrestepType.DISABLED : PhysicsPrestepType.TELEPORT;\r\n }\r\n\r\n /**\r\n * Disable sync from physics to transformNode. This value is set to true at body creation or at motionType setting when the body is not dynamic.\r\n */\r\n disableSync: boolean = false;\r\n\r\n /**\r\n * Physics engine will try to make this body sleeping and not active\r\n */\r\n public startAsleep: boolean;\r\n\r\n private _nodeDisposeObserver: Nullable<Observer<Node>>;\r\n\r\n private _isDisposed = false;\r\n\r\n private _shape: Nullable<PhysicsShape> = null;\r\n\r\n private _motionType: PhysicsMotionType;\r\n\r\n private _prestepType: PhysicsPrestepType = PhysicsPrestepType.DISABLED;\r\n /**\r\n * Constructs a new physics body for the given node.\r\n * @param transformNode - The Transform Node to construct the physics body for. For better performance, it is advised that this node does not have a parent.\r\n * @param motionType - The motion type of the physics body. The options are:\r\n * - PhysicsMotionType.STATIC - Static bodies are not moving and unaffected by forces or collisions. They are good for level boundaries or terrain.\r\n * - PhysicsMotionType.DYNAMIC - Dynamic bodies are fully simulated. They can move and collide with other objects.\r\n * - PhysicsMotionType.ANIMATED - They behave like dynamic bodies, but they won't be affected by other bodies, but still push other bodies out of the way.\r\n * @param startsAsleep - Whether the physics body should start in a sleeping state (not a guarantee). Defaults to false.\r\n * @param scene - The scene containing the physics engine.\r\n *\r\n * This code is useful for creating a physics body for a given Transform Node in a scene.\r\n * It checks the version of the physics engine and the physics plugin, and initializes the body accordingly.\r\n * It also sets the node's rotation quaternion if it is not already set. Finally, it adds the body to the physics engine.\r\n */\r\n constructor(transformNode: TransformNode, motionType: PhysicsMotionType, startsAsleep: boolean, scene: Scene) {\r\n if (!scene) {\r\n return;\r\n }\r\n const physicsEngine = scene.getPhysicsEngine() as PhysicsEngine;\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n this._physicsEngine = physicsEngine;\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n\r\n this._physicsPlugin = physicsPlugin;\r\n if (!transformNode.rotationQuaternion) {\r\n transformNode.rotationQuaternion = Quaternion.FromEulerAngles(transformNode.rotation.x, transformNode.rotation.y, transformNode.rotation.z);\r\n }\r\n\r\n this.startAsleep = startsAsleep;\r\n\r\n this._motionType = motionType;\r\n\r\n // only dynamic and animated body needs sync from physics to transformNode\r\n this.disableSync = motionType == PhysicsMotionType.STATIC;\r\n\r\n // instances?\r\n const m = transformNode as Mesh;\r\n if (m.hasThinInstances) {\r\n this._physicsPlugin.initBodyInstances(this, motionType, m);\r\n } else {\r\n // single instance\r\n if (transformNode.parent) {\r\n // Force computation of world matrix so that the parent transforms are correctly reflected in absolutePosition/absoluteRotationQuaternion.\r\n transformNode.computeWorldMatrix(true);\r\n }\r\n this._physicsPlugin.initBody(this, motionType, transformNode.absolutePosition, transformNode.absoluteRotationQuaternion);\r\n }\r\n this.transformNode = transformNode;\r\n transformNode.physicsBody = this;\r\n physicsEngine.addBody(this);\r\n\r\n this._nodeDisposeObserver = transformNode.onDisposeObservable.add(() => {\r\n this.dispose();\r\n });\r\n }\r\n\r\n /**\r\n * Returns the string \"PhysicsBody\".\r\n * @returns \"PhysicsBody\"\r\n */\r\n public getClassName() {\r\n return \"PhysicsBody\";\r\n }\r\n\r\n /**\r\n * Clone the PhysicsBody to a new body and assign it to the transformNode parameter\r\n * @param transformNode transformNode that will be used for the cloned PhysicsBody\r\n * @returns the newly cloned PhysicsBody\r\n */\r\n public clone(transformNode: TransformNode): PhysicsBody {\r\n const clonedBody = new PhysicsBody(transformNode, this.getMotionType(), this.startAsleep, this.transformNode.getScene());\r\n clonedBody.shape = this.shape;\r\n clonedBody.setMassProperties(this.getMassProperties());\r\n clonedBody.setLinearDamping(this.getLinearDamping());\r\n clonedBody.setAngularDamping(this.getAngularDamping());\r\n return clonedBody;\r\n }\r\n\r\n /**\r\n * If a physics body is connected to an instanced node, update the number physic instances to match the number of node instances.\r\n */\r\n public updateBodyInstances() {\r\n const m = this.transformNode as Mesh;\r\n if (m.hasThinInstances) {\r\n this._physicsPlugin.updateBodyInstances(this, m);\r\n }\r\n }\r\n\r\n /**\r\n * This returns the number of internal instances of the physics body\r\n */\r\n public get numInstances(): number {\r\n return this._pluginDataInstances.length;\r\n }\r\n\r\n /**\r\n * Get the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.\r\n */\r\n public get motionType(): PhysicsMotionType {\r\n return this._motionType;\r\n }\r\n\r\n /**\r\n * Sets the shape of the physics body.\r\n * @param shape - The shape of the physics body.\r\n *\r\n * This method is useful for setting the shape of the physics body, which is necessary for the physics engine to accurately simulate the body's behavior.\r\n * The shape is used to calculate the body's mass, inertia, and other properties.\r\n */\r\n public set shape(shape: Nullable<PhysicsShape>) {\r\n this._shape = shape;\r\n if (shape) {\r\n this._physicsPlugin.setShape(this, shape);\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves the physics shape associated with this object.\r\n *\r\n * @returns The physics shape associated with this object, or `undefined` if no\r\n * shape is associated.\r\n *\r\n * This method is useful for retrieving the physics shape associated with this object,\r\n * which can be used to apply physical forces to the object or to detect collisions.\r\n */\r\n public get shape(): Nullable<PhysicsShape> {\r\n return this._shape;\r\n }\r\n\r\n /**\r\n * Returns the bounding box of the physics body.\r\n * @returns The bounding box of the physics body.\r\n */\r\n public getBoundingBox(): BoundingBox {\r\n return this._physicsPlugin.getBodyBoundingBox(this);\r\n }\r\n\r\n /**\r\n * Sets the event mask for the physics engine.\r\n *\r\n * @param eventMask - A bitmask that determines which events will be sent to the physics engine.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the event mask for.\r\n *\r\n * This method is useful for setting the event mask for the physics engine, which determines which events\r\n * will be sent to the physics engine. This allows the user to control which events the physics engine will respond to.\r\n */\r\n public setEventMask(eventMask: number, instanceIndex?: number) {\r\n this._physicsPlugin.setEventMask(this, eventMask, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the event mask of the physics engine.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the event mask for.\r\n * @returns The event mask of the physics engine.\r\n *\r\n * This method is useful for getting the event mask of the physics engine,\r\n * which is used to determine which events the engine will respond to.\r\n * This is important for ensuring that the engine is responding to the correct events and not\r\n * wasting resources on unnecessary events.\r\n */\r\n public getEventMask(instanceIndex?: number): number {\r\n return this._physicsPlugin.getEventMask(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.\r\n * @param motionType - The motion type to set.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the motion type for.\r\n */\r\n public setMotionType(motionType: PhysicsMotionType, instanceIndex?: number) {\r\n this.disableSync = motionType == PhysicsMotionType.STATIC;\r\n this._physicsPlugin.setMotionType(this, motionType, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the motion type for.\r\n * @returns The motion type of the physics body.\r\n */\r\n public getMotionType(instanceIndex?: number): PhysicsMotionType {\r\n return this._physicsPlugin.getMotionType(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Set the prestep type of the body\r\n * @param prestepType prestep type provided by PhysicsPrestepType\r\n */\r\n public setPrestepType(prestepType: PhysicsPrestepType): void {\r\n this._prestepType = prestepType;\r\n }\r\n\r\n /**\r\n * Get the current prestep type of the body\r\n * @returns the type of prestep associated with the body and its instance index\r\n */\r\n public getPrestepType(): PhysicsPrestepType {\r\n return this._prestepType;\r\n }\r\n\r\n /**\r\n * Computes the mass properties of the physics object, based on the set of physics shapes this body uses.\r\n * This method is useful for computing the initial mass properties of a physics object, such as its mass,\r\n * inertia, and center of mass; these values are important for accurately simulating the physics of the\r\n * object in the physics engine, and computing values based on the shape will provide you with reasonable\r\n * initial values, which you can then customize.\r\n * @param instanceIndex - The index of the instance to compute the mass properties for.\r\n * @returns The mass properties of the object.\r\n */\r\n public computeMassProperties(instanceIndex?: number): PhysicsMassProperties {\r\n return this._physicsPlugin.computeMassProperties(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the mass properties of the physics object.\r\n *\r\n * @param massProps - The mass properties to set.\r\n * @param instanceIndex - The index of the instance to set the mass properties for. If not defined, the mass properties will be set for all instances.\r\n *\r\n * This method is useful for setting the mass properties of a physics object, such as its mass,\r\n * inertia, and center of mass. This is important for accurately simulating the physics of the object in the physics engine.\r\n */\r\n public setMassProperties(massProps: PhysicsMassProperties, instanceIndex?: number): void {\r\n this._physicsPlugin.setMassProperties(this, massProps, instanceIndex);\r\n }\r\n\r\n /**\r\n * Retrieves the mass properties of the object.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the mass properties for.\r\n * @returns The mass properties of the object.\r\n *\r\n * This method is useful for physics simulations, as it allows the user to\r\n * retrieve the mass properties of the object, such as its mass, center of mass,\r\n * and moment of inertia. This information is necessary for accurate physics\r\n * simulations.\r\n */\r\n public getMassProperties(instanceIndex?: number): PhysicsMassProperties {\r\n return this._physicsPlugin.getMassProperties(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the linear damping of the physics body.\r\n *\r\n * @param damping - The linear damping value.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the linear damping for.\r\n *\r\n * This method is useful for controlling the linear damping of the physics body,\r\n * which is the rate at which the body's velocity decreases over time. This is useful for simulating\r\n * the effects of air resistance or other forms of friction.\r\n */\r\n public setLinearDamping(damping: number, instanceIndex?: number) {\r\n this._physicsPlugin.setLinearDamping(this, damping, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the linear damping of the physics body.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the linear damping for.\r\n * @returns The linear damping of the physics body.\r\n *\r\n * This method is useful for retrieving the linear damping of the physics body, which is the amount of\r\n * resistance the body has to linear motion. This is useful for simulating realistic physics behavior\r\n * in a game.\r\n */\r\n public getLinearDamping(instanceIndex?: number): number {\r\n return this._physicsPlugin.getLinearDamping(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the angular damping of the physics body.\r\n * @param damping The angular damping of the body.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the angular damping for.\r\n *\r\n * This method is useful for controlling the angular velocity of a physics body.\r\n * By setting the damping, the body's angular velocity will be reduced over time, simulating the effect of friction.\r\n * This can be used to create realistic physical behavior in a physics engine.\r\n */\r\n public setAngularDamping(damping: number, instanceIndex?: number) {\r\n this._physicsPlugin.setAngularDamping(this, damping, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the angular damping of the physics body.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the angular damping for.\r\n *\r\n * @returns The angular damping of the physics body.\r\n *\r\n * This method is useful for getting the angular damping of the physics body,\r\n * which is the rate of reduction of the angular velocity over time.\r\n * This is important for simulating realistic physics behavior in a game.\r\n */\r\n public getAngularDamping(instanceIndex?: number): number {\r\n return this._physicsPlugin.getAngularDamping(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the linear velocity of the physics object.\r\n * @param linVel - The linear velocity to set.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the linear velocity for.\r\n *\r\n * This method is useful for setting the linear velocity of a physics object,\r\n * which is necessary for simulating realistic physics in a game engine.\r\n * By setting the linear velocity, the physics object will move in the direction and speed specified by the vector.\r\n * This allows for realistic physics simulations, such as simulating the motion of a ball rolling down a hill.\r\n */\r\n public setLinearVelocity(linVel: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.setLinearVelocity(this, linVel, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the linear velocity of the physics body and stores it in the given vector3.\r\n * @param linVel - The vector3 to store the linear velocity in.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the linear velocity for.\r\n *\r\n * This method is useful for getting the linear velocity of a physics body in a physics engine.\r\n * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.\r\n */\r\n public getLinearVelocityToRef(linVel: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.getLinearVelocityToRef(this, linVel, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the linear velocity of the physics body as a new vector3.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the linear velocity for.\r\n * @returns The linear velocity of the physics body.\r\n *\r\n * This method is useful for getting the linear velocity of a physics body in a physics engine.\r\n * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.\r\n */\r\n public getLinearVelocity(instanceIndex?: number): Vector3 {\r\n const ref = new Vector3();\r\n this.getLinearVelocityToRef(ref, instanceIndex);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Sets the angular velocity of the physics object.\r\n * @param angVel - The angular velocity to set.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the angular velocity for.\r\n *\r\n * This method is useful for setting the angular velocity of a physics object, which is necessary for\r\n * simulating realistic physics behavior. The angular velocity is used to determine the rate of rotation of the object,\r\n * which is important for simulating realistic motion.\r\n */\r\n public setAngularVelocity(angVel: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.setAngularVelocity(this, angVel, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the angular velocity of the physics body and stores it in the given vector3.\r\n * @param angVel - The vector3 to store the angular velocity in.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the angular velocity for.\r\n *\r\n * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's\r\n * rotational speed. This information can be used to create realistic physics simulations.\r\n */\r\n public getAngularVelocityToRef(angVel: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.getAngularVelocityToRef(this, angVel, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the angular velocity of the physics body as a new vector3.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the angular velocity for.\r\n * @returns The angular velocity of the physics body.\r\n *\r\n * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's\r\n * rotational speed. This information can be used to create realistic physics simulations.\r\n */\r\n public getAngularVelocity(instanceIndex?: number): Vector3 {\r\n const ref = new Vector3();\r\n this.getAngularVelocityToRef(ref, instanceIndex);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Applies an impulse to the physics object.\r\n *\r\n * @param impulse The impulse vector.\r\n * @param location The location of the impulse.\r\n * @param instanceIndex For a instanced body, the instance to where the impulse should be applied. If not specified, the impulse is applied to all instances.\r\n *\r\n * This method is useful for applying an impulse to a physics object, which can be used to simulate physical forces such as gravity,\r\n * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.\r\n */\r\n public applyImpulse(impulse: Vector3, location: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.applyImpulse(this, impulse, location, instanceIndex);\r\n }\r\n\r\n /**\r\n * Add torque to a physics body\r\n * @param angularImpulse The angular impulse vector.\r\n * @param instanceIndex For a instanced body, the instance to where the impulse should be applied. If not specified, the impulse is applied to all instances.\r\n */\r\n public applyAngularImpulse(angularImpulse: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.applyAngularImpulse(this, angularImpulse, instanceIndex);\r\n }\r\n\r\n /**\r\n * Applies a force to the physics object.\r\n *\r\n * @param force The force vector.\r\n * @param location The location of the force.\r\n * @param instanceIndex For a instanced body, the instance to where the force should be applied. If not specified, the force is applied to all instances.\r\n *\r\n * This method is useful for applying a force to a physics object, which can be used to simulate physical forces such as gravity,\r\n * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.\r\n */\r\n public applyForce(force: Vector3, location: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.applyForce(this, force, location, instanceIndex);\r\n }\r\n\r\n /**\r\n * Retrieves the geometry of the body from the physics plugin.\r\n *\r\n * @returns The geometry of the body.\r\n *\r\n * This method is useful for retrieving the geometry of the body from the physics plugin, which can be used for various physics calculations.\r\n */\r\n public getGeometry(): object {\r\n return this._physicsPlugin.getBodyGeometry(this);\r\n }\r\n\r\n /**\r\n * Returns an observable that will be notified for when a collision starts or continues for this PhysicsBody\r\n * @returns Observable\r\n */\r\n public getCollisionObservable(): Observable<IPhysicsCollisionEvent> {\r\n return this._physicsPlugin.getCollisionObservable(this);\r\n }\r\n\r\n /**\r\n * Returns an observable that will be notified when the body has finished colliding with another body\r\n * @returns\r\n */\r\n public getCollisionEndedObservable(): Observable<IBasePhysicsCollisionEvent> {\r\n return this._physicsPlugin.getCollisionEndedObservable(this);\r\n }\r\n\r\n /**\r\n * Enable or disable collision callback for this PhysicsBody.\r\n * @param enabled true if PhysicsBody's collision will rise a collision event and notifies the observable\r\n */\r\n public setCollisionCallbackEnabled(enabled: boolean): void {\r\n this._collisionCBEnabled = enabled;\r\n this._physicsPlugin.setCollisionCallbackEnabled(this, enabled);\r\n }\r\n\r\n /**\r\n * Enable or disable collision ended callback for this PhysicsBody.\r\n * @param enabled true if PhysicsBody's collision ended will rise a collision event and notifies the observable\r\n */\r\n public setCollisionEndedCallbackEnabled(enabled: boolean): void {\r\n this._collisionEndedCBEnabled = enabled;\r\n this._physicsPlugin.setCollisionEndedCallbackEnabled(this, enabled);\r\n }\r\n\r\n /**\r\n * Get the center of the object in world space.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the center for.\r\n * @returns geometric center of the associated mesh\r\n */\r\n public getObjectCenterWorld(instanceIndex?: number): Vector3 {\r\n const ref = new Vector3();\r\n return this.getObjectCenterWorldToRef(ref, instanceIndex);\r\n }\r\n\r\n /**\r\n * Get the center of the object in world space.\r\n * @param ref - The vector3 to store the result in.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the center for.\r\n * @returns geometric center of the associated mesh\r\n */\r\n public getObjectCenterWorldToRef(ref: Vector3, instanceIndex?: number): Vector3 {\r\n if (this._pluginDataInstances?.length > 0) {\r\n const index = instanceIndex || 0;\r\n const matrixData = (this.transformNode as Mesh)._thinInstanceDataStorage.matrixData;\r\n if (matrixData) {\r\n ref.set(matrixData[index * 16 + 12], matrixData[index * 16 + 13], matrixData[index * 16 + 14]);\r\n }\r\n } else {\r\n ref.copyFrom(this.transformNode.position);\r\n }\r\n return ref;\r\n }\r\n\r\n /**\r\n * Adds a constraint to the physics engine.\r\n *\r\n * @param childBody - The body to which the constraint will be applied.\r\n * @param constraint - The constraint to be applied.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.\r\n * @param childInstanceIndex - If the child body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.\r\n *\r\n */\r\n public addConstraint(childBody: PhysicsBody, constraint: PhysicsConstraint, instanceIndex?: number, childInstanceIndex?: number): void {\r\n this._physicsPlugin.addConstraint(this, childBody, constraint, instanceIndex, childInstanceIndex);\r\n }\r\n\r\n /**\r\n * Sync with a bone\r\n * @param bone The bone that the impostor will be synced to.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n * @param boneAxis Optional vector3 axis the bone is aligned with\r\n */\r\n public syncWithBone(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion, boneAxis?: Vector3) {\r\n const mesh = this.transformNode;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = TmpVectors.Quaternion[0];\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, tempQuat);\r\n tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);\r\n } else {\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, mesh.rotationQuaternion);\r\n }\r\n }\r\n\r\n const pos = TmpVectors.Vector3[0];\r\n const boneDir = TmpVectors.Vector3[1];\r\n\r\n if (!boneAxis) {\r\n boneAxis = TmpVectors.Vector3[2];\r\n boneAxis.x = 0;\r\n boneAxis.y = 1;\r\n boneAxis.z = 0;\r\n }\r\n\r\n bone.getDirectionToRef(boneAxis, boneMesh, boneDir);\r\n bone.getAbsolutePositionToRef(boneMesh, pos);\r\n\r\n if ((distToJoint === undefined || distToJoint === null) && jointPivot) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n if (distToJoint !== undefined && distToJoint !== null) {\r\n pos.x += boneDir.x * distToJoint;\r\n pos.y += boneDir.y * distToJoint;\r\n pos.z += boneDir.z * distToJoint;\r\n }\r\n\r\n mesh.setAbsolutePosition(pos);\r\n }\r\n\r\n /**\r\n * Executes a callback on the body or all of the instances of a body\r\n * @param callback the callback to execute\r\n */\r\n public iterateOverAllInstances(callback: (body: PhysicsBody, instanceIndex?: number) => void) {\r\n if (this._pluginDataInstances?.length > 0) {\r\n for (let i = 0; i < this._pluginDataInstances.length; i++) {\r\n callback(this, i);\r\n }\r\n } else {\r\n callback(this, undefined);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the gravity factor of the physics body\r\n * @param factor the gravity factor to set\r\n * @param instanceIndex the instance of the body to set, if undefined all instances will be set\r\n */\r\n public setGravityFactor(factor: number, instanceIndex?: number) {\r\n this._physicsPlugin.setGravityFactor(this, factor, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the gravity factor of the physics body\r\n * @param instanceIndex the instance of the body to get, if undefined the value of first instance will be returned\r\n * @returns the gravity factor\r\n */\r\n public getGravityFactor(instanceIndex?: number): number {\r\n return this._physicsPlugin.getGravityFactor(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Set the target transformation (position and rotation) of the body, such that the body will set its velocity to reach that target\r\n * @param position The target position\r\n * @param rotation The target rotation\r\n * @param instanceIndex The index of the instance in an instanced body\r\n */\r\n public setTargetTransform(position: Vector3, rotation: Quaternion, instanceIndex?: number) {\r\n this._physicsPlugin.setTargetTransform(this, position, rotation, instanceIndex);\r\n }\r\n\r\n /**\r\n * Returns if the body has been disposed.\r\n * @returns true if disposed, false otherwise.\r\n */\r\n public get isDisposed() {\r\n return this._isDisposed;\r\n }\r\n\r\n /**\r\n * Disposes the body from the physics engine.\r\n *\r\n * This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.\r\n */\r\n public dispose() {\r\n if (this._isDisposed) {\r\n return;\r\n }\r\n // Disable collisions CB so it doesn't fire when the body is disposed\r\n if (this._collisionCBEnabled) {\r\n this.setCollisionCallbackEnabled(false);\r\n }\r\n if (this._collisionEndedCBEnabled) {\r\n this.setCollisionEndedCallbackEnabled(false);\r\n }\r\n if (this._nodeDisposeObserver) {\r\n this.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver);\r\n this._nodeDisposeObserver = null;\r\n }\r\n this._physicsEngine.removeBody(this);\r\n this._physicsPlugin.removeBody(this);\r\n this._physicsPlugin.disposeBody(this);\r\n this.transformNode.physicsBody = null;\r\n this._pluginData = null;\r\n this._pluginDataInstances.length = 0;\r\n this._isDisposed = true;\r\n this.shape = null;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"physicsBody.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v2/physicsBody.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAc1E;;;;GAIG;AACH,MAAM,OAAO,WAAW;IA8BpB;;;OAGG;IACH,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,YAAY,IAAI,kBAAkB,CAAC,QAAQ,CAAC;IAC5D,CAAC;IAED,IAAW,cAAc,CAAC,KAAc;QACpC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC;IAC1F,CAAC;IAmBD;;;;;;;;;;;;;OAaG;IACH,YAAY,aAA4B,EAAE,UAA6B,EAAE,YAAqB,EAAE,KAAY;QAxE5G;;WAEG;QACI,gBAAW,GAAQ,SAAS,CAAC;QACpC;;WAEG;QACI,yBAAoB,GAAe,EAAE,CAAC;QAS7C;;WAEG;QACK,wBAAmB,GAAY,KAAK,CAAC;QAC7C;;WAEG;QACK,6BAAwB,GAAY,KAAK,CAAC;QAkBlD;;WAEG;QACH,gBAAW,GAAY,KAAK,CAAC;QASrB,gBAAW,GAAG,KAAK,CAAC;QAEpB,WAAM,GAA2B,IAAI,CAAC;QAEtC,iBAAY,GAAuB,kBAAkB,CAAC,QAAQ,CAAC;QAgBnE,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO;QACX,CAAC;QACD,MAAM,aAAa,GAAG,KAAK,CAAC,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cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,WAAW,GAAG,IAAI,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;CACJ","sourcesContent":["import type { IBasePhysicsCollisionEvent, IPhysicsCollisionEvent, IPhysicsEnginePluginV2, PhysicsMassProperties } from \"./IPhysicsEnginePlugin\";\r\nimport { PhysicsMotionType, PhysicsPrestepType } from \"./IPhysicsEnginePlugin\";\r\nimport type { PhysicsShape } from \"./physicsShape\";\r\nimport { Vector3, Quaternion, TmpVectors } from \"../../Maths/math.vector\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { PhysicsEngine } from \"./physicsEngine\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { PhysicsConstraint } from \"./physicsConstraint\";\r\nimport type { Bone } from \"core/Bones/bone\";\r\nimport { Space } from \"core/Maths/math.axis\";\r\nimport type { Observable, Observer } from \"../../Misc/observable\";\r\nimport type { Node } from \"../../node\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport type { BoundingBox } from \"core/Culling/boundingBox\";\r\n\r\n/**\r\n * PhysicsBody is useful for creating a physics body that can be used in a physics engine. It allows\r\n * the user to set the mass and velocity of the body, which can then be used to calculate the\r\n * motion of the body in the physics engine.\r\n */\r\nexport class PhysicsBody {\r\n /**\r\n * V2 Physics plugin private data for single Transform\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * V2 Physics plugin private data for instances\r\n */\r\n public _pluginDataInstances: Array<any> = [];\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n private _physicsPlugin: IPhysicsEnginePluginV2;\r\n /**\r\n * The engine used to create and manage this Physics Body\r\n */\r\n private _physicsEngine: PhysicsEngine;\r\n /**\r\n * If the collision callback is enabled\r\n */\r\n private _collisionCBEnabled: boolean = false;\r\n /**\r\n * If the collision ended callback is enabled\r\n */\r\n private _collisionEndedCBEnabled: boolean = false;\r\n /**\r\n * The transform node associated with this Physics Body\r\n */\r\n transformNode: TransformNode;\r\n\r\n /**\r\n * Disable pre-step that consists in updating Physics Body from Transform Node Translation/Orientation.\r\n * True by default for maximum performance.\r\n */\r\n public get disablePreStep(): boolean {\r\n return this._prestepType == PhysicsPrestepType.DISABLED;\r\n }\r\n\r\n public set disablePreStep(value: boolean) {\r\n this._prestepType = value ? PhysicsPrestepType.DISABLED : PhysicsPrestepType.TELEPORT;\r\n }\r\n\r\n /**\r\n * Disable sync from physics to transformNode. This value is set to true at body creation or at motionType setting when the body is not dynamic.\r\n */\r\n disableSync: boolean = false;\r\n\r\n /**\r\n * Physics engine will try to make this body sleeping and not active\r\n */\r\n public startAsleep: boolean;\r\n\r\n private _nodeDisposeObserver: Nullable<Observer<Node>>;\r\n\r\n private _isDisposed = false;\r\n\r\n private _shape: Nullable<PhysicsShape> = null;\r\n\r\n private _prestepType: PhysicsPrestepType = PhysicsPrestepType.DISABLED;\r\n /**\r\n * Constructs a new physics body for the given node.\r\n * @param transformNode - The Transform Node to construct the physics body for. For better performance, it is advised that this node does not have a parent.\r\n * @param motionType - The motion type of the physics body. The options are:\r\n * - PhysicsMotionType.STATIC - Static bodies are not moving and unaffected by forces or collisions. They are good for level boundaries or terrain.\r\n * - PhysicsMotionType.DYNAMIC - Dynamic bodies are fully simulated. They can move and collide with other objects.\r\n * - PhysicsMotionType.ANIMATED - They behave like dynamic bodies, but they won't be affected by other bodies, but still push other bodies out of the way.\r\n * @param startsAsleep - Whether the physics body should start in a sleeping state (not a guarantee). Defaults to false.\r\n * @param scene - The scene containing the physics engine.\r\n *\r\n * This code is useful for creating a physics body for a given Transform Node in a scene.\r\n * It checks the version of the physics engine and the physics plugin, and initializes the body accordingly.\r\n * It also sets the node's rotation quaternion if it is not already set. Finally, it adds the body to the physics engine.\r\n */\r\n constructor(transformNode: TransformNode, motionType: PhysicsMotionType, startsAsleep: boolean, scene: Scene) {\r\n if (!scene) {\r\n return;\r\n }\r\n const physicsEngine = scene.getPhysicsEngine() as PhysicsEngine;\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n this._physicsEngine = physicsEngine;\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n\r\n this._physicsPlugin = physicsPlugin;\r\n if (!transformNode.rotationQuaternion) {\r\n transformNode.rotationQuaternion = Quaternion.FromEulerAngles(transformNode.rotation.x, transformNode.rotation.y, transformNode.rotation.z);\r\n }\r\n\r\n this.startAsleep = startsAsleep;\r\n\r\n // only dynamic and animated body needs sync from physics to transformNode\r\n this.disableSync = motionType == PhysicsMotionType.STATIC;\r\n\r\n // instances?\r\n const m = transformNode as Mesh;\r\n if (m.hasThinInstances) {\r\n this._physicsPlugin.initBodyInstances(this, motionType, m);\r\n } else {\r\n // single instance\r\n if (transformNode.parent) {\r\n // Force computation of world matrix so that the parent transforms are correctly reflected in absolutePosition/absoluteRotationQuaternion.\r\n transformNode.computeWorldMatrix(true);\r\n }\r\n this._physicsPlugin.initBody(this, motionType, transformNode.absolutePosition, transformNode.absoluteRotationQuaternion);\r\n }\r\n this.transformNode = transformNode;\r\n transformNode.physicsBody = this;\r\n physicsEngine.addBody(this);\r\n\r\n this._nodeDisposeObserver = transformNode.onDisposeObservable.add(() => {\r\n this.dispose();\r\n });\r\n }\r\n\r\n /**\r\n * Returns the string \"PhysicsBody\".\r\n * @returns \"PhysicsBody\"\r\n */\r\n public getClassName() {\r\n return \"PhysicsBody\";\r\n }\r\n\r\n /**\r\n * Clone the PhysicsBody to a new body and assign it to the transformNode parameter\r\n * @param transformNode transformNode that will be used for the cloned PhysicsBody\r\n * @returns the newly cloned PhysicsBody\r\n */\r\n public clone(transformNode: TransformNode): PhysicsBody {\r\n const clonedBody = new PhysicsBody(transformNode, this.getMotionType(), this.startAsleep, this.transformNode.getScene());\r\n clonedBody.shape = this.shape;\r\n clonedBody.setMassProperties(this.getMassProperties());\r\n clonedBody.setLinearDamping(this.getLinearDamping());\r\n clonedBody.setAngularDamping(this.getAngularDamping());\r\n return clonedBody;\r\n }\r\n\r\n /**\r\n * If a physics body is connected to an instanced node, update the number physic instances to match the number of node instances.\r\n */\r\n public updateBodyInstances() {\r\n const m = this.transformNode as Mesh;\r\n if (m.hasThinInstances) {\r\n this._physicsPlugin.updateBodyInstances(this, m);\r\n }\r\n }\r\n\r\n /**\r\n * This returns the number of internal instances of the physics body\r\n */\r\n public get numInstances(): number {\r\n return this._pluginDataInstances.length;\r\n }\r\n\r\n /**\r\n * Get the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.\r\n */\r\n public get motionType(): PhysicsMotionType {\r\n return this._physicsPlugin.getMotionType(this);\r\n }\r\n\r\n /**\r\n * Sets the shape of the physics body.\r\n * @param shape - The shape of the physics body.\r\n *\r\n * This method is useful for setting the shape of the physics body, which is necessary for the physics engine to accurately simulate the body's behavior.\r\n * The shape is used to calculate the body's mass, inertia, and other properties.\r\n */\r\n public set shape(shape: Nullable<PhysicsShape>) {\r\n this._shape = shape;\r\n if (shape) {\r\n this._physicsPlugin.setShape(this, shape);\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves the physics shape associated with this object.\r\n *\r\n * @returns The physics shape associated with this object, or `undefined` if no\r\n * shape is associated.\r\n *\r\n * This method is useful for retrieving the physics shape associated with this object,\r\n * which can be used to apply physical forces to the object or to detect collisions.\r\n */\r\n public get shape(): Nullable<PhysicsShape> {\r\n return this._shape;\r\n }\r\n\r\n /**\r\n * Returns the bounding box of the physics body.\r\n * @returns The bounding box of the physics body.\r\n */\r\n public getBoundingBox(): BoundingBox {\r\n return this._physicsPlugin.getBodyBoundingBox(this);\r\n }\r\n\r\n /**\r\n * Sets the event mask for the physics engine.\r\n *\r\n * @param eventMask - A bitmask that determines which events will be sent to the physics engine.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the event mask for.\r\n *\r\n * This method is useful for setting the event mask for the physics engine, which determines which events\r\n * will be sent to the physics engine. This allows the user to control which events the physics engine will respond to.\r\n */\r\n public setEventMask(eventMask: number, instanceIndex?: number) {\r\n this._physicsPlugin.setEventMask(this, eventMask, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the event mask of the physics engine.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the event mask for.\r\n * @returns The event mask of the physics engine.\r\n *\r\n * This method is useful for getting the event mask of the physics engine,\r\n * which is used to determine which events the engine will respond to.\r\n * This is important for ensuring that the engine is responding to the correct events and not\r\n * wasting resources on unnecessary events.\r\n */\r\n public getEventMask(instanceIndex?: number): number {\r\n return this._physicsPlugin.getEventMask(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.\r\n * @param motionType - The motion type to set.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the motion type for.\r\n */\r\n public setMotionType(motionType: PhysicsMotionType, instanceIndex?: number) {\r\n this.disableSync = motionType == PhysicsMotionType.STATIC;\r\n this._physicsPlugin.setMotionType(this, motionType, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the motion type of the physics body. Can be STATIC, DYNAMIC, or ANIMATED.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the motion type for.\r\n * @returns The motion type of the physics body.\r\n */\r\n public getMotionType(instanceIndex?: number): PhysicsMotionType {\r\n return this._physicsPlugin.getMotionType(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Set the prestep type of the body\r\n * @param prestepType prestep type provided by PhysicsPrestepType\r\n */\r\n public setPrestepType(prestepType: PhysicsPrestepType): void {\r\n this._prestepType = prestepType;\r\n }\r\n\r\n /**\r\n * Get the current prestep type of the body\r\n * @returns the type of prestep associated with the body and its instance index\r\n */\r\n public getPrestepType(): PhysicsPrestepType {\r\n return this._prestepType;\r\n }\r\n\r\n /**\r\n * Computes the mass properties of the physics object, based on the set of physics shapes this body uses.\r\n * This method is useful for computing the initial mass properties of a physics object, such as its mass,\r\n * inertia, and center of mass; these values are important for accurately simulating the physics of the\r\n * object in the physics engine, and computing values based on the shape will provide you with reasonable\r\n * initial values, which you can then customize.\r\n * @param instanceIndex - The index of the instance to compute the mass properties for.\r\n * @returns The mass properties of the object.\r\n */\r\n public computeMassProperties(instanceIndex?: number): PhysicsMassProperties {\r\n return this._physicsPlugin.computeMassProperties(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the mass properties of the physics object.\r\n *\r\n * @param massProps - The mass properties to set.\r\n * @param instanceIndex - The index of the instance to set the mass properties for. If not defined, the mass properties will be set for all instances.\r\n *\r\n * This method is useful for setting the mass properties of a physics object, such as its mass,\r\n * inertia, and center of mass. This is important for accurately simulating the physics of the object in the physics engine.\r\n */\r\n public setMassProperties(massProps: PhysicsMassProperties, instanceIndex?: number): void {\r\n this._physicsPlugin.setMassProperties(this, massProps, instanceIndex);\r\n }\r\n\r\n /**\r\n * Retrieves the mass properties of the object.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the mass properties for.\r\n * @returns The mass properties of the object.\r\n *\r\n * This method is useful for physics simulations, as it allows the user to\r\n * retrieve the mass properties of the object, such as its mass, center of mass,\r\n * and moment of inertia. This information is necessary for accurate physics\r\n * simulations.\r\n */\r\n public getMassProperties(instanceIndex?: number): PhysicsMassProperties {\r\n return this._physicsPlugin.getMassProperties(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the linear damping of the physics body.\r\n *\r\n * @param damping - The linear damping value.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the linear damping for.\r\n *\r\n * This method is useful for controlling the linear damping of the physics body,\r\n * which is the rate at which the body's velocity decreases over time. This is useful for simulating\r\n * the effects of air resistance or other forms of friction.\r\n */\r\n public setLinearDamping(damping: number, instanceIndex?: number) {\r\n this._physicsPlugin.setLinearDamping(this, damping, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the linear damping of the physics body.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the linear damping for.\r\n * @returns The linear damping of the physics body.\r\n *\r\n * This method is useful for retrieving the linear damping of the physics body, which is the amount of\r\n * resistance the body has to linear motion. This is useful for simulating realistic physics behavior\r\n * in a game.\r\n */\r\n public getLinearDamping(instanceIndex?: number): number {\r\n return this._physicsPlugin.getLinearDamping(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the angular damping of the physics body.\r\n * @param damping The angular damping of the body.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the angular damping for.\r\n *\r\n * This method is useful for controlling the angular velocity of a physics body.\r\n * By setting the damping, the body's angular velocity will be reduced over time, simulating the effect of friction.\r\n * This can be used to create realistic physical behavior in a physics engine.\r\n */\r\n public setAngularDamping(damping: number, instanceIndex?: number) {\r\n this._physicsPlugin.setAngularDamping(this, damping, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the angular damping of the physics body.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the angular damping for.\r\n *\r\n * @returns The angular damping of the physics body.\r\n *\r\n * This method is useful for getting the angular damping of the physics body,\r\n * which is the rate of reduction of the angular velocity over time.\r\n * This is important for simulating realistic physics behavior in a game.\r\n */\r\n public getAngularDamping(instanceIndex?: number): number {\r\n return this._physicsPlugin.getAngularDamping(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Sets the linear velocity of the physics object.\r\n * @param linVel - The linear velocity to set.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the linear velocity for.\r\n *\r\n * This method is useful for setting the linear velocity of a physics object,\r\n * which is necessary for simulating realistic physics in a game engine.\r\n * By setting the linear velocity, the physics object will move in the direction and speed specified by the vector.\r\n * This allows for realistic physics simulations, such as simulating the motion of a ball rolling down a hill.\r\n */\r\n public setLinearVelocity(linVel: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.setLinearVelocity(this, linVel, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the linear velocity of the physics body and stores it in the given vector3.\r\n * @param linVel - The vector3 to store the linear velocity in.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the linear velocity for.\r\n *\r\n * This method is useful for getting the linear velocity of a physics body in a physics engine.\r\n * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.\r\n */\r\n public getLinearVelocityToRef(linVel: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.getLinearVelocityToRef(this, linVel, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the linear velocity of the physics body as a new vector3.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the linear velocity for.\r\n * @returns The linear velocity of the physics body.\r\n *\r\n * This method is useful for getting the linear velocity of a physics body in a physics engine.\r\n * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.\r\n */\r\n public getLinearVelocity(instanceIndex?: number): Vector3 {\r\n const ref = new Vector3();\r\n this.getLinearVelocityToRef(ref, instanceIndex);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Sets the angular velocity of the physics object.\r\n * @param angVel - The angular velocity to set.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to set the angular velocity for.\r\n *\r\n * This method is useful for setting the angular velocity of a physics object, which is necessary for\r\n * simulating realistic physics behavior. The angular velocity is used to determine the rate of rotation of the object,\r\n * which is important for simulating realistic motion.\r\n */\r\n public setAngularVelocity(angVel: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.setAngularVelocity(this, angVel, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the angular velocity of the physics body and stores it in the given vector3.\r\n * @param angVel - The vector3 to store the angular velocity in.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the angular velocity for.\r\n *\r\n * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's\r\n * rotational speed. This information can be used to create realistic physics simulations.\r\n */\r\n public getAngularVelocityToRef(angVel: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.getAngularVelocityToRef(this, angVel, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the angular velocity of the physics body as a new vector3.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the angular velocity for.\r\n * @returns The angular velocity of the physics body.\r\n *\r\n * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's\r\n * rotational speed. This information can be used to create realistic physics simulations.\r\n */\r\n public getAngularVelocity(instanceIndex?: number): Vector3 {\r\n const ref = new Vector3();\r\n this.getAngularVelocityToRef(ref, instanceIndex);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Applies an impulse to the physics object.\r\n *\r\n * @param impulse The impulse vector.\r\n * @param location The location of the impulse.\r\n * @param instanceIndex For a instanced body, the instance to where the impulse should be applied. If not specified, the impulse is applied to all instances.\r\n *\r\n * This method is useful for applying an impulse to a physics object, which can be used to simulate physical forces such as gravity,\r\n * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.\r\n */\r\n public applyImpulse(impulse: Vector3, location: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.applyImpulse(this, impulse, location, instanceIndex);\r\n }\r\n\r\n /**\r\n * Add torque to a physics body\r\n * @param angularImpulse The angular impulse vector.\r\n * @param instanceIndex For a instanced body, the instance to where the impulse should be applied. If not specified, the impulse is applied to all instances.\r\n */\r\n public applyAngularImpulse(angularImpulse: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.applyAngularImpulse(this, angularImpulse, instanceIndex);\r\n }\r\n\r\n /**\r\n * Applies a force to the physics object.\r\n *\r\n * @param force The force vector.\r\n * @param location The location of the force.\r\n * @param instanceIndex For a instanced body, the instance to where the force should be applied. If not specified, the force is applied to all instances.\r\n *\r\n * This method is useful for applying a force to a physics object, which can be used to simulate physical forces such as gravity,\r\n * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.\r\n */\r\n public applyForce(force: Vector3, location: Vector3, instanceIndex?: number): void {\r\n this._physicsPlugin.applyForce(this, force, location, instanceIndex);\r\n }\r\n\r\n /**\r\n * Retrieves the geometry of the body from the physics plugin.\r\n *\r\n * @returns The geometry of the body.\r\n *\r\n * This method is useful for retrieving the geometry of the body from the physics plugin, which can be used for various physics calculations.\r\n */\r\n public getGeometry(): object {\r\n return this._physicsPlugin.getBodyGeometry(this);\r\n }\r\n\r\n /**\r\n * Returns an observable that will be notified for when a collision starts or continues for this PhysicsBody\r\n * @returns Observable\r\n */\r\n public getCollisionObservable(): Observable<IPhysicsCollisionEvent> {\r\n return this._physicsPlugin.getCollisionObservable(this);\r\n }\r\n\r\n /**\r\n * Returns an observable that will be notified when the body has finished colliding with another body\r\n * @returns\r\n */\r\n public getCollisionEndedObservable(): Observable<IBasePhysicsCollisionEvent> {\r\n return this._physicsPlugin.getCollisionEndedObservable(this);\r\n }\r\n\r\n /**\r\n * Enable or disable collision callback for this PhysicsBody.\r\n * @param enabled true if PhysicsBody's collision will rise a collision event and notifies the observable\r\n */\r\n public setCollisionCallbackEnabled(enabled: boolean): void {\r\n this._collisionCBEnabled = enabled;\r\n this._physicsPlugin.setCollisionCallbackEnabled(this, enabled);\r\n }\r\n\r\n /**\r\n * Enable or disable collision ended callback for this PhysicsBody.\r\n * @param enabled true if PhysicsBody's collision ended will rise a collision event and notifies the observable\r\n */\r\n public setCollisionEndedCallbackEnabled(enabled: boolean): void {\r\n this._collisionEndedCBEnabled = enabled;\r\n this._physicsPlugin.setCollisionEndedCallbackEnabled(this, enabled);\r\n }\r\n\r\n /**\r\n * Get the center of the object in world space.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the center for.\r\n * @returns geometric center of the associated mesh\r\n */\r\n public getObjectCenterWorld(instanceIndex?: number): Vector3 {\r\n const ref = new Vector3();\r\n return this.getObjectCenterWorldToRef(ref, instanceIndex);\r\n }\r\n\r\n /**\r\n * Get the center of the object in world space.\r\n * @param ref - The vector3 to store the result in.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to get the center for.\r\n * @returns geometric center of the associated mesh\r\n */\r\n public getObjectCenterWorldToRef(ref: Vector3, instanceIndex?: number): Vector3 {\r\n if (this._pluginDataInstances?.length > 0) {\r\n const index = instanceIndex || 0;\r\n const matrixData = (this.transformNode as Mesh)._thinInstanceDataStorage.matrixData;\r\n if (matrixData) {\r\n ref.set(matrixData[index * 16 + 12], matrixData[index * 16 + 13], matrixData[index * 16 + 14]);\r\n }\r\n } else {\r\n ref.copyFrom(this.transformNode.position);\r\n }\r\n return ref;\r\n }\r\n\r\n /**\r\n * Adds a constraint to the physics engine.\r\n *\r\n * @param childBody - The body to which the constraint will be applied.\r\n * @param constraint - The constraint to be applied.\r\n * @param instanceIndex - If this body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.\r\n * @param childInstanceIndex - If the child body is instanced, the index of the instance to which the constraint will be applied. If not specified, no constraint will be applied.\r\n *\r\n */\r\n public addConstraint(childBody: PhysicsBody, constraint: PhysicsConstraint, instanceIndex?: number, childInstanceIndex?: number): void {\r\n this._physicsPlugin.addConstraint(this, childBody, constraint, instanceIndex, childInstanceIndex);\r\n }\r\n\r\n /**\r\n * Sync with a bone\r\n * @param bone The bone that the impostor will be synced to.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n * @param boneAxis Optional vector3 axis the bone is aligned with\r\n */\r\n public syncWithBone(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion, boneAxis?: Vector3) {\r\n const mesh = this.transformNode;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = TmpVectors.Quaternion[0];\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, tempQuat);\r\n tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);\r\n } else {\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, mesh.rotationQuaternion);\r\n }\r\n }\r\n\r\n const pos = TmpVectors.Vector3[0];\r\n const boneDir = TmpVectors.Vector3[1];\r\n\r\n if (!boneAxis) {\r\n boneAxis = TmpVectors.Vector3[2];\r\n boneAxis.x = 0;\r\n boneAxis.y = 1;\r\n boneAxis.z = 0;\r\n }\r\n\r\n bone.getDirectionToRef(boneAxis, boneMesh, boneDir);\r\n bone.getAbsolutePositionToRef(boneMesh, pos);\r\n\r\n if ((distToJoint === undefined || distToJoint === null) && jointPivot) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n if (distToJoint !== undefined && distToJoint !== null) {\r\n pos.x += boneDir.x * distToJoint;\r\n pos.y += boneDir.y * distToJoint;\r\n pos.z += boneDir.z * distToJoint;\r\n }\r\n\r\n mesh.setAbsolutePosition(pos);\r\n }\r\n\r\n /**\r\n * Executes a callback on the body or all of the instances of a body\r\n * @param callback the callback to execute\r\n */\r\n public iterateOverAllInstances(callback: (body: PhysicsBody, instanceIndex?: number) => void) {\r\n if (this._pluginDataInstances?.length > 0) {\r\n for (let i = 0; i < this._pluginDataInstances.length; i++) {\r\n callback(this, i);\r\n }\r\n } else {\r\n callback(this, undefined);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the gravity factor of the physics body\r\n * @param factor the gravity factor to set\r\n * @param instanceIndex the instance of the body to set, if undefined all instances will be set\r\n */\r\n public setGravityFactor(factor: number, instanceIndex?: number) {\r\n this._physicsPlugin.setGravityFactor(this, factor, instanceIndex);\r\n }\r\n\r\n /**\r\n * Gets the gravity factor of the physics body\r\n * @param instanceIndex the instance of the body to get, if undefined the value of first instance will be returned\r\n * @returns the gravity factor\r\n */\r\n public getGravityFactor(instanceIndex?: number): number {\r\n return this._physicsPlugin.getGravityFactor(this, instanceIndex);\r\n }\r\n\r\n /**\r\n * Set the target transformation (position and rotation) of the body, such that the body will set its velocity to reach that target\r\n * @param position The target position\r\n * @param rotation The target rotation\r\n * @param instanceIndex The index of the instance in an instanced body\r\n */\r\n public setTargetTransform(position: Vector3, rotation: Quaternion, instanceIndex?: number) {\r\n this._physicsPlugin.setTargetTransform(this, position, rotation, instanceIndex);\r\n }\r\n\r\n /**\r\n * Returns if the body has been disposed.\r\n * @returns true if disposed, false otherwise.\r\n */\r\n public get isDisposed() {\r\n return this._isDisposed;\r\n }\r\n\r\n /**\r\n * Disposes the body from the physics engine.\r\n *\r\n * This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.\r\n */\r\n public dispose() {\r\n if (this._isDisposed) {\r\n return;\r\n }\r\n // Disable collisions CB so it doesn't fire when the body is disposed\r\n if (this._collisionCBEnabled) {\r\n this.setCollisionCallbackEnabled(false);\r\n }\r\n if (this._collisionEndedCBEnabled) {\r\n this.setCollisionEndedCallbackEnabled(false);\r\n }\r\n if (this._nodeDisposeObserver) {\r\n this.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver);\r\n this._nodeDisposeObserver = null;\r\n }\r\n this._physicsEngine.removeBody(this);\r\n this._physicsPlugin.removeBody(this);\r\n this._physicsPlugin.disposeBody(this);\r\n this.transformNode.physicsBody = null;\r\n this._pluginData = null;\r\n this._pluginDataInstances.length = 0;\r\n this._isDisposed = true;\r\n this.shape = null;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"thinSSRRenderingPipeline.js","sourceRoot":"","sources":["../../../../../../dev/core/src/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACjD,OAAO,EAAE,kBAAkB,EAAE,oCAA8C;AAC3E,OAAO,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I,kBAAa,GAAG,CAAC,CAAC;QAsBzB;;;WAGG;QACI,mBAAc,GAAG,CAAC,CAAC;QAkQtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,IAAI,CAAC,eAAe,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACtE,IAAI,CAAC,oBAAoB,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,GAAG,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzH,IAAI,CAAC,oBAAoB,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,IAAI,GAAG,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACzH,IAAI,CAAC,2BAA2B,GAAG,IAAI,8BAA8B,CAAC,IAAI,CAAC,IAAI,GAAG,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAE5H,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,GAAG,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,oBAAoB,EAAE,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,oBAAoB,EAAE,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,2BAA2B,EAAE,OAAO,EAAE,CAAC;IAChD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, CubeTexture, Scene, Camera } from \"core/index\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { ThinSSRPostProcess } from \"core/PostProcesses/thinSSRPostProcess\";\r\nimport { ThinSSRBlurPostProcess } from \"core/PostProcesses/thinSSRBlurPostProcess\";\r\nimport { ThinSSRBlurCombinerPostProcess } from \"core/PostProcesses/thinSSRBlurCombinerPostProcess\";\r\n\r\n/**\r\n * The SSR rendering pipeline is used to generate a reflection based on a flat mirror model.\r\n */\r\nexport class ThinSSRRenderingPipeline {\r\n /** @internal */\r\n public readonly _ssrPostProcess: ThinSSRPostProcess;\r\n /** @internal */\r\n public readonly _ssrBlurXPostProcess: ThinSSRBlurPostProcess;\r\n /** @internal */\r\n public readonly _ssrBlurYPostProcess: ThinSSRBlurPostProcess;\r\n /** @internal */\r\n public readonly _ssrBlurCombinerPostProcess: ThinSSRBlurCombinerPostProcess;\r\n\r\n /**\r\n * Gets or sets the name of the rendering pipeline\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the SSR rendering pipeline is supported\r\n */\r\n public get isSSRSupported(): boolean {\r\n return this._ssrPostProcess.isSSRSupported;\r\n }\r\n\r\n public set isSSRSupported(supported: boolean) {\r\n this._ssrPostProcess.isSSRSupported = supported;\r\n }\r\n\r\n /**\r\n * Gets or sets the maxDistance used to define how far we look for reflection during the ray-marching on the reflected ray (default: 1000).\r\n * Note that this value is a view (camera) space distance (not pixels!).\r\n */\r\n public get maxDistance() {\r\n return this._ssrPostProcess.maxDistance;\r\n }\r\n\r\n public set maxDistance(distance: number) {\r\n this._ssrPostProcess.maxDistance = distance;\r\n }\r\n\r\n /**\r\n * Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel. Should be an integer \\>= 1 as it is the number of pixels we advance at each step (default: 1).\r\n * Use higher values to improve performances (but at the expense of quality).\r\n */\r\n public get step() {\r\n return this._ssrPostProcess.step;\r\n }\r\n\r\n public set step(step: number) {\r\n this._ssrPostProcess.step = step;\r\n }\r\n\r\n /**\r\n * Gets or sets the thickness value used as tolerance when computing the intersection between the reflected ray and the scene (default: 0.5).\r\n * If setting \"enableAutomaticThicknessComputation\" to true, you can use lower values for \"thickness\" (even 0), as the geometry thickness\r\n * is automatically computed thank to the regular depth buffer + the backface depth buffer\r\n */\r\n public get thickness() {\r\n return this._ssrPostProcess.thickness;\r\n }\r\n\r\n public set thickness(thickness: number) {\r\n this._ssrPostProcess.thickness = thickness;\r\n }\r\n\r\n /**\r\n * Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results (default: 1).\r\n */\r\n public get strength() {\r\n return this._ssrPostProcess.strength;\r\n }\r\n\r\n public set strength(strength: number) {\r\n this._ssrPostProcess.strength = strength;\r\n this._ssrBlurCombinerPostProcess.strength = strength;\r\n }\r\n\r\n /**\r\n * Gets or sets the falloff exponent used to compute the reflection strength. Higher values lead to fainter reflections (default: 1).\r\n */\r\n public get reflectionSpecularFalloffExponent() {\r\n return this._ssrPostProcess.reflectionSpecularFalloffExponent;\r\n }\r\n\r\n public set reflectionSpecularFalloffExponent(exponent: number) {\r\n this._ssrPostProcess.reflectionSpecularFalloffExponent = exponent;\r\n this._ssrBlurCombinerPostProcess.reflectionSpecularFalloffExponent = exponent;\r\n }\r\n\r\n /**\r\n * Maximum number of steps during the ray marching process after which we consider an intersection could not be found (default: 1000).\r\n * Should be an integer value.\r\n */\r\n public get maxSteps() {\r\n return this._ssrPostProcess.maxSteps;\r\n }\r\n\r\n public set maxSteps(steps: number) {\r\n this._ssrPostProcess.maxSteps = steps;\r\n }\r\n\r\n /**\r\n * Gets or sets the factor applied when computing roughness. Default value is 0.2.\r\n * When blurring based on roughness is enabled (meaning blurDispersionStrength \\> 0), roughnessFactor is used as a global roughness factor applied on all objects.\r\n * If you want to disable this global roughness set it to 0.\r\n */\r\n public get roughnessFactor() {\r\n return this._ssrPostProcess.roughnessFactor;\r\n }\r\n\r\n public set roughnessFactor(factor: number) {\r\n this._ssrPostProcess.roughnessFactor = factor;\r\n }\r\n\r\n /**\r\n * Number of steps to skip at start when marching the ray to avoid self collisions (default: 1)\r\n * 1 should normally be a good value, depending on the scene you may need to use a higher value (2 or 3)\r\n */\r\n public get selfCollisionNumSkip() {\r\n return this._ssrPostProcess.selfCollisionNumSkip;\r\n }\r\n\r\n public set selfCollisionNumSkip(skip: number) {\r\n this._ssrPostProcess.selfCollisionNumSkip = skip;\r\n }\r\n\r\n /**\r\n * Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04).\r\n * If all r/g/b components of the reflectivity is below or equal this value, the pixel will not be considered reflective and SSR won't be applied.\r\n */\r\n public get reflectivityThreshold() {\r\n return this._ssrPostProcess.reflectivityThreshold;\r\n }\r\n\r\n public set reflectivityThreshold(threshold: number) {\r\n const currentThreshold = this._ssrPostProcess.reflectivityThreshold;\r\n\r\n if (threshold === currentThreshold) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.reflectivityThreshold = threshold;\r\n this._ssrBlurCombinerPostProcess.reflectivityThreshold = threshold;\r\n }\r\n\r\n /**\r\n * Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0).\r\n * Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.\r\n * Note that it is used only when blurring is enabled (blurDispersionStrength \\> 0), because in that mode the SSR contribution is generated in a separate texture.\r\n */\r\n public ssrDownsample = 0;\r\n\r\n /**\r\n * Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.03)\r\n * The reflections are blurred based on the roughness of the surface and the distance between the pixel shaded and the reflected pixel: the higher the distance the more blurry the reflection is.\r\n * blurDispersionStrength allows to increase or decrease this effect.\r\n */\r\n public get blurDispersionStrength() {\r\n return this._ssrBlurXPostProcess.blurStrength;\r\n }\r\n\r\n public set blurDispersionStrength(strength: number) {\r\n if (strength === this._ssrBlurXPostProcess.blurStrength) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.useBlur = strength > 0;\r\n\r\n this._ssrBlurXPostProcess.blurStrength = strength;\r\n this._ssrBlurYPostProcess.blurStrength = strength;\r\n }\r\n\r\n /**\r\n * Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0).\r\n * Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.\r\n */\r\n public blurDownsample = 0;\r\n\r\n /**\r\n * Gets or sets whether or not smoothing reflections is enabled (default: false)\r\n * Enabling smoothing will require more GPU power.\r\n * Note that this setting has no effect if step = 1: it's only used if step \\> 1.\r\n */\r\n public get enableSmoothReflections(): boolean {\r\n return this._ssrPostProcess.enableSmoothReflections;\r\n }\r\n\r\n public set enableSmoothReflections(enabled: boolean) {\r\n this._ssrPostProcess.enableSmoothReflections = enabled;\r\n }\r\n\r\n /**\r\n * Gets or sets the environment cube texture used to define the reflection when the reflected rays of SSR leave the view space or when the maxDistance/maxSteps is reached.\r\n */\r\n public get environmentTexture() {\r\n return this._ssrPostProcess.environmentTexture;\r\n }\r\n\r\n public set environmentTexture(texture: Nullable<CubeTexture>) {\r\n this._ssrPostProcess.environmentTexture = texture;\r\n }\r\n\r\n /**\r\n * Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false.\r\n * Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.\r\n */\r\n public get environmentTextureIsProbe(): boolean {\r\n return this._ssrPostProcess.environmentTextureIsProbe;\r\n }\r\n\r\n public set environmentTextureIsProbe(isProbe: boolean) {\r\n this._ssrPostProcess.environmentTextureIsProbe = isProbe;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).\r\n */\r\n public get attenuateScreenBorders() {\r\n return this._ssrPostProcess.attenuateScreenBorders;\r\n }\r\n\r\n public set attenuateScreenBorders(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateScreenBorders = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).\r\n */\r\n public get attenuateIntersectionDistance() {\r\n return this._ssrPostProcess.attenuateIntersectionDistance;\r\n }\r\n\r\n public set attenuateIntersectionDistance(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateIntersectionDistance = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection (default: true).\r\n */\r\n public get attenuateIntersectionIterations() {\r\n return this._ssrPostProcess.attenuateIntersectionIterations;\r\n }\r\n\r\n public set attenuateIntersectionIterations(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateIntersectionIterations = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) (default: false).\r\n */\r\n public get attenuateFacingCamera() {\r\n return this._ssrPostProcess.attenuateFacingCamera;\r\n }\r\n\r\n public set attenuateFacingCamera(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateFacingCamera = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).\r\n */\r\n public get attenuateBackfaceReflection() {\r\n return this._ssrPostProcess.attenuateBackfaceReflection;\r\n }\r\n\r\n public set attenuateBackfaceReflection(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateBackfaceReflection = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true).\r\n * You can try to set this parameter to false to save some performances: it may produce some artefacts in some cases, but generally they won't really be visible\r\n */\r\n public get clipToFrustum() {\r\n return this._ssrPostProcess.clipToFrustum;\r\n }\r\n\r\n public set clipToFrustum(clip: boolean) {\r\n this._ssrPostProcess.clipToFrustum = clip;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating whether the blending between the current color pixel and the reflection color should be done with a Fresnel coefficient (default: false).\r\n * It is more physically accurate to use the Fresnel coefficient (otherwise it uses the reflectivity of the material for blending), but it is also more expensive when you use blur (when blurDispersionStrength \\> 0).\r\n */\r\n public get useFresnel() {\r\n return this._ssrPostProcess.useFresnel;\r\n }\r\n\r\n public set useFresnel(fresnel: boolean) {\r\n this._ssrPostProcess.useFresnel = fresnel;\r\n this._ssrBlurCombinerPostProcess.useFresnel = fresnel;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false).\r\n * When enabled, a depth renderer is created which will render the back faces of the scene to a depth texture (meaning additional work for the GPU).\r\n * In that mode, the \"thickness\" property is still used as an offset to compute the ray intersection, but you can typically use a much lower\r\n * value than when enableAutomaticThicknessComputation is false (it's even possible to use a value of 0 when using low values for \"step\")\r\n * Note that for performance reasons, this option will only apply to the first camera to which the rendering pipeline is attached!\r\n */\r\n public get enableAutomaticThicknessComputation(): boolean {\r\n return this._ssrPostProcess.enableAutomaticThicknessComputation;\r\n }\r\n\r\n public set enableAutomaticThicknessComputation(automatic: boolean) {\r\n if (this._ssrPostProcess.enableAutomaticThicknessComputation === automatic) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.enableAutomaticThicknessComputation = automatic;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean defining if the input color texture is in gamma space (default: true)\r\n * The SSR effect works in linear space, so if the input texture is in gamma space, we must convert the texture to linear space before applying the effect\r\n */\r\n public get inputTextureColorIsInGammaSpace(): boolean {\r\n return this._ssrPostProcess.inputTextureColorIsInGammaSpace;\r\n }\r\n\r\n public set inputTextureColorIsInGammaSpace(gammaSpace: boolean) {\r\n if (this._ssrPostProcess.inputTextureColorIsInGammaSpace === gammaSpace) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.inputTextureColorIsInGammaSpace = gammaSpace;\r\n this._ssrBlurCombinerPostProcess.inputTextureColorIsInGammaSpace = gammaSpace;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true)\r\n * If you have a post-process that comes after the SSR and that post-process needs the input to be in a linear space, you must disable generateOutputInGammaSpace\r\n */\r\n public get generateOutputInGammaSpace(): boolean {\r\n return this._ssrPostProcess.generateOutputInGammaSpace;\r\n }\r\n\r\n public set generateOutputInGammaSpace(gammaSpace: boolean) {\r\n if (this._ssrPostProcess.generateOutputInGammaSpace === gammaSpace) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.generateOutputInGammaSpace = gammaSpace;\r\n this._ssrBlurCombinerPostProcess.generateOutputInGammaSpace = gammaSpace;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false).\r\n * In this mode, colors have this meaning:\r\n * - blue: the ray hit the max distance (we reached maxDistance)\r\n * - red: the ray ran out of steps (we reached maxSteps)\r\n * - yellow: the ray went off screen\r\n * - green: the ray hit a surface. The brightness of the green color is proportional to the distance between the ray origin and the intersection point: A brighter green means more computation than a darker green.\r\n * In the first 3 cases, the final color is calculated by mixing the skybox color with the pixel color (if environmentTexture is defined), otherwise the pixel color is not modified\r\n * You should try to get as few blue/red/yellow pixels as possible, as this means that the ray has gone further than if it had hit a surface.\r\n */\r\n public get debug(): boolean {\r\n return this._ssrPostProcess.debug;\r\n }\r\n\r\n public set debug(value: boolean) {\r\n if (this._ssrPostProcess.debug === value) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.debug = value;\r\n this._ssrBlurCombinerPostProcess.debug = value;\r\n }\r\n\r\n /**\r\n * Gets or sets the camera to use to render the reflection\r\n */\r\n public get camera() {\r\n return this._ssrPostProcess.camera;\r\n }\r\n\r\n public set camera(camera: Nullable<Camera>) {\r\n this._ssrPostProcess.camera = camera;\r\n this._ssrBlurCombinerPostProcess.camera = camera;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the depth buffer stores screen space depth instead of camera view space depth.\r\n */\r\n public get useScreenspaceDepth() {\r\n return this._ssrPostProcess.useScreenspaceDepth;\r\n }\r\n\r\n public set useScreenspaceDepth(use: boolean) {\r\n this._ssrPostProcess.useScreenspaceDepth = use;\r\n this._ssrBlurCombinerPostProcess.useScreenspaceDepth = use;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the normals are in world space (false by default, meaning normals are in camera view space).\r\n */\r\n public get normalsAreInWorldSpace() {\r\n return this._ssrPostProcess.normalsAreInWorldSpace;\r\n }\r\n\r\n public set normalsAreInWorldSpace(normalsAreInWorldSpace: boolean) {\r\n this._ssrPostProcess.normalsAreInWorldSpace = normalsAreInWorldSpace;\r\n this._ssrBlurCombinerPostProcess.normalsAreInWorldSpace = normalsAreInWorldSpace;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the normals are encoded as unsigned, that is normalUnsigned = normal*0.5+0.5 (false by default).\r\n */\r\n public get normalsAreUnsigned() {\r\n return this._ssrPostProcess.normalsAreUnsigned;\r\n }\r\n\r\n public set normalsAreUnsigned(normalsAreUnsigned: boolean) {\r\n this._ssrPostProcess.normalsAreUnsigned = normalsAreUnsigned;\r\n this._ssrBlurCombinerPostProcess.normalsAreUnsigned = normalsAreUnsigned;\r\n }\r\n\r\n /**\r\n * Checks if all the post processes in the pipeline are ready.\r\n * @returns true if all the post processes in the pipeline are ready\r\n */\r\n public isReady(): boolean {\r\n return this._ssrPostProcess.isReady() && this._ssrBlurXPostProcess.isReady() && this._ssrBlurYPostProcess.isReady() && this._ssrBlurCombinerPostProcess.isReady();\r\n }\r\n\r\n private _scene: Scene;\r\n\r\n /**\r\n * Constructor of the SSR rendering pipeline\r\n * @param name The rendering pipeline name\r\n * @param scene The scene linked to this pipeline\r\n */\r\n constructor(name: string, scene: Scene) {\r\n this.name = name;\r\n this._scene = scene;\r\n\r\n this._ssrPostProcess = new ThinSSRPostProcess(this.name, this._scene);\r\n this._ssrBlurXPostProcess = new ThinSSRBlurPostProcess(this.name + \" BlurX\", this._scene.getEngine(), new Vector2(1, 0));\r\n this._ssrBlurYPostProcess = new ThinSSRBlurPostProcess(this.name + \" BlurY\", this._scene.getEngine(), new Vector2(0, 1));\r\n this._ssrBlurCombinerPostProcess = new ThinSSRBlurCombinerPostProcess(this.name + \" BlurCombiner\", this._scene.getEngine());\r\n\r\n this._ssrPostProcess.useBlur = this._ssrBlurXPostProcess.blurStrength > 0;\r\n }\r\n\r\n /**\r\n * Disposes of the pipeline\r\n */\r\n public dispose(): void {\r\n this._ssrPostProcess?.dispose();\r\n this._ssrBlurXPostProcess?.dispose();\r\n this._ssrBlurYPostProcess?.dispose();\r\n this._ssrBlurCombinerPostProcess?.dispose();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"thinSSRRenderingPipeline.js","sourceRoot":"","sources":["../../../../../../dev/core/src/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACjD,OAAO,EAAE,kBAAkB,EAAE,oCAA8C;AAC3E,OAAO,EAAE,sBAAsB,EAAE,wCAAkD;AACnF,OAAO,EAAE,8BAA8B,EAAE,gDAA0D;AAEnG;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAejC;;OAEG;IACH,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC;IAC/C,CAAC;IAED,IAAW,cAAc,CAAC,SAAkB;QACxC,IAAI,CAAC,eAAe,CAAC,cAAc,GAAG,SAAS,CAAC;IACpD,CAAC;IAED;;;OAGG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;IAC5C,CAAC;IAED,IAAW,WAAW,CAAC,QAAgB;QACnC,IAAI,CAAC,eAAe,CAAC,WAAW,GAAG,QAAQ,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,IAAW,IAAI,CAAC,IAAY;QACxB,IAAI,CAAC,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC;IAC1C,CAAC;IAED,IAAW,SAAS,CAAC,SAAi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CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,YAAY,GAAG,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC;QAChC,IAAI,CAAC,oBAAoB,EAAE,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,oBAAoB,EAAE,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,2BAA2B,EAAE,OAAO,EAAE,CAAC;IAChD,CAAC;CACJ","sourcesContent":["import type { Nullable, CubeTexture, Scene, Camera } from \"core/index\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { ThinSSRPostProcess } from \"core/PostProcesses/thinSSRPostProcess\";\r\nimport { ThinSSRBlurPostProcess } from \"core/PostProcesses/thinSSRBlurPostProcess\";\r\nimport { ThinSSRBlurCombinerPostProcess } from \"core/PostProcesses/thinSSRBlurCombinerPostProcess\";\r\n\r\n/**\r\n * The SSR rendering pipeline is used to generate a reflection based on a flat mirror model.\r\n */\r\nexport class ThinSSRRenderingPipeline {\r\n /** @internal */\r\n public readonly _ssrPostProcess: ThinSSRPostProcess;\r\n /** @internal */\r\n public readonly _ssrBlurXPostProcess: ThinSSRBlurPostProcess;\r\n /** @internal */\r\n public readonly _ssrBlurYPostProcess: ThinSSRBlurPostProcess;\r\n /** @internal */\r\n public readonly _ssrBlurCombinerPostProcess: ThinSSRBlurCombinerPostProcess;\r\n\r\n /**\r\n * Gets or sets the name of the rendering pipeline\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the SSR rendering pipeline is supported\r\n */\r\n public get isSSRSupported(): boolean {\r\n return this._ssrPostProcess.isSSRSupported;\r\n }\r\n\r\n public set isSSRSupported(supported: boolean) {\r\n this._ssrPostProcess.isSSRSupported = supported;\r\n }\r\n\r\n /**\r\n * Gets or sets the maxDistance used to define how far we look for reflection during the ray-marching on the reflected ray (default: 1000).\r\n * Note that this value is a view (camera) space distance (not pixels!).\r\n */\r\n public get maxDistance() {\r\n return this._ssrPostProcess.maxDistance;\r\n }\r\n\r\n public set maxDistance(distance: number) {\r\n this._ssrPostProcess.maxDistance = distance;\r\n }\r\n\r\n /**\r\n * Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel. Should be an integer \\>= 1 as it is the number of pixels we advance at each step (default: 1).\r\n * Use higher values to improve performances (but at the expense of quality).\r\n */\r\n public get step() {\r\n return this._ssrPostProcess.step;\r\n }\r\n\r\n public set step(step: number) {\r\n this._ssrPostProcess.step = step;\r\n }\r\n\r\n /**\r\n * Gets or sets the thickness value used as tolerance when computing the intersection between the reflected ray and the scene (default: 0.5).\r\n * If setting \"enableAutomaticThicknessComputation\" to true, you can use lower values for \"thickness\" (even 0), as the geometry thickness\r\n * is automatically computed thank to the regular depth buffer + the backface depth buffer\r\n */\r\n public get thickness() {\r\n return this._ssrPostProcess.thickness;\r\n }\r\n\r\n public set thickness(thickness: number) {\r\n this._ssrPostProcess.thickness = thickness;\r\n }\r\n\r\n /**\r\n * Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results (default: 1).\r\n */\r\n public get strength() {\r\n return this._ssrPostProcess.strength;\r\n }\r\n\r\n public set strength(strength: number) {\r\n this._ssrPostProcess.strength = strength;\r\n this._ssrBlurCombinerPostProcess.strength = strength;\r\n }\r\n\r\n /**\r\n * Gets or sets the falloff exponent used to compute the reflection strength. Higher values lead to fainter reflections (default: 1).\r\n */\r\n public get reflectionSpecularFalloffExponent() {\r\n return this._ssrPostProcess.reflectionSpecularFalloffExponent;\r\n }\r\n\r\n public set reflectionSpecularFalloffExponent(exponent: number) {\r\n this._ssrPostProcess.reflectionSpecularFalloffExponent = exponent;\r\n this._ssrBlurCombinerPostProcess.reflectionSpecularFalloffExponent = exponent;\r\n }\r\n\r\n /**\r\n * Maximum number of steps during the ray marching process after which we consider an intersection could not be found (default: 1000).\r\n * Should be an integer value.\r\n */\r\n public get maxSteps() {\r\n return this._ssrPostProcess.maxSteps;\r\n }\r\n\r\n public set maxSteps(steps: number) {\r\n this._ssrPostProcess.maxSteps = steps;\r\n }\r\n\r\n /**\r\n * Gets or sets the factor applied when computing roughness. Default value is 0.2.\r\n * When blurring based on roughness is enabled (meaning blurDispersionStrength \\> 0), roughnessFactor is used as a global roughness factor applied on all objects.\r\n * If you want to disable this global roughness set it to 0.\r\n */\r\n public get roughnessFactor() {\r\n return this._ssrPostProcess.roughnessFactor;\r\n }\r\n\r\n public set roughnessFactor(factor: number) {\r\n this._ssrPostProcess.roughnessFactor = factor;\r\n }\r\n\r\n /**\r\n * Number of steps to skip at start when marching the ray to avoid self collisions (default: 1)\r\n * 1 should normally be a good value, depending on the scene you may need to use a higher value (2 or 3)\r\n */\r\n public get selfCollisionNumSkip() {\r\n return this._ssrPostProcess.selfCollisionNumSkip;\r\n }\r\n\r\n public set selfCollisionNumSkip(skip: number) {\r\n this._ssrPostProcess.selfCollisionNumSkip = skip;\r\n }\r\n\r\n /**\r\n * Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04).\r\n * If all r/g/b components of the reflectivity is below or equal this value, the pixel will not be considered reflective and SSR won't be applied.\r\n */\r\n public get reflectivityThreshold() {\r\n return this._ssrPostProcess.reflectivityThreshold;\r\n }\r\n\r\n public set reflectivityThreshold(threshold: number) {\r\n const currentThreshold = this._ssrPostProcess.reflectivityThreshold;\r\n\r\n if (threshold === currentThreshold) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.reflectivityThreshold = threshold;\r\n this._ssrBlurCombinerPostProcess.reflectivityThreshold = threshold;\r\n }\r\n\r\n /**\r\n * Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0).\r\n * Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.\r\n * Note that it is used only when blurring is enabled (blurDispersionStrength \\> 0), because in that mode the SSR contribution is generated in a separate texture.\r\n */\r\n public ssrDownsample = 0;\r\n\r\n /**\r\n * Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.03)\r\n * The reflections are blurred based on the roughness of the surface and the distance between the pixel shaded and the reflected pixel: the higher the distance the more blurry the reflection is.\r\n * blurDispersionStrength allows to increase or decrease this effect.\r\n */\r\n public get blurDispersionStrength() {\r\n return this._ssrBlurXPostProcess.blurStrength;\r\n }\r\n\r\n public set blurDispersionStrength(strength: number) {\r\n if (strength === this._ssrBlurXPostProcess.blurStrength) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.useBlur = strength > 0;\r\n\r\n this._ssrBlurXPostProcess.blurStrength = strength;\r\n this._ssrBlurYPostProcess.blurStrength = strength;\r\n }\r\n\r\n /**\r\n * Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0).\r\n * Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.\r\n */\r\n public blurDownsample = 0;\r\n\r\n /**\r\n * Gets or sets whether or not smoothing reflections is enabled (default: false)\r\n * Enabling smoothing will require more GPU power.\r\n * Note that this setting has no effect if step = 1: it's only used if step \\> 1.\r\n */\r\n public get enableSmoothReflections(): boolean {\r\n return this._ssrPostProcess.enableSmoothReflections;\r\n }\r\n\r\n public set enableSmoothReflections(enabled: boolean) {\r\n this._ssrPostProcess.enableSmoothReflections = enabled;\r\n }\r\n\r\n /**\r\n * Gets or sets the environment cube texture used to define the reflection when the reflected rays of SSR leave the view space or when the maxDistance/maxSteps is reached.\r\n */\r\n public get environmentTexture() {\r\n return this._ssrPostProcess.environmentTexture;\r\n }\r\n\r\n public set environmentTexture(texture: Nullable<CubeTexture>) {\r\n this._ssrPostProcess.environmentTexture = texture;\r\n }\r\n\r\n /**\r\n * Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false.\r\n * Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.\r\n */\r\n public get environmentTextureIsProbe(): boolean {\r\n return this._ssrPostProcess.environmentTextureIsProbe;\r\n }\r\n\r\n public set environmentTextureIsProbe(isProbe: boolean) {\r\n this._ssrPostProcess.environmentTextureIsProbe = isProbe;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).\r\n */\r\n public get attenuateScreenBorders() {\r\n return this._ssrPostProcess.attenuateScreenBorders;\r\n }\r\n\r\n public set attenuateScreenBorders(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateScreenBorders = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).\r\n */\r\n public get attenuateIntersectionDistance() {\r\n return this._ssrPostProcess.attenuateIntersectionDistance;\r\n }\r\n\r\n public set attenuateIntersectionDistance(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateIntersectionDistance = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection (default: true).\r\n */\r\n public get attenuateIntersectionIterations() {\r\n return this._ssrPostProcess.attenuateIntersectionIterations;\r\n }\r\n\r\n public set attenuateIntersectionIterations(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateIntersectionIterations = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) (default: false).\r\n */\r\n public get attenuateFacingCamera() {\r\n return this._ssrPostProcess.attenuateFacingCamera;\r\n }\r\n\r\n public set attenuateFacingCamera(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateFacingCamera = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).\r\n */\r\n public get attenuateBackfaceReflection() {\r\n return this._ssrPostProcess.attenuateBackfaceReflection;\r\n }\r\n\r\n public set attenuateBackfaceReflection(attenuate: boolean) {\r\n this._ssrPostProcess.attenuateBackfaceReflection = attenuate;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true).\r\n * You can try to set this parameter to false to save some performances: it may produce some artefacts in some cases, but generally they won't really be visible\r\n */\r\n public get clipToFrustum() {\r\n return this._ssrPostProcess.clipToFrustum;\r\n }\r\n\r\n public set clipToFrustum(clip: boolean) {\r\n this._ssrPostProcess.clipToFrustum = clip;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating whether the blending between the current color pixel and the reflection color should be done with a Fresnel coefficient (default: false).\r\n * It is more physically accurate to use the Fresnel coefficient (otherwise it uses the reflectivity of the material for blending), but it is also more expensive when you use blur (when blurDispersionStrength \\> 0).\r\n */\r\n public get useFresnel() {\r\n return this._ssrPostProcess.useFresnel;\r\n }\r\n\r\n public set useFresnel(fresnel: boolean) {\r\n this._ssrPostProcess.useFresnel = fresnel;\r\n this._ssrBlurCombinerPostProcess.useFresnel = fresnel;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false).\r\n * When enabled, a depth renderer is created which will render the back faces of the scene to a depth texture (meaning additional work for the GPU).\r\n * In that mode, the \"thickness\" property is still used as an offset to compute the ray intersection, but you can typically use a much lower\r\n * value than when enableAutomaticThicknessComputation is false (it's even possible to use a value of 0 when using low values for \"step\")\r\n * Note that for performance reasons, this option will only apply to the first camera to which the rendering pipeline is attached!\r\n */\r\n public get enableAutomaticThicknessComputation(): boolean {\r\n return this._ssrPostProcess.enableAutomaticThicknessComputation;\r\n }\r\n\r\n public set enableAutomaticThicknessComputation(automatic: boolean) {\r\n if (this._ssrPostProcess.enableAutomaticThicknessComputation === automatic) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.enableAutomaticThicknessComputation = automatic;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean defining if the input color texture is in gamma space (default: true)\r\n * The SSR effect works in linear space, so if the input texture is in gamma space, we must convert the texture to linear space before applying the effect\r\n */\r\n public get inputTextureColorIsInGammaSpace(): boolean {\r\n return this._ssrPostProcess.inputTextureColorIsInGammaSpace;\r\n }\r\n\r\n public set inputTextureColorIsInGammaSpace(gammaSpace: boolean) {\r\n if (this._ssrPostProcess.inputTextureColorIsInGammaSpace === gammaSpace) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.inputTextureColorIsInGammaSpace = gammaSpace;\r\n this._ssrBlurCombinerPostProcess.inputTextureColorIsInGammaSpace = gammaSpace;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true)\r\n * If you have a post-process that comes after the SSR and that post-process needs the input to be in a linear space, you must disable generateOutputInGammaSpace\r\n */\r\n public get generateOutputInGammaSpace(): boolean {\r\n return this._ssrPostProcess.generateOutputInGammaSpace;\r\n }\r\n\r\n public set generateOutputInGammaSpace(gammaSpace: boolean) {\r\n if (this._ssrPostProcess.generateOutputInGammaSpace === gammaSpace) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.generateOutputInGammaSpace = gammaSpace;\r\n this._ssrBlurCombinerPostProcess.generateOutputInGammaSpace = gammaSpace;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false).\r\n * In this mode, colors have this meaning:\r\n * - blue: the ray hit the max distance (we reached maxDistance)\r\n * - red: the ray ran out of steps (we reached maxSteps)\r\n * - yellow: the ray went off screen\r\n * - green: the ray hit a surface. The brightness of the green color is proportional to the distance between the ray origin and the intersection point: A brighter green means more computation than a darker green.\r\n * In the first 3 cases, the final color is calculated by mixing the skybox color with the pixel color (if environmentTexture is defined), otherwise the pixel color is not modified\r\n * You should try to get as few blue/red/yellow pixels as possible, as this means that the ray has gone further than if it had hit a surface.\r\n */\r\n public get debug(): boolean {\r\n return this._ssrPostProcess.debug;\r\n }\r\n\r\n public set debug(value: boolean) {\r\n if (this._ssrPostProcess.debug === value) {\r\n return;\r\n }\r\n\r\n this._ssrPostProcess.debug = value;\r\n this._ssrBlurCombinerPostProcess.debug = value;\r\n }\r\n\r\n /**\r\n * Gets or sets the camera to use to render the reflection\r\n */\r\n public get camera() {\r\n return this._ssrPostProcess.camera;\r\n }\r\n\r\n public set camera(camera: Nullable<Camera>) {\r\n this._ssrPostProcess.camera = camera;\r\n this._ssrBlurCombinerPostProcess.camera = camera;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the depth buffer stores screen space depth instead of camera view space depth.\r\n */\r\n public get useScreenspaceDepth() {\r\n return this._ssrPostProcess.useScreenspaceDepth;\r\n }\r\n\r\n public set useScreenspaceDepth(use: boolean) {\r\n this._ssrPostProcess.useScreenspaceDepth = use;\r\n this._ssrBlurCombinerPostProcess.useScreenspaceDepth = use;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the normals are in world space (false by default, meaning normals are in camera view space).\r\n */\r\n public get normalsAreInWorldSpace() {\r\n return this._ssrPostProcess.normalsAreInWorldSpace;\r\n }\r\n\r\n public set normalsAreInWorldSpace(normalsAreInWorldSpace: boolean) {\r\n this._ssrPostProcess.normalsAreInWorldSpace = normalsAreInWorldSpace;\r\n this._ssrBlurCombinerPostProcess.normalsAreInWorldSpace = normalsAreInWorldSpace;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the normals are encoded as unsigned, that is normalUnsigned = normal*0.5+0.5 (false by default).\r\n */\r\n public get normalsAreUnsigned() {\r\n return this._ssrPostProcess.normalsAreUnsigned;\r\n }\r\n\r\n public set normalsAreUnsigned(normalsAreUnsigned: boolean) {\r\n this._ssrPostProcess.normalsAreUnsigned = normalsAreUnsigned;\r\n this._ssrBlurCombinerPostProcess.normalsAreUnsigned = normalsAreUnsigned;\r\n }\r\n\r\n /**\r\n * Checks if all the post processes in the pipeline are ready.\r\n * @returns true if all the post processes in the pipeline are ready\r\n */\r\n public isReady(): boolean {\r\n return this._ssrPostProcess.isReady() && this._ssrBlurXPostProcess.isReady() && this._ssrBlurYPostProcess.isReady() && this._ssrBlurCombinerPostProcess.isReady();\r\n }\r\n\r\n private _scene: Scene;\r\n\r\n /**\r\n * Constructor of the SSR rendering pipeline\r\n * @param name The rendering pipeline name\r\n * @param scene The scene linked to this pipeline\r\n */\r\n constructor(name: string, scene: Scene) {\r\n this.name = name;\r\n this._scene = scene;\r\n\r\n this._ssrPostProcess = new ThinSSRPostProcess(this.name, this._scene);\r\n this._ssrBlurXPostProcess = new ThinSSRBlurPostProcess(this.name + \" BlurX\", this._scene.getEngine(), new Vector2(1, 0));\r\n this._ssrBlurYPostProcess = new ThinSSRBlurPostProcess(this.name + \" BlurY\", this._scene.getEngine(), new Vector2(0, 1));\r\n this._ssrBlurCombinerPostProcess = new ThinSSRBlurCombinerPostProcess(this.name + \" BlurCombiner\", this._scene.getEngine());\r\n\r\n this._ssrPostProcess.useBlur = this._ssrBlurXPostProcess.blurStrength > 0;\r\n }\r\n\r\n /**\r\n * Disposes of the pipeline\r\n */\r\n public dispose(): void {\r\n this._ssrPostProcess?.dispose();\r\n this._ssrBlurXPostProcess?.dispose();\r\n this._ssrBlurYPostProcess?.dispose();\r\n this._ssrBlurCombinerPostProcess?.dispose();\r\n }\r\n}\r\n"]}
@@ -1,4 +1,4 @@
1
- /* eslint-disable import/no-internal-modules */
1
+ /* eslint-disable @typescript-eslint/no-restricted-imports */
2
2
  export * from "./Pipelines/index.js";
3
3
  export * from "./postProcessRenderEffect.js";
4
4
  export * from "./postProcessRenderPipeline.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/PostProcesses/RenderPipeline/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kDAAkD,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Pipelines/index\";\r\nexport * from \"./postProcessRenderEffect\";\r\nexport * from \"./postProcessRenderPipeline\";\r\nexport * from \"./postProcessRenderPipelineManager\";\r\nexport * from \"./postProcessRenderPipelineManagerSceneComponent\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/PostProcesses/RenderPipeline/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kDAAkD,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport * from \"./Pipelines/index\";\r\nexport * from \"./postProcessRenderEffect\";\r\nexport * from \"./postProcessRenderPipeline\";\r\nexport * from \"./postProcessRenderPipelineManager\";\r\nexport * from \"./postProcessRenderPipelineManagerSceneComponent\";\r\n"]}
@@ -1,4 +1,4 @@
1
- /* eslint-disable import/no-internal-modules */
1
+ /* eslint-disable @typescript-eslint/no-restricted-imports */
2
2
  export * from "./anaglyphPostProcess.js";
3
3
  export * from "./blackAndWhitePostProcess.js";
4
4
  export * from "./bloomEffect.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BA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,iCAAiC,CAAC;AAEhD,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAE9C,uBAAuB;AACvB,cAAc,yCAAyC,CAAC;AACxD,cAAc,6CAA6C,CAAC;AAE5D,uBAAuB;AACvB,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAE1D,sBAAsB;AACtB,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAE1D,QAAQ;AACR,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,qBAAqB;AACrB,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAE1D,OAAO;AACP,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAE3C,MAAM;AACN,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AAEtD,WAAW;AACX,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AAEjD,cAAc;AACd,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,mBAAmB;AACnB,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AAExD,cAAc;AACd,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,SAAS;AACT,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,aAAa;AACb,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,UAAU;AACV,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./anaglyphPostProcess\";\r\nexport * from \"./blackAndWhitePostProcess\";\r\nexport * from \"./bloomEffect\";\r\nexport * from \"./bloomMergePostProcess\";\r\nexport * from \"./blurPostProcess\";\r\nexport * from \"./chromaticAberrationPostProcess\";\r\nexport * from \"./circleOfConfusionPostProcess\";\r\nexport * from \"./colorCorrectionPostProcess\";\r\nexport * from \"./convolutionPostProcess\";\r\nexport * from \"./depthOfFieldBlurPostProcess\";\r\nexport * from \"./depthOfFieldEffect\";\r\nexport * from \"./depthOfFieldMergePostProcess\";\r\nexport * from \"./displayPassPostProcess\";\r\nexport * from \"./extractHighlightsPostProcess\";\r\nexport * from \"./filterPostProcess\";\r\nexport * from \"./fxaaPostProcess\";\r\nexport * from \"./grainPostProcess\";\r\nexport * from \"./highlightsPostProcess\";\r\nexport * from \"./imageProcessingPostProcess\";\r\nexport * from \"./motionBlurPostProcess\";\r\nexport * from \"./passPostProcess\";\r\nexport * from \"./postProcess\";\r\nexport * from \"./postProcessManager\";\r\nexport * from \"./refractionPostProcess\";\r\nexport * from \"./RenderPipeline/index\";\r\nexport * from \"./sharpenPostProcess\";\r\nexport * from \"./stereoscopicInterlacePostProcess\";\r\nexport * from \"./tonemapPostProcess\";\r\nexport * from \"./volumetricLightScatteringPostProcess\";\r\nexport * from \"./vrDistortionCorrectionPostProcess\";\r\nexport * from \"./vrMultiviewToSingleviewPostProcess\";\r\nexport * from \"./screenSpaceReflectionPostProcess\";\r\nexport * from \"./screenSpaceCurvaturePostProcess\";\r\n\r\nexport * from \"./thinAnaglyphPostProcess\";\r\nexport * from \"./thinBlackAndWhitePostProcess\";\r\nexport * from \"./thinBloomEffect\";\r\nexport * from \"./thinBlurPostProcess\";\r\nexport * from \"./thinChromaticAberrationPostProcess\";\r\nexport * from \"./thinCircleOfConfusionPostProcess\";\r\nexport * from \"./thinDepthOfFieldEffect\";\r\nexport * from \"./thinExtractHighlightsPostProcess\";\r\nexport * from \"./thinFXAAPostProcess\";\r\nexport * from \"./thinGrainPostProcess\";\r\nexport * from \"./thinImageProcessingPostProcess\";\r\nexport * from \"./thinMotionBlurPostProcess\";\r\nexport * from \"./thinPassPostProcess\";\r\n\r\n// Postprocess\r\nexport * from \"../Shaders/postprocess.vertex\";\r\nexport * from \"../ShadersWGSL/postprocess.vertex\";\r\n\r\n// Blur postprocess\r\nexport * from \"../Shaders/kernelBlur.fragment\";\r\nexport * from \"../Shaders/kernelBlur.vertex\";\r\nexport * from \"../ShadersWGSL/kernelBlur.fragment\";\r\nexport * from \"../ShadersWGSL/kernelBlur.vertex\";\r\n\r\n// Pass postprocess\r\nexport * from \"../Shaders/pass.fragment\";\r\nexport * from \"../Shaders/passCube.fragment\";\r\nexport * from \"../ShadersWGSL/pass.fragment\";\r\nexport * from \"../ShadersWGSL/passCube.fragment\";\r\n\r\n// vrDFistortionCorrection postprocess\r\nexport * from \"../Shaders/vrDistortionCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/vrDistortionCorrection.fragment\";\r\n\r\n// Image processing postprocess\r\nexport * from \"../ShadersWGSL/imageProcessing.fragment\";\r\nexport * from \"../Shaders/imageProcessing.fragment\";\r\n\r\n// Sharpen\r\nexport * from \"../Shaders/sharpen.fragment\";\r\nexport * from \"../ShadersWGSL/sharpen.fragment\";\r\n\r\n// Grain\r\nexport * from \"../Shaders/grain.fragment\";\r\nexport * from \"../ShadersWGSL/grain.fragment\";\r\n\r\n// Chromatic Aberration\r\nexport * from \"../Shaders/chromaticAberration.fragment\";\r\nexport * from \"../ShadersWGSL/chromaticAberration.fragment\";\r\n\r\n// Depth of field merge\r\nexport * from \"../Shaders/depthOfFieldMerge.fragment\";\r\nexport * from \"../ShadersWGSL/depthOfFieldMerge.fragment\";\r\n\r\n// Circle of confusion\r\nexport * from \"../Shaders/circleOfConfusion.fragment\";\r\nexport * from \"../ShadersWGSL/circleOfConfusion.fragment\";\r\n\r\n// Bloom\r\nexport * from \"../Shaders/bloomMerge.fragment\";\r\nexport * from \"../ShadersWGSL/bloomMerge.fragment\";\r\n\r\n// Extract highlights\r\nexport * from \"../Shaders/extractHighlights.fragment\";\r\nexport * from \"../ShadersWGSL/extractHighlights.fragment\";\r\n\r\n// FXAA\r\nexport * from \"../Shaders/fxaa.fragment\";\r\nexport * from \"../Shaders/fxaa.vertex\";\r\nexport * from \"../ShadersWGSL/fxaa.fragment\";\r\nexport * from \"../ShadersWGSL/fxaa.vertex\";\r\n\r\n// B&W\r\nexport * from \"../Shaders/blackAndWhite.fragment\";\r\nexport * from \"../ShadersWGSL/blackAndWhite.fragment\";\r\n\r\n// Anaglyph\r\nexport * from \"../Shaders/anaglyph.fragment\";\r\nexport * from \"../ShadersWGSL/anaglyph.fragment\";\r\n\r\n// Convolution\r\nexport * from \"../Shaders/convolution.fragment\";\r\nexport * from \"../ShadersWGSL/convolution.fragment\";\r\n\r\n// Color correction\r\nexport * from \"../Shaders/colorCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/colorCorrection.fragment\";\r\n\r\n// Motion blur\r\nexport * from \"../Shaders/motionBlur.fragment\";\r\nexport * from \"../ShadersWGSL/motionBlur.fragment\";\r\n\r\n// Filter\r\nexport * from \"../Shaders/filter.fragment\";\r\nexport * from \"../ShadersWGSL/filter.fragment\";\r\n\r\n// Highlights\r\nexport * from \"../Shaders/highlights.fragment\";\r\nexport * from \"../ShadersWGSL/highlights.fragment\";\r\n\r\n// Display\r\nexport * from \"../Shaders/displayPass.fragment\";\r\nexport * from \"../ShadersWGSL/displayPass.fragment\";\r\n\r\n// Tonemap\r\nexport * from \"../Shaders/tonemap.fragment\";\r\nexport * from \"../ShadersWGSL/tonemap.fragment\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,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AC3C,cAAc,gCAAgC,CAAC;AAE/C,aAAa;AACb,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,UAAU;AACV,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport * from \"./anaglyphPostProcess\";\r\nexport * from \"./blackAndWhitePostProcess\";\r\nexport * from \"./bloomEffect\";\r\nexport * from \"./bloomMergePostProcess\";\r\nexport * from \"./blurPostProcess\";\r\nexport * from \"./chromaticAberrationPostProcess\";\r\nexport * from \"./circleOfConfusionPostProcess\";\r\nexport * from \"./colorCorrectionPostProcess\";\r\nexport * from \"./convolutionPostProcess\";\r\nexport * from \"./depthOfFieldBlurPostProcess\";\r\nexport * from \"./depthOfFieldEffect\";\r\nexport * from \"./depthOfFieldMergePostProcess\";\r\nexport * from \"./displayPassPostProcess\";\r\nexport * from \"./extractHighlightsPostProcess\";\r\nexport * from \"./filterPostProcess\";\r\nexport * from \"./fxaaPostProcess\";\r\nexport * from \"./grainPostProcess\";\r\nexport * from \"./highlightsPostProcess\";\r\nexport * from \"./imageProcessingPostProcess\";\r\nexport * from \"./motionBlurPostProcess\";\r\nexport * from \"./passPostProcess\";\r\nexport * from \"./postProcess\";\r\nexport * from \"./postProcessManager\";\r\nexport * from \"./refractionPostProcess\";\r\nexport * from \"./RenderPipeline/index\";\r\nexport * from \"./sharpenPostProcess\";\r\nexport * from \"./stereoscopicInterlacePostProcess\";\r\nexport * from \"./tonemapPostProcess\";\r\nexport * from \"./volumetricLightScatteringPostProcess\";\r\nexport * from \"./vrDistortionCorrectionPostProcess\";\r\nexport * from \"./vrMultiviewToSingleviewPostProcess\";\r\nexport * from \"./screenSpaceReflectionPostProcess\";\r\nexport * from \"./screenSpaceCurvaturePostProcess\";\r\n\r\nexport * from \"./thinAnaglyphPostProcess\";\r\nexport * from \"./thinBlackAndWhitePostProcess\";\r\nexport * from \"./thinBloomEffect\";\r\nexport * from \"./thinBlurPostProcess\";\r\nexport * from \"./thinChromaticAberrationPostProcess\";\r\nexport * from \"./thinCircleOfConfusionPostProcess\";\r\nexport * from \"./thinDepthOfFieldEffect\";\r\nexport * from \"./thinExtractHighlightsPostProcess\";\r\nexport * from \"./thinFXAAPostProcess\";\r\nexport * from \"./thinGrainPostProcess\";\r\nexport * from \"./thinImageProcessingPostProcess\";\r\nexport * from \"./thinMotionBlurPostProcess\";\r\nexport * from \"./thinPassPostProcess\";\r\n\r\n// Postprocess\r\nexport * from \"../Shaders/postprocess.vertex\";\r\nexport * from \"../ShadersWGSL/postprocess.vertex\";\r\n\r\n// Blur postprocess\r\nexport * from \"../Shaders/kernelBlur.fragment\";\r\nexport * from \"../Shaders/kernelBlur.vertex\";\r\nexport * from \"../ShadersWGSL/kernelBlur.fragment\";\r\nexport * from \"../ShadersWGSL/kernelBlur.vertex\";\r\n\r\n// Pass postprocess\r\nexport * from \"../Shaders/pass.fragment\";\r\nexport * from \"../Shaders/passCube.fragment\";\r\nexport * from \"../ShadersWGSL/pass.fragment\";\r\nexport * from \"../ShadersWGSL/passCube.fragment\";\r\n\r\n// vrDFistortionCorrection postprocess\r\nexport * from \"../Shaders/vrDistortionCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/vrDistortionCorrection.fragment\";\r\n\r\n// Image processing postprocess\r\nexport * from \"../ShadersWGSL/imageProcessing.fragment\";\r\nexport * from \"../Shaders/imageProcessing.fragment\";\r\n\r\n// Sharpen\r\nexport * from \"../Shaders/sharpen.fragment\";\r\nexport * from \"../ShadersWGSL/sharpen.fragment\";\r\n\r\n// Grain\r\nexport * from \"../Shaders/grain.fragment\";\r\nexport * from \"../ShadersWGSL/grain.fragment\";\r\n\r\n// Chromatic Aberration\r\nexport * from \"../Shaders/chromaticAberration.fragment\";\r\nexport * from \"../ShadersWGSL/chromaticAberration.fragment\";\r\n\r\n// Depth of field merge\r\nexport * from \"../Shaders/depthOfFieldMerge.fragment\";\r\nexport * from \"../ShadersWGSL/depthOfFieldMerge.fragment\";\r\n\r\n// Circle of confusion\r\nexport * from \"../Shaders/circleOfConfusion.fragment\";\r\nexport * from \"../ShadersWGSL/circleOfConfusion.fragment\";\r\n\r\n// Bloom\r\nexport * from \"../Shaders/bloomMerge.fragment\";\r\nexport * from \"../ShadersWGSL/bloomMerge.fragment\";\r\n\r\n// Extract highlights\r\nexport * from \"../Shaders/extractHighlights.fragment\";\r\nexport * from \"../ShadersWGSL/extractHighlights.fragment\";\r\n\r\n// FXAA\r\nexport * from \"../Shaders/fxaa.fragment\";\r\nexport * from \"../Shaders/fxaa.vertex\";\r\nexport * from \"../ShadersWGSL/fxaa.fragment\";\r\nexport * from \"../ShadersWGSL/fxaa.vertex\";\r\n\r\n// B&W\r\nexport * from \"../Shaders/blackAndWhite.fragment\";\r\nexport * from \"../ShadersWGSL/blackAndWhite.fragment\";\r\n\r\n// Anaglyph\r\nexport * from \"../Shaders/anaglyph.fragment\";\r\nexport * from \"../ShadersWGSL/anaglyph.fragment\";\r\n\r\n// Convolution\r\nexport * from \"../Shaders/convolution.fragment\";\r\nexport * from \"../ShadersWGSL/convolution.fragment\";\r\n\r\n// Color correction\r\nexport * from \"../Shaders/colorCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/colorCorrection.fragment\";\r\n\r\n// Motion blur\r\nexport * from \"../Shaders/motionBlur.fragment\";\r\nexport * from \"../ShadersWGSL/motionBlur.fragment\";\r\n\r\n// Filter\r\nexport * from \"../Shaders/filter.fragment\";\r\nexport * from \"../ShadersWGSL/filter.fragment\";\r\n\r\n// Highlights\r\nexport * from \"../Shaders/highlights.fragment\";\r\nexport * from \"../ShadersWGSL/highlights.fragment\";\r\n\r\n// Display\r\nexport * from \"../Shaders/displayPass.fragment\";\r\nexport * from \"../ShadersWGSL/displayPass.fragment\";\r\n\r\n// Tonemap\r\nexport * from \"../Shaders/tonemap.fragment\";\r\nexport * from \"../ShadersWGSL/tonemap.fragment\";\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"thinAnaglyphPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinAnaglyphPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,aAAa;IAWnC,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAsC;QACrG,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,iBAAkB;YAC3C,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,uBAAuB,CAAC,WAAW;YACnD,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACP,CAAC;;AAnCD;;GAEG;AACoB,mCAAW,GAAG,UAAU,CAAC;AAEhD;;GAEG;AACoB,gCAAQ,GAAG,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Postprocess used to generate anaglyphic rendering\r\n */\r\nexport class ThinAnaglyphPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"anaglyph\";\r\n\r\n /**\r\n * The list of samplers used by the effect\r\n */\r\n public static readonly Samplers = [\"leftSampler\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/anaglyph.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/anaglyph.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new anaglyph post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinAnaglyphPostProcess.FragmentUrl,\r\n samplers: ThinAnaglyphPostProcess.Samplers,\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"thinAnaglyphPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinAnaglyphPostProcess.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,aAAa;IAWnC,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAsC;QACrG,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,iBAAkB;YAC3C,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,uBAAuB,CAAC,WAAW;YACnD,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;SAC7C,CAAC,CAAC;IACP,CAAC;;AAnCD;;GAEG;AACoB,mCAAW,GAAG,UAAU,CAAC;AAEhD;;GAEG;AACoB,gCAAQ,GAAG,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Postprocess used to generate anaglyphic rendering\r\n */\r\nexport class ThinAnaglyphPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"anaglyph\";\r\n\r\n /**\r\n * The list of samplers used by the effect\r\n */\r\n public static readonly Samplers = [\"leftSampler\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/anaglyph.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/anaglyph.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new anaglyph post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinAnaglyphPostProcess.FragmentUrl,\r\n samplers: ThinAnaglyphPostProcess.Samplers,\r\n });\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"thinBlackAndWhitePostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinBlackAndWhitePostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,aAAa;IAWxC,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,uCAAuC,CAAC,CAAC,CAAC;QAC/D,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC,CAAC;QAC3D,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAsC;QACrG,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,iBAAkB;YAC3C,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,4BAA4B,CAAC,WAAW;YACxD,QAAQ,EAAE,4BAA4B,CAAC,QAAQ;SAClD,CAAC,CAAC;QAGP;;WAEG;QACI,WAAM,GAAG,CAAC,CAAC;IALlB,CAAC;IAOe,IAAI,CAAC,iBAAiB,GAAG,KAAK;QAC1C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,MAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC;;AA7CD;;GAEG;AACoB,wCAAW,GAAG,eAAe,AAAlB,CAAmB;AAErD;;GAEG;AACoB,qCAAQ,GAAG,CAAC,QAAQ,CAAC,AAAb,CAAc","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Post process used to render in black and white\r\n */\r\nexport class ThinBlackAndWhitePostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"blackAndWhite\";\r\n\r\n /**\r\n * The list of uniforms used by the effect\r\n */\r\n public static readonly Uniforms = [\"degree\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/blackAndWhite.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/blackAndWhite.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new black and white post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinBlackAndWhitePostProcess.FragmentUrl,\r\n uniforms: ThinBlackAndWhitePostProcess.Uniforms,\r\n });\r\n }\r\n\r\n /**\r\n * Effect intensity (default: 1)\r\n */\r\n public degree = 1;\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this._drawWrapper.effect!.setFloat(\"degree\", this.degree);\r\n }\r\n}\r\n"]}
1
+ {"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C,AAAb,CAAc","sourcesContent":["import type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Post process used to render in black and white\r\n */\r\nexport class ThinBlackAndWhitePostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"blackAndWhite\";\r\n\r\n /**\r\n * The list of uniforms used by the effect\r\n */\r\n public static readonly Uniforms = [\"degree\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/blackAndWhite.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/blackAndWhite.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new black and white post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinBlackAndWhitePostProcess.FragmentUrl,\r\n uniforms: ThinBlackAndWhitePostProcess.Uniforms,\r\n });\r\n }\r\n\r\n /**\r\n * Effect intensity (default: 1)\r\n */\r\n public degree = 1;\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this._drawWrapper.effect!.setFloat(\"degree\", this.degree);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"thinBloomEffect.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinBloomEffect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EA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AE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC5G,IAAI,CAAC,MAAM,GAAG,IAAI,mBAAmB,CAAC,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC5G,IAAI,CAAC,MAAM,GAAG,IAAI,yBAAyB,CAAC,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAChH,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine } from \"core/index\";\r\nimport { ThinBloomMergePostProcess } from \"./thinBloomMergePostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { ThinBlurPostProcess } from \"./thinBlurPostProcess\";\r\nimport { ThinExtractHighlightsPostProcess } from \"./thinExtractHighlightsPostProcess\";\r\n\r\n/**\r\n * The bloom effect spreads bright areas of an image to simulate artifacts seen in cameras\r\n */\r\nexport class ThinBloomEffect {\r\n /** @internal */\r\n public _downscale: ThinExtractHighlightsPostProcess;\r\n /** @internal */\r\n public _blurX: ThinBlurPostProcess;\r\n /** @internal */\r\n public _blurY: ThinBlurPostProcess;\r\n /** @internal */\r\n public _merge: ThinBloomMergePostProcess;\r\n\r\n /**\r\n * The luminance threshold to find bright areas of the image to bloom.\r\n */\r\n public get threshold(): number {\r\n return this._downscale.threshold;\r\n }\r\n public set threshold(value: number) {\r\n this._downscale.threshold = value;\r\n }\r\n\r\n /**\r\n * The strength of the bloom.\r\n */\r\n public get weight(): number {\r\n return this._merge.weight;\r\n }\r\n public set weight(value: number) {\r\n this._merge.weight = value;\r\n }\r\n\r\n /**\r\n * Specifies the size of the bloom blur kernel, relative to the final output size\r\n */\r\n public get kernel(): number {\r\n return this._blurX.kernel / this.scale;\r\n }\r\n public set kernel(value: number) {\r\n this._blurX.kernel = value * this.scale;\r\n this._blurY.kernel = value * this.scale;\r\n }\r\n\r\n /**\r\n * The ratio of the blur texture to the input texture that should be used to compute the bloom.\r\n */\r\n public readonly scale: number;\r\n\r\n /**\r\n * Creates a new instance of @see ThinBloomEffect\r\n * @param name The name of the bloom render effect\r\n * @param engine The engine which the render effect will be applied. (default: current engine)\r\n * @param scale The ratio of the blur texture to the input texture that should be used to compute the bloom.\r\n * @param blockCompilation If shaders should not be compiled when the effect is created (default: false)\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine>, scale: number, blockCompilation = false) {\r\n this.scale = scale;\r\n this._downscale = new ThinExtractHighlightsPostProcess(name + \"_downscale\", engine, { blockCompilation });\r\n this._blurX = new ThinBlurPostProcess(name + \"_blurX\", engine, new Vector2(1, 0), 10, { blockCompilation });\r\n this._blurY = new ThinBlurPostProcess(name + \"_blurY\", engine, new Vector2(0, 1), 10, { blockCompilation });\r\n this._merge = new ThinBloomMergePostProcess(name + \"_merge\", engine, { blockCompilation });\r\n }\r\n\r\n /**\r\n * Checks if the effect is ready to be used\r\n * @returns if the effect is ready\r\n */\r\n public isReady() {\r\n return this._downscale.isReady() && this._blurX.isReady() && this._blurY.isReady() && this._merge.isReady();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"thinBloomEffect.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinBloomEffect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,gCAA+B;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,O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IAAI,mBAAmB,CAAC,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC5G,IAAI,CAAC,MAAM,GAAG,IAAI,yBAAyB,CAAC,IAAI,GAAG,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED;;;OAGG;IACI,OAAO;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAChH,CAAC;CACJ","sourcesContent":["import type { Nullable, AbstractEngine } from \"core/index\";\r\nimport { ThinBloomMergePostProcess } from \"./thinBloomMergePostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { ThinBlurPostProcess } from \"./thinBlurPostProcess\";\r\nimport { ThinExtractHighlightsPostProcess } from \"./thinExtractHighlightsPostProcess\";\r\n\r\n/**\r\n * The bloom effect spreads bright areas of an image to simulate artifacts seen in cameras\r\n */\r\nexport class ThinBloomEffect {\r\n /** @internal */\r\n public _downscale: ThinExtractHighlightsPostProcess;\r\n /** @internal */\r\n public _blurX: ThinBlurPostProcess;\r\n /** @internal */\r\n public _blurY: ThinBlurPostProcess;\r\n /** @internal */\r\n public _merge: ThinBloomMergePostProcess;\r\n\r\n /**\r\n * The luminance threshold to find bright areas of the image to bloom.\r\n */\r\n public get threshold(): number {\r\n return this._downscale.threshold;\r\n }\r\n public set threshold(value: number) {\r\n this._downscale.threshold = value;\r\n }\r\n\r\n /**\r\n * The strength of the bloom.\r\n */\r\n public get weight(): number {\r\n return this._merge.weight;\r\n }\r\n public set weight(value: number) {\r\n this._merge.weight = value;\r\n }\r\n\r\n /**\r\n * Specifies the size of the bloom blur kernel, relative to the final output size\r\n */\r\n public get kernel(): number {\r\n return this._blurX.kernel / this.scale;\r\n }\r\n public set kernel(value: number) {\r\n this._blurX.kernel = value * this.scale;\r\n this._blurY.kernel = value * this.scale;\r\n }\r\n\r\n /**\r\n * The ratio of the blur texture to the input texture that should be used to compute the bloom.\r\n */\r\n public readonly scale: number;\r\n\r\n /**\r\n * Creates a new instance of @see ThinBloomEffect\r\n * @param name The name of the bloom render effect\r\n * @param engine The engine which the render effect will be applied. (default: current engine)\r\n * @param scale The ratio of the blur texture to the input texture that should be used to compute the bloom.\r\n * @param blockCompilation If shaders should not be compiled when the effect is created (default: false)\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine>, scale: number, blockCompilation = false) {\r\n this.scale = scale;\r\n this._downscale = new ThinExtractHighlightsPostProcess(name + \"_downscale\", engine, { blockCompilation });\r\n this._blurX = new ThinBlurPostProcess(name + \"_blurX\", engine, new Vector2(1, 0), 10, { blockCompilation });\r\n this._blurY = new ThinBlurPostProcess(name + \"_blurY\", engine, new Vector2(0, 1), 10, { blockCompilation });\r\n this._merge = new ThinBloomMergePostProcess(name + \"_merge\", engine, { blockCompilation });\r\n }\r\n\r\n /**\r\n * Checks if the effect is ready to be used\r\n * @returns if the effect is ready\r\n */\r\n public isReady() {\r\n return this._downscale.isReady() && this._blurX.isReady() && this._blurY.isReady() && this._merge.isReady();\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"thinBloomMergePostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinBloomMergePostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,aAAa;IAOrC,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC;QAC5D,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAsC;QACrG,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,iBAAkB;YAC3C,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,yBAAyB,CAAC,WAAW;YACrD,QAAQ,EAAE,yBAAyB,CAAC,QAAQ;YAC5C,QAAQ,EAAE,yBAAyB,CAAC,QAAQ;SAC/C,CAAC,CAAC;QAGP,6DAA6D;QACtD,WAAM,GAAG,CAAC,CAAC;IAHlB,CAAC;IAKe,IAAI,CAAC,iBAAiB,GAAG,KAAK;QAC1C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,MAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC;;AAlCsB,qCAAW,GAAG,YAAY,AAAf,CAAgB;AAE3B,kCAAQ,GAAG,CAAC,aAAa,CAAC,AAAlB,CAAmB;AAE3B,kCAAQ,GAAG,CAAC,WAAW,CAAC,AAAhB,CAAiB","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class ThinBloomMergePostProcess extends EffectWrapper {\r\n public static readonly FragmentUrl = \"bloomMerge\";\r\n\r\n public static readonly Uniforms = [\"bloomWeight\"];\r\n\r\n public static readonly Samplers = [\"bloomBlur\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/bloomMerge.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/bloomMerge.fragment\"));\r\n }\r\n }\r\n\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinBloomMergePostProcess.FragmentUrl,\r\n uniforms: ThinBloomMergePostProcess.Uniforms,\r\n samplers: ThinBloomMergePostProcess.Samplers,\r\n });\r\n }\r\n\r\n /** Weight of the bloom to be added to the original input. */\r\n public weight = 1;\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this._drawWrapper.effect!.setFloat(\"bloomWeight\", this.weight);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"thinBloomMergePostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinBloomMergePostProcess.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,aAAa;IAOrC,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC;QAC5D,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED,YAAY,IAAY,EAAE,SAAmC,IAAI,EAAE,OAAsC;QACrG,KAAK,CAAC;YACF,GAAG,OAAO;YACV,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,iBAAkB;YAC3C,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;YACtB,cAAc,EAAE,yBAAyB,CAAC,WAAW;YACrD,QAAQ,EAAE,yBAAyB,CAAC,QAAQ;YAC5C,QAAQ,EAAE,yBAAyB,CAAC,QAAQ;SAC/C,CAAC,CAAC;QAGP,6DAA6D;QACtD,WAAM,GAAG,CAAC,CAAC;IAHlB,CAAC;IAKe,IAAI,CAAC,iBAAiB,GAAG,KAAK;QAC1C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,MAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC;;AAlCsB,qCAAW,GAAG,YAAY,AAAf,CAAgB;AAE3B,kCAAQ,GAAG,CAAC,aAAa,CAAC,AAAlB,CAAmB;AAE3B,kCAAQ,GAAG,CAAC,WAAW,CAAC,AAAhB,CAAiB","sourcesContent":["import type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class ThinBloomMergePostProcess extends EffectWrapper {\r\n public static readonly FragmentUrl = \"bloomMerge\";\r\n\r\n public static readonly Uniforms = [\"bloomWeight\"];\r\n\r\n public static readonly Samplers = [\"bloomBlur\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/bloomMerge.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/bloomMerge.fragment\"));\r\n }\r\n }\r\n\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinBloomMergePostProcess.FragmentUrl,\r\n uniforms: ThinBloomMergePostProcess.Uniforms,\r\n samplers: ThinBloomMergePostProcess.Samplers,\r\n });\r\n }\r\n\r\n /** Weight of the bloom to be added to the original input. */\r\n public weight = 1;\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this._drawWrapper.effect!.setFloat(\"bloomWeight\", this.weight);\r\n }\r\n}\r\n"]}