@babylonjs/lite 1.0.1 → 1.2.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 (212) 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-BW9sTaVh.js → _mat4-storage-f64-WeexU-hd.js} +2 -2
  5. package/{_mat4-storage-f64-BW9sTaVh.js.map → _mat4-storage-f64-WeexU-hd.js.map} +1 -1
  6. package/{alpha-test-fragment-eUG971h3.js → alpha-test-fragment-x2mnjLgC.js} +2 -2
  7. package/{alpha-test-fragment-eUG971h3.js.map → alpha-test-fragment-x2mnjLgC.js.map} +1 -1
  8. package/{background-dds-skybox-BwG0kYQP.js → background-dds-skybox-BpcDr-9c.js} +3 -3
  9. package/{background-dds-skybox-BwG0kYQP.js.map → background-dds-skybox-BpcDr-9c.js.map} +1 -1
  10. package/{background-ground-DiFpKJzF.js → background-ground-Bm6gjWqx.js} +2 -2
  11. package/{background-ground-DiFpKJzF.js.map → background-ground-Bm6gjWqx.js.map} +1 -1
  12. package/{background-hdr-skybox-DIgJhvfj.js → background-hdr-skybox-CSFo8RX6.js} +3 -3
  13. package/{background-hdr-skybox-DIgJhvfj.js.map → background-hdr-skybox-CSFo8RX6.js.map} +1 -1
  14. package/{background-solid-skybox--fqHdan_.js → background-solid-skybox-DOOBeDIz.js} +2 -2
  15. package/{background-solid-skybox--fqHdan_.js.map → background-solid-skybox-DOOBeDIz.js.map} +1 -1
  16. package/{billboard-renderable-HY2XCd52.js → billboard-renderable-IJfCpeDS.js} +2 -2
  17. package/{billboard-renderable-HY2XCd52.js.map → billboard-renderable-IJfCpeDS.js.map} +1 -1
  18. package/{clamp-block-XHdUk2Va.js → clamp-block-BD_t8I89.js} +2 -2
  19. package/{clamp-block-XHdUk2Va.js.map → clamp-block-BD_t8I89.js.map} +1 -1
  20. package/{clearcoat-fragment-CHYw8MPB.js → clearcoat-fragment-Dj7vGX2u.js} +2 -2
  21. package/{clearcoat-fragment-CHYw8MPB.js.map → clearcoat-fragment-Dj7vGX2u.js.map} +1 -1
  22. package/{create-skeleton-9tdiUjRP.js → create-skeleton-s0hjrC3A.js} +2 -2
  23. package/{create-skeleton-9tdiUjRP.js.map → create-skeleton-s0hjrC3A.js.map} +1 -1
  24. package/{cubemap-skybox-material-DqQ0dyz8.js → cubemap-skybox-material-8lzbgi7K.js} +2 -2
  25. package/{cubemap-skybox-material-DqQ0dyz8.js.map → cubemap-skybox-material-8lzbgi7K.js.map} +1 -1
  26. package/{curve-block-S27sXrJQ.js → curve-block-Ditr4R7V.js} +2 -2
  27. package/{curve-block-S27sXrJQ.js.map → curve-block-Ditr4R7V.js.map} +1 -1
  28. package/{emissive-fragment-CZMQ0_bF.js → emissive-fragment-BOAezkfk.js} +2 -2
  29. package/{emissive-fragment-CZMQ0_bF.js.map → emissive-fragment-BOAezkfk.js.map} +1 -1
  30. package/{esm-shadow-view-Cl36rOrK.js → esm-shadow-view-DRpyRAfa.js} +2 -2
  31. package/{esm-shadow-view-Cl36rOrK.js.map → esm-shadow-view-DRpyRAfa.js.map} +1 -1
  32. package/{esm-shadow-view-CUwxbnMR.js → esm-shadow-view-DmIORQGZ.js} +2 -2
  33. package/{esm-shadow-view-CUwxbnMR.js.map → esm-shadow-view-DmIORQGZ.js.map} +1 -1
  34. package/{esm-shadow-view-DKQ-FSoV.js → esm-shadow-view-JCPaOOi7.js} +2 -2
  35. package/{esm-shadow-view-DKQ-FSoV.js.map → esm-shadow-view-JCPaOOi7.js.map} +1 -1
  36. package/{gaussian-splatting-pipeline-sh-DDo7QQ8l.js → gaussian-splatting-pipeline-sh-B30Mu56i.js} +2 -2
  37. package/{gaussian-splatting-pipeline-sh-DDo7QQ8l.js.map → gaussian-splatting-pipeline-sh-B30Mu56i.js.map} +1 -1
  38. package/{geometry-texture-output-BmuAquio.js → geometry-texture-output-DURiaJ_n.js} +2 -2
  39. package/{geometry-texture-output-BmuAquio.js.map → geometry-texture-output-DURiaJ_n.js.map} +1 -1
  40. package/{geometry-view-xWZmq799.js → geometry-view-DRrscyWU.js} +4 -4
  41. package/{geometry-view-xWZmq799.js.map → geometry-view-DRrscyWU.js.map} +1 -1
  42. package/{gltf-animation-Bq7k_5HA.js → gltf-animation-BjnXkop6.js} +2 -2
  43. package/{gltf-animation-Bq7k_5HA.js.map → gltf-animation-BjnXkop6.js.map} +1 -1
  44. package/{gltf-ext-basisu-C5teqxzQ.js → gltf-ext-basisu-DtzVV1Xx.js} +2 -2
  45. package/{gltf-ext-basisu-C5teqxzQ.js.map → gltf-ext-basisu-DtzVV1Xx.js.map} +1 -1
  46. package/{gltf-ext-node-visibility-DnGTKkMf.js → gltf-ext-node-visibility-BhX0DmiP.js} +2 -2
  47. package/{gltf-ext-node-visibility-DnGTKkMf.js.map → gltf-ext-node-visibility-BhX0DmiP.js.map} +1 -1
  48. package/{gltf-ext-quantization-DheC7FhB.js → gltf-ext-quantization-DaymajCR.js} +2 -2
  49. package/{gltf-ext-quantization-DheC7FhB.js.map → gltf-ext-quantization-DaymajCR.js.map} +1 -1
  50. package/{gltf-ext-uv-transform-DljdVllE.js → gltf-ext-uv-transform-DFmNJ8kA.js} +2 -2
  51. package/{gltf-ext-uv-transform-DljdVllE.js.map → gltf-ext-uv-transform-DFmNJ8kA.js.map} +1 -1
  52. package/{gltf-feature-animation-pointer-DVhymFLK.js → gltf-feature-animation-pointer-C40tqOhL.js} +3 -3
  53. package/{gltf-feature-animation-pointer-DVhymFLK.js.map → gltf-feature-animation-pointer-C40tqOhL.js.map} +1 -1
  54. package/{gltf-feature-animations-hxC3y3bJ.js → gltf-feature-animations-v0S_yb4T.js} +2 -2
  55. package/{gltf-feature-animations-hxC3y3bJ.js.map → gltf-feature-animations-v0S_yb4T.js.map} +1 -1
  56. package/{gltf-feature-draco-B7Q_cMUv.js → gltf-feature-draco-CljWrsna.js} +2 -2
  57. package/{gltf-feature-draco-B7Q_cMUv.js.map → gltf-feature-draco-CljWrsna.js.map} +1 -1
  58. package/{gltf-feature-gpu-instancing-C7sRzWv7.js → gltf-feature-gpu-instancing-BoeSm6Tn.js} +2 -2
  59. package/{gltf-feature-gpu-instancing-C7sRzWv7.js.map → gltf-feature-gpu-instancing-BoeSm6Tn.js.map} +1 -1
  60. package/{gltf-feature-lights-punctual-DF7kya14.js → gltf-feature-lights-punctual-BCTwgyi_.js} +5 -5
  61. package/{gltf-feature-lights-punctual-DF7kya14.js.map → gltf-feature-lights-punctual-BCTwgyi_.js.map} +1 -1
  62. package/{gltf-feature-meshopt-DRG9hEqT.js → gltf-feature-meshopt-DItMkOMt.js} +2 -2
  63. package/{gltf-feature-meshopt-DRG9hEqT.js.map → gltf-feature-meshopt-DItMkOMt.js.map} +1 -1
  64. package/{gltf-feature-morph-DZydYgWp.js → gltf-feature-morph-Cv0mEYIq.js} +3 -3
  65. package/{gltf-feature-morph-DZydYgWp.js.map → gltf-feature-morph-Cv0mEYIq.js.map} +1 -1
  66. package/{gltf-feature-registry-DeYdy3DV.js → gltf-feature-registry-wNbt6UC-.js} +15 -15
  67. package/{gltf-feature-registry-DeYdy3DV.js.map → gltf-feature-registry-wNbt6UC-.js.map} +1 -1
  68. package/{gltf-feature-skeleton-B9och1W0.js → gltf-feature-skeleton-Deh2UBAn.js} +3 -3
  69. package/{gltf-feature-skeleton-B9och1W0.js.map → gltf-feature-skeleton-Deh2UBAn.js.map} +1 -1
  70. package/{gltf-feature-variants-CY_Qft7f.js → gltf-feature-variants-DGSdFNJq.js} +2 -2
  71. package/{gltf-feature-variants-CY_Qft7f.js.map → gltf-feature-variants-DGSdFNJq.js.map} +1 -1
  72. package/{gltf-glb-parser-CqOeXFOz.js → gltf-glb-parser-DSQWsT4r.js} +2 -2
  73. package/{gltf-glb-parser-CqOeXFOz.js.map → gltf-glb-parser-DSQWsT4r.js.map} +1 -1
  74. package/{gltf-interleave-DWf27t-h.js → gltf-interleave-OBqmlu-h.js} +11 -4
  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-DvFxuOqN.js → gltf-pbr-builder-ext-3imk8Tev.js} +2 -2
  79. package/{gltf-pbr-builder-ext-DvFxuOqN.js.map → gltf-pbr-builder-ext-3imk8Tev.js.map} +1 -1
  80. package/{gltf-variants-CUvzYGYX.js → gltf-variants-Dyr54wwg.js} +4 -4
  81. package/{gltf-variants-CUvzYGYX.js.map → gltf-variants-Dyr54wwg.js.map} +1 -1
  82. package/{gpu-task-timer-Dgkff80h.js → gpu-task-timer-DVBNZfq5.js} +2 -2
  83. package/{gpu-task-timer-Dgkff80h.js.map → gpu-task-timer-DVBNZfq5.js.map} +1 -1
  84. package/{gs-picking-pipeline-55sM5LzV.js → gs-picking-pipeline-CERN-Trj.js} +2 -2
  85. package/{gs-picking-pipeline-55sM5LzV.js.map → gs-picking-pipeline-CERN-Trj.js.map} +1 -1
  86. package/{havok-floating-origin-5xp32P-C.js → havok-floating-origin-VVdJRUYc.js} +2 -2
  87. package/{havok-floating-origin-5xp32P-C.js.map → havok-floating-origin-VVdJRUYc.js.map} +1 -1
  88. package/{index-CYZDclhF.js → index-7Bk-uLSM.js} +2 -2
  89. package/{index-CYZDclhF.js.map → index-7Bk-uLSM.js.map} +1 -1
  90. package/{index-C-tEgwbZ.js → index-BgY3QEzL.js} +2817 -1166
  91. package/index-BgY3QEzL.js.map +1 -0
  92. package/{index-SMJ67XwT.js → index-Dr5LK2tg.js} +2 -2
  93. package/{index-SMJ67XwT.js.map → index-Dr5LK2tg.js.map} +1 -1
  94. package/index.d.ts +572 -18
  95. package/index.js +499 -464
  96. package/{input-block-DbRYCnet.js → input-block-DjdlndCL.js} +2 -2
  97. package/{input-block-DbRYCnet.js.map → input-block-DjdlndCL.js.map} +1 -1
  98. package/{iridescence-fragment-S3Ko1jvC.js → iridescence-fragment-kfsCs8lN.js} +2 -2
  99. package/{iridescence-fragment-S3Ko1jvC.js.map → iridescence-fragment-kfsCs8lN.js.map} +1 -1
  100. package/{light-block-CAqWkucp.js → light-block-qjCrz3de.js} +2 -2
  101. package/{light-block-CAqWkucp.js.map → light-block-qjCrz3de.js.map} +1 -1
  102. package/{loop-block-ch-biPFY.js → loop-block-C8vkQ2bz.js} +2 -2
  103. package/{loop-block-ch-biPFY.js.map → loop-block-C8vkQ2bz.js.map} +1 -1
  104. package/{manifold-AS8POaOr.js → manifold-DeXMNgxT.js} +3 -3
  105. package/{manifold-AS8POaOr.js.map → manifold-DeXMNgxT.js.map} +1 -1
  106. package/{morph-fragment-D9he3Ksk.js → morph-fragment-NpZYyIIU.js} +2 -2
  107. package/{morph-fragment-D9he3Ksk.js.map → morph-fragment-NpZYyIIU.js.map} +1 -1
  108. package/{multilight-wgsl-74aXpcJG.js → multilight-wgsl-I5SncF0q.js} +2 -2
  109. package/{multilight-wgsl-74aXpcJG.js.map → multilight-wgsl-I5SncF0q.js.map} +1 -1
  110. package/{node-env-B2bjGcMS.js → node-env-D7Aee08u.js} +2 -2
  111. package/{node-env-B2bjGcMS.js.map → node-env-D7Aee08u.js.map} +1 -1
  112. package/{node-geometry-view-CSXlEAhG.js → node-geometry-view-DfKXWNfV.js} +3 -3
  113. package/{node-geometry-view-CSXlEAhG.js.map → node-geometry-view-DfKXWNfV.js.map} +1 -1
  114. package/{node-registry-extra-compat-BEQH_ksg.js → node-registry-extra-compat-CDLeBR1P.js} +2 -2
  115. package/{node-registry-extra-compat-BEQH_ksg.js.map → node-registry-extra-compat-CDLeBR1P.js.map} +1 -1
  116. package/{node-registry-extra-math-Bm32WBAa.js → node-registry-extra-math-BA8_l4lB.js} +2 -2
  117. package/{node-registry-extra-math-Bm32WBAa.js.map → node-registry-extra-math-BA8_l4lB.js.map} +1 -1
  118. package/{node-renderable-BMHny4tC.js → node-renderable-EwLLnaL1.js} +2 -2
  119. package/{node-renderable-BMHny4tC.js.map → node-renderable-EwLLnaL1.js.map} +1 -1
  120. package/{node-shadow-BRiz7CT1.js → node-shadow-CeTmT6g4.js} +2 -2
  121. package/{node-shadow-BRiz7CT1.js.map → node-shadow-CeTmT6g4.js.map} +1 -1
  122. package/{normal-map-fragment-sE3TjF4U.js → normal-map-fragment-BHImLyM-.js} +2 -2
  123. package/{normal-map-fragment-sE3TjF4U.js.map → normal-map-fragment-BHImLyM-.js.map} +1 -1
  124. package/package.json +10 -3
  125. package/{parse-camera-CmZBS423.js → parse-camera-5IGdctAS.js} +2 -2
  126. package/{parse-camera-CmZBS423.js.map → parse-camera-5IGdctAS.js.map} +1 -1
  127. package/{pbr-geometry-view-T3vMABM8.js → pbr-geometry-view-Dthf9Aut.js} +3 -3
  128. package/{pbr-geometry-view-T3vMABM8.js.map → pbr-geometry-view-Dthf9Aut.js.map} +1 -1
  129. package/{pbr-metallic-roughness-block-full-CHC8w-Uv.js → pbr-metallic-roughness-block-full-DD6zI_Lx.js} +2 -2
  130. package/{pbr-metallic-roughness-block-full-CHC8w-Uv.js.map → pbr-metallic-roughness-block-full-DD6zI_Lx.js.map} +1 -1
  131. package/{pbr-metallic-roughness-block-DbozMlHU.js → pbr-metallic-roughness-block-g7wjzwN_.js} +2 -2
  132. package/{pbr-metallic-roughness-block-DbozMlHU.js.map → pbr-metallic-roughness-block-g7wjzwN_.js.map} +1 -1
  133. package/{pbr-mr-helper-core-DGRgbRXl.js → pbr-mr-helper-core-CWROQ7OA.js} +2 -2
  134. package/{pbr-mr-helper-core-DGRgbRXl.js.map → pbr-mr-helper-core-CWROQ7OA.js.map} +1 -1
  135. package/{pbr-refraction-CquDP9JO.js → pbr-refraction-Dxsm_gii.js} +2 -2
  136. package/{pbr-refraction-CquDP9JO.js.map → pbr-refraction-Dxsm_gii.js.map} +1 -1
  137. package/{pbr-renderable-CaHKHU0g.js → pbr-renderable-CuKWalEM.js} +22 -22
  138. package/{pbr-renderable-CaHKHU0g.js.map → pbr-renderable-CuKWalEM.js.map} +1 -1
  139. package/{pbr-shadow-fragment-DmnNe6yz.js → pbr-shadow-fragment-waeIBQUq.js} +2 -2
  140. package/{pbr-shadow-fragment-DmnNe6yz.js.map → pbr-shadow-fragment-waeIBQUq.js.map} +1 -1
  141. package/{pbr-tracking-Bo7RTANK.js → pbr-tracking-CdeqbBrh.js} +2 -2
  142. package/{pbr-tracking-Bo7RTANK.js.map → pbr-tracking-CdeqbBrh.js.map} +1 -1
  143. package/{pbr-transmission-ext-CoGcJBGE.js → pbr-transmission-ext-BNiXngZc.js} +2 -2
  144. package/{pbr-transmission-ext-CoGcJBGE.js.map → pbr-transmission-ext-BNiXngZc.js.map} +1 -1
  145. package/{recast-navigation.wasm-DG_0AFuk.js → recast-navigation.wasm-VC4lGlEe.js} +3 -3
  146. package/{recast-navigation.wasm-DG_0AFuk.js.map → recast-navigation.wasm-VC4lGlEe.js.map} +1 -1
  147. package/{recast-navigation.wasm-compat-C-Bf2ylB.js → recast-navigation.wasm-compat-CTwYOzRz.js} +3 -3
  148. package/{recast-navigation.wasm-compat-C-Bf2ylB.js.map → recast-navigation.wasm-compat-CTwYOzRz.js.map} +1 -1
  149. package/{reflectance-fragment-CExe6qDY.js → reflectance-fragment-BQFZ_pgy.js} +2 -2
  150. package/{reflectance-fragment-CExe6qDY.js.map → reflectance-fragment-BQFZ_pgy.js.map} +1 -1
  151. package/{rgbd-decode-DkiiiIlt.js → rgbd-decode-duTlXMWd.js} +2 -2
  152. package/{rgbd-decode-DkiiiIlt.js.map → rgbd-decode-duTlXMWd.js.map} +1 -1
  153. package/{screenshot-readback-avr_tYGZ.js → screenshot-readback-DnxR4rhp.js} +2 -2
  154. package/{screenshot-readback-avr_tYGZ.js.map → screenshot-readback-DnxR4rhp.js.map} +1 -1
  155. package/{shader-composer-CZagsJDS.js → shader-composer-CBy2i8nU.js} +2 -2
  156. package/{shader-composer-CZagsJDS.js.map → shader-composer-CBy2i8nU.js.map} +1 -1
  157. package/{shader-renderable-D5sbgzxt.js → shader-renderable-DVMVD6zP.js} +4 -4
  158. package/{shader-renderable-D5sbgzxt.js.map → shader-renderable-DVMVD6zP.js.map} +1 -1
  159. package/{shader-thin-instance-CkQ8rrfH.js → shader-thin-instance-CsDo3ULk.js} +2 -2
  160. package/{shader-thin-instance-CkQ8rrfH.js.map → shader-thin-instance-CsDo3ULk.js.map} +1 -1
  161. package/{sheen-fragment-BEigjpTX.js → sheen-fragment-B_Jd7wrr.js} +2 -2
  162. package/{sheen-fragment-BEigjpTX.js.map → sheen-fragment-B_Jd7wrr.js.map} +1 -1
  163. package/{singlelight-directional-wgsl-Ccsk-ys3.js → singlelight-directional-wgsl-Bw84txva.js} +2 -2
  164. package/{singlelight-directional-wgsl-Ccsk-ys3.js.map → singlelight-directional-wgsl-Bw84txva.js.map} +1 -1
  165. package/{singlelight-hemispheric-wgsl-DL-jpc97.js → singlelight-hemispheric-wgsl-DjxhgI8r.js} +2 -2
  166. package/{singlelight-hemispheric-wgsl-DL-jpc97.js.map → singlelight-hemispheric-wgsl-DjxhgI8r.js.map} +1 -1
  167. package/{singlelight-point-wgsl-hYmiP6ys.js → singlelight-point-wgsl-iA1aRkXA.js} +2 -2
  168. package/{singlelight-point-wgsl-hYmiP6ys.js.map → singlelight-point-wgsl-iA1aRkXA.js.map} +1 -1
  169. package/{singlelight-spot-wgsl-DSjp1p1C.js → singlelight-spot-wgsl-MDdTdstF.js} +2 -2
  170. package/{singlelight-spot-wgsl-DSjp1p1C.js.map → singlelight-spot-wgsl-MDdTdstF.js.map} +1 -1
  171. package/{skeleton-fragment-B__bUbPK.js → skeleton-fragment-COdHWFcK.js} +2 -2
  172. package/{skeleton-fragment-B__bUbPK.js.map → skeleton-fragment-COdHWFcK.js.map} +1 -1
  173. package/{skybox-renderable-BH6uUkal.js → skybox-renderable-DJYkfw32.js} +2 -2
  174. package/{skybox-renderable-BH6uUkal.js.map → skybox-renderable-DJYkfw32.js.map} +1 -1
  175. package/{splat-ply-compressed-BGNK6dnh.js → splat-ply-compressed-SxMlsKNK.js} +2 -2
  176. package/{splat-ply-compressed-BGNK6dnh.js.map → splat-ply-compressed-SxMlsKNK.js.map} +1 -1
  177. package/{standard-pipeline-BvFynkwL.js → standard-pipeline-DXFOUqU_.js} +3 -3
  178. package/{standard-pipeline-BvFynkwL.js.map → standard-pipeline-DXFOUqU_.js.map} +1 -1
  179. package/{standard-renderable-1Q3zemys.js → standard-renderable-BAc-i-ig.js} +3 -3
  180. package/{standard-renderable-1Q3zemys.js.map → standard-renderable-BAc-i-ig.js.map} +1 -1
  181. package/{std-ambient-fragment-__F1KTEu.js → std-ambient-fragment-P8dHZ4An.js} +2 -2
  182. package/{std-ambient-fragment-__F1KTEu.js.map → std-ambient-fragment-P8dHZ4An.js.map} +1 -1
  183. package/{std-cube-reflection-fragment-DidM0byH.js → std-cube-reflection-fragment-CF03MuQt.js} +2 -2
  184. package/{std-cube-reflection-fragment-DidM0byH.js.map → std-cube-reflection-fragment-CF03MuQt.js.map} +1 -1
  185. package/{std-emissive-fragment-Bj62X4Np.js → std-emissive-fragment-P8yJGclx.js} +2 -2
  186. package/{std-emissive-fragment-Bj62X4Np.js.map → std-emissive-fragment-P8yJGclx.js.map} +1 -1
  187. package/{std-lightmap-fragment-DXvfWvKc.js → std-lightmap-fragment-CymEG79z.js} +9 -6
  188. package/std-lightmap-fragment-CymEG79z.js.map +1 -0
  189. package/{std-opacity-fragment-BzMMb1K_.js → std-opacity-fragment-DLa1zV06.js} +2 -2
  190. package/{std-opacity-fragment-BzMMb1K_.js.map → std-opacity-fragment-DLa1zV06.js.map} +1 -1
  191. package/{std-reflection-fragment-DC9Kvu1C.js → std-reflection-fragment-BLySsYos.js} +2 -2
  192. package/{std-reflection-fragment-DC9Kvu1C.js.map → std-reflection-fragment-BLySsYos.js.map} +1 -1
  193. package/{std-shadow-fragment-BnMHeF1-.js → std-shadow-fragment-C_q27Mdi.js} +2 -2
  194. package/{std-shadow-fragment-BnMHeF1-.js.map → std-shadow-fragment-C_q27Mdi.js.map} +1 -1
  195. package/{std-specular-fragment-Bio681OG.js → std-specular-fragment-CaBXyAWY.js} +2 -2
  196. package/{std-specular-fragment-Bio681OG.js.map → std-specular-fragment-CaBXyAWY.js.map} +1 -1
  197. package/{std-tracking-BTcrry2o.js → std-tracking-Bw61Dv98.js} +2 -2
  198. package/{std-tracking-BTcrry2o.js.map → std-tracking-Bw61Dv98.js.map} +1 -1
  199. package/{subsurface-fragment-DpKib445.js → subsurface-fragment-BNQoG9gr.js} +2 -2
  200. package/{subsurface-fragment-DpKib445.js.map → subsurface-fragment-BNQoG9gr.js.map} +1 -1
  201. package/{thin-instance-cull-binding-DwZi7mlE.js → thin-instance-cull-binding-BNC5JiGw.js} +3 -3
  202. package/{thin-instance-cull-binding-DwZi7mlE.js.map → thin-instance-cull-binding-BNC5JiGw.js.map} +1 -1
  203. package/{thin-instance-gpu-uY2NOv0J.js → thin-instance-gpu-C1DGstap.js} +2 -2
  204. package/{thin-instance-gpu-uY2NOv0J.js.map → thin-instance-gpu-C1DGstap.js.map} +1 -1
  205. package/{tracking-primitives-Ck5bgCuo.js → tracking-primitives-CMBWLxGr.js} +2 -2
  206. package/{tracking-primitives-Ck5bgCuo.js.map → tracking-primitives-CMBWLxGr.js.map} +1 -1
  207. package/{unlit-fragment-nc6hu3Mw.js → unlit-fragment-BsHrS9XX.js} +2 -2
  208. package/{unlit-fragment-nc6hu3Mw.js.map → unlit-fragment-BsHrS9XX.js.map} +1 -1
  209. package/gltf-interleave-DWf27t-h.js.map +0 -1
  210. package/gltf-normals-b2h74380.js.map +0 -1
  211. package/index-C-tEgwbZ.js.map +0 -1
  212. package/std-lightmap-fragment-DXvfWvKc.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { bc as setSubtreeVisible, a as F32, e as U8, j as U16, bU as I8, bV as I16, bW as PATH_POINTER } from "./index-C-tEgwbZ.js";
2
- import { _installPointerHandlers } from "./gltf-animation-Bq7k_5HA.js";
1
+ import { be as setSubtreeVisible, a as F32, e as U8, j as U16, bW as I8, bX as I16, bY as PATH_POINTER } from "./index-BgY3QEzL.js";
2
+ import { _installPointerHandlers } from "./gltf-animation-BjnXkop6.js";
3
3
  const _registry = [
4
4
  // /nodes/{n}/extensions/KHR_node_visibility/visible — scalar (0 = hidden).
5
5
  // The setter cascade handles descendants per the KHR_node_visibility spec
@@ -85,4 +85,4 @@ const feature = { id: "KHR_animation_pointer" };
85
85
  export {
86
86
  feature as default
87
87
  };
88
- //# sourceMappingURL=gltf-feature-animation-pointer-DVhymFLK.js.map
88
+ //# sourceMappingURL=gltf-feature-animation-pointer-C40tqOhL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-animation-pointer-DVhymFLK.js","sources":["../src/loader-gltf/animation-pointer.ts","../src/loader-gltf/gltf-feature-animation-pointer.ts"],"sourcesContent":["/** KHR_animation_pointer — JSON-pointer resolver registry.\n * Handlers are registered incrementally (one per parity scene). Unknown\n * pointers return null and warn once. */\nimport type { SceneNode } from \"../scene/scene-node.js\";\nimport { setSubtreeVisible } from \"../scene/visibility.js\";\n\nexport interface ResolvedPointer {\n writer: (output: Float32Array, offset: number) => void;\n arity: number;\n}\n\nexport interface PointerContext {\n nodes: readonly (SceneNode | undefined)[];\n}\n\ntype PointerFactory = (match: RegExpExecArray, ctx: PointerContext) => ResolvedPointer | null;\n\nconst _registry: [RegExp, PointerFactory][] = [\n // /nodes/{n}/extensions/KHR_node_visibility/visible — scalar (0 = hidden).\n // The setter cascade handles descendants per the KHR_node_visibility spec\n // and bumps the module-scoped visibility epoch so the engine invalidates\n // its cached render bundle.\n [\n /^\\/nodes\\/(\\d+)\\/extensions\\/KHR_node_visibility\\/visible$/,\n (m, ctx) => {\n const n = ctx.nodes[+m[1]!];\n if (!n) {\n return null;\n }\n return {\n arity: 1,\n writer: (out, off) => {\n setSubtreeVisible(n, out[off]! !== 0);\n },\n };\n },\n ],\n];\n\nconst _warned = new Set<string>();\n\nexport function resolveAnimationPointer(pointer: string, ctx: PointerContext): ResolvedPointer | null {\n for (const [rx, make] of _registry) {\n const m = rx.exec(pointer);\n if (m) {\n return make(m, ctx);\n }\n }\n if (!_warned.has(pointer)) {\n _warned.add(pointer);\n\n console.warn(`[babylon-lite] KHR_animation_pointer: no handler for \"${pointer}\"`);\n }\n return null;\n}\n","/** KHR_animation_pointer glTF feature.\n *\n * Registered in load-gltf.ts's feature table gated on\n * `extensionsUsed.includes(\"KHR_animation_pointer\")`, so any scene that\n * doesn't declare the extension pays zero bytes for pointer resolution, the\n * non-Float32 sampler converter, or the visibility cascade helper.\n *\n * On side-effect import this module installs two callbacks into gltf-animation:\n * 1. A pointer-channel parser (resolves the JSON pointer to a writer fn).\n * 2. A sampler converter that handles the non-Float32/misaligned accessor\n * cases the fast path in gltf-animation can't express (e.g. the 11-byte\n * UNSIGNED_BYTE visibility accessor in CubeVisibility.glb). */\n\nimport { F32, U16, I16, U8, I8 } from \"../engine/typed-arrays.js\";\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport type { AnimationChannel } from \"../animation/types.js\";\nimport { PATH_POINTER } from \"../animation/types.js\";\nimport { resolveAnimationPointer } from \"./animation-pointer.js\";\nimport { _installPointerHandlers } from \"./gltf-animation.js\";\n\n_installPointerHandlers(\n (ptr, c, nodeMap) => {\n if (!nodeMap) {\n return null;\n }\n const resolved = resolveAnimationPointer(ptr, { nodes: nodeMap });\n if (!resolved) {\n return null;\n }\n const ch: AnimationChannel = {\n samplerIdx: c.sampler,\n nodeIdx: -1,\n path: PATH_POINTER,\n pointerWriter: resolved.writer,\n pointerArity: resolved.arity,\n };\n return ch;\n },\n (src, length, normalized) => {\n // Convert any animation-sampler payload to a standalone Float32Array.\n // Handles the cases the aligned-Float32 fast path can't express.\n const out = new F32(length);\n if (src instanceof F32) {\n for (let i = 0; i < length; i++) {\n out[i] = src[i]!;\n }\n } else if (src instanceof U8) {\n const k = normalized ? 1 / 255 : 1;\n for (let i = 0; i < length; i++) {\n out[i] = src[i]! * k;\n }\n } else if (src instanceof U16) {\n const k = normalized ? 1 / 65535 : 1;\n for (let i = 0; i < length; i++) {\n out[i] = src[i]! * k;\n }\n } else if (src instanceof I8) {\n for (let i = 0; i < length; i++) {\n out[i] = normalized ? Math.max(src[i]! / 127, -1) : src[i]!;\n }\n } else if (src instanceof I16) {\n for (let i = 0; i < length; i++) {\n out[i] = normalized ? Math.max(src[i]! / 32767, -1) : src[i]!;\n }\n }\n return out;\n }\n);\n\n// No per-asset hook — this feature only installs the seam at import time.\nconst feature: GltfFeature = { id: \"KHR_animation_pointer\" };\nexport default feature;\n"],"names":[],"mappings":";;AAiBA,MAAM,YAAwC;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1C;AAAA,IACI;AAAA,IACA,CAAC,GAAG,QAAQ;AACR,YAAM,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC,CAAE;AAC1B,UAAI,CAAC,GAAG;AACJ,eAAO;AAAA,MACX;AACA,aAAO;AAAA,QACH,OAAO;AAAA,QACP,QAAQ,CAAC,KAAK,QAAQ;AAClB,4BAAkB,GAAG,IAAI,GAAG,MAAO,CAAC;AAAA,QACxC;AAAA,MAAA;AAAA,IAER;AAAA,EAAA;AAER;AAEA,MAAM,8BAAc,IAAA;AAEb,SAAS,wBAAwB,SAAiB,KAA6C;AAClG,aAAW,CAAC,IAAI,IAAI,KAAK,WAAW;AAChC,UAAM,IAAI,GAAG,KAAK,OAAO;AACzB,QAAI,GAAG;AACH,aAAO,KAAK,GAAG,GAAG;AAAA,IACtB;AAAA,EACJ;AACA,MAAI,CAAC,QAAQ,IAAI,OAAO,GAAG;AACvB,YAAQ,IAAI,OAAO;AAEnB,YAAQ,KAAK,yDAAyD,OAAO,GAAG;AAAA,EACpF;AACA,SAAO;AACX;AClCA;AAAA,EACI,CAAC,KAAK,GAAG,YAAY;AACjB,QAAI,CAAC,SAAS;AACV,aAAO;AAAA,IACX;AACA,UAAM,WAAW,wBAAwB,KAAK,EAAE,OAAO,SAAS;AAChE,QAA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ts","../src/loader-gltf/gltf-feature-animation-pointer.ts"],"sourcesContent":["/** KHR_animation_pointer — JSON-pointer resolver registry.\n * Handlers are registered incrementally (one per parity scene). Unknown\n * pointers return null and warn once. */\nimport type { SceneNode } from \"../scene/scene-node.js\";\nimport { setSubtreeVisible } from \"../scene/visibility.js\";\n\nexport interface ResolvedPointer {\n writer: (output: Float32Array, offset: number) => void;\n arity: number;\n}\n\nexport interface PointerContext {\n nodes: readonly (SceneNode | undefined)[];\n}\n\ntype PointerFactory = (match: RegExpExecArray, ctx: PointerContext) => ResolvedPointer | null;\n\nconst _registry: [RegExp, PointerFactory][] = [\n // /nodes/{n}/extensions/KHR_node_visibility/visible — scalar (0 = hidden).\n // The setter cascade handles descendants per the KHR_node_visibility spec\n // and bumps the module-scoped visibility epoch so the engine invalidates\n // its cached render bundle.\n [\n /^\\/nodes\\/(\\d+)\\/extensions\\/KHR_node_visibility\\/visible$/,\n (m, ctx) => {\n const n = ctx.nodes[+m[1]!];\n if (!n) {\n return null;\n }\n return {\n arity: 1,\n writer: (out, off) => {\n setSubtreeVisible(n, out[off]! !== 0);\n },\n };\n },\n ],\n];\n\nconst _warned = new Set<string>();\n\nexport function resolveAnimationPointer(pointer: string, ctx: PointerContext): ResolvedPointer | null {\n for (const [rx, make] of _registry) {\n const m = rx.exec(pointer);\n if (m) {\n return make(m, ctx);\n }\n }\n if (!_warned.has(pointer)) {\n _warned.add(pointer);\n\n console.warn(`[babylon-lite] KHR_animation_pointer: no handler for \"${pointer}\"`);\n }\n return null;\n}\n","/** KHR_animation_pointer glTF feature.\n *\n * Registered in load-gltf.ts's feature table gated on\n * `extensionsUsed.includes(\"KHR_animation_pointer\")`, so any scene that\n * doesn't declare the extension pays zero bytes for pointer resolution, the\n * non-Float32 sampler converter, or the visibility cascade helper.\n *\n * On side-effect import this module installs two callbacks into gltf-animation:\n * 1. A pointer-channel parser (resolves the JSON pointer to a writer fn).\n * 2. A sampler converter that handles the non-Float32/misaligned accessor\n * cases the fast path in gltf-animation can't express (e.g. the 11-byte\n * UNSIGNED_BYTE visibility accessor in CubeVisibility.glb). */\n\nimport { F32, U16, I16, U8, I8 } from \"../engine/typed-arrays.js\";\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport type { AnimationChannel } from \"../animation/types.js\";\nimport { PATH_POINTER } from \"../animation/types.js\";\nimport { resolveAnimationPointer } from \"./animation-pointer.js\";\nimport { _installPointerHandlers } from \"./gltf-animation.js\";\n\n_installPointerHandlers(\n (ptr, c, nodeMap) => {\n if (!nodeMap) {\n return null;\n }\n const resolved = resolveAnimationPointer(ptr, { nodes: nodeMap });\n if (!resolved) {\n return null;\n }\n const ch: AnimationChannel = {\n samplerIdx: c.sampler,\n nodeIdx: -1,\n path: PATH_POINTER,\n pointerWriter: resolved.writer,\n pointerArity: resolved.arity,\n };\n return ch;\n },\n (src, length, normalized) => {\n // Convert any animation-sampler payload to a standalone Float32Array.\n // Handles the cases the aligned-Float32 fast path can't express.\n const out = new F32(length);\n if (src instanceof F32) {\n for (let i = 0; i < length; i++) {\n out[i] = src[i]!;\n }\n } else if (src instanceof U8) {\n const k = normalized ? 1 / 255 : 1;\n for (let i = 0; i < length; i++) {\n out[i] = src[i]! * k;\n }\n } else if (src instanceof U16) {\n const k = normalized ? 1 / 65535 : 1;\n for (let i = 0; i < length; i++) {\n out[i] = src[i]! * k;\n }\n } else if (src instanceof I8) {\n for (let i = 0; i < length; i++) {\n out[i] = normalized ? Math.max(src[i]! / 127, -1) : src[i]!;\n }\n } else if (src instanceof I16) {\n for (let i = 0; i < length; i++) {\n out[i] = normalized ? Math.max(src[i]! / 32767, -1) : src[i]!;\n }\n }\n return out;\n }\n);\n\n// No per-asset hook — this feature only installs the seam at import time.\nconst feature: GltfFeature = { id: \"KHR_animation_pointer\" };\nexport default feature;\n"],"names":[],"mappings":";;AAiBA,MAAM,YAAwC;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1C;AAAA,IACI;AAAA,IACA,CAAC,GAAG,QAAQ;A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AI,QAAQ,KAAK;AAC7B,YAAI,CAAC,IAAI,IAAI,CAAC,IAAK;AAAA,MACvB;AAAA,IACJ,WAAW,eAAe,KAAK;AAC3B,YAAM,IAAI,aAAa,IAAI,QAAQ;AACnC,eAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC7B,YAAI,CAAC,IAAI,IAAI,CAAC,IAAK;AAAA,MACvB;AAAA,IACJ,WAAW,eAAe,IAAI;AAC1B,eAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC7B,YAAI,CAAC,IAAI,aAAa,KAAK,IAAI,IAAI,CAAC,IAAK,KAAK,EAAE,IAAI,IAAI,CAAC;AAAA,MAC7D;AAAA,IACJ,WAAW,eAAe,KAAK;AAC3B,eAAS,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC7B,YAAI,CAAC,IAAI,aAAa,KAAK,IAAI,IAAI,CAAC,IAAK,OAAO,EAAE,IAAI,IAAI,CAAC;AAAA,MAC/D;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AACJ;AAGA,MAAM,UAAuB,EAAE,IAAI,wBAAA;"}
@@ -1,7 +1,7 @@
1
1
  const feature = {
2
2
  id: "_animations",
3
3
  async applyAsset(meshes, _root, ctx) {
4
- const [{ parseAnimationData }, { createAnimationGroups }] = await Promise.all([import("./gltf-animation-Bq7k_5HA.js"), import("./index-C-tEgwbZ.js").then((n) => n.jA)]);
4
+ const [{ parseAnimationData }, { createAnimationGroups }] = await Promise.all([import("./gltf-animation-BjnXkop6.js"), import("./index-BgY3QEzL.js").then((n) => n.k7)]);
5
5
  const animData = parseAnimationData(ctx._json, ctx._binChunk, meshes, ctx._parentMap, ctx._worldMatrixCache, ctx._nodeMap);
6
6
  if (!animData) {
7
7
  return {};
@@ -12,4 +12,4 @@ const feature = {
12
12
  export {
13
13
  feature as default
14
14
  };
15
- //# sourceMappingURL=gltf-feature-animations-hxC3y3bJ.js.map
15
+ //# sourceMappingURL=gltf-feature-animations-v0S_yb4T.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-animations-hxC3y3bJ.js","sources":["../src/loader-gltf/gltf-feature-animations.ts"],"sourcesContent":["/** glTF animation feature.\n * Triggered when the asset has any animations. Per-asset hook parses clips,\n * binds them to the uploaded meshes, and returns AnimationGroups. */\n\nimport type { GltfFeature } from \"./gltf-feature.js\";\n\nconst feature: GltfFeature = {\n id: \"_animations\",\n async applyAsset(meshes, _root, ctx) {\n const [{ parseAnimationData }, { createAnimationGroups }] = await Promise.all([import(\"./gltf-animation.js\"), import(\"../animation/animation-group.js\")]);\n const animData = parseAnimationData(ctx._json, ctx._binChunk, meshes, ctx._parentMap, ctx._worldMatrixCache, ctx._nodeMap);\n if (!animData) {\n return {};\n }\n return { animationGroups: createAnimationGroups(animData) };\n },\n};\nexport default feature;\n"],"names":[],"mappings":"AAMA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,WAAW,QAAQ,OAAO,KAAK;AACjC,UAAM,CAAC,EAAE,mBAAA,GAAsB,EAAE,sBAAA,CAAuB,IAAI,MAAM,QAAQ,IAAI,CAAC,OAAO,8BAAqB,GAAG,OAAO,qBAAiC,EAAA,KAAA,OAAA,EAAA,EAAA,CAAC,CAAC;AACxJ,UAAM,WAAW,mBAAmB,IAAI,OAAO,IAAI,WAAW,QAAQ,IAAI,YAAY,IAAI,mBAAmB,IAAI,QAAQ;AACzH,QAAI,CAAC,UAAU;AACX,aAAO,CAAA;AAAA,IACX;AACA,WAAO,EAAE,iBAAiB,sBAAsB,QAAQ,EAAA;AAAA,EAC5D;AACJ;"}
1
+ {"version":3,"file":"gltf-feature-animations-v0S_yb4T.js","sources":["../src/loader-gltf/gltf-feature-animations.ts"],"sourcesContent":["/** glTF animation feature.\n * Triggered when the asset has any animations. Per-asset hook parses clips,\n * binds them to the uploaded meshes, and returns AnimationGroups. */\n\nimport type { GltfFeature } from \"./gltf-feature.js\";\n\nconst feature: GltfFeature = {\n id: \"_animations\",\n async applyAsset(meshes, _root, ctx) {\n const [{ parseAnimationData }, { createAnimationGroups }] = await Promise.all([import(\"./gltf-animation.js\"), import(\"../animation/animation-group.js\")]);\n const animData = parseAnimationData(ctx._json, ctx._binChunk, meshes, ctx._parentMap, ctx._worldMatrixCache, ctx._nodeMap);\n if (!animData) {\n return {};\n }\n return { animationGroups: createAnimationGroups(animData) };\n },\n};\nexport default feature;\n"],"names":[],"mappings":"AAMA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,WAAW,QAAQ,OAAO,KAAK;AACjC,UAAM,CAAC,EAAE,mBAAA,GAAsB,EAAE,sBAAA,CAAuB,IAAI,MAAM,QAAQ,IAAI,CAAC,OAAO,8BAAqB,GAAG,OAAO,qBAAiC,EAAA,KAAA,OAAA,EAAA,EAAA,CAAC,CAAC;AACxJ,UAAM,WAAW,mBAAmB,IAAI,OAAO,IAAI,WAAW,QAAQ,IAAI,YAAY,IAAI,mBAAmB,IAAI,QAAQ;AACzH,QAAI,CAAC,UAAU;AACX,aAAO,CAAA;AAAA,IACX;AACA,WAAO,EAAE,iBAAiB,sBAAsB,QAAQ,EAAA;AAAA,EAC5D;AACJ;"}
@@ -1,4 +1,4 @@
1
- import { e as U8, U as U32, bT as I32, a as F32 } from "./index-C-tEgwbZ.js";
1
+ import { e as U8, U as U32, bV as I32, a as F32 } from "./index-BgY3QEzL.js";
2
2
  let dracoBaseUrl = "/";
3
3
  let modulePromise = null;
4
4
  let scriptLoadPromise = null;
@@ -122,4 +122,4 @@ const feature = {
122
122
  export {
123
123
  feature as default
124
124
  };
125
- //# sourceMappingURL=gltf-feature-draco-B7Q_cMUv.js.map
125
+ //# sourceMappingURL=gltf-feature-draco-CljWrsna.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-draco-B7Q_cMUv.js","sources":["../src/loader-gltf/draco-decode.ts","../src/loader-gltf/gltf-feature-draco.ts"],"sourcesContent":["/**\n * Lazy KHR_draco_mesh_compression decoder.\n *\n * The Draco decoder (JS glue + WASM) is loaded from `/draco_decoder.js` and\n * `/draco_decoder.wasm` on first use via a `<script>` injection. This keeps\n * bundle size at zero bytes for scenes that do not load Draco-compressed\n * glTF assets — the entire module (including this file) is dynamically\n * imported from extractAllMeshes only when a primitive carries\n * `KHR_draco_mesh_compression`.\n *\n * The decoder output is always 32-bit: Float32 for FLOAT accessors,\n * Uint32Array for indices. Vertex attributes match glTF accessor types\n * (POSITION/NORMAL/TANGENT=VEC3, TEXCOORD_0=VEC2, ...).\n */\n\nimport { F32, U32, I32, U8 } from \"../engine/typed-arrays.js\";\nimport type { DecodedPrimitive } from \"./gltf-feature.js\";\n\n// Public base URL where the decoder JS + WASM are hosted. Defaults to site root.\nlet dracoBaseUrl = \"/\";\n\n/** Override the base URL where draco_decoder.js and draco_decoder.wasm are hosted. */\nexport function setDracoBaseUrl(url: string): void {\n dracoBaseUrl = url.endsWith(\"/\") ? url : url + \"/\";\n}\n\ninterface DracoModule {\n Decoder: new () => {\n DecodeBufferToMesh(buffer: unknown, mesh: unknown): { ok(): boolean; error_msg(): string };\n GetTrianglesUInt32Array(mesh: unknown, byteLength: number, outPtr: number): void;\n GetAttributeByUniqueId(mesh: unknown, uniqueId: number): unknown;\n GetAttributeDataArrayForAllPoints(mesh: unknown, attr: unknown, dataType: number, byteLength: number, outPtr: number): boolean;\n };\n DecoderBuffer: new () => { Init(data: Uint8Array, size: number): void };\n Mesh: new () => { num_faces(): number; num_points(): number };\n destroy(obj: unknown): void;\n HEAPF32: Float32Array;\n HEAPU32: Uint32Array;\n HEAP32: Int32Array;\n DT_FLOAT32: number;\n DT_INT32: number;\n _malloc(size: number): number;\n _free(ptr: number): void;\n}\n\ntype DracoFactory = (cfg: { locateFile?: (file: string) => string }) => Promise<DracoModule>;\n\nlet modulePromise: Promise<DracoModule> | null = null;\nlet scriptLoadPromise: Promise<DracoFactory> | null = null;\n\nfunction loadDracoScript(): Promise<DracoFactory> {\n if (scriptLoadPromise) {\n return scriptLoadPromise;\n }\n scriptLoadPromise = new Promise<DracoFactory>((resolve, reject) => {\n const existing = (globalThis as { DracoDecoderModule?: DracoFactory }).DracoDecoderModule;\n if (existing) {\n resolve(existing);\n return;\n }\n const script = document.createElement(\"script\");\n script.src = dracoBaseUrl + \"draco_decoder.js\";\n script.onload = () => {\n const factory = (globalThis as { DracoDecoderModule?: DracoFactory }).DracoDecoderModule;\n if (!factory) {\n reject(new Error(\"draco_decoder.js loaded but DracoDecoderModule is undefined\"));\n } else {\n resolve(factory);\n }\n };\n script.onerror = () => reject(new Error(\"Failed to load draco_decoder.js from \" + script.src));\n document.head.appendChild(script);\n });\n return scriptLoadPromise;\n}\n\nasync function getDracoModule(): Promise<DracoModule> {\n if (modulePromise) {\n return modulePromise;\n }\n modulePromise = (async () => {\n const factory = await loadDracoScript();\n return factory({ locateFile: (f: string) => dracoBaseUrl + f });\n })();\n return modulePromise;\n}\n\n/**\n * Decode a KHR_draco_mesh_compression primitive.\n * @param compressed - The raw bytes of the bufferView referenced by the extension.\n * @param attributeMap - Map of glTF attribute name (POSITION, NORMAL, ...) to Draco unique id.\n * @param accessorTypes - Map of glTF attribute name to component count (3 for VEC3, 2 for VEC2, 4 for VEC4).\n */\nexport async function decodeDracoPrimitive(compressed: Uint8Array, attributeMap: Record<string, number>, accessorTypes: Record<string, number>): Promise<DecodedPrimitive> {\n const module = await getDracoModule();\n const decoder = new module.Decoder();\n const buffer = new module.DecoderBuffer();\n buffer.Init(compressed, compressed.byteLength);\n const mesh = new module.Mesh();\n const status = decoder.DecodeBufferToMesh(buffer, mesh);\n if (!status.ok()) {\n const err = status.error_msg();\n module.destroy(buffer);\n module.destroy(mesh);\n module.destroy(decoder);\n throw new Error(\"Draco decode failed: \" + err);\n }\n\n const numPoints = mesh.num_points();\n const numFaces = mesh.num_faces();\n const indexCount = numFaces * 3;\n\n // Indices: Draco returns Uint32 triangles. Always slice() off the heap\n // view because module._malloc may grow the WASM memory and invalidate\n // the typed-array views we already hold.\n const indexByteLength = indexCount * 4;\n const indexPtr = module._malloc(indexByteLength);\n decoder.GetTrianglesUInt32Array(mesh, indexByteLength, indexPtr);\n const indices = new U32(module.HEAPU32.buffer, indexPtr, indexCount).slice();\n module._free(indexPtr);\n\n const attributes = new Map<string, Float32Array | Uint32Array | Int32Array>();\n for (const name of Object.keys(attributeMap)) {\n const uniqueId = attributeMap[name]!;\n const attr = decoder.GetAttributeByUniqueId(mesh, uniqueId);\n const componentCount = accessorTypes[name] ?? 3;\n const totalComponents = numPoints * componentCount;\n const isIntAttr = name === \"JOINTS_0\" || name === \"JOINTS_1\";\n const bytesPerElement = 4;\n const byteLength = totalComponents * bytesPerElement;\n const ptr = module._malloc(byteLength);\n const dataType = isIntAttr ? module.DT_INT32 : module.DT_FLOAT32;\n decoder.GetAttributeDataArrayForAllPoints(mesh, attr, dataType, byteLength, ptr);\n // Re-read the HEAP view AFTER malloc/decode — the underlying buffer\n // may have been reallocated during decoding.\n if (isIntAttr) {\n attributes.set(name, new I32(module.HEAP32.buffer, ptr, totalComponents).slice());\n } else {\n attributes.set(name, new F32(module.HEAPF32.buffer, ptr, totalComponents).slice());\n }\n module._free(ptr);\n }\n\n module.destroy(buffer);\n module.destroy(mesh);\n module.destroy(decoder);\n\n return { _attributes: attributes, _indices: indices, _vertexCount: numPoints, _indexCount: indexCount };\n}\n\n/**\n * Read the bufferView slice referenced by the Draco extension into a Uint8Array.\n */\nexport function getDracoBufferViewBytes(json: { bufferViews: Array<{ byteOffset?: number; byteLength: number }> }, binChunk: DataView, bufferViewIdx: number): Uint8Array {\n const view = json.bufferViews[bufferViewIdx];\n if (!view) {\n throw new Error(`Draco bufferView ${bufferViewIdx} not found`);\n }\n const offset = binChunk.byteOffset + (view.byteOffset ?? 0);\n return new U8(binChunk.buffer, offset, view.byteLength);\n}\n","/**\n * KHR_draco_mesh_compression feature.\n *\n * Runs as a `preMesh` hook — before mesh extraction — so the core loader\n * stays unaware of Draco. This module is only dynamic-imported when the\n * asset's `extensionsUsed` lists KHR_draco_mesh_compression, which in turn\n * dynamic-imports the actual Emscripten-based decoder (`draco-decode.ts`).\n */\n\nimport type { DecodedPrimitive, GltfFeature } from \"./gltf-feature.js\";\nimport { decodeDracoPrimitive, getDracoBufferViewBytes } from \"./draco-decode.js\";\n\nconst TYPE_COMPONENT_COUNTS: Record<string, number> = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 };\n\nconst feature: GltfFeature = {\n id: \"KHR_draco_mesh_compression\",\n async preMesh(jsonIn, binChunk) {\n const json = jsonIn as {\n meshes?: Array<{\n primitives?: Array<{ attributes?: Record<string, number>; extensions?: Record<string, { bufferView: number; attributes: Record<string, number> }> }>;\n }>;\n accessors?: Array<{ type: string }>;\n };\n const out = new Map<unknown, DecodedPrimitive>();\n for (const mesh of json.meshes ?? []) {\n for (const primitive of mesh.primitives ?? []) {\n const ext = primitive.extensions?.KHR_draco_mesh_compression;\n if (!ext) {\n continue;\n }\n const bytes = getDracoBufferViewBytes(json as { bufferViews: Array<{ byteOffset?: number; byteLength: number }> }, binChunk, ext.bufferView);\n const accessorTypes: Record<string, number> = {};\n for (const name of Object.keys(ext.attributes)) {\n const accIdx = primitive.attributes?.[name];\n if (accIdx !== undefined && json.accessors?.[accIdx]) {\n accessorTypes[name] = TYPE_COMPONENT_COUNTS[json.accessors[accIdx].type] ?? 3;\n }\n }\n const decoded = await decodeDracoPrimitive(bytes, ext.attributes, accessorTypes);\n out.set(primitive, decoded);\n }\n }\n return out;\n },\n};\n\nexport default feature;\n"],"names":[],"mappings":";AAmBA,IAAI,eAAe;AA4BnB,IAAI,gBAA6C;AACjD,IAAI,oBAAkD;AAEtD,SAAS,kBAAyC;AAC9C,MAAI,mBAAmB;AACnB,WAAO;AAAA,EACX;AACA,sBAAoB,IAAI,QAAsB,CAAC,SAAS,WAAW;AAC/D,UAAM,WAAY,WAAqD;AACvE,QAAI,UAAU;AACV,cAAQ,QAAQ;AAChB;AAAA,IACJ;AACA,UAAM,SA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G,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAA;AAEtH,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,QAAQ,QAAQ,UAAU;;AAC5B,UAAM,OAAO;AAMb,UAAM,0BAAU,IAAA;AAChB,eAAW,QAAQ,KAAK,UAAU,CAAA,GAAI;AAClC,iBAAW,aAAa,KAAK,cAAc,CAAA,GAAI;AAC3C,cAAM,OAAM,eAAU,eAAV,mBAAsB;AAClC,YAAI,CAAC,KAAK;AACN;AAAA,QACJ;AACA,cAAM,QAAQ,wBAAwB,MAA6E,UAAU,IAAI,UAAU;AAC3I,cAAM,gBAAwC,CAAA;AAC9C,mBAAW,QAAQ,OAAO,KAAK,IAAI,UAAU,GAAG;AAC5C,gBAAM,UAAS,eAAU,eAAV,mBAAuB;AACtC,cAAI,WAAW,YAAa,UAAK,cAAL,mBAAiB,UAAS;AAClD,0BAAc,IAAI,IAAI,sBAAsB,KAAK,UAAU,MAAM,EAAE,IAAI,KAAK;AAAA,UAChF;AAAA,QACJ;AACA,cAAM,UAAU,MAAM,qBAAqB,OAAO,IAAI,YAAY,aAAa;AAC/E,YAAI,IAAI,WAAW,OAAO;AAAA,MAC9B;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AACJ;"}
1
+ {"version":3,"file":"gltf-feature-draco-CljWrsna.js","sources":["../src/loader-gltf/draco-decode.ts","../src/loader-gltf/gltf-feature-draco.ts"],"sourcesContent":["/**\n * Lazy KHR_draco_mesh_compression decoder.\n *\n * The Draco decoder (JS glue + WASM) is loaded from `/draco_decoder.js` and\n * `/draco_decoder.wasm` on first use via a `<script>` injection. This keeps\n * bundle size at zero bytes for scenes that do not load Draco-compressed\n * glTF assets — the entire module (including this file) is dynamically\n * imported from extractAllMeshes only when a primitive carries\n * `KHR_draco_mesh_compression`.\n *\n * The decoder output is always 32-bit: Float32 for FLOAT accessors,\n * Uint32Array for indices. Vertex attributes match glTF accessor types\n * (POSITION/NORMAL/TANGENT=VEC3, TEXCOORD_0=VEC2, ...).\n */\n\nimport { F32, U32, I32, U8 } from \"../engine/typed-arrays.js\";\nimport type { DecodedPrimitive } from \"./gltf-feature.js\";\n\n// Public base URL where the decoder JS + WASM are hosted. Defaults to site root.\nlet dracoBaseUrl = \"/\";\n\n/** Override the base URL where draco_decoder.js and draco_decoder.wasm are hosted. */\nexport function setDracoBaseUrl(url: string): void {\n dracoBaseUrl = url.endsWith(\"/\") ? url : url + \"/\";\n}\n\ninterface DracoModule {\n Decoder: new () => {\n DecodeBufferToMesh(buffer: unknown, mesh: unknown): { ok(): boolean; error_msg(): string };\n GetTrianglesUInt32Array(mesh: unknown, byteLength: number, outPtr: number): void;\n GetAttributeByUniqueId(mesh: unknown, uniqueId: number): unknown;\n GetAttributeDataArrayForAllPoints(mesh: unknown, attr: unknown, dataType: number, byteLength: number, outPtr: number): boolean;\n };\n DecoderBuffer: new () => { Init(data: Uint8Array, size: number): void };\n Mesh: new () => { num_faces(): number; num_points(): number };\n destroy(obj: unknown): void;\n HEAPF32: Float32Array;\n HEAPU32: Uint32Array;\n HEAP32: Int32Array;\n DT_FLOAT32: number;\n DT_INT32: number;\n _malloc(size: number): number;\n _free(ptr: number): void;\n}\n\ntype DracoFactory = (cfg: { locateFile?: (file: string) => string }) => Promise<DracoModule>;\n\nlet modulePromise: Promise<DracoModule> | null = null;\nlet scriptLoadPromise: Promise<DracoFactory> | null = null;\n\nfunction loadDracoScript(): Promise<DracoFactory> {\n if (scriptLoadPromise) {\n return scriptLoadPromise;\n }\n scriptLoadPromise = new Promise<DracoFactory>((resolve, reject) => {\n const existing = (globalThis as { DracoDecoderModule?: DracoFactory }).DracoDecoderModule;\n if (existing) {\n resolve(existing);\n return;\n }\n const script = document.createElement(\"script\");\n script.src = dracoBaseUrl + \"draco_decoder.js\";\n script.onload = () => {\n const factory = (globalThis as { DracoDecoderModule?: DracoFactory }).DracoDecoderModule;\n if (!factory) {\n reject(new Error(\"draco_decoder.js loaded but DracoDecoderModule is undefined\"));\n } else {\n resolve(factory);\n }\n };\n script.onerror = () => reject(new Error(\"Failed to load draco_decoder.js from \" + script.src));\n document.head.appendChild(script);\n });\n return scriptLoadPromise;\n}\n\nasync function getDracoModule(): Promise<DracoModule> {\n if (modulePromise) {\n return modulePromise;\n }\n modulePromise = (async () => {\n const factory = await loadDracoScript();\n return factory({ locateFile: (f: string) => dracoBaseUrl + f });\n })();\n return modulePromise;\n}\n\n/**\n * Decode a KHR_draco_mesh_compression primitive.\n * @param compressed - The raw bytes of the bufferView referenced by the extension.\n * @param attributeMap - Map of glTF attribute name (POSITION, NORMAL, ...) to Draco unique id.\n * @param accessorTypes - Map of glTF attribute name to component count (3 for VEC3, 2 for VEC2, 4 for VEC4).\n */\nexport async function decodeDracoPrimitive(compressed: Uint8Array, attributeMap: Record<string, number>, accessorTypes: Record<string, number>): Promise<DecodedPrimitive> {\n const module = await getDracoModule();\n const decoder = new module.Decoder();\n const buffer = new module.DecoderBuffer();\n buffer.Init(compressed, compressed.byteLength);\n const mesh = new module.Mesh();\n const status = decoder.DecodeBufferToMesh(buffer, mesh);\n if (!status.ok()) {\n const err = status.error_msg();\n module.destroy(buffer);\n module.destroy(mesh);\n module.destroy(decoder);\n throw new Error(\"Draco decode failed: \" + err);\n }\n\n const numPoints = mesh.num_points();\n const numFaces = mesh.num_faces();\n const indexCount = numFaces * 3;\n\n // Indices: Draco returns Uint32 triangles. Always slice() off the heap\n // view because module._malloc may grow the WASM memory and invalidate\n // the typed-array views we already hold.\n const indexByteLength = indexCount * 4;\n const indexPtr = module._malloc(indexByteLength);\n decoder.GetTrianglesUInt32Array(mesh, indexByteLength, indexPtr);\n const indices = new U32(module.HEAPU32.buffer, indexPtr, indexCount).slice();\n module._free(indexPtr);\n\n const attributes = new Map<string, Float32Array | Uint32Array | Int32Array>();\n for (const name of Object.keys(attributeMap)) {\n const uniqueId = attributeMap[name]!;\n const attr = decoder.GetAttributeByUniqueId(mesh, uniqueId);\n const componentCount = accessorTypes[name] ?? 3;\n const totalComponents = numPoints * componentCount;\n const isIntAttr = name === \"JOINTS_0\" || name === \"JOINTS_1\";\n const bytesPerElement = 4;\n const byteLength = totalComponents * bytesPerElement;\n const ptr = module._malloc(byteLength);\n const dataType = isIntAttr ? module.DT_INT32 : module.DT_FLOAT32;\n decoder.GetAttributeDataArrayForAllPoints(mesh, attr, dataType, byteLength, ptr);\n // Re-read the HEAP view AFTER malloc/decode — the underlying buffer\n // may have been reallocated during decoding.\n if (isIntAttr) {\n attributes.set(name, new I32(module.HEAP32.buffer, ptr, totalComponents).slice());\n } else {\n attributes.set(name, new F32(module.HEAPF32.buffer, ptr, totalComponents).slice());\n }\n module._free(ptr);\n }\n\n module.destroy(buffer);\n module.destroy(mesh);\n module.destroy(decoder);\n\n return { _attributes: attributes, _indices: indices, _vertexCount: numPoints, _indexCount: indexCount };\n}\n\n/**\n * Read the bufferView slice referenced by the Draco extension into a Uint8Array.\n */\nexport function getDracoBufferViewBytes(json: { bufferViews: Array<{ byteOffset?: number; byteLength: number }> }, binChunk: DataView, bufferViewIdx: number): Uint8Array {\n const view = json.bufferViews[bufferViewIdx];\n if (!view) {\n throw new Error(`Draco bufferView ${bufferViewIdx} not found`);\n }\n const offset = binChunk.byteOffset + (view.byteOffset ?? 0);\n return new U8(binChunk.buffer, offset, view.byteLength);\n}\n","/**\n * KHR_draco_mesh_compression feature.\n *\n * Runs as a `preMesh` hook — before mesh extraction — so the core loader\n * stays unaware of Draco. This module is only dynamic-imported when the\n * asset's `extensionsUsed` lists KHR_draco_mesh_compression, which in turn\n * dynamic-imports the actual Emscripten-based decoder (`draco-decode.ts`).\n */\n\nimport type { DecodedPrimitive, GltfFeature } from \"./gltf-feature.js\";\nimport { decodeDracoPrimitive, getDracoBufferViewBytes } from \"./draco-decode.js\";\n\nconst TYPE_COMPONENT_COUNTS: Record<string, number> = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 };\n\nconst feature: GltfFeature = {\n id: \"KHR_draco_mesh_compression\",\n async preMesh(jsonIn, binChunk) {\n const json = jsonIn as {\n meshes?: Array<{\n primitives?: Array<{ attributes?: Record<string, number>; extensions?: Record<string, { bufferView: number; attributes: Record<string, number> }> }>;\n }>;\n accessors?: Array<{ type: string }>;\n };\n const out = new Map<unknown, DecodedPrimitive>();\n for (const mesh of json.meshes ?? []) {\n for (const primitive of mesh.primitives ?? []) {\n const ext = primitive.extensions?.KHR_draco_mesh_compression;\n if (!ext) {\n continue;\n }\n const bytes = getDracoBufferViewBytes(json as { bufferViews: Array<{ byteOffset?: number; byteLength: number }> }, binChunk, ext.bufferView);\n const accessorTypes: Record<string, number> = {};\n for (const name of Object.keys(ext.attributes)) {\n const accIdx = primitive.attributes?.[name];\n if (accIdx !== undefined && json.accessors?.[accIdx]) {\n accessorTypes[name] = TYPE_COMPONENT_COUNTS[json.accessors[accIdx].type] ?? 3;\n }\n }\n const decoded = await decodeDracoPrimitive(bytes, ext.attributes, accessorTypes);\n out.set(primitive, decoded);\n }\n }\n return out;\n },\n};\n\nexport default feature;\n"],"names":[],"mappings":";AAmBA,IAAI,eAAe;AA4BnB,IAAI,gBAA6C;AACjD,IAAI,oBAAkD;AAEtD,SAAS,kBAAyC;AAC9C,MAAI,mBAAmB;AACnB,WAAO;AAAA,EACX;AACA,sBAAoB,IAAI,QAAsB,CAAC,SAAS,WAAW;AAC/D,UAAM,WAAY,WAAqD;AACvE,QAAI,UAAU;AACV,cAAQ,QAAQ;AAChB;AAAA,IACJ;AACA,UAAM,SAAS,SAAS,cAAc,QAAQ;AAC9C,WAAO,MAAM,eAAe;AAC5B,WAAO,SAAS,MAAM;AAClB,YAAM,UAAW,WAAqD;AACtE,UAAI,CAAC,SAAS;AACV,eAAO,IAAI,MAAM,6DAA6D,CAAC;AAAA,MACnF,OAAO;AACH,gBAAQ,OAAO;AAAA,MACnB;AAAA,IACJ;AACA,WAAO,UAAU,MAAM,OAAO,IAAI,MAAM,0CAA0C,O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,OAAM,eAAU,eAAV,mBAAsB;AAClC,YAAI,CAAC,KAAK;AACN;AAAA,QACJ;AACA,cAAM,QAAQ,wBAAwB,MAA6E,UAAU,IAAI,UAAU;AAC3I,cAAM,gBAAwC,CAAA;AAC9C,mBAAW,QAAQ,OAAO,KAAK,IAAI,UAAU,GAAG;AAC5C,gBAAM,UAAS,eAAU,eAAV,mBAAuB;AACtC,cAAI,WAAW,YAAa,UAAK,cAAL,mBAAiB,UAAS;AAClD,0BAAc,IAAI,IAAI,sBAAsB,KAAK,UAAU,MAAM,EAAE,IAAI,KAAK;AAAA,UAChF;AAAA,QACJ;AACA,cAAM,UAAU,MAAM,qBAAqB,OAAO,IAAI,YAAY,aAAa;AAC/E,YAAI,IAAI,WAAW,OAAO;AAAA,MAC9B;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AACJ;"}
@@ -1,4 +1,4 @@
1
- import { r as resolveAccessor, bp as setThinInstances, bq as mat4ComposeInto, a as F32, h as computeAabb, br as getLoaderTmpInstance, bs as mat4Multiply } from "./index-C-tEgwbZ.js";
1
+ import { r as resolveAccessor, br as setThinInstances, bs as mat4ComposeInto, a as F32, h as computeAabb, bt as getLoaderTmpInstance, bu as mat4Multiply } from "./index-BgY3QEzL.js";
2
2
  function collectMeshesUnderNode(tn) {
3
3
  const out = [];
4
4
  for (const c of (tn == null ? void 0 : tn.children) ?? []) {
@@ -149,4 +149,4 @@ function expandMeshAabbForInstances(mesh, matrices, count, nodeWorld) {
149
149
  export {
150
150
  ext as default
151
151
  };
152
- //# sourceMappingURL=gltf-feature-gpu-instancing-C7sRzWv7.js.map
152
+ //# sourceMappingURL=gltf-feature-gpu-instancing-BoeSm6Tn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-gpu-instancing-C7sRzWv7.js","sources":["../src/loader-gltf/gltf-feature-gpu-instancing.ts"],"sourcesContent":["/** glTF EXT_mesh_gpu_instancing extension.\n *\n * Attaches hardware-instanced thin instances to every mesh that belongs to a\n * node carrying `extensions.EXT_mesh_gpu_instancing`. The extension provides\n * per-instance TRANSLATION / ROTATION / SCALE accessors (all optional); each\n * instance matrix is composed as T·R·S in the node's local frame. The node's\n * own TRS is applied through the regular parent-chain world matrix at render\n * time (`finalWorld = mesh.world * instanceWorld` in thin-instance-fragment),\n * so instance matrices must NOT pre-multiply the node transform.\n *\n * Dynamically imported by load-gltf only when the asset declares the\n * extension in `extensionsUsed`, so bundles pay zero bytes otherwise.\n *\n * Spec: https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md\n */\n\nimport { F32 } from \"../engine/typed-arrays.js\";\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport type { Mesh } from \"../mesh/mesh.js\";\nimport { resolveAccessor } from \"./gltf-parser.js\";\nimport { computeAabb } from \"../math/compute-aabb.js\";\nimport { mat4ComposeInto } from \"../math/mat4-compose-into.js\";\nimport { mat4Multiply } from \"../math/mat4-multiply.js\";\nimport type { Mat4 } from \"../math/types.js\";\nimport type { Mat4Storage } from \"../math/types.js\";\nimport { setThinInstances } from \"../mesh/thin-instance.js\";\nimport { getLoaderTmpInstance } from \"./_loader-scratch.js\";\n\n/** Collect every Mesh child (direct children only — matches buildNodeHierarchy). */\nfunction collectMeshesUnderNode(tn: { children?: unknown[] } | undefined): Mesh[] {\n const out: Mesh[] = [];\n for (const c of tn?.children ?? []) {\n if (c && typeof c === \"object\" && \"material\" in (c as object)) {\n out.push(c as Mesh);\n }\n }\n return out;\n}\n\nfunction buildInstanceMatrices(translation: Float32Array | null, rotation: Float32Array | null, scale: Float32Array | null, count: number): Float32Array {\n const matrices = new F32(count * 16);\n for (let i = 0; i < count; i++) {\n const tx = translation ? translation[i * 3]! : 0;\n const ty = translation ? translation[i * 3 + 1]! : 0;\n const tz = translation ? translation[i * 3 + 2]! : 0;\n const qx = rotation ? rotation[i * 4]! : 0;\n const qy = rotation ? rotation[i * 4 + 1]! : 0;\n const qz = rotation ? rotation[i * 4 + 2]! : 0;\n const qw = rotation ? rotation[i * 4 + 3]! : 1;\n const sx = scale ? scale[i * 3]! : 1;\n const sy = scale ? scale[i * 3 + 1]! : 1;\n const sz = scale ? scale[i * 3 + 2]! : 1;\n mat4ComposeInto(matrices, i * 16, tx, ty, tz, qx, qy, qz, qw, sx, sy, sz);\n }\n return matrices;\n}\n\nconst ext: GltfFeature = {\n id: \"EXT_mesh_gpu_instancing\",\n async applyAsset(_meshes, _root, ctx) {\n const { _json: json, _binChunk: binChunk, _nodeMap: nodeMap } = ctx;\n if (!nodeMap) {\n return {};\n }\n const nodes = json.nodes ?? [];\n for (let nodeIdx = 0; nodeIdx < nodes.length; nodeIdx++) {\n const attrs = nodes[nodeIdx]?.extensions?.EXT_mesh_gpu_instancing?.attributes;\n if (!attrs) {\n continue;\n }\n const tn = nodeMap[nodeIdx];\n if (!tn) {\n continue;\n }\n const meshesForNode = collectMeshesUnderNode(tn as unknown as { children?: unknown[] });\n if (meshesForNode.length === 0) {\n continue;\n }\n\n const tAcc = attrs.TRANSLATION !== undefined ? resolveAccessor(json, binChunk, attrs.TRANSLATION) : null;\n const rAcc = attrs.ROTATION !== undefined ? resolveAccessor(json, binChunk, attrs.ROTATION) : null;\n const sAcc = attrs.SCALE !== undefined ? resolveAccessor(json, binChunk, attrs.SCALE) : null;\n\n let count = 0;\n for (const acc of [tAcc, rAcc, sAcc]) {\n if (!acc) {\n continue;\n }\n if (count === 0) {\n count = acc._count;\n } else if (acc._count !== count) {\n throw new Error(`EXT_mesh_gpu_instancing: accessor count mismatch on node ${nodeIdx}`);\n }\n }\n if (count === 0) {\n continue;\n }\n\n const matrices = buildInstanceMatrices(\n tAcc ? (tAcc._data as Float32Array) : null,\n rAcc ? (rAcc._data as Float32Array) : null,\n sAcc ? (sAcc._data as Float32Array) : null,\n count\n );\n const nodeWorld = ctx._worldMatrixCache.get(nodeIdx);\n for (const mesh of meshesForNode) {\n setThinInstances(mesh, matrices, count);\n expandMeshAabbForInstances(mesh, matrices, count, nodeWorld);\n }\n }\n return {};\n },\n};\nexport default ext;\n\n/** Expand a mesh's world-space AABB to enclose all thin instances so that\n * auto-framing cameras see the full instanced grid, not just the base mesh.\n * Uses the module-level `getLoaderTmpInstance()` scratch for the per-iteration\n * instance world matrix — no per-call allocation. */\nfunction expandMeshAabbForInstances(mesh: Mesh, matrices: Float32Array, count: number, nodeWorld: Mat4 | undefined): void {\n const positions = mesh._cpuPositions;\n if (!positions || !nodeWorld || count === 0) {\n return;\n }\n // Local AABB of the base mesh (before any per-instance / node transform).\n const [lmin, lmax] = computeAabb(positions);\n if (!isFinite(lmin[0]!)) {\n return;\n }\n // 8 corners of the local AABB, packed as 24 floats for computeAabb.\n const corners = new F32([\n lmin[0]!,\n lmin[1]!,\n lmin[2]!,\n lmax[0]!,\n lmin[1]!,\n lmin[2]!,\n lmin[0]!,\n lmax[1]!,\n lmin[2]!,\n lmax[0]!,\n lmax[1]!,\n lmin[2]!,\n lmin[0]!,\n lmin[1]!,\n lmax[2]!,\n lmax[0]!,\n lmin[1]!,\n lmax[2]!,\n lmin[0]!,\n lmax[1]!,\n lmax[2]!,\n lmax[0]!,\n lmax[1]!,\n lmax[2]!,\n ]);\n let wMinX = Infinity,\n wMinY = Infinity,\n wMinZ = Infinity;\n let wMaxX = -Infinity,\n wMaxY = -Infinity,\n wMaxZ = -Infinity;\n const instWorld = getLoaderTmpInstance();\n const instBuf = instWorld as unknown as Mat4Storage;\n for (let i = 0; i < count; i++) {\n for (let k = 0; k < 16; k++) {\n instBuf[k] = matrices[i * 16 + k]!;\n }\n const combined = mat4Multiply(nodeWorld, instWorld);\n const [imin, imax] = computeAabb(corners, combined);\n if (imin[0]! < wMinX) {\n wMinX = imin[0]!;\n }\n if (imin[1]! < wMinY) {\n wMinY = imin[1]!;\n }\n if (imin[2]! < wMinZ) {\n wMinZ = imin[2]!;\n }\n if (imax[0]! > wMaxX) {\n wMaxX = imax[0]!;\n }\n if (imax[1]! > wMaxY) {\n wMaxY = imax[1]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,UAAM,WAAW,aAAa,WAAW,SAAS;AAClD,UAAM,CAAC,MAAM,IAAI,IAAI,YAAY,SAAS,QAAQ;AAClD,QAAI,KAAK,CAAC,IAAK,OAAO;AAClB,cAAQ,KAAK,CAAC;AAAA,IAClB;AACA,QAAI,KAAK,CAAC,IAAK,OAAO;AAClB,cAAQ,KAAK,CAAC;AAAA,IAClB;AACA,QAAI,KAAK,CAAC,IAAK,OAAO;AAClB,cAAQ,KAAK,CAAC;AAAA,IAClB;AACA,QAAI,KAAK,CAAC,IAAK,OAAO;AAClB,cAAQ,KAAK,CAAC;AAAA,IAClB;AACA,QAAI,KAAK,CAAC,IAAK,OAAO;AAClB,cAAQ,KAAK,CAAC;AAAA,IAClB;AACA,QAAI,KAAK,CAAC,IAAK,OAAO;AAClB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACJ;AACA,OAAK,WAAW,CAAC,OAAO,OAAO,KAAK;AACpC,OAAK,WAAW,CAAC,OAAO,OAAO,KAAK;AACxC;"}
1
+ {"version":3,"file":"gltf-feature-gpu-instancing-BoeSm6Tn.js","sources":["../src/loader-gltf/gltf-feature-gpu-instancing.ts"],"sourcesContent":["/** glTF EXT_mesh_gpu_instancing extension.\n *\n * Attaches hardware-instanced thin instances to every mesh that belongs to a\n * node carrying `extensions.EXT_mesh_gpu_instancing`. The extension provides\n * per-instance TRANSLATION / ROTATION / SCALE accessors (all optional); each\n * instance matrix is composed as T·R·S in the node's local frame. The node's\n * own TRS is applied through the regular parent-chain world matrix at render\n * time (`finalWorld = mesh.world * instanceWorld` in thin-instance-fragment),\n * so instance matrices must NOT pre-multiply the node transform.\n *\n * Dynamically imported by load-gltf only when the asset declares the\n * extension in `extensionsUsed`, so bundles pay zero bytes otherwise.\n *\n * Spec: https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md\n */\n\nimport { F32 } from \"../engine/typed-arrays.js\";\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport type { Mesh } from \"../mesh/mesh.js\";\nimport { resolveAccessor } from \"./gltf-parser.js\";\nimport { computeAabb } from \"../math/compute-aabb.js\";\nimport { mat4ComposeInto } from \"../math/mat4-compose-into.js\";\nimport { mat4Multiply } from \"../math/mat4-multiply.js\";\nimport type { Mat4 } from \"../math/types.js\";\nimport type { Mat4Storage } from \"../math/types.js\";\nimport { setThinInstances } from \"../mesh/thin-instance.js\";\nimport { getLoaderTmpInstance } from \"./_loader-scratch.js\";\n\n/** Collect every Mesh child (direct children only — matches buildNodeHierarchy). */\nfunction collectMeshesUnderNode(tn: { children?: unknown[] } | undefined): Mesh[] {\n const out: Mesh[] = [];\n for (const c of tn?.children ?? []) {\n if (c && typeof c === \"object\" && \"material\" in (c as object)) {\n out.push(c as Mesh);\n }\n }\n return out;\n}\n\nfunction buildInstanceMatrices(translation: Float32Array | null, rotation: Float32Array | null, scale: Float32Array | null, count: number): Float32Array {\n const matrices = new F32(count * 16);\n for (let i = 0; i < count; i++) {\n const tx = translation ? translation[i * 3]! : 0;\n const ty = translation ? translation[i * 3 + 1]! : 0;\n const tz = translation ? translation[i * 3 + 2]! : 0;\n const qx = rotation ? rotation[i * 4]! : 0;\n const qy = rotation ? rotation[i * 4 + 1]! : 0;\n const qz = rotation ? rotation[i * 4 + 2]! : 0;\n const qw = rotation ? rotation[i * 4 + 3]! : 1;\n const sx = scale ? scale[i * 3]! : 1;\n const sy = scale ? scale[i * 3 + 1]! : 1;\n const sz = scale ? scale[i * 3 + 2]! : 1;\n mat4ComposeInto(matrices, i * 16, tx, ty, tz, qx, qy, qz, qw, sx, sy, sz);\n }\n return matrices;\n}\n\nconst ext: GltfFeature = {\n id: \"EXT_mesh_gpu_instancing\",\n async applyAsset(_meshes, _root, ctx) {\n const { _json: json, _binChunk: binChunk, _nodeMap: nodeMap } = ctx;\n if (!nodeMap) {\n return {};\n }\n const nodes = json.nodes ?? [];\n for (let nodeIdx = 0; nodeIdx < nodes.length; nodeIdx++) {\n const attrs = nodes[nodeIdx]?.extensions?.EXT_mesh_gpu_instancing?.attributes;\n if (!attrs) {\n continue;\n }\n const tn = nodeMap[nodeIdx];\n if (!tn) {\n continue;\n }\n const meshesForNode = collectMeshesUnderNode(tn as unknown as { children?: unknown[] });\n if (meshesForNode.length === 0) {\n continue;\n }\n\n const tAcc = attrs.TRANSLATION !== undefined ? resolveAccessor(json, binChunk, attrs.TRANSLATION) : null;\n const rAcc = attrs.ROTATION !== undefined ? resolveAccessor(json, binChunk, attrs.ROTATION) : null;\n const sAcc = attrs.SCALE !== undefined ? resolveAccessor(json, binChunk, attrs.SCALE) : null;\n\n let count = 0;\n for (const acc of [tAcc, rAcc, sAcc]) {\n if (!acc) {\n continue;\n }\n if (count === 0) {\n count = acc._count;\n } else if (acc._count !== count) {\n throw new Error(`EXT_mesh_gpu_instancing: accessor count mismatch on node ${nodeIdx}`);\n }\n }\n if (count === 0) {\n continue;\n }\n\n const matrices = buildInstanceMatrices(\n tAcc ? (tAcc._data as Float32Array) : null,\n rAcc ? (rAcc._data as Float32Array) : null,\n sAcc ? (sAcc._data as Float32Array) : null,\n count\n );\n const nodeWorld = ctx._worldMatrixCache.get(nodeIdx);\n for (const mesh of meshesForNode) {\n setThinInstances(mesh, matrices, count);\n expandMeshAabbForInstances(mesh, matrices, count, nodeWorld);\n }\n }\n return {};\n },\n};\nexport default ext;\n\n/** Expand a mesh's world-space AABB to enclose all thin instances so that\n * auto-framing cameras see the full instanced grid, not just the base mesh.\n * Uses the module-level `getLoaderTmpInstance()` scratch for the per-iteration\n * instance world matrix — no per-call allocation. */\nfunction expandMeshAabbForInstances(mesh: Mesh, matrices: Float32Array, count: number, nodeWorld: Mat4 | undefined): void {\n const positions = mesh._cpuPositions;\n if (!positions || !nodeWorld || count === 0) {\n return;\n }\n // Local AABB of the base mesh (before any per-instance / node transform).\n const [lmin, lmax] = computeAabb(positions);\n if (!isFinite(lmin[0]!)) {\n return;\n }\n // 8 corners of the local AABB, packed as 24 floats for computeAabb.\n const corners = new F32([\n lmin[0]!,\n lmin[1]!,\n lmin[2]!,\n lmax[0]!,\n lmin[1]!,\n lmin[2]!,\n lmin[0]!,\n lmax[1]!,\n lmin[2]!,\n lmax[0]!,\n lmax[1]!,\n lmin[2]!,\n lmin[0]!,\n lmin[1]!,\n lmax[2]!,\n lmax[0]!,\n lmin[1]!,\n lmax[2]!,\n lmin[0]!,\n lmax[1]!,\n lmax[2]!,\n lmax[0]!,\n lmax[1]!,\n lmax[2]!,\n ]);\n let wMinX = Infinity,\n wMinY = Infinity,\n wMinZ = Infinity;\n let wMaxX = -Infinity,\n wMaxY = -Infinity,\n wMaxZ = -Infinity;\n const instWorld = getLoaderTmpInstance();\n const instBuf = instWorld as unknown as Mat4Storage;\n for (let i = 0; i < count; i++) {\n for (let k = 0; k < 16; k++) {\n instBuf[k] = matrices[i * 16 + k]!;\n }\n const combined = mat4Multiply(nodeWorld, instWorld);\n const [imin, imax] = computeAabb(corners, combined);\n if (imin[0]! < wMinX) {\n wMinX = imin[0]!;\n }\n if (imin[1]! < wMinY) {\n wMinY = imin[1]!;\n }\n if (imin[2]! < wMinZ) {\n wMinZ = imin[2]!;\n }\n if (imax[0]! > wMaxX) {\n wMaxX = imax[0]!;\n }\n if (imax[1]! > wMaxY) {\n wMaxY = imax[1]!;\n }\n if (imax[2]! > wMaxZ) {\n wMaxZ = imax[2]!;\n }\n }\n mesh.boundMin = [wMinX, wMinY, wMinZ];\n mesh.boundMax = [wMaxX, wMaxY, wMaxZ];\n}\n"],"names":[],"mappings":";AA6BA,SAAS,uBAAuB,IAAkD;AAC9E,QAAM,MAAc,CAAA;AACpB,aAAW,MAAK,yBAAI,aAAY,CAAA,GAAI;AAChC,QAAI,KAAK,OAAO,MAAM,YAAY,cAAe,GAAc;AAC3D,UAAI,KAAK,CAAS;AAAA,IACtB;AAAA,EACJ;AACA,SAAO;AACX;AAEA,SAAS,sBAAsB,aAAkC,UAA+B,OAA4B,OAA6B;AACrJ,QAAM,WAAW,IAAI,I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C;AAAA,IAClB;AACA,QAAI,KAAK,CAAC,IAAK,OAAO;AAClB,cAAQ,KAAK,CAAC;AAAA,IAClB;AAAA,EACJ;AACA,OAAK,WAAW,CAAC,OAAO,OAAO,KAAK;AACpC,OAAK,WAAW,CAAC,OAAO,OAAO,KAAK;AACxC;"}
@@ -1,4 +1,4 @@
1
- import { M as MAX_LIGHTS, ba as setMaxLights, bb as computeNodeWorldMatrix } from "./index-C-tEgwbZ.js";
1
+ import { M as MAX_LIGHTS, bc as setMaxLights, bd as computeNodeWorldMatrix } from "./index-BgY3QEzL.js";
2
2
  const feature = {
3
3
  id: "KHR_lights_punctual",
4
4
  async applyAsset(_meshes, _root, ctx) {
@@ -40,20 +40,20 @@ const feature = {
40
40
  const intensity = def.intensity ?? 1;
41
41
  const range = def.range !== void 0 ? def.range : Number.MAX_VALUE;
42
42
  if (def.type === "point") {
43
- const { createPointLight } = await import("./index-C-tEgwbZ.js").then((n) => n.jx);
43
+ const { createPointLight } = await import("./index-BgY3QEzL.js").then((n) => n.k4);
44
44
  const pl = createPointLight([px, py, pz], intensity);
45
45
  pl.diffuse = color;
46
46
  pl.specular = color;
47
47
  pl.range = range;
48
48
  lights.push(pl);
49
49
  } else if (def.type === "directional") {
50
- const { createDirectionalLight } = await import("./index-C-tEgwbZ.js").then((n) => n.jy);
50
+ const { createDirectionalLight } = await import("./index-BgY3QEzL.js").then((n) => n.k5);
51
51
  const dl = createDirectionalLight(dir, intensity);
52
52
  dl.diffuse = color;
53
53
  dl.specular = color;
54
54
  lights.push(dl);
55
55
  } else if (def.type === "spot") {
56
- const { createSpotLight } = await import("./index-C-tEgwbZ.js").then((n) => n.jz);
56
+ const { createSpotLight } = await import("./index-BgY3QEzL.js").then((n) => n.k6);
57
57
  const outer = ((_i = def.spot) == null ? void 0 : _i.outerConeAngle) ?? Math.PI / 4;
58
58
  const sl = createSpotLight([px, py, pz], dir, outer * 2, 1, intensity);
59
59
  sl.diffuse = color;
@@ -68,4 +68,4 @@ const feature = {
68
68
  export {
69
69
  feature as default
70
70
  };
71
- //# sourceMappingURL=gltf-feature-lights-punctual-DF7kya14.js.map
71
+ //# sourceMappingURL=gltf-feature-lights-punctual-BCTwgyi_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-lights-punctual-DF7kya14.js","sources":["../src/loader-gltf/gltf-feature-lights-punctual.ts"],"sourcesContent":["/** KHR_lights_punctual glTF extension.\n * Parses point / directional / spot lights from the asset's top-level\n * KHR_lights_punctual.lights array and instantiates one Lite light per\n * referencing node, baking the node's world transform into the light's\n * position / direction. Lights are contributed via the AssetContainer's\n * `entities` array; addToScene() picks them up through the `lightType`\n * branch of its traversal. */\n\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport type { LightBase } from \"../light/types.js\";\nimport { MAX_LIGHTS, setMaxLights } from \"../light/types.js\";\nimport { computeNodeWorldMatrix } from \"./gltf-parser.js\";\n\ninterface GltfLightDef {\n type: \"point\" | \"directional\" | \"spot\";\n color?: [number, number, number];\n intensity?: number;\n range?: number;\n spot?: { innerConeAngle?: number; outerConeAngle?: number };\n}\n\nconst feature: GltfFeature = {\n id: \"KHR_lights_punctual\",\n async applyAsset(_meshes, _root, ctx) {\n const defs: GltfLightDef[] | undefined = ctx._json.extensions?.KHR_lights_punctual?.lights;\n if (!defs?.length) {\n return {};\n }\n const lights: LightBase[] = [];\n const nodes = ctx._json.nodes ?? [];\n // Count lights first so we can raise MAX_LIGHTS before any pipeline is\n // compiled (loadGltf runs before addToScene which triggers pipeline\n // creation). Lite's MAX_LIGHTS is scene-wide, so cover every punctual\n // light declared by the asset rather than Babylon's per-material cap.\n let lightNodeCount = 0;\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i]?.extensions?.KHR_lights_punctual?.light !== undefined) {\n lightNodeCount++;\n }\n }\n if (lightNodeCount > MAX_LIGHTS) {\n setMaxLights(lightNodeCount);\n }\n for (let nodeIdx = 0; nodeIdx < nodes.length; nodeIdx++) {\n const lightIdx: number | undefined = nodes[nodeIdx]?.extensions?.KHR_lights_punctual?.light;\n if (lightIdx === undefined) {\n continue;\n }\n const def = defs[lightIdx];\n if (!def) {\n continue;\n }\n const world = computeNodeWorldMatrix(ctx._json, nodeIdx, ctx._parentMap, ctx._worldMatrixCache);\n const px = world[12]!;\n const py = world[13]!;\n const pz = world[14]!;\n // glTF convention: light forward is -Z in local space. Extract world-space forward\n // by transforming (0,0,-1) through the node's upper-3x3. Normalize defensively.\n const fx = -world[8]!;\n const fy = -world[9]!;\n const fz = -world[10]!;\n const flen = Math.hypot(fx, fy, fz) || 1;\n const dir: [number, number, number] = [fx / flen, fy / flen, fz / flen];\n const color: [number, number, number] = def.color ? [def.color[0]!, def.color[1]!, def.color[2]!] : [1, 1, 1];\n const intensity = def.intensity ?? 1;\n const range = def.range !== undefined ? def.range : Number.MAX_VALUE;\n\n if (def.type === \"point\") {\n const { createPointLight } = await import(\"../light/point-light.js\");\n const pl = createPointLight([px, py, pz], intensity);\n pl.diffuse = color;\n pl.specular = color;\n pl.range = range;\n lights.push(pl);\n } else if (def.type === \"directional\") {\n const { createDirectionalLight } = await import(\"../light/directional-light.js\");\n const dl = createDirectionalLight(dir, intensity);\n dl.diffuse = color;\n dl.specular = color;\n lights.push(dl);\n } else if (def.type === \"spot\") {\n const { createSpotLight } = await import(\"../light/spot-light.js\");\n const outer = def.spot?.outerConeAngle ?? Math.PI / 4;\n const sl = createSpotLight([px, py, pz], dir, outer * 2, 1, intensity);\n sl.diffuse = color;\n sl.specular = color;\n sl.range = range;\n lights.push(sl);\n }\n }\n return { entities: lights };\n },\n};\nexport default feature;\n"],"names":[],"mappings":";AAqBA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,WAAW,SAAS,OAAO,KAAK;;AAClC,UAAM,QAAmC,eAAI,MAAM,eAAV,mBAAsB,wBAAtB,mBAA2C;AACpF,QAAI,EAAC,6BAAM,SAAQ;AACf,aAAO,CAAA;AAAA,IACX;AACA,UAAM,SAAsB,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,EAAA,KAAA,OAAA,EAAA,EAAA;AACnE,cAAM,KAAK,iBAAiB,CAAC,IAAI,IAAI,EAAE,GAAG,SAAS;AACnD,WAAG,UAAU;AACb,WAAG,WAAW;AACd,WAAG,QAAQ;AACX,eAAO,KAAK,EAAE;AAAA,MAClB,WAAW,IAAI,SAAS,eAAe;AACnC,cAAM,EAAE,uBAAA,IAA2B,MAAM,OAAO,qBAA+B,EAAA,KAAA,OAAA,EAAA,EAAA;AAC/E,cAAM,KAAK,uBAAuB,KAAK,SAAS;AAChD,WAAG,UAAU;AACb,WAAG,WAAW;AACd,eAAO,KAAK,EAAE;AAAA,MAClB,WAAW,IAAI,SAAS,QAAQ;AAC5B,cAAM,EAAE,gBAAA,IAAoB,MAAM,OAAO,qBAAwB,EAAA,KAAA,OAAA,EAAA,EAAA;AACjE,cAAM,UAAQ,SAAI,SAAJ,mBAAU,mBAAkB,KAAK,KAAK;AACpD,cAAM,KAAK,gBAAgB,CAAC,IAAI,IAAI,EAAE,GAAG,KAAK,QAAQ,GAAG,GAAG,SAAS;AACrE,WAAG,UAAU;AACb,WAAG,WAAW;AACd,WAAG,QAAQ;AACX,eAAO,KAAK,EAAE;AAAA,MAClB;AAAA,IACJ;AACA,WAAO,EAAE,UAAU,OAAA;AAAA,EACvB;AACJ;"}
1
+ {"version":3,"file":"gltf-feature-lights-punctual-BCTwgyi_.js","sources":["../src/loader-gltf/gltf-feature-lights-punctual.ts"],"sourcesContent":["/** KHR_lights_punctual glTF extension.\n * Parses point / directional / spot lights from the asset's top-level\n * KHR_lights_punctual.lights array and instantiates one Lite light per\n * referencing node, baking the node's world transform into the light's\n * position / direction. Lights are contributed via the AssetContainer's\n * `entities` array; addToScene() picks them up through the `lightType`\n * branch of its traversal. */\n\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport type { LightBase } from \"../light/types.js\";\nimport { MAX_LIGHTS, setMaxLights } from \"../light/types.js\";\nimport { computeNodeWorldMatrix } from \"./gltf-parser.js\";\n\ninterface GltfLightDef {\n type: \"point\" | \"directional\" | \"spot\";\n color?: [number, number, number];\n intensity?: number;\n range?: number;\n spot?: { innerConeAngle?: number; outerConeAngle?: number };\n}\n\nconst feature: GltfFeature = {\n id: \"KHR_lights_punctual\",\n async applyAsset(_meshes, _root, ctx) {\n const defs: GltfLightDef[] | undefined = ctx._json.extensions?.KHR_lights_punctual?.lights;\n if (!defs?.length) {\n return {};\n }\n const lights: LightBase[] = [];\n const nodes = ctx._json.nodes ?? [];\n // Count lights first so we can raise MAX_LIGHTS before any pipeline is\n // compiled (loadGltf runs before addToScene which triggers pipeline\n // creation). Lite's MAX_LIGHTS is scene-wide, so cover every punctual\n // light declared by the asset rather than Babylon's per-material cap.\n let lightNodeCount = 0;\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i]?.extensions?.KHR_lights_punctual?.light !== undefined) {\n lightNodeCount++;\n }\n }\n if (lightNodeCount > MAX_LIGHTS) {\n setMaxLights(lightNodeCount);\n }\n for (let nodeIdx = 0; nodeIdx < nodes.length; nodeIdx++) {\n const lightIdx: number | undefined = nodes[nodeIdx]?.extensions?.KHR_lights_punctual?.light;\n if (lightIdx === undefined) {\n continue;\n }\n const def = defs[lightIdx];\n if (!def) {\n continue;\n }\n const world = computeNodeWorldMatrix(ctx._json, nodeIdx, ctx._parentMap, ctx._worldMatrixCache);\n const px = world[12]!;\n const py = world[13]!;\n const pz = world[14]!;\n // glTF convention: light forward is -Z in local space. Extract world-space forward\n // by transforming (0,0,-1) through the node's upper-3x3. Normalize defensively.\n const fx = -world[8]!;\n const fy = -world[9]!;\n const fz = -world[10]!;\n const flen = Math.hypot(fx, fy, fz) || 1;\n const dir: [number, number, number] = [fx / flen, fy / flen, fz / flen];\n const color: [number, number, number] = def.color ? [def.color[0]!, def.color[1]!, def.color[2]!] : [1, 1, 1];\n const intensity = def.intensity ?? 1;\n const range = def.range !== undefined ? def.range : Number.MAX_VALUE;\n\n if (def.type === \"point\") {\n const { createPointLight } = await import(\"../light/point-light.js\");\n const pl = createPointLight([px, py, pz], intensity);\n pl.diffuse = color;\n pl.specular = color;\n pl.range = range;\n lights.push(pl);\n } else if (def.type === \"directional\") {\n const { createDirectionalLight } = await import(\"../light/directional-light.js\");\n const dl = createDirectionalLight(dir, intensity);\n dl.diffuse = color;\n dl.specular = color;\n lights.push(dl);\n } else if (def.type === \"spot\") {\n const { createSpotLight } = await import(\"../light/spot-light.js\");\n const outer = def.spot?.outerConeAngle ?? Math.PI / 4;\n const sl = createSpotLight([px, py, pz], dir, outer * 2, 1, intensity);\n sl.diffuse = color;\n sl.specular = color;\n sl.range = range;\n lights.push(sl);\n }\n }\n return { entities: lights };\n },\n};\nexport default feature;\n"],"names":[],"mappings":";AAqBA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,WAAW,SAAS,OAAO,KAAK;;AAClC,UAAM,QAAmC,eAAI,MAAM,eAAV,mBAAsB,wBAAtB,mBAA2C;AACpF,QAAI,EAAC,6BAAM,SAAQ;AACf,aAAO,CAAA;AAAA,IACX;AACA,UAAM,SAAsB,CAAA;AAC5B,UAAM,QAAQ,IAAI,MAAM,SAAS,CAAA;AAKjC,QAAI,iBAAiB;AACrB,aAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACnC,YAAI,uBAAM,CAAC,MAAP,mBAAU,eAAV,mBAAsB,wBAAtB,mBAA2C,WAAU,QAAW;AAChE;AAAA,MACJ;AAAA,IACJ;AACA,QAAI,iBAAiB,YAAY;AAC7B,mBAAa,cAAc;AAAA,IAC/B;AACA,aAAS,UAAU,GAAG,UAAU,MAAM,QAAQ,WAAW;AACrD,YAAM,YAA+B,uBAAM,OAAO,MAAb,mBAAgB,eAAhB,mBAA4B,wBAA5B,mBAAiD;AACtF,UAAI,aAAa,QAAW;AACxB;AAAA,MACJ;AACA,YAAM,MAAM,KAAK,QAAQ;AACzB,UAAI,CAAC,KAAK;AACN;AAAA,MACJ;AACA,YAAM,QAAQ,uBAAuB,IAAI,OAA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ACpD,cAAM,KAAK,gBAAgB,CAAC,IAAI,IAAI,EAAE,GAAG,KAAK,QAAQ,GAAG,GAAG,SAAS;AACrE,WAAG,UAAU;AACb,WAAG,WAAW;AACd,WAAG,QAAQ;AACX,eAAO,KAAK,EAAE;AAAA,MAClB;AAAA,IACJ;AACA,WAAO,EAAE,UAAU,OAAA;AAAA,EACvB;AACJ;"}
@@ -1,4 +1,4 @@
1
- import { e as U8, D as DV } from "./index-C-tEgwbZ.js";
1
+ import { e as U8, D as DV } from "./index-BgY3QEzL.js";
2
2
  let meshoptBaseUrl = "/";
3
3
  let scriptLoadPromise = null;
4
4
  function loadMeshoptScript() {
@@ -82,4 +82,4 @@ const feature = {
82
82
  export {
83
83
  feature as default
84
84
  };
85
- //# sourceMappingURL=gltf-feature-meshopt-DRG9hEqT.js.map
85
+ //# sourceMappingURL=gltf-feature-meshopt-DItMkOMt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-meshopt-DRG9hEqT.js","sources":["../src/loader-gltf/meshopt-decode.ts","../src/loader-gltf/gltf-feature-meshopt.ts"],"sourcesContent":["/**\n * Lazy EXT_meshopt_compression decoder.\n *\n * The meshoptimizer decoder (JS glue + embedded WASM) is loaded from\n * `/meshopt_decoder.js` on first use via a `<script>` injection — exactly like\n * the Draco decoder. This keeps bundle size at zero bytes for scenes that do\n * not load meshopt-compressed glTF assets: the entire module (including this\n * file) is dynamic-imported from the meshopt feature only when an asset's\n * `extensionsUsed` lists EXT_meshopt_compression.\n */\n\n// Public base URL where meshopt_decoder.js is hosted. Defaults to site root.\nlet meshoptBaseUrl = \"/\";\n\n/** Override the base URL where meshopt_decoder.js is hosted. */\nexport function setMeshoptBaseUrl(url: string): void {\n meshoptBaseUrl = url.endsWith(\"/\") ? url : url + \"/\";\n}\n\n/** Minimal surface of the global `MeshoptDecoder` object we rely on. */\ninterface MeshoptDecoderModule {\n ready: Promise<void>;\n decodeGltfBuffer(target: Uint8Array, count: number, size: number, source: Uint8Array, mode: string, filter?: string): void;\n}\n\nlet scriptLoadPromise: Promise<MeshoptDecoderModule> | null = null;\n\nfunction loadMeshoptScript(): Promise<MeshoptDecoderModule> {\n if (scriptLoadPromise) {\n return scriptLoadPromise;\n }\n scriptLoadPromise = new Promise<MeshoptDecoderModule>((resolve, reject) => {\n const existing = (globalThis as { MeshoptDecoder?: MeshoptDecoderModule }).MeshoptDecoder;\n if (existing) {\n resolve(existing);\n return;\n }\n const script = document.createElement(\"script\");\n script.src = meshoptBaseUrl + \"meshopt_decoder.js\";\n script.onload = () => {\n const mod = (globalThis as { MeshoptDecoder?: MeshoptDecoderModule }).MeshoptDecoder;\n if (!mod) {\n reject(new Error(\"meshopt_decoder.js loaded but MeshoptDecoder is undefined\"));\n } else {\n resolve(mod);\n }\n };\n script.onerror = () => reject(new Error(\"Failed to load meshopt_decoder.js from \" + script.src));\n document.head.appendChild(script);\n });\n return scriptLoadPromise;\n}\n\n/** Resolve the ready meshopt decoder module (WASM instantiated). */\nexport async function getMeshoptDecoder(): Promise<MeshoptDecoderModule> {\n const mod = await loadMeshoptScript();\n await mod.ready;\n return mod;\n}\n","/**\n * EXT_meshopt_compression feature.\n *\n * Runs as a `preParse` hook — before any accessor is read — so the core loader\n * and accessor reader stay unaware of meshopt. This module is only\n * dynamic-imported when the asset's `extensionsUsed` lists\n * EXT_meshopt_compression, which in turn loads the meshoptimizer decoder\n * (`meshopt-decode.ts`) lazily.\n *\n * EXT_meshopt_compression is a bufferView-level codec: each compressed\n * bufferView carries an extension object describing the compressed source\n * (`buffer`/`byteOffset`/`byteLength`), the decoded layout (`count`/`byteStride`)\n * and the codec (`mode`/`filter`). We decode every compressed bufferView, copy\n * through every uncompressed one, and pack the results into a single contiguous\n * binary chunk, rewriting `bufferViews` to point into it. Accessor byteOffsets\n * are bufferView-relative and the per-bufferView layout (count * byteStride) is\n * preserved, so the existing accessor reader resolves the decoded data\n * transparently.\n */\n\nimport { U8, DV } from \"../engine/typed-arrays.js\";\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport { getMeshoptDecoder } from \"./meshopt-decode.js\";\n\ninterface MeshoptExt {\n buffer: number;\n byteOffset?: number;\n byteLength: number;\n byteStride: number;\n count: number;\n mode: string;\n filter?: string;\n}\n\ninterface BufferView {\n buffer?: number;\n byteOffset?: number;\n byteLength: number;\n byteStride?: number;\n extensions?: { EXT_meshopt_compression?: MeshoptExt; [k: string]: unknown };\n}\n\n/** Round up to the next 4-byte boundary so relocated bufferViews stay aligned\n * for Float32Array / Uint16Array / Uint32Array views over the packed buffer. */\nfunction align4(n: number): number {\n return (n + 3) & ~3;\n}\n\nconst feature: GltfFeature = {\n id: \"EXT_meshopt_compression\",\n async preParse(json, binChunk) {\n const bufferViews: BufferView[] = json.bufferViews ?? [];\n const decoder = await getMeshoptDecoder();\n\n // Pass 1: materialize each bufferView (decode meshopt ones, copy the rest)\n // and compute the packed-buffer offset for each.\n const materialized: Uint8Array[] = new Array(bufferViews.length);\n const newOffsets: number[] = new Array(bufferViews.length);\n let total = 0;\n for (let i = 0; i < bufferViews.length; i++) {\n const bv = bufferViews[i]!;\n const ext = bv.extensions?.EXT_meshopt_compression;\n let bytes: Uint8Array;\n if (ext) {\n if ((ext.buffer ?? 0) !== 0) {\n throw new Error(`EXT_meshopt_compression: compressed source buffer ${ext.buffer} is not buffer 0 (unsupported)`);\n }\n const source = new U8(binChunk.buffer, binChunk.byteOffset + (ext.byteOffset ?? 0), ext.byteLength);\n const target = new U8(ext.count * ext.byteStride);\n decoder.decodeGltfBuffer(target, ext.count, ext.byteStride, source, ext.mode, ext.filter ?? \"NONE\");\n bytes = target;\n } else {\n if ((bv.buffer ?? 0) !== 0) {\n throw new Error(`EXT_meshopt_compression: uncompressed bufferView in buffer ${bv.buffer} is not buffer 0 (unsupported)`);\n }\n bytes = new U8(binChunk.buffer.slice(binChunk.byteOffset + (bv.byteOffset ?? 0), binChunk.byteOffset + (bv.byteOffset ?? 0) + bv.byteLength));\n }\n materialized[i] = bytes;\n newOffsets[i] = total;\n total = align4(total + bytes.length);\n }\n\n // Pass 2: pack into a single contiguous buffer and rewrite bufferViews.\n const packed = new U8(total);\n for (let i = 0; i < bufferViews.length; i++) {\n const bv = bufferViews[i]!;\n packed.set(materialized[i]!, newOffsets[i]!);\n bv.buffer = 0;\n bv.byteOffset = newOffsets[i]!;\n bv.byteLength = materialized[i]!.length;\n if (bv.extensions) {\n delete bv.extensions.EXT_meshopt_compression;\n }\n }\n\n return new DV(packed.buffer);\n },\n};\n\nexport default feature;\n"],"names":[],"mappings":";AAYA,IAAI,iBAAiB;AAarB,IAAI,oBAA0D;AAE9D,SAAS,oBAAmD;AACxD,MAAI,mBAAmB;AACnB,WAAO;AAAA,EACX;AACA,sBAAoB,IAAI,QAA8B,CAAC,SAAS,WAAW;AACvE,UAAM,WAAY,WAAyD;AAC3E,QAAI,UAAU;AACV,cAAQ,QAAQ;AAChB;AAAA,IACJ;AACA,UAAM,SAAS,SAAS,cAAc,QAAQ;AAC9C,WAAO,MAAM,iBAAiB;AAC9B,WAAO,SAAS,MAAM;AAClB,YAAM,MAAO,WAAyD;AACtE,UAAI,CAAC,KAAK;AACN,eAAO,IAAI,MAAM,2DAA2D,CAAC;AAAA,MACjF,OAAO;AACH,gBAAQ,GAAG;AAAA,MACf;AAAA,IACJ;AACA,WAAO,UAAU,MAAM,OAAO,IAAI,MAAM,4CAA4C,OAAO,GAAG,CAAC;AAC/F,aAAS,KAAK,YAAY,MAAM;AAAA,EACpC,CAAC;AACD,SAAO;AACX;AAGA,eAAsB,oBAAmD;AACrE,QAAM,MAAM,MAAM,kBAAA;AAClB,QAAM,IAAI;AACV,SAAO;AACX;ACdA,SAAS,OAAO,GAAmB;AAC/B,SAAQ,IAAI,IAAK;AACrB;AAEA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,SAAS,MAAM,UAAU;;AAC3B,UAAM,cAA4B,KAAK,eAAe,CAAA;AACtD,UAAM,UAAU,MAAM,kBAAA;AAItB,UA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f,eAAO,GAAG,WAAW;AAAA,MACzB;AAAA,IACJ;AAEA,WAAO,IAAI,GAAG,OAAO,MAAM;AAAA,EAC/B;AACJ;"}
1
+ {"version":3,"file":"gltf-feature-meshopt-DItMkOMt.js","sources":["../src/loader-gltf/meshopt-decode.ts","../src/loader-gltf/gltf-feature-meshopt.ts"],"sourcesContent":["/**\n * Lazy EXT_meshopt_compression decoder.\n *\n * The meshoptimizer decoder (JS glue + embedded WASM) is loaded from\n * `/meshopt_decoder.js` on first use via a `<script>` injection — exactly like\n * the Draco decoder. This keeps bundle size at zero bytes for scenes that do\n * not load meshopt-compressed glTF assets: the entire module (including this\n * file) is dynamic-imported from the meshopt feature only when an asset's\n * `extensionsUsed` lists EXT_meshopt_compression.\n */\n\n// Public base URL where meshopt_decoder.js is hosted. Defaults to site root.\nlet meshoptBaseUrl = \"/\";\n\n/** Override the base URL where meshopt_decoder.js is hosted. */\nexport function setMeshoptBaseUrl(url: string): void {\n meshoptBaseUrl = url.endsWith(\"/\") ? url : url + \"/\";\n}\n\n/** Minimal surface of the global `MeshoptDecoder` object we rely on. */\ninterface MeshoptDecoderModule {\n ready: Promise<void>;\n decodeGltfBuffer(target: Uint8Array, count: number, size: number, source: Uint8Array, mode: string, filter?: string): void;\n}\n\nlet scriptLoadPromise: Promise<MeshoptDecoderModule> | null = null;\n\nfunction loadMeshoptScript(): Promise<MeshoptDecoderModule> {\n if (scriptLoadPromise) {\n return scriptLoadPromise;\n }\n scriptLoadPromise = new Promise<MeshoptDecoderModule>((resolve, reject) => {\n const existing = (globalThis as { MeshoptDecoder?: MeshoptDecoderModule }).MeshoptDecoder;\n if (existing) {\n resolve(existing);\n return;\n }\n const script = document.createElement(\"script\");\n script.src = meshoptBaseUrl + \"meshopt_decoder.js\";\n script.onload = () => {\n const mod = (globalThis as { MeshoptDecoder?: MeshoptDecoderModule }).MeshoptDecoder;\n if (!mod) {\n reject(new Error(\"meshopt_decoder.js loaded but MeshoptDecoder is undefined\"));\n } else {\n resolve(mod);\n }\n };\n script.onerror = () => reject(new Error(\"Failed to load meshopt_decoder.js from \" + script.src));\n document.head.appendChild(script);\n });\n return scriptLoadPromise;\n}\n\n/** Resolve the ready meshopt decoder module (WASM instantiated). */\nexport async function getMeshoptDecoder(): Promise<MeshoptDecoderModule> {\n const mod = await loadMeshoptScript();\n await mod.ready;\n return mod;\n}\n","/**\n * EXT_meshopt_compression feature.\n *\n * Runs as a `preParse` hook — before any accessor is read — so the core loader\n * and accessor reader stay unaware of meshopt. This module is only\n * dynamic-imported when the asset's `extensionsUsed` lists\n * EXT_meshopt_compression, which in turn loads the meshoptimizer decoder\n * (`meshopt-decode.ts`) lazily.\n *\n * EXT_meshopt_compression is a bufferView-level codec: each compressed\n * bufferView carries an extension object describing the compressed source\n * (`buffer`/`byteOffset`/`byteLength`), the decoded layout (`count`/`byteStride`)\n * and the codec (`mode`/`filter`). We decode every compressed bufferView, copy\n * through every uncompressed one, and pack the results into a single contiguous\n * binary chunk, rewriting `bufferViews` to point into it. Accessor byteOffsets\n * are bufferView-relative and the per-bufferView layout (count * byteStride) is\n * preserved, so the existing accessor reader resolves the decoded data\n * transparently.\n */\n\nimport { U8, DV } from \"../engine/typed-arrays.js\";\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport { getMeshoptDecoder } from \"./meshopt-decode.js\";\n\ninterface MeshoptExt {\n buffer: number;\n byteOffset?: number;\n byteLength: number;\n byteStride: number;\n count: number;\n mode: string;\n filter?: string;\n}\n\ninterface BufferView {\n buffer?: number;\n byteOffset?: number;\n byteLength: number;\n byteStride?: number;\n extensions?: { EXT_meshopt_compression?: MeshoptExt; [k: string]: unknown };\n}\n\n/** Round up to the next 4-byte boundary so relocated bufferViews stay aligned\n * for Float32Array / Uint16Array / Uint32Array views over the packed buffer. */\nfunction align4(n: number): number {\n return (n + 3) & ~3;\n}\n\nconst feature: GltfFeature = {\n id: \"EXT_meshopt_compression\",\n async preParse(json, binChunk) {\n const bufferViews: BufferView[] = json.bufferViews ?? [];\n const decoder = await getMeshoptDecoder();\n\n // Pass 1: materialize each bufferView (decode meshopt ones, copy the rest)\n // and compute the packed-buffer offset for each.\n const materialized: Uint8Array[] = new Array(bufferViews.length);\n const newOffsets: number[] = new Array(bufferViews.length);\n let total = 0;\n for (let i = 0; i < bufferViews.length; i++) {\n const bv = bufferViews[i]!;\n const ext = bv.extensions?.EXT_meshopt_compression;\n let bytes: Uint8Array;\n if (ext) {\n if ((ext.buffer ?? 0) !== 0) {\n throw new Error(`EXT_meshopt_compression: compressed source buffer ${ext.buffer} is not buffer 0 (unsupported)`);\n }\n const source = new U8(binChunk.buffer, binChunk.byteOffset + (ext.byteOffset ?? 0), ext.byteLength);\n const target = new U8(ext.count * ext.byteStride);\n decoder.decodeGltfBuffer(target, ext.count, ext.byteStride, source, ext.mode, ext.filter ?? \"NONE\");\n bytes = target;\n } else {\n if ((bv.buffer ?? 0) !== 0) {\n throw new Error(`EXT_meshopt_compression: uncompressed bufferView in buffer ${bv.buffer} is not buffer 0 (unsupported)`);\n }\n bytes = new U8(binChunk.buffer.slice(binChunk.byteOffset + (bv.byteOffset ?? 0), binChunk.byteOffset + (bv.byteOffset ?? 0) + bv.byteLength));\n }\n materialized[i] = bytes;\n newOffsets[i] = total;\n total = align4(total + bytes.length);\n }\n\n // Pass 2: pack into a single contiguous buffer and rewrite bufferViews.\n const packed = new U8(total);\n for (let i = 0; i < bufferViews.length; i++) {\n const bv = bufferViews[i]!;\n packed.set(materialized[i]!, newOffsets[i]!);\n bv.buffer = 0;\n bv.byteOffset = newOffsets[i]!;\n bv.byteLength = materialized[i]!.length;\n if (bv.extensions) {\n delete bv.extensions.EXT_meshopt_compression;\n }\n }\n\n return new DV(packed.buffer);\n },\n};\n\nexport default feature;\n"],"names":[],"mappings":";AAYA,IAAI,iBAAiB;AAarB,IAAI,oBAA0D;AAE9D,SAAS,oBAAmD;AACxD,MAAI,mBAAmB;AACnB,WAAO;AAAA,EACX;AACA,sBAAoB,IAAI,QAA8B,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,QAAQ,IAAI,UAAU;AAChD,gBAAQ,iBAAiB,QAAQ,IAAI,OAAO,IAAI,YAAY,QAAQ,IAAI,MAAM,IAAI,UAAU,MAAM;AAClG,gBAAQ;AAAA,MACZ,OAAO;AACH,aAAK,GAAG,UAAU,OAAO,GAAG;AACxB,gBAAM,IAAI,MAAM,8DAA8D,GAAG,MAAM,gCAAgC;AAAA,QAC3H;AACA,gBAAQ,IAAI,GAAG,SAAS,OAAO,MAAM,SAAS,cAAc,GAAG,cAAc,IAAI,SAAS,cAAc,GAAG,cAAc,KAAK,GAAG,UAAU,CAAC;AAAA,MAChJ;AACA,mBAAa,CAAC,IAAI;AAClB,iBAAW,CAAC,IAAI;AAChB,cAAQ,OAAO,QAAQ,MAAM,MAAM;AAAA,IACvC;AAGA,UAAM,SAAS,IAAI,GAAG,KAAK;AAC3B,aAAS,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;AACzC,YAAM,KAAK,YAAY,CAAC;AACxB,aAAO,IAAI,aAAa,CAAC,GAAI,WAAW,CAAC,CAAE;AAC3C,SAAG,SAAS;AACZ,SAAG,aAAa,WAAW,CAAC;AAC5B,SAAG,aAAa,aAAa,CAAC,EAAG;AACjC,UAAI,GAAG,YAAY;AACf,eAAO,GAAG,WAAW;AAAA,MACzB;AAAA,IACJ;AAEA,WAAO,IAAI,GAAG,OAAO,MAAM;AAAA,EAC/B;AACJ;"}
@@ -1,4 +1,4 @@
1
- import { r as resolveAccessor, a as F32 } from "./index-C-tEgwbZ.js";
1
+ import { r as resolveAccessor, a as F32 } from "./index-BgY3QEzL.js";
2
2
  const feature = {
3
3
  id: "_morph",
4
4
  async applyMesh(meshData, mesh, ctx) {
@@ -19,11 +19,11 @@ const feature = {
19
19
  }
20
20
  const parentMesh = json.meshes[json.nodes[meshData._nodeIndex].mesh];
21
21
  const morphWeights = parentMesh.weights ?? new Array(targets.length).fill(0);
22
- const { createMorphTargets } = await import("./index-C-tEgwbZ.js").then((n) => n.jB);
22
+ const { createMorphTargets } = await import("./index-BgY3QEzL.js").then((n) => n.k8);
23
23
  mesh.morphTargets = createMorphTargets(ctx._engine, morphTargets, meshData._vertexCount, morphWeights);
24
24
  }
25
25
  };
26
26
  export {
27
27
  feature as default
28
28
  };
29
- //# sourceMappingURL=gltf-feature-morph-DZydYgWp.js.map
29
+ //# sourceMappingURL=gltf-feature-morph-Cv0mEYIq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-morph-DZydYgWp.js","sources":["../src/loader-gltf/gltf-feature-morph.ts"],"sourcesContent":["/** Morph target feature. Extracts per-primitive morph targets lazily so the\n * core loader doesn't carry any morph-related code for non-morphed assets. */\n\nimport { F32 } from \"../engine/typed-arrays.js\";\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport { resolveAccessor } from \"./gltf-parser.js\";\n\nconst feature: GltfFeature = {\n id: \"_morph\",\n async applyMesh(meshData, mesh, ctx) {\n const primitive = meshData._primitive;\n const targets = primitive.targets;\n if (!targets || targets.length === 0) {\n return;\n }\n const { _json: json, _binChunk: binChunk } = ctx;\n const morphTargets: { positions: Float32Array; normals: Float32Array | null }[] = [];\n for (const target of targets) {\n const posAcc = target.POSITION !== undefined ? resolveAccessor(json, binChunk, target.POSITION) : null;\n const normAcc = target.NORMAL !== undefined ? resolveAccessor(json, binChunk, target.NORMAL) : null;\n morphTargets.push({\n positions: posAcc ? (posAcc._data as Float32Array) : new F32(meshData._vertexCount * 3),\n normals: normAcc ? (normAcc._data as Float32Array) : null,\n });\n }\n const parentMesh = json.meshes[json.nodes[meshData._nodeIndex].mesh];\n const morphWeights = parentMesh.weights ?? new Array(targets.length).fill(0);\n const { createMorphTargets } = await import(\"../morph/create-morph-targets.js\");\n mesh.morphTargets = createMorphTargets(ctx._engine, morphTargets, meshData._vertexCount, morphWeights);\n },\n};\nexport default feature;\n"],"names":[],"mappings":";AAOA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,UAAU,UAAU,MAAM,KAAK;AACjC,UAAM,YAAY,SAAS;AAC3B,UAAM,UAAU,UAAU;AAC1B,QAAI,CAAC,WAAW,QAAQ,WAAW,GAAG;AAClC;AAAA,IACJ;AACA,UAAM,EAAE,OAAO,MAAM,WAAW,aAAa;AAC7C,UAAM,eAA4E,CAAA;AAClF,eAAW,UAAU,SAAS;AAC1B,YAAM,SAAS,OAAO,aAAa,SAAY,gBAAgB,MAAM,UAAU,OAAO,QAAQ,IAAI;AAClG,YAAM,UAAU,OAAO,WAAW,SAAY,gBAAgB,MAAM,UAAU,OAAO,MAAM,IAAI;AAC/F,mBAAa,KAAK;AAAA,QACd,WAAW,SAAU,OAAO,QAAyB,IAAI,IAAI,SAAS,eAAe,CAAC;AAAA,QACtF,SAAS,UAAW,QAAQ,QAAyB;AAAA,MAAA,CACxD;AAAA,IACL;AACA,UAAM,aAAa,KAAK,OAAO,KAAK,MAAM,SAAS,UAAU,EAAE,IAAI;AACnE,UAAM,eAAe,WAAW,WAAW,IAAI,MAAM,QAAQ,MAAM,EAAE,KAAK,CAAC;AAC3E,UAAM,EAAE,mBAAA,IAAuB,MAAM,OAAO,qBAAkC,EAAA,KAAA,OAAA,EAAA,EAAA;AAC9E,SAAK,eAAe,mBAAmB,IAAI,SAAS,cAAc,SAAS,cAAc,YAAY;AAAA,EACzG;AACJ;"}
1
+ {"version":3,"file":"gltf-feature-morph-Cv0mEYIq.js","sources":["../src/loader-gltf/gltf-feature-morph.ts"],"sourcesContent":["/** Morph target feature. Extracts per-primitive morph targets lazily so the\n * core loader doesn't carry any morph-related code for non-morphed assets. */\n\nimport { F32 } from \"../engine/typed-arrays.js\";\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport { resolveAccessor } from \"./gltf-parser.js\";\n\nconst feature: GltfFeature = {\n id: \"_morph\",\n async applyMesh(meshData, mesh, ctx) {\n const primitive = meshData._primitive;\n const targets = primitive.targets;\n if (!targets || targets.length === 0) {\n return;\n }\n const { _json: json, _binChunk: binChunk } = ctx;\n const morphTargets: { positions: Float32Array; normals: Float32Array | null }[] = [];\n for (const target of targets) {\n const posAcc = target.POSITION !== undefined ? resolveAccessor(json, binChunk, target.POSITION) : null;\n const normAcc = target.NORMAL !== undefined ? resolveAccessor(json, binChunk, target.NORMAL) : null;\n morphTargets.push({\n positions: posAcc ? (posAcc._data as Float32Array) : new F32(meshData._vertexCount * 3),\n normals: normAcc ? (normAcc._data as Float32Array) : null,\n });\n }\n const parentMesh = json.meshes[json.nodes[meshData._nodeIndex].mesh];\n const morphWeights = parentMesh.weights ?? new Array(targets.length).fill(0);\n const { createMorphTargets } = await import(\"../morph/create-morph-targets.js\");\n mesh.morphTargets = createMorphTargets(ctx._engine, morphTargets, meshData._vertexCount, morphWeights);\n },\n};\nexport default feature;\n"],"names":[],"mappings":";AAOA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,UAAU,UAAU,MAAM,KAAK;AACjC,UAAM,YAAY,SAAS;AAC3B,UAAM,UAAU,UAAU;AAC1B,QAAI,CAAC,WAAW,QAAQ,WAAW,GAAG;AAClC;AAAA,IACJ;AACA,UAAM,EAAE,OAAO,MAAM,WAAW,aAAa;AAC7C,UAAM,eAA4E,CAAA;AAClF,eAAW,UAAU,SAAS;AAC1B,YAAM,SAAS,OAAO,aAAa,SAAY,gBAAgB,MAAM,UAAU,OAAO,QAAQ,IAAI;AAClG,YAAM,UAAU,OAAO,WAAW,SAAY,gBAAgB,MAAM,UAAU,OAAO,MAAM,IAAI;AAC/F,mBAAa,KAAK;AAAA,QACd,WAAW,SAAU,OAAO,QAAyB,IAAI,IAAI,SAAS,eAAe,CAAC;AAAA,QACtF,SAAS,UAAW,QAAQ,QAAyB;AAAA,MAAA,CACxD;AAAA,IACL;AACA,UAAM,aAAa,KAAK,OAAO,KAAK,MAAM,SAAS,UAAU,EAAE,IAAI;AACnE,UAAM,eAAe,WAAW,WAAW,IAAI,MAAM,QAAQ,MAAM,EAAE,KAAK,CAAC;AAC3E,UAAM,EAAE,mBAAA,IAAuB,MAAM,OAAO,qBAAkC,EAAA,KAAA,OAAA,EAAA,EAAA;AAC9E,SAAK,eAAe,mBAAmB,IAAI,SAAS,cAAc,SAAS,cAAc,YAAY;AAAA,EACzG;AACJ;"}
@@ -1,12 +1,12 @@
1
- import { n as needsOrmComposite, l as anyPrimitive } from "./index-C-tEgwbZ.js";
1
+ import { n as needsOrmComposite, l as anyPrimitive } from "./index-BgY3QEzL.js";
2
2
  const M = "KHR_materials_";
3
3
  const _features = [
4
4
  // Pre-parse features (buffer-level): order matters — meshopt decompresses
5
5
  // bufferViews first, then quantization dequantizes the resulting accessors.
6
- ["EXT_meshopt_compression", () => import("./gltf-feature-meshopt-DRG9hEqT.js")],
7
- ["KHR_mesh_quantization", () => import("./gltf-ext-quantization-DheC7FhB.js")],
6
+ ["EXT_meshopt_compression", () => import("./gltf-feature-meshopt-DItMkOMt.js")],
7
+ ["KHR_mesh_quantization", () => import("./gltf-ext-quantization-DaymajCR.js")],
8
8
  // Pre-mesh features (geometry decompression)
9
- ["KHR_draco_mesh_compression", () => import("./gltf-feature-draco-B7Q_cMUv.js")],
9
+ ["KHR_draco_mesh_compression", () => import("./gltf-feature-draco-CljWrsna.js")],
10
10
  // Material extensions
11
11
  [M + "clearcoat", () => import("./gltf-ext-clearcoat-CLH2SVph.js")],
12
12
  [M + "iridescence", () => import("./gltf-ext-iridescence-C6bq7jiM.js")],
@@ -21,8 +21,8 @@ const _features = [
21
21
  var _a;
22
22
  return (_a = j.extensionsUsed) == null ? void 0 : _a.includes(M + e);
23
23
  }), () => import("./gltf-ext-dielectric-qHzlnvdl.js")],
24
- ["KHR_texture_transform", () => import("./gltf-ext-uv-transform-DljdVllE.js")],
25
- ["KHR_texture_basisu", () => import("./gltf-ext-basisu-C5teqxzQ.js")],
24
+ ["KHR_texture_transform", () => import("./gltf-ext-uv-transform-DFmNJ8kA.js")],
25
+ ["KHR_texture_basisu", () => import("./gltf-ext-basisu-DtzVV1Xx.js")],
26
26
  [needsOrmComposite, () => import("./gltf-ext-orm-CT18G_vQ.js")],
27
27
  // Per-mesh features (predicates inlined to avoid eager imports)
28
28
  [(j) => {
@@ -31,21 +31,21 @@ const _features = [
31
31
  var _a2;
32
32
  return ((_a2 = p.attributes) == null ? void 0 : _a2.JOINTS_0) !== void 0;
33
33
  });
34
- }, () => import("./gltf-feature-skeleton-B9och1W0.js")],
34
+ }, () => import("./gltf-feature-skeleton-Deh2UBAn.js")],
35
35
  [(j) => anyPrimitive(j, (p) => {
36
36
  var _a;
37
37
  return !!((_a = p.targets) == null ? void 0 : _a.length);
38
- }), () => import("./gltf-feature-morph-DZydYgWp.js")],
38
+ }), () => import("./gltf-feature-morph-Cv0mEYIq.js")],
39
39
  // Per-asset features
40
- ["KHR_lights_punctual", () => import("./gltf-feature-lights-punctual-DF7kya14.js")],
40
+ ["KHR_lights_punctual", () => import("./gltf-feature-lights-punctual-BCTwgyi_.js")],
41
41
  [(j) => {
42
42
  var _a;
43
43
  return !!((_a = j.animations) == null ? void 0 : _a.length);
44
- }, () => import("./gltf-feature-animations-hxC3y3bJ.js")],
45
- [M + "variants", () => import("./gltf-feature-variants-CY_Qft7f.js")],
46
- ["KHR_node_visibility", () => import("./gltf-ext-node-visibility-DnGTKkMf.js")],
47
- ["KHR_animation_pointer", () => import("./gltf-feature-animation-pointer-DVhymFLK.js")],
48
- ["EXT_mesh_gpu_instancing", () => import("./gltf-feature-gpu-instancing-C7sRzWv7.js")],
44
+ }, () => import("./gltf-feature-animations-v0S_yb4T.js")],
45
+ [M + "variants", () => import("./gltf-feature-variants-DGSdFNJq.js")],
46
+ ["KHR_node_visibility", () => import("./gltf-ext-node-visibility-BhX0DmiP.js")],
47
+ ["KHR_animation_pointer", () => import("./gltf-feature-animation-pointer-C40tqOhL.js")],
48
+ ["EXT_mesh_gpu_instancing", () => import("./gltf-feature-gpu-instancing-BoeSm6Tn.js")],
49
49
  ["KHR_xmp_json_ld", () => import("./gltf-feature-xmp-BUfq_IVG.js")]
50
50
  ];
51
51
  async function loadGltfFeatures(json) {
@@ -56,4 +56,4 @@ async function loadGltfFeatures(json) {
56
56
  export {
57
57
  loadGltfFeatures
58
58
  };
59
- //# sourceMappingURL=gltf-feature-registry-DeYdy3DV.js.map
59
+ //# sourceMappingURL=gltf-feature-registry-wNbt6UC-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-registry-DeYdy3DV.js","sources":["../src/loader-gltf/gltf-feature-registry.ts"],"sourcesContent":["/**\n * glTF optional-feature registry.\n *\n * The `_features` table maps every optional glTF capability to a `[trigger, load]`\n * pair: a cheap trigger plus a dynamic `import()` of the feature's `GltfFeature`\n * module. A trigger is either an exact `extensionsUsed` name (the common case) or\n * a predicate over the parsed JSON for features that aren't a simple extension\n * membership (ORM compositing, skeletons, morph targets, animations, dielectric\n * material cluster).\n *\n * This whole module is itself dynamically imported by the core loader\n * (`load-gltf.ts`) ONLY when the asset can possibly trigger at least one feature\n * — so assets that use no optional features (plain metallic-roughness GLBs) never\n * pay for the table or its import thunks.\n *\n * The core loader knows zero feature names; new extensions are added here alone.\n */\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport { anyPrimitive, needsOrmComposite } from \"./gltf-parser.js\";\n\n/** Dynamic `import()` of a feature's `GltfFeature` module. */\ntype Loader = () => Promise<{ default: GltfFeature }>;\n/** Either an exact `extensionsUsed` name, or a predicate over the parsed JSON. */\ntype Trigger = string | ((json: any) => boolean);\n\nconst M = \"KHR_materials_\";\n\nconst _features: [Trigger, Loader][] = [\n // Pre-parse features (buffer-level): order matters — meshopt decompresses\n // bufferViews first, then quantization dequantizes the resulting accessors.\n [\"EXT_meshopt_compression\", () => import(\"./gltf-feature-meshopt.js\")],\n [\"KHR_mesh_quantization\", () => import(\"./gltf-ext-quantization.js\")],\n // Pre-mesh features (geometry decompression)\n [\"KHR_draco_mesh_compression\", () => import(\"./gltf-feature-draco.js\")],\n // Material extensions\n [M + \"clearcoat\", () => import(\"./gltf-ext-clearcoat.js\")],\n [M + \"iridescence\", () => import(\"./gltf-ext-iridescence.js\")],\n [M + \"emissive_strength\", () => import(\"./gltf-ext-emissive-strength.js\")],\n [M + \"sheen\", () => import(\"./gltf-ext-sheen.js\")],\n [M + \"anisotropy\", () => import(\"./gltf-ext-anisotropy.js\")],\n [M + \"unlit\", () => import(\"./gltf-ext-unlit.js\")],\n [M + \"pbrSpecularGlossiness\", () => import(\"./gltf-ext-spec-gloss.js\")],\n // Dielectric cluster (ior/specular/transmission/volume/dispersion) — any of the five triggers the\n // loader; transmission refraction is wired dynamically by the PBR material path when needed.\n [(j) => [\"transmission\", \"volume\", \"ior\", \"specular\", \"dispersion\"].some((e) => j.extensionsUsed?.includes(M + e)), () => import(\"./gltf-ext-dielectric.js\")],\n [\"KHR_texture_transform\", () => import(\"./gltf-ext-uv-transform.js\")],\n [\"KHR_texture_basisu\", () => import(\"./gltf-ext-basisu.js\")],\n [needsOrmComposite, () => import(\"./gltf-ext-orm.js\")],\n // Per-mesh features (predicates inlined to avoid eager imports)\n [(j) => !!j.skins?.length && anyPrimitive(j, (p) => p.attributes?.JOINTS_0 !== undefined), () => import(\"./gltf-feature-skeleton.js\")],\n [(j) => anyPrimitive(j, (p) => !!p.targets?.length), () => import(\"./gltf-feature-morph.js\")],\n // Per-asset features\n [\"KHR_lights_punctual\", () => import(\"./gltf-feature-lights-punctual.js\")],\n [(j) => !!j.animations?.length, () => import(\"./gltf-feature-animations.js\")],\n [M + \"variants\", () => import(\"./gltf-feature-variants.js\")],\n [\"KHR_node_visibility\", () => import(\"./gltf-ext-node-visibility.js\")],\n [\"KHR_animation_pointer\", () => import(\"./gltf-feature-animation-pointer.js\")],\n [\"EXT_mesh_gpu_instancing\", () => import(\"./gltf-feature-gpu-instancing.js\")],\n [\"KHR_xmp_json_ld\", () => import(\"./gltf-feature-xmp.js\")],\n];\n\n/** Dynamic-import every feature the asset triggers. */\nexport async function loadGltfFeatures(json: any): Promise<GltfFeature[]> {\n const used: string[] = json.extensionsUsed ?? [];\n const mods = await Promise.all(_features.flatMap(([t, load]) => ((typeof t === \"string\" ? used.includes(t) : t(json)) ? [load()] : [])));\n return mods.map((m) => m.default);\n}\n"],"names":["_a"],"mappings":";AAyBA,MAAM,IAAI;AAEV,MAAM,YAAiC;AAAA;AAAA;AAAA,EAGnC,CAAC,2BAA2B,MAAM,OAAO,oCAA2B,CAAC;AAAA,EACrE,CAAC,yBAAyB,MAAM,OAAO,qCAA4B,CAAC;AAAA;AAAA,EAEpE,CAAC,8BAA8B,MAAM,OAAO,kCAAyB,CAAC;AAAA;AAAA,EAEtE,CAAC,IAAI,aAAa,MAAM,OAAO,kCAAyB,CAAC;AAAA,EACzD,CAAC,IAAI,eAAe,MAAM,OAAO,oCAA2B,CAAC;AAAA,EAC7D,CAAC,IAAI,qBAAqB,MAAM,OAAO,0CAAiC,CAAC;AAAA,EACzE,CAAC,IAAI,SAAS,MAAM,OAAO,8BAAqB,CAAC;AAAA,EACjD,CAAC,IAAI,cAAc,MAAM,OAAO,mCAA0B,CAAC;AAAA,EAC3D,CAAC,IAAI,SAAS,MAAM,OAAO,8BAAqB,CAAC;AAAA,EACjD,CAAC,IAAI,yBAAyB,MAAM,OAAO,mCAA0B,CAAC;AAAA;AAAA;AAAA,EAGtE,CAAC,CAAC,MAAM,CAAC,gBAAgB,UAAU,OAAO,YAAY,YAAY,EAAE,KAAK,CAAC;;AAAM,mBAAE,mBAAF,mBAAkB,SAAS,IAAI;AAAA,GAAE,GAAG,MAAM,OAAO,mCAA0B,CAAC;AAAA,EAC5J,CAAC,yBAAyB,MAAM,OAAO,qCAA4B,CAAC;AAAA,EACpE,CAAC,sBAAsB,MAAM,OAAO,+BAAsB,CAAC;AAAA,EAC3D,CAAC,mBAAmB,MAAM,OAAO,4BAAmB,CAAC;AAAA;AAAA,EAErD,CAAC,CAAC,MAAA;;AAAM,YAAC,GAAC,OAAE,UAAF,mBAAS,WAAU,aAAa,GAAG,CAAC,MAAA;;AAAM,eAAAA,MAAA,EAAE,eAAF,gBAAAA,IAAc,cAAa;AAAA,KAAS;AAAA,KAAG,MAAM,OAAO,qCAA4B,CAAC;AAAA,EACrI,CAAC,CAAC,MAAM,aAAa,GAAG,CAAC,MAAA;;AAAM,YAAC,GAAC,OAAE,YAAF,mBAAW;AAAA,GAAM,GAAG,MAAM,OAAO,kCAAyB,CAAC;AAAA;AAAA,EAE5F,CAAC,uBAAuB,MAAM,OAAO,4CAAmC,CAAC;AAAA,EACzE,CAAC,CAAC,MAAA;;AAAM,YAAC,GAAC,OAAE,eAAF,mBAAc;AAAA,KAAQ,MAAM,OAAO,uCAA8B,CAAC;AAAA,EAC5E,CAAC,IAAI,YAAY,MAAM,OAAO,qCAA4B,CAAC;AAAA,EAC3D,CAAC,uBAAuB,MAAM,OAAO,wCAA+B,CAAC;AAAA,EACrE,CAAC,yBAAyB,MAAM,OAAO,8CAAqC,CAAC;AAAA,EAC7E,CAAC,2BAA2B,MAAM,OAAO,2CAAkC,CAAC;AAAA,EAC5E,CAAC,mBAAmB,MAAM,OAAO,gCAAuB,CAAC;AAC7D;AAGA,eAAsB,iBAAiB,MAAmC;AACtE,QAAM,OAAiB,KAAK,kBAAkB,CAAA;AAC9C,QAAM,OAAO,MAAM,QAAQ,IAAI,UAAU,QAAQ,CAAC,CAAC,GAAG,IAAI,OAAQ,OAAO,MAAM,WAAW,KAAK,SAAS,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,KAAA,CAAM,IAAI,CAAA,CAAG,CAAC;AACvI,SAAO,KAAK,IAAI,CAAC,MAAM,EAAE,OAAO;AACpC;"}
1
+ {"version":3,"file":"gltf-feature-registry-wNbt6UC-.js","sources":["../src/loader-gltf/gltf-feature-registry.ts"],"sourcesContent":["/**\n * glTF optional-feature registry.\n *\n * The `_features` table maps every optional glTF capability to a `[trigger, load]`\n * pair: a cheap trigger plus a dynamic `import()` of the feature's `GltfFeature`\n * module. A trigger is either an exact `extensionsUsed` name (the common case) or\n * a predicate over the parsed JSON for features that aren't a simple extension\n * membership (ORM compositing, skeletons, morph targets, animations, dielectric\n * material cluster).\n *\n * This whole module is itself dynamically imported by the core loader\n * (`load-gltf.ts`) ONLY when the asset can possibly trigger at least one feature\n * — so assets that use no optional features (plain metallic-roughness GLBs) never\n * pay for the table or its import thunks.\n *\n * The core loader knows zero feature names; new extensions are added here alone.\n */\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport { anyPrimitive, needsOrmComposite } from \"./gltf-parser.js\";\n\n/** Dynamic `import()` of a feature's `GltfFeature` module. */\ntype Loader = () => Promise<{ default: GltfFeature }>;\n/** Either an exact `extensionsUsed` name, or a predicate over the parsed JSON. */\ntype Trigger = string | ((json: any) => boolean);\n\nconst M = \"KHR_materials_\";\n\nconst _features: [Trigger, Loader][] = [\n // Pre-parse features (buffer-level): order matters — meshopt decompresses\n // bufferViews first, then quantization dequantizes the resulting accessors.\n [\"EXT_meshopt_compression\", () => import(\"./gltf-feature-meshopt.js\")],\n [\"KHR_mesh_quantization\", () => import(\"./gltf-ext-quantization.js\")],\n // Pre-mesh features (geometry decompression)\n [\"KHR_draco_mesh_compression\", () => import(\"./gltf-feature-draco.js\")],\n // Material extensions\n [M + \"clearcoat\", () => import(\"./gltf-ext-clearcoat.js\")],\n [M + \"iridescence\", () => import(\"./gltf-ext-iridescence.js\")],\n [M + \"emissive_strength\", () => import(\"./gltf-ext-emissive-strength.js\")],\n [M + \"sheen\", () => import(\"./gltf-ext-sheen.js\")],\n [M + \"anisotropy\", () => import(\"./gltf-ext-anisotropy.js\")],\n [M + \"unlit\", () => import(\"./gltf-ext-unlit.js\")],\n [M + \"pbrSpecularGlossiness\", () => import(\"./gltf-ext-spec-gloss.js\")],\n // Dielectric cluster (ior/specular/transmission/volume/dispersion) — any of the five triggers the\n // loader; transmission refraction is wired dynamically by the PBR material path when needed.\n [(j) => [\"transmission\", \"volume\", \"ior\", \"specular\", \"dispersion\"].some((e) => j.extensionsUsed?.includes(M + e)), () => import(\"./gltf-ext-dielectric.js\")],\n [\"KHR_texture_transform\", () => import(\"./gltf-ext-uv-transform.js\")],\n [\"KHR_texture_basisu\", () => import(\"./gltf-ext-basisu.js\")],\n [needsOrmComposite, () => import(\"./gltf-ext-orm.js\")],\n // Per-mesh features (predicates inlined to avoid eager imports)\n [(j) => !!j.skins?.length && anyPrimitive(j, (p) => p.attributes?.JOINTS_0 !== undefined), () => import(\"./gltf-feature-skeleton.js\")],\n [(j) => anyPrimitive(j, (p) => !!p.targets?.length), () => import(\"./gltf-feature-morph.js\")],\n // Per-asset features\n [\"KHR_lights_punctual\", () => import(\"./gltf-feature-lights-punctual.js\")],\n [(j) => !!j.animations?.length, () => import(\"./gltf-feature-animations.js\")],\n [M + \"variants\", () => import(\"./gltf-feature-variants.js\")],\n [\"KHR_node_visibility\", () => import(\"./gltf-ext-node-visibility.js\")],\n [\"KHR_animation_pointer\", () => import(\"./gltf-feature-animation-pointer.js\")],\n [\"EXT_mesh_gpu_instancing\", () => import(\"./gltf-feature-gpu-instancing.js\")],\n [\"KHR_xmp_json_ld\", () => import(\"./gltf-feature-xmp.js\")],\n];\n\n/** Dynamic-import every feature the asset triggers. */\nexport async function loadGltfFeatures(json: any): Promise<GltfFeature[]> {\n const used: string[] = json.extensionsUsed ?? [];\n const mods = await Promise.all(_features.flatMap(([t, load]) => ((typeof t === \"string\" ? used.includes(t) : t(json)) ? [load()] : [])));\n return mods.map((m) => m.default);\n}\n"],"names":["_a"],"mappings":";AAyBA,MAAM,IAAI;AAEV,MAAM,YAAiC;AAAA;AAAA;AAAA,EAGnC,CAAC,2BAA2B,MAAM,OAAO,oCAA2B,CAAC;AAAA,EACrE,CAAC,yBAAyB,MAAM,OAAO,qCAA4B,CAAC;AAAA;AAAA,EAEpE,CAAC,8BAA8B,MAAM,OAAO,kCAAyB,CAAC;AAAA;AAAA,EAEtE,CAAC,IAAI,aAAa,MAAM,OAAO,kCAAyB,CAAC;AAAA,EACzD,CAAC,IAAI,eAAe,MAAM,OAAO,oCAA2B,CAAC;AAAA,EAC7D,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AO,wCAA+B,CAAC;AAAA,EACrE,CAAC,yBAAyB,MAAM,OAAO,8CAAqC,CAAC;AAAA,EAC7E,CAAC,2BAA2B,MAAM,OAAO,2CAAkC,CAAC;AAAA,EAC5E,CAAC,mBAAmB,MAAM,OAAO,gCAAuB,CAAC;AAC7D;AAGA,eAAsB,iBAAiB,MAAmC;AACtE,QAAM,OAAiB,KAAK,kBAAkB,CAAA;AAC9C,QAAM,OAAO,MAAM,QAAQ,IAAI,UAAU,QAAQ,CAAC,CAAC,GAAG,IAAI,OAAQ,OAAO,MAAM,WAAW,KAAK,SAAS,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,KAAA,CAAM,IAAI,CAAA,CAAG,CAAC;AACvI,SAAO,KAAK,IAAI,CAAC,MAAM,EAAE,OAAO;AACpC;"}
@@ -1,4 +1,4 @@
1
- import { r as resolveAccessor } from "./index-C-tEgwbZ.js";
1
+ import { r as resolveAccessor } from "./index-BgY3QEzL.js";
2
2
  function resolveAttr(name, primitive, decoded, json, binChunk) {
3
3
  var _a;
4
4
  if (decoded && decoded._attributes.has(name)) {
@@ -24,7 +24,7 @@ const feature = {
24
24
  }
25
25
  const joints1 = resolveAttr("JOINTS_1", primitive, decoded, json, binChunk);
26
26
  const weights1 = resolveAttr("WEIGHTS_1", primitive, decoded, json, binChunk);
27
- const [{ extractSkin, computeBoneTextureData }, { createSkeleton }] = await Promise.all([import("./gltf-animation-Bq7k_5HA.js"), import("./create-skeleton-9tdiUjRP.js")]);
27
+ const [{ extractSkin, computeBoneTextureData }, { createSkeleton }] = await Promise.all([import("./gltf-animation-BjnXkop6.js"), import("./create-skeleton-s0hjrC3A.js")]);
28
28
  const skin = extractSkin(json, binChunk, node.skin, meshData._worldMatrix, parentMap, worldMatrixCache);
29
29
  const boneData = computeBoneTextureData(skin);
30
30
  mesh.skeleton = createSkeleton(ctx._engine, joints, weights, skin.jointNodes.length, boneData, joints1, weights1);
@@ -33,4 +33,4 @@ const feature = {
33
33
  export {
34
34
  feature as default
35
35
  };
36
- //# sourceMappingURL=gltf-feature-skeleton-B9och1W0.js.map
36
+ //# sourceMappingURL=gltf-feature-skeleton-Deh2UBAn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-skeleton-B9och1W0.js","sources":["../src/loader-gltf/gltf-feature-skeleton.ts"],"sourcesContent":["/** Skeletal animation feature. Extracts joints/weights/skin on demand so the\n * core loader doesn't carry any skinning-related code for non-skinned assets. */\n\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport { resolveAccessor } from \"./gltf-parser.js\";\n\n/** Resolve a vertex attribute by name, preferring any pre-decoded\n * (e.g. Draco) data over the raw accessor. */\nfunction resolveAttr(name: string, primitive: any, decoded: any, json: any, binChunk: DataView): ArrayBufferView | null {\n if (decoded && decoded._attributes.has(name)) {\n return decoded._attributes.get(name)!;\n }\n const idx = primitive.attributes?.[name];\n return idx !== undefined ? (resolveAccessor(json, binChunk, idx)._data as ArrayBufferView) : null;\n}\n\nconst feature: GltfFeature = {\n id: \"_skeleton\",\n async applyMesh(meshData, mesh, ctx) {\n const { _json: json, _binChunk: binChunk, _parentMap: parentMap, _worldMatrixCache: worldMatrixCache } = ctx;\n const node = json.nodes[meshData._nodeIndex];\n if (node.skin === undefined || !json.skins) {\n return;\n }\n const primitive = meshData._primitive;\n const decoded = meshData._decoded;\n const joints = resolveAttr(\"JOINTS_0\", primitive, decoded, json, binChunk) as Uint16Array | Uint8Array | null;\n const weights = resolveAttr(\"WEIGHTS_0\", primitive, decoded, json, binChunk) as Float32Array | null;\n if (!joints || !weights) {\n return;\n }\n const joints1 = resolveAttr(\"JOINTS_1\", primitive, decoded, json, binChunk) as Uint16Array | Uint8Array | null;\n const weights1 = resolveAttr(\"WEIGHTS_1\", primitive, decoded, json, binChunk) as Float32Array | null;\n\n const [{ extractSkin, computeBoneTextureData }, { createSkeleton }] = await Promise.all([import(\"./gltf-animation.js\"), import(\"../skeleton/create-skeleton.js\")]);\n const skin = extractSkin(json, binChunk, node.skin, meshData._worldMatrix, parentMap, worldMatrixCache);\n const boneData = computeBoneTextureData(skin);\n mesh.skeleton = createSkeleton(ctx._engine, joints, weights, skin.jointNodes.length, boneData, joints1, weights1);\n },\n};\nexport default feature;\n"],"names":[],"mappings":";AAQA,SAAS,YAAY,MAAc,WAAgB,SAAc,MAAW,UAA4C;;AACpH,MAAI,WAAW,QAAQ,YAAY,IAAI,IAAI,GAAG;AAC1C,WAAO,QAAQ,YAAY,IAAI,IAAI;AAAA,EACvC;AACA,QAAM,OAAM,eAAU,eAAV,mBAAuB;AACnC,SAAO,QAAQ,SAAa,gBAAgB,MAAM,UAAU,GAAG,EAAE,QAA4B;AACjG;AAEA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,UAAU,UAAU,MAAM,KAAK;AACjC,UAAM,EAAE,OAAO,MAAM,WAAW,UAAU,YAAY,WAAW,mBAAmB,iBAAA,IAAqB;AACzG,UAAM,OAAO,KAAK,MAAM,SAAS,UAAU;AAC3C,QAAI,KAAK,SAAS,UAAa,CAAC,KAAK,OAAO;AACxC;AAAA,IACJ;AACA,UAAM,YAAY,SAAS;AAC3B,UAAM,UAAU,SAAS;AACzB,UAAM,SAAS,YAAY,YAAY,WAAW,SAAS,MAAM,QAAQ;AACzE,UAAM,UAAU,YAAY,aAAa,WAAW,SAAS,MAAM,QAAQ;AAC3E,QAAI,CAAC,UAAU,CAAC,SAAS;AACrB;AAAA,IACJ;AACA,UAAM,UAAU,YAAY,YAAY,WAAW,SAAS,MAAM,QAAQ;AAC1E,UAAM,WAAW,YAAY,aAAa,WAAW,SAAS,MAAM,QAAQ;AAE5E,UAAM,CAAC,EAAE,aAAa,0BAA0B,EAAE,gBAAgB,IAAI,MAAM,QAAQ,IAAI,CAAC,OAAO,8BAAqB,GAAG,OAAO,+BAAgC,CAAC,CAAC;AACjK,UAAM,OAAO,YAAY,MAAM,UAAU,KAAK,MAAM,SAAS,cAAc,WAAW,gBAAgB;AACtG,UAAM,WAAW,uBAAuB,IAAI;AAC5C,SAAK,WAAW,eAAe,IAAI,SAAS,QAAQ,SAAS,KAAK,WAAW,QAAQ,UAAU,SAAS,QAAQ;AAAA,EACpH;AACJ;"}
1
+ {"version":3,"file":"gltf-feature-skeleton-Deh2UBAn.js","sources":["../src/loader-gltf/gltf-feature-skeleton.ts"],"sourcesContent":["/** Skeletal animation feature. Extracts joints/weights/skin on demand so the\n * core loader doesn't carry any skinning-related code for non-skinned assets. */\n\nimport type { GltfFeature } from \"./gltf-feature.js\";\nimport { resolveAccessor } from \"./gltf-parser.js\";\n\n/** Resolve a vertex attribute by name, preferring any pre-decoded\n * (e.g. Draco) data over the raw accessor. */\nfunction resolveAttr(name: string, primitive: any, decoded: any, json: any, binChunk: DataView): ArrayBufferView | null {\n if (decoded && decoded._attributes.has(name)) {\n return decoded._attributes.get(name)!;\n }\n const idx = primitive.attributes?.[name];\n return idx !== undefined ? (resolveAccessor(json, binChunk, idx)._data as ArrayBufferView) : null;\n}\n\nconst feature: GltfFeature = {\n id: \"_skeleton\",\n async applyMesh(meshData, mesh, ctx) {\n const { _json: json, _binChunk: binChunk, _parentMap: parentMap, _worldMatrixCache: worldMatrixCache } = ctx;\n const node = json.nodes[meshData._nodeIndex];\n if (node.skin === undefined || !json.skins) {\n return;\n }\n const primitive = meshData._primitive;\n const decoded = meshData._decoded;\n const joints = resolveAttr(\"JOINTS_0\", primitive, decoded, json, binChunk) as Uint16Array | Uint8Array | null;\n const weights = resolveAttr(\"WEIGHTS_0\", primitive, decoded, json, binChunk) as Float32Array | null;\n if (!joints || !weights) {\n return;\n }\n const joints1 = resolveAttr(\"JOINTS_1\", primitive, decoded, json, binChunk) as Uint16Array | Uint8Array | null;\n const weights1 = resolveAttr(\"WEIGHTS_1\", primitive, decoded, json, binChunk) as Float32Array | null;\n\n const [{ extractSkin, computeBoneTextureData }, { createSkeleton }] = await Promise.all([import(\"./gltf-animation.js\"), import(\"../skeleton/create-skeleton.js\")]);\n const skin = extractSkin(json, binChunk, node.skin, meshData._worldMatrix, parentMap, worldMatrixCache);\n const boneData = computeBoneTextureData(skin);\n mesh.skeleton = createSkeleton(ctx._engine, joints, weights, skin.jointNodes.length, boneData, joints1, weights1);\n },\n};\nexport default feature;\n"],"names":[],"mappings":";AAQA,SAAS,YAAY,MAAc,WAAgB,SAAc,MAAW,UAA4C;;AACpH,MAAI,WAAW,QAAQ,YAAY,IAAI,IAAI,GAAG;AAC1C,WAAO,QAAQ,YAAY,IAAI,IAAI;AAAA,EACvC;AACA,QAAM,OAAM,eAAU,eAAV,mBAAuB;AACnC,SAAO,QAAQ,SAAa,gBAAgB,MAAM,UAAU,GAAG,EAAE,QAA4B;AACjG;AAEA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,UAAU,UAAU,MAAM,KAAK;AACjC,UAAM,EAAE,OAAO,MAAM,WAAW,UAAU,YAAY,WAAW,mBAAmB,iBAAA,IAAqB;AACzG,UAAM,OAAO,KAAK,MAAM,SAAS,UAAU;AAC3C,QAAI,KAAK,SAAS,UAAa,CAAC,KAAK,OAAO;AACxC;AAAA,IACJ;AACA,UAAM,YAAY,SAAS;AAC3B,UAAM,UAAU,SAAS;AACzB,UAAM,SAAS,YAAY,YAAY,WAAW,SAAS,MAAM,QAAQ;AACzE,UAAM,UAAU,YAAY,aAAa,WAAW,SAAS,MAAM,QAAQ;AAC3E,QAAI,CAAC,UAAU,CAAC,SAAS;AACrB;AAAA,IACJ;AACA,UAAM,UAAU,YAAY,YAAY,WAAW,SAAS,MAAM,QAAQ;AAC1E,UAAM,WAAW,YAAY,aAAa,WAAW,SAAS,MAAM,QAAQ;AAE5E,UAAM,CAAC,EAAE,aAAa,0BAA0B,EAAE,gBAAgB,IAAI,MAAM,QAAQ,IAAI,CAAC,OAAO,8BAAqB,GAAG,OAAO,+BAAgC,CAAC,CAAC;AACjK,UAAM,OAAO,YAAY,MAAM,UAAU,KAAK,MAAM,SAAS,cAAc,WAAW,gBAAgB;AACtG,UAAM,WAAW,uBAAuB,IAAI;AAC5C,SAAK,WAAW,eAAe,IAAI,SAAS,QAAQ,SAAS,KAAK,WAAW,QAAQ,UAAU,SAAS,QAAQ;AAAA,EACpH;AACJ;"}
@@ -6,7 +6,7 @@ const feature = {
6
6
  if (!(variantNames == null ? void 0 : variantNames.length)) {
7
7
  return {};
8
8
  }
9
- const { loadVariantMaterials } = await import("./gltf-variants-CUvzYGYX.js");
9
+ const { loadVariantMaterials } = await import("./gltf-variants-Dyr54wwg.js");
10
10
  const materialVariants = await loadVariantMaterials(ctx._json, ctx._binChunk, ctx._baseUrl, variantNames, meshes, ctx._engine, ctx._matExts, ctx._wrapTex);
11
11
  return { materialVariants };
12
12
  }
@@ -14,4 +14,4 @@ const feature = {
14
14
  export {
15
15
  feature as default
16
16
  };
17
- //# sourceMappingURL=gltf-feature-variants-CY_Qft7f.js.map
17
+ //# sourceMappingURL=gltf-feature-variants-DGSdFNJq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-feature-variants-CY_Qft7f.js","sources":["../src/loader-gltf/gltf-feature-variants.ts"],"sourcesContent":["/** KHR_materials_variants feature.\n * Triggered when the root extension carries variant definitions. Per-asset\n * hook builds variant material data shared with the material-ext driver. */\n\nimport type { GltfFeature } from \"./gltf-feature.js\";\n\nconst feature: GltfFeature = {\n id: \"KHR_materials_variants\",\n async applyAsset(meshes, _root, ctx) {\n const variantNames: string[] | undefined = ctx._json.extensions?.KHR_materials_variants?.variants?.map((v: { name: string }) => v.name);\n if (!variantNames?.length) {\n return {};\n }\n const { loadVariantMaterials } = await import(\"./gltf-variants.js\");\n const materialVariants = await loadVariantMaterials(ctx._json, ctx._binChunk, ctx._baseUrl, variantNames, meshes, ctx._engine, ctx._matExts, ctx._wrapTex);\n return { materialVariants };\n },\n};\nexport default feature;\n"],"names":[],"mappings":"AAMA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,WAAW,QAAQ,OAAO,KAAK;AAFzC;AAGQ,UAAM,gBAAqC,qBAAI,MAAM,eAAV,mBAAsB,2BAAtB,mBAA8C,aAA9C,mBAAwD,IAAI,CAAC,MAAwB,EAAE;AAClI,QAAI,EAAC,6CAAc,SAAQ;AACvB,aAAO,CAAA;AAAA,IACX;AACA,UAAM,EAAE,qBAAA,IAAyB,MAAM,OAAO,6BAAoB;AAClE,UAAM,mBAAmB,MAAM,qBAAqB,IAAI,OAAO,IAAI,WAAW,IAAI,UAAU,cAAc,QAAQ,IAAI,SAAS,IAAI,UAAU,IAAI,QAAQ;AACzJ,WAAO,EAAE,iBAAA;AAAA,EACb;AACJ;"}
1
+ {"version":3,"file":"gltf-feature-variants-DGSdFNJq.js","sources":["../src/loader-gltf/gltf-feature-variants.ts"],"sourcesContent":["/** KHR_materials_variants feature.\n * Triggered when the root extension carries variant definitions. Per-asset\n * hook builds variant material data shared with the material-ext driver. */\n\nimport type { GltfFeature } from \"./gltf-feature.js\";\n\nconst feature: GltfFeature = {\n id: \"KHR_materials_variants\",\n async applyAsset(meshes, _root, ctx) {\n const variantNames: string[] | undefined = ctx._json.extensions?.KHR_materials_variants?.variants?.map((v: { name: string }) => v.name);\n if (!variantNames?.length) {\n return {};\n }\n const { loadVariantMaterials } = await import(\"./gltf-variants.js\");\n const materialVariants = await loadVariantMaterials(ctx._json, ctx._binChunk, ctx._baseUrl, variantNames, meshes, ctx._engine, ctx._matExts, ctx._wrapTex);\n return { materialVariants };\n },\n};\nexport default feature;\n"],"names":[],"mappings":"AAMA,MAAM,UAAuB;AAAA,EACzB,IAAI;AAAA,EACJ,MAAM,WAAW,QAAQ,OAAO,KAAK;AAFzC;AAGQ,UAAM,gBAAqC,qBAAI,MAAM,eAAV,mBAAsB,2BAAtB,mBAA8C,aAA9C,mBAAwD,IAAI,CAAC,MAAwB,EAAE;AAClI,QAAI,EAAC,6CAAc,SAAQ;AACvB,aAAO,CAAA;AAAA,IACX;AACA,UAAM,EAAE,qBAAA,IAAyB,MAAM,OAAO,6BAAoB;AAClE,UAAM,mBAAmB,MAAM,qBAAqB,IAAI,OAAO,IAAI,WAAW,IAAI,UAAU,cAAc,QAAQ,IAAI,SAAS,IAAI,UAAU,IAAI,QAAQ;AACzJ,WAAO,EAAE,iBAAA;AAAA,EACb;AACJ;"}
@@ -1,4 +1,4 @@
1
- import { D as DV, e as U8 } from "./index-C-tEgwbZ.js";
1
+ import { D as DV, e as U8 } from "./index-BgY3QEzL.js";
2
2
  function parseGlbContainer(buffer) {
3
3
  const view = new DV(buffer);
4
4
  const magic = view.getUint32(0, true);
@@ -25,4 +25,4 @@ function parseGlbContainer(buffer) {
25
25
  export {
26
26
  parseGlbContainer
27
27
  };
28
- //# sourceMappingURL=gltf-glb-parser-CqOeXFOz.js.map
28
+ //# sourceMappingURL=gltf-glb-parser-DSQWsT4r.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-glb-parser-CqOeXFOz.js","sources":["../src/loader-gltf/gltf-glb-parser.ts"],"sourcesContent":["import { U8, DV } from \"../engine/typed-arrays.js\";\n/** GLB binary container parsing. Kept separate so .gltf-only scenes do not ship it. */\n\nexport function parseGlbContainer(buffer: ArrayBuffer): { json: any; binChunk: DataView } {\n const view = new DV(buffer);\n\n // Header (12 bytes)\n const magic = view.getUint32(0, true);\n if (magic !== 0x46546c67) {\n throw new Error(\"Not a valid GLB file\");\n }\n // const version = view.getUint32(4, true);\n // const totalLength = view.getUint32(8, true);\n\n // JSON chunk\n let offset = 12;\n const jsonLength = view.getUint32(offset, true);\n const jsonType = view.getUint32(offset + 4, true);\n if (jsonType !== 0x4e4f534a) {\n throw new Error(\"First GLB chunk is not JSON\");\n }\n const jsonStr = new TextDecoder().decode(new U8(buffer, offset + 8, jsonLength));\n const json = JSON.parse(jsonStr);\n offset += 8 + jsonLength;\n\n // BIN chunk\n const binLength = view.getUint32(offset, true);\n const binType = view.getUint32(offset + 4, true);\n if (binType !== 0x004e4942) {\n throw new Error(\"Second GLB chunk is not BIN\");\n }\n const binChunk = new DV(buffer, offset + 8, binLength);\n\n return { json, binChunk };\n}\n"],"names":[],"mappings":";AAGO,SAAS,kBAAkB,QAAwD;AACtF,QAAM,OAAO,IAAI,GAAG,MAAM;AAG1B,QAAM,QAAQ,KAAK,UAAU,GAAG,IAAI;AACpC,MAAI,UAAU,YAAY;AACtB,UAAM,IAAI,MAAM,sBAAsB;AAAA,EAC1C;AAKA,MAAI,SAAS;AACb,QAAM,aAAa,KAAK,UAAU,QAAQ,IAAI;AAC9C,QAAM,WAAW,KAAK,UAAU,SAAS,GAAG,IAAI;AAChD,MAAI,aAAa,YAAY;AACzB,UAAM,IAAI,MAAM,6BAA6B;AAAA,EACjD;AACA,QAAM,UAAU,IAAI,YAAA,EAAc,OAAO,IAAI,GAAG,QAAQ,SAAS,GAAG,UAAU,CAAC;AAC/E,QAAM,OAAO,KAAK,MAAM,OAAO;AAC/B,YAAU,IAAI;AAGd,QAAM,YAAY,KAAK,UAAU,QAAQ,IAAI;AAC7C,QAAM,UAAU,KAAK,UAAU,SAAS,GAAG,IAAI;AAC/C,MAAI,YAAY,SAAY;AACxB,UAAM,IAAI,MAAM,6BAA6B;AAAA,EACjD;AACA,QAAM,WAAW,IAAI,GAAG,QAAQ,SAAS,GAAG,SAAS;AAErD,SAAO,EAAE,MAAM,SAAA;AACnB;"}
1
+ {"version":3,"file":"gltf-glb-parser-DSQWsT4r.js","sources":["../src/loader-gltf/gltf-glb-parser.ts"],"sourcesContent":["import { U8, DV } from \"../engine/typed-arrays.js\";\n/** GLB binary container parsing. Kept separate so .gltf-only scenes do not ship it. */\n\nexport function parseGlbContainer(buffer: ArrayBuffer): { json: any; binChunk: DataView } {\n const view = new DV(buffer);\n\n // Header (12 bytes)\n const magic = view.getUint32(0, true);\n if (magic !== 0x46546c67) {\n throw new Error(\"Not a valid GLB file\");\n }\n // const version = view.getUint32(4, true);\n // const totalLength = view.getUint32(8, true);\n\n // JSON chunk\n let offset = 12;\n const jsonLength = view.getUint32(offset, true);\n const jsonType = view.getUint32(offset + 4, true);\n if (jsonType !== 0x4e4f534a) {\n throw new Error(\"First GLB chunk is not JSON\");\n }\n const jsonStr = new TextDecoder().decode(new U8(buffer, offset + 8, jsonLength));\n const json = JSON.parse(jsonStr);\n offset += 8 + jsonLength;\n\n // BIN chunk\n const binLength = view.getUint32(offset, true);\n const binType = view.getUint32(offset + 4, true);\n if (binType !== 0x004e4942) {\n throw new Error(\"Second GLB chunk is not BIN\");\n }\n const binChunk = new DV(buffer, offset + 8, binLength);\n\n return { json, binChunk };\n}\n"],"names":[],"mappings":";AAGO,SAAS,kBAAkB,QAAwD;AACtF,QAAM,OAAO,IAAI,GAAG,MAAM;AAG1B,QAAM,QAAQ,KAAK,UAAU,GAAG,IAAI;AACpC,MAAI,UAAU,YAAY;AACtB,UAAM,IAAI,MAAM,sBAAsB;AAAA,EAC1C;AAKA,MAAI,SAAS;AACb,QAAM,aAAa,KAAK,UAAU,QAAQ,IAAI;AAC9C,QAAM,WAAW,KAAK,UAAU,SAAS,GAAG,IAAI;AAChD,MAAI,aAAa,YAAY;AACzB,UAAM,IAAI,MAAM,6BAA6B;AAAA,EACjD;AACA,QAAM,UAAU,IAAI,YAAA,EAAc,OAAO,IAAI,GAAG,QAAQ,SAAS,GAAG,UAAU,CAAC;AAC/E,QAAM,OAAO,KAAK,MAAM,OAAO;AAC/B,YAAU,IAAI;AAGd,QAAM,YAAY,KAAK,UAAU,QAAQ,IAAI;AAC7C,QAAM,UAAU,KAAK,UAAU,SAAS,GAAG,IAAI;AAC/C,MAAI,YAAY,SAAY;AACxB,UAAM,IAAI,MAAM,6BAA6B;AAAA,EACjD;AACA,QAAM,WAAW,IAAI,GAAG,QAAQ,SAAS,GAAG,SAAS;AAErD,SAAO,EAAE,MAAM,SAAA;AACnB;"}