@babylonjs/lite 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +51 -0
  3. package/THIRD_PARTY_NOTICES.txt +318 -0
  4. package/{_mat4-storage-f64-CjDoht2w.js → _mat4-storage-f64-WeexU-hd.js} +2 -2
  5. package/{_mat4-storage-f64-CjDoht2w.js.map → _mat4-storage-f64-WeexU-hd.js.map} +1 -1
  6. package/{alpha-test-fragment-B7DjSnF7.js → alpha-test-fragment-x2mnjLgC.js} +2 -2
  7. package/{alpha-test-fragment-B7DjSnF7.js.map → alpha-test-fragment-x2mnjLgC.js.map} +1 -1
  8. package/{background-dds-skybox-BEX309u3.js → background-dds-skybox-BpcDr-9c.js} +3 -3
  9. package/{background-dds-skybox-BEX309u3.js.map → background-dds-skybox-BpcDr-9c.js.map} +1 -1
  10. package/{background-ground-BU0HOcM4.js → background-ground-Bm6gjWqx.js} +2 -2
  11. package/{background-ground-BU0HOcM4.js.map → background-ground-Bm6gjWqx.js.map} +1 -1
  12. package/{background-hdr-skybox--RRRic_K.js → background-hdr-skybox-CSFo8RX6.js} +3 -3
  13. package/{background-hdr-skybox--RRRic_K.js.map → background-hdr-skybox-CSFo8RX6.js.map} +1 -1
  14. package/{background-solid-skybox-BrH2fXSu.js → background-solid-skybox-DOOBeDIz.js} +2 -2
  15. package/{background-solid-skybox-BrH2fXSu.js.map → background-solid-skybox-DOOBeDIz.js.map} +1 -1
  16. package/{billboard-renderable-BHWryAeC.js → billboard-renderable-IJfCpeDS.js} +2 -2
  17. package/{billboard-renderable-BHWryAeC.js.map → billboard-renderable-IJfCpeDS.js.map} +1 -1
  18. package/{clamp-block-DqbwnQGW.js → clamp-block-BD_t8I89.js} +2 -2
  19. package/{clamp-block-DqbwnQGW.js.map → clamp-block-BD_t8I89.js.map} +1 -1
  20. package/{clearcoat-fragment-D6FSCie1.js → clearcoat-fragment-Dj7vGX2u.js} +2 -2
  21. package/{clearcoat-fragment-D6FSCie1.js.map → clearcoat-fragment-Dj7vGX2u.js.map} +1 -1
  22. package/{create-skeleton-D_uplboC.js → create-skeleton-s0hjrC3A.js} +2 -2
  23. package/{create-skeleton-D_uplboC.js.map → create-skeleton-s0hjrC3A.js.map} +1 -1
  24. package/{cubemap-skybox-material-DQcMMdf-.js → cubemap-skybox-material-8lzbgi7K.js} +2 -2
  25. package/{cubemap-skybox-material-DQcMMdf-.js.map → cubemap-skybox-material-8lzbgi7K.js.map} +1 -1
  26. package/{curve-block-21rT0JjG.js → curve-block-Ditr4R7V.js} +2 -2
  27. package/{curve-block-21rT0JjG.js.map → curve-block-Ditr4R7V.js.map} +1 -1
  28. package/{emissive-fragment-C5FtBs3y.js → emissive-fragment-BOAezkfk.js} +2 -2
  29. package/{emissive-fragment-C5FtBs3y.js.map → emissive-fragment-BOAezkfk.js.map} +1 -1
  30. package/{esm-shadow-view-c5YV4Eg9.js → esm-shadow-view-DRpyRAfa.js} +2 -2
  31. package/{esm-shadow-view-c5YV4Eg9.js.map → esm-shadow-view-DRpyRAfa.js.map} +1 -1
  32. package/{esm-shadow-view-Gtd1LWRP.js → esm-shadow-view-DmIORQGZ.js} +2 -2
  33. package/{esm-shadow-view-Gtd1LWRP.js.map → esm-shadow-view-DmIORQGZ.js.map} +1 -1
  34. package/{esm-shadow-view-Cl3rPGof.js → esm-shadow-view-JCPaOOi7.js} +2 -2
  35. package/{esm-shadow-view-Cl3rPGof.js.map → esm-shadow-view-JCPaOOi7.js.map} +1 -1
  36. package/{gaussian-splatting-pipeline-sh-7J31V23x.js → gaussian-splatting-pipeline-sh-B30Mu56i.js} +2 -2
  37. package/{gaussian-splatting-pipeline-sh-7J31V23x.js.map → gaussian-splatting-pipeline-sh-B30Mu56i.js.map} +1 -1
  38. package/{geometry-texture-output-dXk4E9uu.js → geometry-texture-output-DURiaJ_n.js} +2 -2
  39. package/{geometry-texture-output-dXk4E9uu.js.map → geometry-texture-output-DURiaJ_n.js.map} +1 -1
  40. package/{geometry-view-BsFJpBJa.js → geometry-view-DRrscyWU.js} +4 -4
  41. package/{geometry-view-BsFJpBJa.js.map → geometry-view-DRrscyWU.js.map} +1 -1
  42. package/{gltf-animation-K_zZxj_d.js → gltf-animation-BjnXkop6.js} +2 -2
  43. package/{gltf-animation-K_zZxj_d.js.map → gltf-animation-BjnXkop6.js.map} +1 -1
  44. package/{gltf-ext-basisu-CDbPclzZ.js → gltf-ext-basisu-DtzVV1Xx.js} +2 -202
  45. package/gltf-ext-basisu-DtzVV1Xx.js.map +1 -0
  46. package/{gltf-ext-node-visibility-DXCJEYr6.js → gltf-ext-node-visibility-BhX0DmiP.js} +2 -2
  47. package/{gltf-ext-node-visibility-DXCJEYr6.js.map → gltf-ext-node-visibility-BhX0DmiP.js.map} +1 -1
  48. package/{gltf-ext-quantization-CvHI_0Vg.js → gltf-ext-quantization-DaymajCR.js} +2 -2
  49. package/{gltf-ext-quantization-CvHI_0Vg.js.map → gltf-ext-quantization-DaymajCR.js.map} +1 -1
  50. package/{gltf-ext-uv-transform-DgYazJBs.js → gltf-ext-uv-transform-DFmNJ8kA.js} +2 -2
  51. package/{gltf-ext-uv-transform-DgYazJBs.js.map → gltf-ext-uv-transform-DFmNJ8kA.js.map} +1 -1
  52. package/{gltf-feature-animation-pointer-D1RJRFBw.js → gltf-feature-animation-pointer-C40tqOhL.js} +3 -3
  53. package/{gltf-feature-animation-pointer-D1RJRFBw.js.map → gltf-feature-animation-pointer-C40tqOhL.js.map} +1 -1
  54. package/{gltf-feature-animations-Cmc1uoIu.js → gltf-feature-animations-v0S_yb4T.js} +2 -2
  55. package/{gltf-feature-animations-Cmc1uoIu.js.map → gltf-feature-animations-v0S_yb4T.js.map} +1 -1
  56. package/{gltf-feature-draco-CKKzT5E3.js → gltf-feature-draco-CljWrsna.js} +2 -2
  57. package/{gltf-feature-draco-CKKzT5E3.js.map → gltf-feature-draco-CljWrsna.js.map} +1 -1
  58. package/{gltf-feature-gpu-instancing-n87SO6Vh.js → gltf-feature-gpu-instancing-BoeSm6Tn.js} +2 -2
  59. package/{gltf-feature-gpu-instancing-n87SO6Vh.js.map → gltf-feature-gpu-instancing-BoeSm6Tn.js.map} +1 -1
  60. package/{gltf-feature-lights-punctual-Ckm3ciL8.js → gltf-feature-lights-punctual-BCTwgyi_.js} +5 -5
  61. package/{gltf-feature-lights-punctual-Ckm3ciL8.js.map → gltf-feature-lights-punctual-BCTwgyi_.js.map} +1 -1
  62. package/{gltf-feature-meshopt-DLC4SF1E.js → gltf-feature-meshopt-DItMkOMt.js} +2 -2
  63. package/{gltf-feature-meshopt-DLC4SF1E.js.map → gltf-feature-meshopt-DItMkOMt.js.map} +1 -1
  64. package/{gltf-feature-morph-Cjtu7hYa.js → gltf-feature-morph-Cv0mEYIq.js} +3 -3
  65. package/{gltf-feature-morph-Cjtu7hYa.js.map → gltf-feature-morph-Cv0mEYIq.js.map} +1 -1
  66. package/{gltf-feature-registry-C63Hjp9w.js → gltf-feature-registry-wNbt6UC-.js} +15 -15
  67. package/{gltf-feature-registry-C63Hjp9w.js.map → gltf-feature-registry-wNbt6UC-.js.map} +1 -1
  68. package/{gltf-feature-skeleton-DKbOGidp.js → gltf-feature-skeleton-Deh2UBAn.js} +3 -3
  69. package/{gltf-feature-skeleton-DKbOGidp.js.map → gltf-feature-skeleton-Deh2UBAn.js.map} +1 -1
  70. package/{gltf-feature-variants-Cmzu0O0e.js → gltf-feature-variants-DGSdFNJq.js} +2 -2
  71. package/{gltf-feature-variants-Cmzu0O0e.js.map → gltf-feature-variants-DGSdFNJq.js.map} +1 -1
  72. package/{gltf-glb-parser-Cj5MHS-v.js → gltf-glb-parser-DSQWsT4r.js} +2 -2
  73. package/{gltf-glb-parser-Cj5MHS-v.js.map → gltf-glb-parser-DSQWsT4r.js.map} +1 -1
  74. package/{gltf-interleave-gHf9_t0i.js → gltf-interleave-OBqmlu-h.js} +11 -5
  75. package/gltf-interleave-OBqmlu-h.js.map +1 -0
  76. package/{gltf-normals-b2h74380.js → gltf-normals-D_P0KA4b.js} +10 -2
  77. package/gltf-normals-D_P0KA4b.js.map +1 -0
  78. package/{gltf-pbr-builder-ext-edNcjwPf.js → gltf-pbr-builder-ext-3imk8Tev.js} +2 -2
  79. package/{gltf-pbr-builder-ext-edNcjwPf.js.map → gltf-pbr-builder-ext-3imk8Tev.js.map} +1 -1
  80. package/{gltf-variants-CPxNdtP4.js → gltf-variants-Dyr54wwg.js} +4 -4
  81. package/{gltf-variants-CPxNdtP4.js.map → gltf-variants-Dyr54wwg.js.map} +1 -1
  82. package/gpu-task-timer-DVBNZfq5.js +236 -0
  83. package/gpu-task-timer-DVBNZfq5.js.map +1 -0
  84. package/gpu-timer-CUpqT_hK.js +55 -0
  85. package/gpu-timer-CUpqT_hK.js.map +1 -0
  86. package/{gs-picking-pipeline-DYaW_Lg3.js → gs-picking-pipeline-CERN-Trj.js} +2 -2
  87. package/{gs-picking-pipeline-DYaW_Lg3.js.map → gs-picking-pipeline-CERN-Trj.js.map} +1 -1
  88. package/{havok-floating-origin-Dr-18Nds.js → havok-floating-origin-VVdJRUYc.js} +2 -2
  89. package/{havok-floating-origin-Dr-18Nds.js.map → havok-floating-origin-VVdJRUYc.js.map} +1 -1
  90. package/{index-CYZDclhF.js → index-7Bk-uLSM.js} +2 -2
  91. package/{index-CYZDclhF.js.map → index-7Bk-uLSM.js.map} +1 -1
  92. package/{index-CLElg2Bo.js → index-BgY3QEzL.js} +4774 -1276
  93. package/index-BgY3QEzL.js.map +1 -0
  94. package/{index-SMJ67XwT.js → index-Dr5LK2tg.js} +2 -2
  95. package/{index-SMJ67XwT.js.map → index-Dr5LK2tg.js.map} +1 -1
  96. package/index.d.ts +1047 -13
  97. package/index.js +508 -444
  98. package/{input-block-DqEedWF2.js → input-block-DjdlndCL.js} +2 -2
  99. package/{input-block-DqEedWF2.js.map → input-block-DjdlndCL.js.map} +1 -1
  100. package/{iridescence-fragment-BHU59-gQ.js → iridescence-fragment-kfsCs8lN.js} +2 -2
  101. package/{iridescence-fragment-BHU59-gQ.js.map → iridescence-fragment-kfsCs8lN.js.map} +1 -1
  102. package/{light-block-Bv37V8vl.js → light-block-qjCrz3de.js} +2 -2
  103. package/{light-block-Bv37V8vl.js.map → light-block-qjCrz3de.js.map} +1 -1
  104. package/{loop-block-qTg8vb99.js → loop-block-C8vkQ2bz.js} +2 -2
  105. package/{loop-block-qTg8vb99.js.map → loop-block-C8vkQ2bz.js.map} +1 -1
  106. package/{manifold-AS8POaOr.js → manifold-DeXMNgxT.js} +3 -3
  107. package/{manifold-AS8POaOr.js.map → manifold-DeXMNgxT.js.map} +1 -1
  108. package/{morph-fragment-BRCUr2wQ.js → morph-fragment-NpZYyIIU.js} +2 -2
  109. package/{morph-fragment-BRCUr2wQ.js.map → morph-fragment-NpZYyIIU.js.map} +1 -1
  110. package/{multilight-wgsl-DMeppAdZ.js → multilight-wgsl-I5SncF0q.js} +2 -2
  111. package/{multilight-wgsl-DMeppAdZ.js.map → multilight-wgsl-I5SncF0q.js.map} +1 -1
  112. package/{node-env-Bc559GmY.js → node-env-D7Aee08u.js} +2 -2
  113. package/{node-env-Bc559GmY.js.map → node-env-D7Aee08u.js.map} +1 -1
  114. package/{node-geometry-view-COmWsRXK.js → node-geometry-view-DfKXWNfV.js} +3 -3
  115. package/{node-geometry-view-COmWsRXK.js.map → node-geometry-view-DfKXWNfV.js.map} +1 -1
  116. package/{node-registry-extra-compat-dWrv7gpS.js → node-registry-extra-compat-CDLeBR1P.js} +2 -2
  117. package/{node-registry-extra-compat-dWrv7gpS.js.map → node-registry-extra-compat-CDLeBR1P.js.map} +1 -1
  118. package/{node-registry-extra-math-Bn854sX9.js → node-registry-extra-math-BA8_l4lB.js} +2 -2
  119. package/{node-registry-extra-math-Bn854sX9.js.map → node-registry-extra-math-BA8_l4lB.js.map} +1 -1
  120. package/{node-renderable-B5G8WcdH.js → node-renderable-EwLLnaL1.js} +2 -2
  121. package/{node-renderable-B5G8WcdH.js.map → node-renderable-EwLLnaL1.js.map} +1 -1
  122. package/{node-shadow-CVIUlNf0.js → node-shadow-CeTmT6g4.js} +2 -2
  123. package/{node-shadow-CVIUlNf0.js.map → node-shadow-CeTmT6g4.js.map} +1 -1
  124. package/{normal-map-fragment-CQSxhjCy.js → normal-map-fragment-BHImLyM-.js} +2 -2
  125. package/{normal-map-fragment-CQSxhjCy.js.map → normal-map-fragment-BHImLyM-.js.map} +1 -1
  126. package/package.json +10 -3
  127. package/{parse-camera-pBRT_6i5.js → parse-camera-5IGdctAS.js} +2 -2
  128. package/{parse-camera-pBRT_6i5.js.map → parse-camera-5IGdctAS.js.map} +1 -1
  129. package/{pbr-geometry-view-NiZY_juX.js → pbr-geometry-view-Dthf9Aut.js} +3 -3
  130. package/{pbr-geometry-view-NiZY_juX.js.map → pbr-geometry-view-Dthf9Aut.js.map} +1 -1
  131. package/{pbr-metallic-roughness-block-full-Ta9lR2cz.js → pbr-metallic-roughness-block-full-DD6zI_Lx.js} +2 -2
  132. package/{pbr-metallic-roughness-block-full-Ta9lR2cz.js.map → pbr-metallic-roughness-block-full-DD6zI_Lx.js.map} +1 -1
  133. package/{pbr-metallic-roughness-block-JBSi-tQN.js → pbr-metallic-roughness-block-g7wjzwN_.js} +2 -2
  134. package/{pbr-metallic-roughness-block-JBSi-tQN.js.map → pbr-metallic-roughness-block-g7wjzwN_.js.map} +1 -1
  135. package/{pbr-mr-helper-core-BVWNR08D.js → pbr-mr-helper-core-CWROQ7OA.js} +2 -2
  136. package/{pbr-mr-helper-core-BVWNR08D.js.map → pbr-mr-helper-core-CWROQ7OA.js.map} +1 -1
  137. package/{pbr-refraction-C9FvFmAp.js → pbr-refraction-Dxsm_gii.js} +2 -2
  138. package/{pbr-refraction-C9FvFmAp.js.map → pbr-refraction-Dxsm_gii.js.map} +1 -1
  139. package/{pbr-renderable-DzUF2QIk.js → pbr-renderable-CuKWalEM.js} +22 -22
  140. package/{pbr-renderable-DzUF2QIk.js.map → pbr-renderable-CuKWalEM.js.map} +1 -1
  141. package/{pbr-shadow-fragment-CnqnbGYS.js → pbr-shadow-fragment-waeIBQUq.js} +2 -2
  142. package/{pbr-shadow-fragment-CnqnbGYS.js.map → pbr-shadow-fragment-waeIBQUq.js.map} +1 -1
  143. package/{pbr-tracking-3tU1kqea.js → pbr-tracking-CdeqbBrh.js} +2 -2
  144. package/{pbr-tracking-3tU1kqea.js.map → pbr-tracking-CdeqbBrh.js.map} +1 -1
  145. package/{pbr-transmission-ext-BcLjRxfB.js → pbr-transmission-ext-BNiXngZc.js} +2 -2
  146. package/{pbr-transmission-ext-BcLjRxfB.js.map → pbr-transmission-ext-BNiXngZc.js.map} +1 -1
  147. package/{recast-navigation.wasm-DG_0AFuk.js → recast-navigation.wasm-VC4lGlEe.js} +3 -3
  148. package/{recast-navigation.wasm-DG_0AFuk.js.map → recast-navigation.wasm-VC4lGlEe.js.map} +1 -1
  149. package/{recast-navigation.wasm-compat-C-Bf2ylB.js → recast-navigation.wasm-compat-CTwYOzRz.js} +3 -3
  150. package/{recast-navigation.wasm-compat-C-Bf2ylB.js.map → recast-navigation.wasm-compat-CTwYOzRz.js.map} +1 -1
  151. package/{reflectance-fragment-Dbpgw3Jt.js → reflectance-fragment-BQFZ_pgy.js} +2 -2
  152. package/{reflectance-fragment-Dbpgw3Jt.js.map → reflectance-fragment-BQFZ_pgy.js.map} +1 -1
  153. package/{rgbd-decode-DoyUquy3.js → rgbd-decode-duTlXMWd.js} +2 -2
  154. package/{rgbd-decode-DoyUquy3.js.map → rgbd-decode-duTlXMWd.js.map} +1 -1
  155. package/{scene-material-swap-nNUH4nGn.js → scene-material-swap-4qM0tpBK.js} +1 -2
  156. package/scene-material-swap-4qM0tpBK.js.map +1 -0
  157. package/{screenshot-readback-D0Sj9qq3.js → screenshot-readback-DnxR4rhp.js} +2 -2
  158. package/{screenshot-readback-D0Sj9qq3.js.map → screenshot-readback-DnxR4rhp.js.map} +1 -1
  159. package/{shader-composer-BUD_pSX4.js → shader-composer-CBy2i8nU.js} +2 -2
  160. package/{shader-composer-BUD_pSX4.js.map → shader-composer-CBy2i8nU.js.map} +1 -1
  161. package/{shader-renderable-D7-RyVxa.js → shader-renderable-DVMVD6zP.js} +41 -9
  162. package/shader-renderable-DVMVD6zP.js.map +1 -0
  163. package/{shader-thin-instance-DuBotxDO.js → shader-thin-instance-CsDo3ULk.js} +2 -2
  164. package/{shader-thin-instance-DuBotxDO.js.map → shader-thin-instance-CsDo3ULk.js.map} +1 -1
  165. package/{sheen-fragment-1MkEMcbc.js → sheen-fragment-B_Jd7wrr.js} +2 -2
  166. package/{sheen-fragment-1MkEMcbc.js.map → sheen-fragment-B_Jd7wrr.js.map} +1 -1
  167. package/{singlelight-directional-wgsl-BsV8G456.js → singlelight-directional-wgsl-Bw84txva.js} +2 -2
  168. package/{singlelight-directional-wgsl-BsV8G456.js.map → singlelight-directional-wgsl-Bw84txva.js.map} +1 -1
  169. package/{singlelight-hemispheric-wgsl-Bo0jKlW5.js → singlelight-hemispheric-wgsl-DjxhgI8r.js} +2 -2
  170. package/{singlelight-hemispheric-wgsl-Bo0jKlW5.js.map → singlelight-hemispheric-wgsl-DjxhgI8r.js.map} +1 -1
  171. package/{singlelight-point-wgsl-DV39UP5Y.js → singlelight-point-wgsl-iA1aRkXA.js} +2 -2
  172. package/{singlelight-point-wgsl-DV39UP5Y.js.map → singlelight-point-wgsl-iA1aRkXA.js.map} +1 -1
  173. package/{singlelight-spot-wgsl-yg3od6vL.js → singlelight-spot-wgsl-MDdTdstF.js} +2 -2
  174. package/{singlelight-spot-wgsl-yg3od6vL.js.map → singlelight-spot-wgsl-MDdTdstF.js.map} +1 -1
  175. package/{skeleton-fragment-DdxYG6kv.js → skeleton-fragment-COdHWFcK.js} +2 -2
  176. package/{skeleton-fragment-DdxYG6kv.js.map → skeleton-fragment-COdHWFcK.js.map} +1 -1
  177. package/{skybox-renderable-CJD4XmX5.js → skybox-renderable-DJYkfw32.js} +2 -2
  178. package/{skybox-renderable-CJD4XmX5.js.map → skybox-renderable-DJYkfw32.js.map} +1 -1
  179. package/{splat-ply-compressed-DHjyiVmI.js → splat-ply-compressed-SxMlsKNK.js} +2 -2
  180. package/{splat-ply-compressed-DHjyiVmI.js.map → splat-ply-compressed-SxMlsKNK.js.map} +1 -1
  181. package/{standard-pipeline-XTbHL7MY.js → standard-pipeline-DXFOUqU_.js} +3 -3
  182. package/{standard-pipeline-XTbHL7MY.js.map → standard-pipeline-DXFOUqU_.js.map} +1 -1
  183. package/{standard-renderable-CREWLNHI.js → standard-renderable-BAc-i-ig.js} +3 -3
  184. package/{standard-renderable-CREWLNHI.js.map → standard-renderable-BAc-i-ig.js.map} +1 -1
  185. package/{std-ambient-fragment-Bjx3VFrr.js → std-ambient-fragment-P8dHZ4An.js} +2 -2
  186. package/{std-ambient-fragment-Bjx3VFrr.js.map → std-ambient-fragment-P8dHZ4An.js.map} +1 -1
  187. package/{std-cube-reflection-fragment-y9WWdXUt.js → std-cube-reflection-fragment-CF03MuQt.js} +2 -2
  188. package/{std-cube-reflection-fragment-y9WWdXUt.js.map → std-cube-reflection-fragment-CF03MuQt.js.map} +1 -1
  189. package/{std-emissive-fragment-C8Lnmojh.js → std-emissive-fragment-P8yJGclx.js} +2 -2
  190. package/{std-emissive-fragment-C8Lnmojh.js.map → std-emissive-fragment-P8yJGclx.js.map} +1 -1
  191. package/{std-lightmap-fragment-DFxGcoA5.js → std-lightmap-fragment-CymEG79z.js} +9 -6
  192. package/std-lightmap-fragment-CymEG79z.js.map +1 -0
  193. package/{std-opacity-fragment-EXzFWiSp.js → std-opacity-fragment-DLa1zV06.js} +2 -2
  194. package/{std-opacity-fragment-EXzFWiSp.js.map → std-opacity-fragment-DLa1zV06.js.map} +1 -1
  195. package/{std-reflection-fragment-BoJORqpG.js → std-reflection-fragment-BLySsYos.js} +2 -2
  196. package/{std-reflection-fragment-BoJORqpG.js.map → std-reflection-fragment-BLySsYos.js.map} +1 -1
  197. package/{std-shadow-fragment-Bq-Wc8UJ.js → std-shadow-fragment-C_q27Mdi.js} +2 -2
  198. package/{std-shadow-fragment-Bq-Wc8UJ.js.map → std-shadow-fragment-C_q27Mdi.js.map} +1 -1
  199. package/{std-specular-fragment-CM5R5j2g.js → std-specular-fragment-CaBXyAWY.js} +2 -2
  200. package/{std-specular-fragment-CM5R5j2g.js.map → std-specular-fragment-CaBXyAWY.js.map} +1 -1
  201. package/{std-tracking-Cif_wXeT.js → std-tracking-Bw61Dv98.js} +2 -2
  202. package/{std-tracking-Cif_wXeT.js.map → std-tracking-Bw61Dv98.js.map} +1 -1
  203. package/{subsurface-fragment-BEaAXYXz.js → subsurface-fragment-BNQoG9gr.js} +2 -2
  204. package/{subsurface-fragment-BEaAXYXz.js.map → subsurface-fragment-BNQoG9gr.js.map} +1 -1
  205. package/{thin-instance-cull-binding-DWKUt5ZN.js → thin-instance-cull-binding-BNC5JiGw.js} +3 -3
  206. package/{thin-instance-cull-binding-DWKUt5ZN.js.map → thin-instance-cull-binding-BNC5JiGw.js.map} +1 -1
  207. package/{thin-instance-gpu-BDdRcNAh.js → thin-instance-gpu-C1DGstap.js} +2 -2
  208. package/{thin-instance-gpu-BDdRcNAh.js.map → thin-instance-gpu-C1DGstap.js.map} +1 -1
  209. package/{tracking-primitives-CglRNTlX.js → tracking-primitives-CMBWLxGr.js} +2 -2
  210. package/{tracking-primitives-CglRNTlX.js.map → tracking-primitives-CMBWLxGr.js.map} +1 -1
  211. package/{unlit-fragment-kxfZWlnp.js → unlit-fragment-BsHrS9XX.js} +2 -2
  212. package/{unlit-fragment-kxfZWlnp.js.map → unlit-fragment-BsHrS9XX.js.map} +1 -1
  213. package/gltf-ext-basisu-CDbPclzZ.js.map +0 -1
  214. package/gltf-interleave-gHf9_t0i.js.map +0 -1
  215. package/gltf-normals-b2h74380.js.map +0 -1
  216. package/index-CLElg2Bo.js.map +0 -1
  217. package/scene-material-swap-nNUH4nGn.js.map +0 -1
  218. package/shader-renderable-D7-RyVxa.js.map +0 -1
  219. package/std-lightmap-fragment-DFxGcoA5.js.map +0 -1
package/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /** Axis-aligned bounding box represented as `[min, max]` XYZ tuples. */
2
+ export declare type Aabb = [min: [number, number, number], max: [number, number, number]];
3
+
1
4
  /** Increment ref count on a Texture2D. First acquire sets count to 1. */
2
5
  export declare function acquireTexture(tex: Texture2D): void;
3
6
 
@@ -82,12 +85,44 @@ export declare function addDepthHostedSpriteLayer(scene: SceneContext, layer: Sp
82
85
  */
83
86
  export declare function addFacingBillboardSystem(scene: SceneContext, system: FacingBillboardSpriteSystem): void;
84
87
 
88
+ /**
89
+ * Add one logical hierarchy instance and return its slot index.
90
+ *
91
+ * The same root matrix is expanded into each descendant mesh's thin-instance
92
+ * buffer so child offsets, rotations, and scales are preserved.
93
+ *
94
+ * @param pool - Pool created by {@link createHierarchyInstancePool}.
95
+ * @param matrix - Desired world matrix for the hierarchy root instance.
96
+ */
97
+ export declare function addHierarchyInstance(pool: HierarchyInstancePool, matrix: Mat4): number;
98
+
85
99
  /** Add one or more render-target dependencies to the pass. Idempotent
86
100
  * (Set semantics). Mirrors BJS `FrameGraphRenderPass.addDependencies`,
87
101
  * promoted onto the base `Pass` because every future pass type
88
102
  * (compute / copy / object-list) needs the same surface. */
89
103
  export declare function addPassDependencies(pass: Pass, deps: RenderTarget | readonly RenderTarget[]): void;
90
104
 
105
+ /**
106
+ * Adds a child shape to a container shape with an explicit local transform.
107
+ * @param world - The physics world.
108
+ * @param container - Parent container shape.
109
+ * @param child - Child shape to append.
110
+ * @param translation - Child translation in container space.
111
+ * @param rotation - Child rotation in container space.
112
+ * @param scale - Child scale in container space.
113
+ */
114
+ export declare function addPhysicsShapeChild(world: PhysicsWorld, container: PhysicsShape, child: PhysicsShape, translation?: Vec3, rotation?: Quat, scale?: Vec3): void;
115
+
116
+ /**
117
+ * Adds a child shape to a container, deriving its local transform from two scene nodes.
118
+ * @param world - The physics world.
119
+ * @param container - Parent container shape.
120
+ * @param parentNode - Scene node associated with the container shape.
121
+ * @param child - Child shape to append.
122
+ * @param childNode - Scene node associated with the child shape.
123
+ */
124
+ export declare function addPhysicsShapeChildFromParent(world: PhysicsWorld, container: PhysicsShape, parentNode: SceneNode, child: PhysicsShape, childNode: SceneNode): void;
125
+
91
126
  /** Create a `RenderPass`, wire it to the task currently recording, and return
92
127
  * it. Must be called from inside `Task.record()` so the FG can associate the
93
128
  * new pass with the right task (mirrors BJS `frameGraph.addRenderPass`).
@@ -151,6 +186,9 @@ export declare function addThinInstance(mesh: Mesh, matrix: Mat4): number;
151
186
  */
152
187
  export declare function addToScene(scene: SceneContext, entity: Mesh | LightBase | Camera | ShadowGenerator | TransformNode | AssetContainer): void;
153
188
 
189
+ /** Add two vectors component-wise. */
190
+ export declare function addVec3(a: Vec3, b: Vec3): Vec3;
191
+
154
192
  /** Request the agent to move toward a world target (constrained by navmesh). */
155
193
  export declare function agentGoto(crowd: NavCrowd, index: number, destination: Vec3): void;
156
194
 
@@ -347,6 +385,23 @@ declare type AnyMaterial = StandardMaterialProps | PbrMaterialProps;
347
385
  */
348
386
  export declare function appendSpriteAtlasFrames(engine: EngineContext, atlas: SpriteAtlas, sources: readonly SpriteAtlasFrameSource[]): number[];
349
387
 
388
+ /**
389
+ * Applies a force for one fixed physics timestep, matching Babylon.js PhysicsBody.applyForce.
390
+ * @param world - The physics world.
391
+ * @param body - The physics body to update.
392
+ * @param force - Force vector.
393
+ * @param location - World-space application point.
394
+ */
395
+ export declare function applyPhysicsBodyForce(world: PhysicsWorld, body: PhysicsBody, force: Vec3, location: Vec3): void;
396
+
397
+ /**
398
+ * Applies a world-space impulse to a physics body.
399
+ * @param body - The physics body to update.
400
+ * @param impulse - Impulse vector.
401
+ * @param location - World-space application point.
402
+ */
403
+ export declare function applyPhysicsBodyImpulse(body: PhysicsBody, impulse: Vec3, location: Vec3): void;
404
+
350
405
  /**
351
406
  * Apply a one-shot linear impulse (kg·m/s) to a body at a world `point` (defaults to the body's
352
407
  * current position / centre of mass), waking it if asleep. Used to shoot, throw, or shove a prop.
@@ -523,7 +578,9 @@ export declare function attachFreeControl(camera: FreeCamera, canvas: HTMLCanvas
523
578
  * - Left-drag: pan (the cursor stays anchored to the globe surface).
524
579
  * - Middle/right-drag: rotate (yaw + pitch / tilt).
525
580
  * - Wheel: zoom (toward the cursor by default).
526
- * - Keyboard: arrows = tilt, W/A/S/D = pan, +/- = zoom.
581
+ * - Touch: single-finger drag = pan; two-finger pinch = zoom toward the centroid,
582
+ * promoting to a pan once the centroid drifts ≥ 20 px.
583
+ * - Keyboard: arrows = pan, Ctrl+arrows = tilt (pitch/yaw), +/- = zoom along the look vector.
527
584
  *
528
585
  * Movement uses Babylon.js's framerate-independent physics model (velocity +
529
586
  * inertial decay). Globe picking is analytic ray-sphere against the planet
@@ -848,7 +905,7 @@ export declare interface BoundingBoxGizmoOptions {
848
905
  * The view/projection matrix caches below are allocated by the camera factory
849
906
  * via the process-global `allocateMat4()` singleton — F32 by default, F64
850
907
  * after any HPM engine is constructed (see
851
- * `docs/architecture/33-high-precision-matrix.md`). The storage
908
+ * `docs/lite/architecture/36-high-precision-matrix.md`). The storage
852
909
  * type is fixed at construction and never changes. */
853
910
  export declare interface Camera {
854
911
  fov: number;
@@ -895,6 +952,45 @@ export declare const CAP_NONE = 0;
895
952
  /** Cap mode: close only the start of the tube/extrusion. */
896
953
  export declare const CAP_START = 1;
897
954
 
955
+ /**
956
+ * CreateCapsule — matches Babylon.js MeshBuilder.CreateCapsule default options.
957
+ *
958
+ * Generates a capsule (a cylinder capped by two hemispheres) or a "pill" when
959
+ * `radiusTop`/`radiusBottom` differ. Vertex/normal/UV generation and index
960
+ * winding are ported verbatim from `@babylonjs/core/Meshes/Builders/capsuleBuilder.js`
961
+ * to guarantee parity. The default Y-up orientation is used (the `orientation`
962
+ * remap of the Babylon builder is intentionally omitted to keep the API small).
963
+ */
964
+ /** Geometry buffers produced by {@link createCapsuleData}. */
965
+ export declare interface CapsuleData {
966
+ positions: Float32Array;
967
+ normals: Float32Array;
968
+ uvs: Float32Array;
969
+ indices: Uint32Array;
970
+ }
971
+
972
+ /** Options for `createCapsuleData`. Subset of Babylon's CreateCapsule. */
973
+ export declare interface CapsuleOptions {
974
+ /** Total height of the capsule including both caps. Default 1. */
975
+ height?: number;
976
+ /** Radius of the cylindrical body and both caps. Default 0.25. */
977
+ radius?: number;
978
+ /** Radius of the top cap; defaults to `radius`. */
979
+ radiusTop?: number;
980
+ /** Radius of the bottom cap; defaults to `radius`. */
981
+ radiusBottom?: number;
982
+ /** Number of radial segments around the capsule. Default 16. */
983
+ tessellation?: number;
984
+ /** Number of height segments along the cylindrical body. Default 2. */
985
+ subdivisions?: number;
986
+ /** Number of segments per cap; defaults applied to both caps. Default 6. */
987
+ capSubdivisions?: number;
988
+ /** Number of segments for the top cap; defaults to `capSubdivisions`. */
989
+ topCapSubdivisions?: number;
990
+ /** Number of segments for the bottom cap; defaults to `capSubdivisions`. */
991
+ bottomCapSubdivisions?: number;
992
+ }
993
+
898
994
  /**
899
995
  * Capture the current canvas backbuffer of a {@link SurfaceContext} — the final presented
900
996
  * frame (post-processing and all) with NO HTML/DOM overlay, since those are never drawn
@@ -921,6 +1017,64 @@ export declare const CAP_START = 1;
921
1017
  */
922
1018
  export declare function captureScreenshot(surface: SurfaceContext): Promise<Screenshot>;
923
1019
 
1020
+ /**
1021
+ * Collision event fired by {@link PhysicsCharacterController.onTriggerCollisionObservable}
1022
+ * for every dynamic body the character pushes during a step. Mirrors Babylon.js'
1023
+ * `onTriggerCollisionObservable` payload (minus its `colliderIndex`, which has no Lite equivalent).
1024
+ */
1025
+ export declare interface CharacterCollisionEvent {
1026
+ /** The dynamic physics body the character contacted. Its `.node.name` identifies the collider. */
1027
+ collider: PhysicsBody;
1028
+ /** Impulse (world space) the character applied to the collider at the contact point. */
1029
+ impulse: Vec3;
1030
+ /** World-space position of the contact at which the impulse was applied. */
1031
+ impulsePosition: Vec3;
1032
+ }
1033
+
1034
+ /**
1035
+ * Minimal single-event observable used by {@link PhysicsCharacterController} for collision
1036
+ * callbacks. Kept local to the physics module (no dependency on gizmo/observable code) so the
1037
+ * character-controller graph stays self-contained and tree-shakeable.
1038
+ */
1039
+ export declare class CharacterCollisionObservable {
1040
+ private _subs;
1041
+ /**
1042
+ * Subscribe to collision events.
1043
+ * @param cb - Callback invoked for each dynamic-body contact during a step.
1044
+ * @returns A disposer that removes the subscription when called.
1045
+ */
1046
+ add(cb: (event: CharacterCollisionEvent) => void): () => void;
1047
+ /**
1048
+ * Notify all subscribers of a collision event.
1049
+ * @param event - The collision event payload.
1050
+ */
1051
+ notify(event: CharacterCollisionEvent): void;
1052
+ }
1053
+
1054
+ /** Contact state of the character against the geometry beneath it. */
1055
+ export declare const enum CharacterSupportedState {
1056
+ /** No surface within reach. */
1057
+ UNSUPPORTED = 0,
1058
+ /** Touching a surface too steep to stand on; the character slides. */
1059
+ SLIDING = 1,
1060
+ /** Standing on a walkable surface. */
1061
+ SUPPORTED = 2
1062
+ }
1063
+
1064
+ /** Surface information returned by {@link PhysicsCharacterController.checkSupport}. */
1065
+ export declare interface CharacterSurfaceInfo {
1066
+ /** Whether the supporting surface belongs to a dynamic (simulated) body. */
1067
+ isSurfaceDynamic: boolean;
1068
+ /** Whether the character is unsupported, sliding, or supported. */
1069
+ supportedState: CharacterSupportedState;
1070
+ /** Average normal of the supporting surfaces (world space). */
1071
+ averageSurfaceNormal: Vec3;
1072
+ /** Average linear velocity induced by the supporting surfaces. */
1073
+ averageSurfaceVelocity: Vec3;
1074
+ /** Average angular velocity induced by the supporting surfaces. */
1075
+ averageAngularSurfaceVelocity: Vec3;
1076
+ }
1077
+
924
1078
  /** A post-process task that offsets the red/green/blue channels to simulate lens chromatic aberration. */
925
1079
  export declare interface ChromaticAberrationPostProcessTask extends PostProcessTask {
926
1080
  aberrationAmount: number;
@@ -1106,6 +1260,31 @@ export declare interface ClusteredPointLightOptions {
1106
1260
  intensity?: number;
1107
1261
  }
1108
1262
 
1263
+ /** RGB color */
1264
+ export declare interface Color3 {
1265
+ r: number;
1266
+ g: number;
1267
+ b: number;
1268
+ }
1269
+
1270
+ /** RGBA color */
1271
+ export declare interface Color4 {
1272
+ r: number;
1273
+ g: number;
1274
+ b: number;
1275
+ a: number;
1276
+ }
1277
+
1278
+ /** Compute an AABB by folding XYZ min/max over a positions buffer.
1279
+ *
1280
+ * When `world` is provided each position is transformed by it before being
1281
+ * folded (column-major Mat4: m[col*4+row]). Otherwise the AABB is computed
1282
+ * in the positions' own space.
1283
+ *
1284
+ * Returns `[[+Inf,+Inf,+Inf],[-Inf,-Inf,-Inf]]` for empty input — callers
1285
+ * that care can check `isFinite(min[0])`. */
1286
+ export declare function computeAabb(positions: Float32Array, world?: Mat4): Aabb;
1287
+
1109
1288
  /**
1110
1289
  * Build the east/north/up orthonormal basis at a point on the globe (left-handed
1111
1290
  * convention). `up` is the geocentric normal (normalized position); `east` and
@@ -1284,6 +1463,16 @@ export declare function createBox(engine: EngineContext, size?: number): Mesh;
1284
1463
  * Set the matching option to `false` to display only one of them. */
1285
1464
  export declare function createCameraGizmo(engine: EngineContext, layer: UtilityLayer, options?: CameraGizmoOptions): CameraGizmo;
1286
1465
 
1466
+ /** Create a capsule (cylinder capped by two hemispheres) mesh. Caller must assign material. */
1467
+ export declare function createCapsule(engine: EngineContext, options?: CapsuleOptions): Mesh;
1468
+
1469
+ /**
1470
+ * Build capsule geometry data.
1471
+ * @param options - Capsule dimensions and tessellation.
1472
+ * @returns Positions, normals, UVs, and indices for the capsule mesh.
1473
+ */
1474
+ export declare function createCapsuleData(options?: CapsuleOptions): CapsuleData;
1475
+
1287
1476
  /**
1288
1477
  * Create a post-process task that simulates chromatic aberration by shifting color channels outward from a center point.
1289
1478
  * @param config - Aberration parameters and source/target settings.
@@ -1555,10 +1744,35 @@ export declare function createGroundFromHeightMap(engine: EngineContext, url: st
1555
1744
  */
1556
1745
  export declare function createHavokWorld(scene: SceneContext, hknp: any, gravity?: Vec3): PhysicsWorld;
1557
1746
 
1747
+ /**
1748
+ * Create a Havok heightfield collision shape. Attach it to a STATIC body bound to the
1749
+ * ground mesh so the heightfield aligns with the visible terrain.
1750
+ * @param world - The physics world.
1751
+ * @param options - Ground mesh source or explicit heightfield parameters.
1752
+ * @returns The created shape handle.
1753
+ */
1754
+ export declare function createHeightFieldShape(world: PhysicsWorld, options: HeightFieldShapeOptions): PhysicsShape;
1755
+
1558
1756
  /** Create a hemispheric light. Returns plain data — caller adds to scene.
1559
1757
  * Matches Babylon.js HemisphericLight behavior. */
1560
1758
  export declare function createHemisphericLight(direction?: [number, number, number], intensity?: number): HemisphericLight;
1561
1759
 
1760
+ /**
1761
+ * Build a fixed-capacity thin-instance pool from a template hierarchy.
1762
+ *
1763
+ * Call before `registerScene()`, after the hierarchy's parent links are
1764
+ * established. Fresh `loadGltf()` hierarchies are also supported: this helper
1765
+ * materializes child parent links from the `children` arrays before snapshotting
1766
+ * template world matrices.
1767
+ *
1768
+ * The template meshes are converted to thin-instanced meshes with an active
1769
+ * count of zero, so they do not draw until instances are added.
1770
+ *
1771
+ * @param root - Root transform node or mesh for the template hierarchy.
1772
+ * @param capacity - Maximum number of active logical hierarchy instances.
1773
+ */
1774
+ export declare function createHierarchyInstancePool(root: SceneNode, capacity: number): HierarchyInstancePool;
1775
+
1562
1776
  /**
1563
1777
  * Create a frame-graph task that applies the scene's image-processing settings
1564
1778
  * (exposure, contrast, tone mapping) to a color source and draws it to the swapchain.
@@ -1691,7 +1905,7 @@ export declare function createPcfSpotlightShadowGenerator(engine: EngineContext,
1691
1905
  /**
1692
1906
  * Create a physics aggregate: body + shape + material wired together.
1693
1907
  * `mass === 0` → STATIC, `mass > 0` → DYNAMIC.
1694
- * Shape geometry is auto-sized from the mesh bounding box when not specified.
1908
+ * Primitive shape geometry is auto-sized from the mesh bounding box when not specified.
1695
1909
  */
1696
1910
  export declare function createPhysicsAggregate(world: PhysicsWorld, node: Mesh, type: PhysicsShapeType, options: PhysicsAggregateOptions): PhysicsAggregate;
1697
1911
 
@@ -1706,13 +1920,41 @@ export declare function createPhysicsAggregate(world: PhysicsWorld, node: Mesh,
1706
1920
  export declare function createPhysicsBody(world: PhysicsWorld, node: SceneNode, motionType: PhysicsMotionType, startsAsleep?: boolean): PhysicsBody;
1707
1921
 
1708
1922
  /**
1709
- * Creates a collision shape (sphere, box, capsule, or cylinder) from the given options.
1923
+ * Create a Havok physics character controller.
1924
+ *
1925
+ * The controller adds a kinematic capsule body to `world` and resolves collisions by sweeping
1926
+ * that capsule each step. Drive it from a per-physics-step callback (e.g. `onPhysicsAfterStep`)
1927
+ * by calling {@link PhysicsCharacterController.moveWithCollisions} with the desired displacement,
1928
+ * then read {@link PhysicsCharacterController.getPosition} to update your display mesh.
1929
+ * @param world - The physics world to add the character to.
1930
+ * @param position - Initial world-space position of the character.
1931
+ * @param options - Capsule dimensions.
1932
+ * @returns The character controller instance.
1933
+ */
1934
+ export declare function createPhysicsCharacterController(world: PhysicsWorld, position: Vec3, options: PhysicsCharacterControllerOptions): PhysicsCharacterController;
1935
+
1936
+ /**
1937
+ * Creates and enables a Havok constraint between two physics bodies.
1938
+ * @param world - The physics world.
1939
+ * @param bodyA - Parent body.
1940
+ * @param bodyB - Child body.
1941
+ * @param type - Constraint type.
1942
+ * @param options - Pivot and axis options.
1943
+ * @param limits - Optional 6DoF limits.
1944
+ */
1945
+ export declare function createPhysicsConstraint(world: PhysicsWorld, bodyA: PhysicsBody, bodyB: PhysicsBody, type: PhysicsConstraintType, options?: PhysicsConstraintOptions, limits?: readonly PhysicsConstraintLimit[]): PhysicsConstraint;
1946
+
1947
+ /**
1948
+ * Creates a collision shape from the given options.
1710
1949
  * @param world - The physics world.
1711
1950
  * @param options - The shape type and its geometry parameters.
1712
1951
  * @returns The created shape handle.
1713
1952
  */
1714
1953
  export declare function createPhysicsShape(world: PhysicsWorld, options: PhysicsShapeOptions): PhysicsShape;
1715
1954
 
1955
+ /** Creates a tree-shakable Physics V2 debug viewer for a scene/world pair. */
1956
+ export declare function createPhysicsViewer(scene: SceneContext, world: PhysicsWorld, options?: PhysicsViewerOptions): PhysicsViewer;
1957
+
1716
1958
  /** Create a plane (unit quad facing -Z). Caller must assign material. */
1717
1959
  export declare function createPlane(engine: EngineContext, options?: PlaneOptions): Mesh;
1718
1960
 
@@ -2024,6 +2266,9 @@ export declare interface CrossFadeAnimationGroupsOptions {
2024
2266
  readonly toWeight?: number;
2025
2267
  }
2026
2268
 
2269
+ /** Compute the right-handed cross product `a x b`. */
2270
+ export declare function crossVec3(a: Vec3, b: Vec3): Vec3;
2271
+
2027
2272
  /** Returns the boolean union (`a` ∪ `b`) of two solids as a new solid. */
2028
2273
  export declare function csg2Add(a: Csg2Solid, b: Csg2Solid): Csg2Solid;
2029
2274
 
@@ -2254,6 +2499,9 @@ export declare function disposeLightGizmo(gizmo: LightGizmo, layer: UtilityLayer
2254
2499
  */
2255
2500
  export declare function disposePhysics(world: PhysicsWorld): void;
2256
2501
 
2502
+ /** Disposes all physics debug meshes and unregisters the viewer update hook. */
2503
+ export declare function disposePhysicsViewer(viewer: PhysicsViewer): void;
2504
+
2257
2505
  /** Dispose GPU resources owned by this picker. */
2258
2506
  export declare function disposePicker(picker: GpuPicker): void;
2259
2507
 
@@ -2308,6 +2556,9 @@ export declare function disposeUniformEffectWrapper(wrapper: UniformEffectWrappe
2308
2556
  /** Dispose the utility layer's underlying scene. Idempotent. */
2309
2557
  export declare function disposeUtilityLayer(utility: UtilityLayer): void;
2310
2558
 
2559
+ /** Compute the dot product of two vectors. */
2560
+ export declare function dotVec3(a: Vec3, b: Vec3): number;
2561
+
2311
2562
  /**
2312
2563
  * A per-pass draw binding produced by `Renderable.bind(engine, target)`.
2313
2564
  *
@@ -2495,7 +2746,11 @@ export declare interface EngineContext extends SurfaceContext {
2495
2746
  * `createSurface(engine, canvas, ...)` to append more. */
2496
2747
  readonly surfaces: readonly [SurfaceContext, ...SurfaceContext[]];
2497
2748
  /** Number of GPU draw calls in the last rendered frame, summed across all surfaces. */
2498
2749
  drawCallCount: number;
2499
- /**
2750
+ /** GPU time spent on the last measured frame, in milliseconds — 0 until the first measured frame and
2751
+ * while GPU timing is disabled (the default). Enable with {@link setGpuTimingEnabled}; query device
2752
+ * capability with {@link isGpuTimingSupported}. Updates a frame or two behind, since the timestamp
2753
+ * readback is async and off the render critical path, so reading it does not perturb the value. */
2754
+ gpuFrameTimeMs: number;
2500
2755
  /**
2501
2756
  * When true, world matrices are computed using Float64 intermediate precision
2502
2757
  * and downcast to Float32 at GPU upload time. Defaults to false.
2503
2758
  */
@@ -3003,6 +3258,15 @@ export declare function getCameraPosition(camera: Camera): Vec3;
3003
3258
  /** Snap a position to the closest point on the navmesh. */
3004
3259
  export declare function getClosestPoint(plugin: NavigationPlugin, position: Vec3): Vec3;
3005
3260
 
3261
+ /**
3262
+ * Flatten a loaded asset container's entity tree to its renderable `Mesh` nodes
3263
+ * (those carrying GPU geometry), matching the flat `meshes` array Babylon.js
3264
+ * loaders return. Useful for camera-framing and per-mesh inspection after a load.
3265
+ *
3266
+ * Tree-shakeable: only callers that import this pull it into their bundle.
3267
+ */
3268
+ export declare function getContainerMeshes(container: AssetContainer): Mesh[];
3269
+
3006
3270
  /** Returns the render-target aspect ratio adjusted for the camera's normalized viewport, or the raw ratio if none. */
3007
3271
  export declare function getEffectiveAspectRatio(camera: Camera | null | undefined, targetWidth: number, targetHeight: number): number;
3008
3272
 
@@ -3075,6 +3339,9 @@ export declare function getPickedUV(info: PickingInfo): [number, number] | null;
3075
3339
  /** Compute the projection matrix for a camera. Cached per worldMatrixVersion + aspect. */
3076
3340
  export declare function getProjectionMatrix(camera: Camera, aspectRatio: number): Mat4;
3077
3341
 
3342
+ /** Return the latest task GPU timing snapshot without stalling the GPU or CPU. */
3343
+ export declare function getRenderTaskGpuTimings(engine: EngineContext): RenderTaskGpuTimings;
3344
+
3078
3345
  /**
3079
3346
  * Resolves the current instance index of the sprite referenced by `handle`.
3080
3347
  * @param handle - Handle of the sprite to resolve.
@@ -3316,6 +3583,27 @@ declare interface HdrLoadOptions {
3316
3583
  skyboxSize?: number;
3317
3584
  }
3318
3585
 
3586
+ /** Options for {@link createHeightFieldShape}. */
3587
+ export declare interface HeightFieldShapeOptions {
3588
+ /**
3589
+ * Ground mesh whose world-space vertex grid defines the heightfield. When set, the
3590
+ * sample count, world size, and height data are derived from the mesh (the explicit
3591
+ * fields below are ignored). The mesh must be a regular `(N+1)×(N+1)` grid such as the
3592
+ * one produced by `createGroundFromHeightMap`.
3593
+ */
3594
+ groundMesh?: Mesh;
3595
+ /** Explicit: number of height samples along X. */
3596
+ numHeightFieldSamplesX?: number;
3597
+ /** Explicit: number of height samples along Z. */
3598
+ numHeightFieldSamplesZ?: number;
3599
+ /** Explicit: world-space size along X. */
3600
+ heightFieldSizeX?: number;
3601
+ /** Explicit: world-space size along Z. */
3602
+ heightFieldSizeZ?: number;
3603
+ /** Explicit: row-major height samples (`numHeightFieldSamplesX * numHeightFieldSamplesZ`). */
3604
+ heightFieldData?: Float32Array;
3605
+ }
3606
+
3319
3607
  export declare interface HemisphericLight extends LightBase {
3320
3608
  readonly lightType: "hemispheric";
3321
3609
  direction: ObservableVec3;
@@ -3325,6 +3613,30 @@ export declare interface HemisphericLight extends LightBase {
3325
3613
  groundColor: [number, number, number];
3326
3614
  }
3327
3615
 
3616
+ /** Hides a body that was previously shown with {@link showPhysicsBody}. */
3617
+ export declare function hidePhysicsBody(viewer: PhysicsViewer, body: PhysicsBody): boolean;
3618
+
3619
+ /**
3620
+ * A fixed-capacity thin-instance pool for a transform-node hierarchy.
3621
+ *
3622
+ * The source meshes become the render carriers for the pool: each descendant
3623
+ * mesh receives its own thin-instance matrix buffer, and one logical hierarchy
3624
+ * instance updates the matching slot in every buffer.
3625
+ */
3626
+ export declare interface HierarchyInstancePool {
3627
+ /** Template hierarchy root used to build the pool. */
3628
+ readonly root: SceneNode;
3629
+ /** Maximum number of logical hierarchy instances that can be active. */
3630
+ readonly capacity: number;
3631
+ /** Descendant meshes driven by this pool. */
3632
+ readonly meshes: readonly Mesh[];
3633
+ /**
3634
+ * Current active logical hierarchy instance count.
3635
+ * Prefer {@link addHierarchyInstance}, {@link removeHierarchyInstance}, and
3636
+ * {@link setHierarchyInstanceCount} over mutating this field directly.
3637
+ */
3638
+ count: number;
3639
+
3328
3640
  /** Image processing configuration. */
3329
3641
  export declare interface ImageProcessingConfig {
3330
3642
  exposure: number;
@@ -3362,7 +3674,7 @@ export declare interface IParentable {
3362
3674
  }
3363
3675
 
3364
3676
  /** Iridescence thin-film properties. Maps to BJS PBRMaterial.iridescence and KHR_materials_iridescence. */
3365
- declare interface IridescenceProps {
3677
+ export declare interface IridescenceProps {
3366
3678
  /** Whether iridescence is active. Default false. */
3367
3679
  isEnabled?: boolean;
3368
3680
  /** Iridescence blend intensity (0=off, 1=full). Default 1.0 for native PBR; glTF default is supplied by the loader. */
@@ -3408,6 +3720,14 @@ export declare function isGizmoInteracting(canvas: HTMLCanvasElement): boolean;
3408
3720
  * produces a stray orbit even if the async pick is slow. */
3409
3721
  export declare function isGizmoPickPending(canvas: HTMLCanvasElement): boolean;
3410
3722
 
3723
+ /** Whether GPU frame-time measurement is available on this engine's device — i.e. the adapter offered
3724
+ * the WebGPU `timestamp-query` feature (requested opportunistically by {@link createEngine}). When false,
3725
+ * {@link setGpuTimingEnabled} is a no-op and {@link EngineContext.gpuFrameTimeMs} stays 0. */
3726
+ export declare function isGpuTimingSupported(engine: EngineContext): boolean;
3727
+
3728
+ /** Whether per-render-task GPU timing can run on this engine's WebGPU device. */
3729
+ export declare function isRenderTaskGpuTimingSupported(engine: EngineContext): boolean;
3730
+
3411
3731
  /**
3412
3732
  * Returns `true` if the sprite referenced by `handle` is still present in its layer.
3413
3733
  * @param handle - Handle to test.
@@ -3424,6 +3744,12 @@ export declare interface IWorldMatrixProvider {
3424
3744
  readonly worldMatrixVersion: number;
3425
3745
  }
3426
3746
 
3747
+ /** Compute the Euclidean length of a vector. */
3748
+ export declare function lengthVec3(v: Vec3): number;
3749
+
3750
+ /** Linearly interpolate from vector `a` to vector `b` by factor `t`. */
3751
+ export declare function lerpVec3(a: Vec3, b: Vec3, t: number): Vec3;
3752
+
3427
3753
  /** Shared base for all light types.
3428
3754
  * Provides pipeline integration callbacks so render pipelines are light-agnostic. */
3429
3755
  export declare interface LightBase extends IWorldMatrixProvider, IParentable {
@@ -3518,6 +3844,17 @@ declare interface LoadBabylonOptions {
3518
3844
  */
3519
3845
  export declare function loadBasisTexture2D(engine: EngineContext, url: string, opts?: Texture2DOptions): Promise<Texture2D>;
3520
3846
 
3847
+ /**
3848
+ * Load a DDS cubemap environment for PBR IBL.
3849
+ * Uploads ALL mip levels (prefiltered data) and computes spherical harmonics
3850
+ * from mip 0 face data for irradiance lighting.
3851
+ */
3852
+ export declare function loadDdsEnvironment(scene: SceneContext, url: string, options: {
3853
+ brdfUrl: string;
3854
+ skipSkybox?: boolean;
3855
+ skipGround?: boolean;
3856
+ }): Promise<EnvironmentTextures>;
3857
+
3521
3858
  /**
3522
3859
  * Load a Babylon.js .env environment file and upload cubemap + BRDF LUT to GPU.
3523
3860
  * BRDF LUT is decoded from a pre-baked RGBD PNG (matching BJS's embedded
@@ -3655,12 +3992,24 @@ export declare interface Mat4 {
3655
3992
  readonly length: 16;
3656
3993
  /** Compose TRS (translation * rotation * scale) into a single Mat4. */
3657
3994
  export declare function mat4Compose(tx: number, ty: number, tz: number, qx: number, qy: number, qz: number, qw: number, sx: number, sy: number, sz: number): Mat4;
3658
3995
 
3996
+ /** Create a rotation matrix from a quaternion. */
3997
+ export declare function mat4FromQuat(qx: number, qy: number, qz: number, qw: number): Mat4;
3998
+
3659
3999
  /** Create a new identity Mat4. */
3660
4000
  export declare function mat4Identity(): Mat4;
3661
4001
 
3662
4002
  /** Compute inverse of a Mat4. Returns null if singular. */
3663
4003
  export declare function mat4Invert(input: Mat4): Mat4 | null;
3664
4004
 
4005
+ /** LookAt matrix (right-handed). Matches Babylon.js Matrix.LookAtLHToRef with LH convention. */
4006
+ export declare function mat4LookAtLH(eye: Vec3, target: Vec3, up: Vec3): Mat4;
4007
+
4008
+ /** Multiply two Mat4: out = a * b (column-major). */
4009
+ export declare function mat4Multiply(a: Mat4, b: Mat4): Mat4;
4010
+
4011
+ /** Reverse-Z perspective projection (left-handed, zero-to-one depth). */
4012
+ export declare function mat4PerspectiveLH(fov: number, aspect: number, near: number, far: number): Mat4;
4013
+
3665
4014
  /** Create a scaling matrix. */
3666
4015
  export declare function mat4Scale(x: number, y: number, z: number): Mat4;
3667
4016
 
@@ -3870,6 +4219,9 @@ export declare interface NavMeshSource {
3870
4219
  indices: ArrayLike<number>;
3871
4220
  }
3872
4221
 
4222
+ /** Negate every vector component. */
4223
+ export declare function negateVec3(v: Vec3): Vec3;
4224
+
3873
4225
  /** Parsed block in the graph. */
3874
4226
  declare interface NodeBlock {
3875
4227
  readonly id: number;
@@ -4089,6 +4441,9 @@ export declare function normalizeRadians(angle: number): number;
4089
4441
  */
4090
4442
  export declare function normalizeVec3(x: number, y: number, z: number, epsilon?: number): Vec3Tuple;
4091
4443
 
4444
+ /** Normalize a `Vec3` object, returning `{ x: 0, y: 0, z: 0 }` for degenerate input. */
4445
+ export declare function normalizeVec3Object(v: Vec3): Vec3;
4446
+
4092
4447
  /**
4093
4448
  * A 4-component quaternion whose `x`/`y`/`z`/`w` setters fire an `onDirty` callback
4094
4449
  * when a component actually changes, letting the hierarchy system detect rotation updates.
@@ -4181,6 +4536,38 @@ export declare function onBeforeRender(scene: SceneContext, cb: (deltaMs: number
4181
4536
  */
4182
4537
  export declare function onCsmReceiverUpdate(sg: ShadowGenerator, cb: (data: Float32Array) => void): () => void;
4183
4538
 
4539
+ /**
4540
+ * Registers a callback to run after each physics step, once dynamic body transforms have been
4541
+ * synced back to their nodes and before the frame is rendered. Use this for per-step logic that
4542
+ * must observe (or react to) the freshly-integrated state — e.g. tracking a marker to a body's
4543
+ * post-step pose, or applying a force whose effect should integrate on the next step.
4544
+ * @param world - The physics world to hook.
4545
+ * @param cb - Callback invoked with the world timestep (seconds) after each step.
4546
+ */
4547
+ export declare function onPhysicsAfterStep(world: PhysicsWorld, cb: (timestep: number) => void): void;
4548
+
4549
+ /**
4550
+ * Register a callback invoked once per collision event after each physics step.
4551
+ *
4552
+ * The events are produced by the Havok world step, so they are drained via the post-step hook
4553
+ * ({@link onPhysicsAfterStep}). Enable events on the participating bodies first with
4554
+ * {@link setPhysicsBodyCollisionEventsEnabled}, otherwise the stream is empty.
4555
+ * @param world - The physics world to listen on.
4556
+ * @param cb - Callback invoked with each {@link PhysicsCollisionInfo} as it is read.
4557
+ */
4558
+ export declare function onPhysicsCollision(world: PhysicsWorld, cb: (info: PhysicsCollisionInfo) => void): void;
4559
+
4560
+ /**
4561
+ * Register a callback invoked once per trigger event after each physics step.
4562
+ *
4563
+ * The events are produced by the Havok world step, so they are drained via the post-step
4564
+ * hook ({@link onPhysicsAfterStep}). Flag the participating shape with
4565
+ * {@link setPhysicsShapeIsTrigger} first, otherwise the stream is empty.
4566
+ * @param world - The physics world to listen on.
4567
+ * @param cb - Callback invoked with each {@link PhysicsTriggerInfo} as it is read.
4568
+ */
4569
+ export declare function onPhysicsTrigger(world: PhysicsWorld, cb: (info: PhysicsTriggerInfo) => void): void;
4570
+
4184
4571
  /** Register a callback to run when `disposeScene` is called. Used to tie
4185
4572
  * user-owned GPU resources (e.g. a `SpriteRenderer`) to the scene's lifetime. */
4186
4573
  export declare function onSceneDispose(scene: SceneContext, cb: () => void): void;
@@ -4382,12 +4769,241 @@ export declare interface PhysicsAggregateOptions {
4382
4769
  center?: Vec3;
4383
4770
  startAsleep?: boolean;
4384
4771
  isTriggerShape?: boolean;
4772
+ /**
4773
+ * Optional pre-built shape. When provided, it is used directly and the
4774
+ * primitive-shape build path is skipped. This lets callers supply
4775
+ * mesh/convex-hull shapes (built via `createPhysicsShape`) without pulling
4776
+ * the mesh-shape code into `createPhysicsAggregate` itself.
4777
+ */
4778
+ shape?: PhysicsShape;
4385
4779
  }
4386
4780
 
4387
4781
  /** Opaque handle to a Havok rigid body, bound to a scene node and a motion type. */
4388
4782
  export declare interface PhysicsBody {
4389
4783
  readonly node: SceneNode;
4390
4784
  readonly motionType: PhysicsMotionType;
4391
4785
 
4786
+ /**
4787
+ * A physics-driven character controller. Create one with
4788
+ * {@link createPhysicsCharacterController}; drive it each physics step with
4789
+ * {@link PhysicsCharacterController.moveWithCollisions} and read back the resolved position
4790
+ * with {@link PhysicsCharacterController.getPosition}.
4791
+ */
4792
+ export declare class PhysicsCharacterController {
4793
+ /** Minimum separation kept from surfaces, in metres. Default `0.05`. */
4794
+ keepDistance: number;
4795
+ /** Extra distance over which a contact is still tracked. Default `0.1`. */
4796
+ keepContactTolerance: number;
4797
+ /** Maximum number of cast iterations per integration step. Default `10`. */
4798
+ maxCastIterations: number;
4799
+ /** Speed at which penetrations are pushed out. Default `1.0`. */
4800
+ penetrationRecoverySpeed: number;
4801
+ /** Static-friction coefficient against surfaces. Default `0`. */
4802
+ staticFriction: number;
4803
+ /** Dynamic-friction coefficient against surfaces. Default `1`. */
4804
+ dynamicFriction: number;
4805
+ /** Cosine of the steepest slope the character can stand on. Default `0.5` (60°). */
4806
+ maxSlopeCosine: number;
4807
+ /** Upper bound on per-solve character speed. Default `10`. */
4808
+ maxCharacterSpeedForSolver: number;
4809
+ /** World up vector. Default `(0, 1, 0)`. */
4810
+ up: Vec3;
4811
+ /** Push strength applied to dynamic bodies the character contacts. Default `1e38`. */
4812
+ characterStrength: number;
4813
+ /** Acceleration factor used by {@link calculateMovement}. Default `0.05`. */
4814
+ acceleration: number;
4815
+ /** Maximum world-space acceleration used by {@link calculateMovement}. Default `50`. */
4816
+ maxAcceleration: number;
4817
+ /** Character mass used when reacting to gravity against dynamic bodies. Default `0`. */
4818
+ characterMass: number;
4819
+ /**
4820
+ * Fires once per dynamic body the character pushes during a step, just before the reactive
4821
+ * impulse is applied. Mirrors Babylon.js' `onTriggerCollisionObservable`. Subscribe with
4822
+ * `.add(cb)`; the returned disposer removes the subscription.
4823
+ */
4824
+ readonly onTriggerCollisionObservable: CharacterCollisionObservable;
4825
+ private readonly _world;
4826
+ private readonly _shape;
4827
+ private readonly _node;
4828
+ private readonly _body;
4829
+ private readonly _startCollector;
4830
+ private readonly _castCollector;
4831
+ private _position;
4832
+ private _velocity;
4833
+ private _lastVelocity;
4834
+ private _lastDisplacement;
4835
+ private _orientation;
4836
+ private _manifold;
4837
+ private _lastInvDeltaTime;
4838
+ private _frameId;
4839
+ private readonly _contactAngleSensitivity;
4840
+ private readonly _displacementEps;
4841
+ private readonly _bodyTracking;
4842
+ /** Construct a controller. Prefer the {@link createPhysicsCharacterController} factory. */
4843
+ constructor(world: PhysicsWorld, position: Vec3, options: PhysicsCharacterControllerOptions);
4844
+ /** Release the controller's body, shape, and query collectors. */
4845
+ dispose(): void;
4846
+ /** Get the current character position (world space). The returned vector is owned by the controller. */
4847
+ getPosition(): Vec3;
4848
+ /** Teleport the character to a new position, clearing any swept motion. */
4849
+ setPosition(position: Vec3): void;
4850
+ /** Get the current character velocity (world space). The returned vector is owned by the controller. */
4851
+ getVelocity(): Vec3;
4852
+ /** Set the character velocity (world space). */
4853
+ setVelocity(velocity: Vec3): void;
4854
+ /**
4855
+ * Move the character by a displacement this physics step, sliding along any geometry it meets.
4856
+ * @param displacement - Requested world-space displacement for this step.
4857
+ */
4858
+ moveWithCollisions(displacement: Vec3): void;
4859
+ /**
4860
+ * Advance the controller using a velocity already chosen for this step (instead of a raw
4861
+ * displacement). Mirrors Babylon.js' `integrate`: it picks a cast direction from the current
4862
+ * velocity and surface info, then runs the collide-and-slide.
4863
+ * @param deltaTime - Step duration in seconds.
4864
+ * @param surfaceInfo - Surface info from a prior {@link checkSupport} call.
4865
+ * @param gravity - Gravity applied to the character this step.
4866
+ */
4867
+ integrate(deltaTime: number, surfaceInfo: CharacterSurfaceInfo, gravity: Vec3): void;
4868
+ /**
4869
+ * Probe the surface under the character along a direction (usually gravity) to classify support.
4870
+ * @param deltaTime - Step duration in seconds.
4871
+ * @param direction - Direction to probe, usually the gravity direction.
4872
+ * @returns Support classification and averaged surface motion/normal.
4873
+ */
4874
+ checkSupport(deltaTime: number, direction: Vec3): CharacterSurfaceInfo;
4875
+ /**
4876
+ * Compute a target velocity from the current state, a desired velocity, and surface info — a
4877
+ * helper for steering input into surface-aware motion.
4878
+ * @param deltaTime - Step duration in seconds.
4879
+ * @param forwardWorld - Character forward direction (world space).
4880
+ * @param surfaceNormal - Supporting surface normal.
4881
+ * @param currentVelocity - Current character velocity.
4882
+ * @param surfaceVelocity - Velocity induced by the surface.
4883
+ * @param desiredVelocity - Desired character velocity.
4884
+ * @param upWorld - Up vector (world space).
4885
+ * @returns The new velocity vector.
4886
+ */
4887
+ calculateMovement(deltaTime: number, forwardWorld: Vec3, surfaceNormal: Vec3, currentVelocity: Vec3, surfaceVelocity: Vec3, desiredVelocity: Vec3, upWorld: Vec3): Vec3;
4888
+ private _integrateManifolds;
4889
+ private _castWithCollectors;
4890
+ private _findBody;
4891
+ private _contactFromCast;
4892
+ private _validateManifold;
4893
+ private _updateManifold;
4894
+ private _compareContacts;
4895
+ private _findContact;
4896
+ private _getMassProperties;
4897
+ private _getComWorld;
4898
+ private _getPointVelocity;
4899
+ private _getInvMass;
4900
+ private _createSurfaceConstraint;
4901
+ private _addMaxSlopePlane;
4902
+ private _resolveConstraintPenetration;
4903
+ private _createConstraintsFromManifold;
4904
+ private _resolveContacts;
4905
+ private _getOutput;
4906
+ private _sortInfo;
4907
+ private _solve1d;
4908
+ private _solveTest1d;
4909
+ private _solve2d;
4910
+ private _solve3d;
4911
+ private _examineActivePlanes;
4912
+ private _copyPlane;
4913
+ private _simplexSolverSolve;
4914
+ }
4915
+
4916
+ /** Options describing the character's collision capsule. */
4917
+ export declare interface PhysicsCharacterControllerOptions {
4918
+ /** Total capsule height (tip to tip), in metres. Default `1.8`. */
4919
+ capsuleHeight: number;
4920
+ /** Capsule radius, in metres. Default `0.6`. */
4921
+ capsuleRadius: number;
4922
+ }
4923
+
4924
+ /** A single collision event reported by Havok after a physics step. */
4925
+ export declare interface PhysicsCollisionInfo {
4926
+ /** Phase of the contact: a new contact, an ongoing contact, or a contact that just ended. */
4927
+ type: "STARTED" | "CONTINUED" | "FINISHED";
4928
+ /** World-space contact point (closest point on the first body). */
4929
+ point: Vec3;
4930
+ /** World-space contact normal at the contact point. */
4931
+ normal: Vec3;
4932
+ /** Magnitude of the impulse applied to resolve the contact (0 for `FINISHED`). */
4933
+ impulse: number;
4934
+ }
4935
+
4936
+ /** Opaque handle to a Havok constraint between two bodies. */
4937
+ export declare interface PhysicsConstraint {
4392
4938
  readonly bodyA: PhysicsBody;
4939
+ readonly bodyB: PhysicsBody;
4940
+ readonly type: PhysicsConstraintType;
4941
+ readonly options: PhysicsConstraintOptions;
4942
+ readonly limits?: readonly PhysicsConstraintLimit[];
4943
+ }
4944
+
4945
+ /** Axis addressed by a Physics V2 constraint limit. */
4946
+ export declare const enum PhysicsConstraintAxis {
4947
+ LINEAR_X = 0,
4948
+ LINEAR_Y = 1,
4949
+ LINEAR_Z = 2,
4950
+ ANGULAR_X = 3,
4951
+ ANGULAR_Y = 4,
4952
+ ANGULAR_Z = 5,
4953
+ LINEAR_DISTANCE = 6
4954
+ }
4955
+
4956
+ /** Minimal constraint debug data consumed by the Lite PhysicsViewer. */
4957
+ export declare interface PhysicsConstraintDebug {
4958
+ readonly bodyA: PhysicsBody;
4959
+ readonly bodyB: PhysicsBody;
4960
+ readonly pivotA: Vec3;
4961
+ readonly pivotB: Vec3;
4962
+ readonly axisA?: Vec3;
4963
+ readonly axisB?: Vec3;
4964
+ readonly perpAxisA?: Vec3;
4965
+ readonly perpAxisB?: Vec3;
4966
+ readonly type?: number;
4967
+ }
4968
+
4969
+ /** Limit options used by 6DoF constraints. */
4970
+ export declare interface PhysicsConstraintLimit {
4971
+ axis: PhysicsConstraintAxis;
4972
+ minLimit?: number;
4973
+ maxLimit?: number;
4974
+ stiffness?: number;
4975
+ damping?: number;
4976
+ }
4977
+
4978
+ /** Pivot/axis options used to create a physics constraint. */
4979
+ export declare interface PhysicsConstraintOptions {
4980
+ pivotA?: Vec3;
4981
+ pivotB?: Vec3;
4982
+ axisA?: Vec3;
4983
+ axisB?: Vec3;
4984
+ perpAxisA?: Vec3;
4985
+ perpAxisB?: Vec3;
4986
+ maxDistance?: number;
4987
+ collision?: boolean;
4988
+ }
4989
+
4990
+ /** Type of Havok Physics V2 constraint. */
4991
+ export declare const enum PhysicsConstraintType {
4992
+ BALL_AND_SOCKET = 1,
4993
+ DISTANCE = 2,
4994
+ HINGE = 3,
4995
+ SLIDER = 4,
4996
+ LOCK = 5,
4997
+ PRISMATIC = 6,
4998
+ SIX_DOF = 7
4999
+ }
5000
+
5001
+ /** Mass properties applied to a physics body. Omitted fields keep Havok's shape-derived values. */
5002
+ export declare interface PhysicsMassProperties {
5003
+ centerOfMass?: Vec3;
5004
+ mass?: number;
5005
+ inertia?: Vec3;
5006
+ inertiaOrientation?: Quat;
5007
+ }
5008
+
4393
5009
  /** How a body moves: `STATIC` (immovable), `ANIMATED` (driven by the node transform), or `DYNAMIC` (simulated). */
4394
5010
  export declare const enum PhysicsMotionType {
4395
5011
  STATIC = 0,
@@ -4395,6 +5011,32 @@ export declare const enum PhysicsMotionType {
4395
5011
  DYNAMIC = 2
4396
5012
  }
4397
5013
 
5014
+ /**
5015
+ * How a moved transform node is propagated to its physics body before each step.
5016
+ * `DISABLED` skips the sync, `TELEPORT` snaps the body to the node (`HP_Body_SetQTransform`),
5017
+ * and `ACTION` sets the body's velocity so it reaches the node (`HP_Body_SetTargetQTransform`,
5018
+ * dragging resting bodies via friction). Values match Babylon.js `PhysicsPrestepType`.
5019
+ */
5020
+ export declare const enum PhysicsPrestepType {
5021
+ DISABLED = 0,
5022
+ TELEPORT = 1,
5023
+ ACTION = 2
5024
+ }
5025
+
5026
+ /**
5027
+ * Cast a ray from `from` to `to` and return the first body it hits.
5028
+ *
5029
+ * `collideWith`/`membership` filter which bodies the ray can hit (by their shape filter masks).
5030
+ * For MESH shapes the hit triangle index is reported; non-mesh shapes report `-1`. Run at least
5031
+ * one physics step first so the broadphase exists.
5032
+ * @param world - The physics world to query.
5033
+ * @param from - World-space ray origin.
5034
+ * @param to - World-space ray end point.
5035
+ * @param query - Optional collision-filter masks and trigger behaviour.
5036
+ * @returns The raycast result; `hasHit` is `false` when the ray clears every matching body.
5037
+ */
5038
+ export declare function physicsRaycast(world: PhysicsWorld, from: Vec3, to: Vec3, query?: RaycastQuery): RaycastResult;
5039
+
4398
5040
  /** Opaque handle to a Havok collision shape. */
4399
5041
  export declare interface PhysicsShape {
4400
5042
 
@@ -4402,6 +5044,10 @@ export declare interface PhysicsShape {
4402
5044
  export declare interface PhysicsShapeOptions {
4403
5045
  type: PhysicsShapeType;
4404
5046
  parameters?: PhysicsShapeParameters;
5047
+ /** Mesh or transform hierarchy used when `type` is `MESH` or `CONVEX_HULL`. */
5048
+ mesh?: SceneNode;
5049
+ /** When true, mesh and convex-hull shapes accumulate descendant meshes under `mesh`. */
5050
+ includeChildMeshes?: boolean;
4405
5051
  }
4406
5052
 
4407
5053
  /** Geometry parameters describing a collision shape; which fields apply depends on the shape type. */
@@ -4426,12 +5072,55 @@ export declare const enum PhysicsShapeType {
4426
5072
  HEIGHTFIELD = 7
4427
5073
  }
4428
5074
 
5075
+ /** A single trigger-volume event reported by Havok after a physics step. */
5076
+ export declare interface PhysicsTriggerInfo {
5077
+ /** `ENTERED` when a body enters the trigger volume, `EXITED` when it leaves. */
5078
+ type: "ENTERED" | "EXITED";
5079
+ }
5080
+
5081
+ /** Pure-state handle for Havok Physics V2 debug rendering. */
5082
+ export declare interface PhysicsViewer {
5083
+ readonly scene: SceneContext;
5084
+ readonly world: PhysicsWorld;
5085
+
5086
+ /** Options used when creating a physics debug viewer. */
5087
+ export declare interface PhysicsViewerOptions {
5088
+ /** RGBA debug line color. Defaults to opaque white, matching Babylon.js PhysicsViewer. */
5089
+ color?: readonly [number, number, number, number];
5090
+ }
5091
+
4429
5092
  /** Pure-state handle to a Havok physics world: the WASM module, the native world, its bodies, and the timestep. */
4430
5093
  export declare interface PhysicsWorld {
4431
5094
 
4432
5095
  /** Pick the mesh at CSS-space canvas coordinates, matching Babylon.js Scene.pick. Returns a PickingInfo. */
4433
5096
  export declare function pickAsync(picker: GpuPicker, x: number, y: number, options?: PickOptions): Promise<PickingInfo>;
4434
5097
 
5098
+ /**
5099
+ * Optional GPU-side discard rule for {@link pickAsync}.
5100
+ *
5101
+ * This lets apps remove pick hits with custom WGSL while keeping the main scene
5102
+ * render untouched. The WGSL must define
5103
+ * `fn shouldDiscardPick(input: PickDiscardInput) -> bool`.
5104
+ */
5105
+ export declare interface PickDiscardRule {
5106
+ /** Stable cache key for the generated picking pipeline set. Change it when the WGSL or layout changes. */
5107
+ readonly key: string;
5108
+ /** WGSL source that defines `shouldDiscardPick(input: PickDiscardInput) -> bool`. */
5109
+ readonly wgsl: string;
5110
+ /** Optional typed-array storage inputs exposed to the discard WGSL at group 2. */
5111
+ readonly storage?: readonly PickDiscardStorage[];
5112
+ }
5113
+
5114
+ /** Storage data for a pick discard rule. Lite injects the WGSL declaration and owns the GPU buffer upload. */
5115
+ declare interface PickDiscardStorage {
5116
+ /** WGSL variable name declared at `@group(2) @binding(index)`; must be unique within the rule. */
5117
+ readonly name: string;
5118
+ /** WGSL storage type, for example `array<vec4<f32>>`. */
5119
+ readonly type: string;
5120
+ /** Per-mesh data for the current pick. Return `null` to draw that mesh with the default picker. */
5121
+ readonly data: (mesh: Mesh) => ArrayBufferView | null | undefined;
5122
+ }
5123
+
4435
5124
  /** Result of a GPU pick operation. */
4436
5125
  export declare interface PickingInfo {
4437
5126
  hit: boolean;
@@ -4461,6 +5150,18 @@ export declare interface PickOptions {
4461
5150
  * structure behind/around them. When omitted, every mesh is pickable (previous behaviour). Applied
4462
5151
  * identically to the id-assignment and id-resolve passes so ids stay consistent. */
4463
5152
  filter?: (mesh: Mesh) => boolean;
5153
+ /** Optional GPU fragment-discard extension for app-specific pick removal.
5154
+ *
5155
+ * `wgsl` is injected into the regular and thin-instance picking shaders and must define:
5156
+ *
5157
+ * `fn shouldDiscardPick(input: PickDiscardInput) -> bool`
5158
+ *
5159
+ * The input exposes only generic picker data: `worldPos`, `pickId`, `thinInstanceIndex`,
5160
+ * `hasThinInstance`, and `instanceExtras` (the original thin-instance matrix w lanes, zero for
5161
+ * non-instanced meshes). Storage entries are uploaded and bound by Lite for the current pick only. */
5162
+ discard?: PickDiscardRule;
5163
+ /** Dev-only diagnostics: logs the pick ray, pixel, pick id/depth and resolved mesh. */
5164
+ debugLabel?: string;
4464
5165
  }
4465
5166
 
4466
5167
  /** Sampler and format overrides for `createTexture2DFromPixels()`. */
@@ -4836,7 +5537,7 @@ export declare type QuadCurve = {
4836
5537
  };
4837
5538
 
4838
5539
  /** Quaternion rotation */
4839
- declare interface Quat {
5540
+ export declare interface Quat {
4840
5541
  x: number;
4841
5542
  y: number;
4842
5543
  z: number;
@@ -4862,6 +5563,32 @@ export declare function raycast(plugin: NavigationPlugin, start: Vec3, end: Vec3
4862
5563
  hitPoint?: Vec3;
4863
5564
  };
4864
5565
 
5566
+ /** Query parameters for {@link physicsRaycast}. */
5567
+ export declare interface RaycastQuery {
5568
+ /** Bitmask describing which collision groups the ray belongs to. Default `~0` (all). */
5569
+ membership?: number;
5570
+ /** Bitmask describing which collision groups the ray collides with. Default `~0` (all). */
5571
+ collideWith?: number;
5572
+ /** Whether trigger volumes count as hits. Default `false`. */
5573
+ shouldHitTriggers?: boolean;
5574
+ }
5575
+
5576
+ /** Result of a {@link physicsRaycast} query. */
5577
+ export declare interface RaycastResult {
5578
+ /** Whether the ray hit a body. */
5579
+ hasHit: boolean;
5580
+ /** World-space contact point. */
5581
+ hitPoint: Vec3;
5582
+ /** Surface normal at the contact point. */
5583
+ hitNormal: Vec3;
5584
+ /** Distance from the ray origin (`from`) to the contact point. */
5585
+ hitDistance: number;
5586
+ /** Index of the triangle hit on a MESH shape, or `-1` for non-mesh shapes. */
5587
+ triangleIndex: number;
5588
+ /** The body that was hit, or `null` when nothing was hit (or the body is not tracked). */
5589
+ body: PhysicsBody | null;
5590
+ }
5591
+
4865
5592
  /** Rebuild renderables whose pipeline/bind-group feature state depends on a material.
4866
5593
  * Use after texture, sampler, bind-group layout, culling, or feature changes.
4867
5594
  * UBO-only scalar/vector changes should use markMaterialUboDirty instead. */
@@ -4971,6 +5698,17 @@ export declare function removeBillboardSpriteIndex(system: BillboardSpriteSystem
4971
5698
  * Standalone function for tree-shaking — only included when actually used. */
4972
5699
  export declare function removeFromScene(scene: SceneContext, mesh: Mesh): void;
4973
5700
 
5701
+ /**
5702
+ * Remove one logical hierarchy instance with O(1) swap-remove semantics.
5703
+ *
5704
+ * If `index` is not the last active slot, the last logical instance moves into
5705
+ * `index` in every descendant mesh buffer.
5706
+ *
5707
+ * @param pool - Pool created by {@link createHierarchyInstancePool}.
5708
+ * @param index - Active logical instance index to remove.
5709
+ */
5710
+ export declare function removeHierarchyInstance(pool: HierarchyInstancePool, index: number): void;
5711
+
4974
5712
  /** Remove a mesh from this task's renderable + binding lists. Idempotent. */
4975
5713
  export declare function removeMeshFromTask(task: RenderTask, mesh: object): void;
4976
5714
 
@@ -5145,13 +5883,46 @@ export declare interface RenderTaskConfig {
5145
5883
  /** Use canvas dimensions, not render-target dimensions, for this pass's scene UBO aspect. */
5146
5884
  cs?: boolean;
5147
5885
  /** Scene-texture transmission settings. `copyCount: 0` copies before every transmissive draw.
5148
- * `generateMipmaps: false` allocates only mip 0 for the refraction texture and skips mip generation. */
5886
+ * `generateMipmaps: false` allocates only mip 0 for the refraction texture and skips mip generation.
5887
+ * `mipLevelCount` caps the generated chain when a material only samples low explicit LODs. */
5149
5888
  transmission?: {
5150
5889
  copyCount?: number;
5151
5890
  generateMipmaps?: boolean;
5891
+ mipLevelCount?: number;
5152
5892
  };
5153
5893
  }
5154
5894
 
5895
+ /** GPU time measured for one frame-graph task in one rendered frame. */
5896
+ export declare interface RenderTaskGpuTiming {
5897
+ /** Execution-order index within the measured frame. Useful when several tasks share the same name. */
5898
+ readonly index: number;
5899
+ /** The task's existing frame-graph label (`Task.name`, e.g. `"shadow"`, `"scene"`, `"post-process"`). */
5900
+ readonly name: string;
5901
+ /** GPU duration for this task in milliseconds. */
5902
+ readonly durationMs: number;
5903
+ }
5904
+
5905
+ /** Latest per-task GPU timing snapshot for an engine. */
5906
+ export declare interface RenderTaskGpuTimings {
5907
+ /** `unsupported` when the WebGPU device lacks `timestamp-query`; `pending` until the first readback lands. */
5908
+ readonly status: RenderTaskGpuTimingStatus;
5909
+ /** Whether this engine's device exposes WebGPU timestamp queries. */
5910
+ readonly supported: boolean;
5911
+ /** Whether task timing is currently enabled and recording future frames. */
5912
+ readonly enabled: boolean;
5913
+ /** Monotonic profiler frame index for the snapshot. `0` means no measured frame has completed yet. */
5914
+ readonly frameIndex: number;
5915
+ /** Measured tasks in frame execution order. Empty until `status === "available"`. */
5916
+ readonly tasks: readonly RenderTaskGpuTiming[];
5917
+ /** Number of tasks skipped in that frame because the profiler's query-set capacity was exceeded. */
5918
+ readonly droppedTaskCount: number;
5919
+ /** Readback failure message when `status === "error"`. */
5920
+ readonly error?: string;
5921
+ }
5922
+
5923
+ /** Availability / lifecycle state for per-frame-graph-task GPU timings. */
5924
+ export declare type RenderTaskGpuTimingStatus = "unsupported" | "disabled" | "pending" | "available" | "error";
5925
+
5155
5926
  /** Sampler / format overrides for `createRenderTexture2D()`. */
5156
5927
  export declare interface RenderTexture2DOptions {
5157
5928
  /** Address mode U. Default 'clamp-to-edge'. */
@@ -5243,6 +6014,9 @@ export declare interface ScaleGizmoOptions {
5243
6014
  thickness?: number;
5244
6015
  }
5245
6016
 
6017
+ /** Multiply every component of `v` by scalar `s`. */
6018
+ export declare function scaleVec3(v: Vec3, s: number): Vec3;
6019
+
5246
6020
  /** Scattering sub-feature. Presence enables screen-space subsurface scattering.
5247
6021
  * NOTE: PrePass/SSS pipeline is not yet implemented — this type is reserved. */
5248
6022
  declare interface ScatteringProps {
@@ -5464,6 +6238,46 @@ export declare function setFog(scene: SceneContext, config: FogConfig): void;
5464
6238
  /** Set one or more orientation fields at once (single recompute). Omitted fields keep their value. */
5465
6239
  export declare function setGeospatialOrientation(camera: GeospatialCamera, orientation: GeospatialOrientation): void;
5466
6240
 
6241
+ /** Enable or disable per-frame GPU timing. Disabled by default and a no-op on devices where
6242
+ * {@link isGpuTimingSupported} is false. While on, {@link EngineContext.gpuFrameTimeMs} is updated each
6243
+ * frame with the measured GPU time — the time the GPU spends on that frame's work, not CPU/wall-clock
6244
+ * time — a frame or two behind via an async, non-blocking readback.
6245
+ *
6246
+ * Implementation: the timer module is dynamic-imported on the first enable, so engines that never call
6247
+ * this ship none of it. Once loaded, three tiny per-frame hooks are installed on the engine; while timing
6248
+ * is off they are undefined and {@link renderFrame} only optional-chains them (a no-op short-circuit), so
6249
+ * scenes that never enable timing pay effectively nothing. The opening/closing timestamps are written into
6250
+ * the frame's command encoder so the GPU runs them contiguously around just that frame's passes. The first
6251
+ * enable takes effect a microtask later (the GPU resources are created lazily, then reused); subsequent
6252
+ * toggles are synchronous. */
6253
+ export declare function setGpuTimingEnabled(engine: EngineContext, enabled: boolean): void;
6254
+
6255
+ /**
6256
+ * Set the active logical hierarchy instance count without reallocating buffers.
6257
+ *
6258
+ * This mirrors {@link setThinInstanceCount}: it only changes how many existing
6259
+ * slots draw. Newly exposed slots are not initialized here; use
6260
+ * {@link addHierarchyInstance} when growing with a new matrix, or immediately
6261
+ * call {@link setHierarchyInstanceMatrix} before the next frame.
6262
+ *
6263
+ * @param pool - Pool created by {@link createHierarchyInstancePool}.
6264
+ * @param count - New active logical instance count, from 0 to `pool.capacity`.
6265
+ */
6266
+ export declare function setHierarchyInstanceCount(pool: HierarchyInstancePool, count: number): void;
6267
+
6268
+ /**
6269
+ * Update one logical hierarchy instance's root matrix.
6270
+ *
6271
+ * @param pool - Pool created by {@link createHierarchyInstancePool}.
6272
+ * @param index - Active logical instance index to update.
6273
+ * @param matrix - Desired world matrix for the hierarchy root instance.
6274
+ */
6275
+ export declare function setHierarchyInstanceMatrix(pool: HierarchyInstancePool, index: number, matrix: Mat4): void;
6276
+
6277
+ /** Override the URL of the KTX2/Basis decoder script (and, optionally, the URLs of the WASM/JS transcoder
6278
+ * modules it pulls). Call before the first KHR_texture_basisu texture loads. */
6279
+ export declare function setKtx2DecoderUrl(url: string, wasmUrls?: Record<string, Record<string, string>>): void;
6280
+
5467
6281
  /** Raise (or lower) the maximum number of scene lights in the shared lights UBO.
5468
6282
  * Must be called BEFORE scene pipelines are compiled — existing pipelines
5469
6283
  * and UBOs bake the cap into their WGSL/layout. */
@@ -5493,22 +6307,45 @@ export declare function setParent(child: Mesh, parent: IWorldMatrixProvider | nu
5493
6307
  */
5494
6308
  export declare function setPhysicsBodyAngularVelocity(world: PhysicsWorld, body: PhysicsBody, velocity: Vec3): void;
5495
6309
 
6310
+ /**
6311
+ * Enable or disable collision-event reporting for a single body by setting its Havok event mask.
6312
+ *
6313
+ * Only bodies with events enabled contribute to the stream read by {@link onPhysicsCollision};
6314
+ * a collision is reported when at least one of the two touching bodies has events enabled.
6315
+ * @param world - The physics world owning the body.
6316
+ * @param body - The body to toggle collision events on.
6317
+ * @param enabled - `true` to report STARTED/CONTINUED/FINISHED events, `false` to silence the body.
6318
+ */
6319
+ export declare function setPhysicsBodyCollisionEventsEnabled(world: PhysicsWorld, body: PhysicsBody, enabled: boolean): void;
6320
+
5496
6321
  /**
5497
6322
  * Set a body's linear velocity (m/s) directly — e.g. to impart a throw velocity on release.
5498
6323
  */
5499
6324
  export declare function setPhysicsBodyLinearVelocity(world: PhysicsWorld, body: PhysicsBody, velocity: Vec3): void;
5500
6325
 
5501
6326
  /**
5502
- * Sets a body's mass and a matching diagonal inertia tensor.
6327
+ * Sets a body's mass, preserving the shape-derived inertia tensor, centre of mass, and inertia
6328
+ * orientation (matching Babylon.js `HavokPlugin` — only the mass scalar is overridden). A body with
6329
+ * no shape attached yet has no inertia tensor to derive, so it falls back to an isotropic inertia
6330
+ * proportional to the mass until a shape is set.
5503
6331
  * @param world - The physics world.
5504
6332
  * @param body - The body to update.
5505
6333
  * @param mass - Mass in kilograms.
5506
- * @param centerOfMass - Optional body-local centre of mass (defaults to the origin). Use this when the
5507
- * collision shape is offset from the body's reference frame (e.g. a prop whose body origin sits at
5508
- * its base but whose shape is centred on its middle) so it tumbles around its real centre.
6334
+ * @param centerOfMass - Optional body-local centre of mass override. When omitted, the shape-derived
6335
+ * centre of mass is preserved. Use this when the collision shape is offset from the body's reference
6336
+ * frame (e.g. a prop whose body origin sits at its base but whose shape is centred on its middle)
6337
+ * so it tumbles around its real centre.
5509
6338
  */
5510
6339
  export declare function setPhysicsBodyMass(world: PhysicsWorld, body: PhysicsBody, mass: number, centerOfMass?: Vec3): void;
5511
6340
 
6341
+ /**
6342
+ * Sets a body's mass properties, preserving Havok's shape-derived values for omitted fields.
6343
+ * @param world - The physics world.
6344
+ * @param body - The body to update.
6345
+ * @param properties - Mass-property overrides.
6346
+ */
6347
+ export declare function setPhysicsBodyMassProperties(world: PhysicsWorld, body: PhysicsBody, properties: PhysicsMassProperties): void;
6348
+
5512
6349
  /**
5513
6350
  * Switch a body's motion type at runtime (e.g. ANIMATED/kinematic while a prop is grabbed, then
5514
6351
  * DYNAMIC on release). Mutates `body.motionType` so the per-frame step syncs it the right way
@@ -5516,6 +6353,24 @@ export declare function setPhysicsBodyMass(world: PhysicsWorld, body: PhysicsBod
5516
6353
  */
5517
6354
  export declare function setPhysicsBodyMotionType(world: PhysicsWorld, body: PhysicsBody, motionType: PhysicsMotionType): void;
5518
6355
 
6356
+ /**
6357
+ * Enable or disable pre-step synchronization from a node transform to its Havok body.
6358
+ * @param body - The physics body to update.
6359
+ * @param enabled - When true, the node transform is written to Havok before each physics step.
6360
+ */
6361
+ export declare function setPhysicsBodyPreStep(body: PhysicsBody, enabled: boolean): void;
6362
+
6363
+ /**
6364
+ * Sets how a moved transform node is propagated to its physics body before each step.
6365
+ * `TELEPORT` snaps the body to the node, `ACTION` sets a velocity toward it (so resting bodies are
6366
+ * dragged along by friction), and `DISABLED` skips the pre-step sync entirely. Setting any type
6367
+ * other than `DISABLED` automatically enables prestep syncing for the body (equivalent to
6368
+ * {@link setPhysicsBodyPreStep}), so STATIC/DYNAMIC bodies are synced without an extra call.
6369
+ * @param body - The physics body to update.
6370
+ * @param type - The prestep behaviour to apply.
6371
+ */
6372
+ export declare function setPhysicsBodyPrestepType(body: PhysicsBody, type: PhysicsPrestepType): void;
6373
+
5519
6374
  /**
5520
6375
  * Assigns a collision shape to a body.
5521
6376
  * @param world - The physics world.
@@ -5540,6 +6395,34 @@ export declare function setPhysicsBodyTransform(world: PhysicsWorld, body: Physi
5540
6395
  */
5541
6396
  export declare function setPhysicsGravity(world: PhysicsWorld, gravity: Vec3, worldPosition?: Vec3): void;
5542
6397
 
6398
+ /**
6399
+ * Sets the Havok filter collide mask for a collision shape.
6400
+ * @param world - The physics world.
6401
+ * @param shape - The shape to update.
6402
+ * @param collideMask - Bitmask describing which collision groups this shape collides with.
6403
+ */
6404
+ export declare function setPhysicsShapeFilterCollideMask(world: PhysicsWorld, shape: PhysicsShape, collideMask: number): void;
6405
+
6406
+ /**
6407
+ * Sets the Havok filter membership mask for a collision shape.
6408
+ * @param world - The physics world.
6409
+ * @param shape - The shape to update.
6410
+ * @param membershipMask - Bitmask describing which collision group this shape belongs to.
6411
+ */
6412
+ export declare function setPhysicsShapeFilterMembershipMask(world: PhysicsWorld, shape: PhysicsShape, membershipMask: number): void;
6413
+
6414
+ /**
6415
+ * Flag a collision shape as a trigger volume (or clear the flag).
6416
+ *
6417
+ * A trigger shape detects overlaps and reports {@link PhysicsTriggerInfo} events but does
6418
+ * not produce a physical collision response — bodies pass through it. Attach the flagged
6419
+ * shape to a body in the world, then listen with {@link onPhysicsTrigger}.
6420
+ * @param world - The physics world owning the shape.
6421
+ * @param shape - The collision shape to flag.
6422
+ * @param isTrigger - `true` to make the shape a trigger volume, `false` for a solid shape.
6423
+ */
6424
+ export declare function setPhysicsShapeIsTrigger(world: PhysicsWorld, shape: PhysicsShape, isTrigger: boolean): void;
6425
+
5543
6426
  /**
5544
6427
  * Sets a shape's surface material properties.
5545
6428
  * @param world - The physics world.
@@ -5566,6 +6449,15 @@ export declare function setPhysicsVelocityLimits(world: PhysicsWorld, maxLinear:
5566
6449
 
5567
6450
  export declare function setPositionGizmoLocalCoordinates(gizmo: PositionGizmo, useLocal: boolean): void;
5568
6451
 
6452
+ /** Enable or disable per-frame-graph-task GPU timing.
6453
+ *
6454
+ * The profiling implementation is loaded with a dynamic import on first enable. Engines that never call this
6455
+ * function do not fetch the profiler chunk or carry task-timing code in the always-fetched frame graph.
6456
+ * The returned snapshot is `unsupported` if the device lacks WebGPU `timestamp-query`, `pending` immediately
6457
+ * after enable, and `available` once a later frame's async timestamp readback completes.
6458
+ */
6459
+ export declare function setRenderTaskGpuTimingEnabled(engine: EngineContext, enabled: boolean): Promise<RenderTaskGpuTimings>;
6460
+
5569
6461
  export declare function setRotationGizmoLocalCoordinates(gizmo: RotationGizmo, useLocal: boolean): void;
5570
6462
 
5571
6463
  /** Toggle local-coord mode on the per-axis scale arrows. The uniform-scale
@@ -5581,6 +6473,9 @@ export declare function setShaderFloat(material: ShaderMaterial, name: string, v
5581
6473
  * straight into a matrix uniform without laundering through a typed array. */
5582
6474
  export declare function setShaderMatrix(material: ShaderMaterial, name: string, value: Float32Array | Mat4): void;
5583
6475
 
6476
+ /** Bind (or clear) a declared read-only storage buffer. */
6477
+ export declare function setShaderStorageBuffer(material: ShaderMaterial, name: string, buffer: GPUBuffer | null): void;
6478
+
5584
6479
  /** Bind (or clear) the texture for a declared sampler, enforcing that depth and
5585
6480
  * non-depth samplers receive a matching `Texture2D`.
5586
6481
  * @param material - Target material.
@@ -5721,6 +6616,7 @@ export declare interface ShaderMaterial extends Material {
5721
6616
  readonly attributes: readonly ShaderAttributeName[];
5722
6617
  readonly uniformDecls: readonly ShaderUniformDecl[];
5723
6618
  readonly samplerDecls: readonly ShaderSamplerDecl[];
6619
+ readonly storageBufferDecls: readonly ShaderStorageBufferDecl[];
5724
6620
  readonly defines: readonly ShaderDefine[];
5725
6621
  readonly needAlphaBlending: boolean;
5726
6622
  readonly blendMode: "alpha" | "additive";
@@ -5730,6 +6626,7 @@ export declare interface ShaderMaterial extends Material {
5730
6626
  readonly backFaceCulling: boolean;
5731
6627
  readonly depthWrite: boolean;
5732
6628
  readonly depthCompare: GPUCompareFunction;
6629
+ readonly depthOnlyFragment: boolean;
5733
6630
  readonly depthBias: number;
5734
6631
  readonly depthBiasSlopeScale: number;
5735
6632
 
@@ -5742,6 +6639,7 @@ export declare interface ShaderMaterialOptions {
5742
6639
  readonly attributes: readonly ShaderAttributeName[];
5743
6640
  readonly uniforms?: readonly ShaderUniformOption[];
5744
6641
  readonly samplers?: readonly ShaderSamplerOption[];
6642
+ readonly storageBuffers?: readonly ShaderStorageBufferOption[];
5745
6643
  readonly defines?: ShaderDefineMap;
5746
6644
  readonly needAlphaBlending?: boolean;
5747
6645
  /** Blend equation used when `needAlphaBlending` is set. "alpha" (default) is
@@ -5759,6 +6657,10 @@ export declare interface ShaderMaterialOptions {
5759
6657
  readonly backFaceCulling?: boolean;
5760
6658
  readonly depthWrite?: boolean;
5761
6659
  readonly depthCompare?: GPUCompareFunction;
6660
+ /** Compile/run the fragment stage even for depth-only render targets (no colour attachments).
6661
+ * Use for depth-only casters that need `discard` (alpha/clip masks). The fragment shader must not
6662
+ * declare colour outputs when drawn into a depth-only target. Default false. */
6663
+ readonly depthOnlyFragment?: boolean;
5762
6664
  /** Constant depth-bias added in the pipeline's depth-stencil state (units of the depth format's minimum
5763
6665
  * representable value). Lets a surface that hugs another (e.g. tiles overlapping a cone, decals) win the
5764
6666
  * depth test consistently and avoid z-fighting. Default 0 (no bias). */
@@ -5798,6 +6700,15 @@ export declare interface ShaderSamplerDecl {
5798
6700
  /** A sampler entry: either a bare sampler name or an explicit declaration. */
5799
6701
  export declare type ShaderSamplerOption = string | ShaderSamplerDecl;
5800
6702
 
6703
+ /** A storage buffer declaration. `type` is the WGSL variable type, e.g. `array<vec4<f32>>`. */
6704
+ declare interface ShaderStorageBufferDecl {
6705
+ readonly name: string;
6706
+ readonly type: string;
6707
+ }
6708
+
6709
+ /** A storage-buffer entry: a read-only WGSL storage binding declaration. */
6710
+ declare type ShaderStorageBufferOption = ShaderStorageBufferDecl;
6711
+
5801
6712
  /** Built-in uniform names automatically populated by the renderer each frame
5802
6713
  * (transforms, camera position, screen size, alpha cutoff). */
5803
6714
  export declare type ShaderSystemUniformName = "world" | "view" | "projection" | "viewProjection" | "worldView" | "worldViewProjection" | "cameraPosition" | "screenSize" | "alphaCutoff";
@@ -5826,8 +6737,93 @@ export declare interface ShadowTask extends Task {
5826
6737
  readonly name: "shadow";
5827
6738
  }
5828
6739
 
6740
+ /**
6741
+ * Sweep a shape from `startPosition` to `endPosition` (orientation fixed) and return the
6742
+ * first body it hits.
6743
+ *
6744
+ * `hitPoint` is the world-space contact point on the hit body; `fraction` is where along
6745
+ * the sweep contact first occurs. Run at least one physics step first so the broadphase exists.
6746
+ * @param world - The physics world to query.
6747
+ * @param query - Swept shape, orientation, and start/end positions.
6748
+ * @returns The cast result; `hasHit` is `false` when the sweep clears every body.
6749
+ */
6750
+ export declare function shapeCast(world: PhysicsWorld, query: ShapeCastQuery): ShapeCastResult;
6751
+
6752
+ /** Query parameters for {@link shapeCast}. */
6753
+ export declare interface ShapeCastQuery {
6754
+ /** Shape to sweep through the world. */
6755
+ shape: PhysicsShape;
6756
+ /** World-space orientation held constant during the sweep. */
6757
+ rotation: Quat;
6758
+ /** World-space sweep start position. */
6759
+ startPosition: Vec3;
6760
+ /** World-space sweep end position. */
6761
+ endPosition: Vec3;
6762
+ /** Whether trigger volumes count as hits. Default `false`. */
6763
+ shouldHitTriggers?: boolean;
6764
+ }
6765
+
6766
+ /** Result of a {@link shapeCast} query. */
6767
+ export declare interface ShapeCastResult {
6768
+ /** Whether the swept shape hit a body. */
6769
+ hasHit: boolean;
6770
+ /** Fraction along the sweep (`startPosition`→`endPosition`) where contact first occurs. */
6771
+ fraction: number;
6772
+ /** Contact point on the swept shape (query-shape space). */
6773
+ inputHitPoint: Vec3;
6774
+ /** Contact point on the hit body (world space). */
6775
+ hitPoint: Vec3;
6776
+ /** Surface normal at the swept-shape contact. */
6777
+ inputHitNormal: Vec3;
6778
+ /** Surface normal at the hit-body contact. */
6779
+ hitNormal: Vec3;
6780
+ }
6781
+
6782
+ /**
6783
+ * Find the closest point between a query shape and the nearest body in the world.
6784
+ *
6785
+ * The query shape is positioned at `position`/`rotation` and tested against the world's
6786
+ * broadphase. When a body is found within `maxDistance`, `inputHitPoint` is the closest
6787
+ * point on the query shape and `hitPoint` is the closest point on the hit body (world
6788
+ * space). Run at least one physics step first so the broadphase exists.
6789
+ * @param world - The physics world to query.
6790
+ * @param query - Query shape, transform, and search distance.
6791
+ * @returns The proximity result; `hasHit` is `false` when nothing is within range.
6792
+ */
6793
+ export declare function shapeProximity(world: PhysicsWorld, query: ShapeProximityQuery): ShapeProximityResult;
6794
+
6795
+ /** Query parameters for {@link shapeProximity}. */
6796
+ export declare interface ShapeProximityQuery {
6797
+ /** Shape to test for proximity. */
6798
+ shape: PhysicsShape;
6799
+ /** World-space position of the query shape. */
6800
+ position: Vec3;
6801
+ /** World-space orientation of the query shape. */
6802
+ rotation: Quat;
6803
+ /** Maximum distance to search for a nearby body. */
6804
+ maxDistance: number;
6805
+ /** Whether trigger volumes count as hits. Default `false`. */
6806
+ shouldHitTriggers?: boolean;
6807
+ }
6808
+
6809
+ /** Result of a {@link shapeProximity} query. */
6810
+ export declare interface ShapeProximityResult {
6811
+ /** Whether a body was found within `maxDistance`. */
6812
+ hasHit: boolean;
6813
+ /** Distance between the closest points. */
6814
+ distance: number;
6815
+ /** Closest point on the query shape (query-shape local space in a zero-offset world). */
6816
+ inputHitPoint: Vec3;
6817
+ /** Closest point on the hit body (world space). */
6818
+ hitPoint: Vec3;
6819
+ /** Surface normal at the query-shape closest point. */
6820
+ inputHitNormal: Vec3;
6821
+ /** Surface normal at the hit-body closest point. */
6822
+ hitNormal: Vec3;
6823
+ }
6824
+
5829
6825
  /** Sheen layer properties. Maps to BJS PBRMaterial.sheen sub-object. */
5830
- declare interface SheenProps {
6826
+ export declare interface SheenProps {
5831
6827
  /** Whether sheen is active. Default false. */
5832
6828
  isEnabled: boolean;
5833
6829
  /** Sheen color (linear RGB). Default [1, 1, 1]. */
@@ -5845,6 +6841,12 @@ declare interface SheenProps {
5845
6841
  albedoScaling?: boolean;
5846
6842
  }
5847
6843
 
6844
+ /** Shows a Havok Physics V2 body as a wireframe debug mesh. */
6845
+ export declare function showPhysicsBody(viewer: PhysicsViewer, body: PhysicsBody): Mesh | null;
6846
+
6847
+ /** Shows a simplified Physics V2 constraint overlay: local axes (with arrowheads) plus angular-limit disks. */
6848
+ export declare function showPhysicsConstraint(viewer: PhysicsViewer, constraint: PhysicsConstraintDebug): Mesh[];
6849
+
5848
6850
  /** Connects a skeleton to its GPU bone texture for per-frame updates. */
5849
6851
  declare interface SkeletonBinding {
5850
6852
  readonly jointNodes: readonly number[];
@@ -6286,6 +7288,10 @@ export declare interface StandardMaterialProps extends Material {
6286
7288
  lightmapLevel: number;
6287
7289
  /** Lightmap UV channel. 0=UV1, 1=UV2. Default 1 (BJS convention). */
6288
7290
  lightmapCoordIndex: 0 | 1;
7291
+ /** When true, the lightmap is a baked shadowmap that multiplies the final color
7292
+ * (`color *= lightmap * level`) instead of being added. Matches BJS
7293
+ * StandardMaterial.useLightmapAsShadowmap. Default false. */
7294
+ useLightmapAsShadowmap: boolean;
6289
7295
  /** Optional opacity texture. Multiplies alpha (.a channel). */
6290
7296
  opacityTexture: Texture2D | null;
6291
7297
  /** Opacity texture intensity. Default 1.0. */
@@ -6369,6 +7375,9 @@ export declare interface SubSurfaceProps {
6369
7375
  refraction?: RefractionProps;
6370
7376
  }
6371
7377
 
7378
+ /** Subtract vector `b` from vector `a` component-wise. */
7379
+ export declare function subVec3(a: Vec3, b: Vec3): Vec3;
7380
+
6372
7381
  /**
6373
7382
  * Per-canvas rendering surface — owns the GPU canvas context, swapchain format, MSAA
6374
7383
  * configuration, and the list of `RenderingContext`s (scenes, effect renderers,
@@ -6720,6 +7729,14 @@ export declare interface TransmissionOptions {
6720
7729
  * stack) and just need the opaque scene color exposed to a custom transmissive
6721
7730
  * `ShaderMaterial`. */
6722
7731
  linear?: boolean;
7732
+ /** Override how many times the scene-colour grab is refreshed per frame. `0` means before every
7733
+ * transmissive draw; the default is once before the first transmissive draw. */
7734
+ copyCount?: number;
7735
+ /** Set false when the transmissive material never samples the scene-colour grab above mip 0. */
7736
+ generateMipmaps?: boolean;
7737
+ /** Cap the scene-colour grab mip chain. Use this when the material samples explicit low LODs only, so
7738
+ * unused tiny mips are not regenerated every frame. Ignored when `generateMipmaps` is false. */
7739
+ mipLevelCount?: number;
6723
7740
  }
6724
7741
 
6725
7742
  /** Options for `createTubeData`: a circular cross-section swept along a path. */
@@ -6989,12 +8006,29 @@ export declare interface Vec3 {
6989
8006
  z: number;
6990
8007
  }
6991
8008
 
8009
+ /** Create a plain `{ x, y, z }` vector object. */
8010
+ export declare function vec3(x: number, y: number, z: number): Vec3;
8011
+
6992
8012
  /** 3-component vector as a fixed-length `[x, y, z]` tuple. */
6993
8013
  export declare type Vec3Tuple = [number, number, number];
6994
8014
 
8015
+ /** Unit vector pointing up on the positive Y axis. */
8016
+ export declare const Vec3Up: Readonly<Vec3>;
8017
+
8018
+ /** 4-component vector (homogeneous coords, quaternion, tangent) */
8019
+ export declare interface Vec4 {
8020
+ x: number;
8021
+ y: number;
8022
+ z: number;
8023
+ w: number;
8024
+ }
8025
+
6995
8026
  /** Babylon Lite version string. */
6996
8027
  export declare const VERSION = "0.1.0";
6997
8028
 
6998
8029
  declare interface VertexAttribute {
6999
8030
 
8031
+ /** Write Vec3 into a Float32Array at the given byte offset (for uniform buffers). */
8032
+ export declare function writeVec3(out: Float32Array, offset: number, v: Vec3): void;
8033
+
7000
8034
  export { }