@zephyr3d/scene 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (389) hide show
  1. package/dist/animation/animationset.js +220 -1
  2. package/dist/animation/animationset.js.map +1 -1
  3. package/dist/animation/ik/ccd_solver.js +3 -4
  4. package/dist/animation/ik/ccd_solver.js.map +1 -1
  5. package/dist/animation/ik/fabrik_solver.js +3 -4
  6. package/dist/animation/ik/fabrik_solver.js.map +1 -1
  7. package/dist/animation/ik/ik_pole_constraint.js +7 -2
  8. package/dist/animation/ik/ik_pole_constraint.js.map +1 -1
  9. package/dist/animation/ik/ik_utils.js +0 -79
  10. package/dist/animation/ik/ik_utils.js.map +1 -1
  11. package/dist/animation/ik/two_bone_ik_solver.js +3 -4
  12. package/dist/animation/ik/two_bone_ik_solver.js.map +1 -1
  13. package/dist/animation/skeleton.js +157 -125
  14. package/dist/animation/skeleton.js.map +1 -1
  15. package/dist/animation/spring/spring_bone.js +240 -0
  16. package/dist/animation/spring/spring_bone.js.map +1 -0
  17. package/dist/animation/spring/spring_bone_collider.js +198 -0
  18. package/dist/animation/spring/spring_bone_collider.js.map +1 -0
  19. package/dist/animation/spring/spring_bone_constraint.js +170 -0
  20. package/dist/animation/spring/spring_bone_constraint.js.map +1 -0
  21. package/dist/animation/spring/spring_bone_system.js +328 -0
  22. package/dist/animation/spring/spring_bone_system.js.map +1 -0
  23. package/dist/asset/model.js +2 -2
  24. package/dist/index.d.ts +17 -0
  25. package/dist/material/mixins/pbr/common.js +20 -17
  26. package/dist/material/mixins/pbr/common.js.map +1 -1
  27. package/dist/render/gpu_picking.js +100 -0
  28. package/dist/render/gpu_picking.js.map +1 -0
  29. package/dist/render/rendergraph/device_pool_allocator.js +41 -0
  30. package/dist/render/rendergraph/device_pool_allocator.js.map +1 -0
  31. package/dist/render/rendergraph/executor.js +146 -0
  32. package/dist/render/rendergraph/executor.js.map +1 -0
  33. package/dist/render/rendergraph/forward_plus_builder.js +414 -0
  34. package/dist/render/rendergraph/forward_plus_builder.js.map +1 -0
  35. package/dist/render/rendergraph/rendergraph.js +306 -0
  36. package/dist/render/rendergraph/rendergraph.js.map +1 -0
  37. package/dist/render/rendergraph/types.js +57 -0
  38. package/dist/render/rendergraph/types.js.map +1 -0
  39. package/dist/render/sky_motion_vector.js +85 -0
  40. package/dist/render/sky_motion_vector.js.map +1 -0
  41. package/dist/utility/serialization/scene/animation.js +3 -3
  42. package/dist/utility/serialization/scene/node.js +1 -1
  43. package/package.json +2 -2
  44. package/dist/animation/ik/ik_chain_builder.js +0 -68
  45. package/dist/animation/ik/ik_chain_builder.js.map +0 -1
  46. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js +0 -38
  47. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js.map +0 -1
  48. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js +0 -10
  49. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js.map +0 -1
  50. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js +0 -127
  51. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js.map +0 -1
  52. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js +0 -263
  53. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js.map +0 -1
  54. package/dist/src/animation/animation.js +0 -127
  55. package/dist/src/animation/animation.js.map +0 -1
  56. package/dist/src/animation/animationset.js +0 -255
  57. package/dist/src/animation/animationset.js.map +0 -1
  58. package/dist/src/animation/animationtrack.js +0 -34
  59. package/dist/src/animation/animationtrack.js.map +0 -1
  60. package/dist/src/animation/eulerrotationtrack.js +0 -52
  61. package/dist/src/animation/eulerrotationtrack.js.map +0 -1
  62. package/dist/src/animation/morphtarget.js +0 -93
  63. package/dist/src/animation/morphtarget.js.map +0 -1
  64. package/dist/src/animation/morphtrack.js +0 -70
  65. package/dist/src/animation/morphtrack.js.map +0 -1
  66. package/dist/src/animation/proptrack.js +0 -161
  67. package/dist/src/animation/proptrack.js.map +0 -1
  68. package/dist/src/animation/rotationtrack.js +0 -51
  69. package/dist/src/animation/rotationtrack.js.map +0 -1
  70. package/dist/src/animation/scaletrack.js +0 -50
  71. package/dist/src/animation/scaletrack.js.map +0 -1
  72. package/dist/src/animation/skeleton.js +0 -204
  73. package/dist/src/animation/skeleton.js.map +0 -1
  74. package/dist/src/animation/translationtrack.js +0 -50
  75. package/dist/src/animation/translationtrack.js.map +0 -1
  76. package/dist/src/app/app.js +0 -129
  77. package/dist/src/app/app.js.map +0 -1
  78. package/dist/src/app/inputmgr.js +0 -267
  79. package/dist/src/app/inputmgr.js.map +0 -1
  80. package/dist/src/asset/assetmanager.js +0 -404
  81. package/dist/src/asset/assetmanager.js.map +0 -1
  82. package/dist/src/asset/builtin.js +0 -337
  83. package/dist/src/asset/builtin.js.map +0 -1
  84. package/dist/src/asset/loaders/dds/dds.js +0 -470
  85. package/dist/src/asset/loaders/dds/dds.js.map +0 -1
  86. package/dist/src/asset/loaders/dds/dds_loader.js +0 -28
  87. package/dist/src/asset/loaders/dds/dds_loader.js.map +0 -1
  88. package/dist/src/asset/loaders/gltf/gltf_loader.js +0 -1265
  89. package/dist/src/asset/loaders/gltf/gltf_loader.js.map +0 -1
  90. package/dist/src/asset/loaders/gltf/helpers.js +0 -327
  91. package/dist/src/asset/loaders/gltf/helpers.js.map +0 -1
  92. package/dist/src/asset/loaders/hdr/hdr.js +0 -180
  93. package/dist/src/asset/loaders/hdr/hdr.js.map +0 -1
  94. package/dist/src/asset/loaders/image/tga_Loader.js +0 -116
  95. package/dist/src/asset/loaders/image/tga_Loader.js.map +0 -1
  96. package/dist/src/asset/loaders/image/webimage_loader.js +0 -63
  97. package/dist/src/asset/loaders/image/webimage_loader.js.map +0 -1
  98. package/dist/src/asset/loaders/loader.js +0 -45
  99. package/dist/src/asset/loaders/loader.js.map +0 -1
  100. package/dist/src/asset/model.js +0 -414
  101. package/dist/src/asset/model.js.map +0 -1
  102. package/dist/src/blitter/bilateralblur.js +0 -221
  103. package/dist/src/blitter/bilateralblur.js.map +0 -1
  104. package/dist/src/blitter/blitter.js +0 -390
  105. package/dist/src/blitter/blitter.js.map +0 -1
  106. package/dist/src/blitter/box.js +0 -118
  107. package/dist/src/blitter/box.js.map +0 -1
  108. package/dist/src/blitter/copy.js +0 -22
  109. package/dist/src/blitter/copy.js.map +0 -1
  110. package/dist/src/blitter/gaussianblur.js +0 -228
  111. package/dist/src/blitter/gaussianblur.js.map +0 -1
  112. package/dist/src/camera/base.js +0 -92
  113. package/dist/src/camera/base.js.map +0 -1
  114. package/dist/src/camera/camera.js +0 -1005
  115. package/dist/src/camera/camera.js.map +0 -1
  116. package/dist/src/camera/fps.js +0 -238
  117. package/dist/src/camera/fps.js.map +0 -1
  118. package/dist/src/camera/orbit.js +0 -245
  119. package/dist/src/camera/orbit.js.map +0 -1
  120. package/dist/src/camera/orthocamera.js +0 -167
  121. package/dist/src/camera/orthocamera.js.map +0 -1
  122. package/dist/src/camera/perspectivecamera.js +0 -141
  123. package/dist/src/camera/perspectivecamera.js.map +0 -1
  124. package/dist/src/index.js +0 -120
  125. package/dist/src/index.js.map +0 -1
  126. package/dist/src/material/blinn.js +0 -81
  127. package/dist/src/material/blinn.js.map +0 -1
  128. package/dist/src/material/grassmaterial.js +0 -113
  129. package/dist/src/material/grassmaterial.js.map +0 -1
  130. package/dist/src/material/lambert.js +0 -92
  131. package/dist/src/material/lambert.js.map +0 -1
  132. package/dist/src/material/material.js +0 -301
  133. package/dist/src/material/material.js.map +0 -1
  134. package/dist/src/material/meshmaterial.js +0 -704
  135. package/dist/src/material/meshmaterial.js.map +0 -1
  136. package/dist/src/material/mixins/albedocolor.js +0 -76
  137. package/dist/src/material/mixins/albedocolor.js.map +0 -1
  138. package/dist/src/material/mixins/foliage.js +0 -47
  139. package/dist/src/material/mixins/foliage.js.map +0 -1
  140. package/dist/src/material/mixins/lightmodel/blinnphong.js +0 -112
  141. package/dist/src/material/mixins/lightmodel/blinnphong.js.map +0 -1
  142. package/dist/src/material/mixins/lightmodel/lambert.js +0 -58
  143. package/dist/src/material/mixins/lightmodel/lambert.js.map +0 -1
  144. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js +0 -178
  145. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js.map +0 -1
  146. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js +0 -139
  147. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js.map +0 -1
  148. package/dist/src/material/mixins/lit.js +0 -476
  149. package/dist/src/material/mixins/lit.js.map +0 -1
  150. package/dist/src/material/mixins/pbr/common.js +0 -918
  151. package/dist/src/material/mixins/pbr/common.js.map +0 -1
  152. package/dist/src/material/mixins/texture.js +0 -172
  153. package/dist/src/material/mixins/texture.js.map +0 -1
  154. package/dist/src/material/mixins/vertexcolor.js +0 -56
  155. package/dist/src/material/mixins/vertexcolor.js.map +0 -1
  156. package/dist/src/material/particle.js +0 -178
  157. package/dist/src/material/particle.js.map +0 -1
  158. package/dist/src/material/pbrmr.js +0 -97
  159. package/dist/src/material/pbrmr.js.map +0 -1
  160. package/dist/src/material/pbrsg.js +0 -97
  161. package/dist/src/material/pbrsg.js.map +0 -1
  162. package/dist/src/material/shader/helper.js +0 -1209
  163. package/dist/src/material/shader/helper.js.map +0 -1
  164. package/dist/src/material/terrain-cm.js +0 -606
  165. package/dist/src/material/terrain-cm.js.map +0 -1
  166. package/dist/src/material/terrainmaterial.js +0 -375
  167. package/dist/src/material/terrainmaterial.js.map +0 -1
  168. package/dist/src/material/unlit.js +0 -41
  169. package/dist/src/material/unlit.js.map +0 -1
  170. package/dist/src/material/water.js +0 -417
  171. package/dist/src/material/water.js.map +0 -1
  172. package/dist/src/posteffect/bloom.js +0 -361
  173. package/dist/src/posteffect/bloom.js.map +0 -1
  174. package/dist/src/posteffect/compositor.js +0 -226
  175. package/dist/src/posteffect/compositor.js.map +0 -1
  176. package/dist/src/posteffect/fxaa.js +0 -273
  177. package/dist/src/posteffect/fxaa.js.map +0 -1
  178. package/dist/src/posteffect/grayscale.js +0 -69
  179. package/dist/src/posteffect/grayscale.js.map +0 -1
  180. package/dist/src/posteffect/motionblur.js +0 -96
  181. package/dist/src/posteffect/motionblur.js.map +0 -1
  182. package/dist/src/posteffect/posteffect.js +0 -126
  183. package/dist/src/posteffect/posteffect.js.map +0 -1
  184. package/dist/src/posteffect/sao.js +0 -324
  185. package/dist/src/posteffect/sao.js.map +0 -1
  186. package/dist/src/posteffect/ssr.js +0 -489
  187. package/dist/src/posteffect/ssr.js.map +0 -1
  188. package/dist/src/posteffect/taa.js +0 -172
  189. package/dist/src/posteffect/taa.js.map +0 -1
  190. package/dist/src/posteffect/tonemap.js +0 -94
  191. package/dist/src/posteffect/tonemap.js.map +0 -1
  192. package/dist/src/render/abuffer_oit.js +0 -361
  193. package/dist/src/render/abuffer_oit.js.map +0 -1
  194. package/dist/src/render/clipmap.js +0 -851
  195. package/dist/src/render/clipmap.js.map +0 -1
  196. package/dist/src/render/cluster_light.js +0 -333
  197. package/dist/src/render/cluster_light.js.map +0 -1
  198. package/dist/src/render/cull_visitor.js +0 -187
  199. package/dist/src/render/cull_visitor.js.map +0 -1
  200. package/dist/src/render/depthpass.js +0 -68
  201. package/dist/src/render/depthpass.js.map +0 -1
  202. package/dist/src/render/drawable_mixin.js +0 -227
  203. package/dist/src/render/drawable_mixin.js.map +0 -1
  204. package/dist/src/render/envlight.js +0 -463
  205. package/dist/src/render/envlight.js.map +0 -1
  206. package/dist/src/render/fbm_wavegenerator.js +0 -251
  207. package/dist/src/render/fbm_wavegenerator.js.map +0 -1
  208. package/dist/src/render/fft_wavegenerator.js +0 -1006
  209. package/dist/src/render/fft_wavegenerator.js.map +0 -1
  210. package/dist/src/render/fullscreenquad.js +0 -38
  211. package/dist/src/render/fullscreenquad.js.map +0 -1
  212. package/dist/src/render/gerstner_wavegenerator.js +0 -314
  213. package/dist/src/render/gerstner_wavegenerator.js.map +0 -1
  214. package/dist/src/render/globalbindgroup_allocator.js +0 -60
  215. package/dist/src/render/globalbindgroup_allocator.js.map +0 -1
  216. package/dist/src/render/hzb.js +0 -273
  217. package/dist/src/render/hzb.js.map +0 -1
  218. package/dist/src/render/lightpass.js +0 -172
  219. package/dist/src/render/lightpass.js.map +0 -1
  220. package/dist/src/render/objectcolorpass.js +0 -51
  221. package/dist/src/render/objectcolorpass.js.map +0 -1
  222. package/dist/src/render/primitive.js +0 -364
  223. package/dist/src/render/primitive.js.map +0 -1
  224. package/dist/src/render/render_queue.js +0 -467
  225. package/dist/src/render/render_queue.js.map +0 -1
  226. package/dist/src/render/renderbundle_wrapper.js +0 -152
  227. package/dist/src/render/renderbundle_wrapper.js.map +0 -1
  228. package/dist/src/render/renderer.js +0 -455
  229. package/dist/src/render/renderer.js.map +0 -1
  230. package/dist/src/render/renderpass.js +0 -200
  231. package/dist/src/render/renderpass.js.map +0 -1
  232. package/dist/src/render/shadowmap_pass.js +0 -56
  233. package/dist/src/render/shadowmap_pass.js.map +0 -1
  234. package/dist/src/render/sky.js +0 -1103
  235. package/dist/src/render/sky.js.map +0 -1
  236. package/dist/src/render/weightedblended_oit.js +0 -168
  237. package/dist/src/render/weightedblended_oit.js.map +0 -1
  238. package/dist/src/scene/batchgroup.js +0 -162
  239. package/dist/src/scene/batchgroup.js.map +0 -1
  240. package/dist/src/scene/environment.js +0 -209
  241. package/dist/src/scene/environment.js.map +0 -1
  242. package/dist/src/scene/graph_node.js +0 -72
  243. package/dist/src/scene/graph_node.js.map +0 -1
  244. package/dist/src/scene/light.js +0 -416
  245. package/dist/src/scene/light.js.map +0 -1
  246. package/dist/src/scene/mesh.js +0 -341
  247. package/dist/src/scene/mesh.js.map +0 -1
  248. package/dist/src/scene/octree.js +0 -649
  249. package/dist/src/scene/octree.js.map +0 -1
  250. package/dist/src/scene/particlesys.js +0 -738
  251. package/dist/src/scene/particlesys.js.map +0 -1
  252. package/dist/src/scene/raycast_visitor.js +0 -103
  253. package/dist/src/scene/raycast_visitor.js.map +0 -1
  254. package/dist/src/scene/scene.js +0 -284
  255. package/dist/src/scene/scene.js.map +0 -1
  256. package/dist/src/scene/scene_node.js +0 -732
  257. package/dist/src/scene/scene_node.js.map +0 -1
  258. package/dist/src/scene/terrain/grass.js +0 -278
  259. package/dist/src/scene/terrain/grass.js.map +0 -1
  260. package/dist/src/scene/terrain/heightfield.js +0 -475
  261. package/dist/src/scene/terrain/heightfield.js.map +0 -1
  262. package/dist/src/scene/terrain/patch.js +0 -530
  263. package/dist/src/scene/terrain/patch.js.map +0 -1
  264. package/dist/src/scene/terrain/quadtree.js +0 -461
  265. package/dist/src/scene/terrain/quadtree.js.map +0 -1
  266. package/dist/src/scene/terrain/terrain.js +0 -246
  267. package/dist/src/scene/terrain/terrain.js.map +0 -1
  268. package/dist/src/scene/terrain-cm/grass.js +0 -594
  269. package/dist/src/scene/terrain-cm/grass.js.map +0 -1
  270. package/dist/src/scene/terrain-cm/grassmaterial.js +0 -159
  271. package/dist/src/scene/terrain-cm/grassmaterial.js.map +0 -1
  272. package/dist/src/scene/terrain-cm/terrain-cm.js +0 -538
  273. package/dist/src/scene/terrain-cm/terrain-cm.js.map +0 -1
  274. package/dist/src/scene/water.js +0 -374
  275. package/dist/src/scene/water.js.map +0 -1
  276. package/dist/src/shaders/atmosphere.js +0 -957
  277. package/dist/src/shaders/atmosphere.js.map +0 -1
  278. package/dist/src/shaders/fog.js +0 -112
  279. package/dist/src/shaders/fog.js.map +0 -1
  280. package/dist/src/shaders/misc.js +0 -266
  281. package/dist/src/shaders/misc.js.map +0 -1
  282. package/dist/src/shaders/noise.js +0 -222
  283. package/dist/src/shaders/noise.js.map +0 -1
  284. package/dist/src/shaders/pbr.js +0 -51
  285. package/dist/src/shaders/pbr.js.map +0 -1
  286. package/dist/src/shaders/shadow.js +0 -636
  287. package/dist/src/shaders/shadow.js.map +0 -1
  288. package/dist/src/shaders/ssr.js +0 -490
  289. package/dist/src/shaders/ssr.js.map +0 -1
  290. package/dist/src/shaders/temporal.js +0 -215
  291. package/dist/src/shaders/temporal.js.map +0 -1
  292. package/dist/src/shaders/water.js +0 -756
  293. package/dist/src/shaders/water.js.map +0 -1
  294. package/dist/src/shadow/esm.js +0 -237
  295. package/dist/src/shadow/esm.js.map +0 -1
  296. package/dist/src/shadow/pcf_opt.js +0 -181
  297. package/dist/src/shadow/pcf_opt.js.map +0 -1
  298. package/dist/src/shadow/pcf_pd.js +0 -189
  299. package/dist/src/shadow/pcf_pd.js.map +0 -1
  300. package/dist/src/shadow/shader.js +0 -37
  301. package/dist/src/shadow/shader.js.map +0 -1
  302. package/dist/src/shadow/shadow_impl.js +0 -15
  303. package/dist/src/shadow/shadow_impl.js.map +0 -1
  304. package/dist/src/shadow/shadowmapper.js +0 -790
  305. package/dist/src/shadow/shadowmapper.js.map +0 -1
  306. package/dist/src/shadow/ssm.js +0 -159
  307. package/dist/src/shadow/ssm.js.map +0 -1
  308. package/dist/src/shadow/vsm.js +0 -297
  309. package/dist/src/shadow/vsm.js.map +0 -1
  310. package/dist/src/shapes/box.js +0 -386
  311. package/dist/src/shapes/box.js.map +0 -1
  312. package/dist/src/shapes/cylinder.js +0 -125
  313. package/dist/src/shapes/cylinder.js.map +0 -1
  314. package/dist/src/shapes/plane.js +0 -88
  315. package/dist/src/shapes/plane.js.map +0 -1
  316. package/dist/src/shapes/shape.js +0 -87
  317. package/dist/src/shapes/shape.js.map +0 -1
  318. package/dist/src/shapes/sphere.js +0 -114
  319. package/dist/src/shapes/sphere.js.map +0 -1
  320. package/dist/src/shapes/tetrahedron.js +0 -188
  321. package/dist/src/shapes/tetrahedron.js.map +0 -1
  322. package/dist/src/shapes/torus.js +0 -111
  323. package/dist/src/shapes/torus.js.map +0 -1
  324. package/dist/src/utility/aabbtree.js +0 -400
  325. package/dist/src/utility/aabbtree.js.map +0 -1
  326. package/dist/src/utility/bounding_volume.js +0 -29
  327. package/dist/src/utility/bounding_volume.js.map +0 -1
  328. package/dist/src/utility/debug.js +0 -28
  329. package/dist/src/utility/debug.js.map +0 -1
  330. package/dist/src/utility/draco/decoder.js +0 -116
  331. package/dist/src/utility/draco/decoder.js.map +0 -1
  332. package/dist/src/utility/misc.js +0 -105
  333. package/dist/src/utility/misc.js.map +0 -1
  334. package/dist/src/utility/panorama.js +0 -163
  335. package/dist/src/utility/panorama.js.map +0 -1
  336. package/dist/src/utility/pmrem.js +0 -354
  337. package/dist/src/utility/pmrem.js.map +0 -1
  338. package/dist/src/utility/rendermipmap.js +0 -115
  339. package/dist/src/utility/rendermipmap.js.map +0 -1
  340. package/dist/src/utility/serialization/json.js +0 -402
  341. package/dist/src/utility/serialization/json.js.map +0 -1
  342. package/dist/src/utility/serialization/manager.js +0 -623
  343. package/dist/src/utility/serialization/manager.js.map +0 -1
  344. package/dist/src/utility/serialization/scene/animation.js +0 -248
  345. package/dist/src/utility/serialization/scene/animation.js.map +0 -1
  346. package/dist/src/utility/serialization/scene/batch.js +0 -59
  347. package/dist/src/utility/serialization/scene/batch.js.map +0 -1
  348. package/dist/src/utility/serialization/scene/camera.js +0 -790
  349. package/dist/src/utility/serialization/scene/camera.js.map +0 -1
  350. package/dist/src/utility/serialization/scene/common.js +0 -222
  351. package/dist/src/utility/serialization/scene/common.js.map +0 -1
  352. package/dist/src/utility/serialization/scene/light.js +0 -575
  353. package/dist/src/utility/serialization/scene/light.js.map +0 -1
  354. package/dist/src/utility/serialization/scene/material.js +0 -1111
  355. package/dist/src/utility/serialization/scene/material.js.map +0 -1
  356. package/dist/src/utility/serialization/scene/mesh.js +0 -148
  357. package/dist/src/utility/serialization/scene/mesh.js.map +0 -1
  358. package/dist/src/utility/serialization/scene/misc.js +0 -39
  359. package/dist/src/utility/serialization/scene/misc.js.map +0 -1
  360. package/dist/src/utility/serialization/scene/node.js +0 -451
  361. package/dist/src/utility/serialization/scene/node.js.map +0 -1
  362. package/dist/src/utility/serialization/scene/particle.js +0 -425
  363. package/dist/src/utility/serialization/scene/particle.js.map +0 -1
  364. package/dist/src/utility/serialization/scene/primitive.js +0 -692
  365. package/dist/src/utility/serialization/scene/primitive.js.map +0 -1
  366. package/dist/src/utility/serialization/scene/scene.js +0 -704
  367. package/dist/src/utility/serialization/scene/scene.js.map +0 -1
  368. package/dist/src/utility/serialization/scene/terrain.js +0 -488
  369. package/dist/src/utility/serialization/scene/terrain.js.map +0 -1
  370. package/dist/src/utility/serialization/scene/water.js +0 -465
  371. package/dist/src/utility/serialization/scene/water.js.map +0 -1
  372. package/dist/src/utility/shprojector.js +0 -297
  373. package/dist/src/utility/shprojector.js.map +0 -1
  374. package/dist/src/utility/textures/ggxlut.js +0 -213
  375. package/dist/src/utility/textures/ggxlut.js.map +0 -1
  376. package/dist/src/utility/textures/gradientnoise.js +0 -62
  377. package/dist/src/utility/textures/gradientnoise.js.map +0 -1
  378. package/dist/src/utility/textures/randomnoise.js +0 -41
  379. package/dist/src/utility/textures/randomnoise.js.map +0 -1
  380. package/dist/src/values.js +0 -162
  381. package/dist/src/values.js.map +0 -1
  382. package/dist/utility/blueprint/material/common.js +0 -7
  383. package/dist/utility/blueprint/material/common.js.map +0 -1
  384. package/dist/utility/serialization/blueprint/constants.js +0 -255
  385. package/dist/utility/serialization/blueprint/constants.js.map +0 -1
  386. package/dist/utility/serialization/blueprint/material/constants.js +0 -203
  387. package/dist/utility/serialization/blueprint/material/constants.js.map +0 -1
  388. package/dist/utility/serialization/blueprint/material/texture.js +0 -165
  389. package/dist/utility/serialization/blueprint/material/texture.js.map +0 -1
@@ -1,68 +0,0 @@
1
- import { IKChain } from './ik_chain.js';
2
-
3
- /**
4
- * Helper class for building IK chains from various sources.
5
- *
6
- * @public
7
- */ class IKChainBuilder {
8
- /**
9
- * Create an IK chain from an array of scene nodes.
10
- *
11
- * @param nodes - Array of scene nodes from root to end effector
12
- * @returns The created IK chain
13
- */ static fromNodes(nodes) {
14
- return new IKChain(nodes);
15
- }
16
- /**
17
- * Create an IK chain from a skeleton using joint indices.
18
- *
19
- * @param skeleton - The skeleton containing the joints
20
- * @param jointIndices - Array of joint indices from root to end effector
21
- * @returns The created IK chain
22
- */ static fromSkeleton(skeleton, jointIndices) {
23
- if (jointIndices.length < 2) {
24
- throw new Error('IK chain must have at least 2 joints');
25
- }
26
- const joints = skeleton.joints;
27
- const nodes = [];
28
- for (const index of jointIndices){
29
- if (index < 0 || index >= joints.length) {
30
- throw new Error(`Invalid joint index: ${index}`);
31
- }
32
- nodes.push(joints[index]);
33
- }
34
- return new IKChain(nodes);
35
- }
36
- /**
37
- * Create an IK chain by traversing from a start node to an end node.
38
- *
39
- * @remarks
40
- * This method walks up the parent chain from the end node until it
41
- * reaches the start node, building the joint chain in the process.
42
- *
43
- * @param startNode - The root joint of the chain
44
- * @param endNode - The end effector joint
45
- * @returns The created IK chain
46
- */ static fromNodeHierarchy(startNode, endNode) {
47
- const nodes = [];
48
- let current = endNode;
49
- // Walk up the hierarchy from end to start
50
- while(current){
51
- nodes.unshift(current); // Add to front
52
- if (current === startNode) {
53
- break;
54
- }
55
- current = current.parent;
56
- }
57
- if (nodes[0] !== startNode) {
58
- throw new Error('End node is not a descendant of start node');
59
- }
60
- if (nodes.length < 2) {
61
- throw new Error('IK chain must have at least 2 joints');
62
- }
63
- return new IKChain(nodes);
64
- }
65
- }
66
-
67
- export { IKChainBuilder };
68
- //# sourceMappingURL=ik_chain_builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ik_chain_builder.js","sources":["../../../src/animation/ik/ik_chain_builder.ts"],"sourcesContent":["import { IKChain } from './ik_chain';\r\nimport type { SceneNode } from '../../scene/scene_node';\r\nimport type { Skeleton } from '../skeleton';\r\n\r\n/**\r\n * Helper class for building IK chains from various sources.\r\n *\r\n * @public\r\n */\r\nexport class IKChainBuilder {\r\n /**\r\n * Create an IK chain from an array of scene nodes.\r\n *\r\n * @param nodes - Array of scene nodes from root to end effector\r\n * @returns The created IK chain\r\n */\r\n static fromNodes(nodes: SceneNode[]): IKChain {\r\n return new IKChain(nodes);\r\n }\r\n\r\n /**\r\n * Create an IK chain from a skeleton using joint indices.\r\n *\r\n * @param skeleton - The skeleton containing the joints\r\n * @param jointIndices - Array of joint indices from root to end effector\r\n * @returns The created IK chain\r\n */\r\n static fromSkeleton(skeleton: Skeleton, jointIndices: number[]): IKChain {\r\n if (jointIndices.length < 2) {\r\n throw new Error('IK chain must have at least 2 joints');\r\n }\r\n\r\n const joints = skeleton.joints;\r\n const nodes: SceneNode[] = [];\r\n\r\n for (const index of jointIndices) {\r\n if (index < 0 || index >= joints.length) {\r\n throw new Error(`Invalid joint index: ${index}`);\r\n }\r\n nodes.push(joints[index]);\r\n }\r\n\r\n return new IKChain(nodes);\r\n }\r\n\r\n /**\r\n * Create an IK chain by traversing from a start node to an end node.\r\n *\r\n * @remarks\r\n * This method walks up the parent chain from the end node until it\r\n * reaches the start node, building the joint chain in the process.\r\n *\r\n * @param startNode - The root joint of the chain\r\n * @param endNode - The end effector joint\r\n * @returns The created IK chain\r\n */\r\n static fromNodeHierarchy(startNode: SceneNode, endNode: SceneNode): IKChain {\r\n const nodes: SceneNode[] = [];\r\n let current: SceneNode | null = endNode;\r\n\r\n // Walk up the hierarchy from end to start\r\n while (current) {\r\n nodes.unshift(current); // Add to front\r\n\r\n if (current === startNode) {\r\n break;\r\n }\r\n\r\n current = current.parent as SceneNode | null;\r\n }\r\n\r\n if (nodes[0] !== startNode) {\r\n throw new Error('End node is not a descendant of start node');\r\n }\r\n\r\n if (nodes.length < 2) {\r\n throw new Error('IK chain must have at least 2 joints');\r\n }\r\n\r\n return new IKChain(nodes);\r\n }\r\n}\r\n"],"names":["IKChainBuilder","fromNodes","nodes","IKChain","fromSkeleton","skeleton","jointIndices","length","Error","joints","index","push","fromNodeHierarchy","startNode","endNode","current","unshift","parent"],"mappings":";;AAIA;;;;AAIC,IACM,MAAMA,cAAAA,CAAAA;AACX;;;;;MAMA,OAAOC,SAAUC,CAAAA,KAAkB,EAAW;A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AAA,CAAA;AAClB;AAEA,QAAA,OAAO,IAAIL,OAAQD,CAAAA,KAAAA,CAAAA;AACrB;AACF;;;;"}
@@ -1,38 +0,0 @@
1
- import { ScriptingSystem } from './scriptingsystem.js';
2
-
3
- class RuntimeManager {
4
- scriptingSystem;
5
- enabled;
6
- constructor(VFS, scriptsRoot, editorMode, enabled){
7
- this.scriptingSystem = new ScriptingSystem({
8
- VFS,
9
- scriptsRoot,
10
- editorMode
11
- });
12
- this.enabled = enabled ?? true;
13
- }
14
- get VFS() {
15
- return this.scriptingSystem.registry.VFS;
16
- }
17
- detachAllScripts() {
18
- if (this.enabled) {
19
- this.scriptingSystem.detachAllScripts();
20
- }
21
- }
22
- async attachScript(host, module) {
23
- return this.enabled ? await this.scriptingSystem.attachScript(host, module) : null;
24
- }
25
- detachScript(host, idOrInstance) {
26
- if (this.enabled) {
27
- this.scriptingSystem.detachScript(host, idOrInstance);
28
- }
29
- }
30
- update(deltaTime, elapsedTime) {
31
- if (this.enabled) {
32
- this.scriptingSystem.update(deltaTime, elapsedTime);
33
- }
34
- }
35
- }
36
-
37
- export { RuntimeManager };
38
- //# sourceMappingURL=runtimemgr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtimemgr.js","sources":["../../../../../../node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js"],"sourcesContent":["import { ScriptingSystem } from './scriptingsystem.js';\n\nclass RuntimeManager {\n scriptingSystem;\n enabled;\n constructor(VFS, scriptsRoot, editorMode, enabled){\n this.scriptingSystem = new ScriptingSystem({\n VFS,\n scriptsRoot,\n editorMode\n });\n this.enabled = enabled ?? true;\n }\n get VFS() {\n return this.scriptingSystem.registry.VFS;\n }\n detachAllScripts() {\n if (this.enabled) {\n this.scriptingSystem.detachAllScripts();\n }\n }\n async attachScript(host, module) {\n return this.enabled ? await this.scriptingSystem.attachScript(host, module) : null;\n }\n detachScript(host, idOrInstance) {\n if (this.enabled) {\n this.scriptingSystem.detachScript(host, idOrInstance);\n }\n }\n update(deltaTime, elapsedTime) {\n if (this.enabled) {\n this.scriptingSystem.update(deltaTime, elapsedTime);\n }\n }\n}\n\nexport { RuntimeManager };\n//# sourceMappingURL=runtimemgr.js.map\n"],"names":[],"mappings":";;AAEA,MAAM,cAAc,CAAC;AACrB,IAAI,eAAe;AACnB,IAAI,OAAO;AACX,IAAI,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,CAAC;AACtD,QAAQ,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC;AACnD,YAAY,GAAG;AACf,YAAY,WAAW;AACvB,YAAY;AACZ,SAAS,CAAC;AACV,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,IAAI;AACtC;AACA,IAAI,IAAI,GAAG,GAAG;AACd,QAAQ,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG;AAChD;AACA,IAAI,gBAAgB,GAAG;AACvB,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;AAC1B,YAAY,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE;AACnD;AACA;AACA,IAAI,MAAM,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE;AACrC,QAAQ,OAAO,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI;AAC1F;AACA,IAAI,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE;AACrC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;AAC1B,YAAY,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;AACjE;AACA;AACA,IAAI,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE;AACnC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;AAC1B,YAAY,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC;AAC/D;AACA;AACA;;;;","x_google_ignoreList":[0]}
@@ -1,10 +0,0 @@
1
- class RuntimeScript {
2
- onCreated() {}
3
- onAttached(_host) {}
4
- onUpdate(_deltaTime, _elapsedTime) {}
5
- onDetached() {}
6
- onDestroy() {}
7
- }
8
-
9
- export { RuntimeScript };
10
- //# sourceMappingURL=runtimescript.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtimescript.js","sources":["../../../../../../node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js"],"sourcesContent":["class RuntimeScript {\n onCreated() {}\n onAttached(_host) {}\n onUpdate(_deltaTime, _elapsedTime) {}\n onDetached() {}\n onDestroy() {}\n}\n\nexport { RuntimeScript };\n//# sourceMappingURL=runtimescript.js.map\n"],"names":[],"mappings":"AAAA,MAAM,aAAa,CAAC;AACpB,IAAI,SAAS,GAAG;AAChB,IAAI,UAAU,CAAC,KAAK,EAAE;AACtB,IAAI,QAAQ,CAAC,UAAU,EAAE,YAAY,EAAE;AACvC,IAAI,UAAU,GAAG;AACjB,IAAI,SAAS,GAAG;AAChB;;;;","x_google_ignoreList":[0]}
@@ -1,127 +0,0 @@
1
- import { ScriptRegistry } from './scriptregistry.js';
2
- import { HttpFS } from '@zephyr3d/base';
3
- import { RuntimeScript } from './runtimescript.js';
4
-
5
- class ScriptingSystem {
6
- _registry;
7
- _hostScripts = new Map();
8
- _onLoadError;
9
- _importComment;
10
- constructor(opts = {}){
11
- this._registry = new ScriptRegistry(opts.VFS ?? new HttpFS('./'), opts.scriptsRoot ?? '/', opts.editorMode ?? false);
12
- this._importComment = opts.importComment;
13
- this._onLoadError = opts.onLoadError;
14
- }
15
- get registry() {
16
- return this._registry;
17
- }
18
- // Attachs a script to object and returns the script instance
19
- async attachScript(host, module) {
20
- try {
21
- const url = await this._registry.resolveRuntimeUrl(module);
22
- if (!url) {
23
- return null;
24
- }
25
- const mod = await import(url + (this._importComment ?? ''));
26
- let instance;
27
- if (typeof mod?.default === 'function') {
28
- // default export
29
- instance = new mod.default();
30
- if (instance instanceof RuntimeScript) {
31
- const P = instance.onCreated();
32
- if (P instanceof Promise) {
33
- await P;
34
- }
35
- }
36
- } else {
37
- console.warn(`Script '${module}' does not have RuntimeScript class exported as default`);
38
- return null;
39
- }
40
- const attached = {
41
- id: module,
42
- url,
43
- instance
44
- };
45
- let list = this._hostScripts.get(host);
46
- if (!list) {
47
- list = [];
48
- this._hostScripts.set(host, list);
49
- if (host) {
50
- host.on('dispose', ()=>{
51
- this.detachScript(host);
52
- });
53
- }
54
- }
55
- list.push(attached);
56
- this.registerHost(host);
57
- const P = instance.onAttached(host);
58
- if (P instanceof Promise) {
59
- await P;
60
- }
61
- return attached.instance;
62
- } catch (e) {
63
- this._onLoadError?.(e, module);
64
- return null;
65
- }
66
- }
67
- // Detach script from host object
68
- detachScript(host, idOrInstance) {
69
- const list = this._hostScripts.get(host);
70
- if (!list || list.length === 0) {
71
- return false;
72
- }
73
- let removed = false;
74
- for(let i = list.length - 1; i >= 0; i--){
75
- const it = list[i];
76
- const hit = !idOrInstance || typeof idOrInstance === 'string' ? it.id === idOrInstance : it.instance === idOrInstance;
77
- if (hit) {
78
- try {
79
- it.instance.onDetached();
80
- } catch (err) {
81
- console.error(`Error occured at onDetach() of module '${it.id}': ${err}`);
82
- }
83
- try {
84
- it.instance.onDestroy();
85
- } catch (err) {
86
- console.error(`Error occured at onDestroy() of module '${it.id}': ${err}`);
87
- }
88
- list.splice(i, 1);
89
- removed = true;
90
- }
91
- }
92
- if (list.length === 0) {
93
- this._hostScripts.delete(host);
94
- this.unregisterHost(host);
95
- }
96
- return removed;
97
- }
98
- // Update script instances
99
- update(deltaTime, elapsedTime) {
100
- if (this._hostScripts.size === 0) {
101
- return;
102
- }
103
- for (const list of this._hostScripts.values()){
104
- for (const s of list){
105
- try {
106
- s.instance.onUpdate(deltaTime, elapsedTime);
107
- } catch (err) {
108
- console.error(`Error occured at onUpdate() of module '${s.id}': ${err}`);
109
- }
110
- }
111
- }
112
- }
113
- // Detach all script instances
114
- detachAllScripts() {
115
- while(this._hostScripts.size > 0){
116
- for (const entry of this._hostScripts){
117
- this.detachScript(entry[0]);
118
- }
119
- }
120
- }
121
- // Preserved functions
122
- registerHost(_host) {}
123
- unregisterHost(_host) {}
124
- }
125
-
126
- export { ScriptingSystem };
127
- //# sourceMappingURL=scriptingsystem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scriptingsystem.js","sources":["../../../../../../node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js"],"sourcesContent":["import { ScriptRegistry } from './scriptregistry.js';\nimport { HttpFS } from '@zephyr3d/base';\nimport { RuntimeScript } from './runtimescript.js';\n\nclass ScriptingSystem {\n _registry;\n _hostScripts = new Map();\n _onLoadError;\n _importComment;\n constructor(opts = {}){\n this._registry = new ScriptRegistry(opts.VFS ?? new HttpFS('./'), opts.scriptsRoot ?? '/', opts.editorMode ?? false);\n this._importComment = opts.importComment;\n this._onLoadError = opts.onLoadError;\n }\n get registry() {\n return this._registry;\n }\n // Attachs a script to object and returns the script instance\n async attachScript(host, module) {\n try {\n const url = await this._registry.resolveRuntimeUrl(module);\n if (!url) {\n return null;\n }\n const mod = await import(url + (this._importComment ?? ''));\n let instance;\n if (typeof mod?.default === 'function') {\n // default export\n instance = new mod.default();\n if (instance instanceof RuntimeScript) {\n const P = instance.onCreated();\n if (P instanceof Promise) {\n await P;\n }\n }\n } else {\n console.warn(`Script '${module}' does not have RuntimeScript class exported as default`);\n return null;\n }\n const attached = {\n id: module,\n url,\n instance\n };\n let list = this._hostScripts.get(host);\n if (!list) {\n list = [];\n this._hostScripts.set(host, list);\n if (host) {\n host.on('dispose', ()=>{\n this.detachScript(host);\n });\n }\n }\n list.push(attached);\n this.registerHost(host);\n const P = instance.onAttached(host);\n if (P instanceof Promise) {\n await P;\n }\n return attached.instance;\n } catch (e) {\n this._onLoadError?.(e, module);\n return null;\n }\n }\n // Detach script from host object\n detachScript(host, idOrInstance) {\n const list = this._hostScripts.get(host);\n if (!list || list.length === 0) {\n return false;\n }\n let removed = false;\n for(let i = list.length - 1; i >= 0; i--){\n const it = list[i];\n const hit = !idOrInstance || typeof idOrInstance === 'string' ? it.id === idOrInstance : it.instance === idOrInstance;\n if (hit) {\n try {\n it.instance.onDetached();\n } catch (err) {\n console.error(`Error occured at onDetach() of module '${it.id}': ${err}`);\n }\n try {\n it.instance.onDestroy();\n } catch (err) {\n console.error(`Error occured at onDestroy() of module '${it.id}': ${err}`);\n }\n list.splice(i, 1);\n removed = true;\n }\n }\n if (list.length === 0) {\n this._hostScripts.delete(host);\n this.unregisterHost(host);\n }\n return removed;\n }\n // Update script instances\n update(deltaTime, elapsedTime) {\n if (this._hostScripts.size === 0) {\n return;\n }\n for (const list of this._hostScripts.values()){\n for (const s of list){\n try {\n s.instance.onUpdate(deltaTime, elapsedTime);\n } catch (err) {\n console.error(`Error occured at onUpdate() of module '${s.id}': ${err}`);\n }\n }\n }\n }\n // Detach all script instances\n detachAllScripts() {\n while(this._hostScripts.size > 0){\n for (const entry of this._hostScripts){\n this.detachScript(entry[0]);\n }\n }\n }\n // Preserved functions\n registerHost(_host) {}\n unregisterHost(_host) {}\n}\n\nexport { ScriptingSystem };\n//# sourceMappingURL=scriptingsystem.js.map\n"],"names":[],"mappings":";;;;AAIA,MAAM,eAAe,CAAC;AACtB,IAAI,SAAS;AACb,IAAI,YAAY,GAAG,IAAI,GAAG,EAAE;AAC5B,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;AAC1B,QAAQ,IAAI,CAAC,SAAS,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,IAAI,GAAG,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC;AAC5H,QAAQ,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,aAAa;AAChD,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WA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C,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC5F;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC;AACzC,YAAY,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,CAAC;AAClD,gBAAgB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3C;AACA;AACA;AACA;AACA,IAAI,YAAY,CAAC,KAAK,EAAE;AACxB,IAAI,cAAc,CAAC,KAAK,EAAE;AAC1B;;;;","x_google_ignoreList":[0]}
@@ -1,263 +0,0 @@
1
- import { textToBase64 } from '@zephyr3d/base';
2
-
3
- function toDataUrl(js, id) {
4
- const b64 = textToBase64(js);
5
- return `data:text/javascript;base64,${b64}#${encodeURIComponent(String(id))}`;
6
- }
7
- function isAbsoluteUrl(spec) {
8
- return /^https?:\/\//i.test(spec);
9
- }
10
- function isSpecialUrl(spec) {
11
- return /^(data|blob):/i.test(spec);
12
- }
13
- function isBareModule(spec) {
14
- return !spec.startsWith('./') && !spec.startsWith('../') && !spec.startsWith('/') && !spec.startsWith('#/');
15
- }
16
- class ScriptRegistry {
17
- _vfs;
18
- _scriptsRoot;
19
- _built = new Map();
20
- _editorMode = false;
21
- constructor(vfs, scriptsRoot, editorMode){
22
- this._vfs = vfs;
23
- this._scriptsRoot = scriptsRoot;
24
- this._editorMode = editorMode;
25
- }
26
- get VFS() {
27
- return this._vfs;
28
- }
29
- set VFS(vfs) {
30
- this._vfs = vfs;
31
- }
32
- get editorMode() {
33
- return this._editorMode;
34
- }
35
- set editorMode(val) {
36
- this._editorMode = val;
37
- }
38
- get scriptsRoot() {
39
- return this._scriptsRoot;
40
- }
41
- set scriptsRoot(path) {
42
- this._scriptsRoot = path;
43
- }
44
- async fetchSource(_id) {
45
- let type = null;
46
- let pathWithExt = '';
47
- if (_id.endsWith('.ts')) {
48
- pathWithExt = _id;
49
- type = 'ts';
50
- } else if (_id.endsWith('.js')) {
51
- pathWithExt = _id;
52
- type = 'js';
53
- }
54
- if (type) {
55
- const exists = await this._vfs.exists(pathWithExt);
56
- if (!exists) {
57
- type = null;
58
- }
59
- const stat = await this._vfs.stat(pathWithExt);
60
- if (stat.isDirectory) {
61
- type = null;
62
- }
63
- }
64
- const types = [
65
- 'ts',
66
- 'js'
67
- ];
68
- if (!type) {
69
- for (const t of types){
70
- pathWithExt = `${_id}.${t}`;
71
- const exists = await this._vfs.exists(pathWithExt);
72
- if (exists) {
73
- const stats = await this._vfs.stat(pathWithExt);
74
- if (stats.isFile) {
75
- type = t;
76
- break;
77
- }
78
- }
79
- }
80
- }
81
- if (type) {
82
- const code = await this._vfs.readFile(pathWithExt, {
83
- encoding: 'utf8'
84
- });
85
- return {
86
- code,
87
- type,
88
- path: pathWithExt
89
- };
90
- }
91
- }
92
- async resolveRuntimeUrl(entryId) {
93
- const id = this.resolveLogicalId(entryId);
94
- return this._editorMode ? await this.build(String(id)) : id;
95
- }
96
- async getDependencies(entryId, fromId, dependencies) {
97
- const reStatic = /\b(?:import|export)\s+[^"']*?from\s+(['"])([^'"]+)\1/g;
98
- const reDynamic = /\bimport\s*\(\s*(['"])([^'"]+)\1\s*\)/g;
99
- const normalizedId = this.resolveLogicalId(entryId, fromId);
100
- const srcPath = await this.resolveSourcePath(normalizedId);
101
- if (!srcPath || dependencies[srcPath.path] !== undefined) {
102
- return;
103
- }
104
- const code = await this._vfs.readFile(srcPath.path, {
105
- encoding: 'utf8'
106
- });
107
- dependencies[srcPath.path] = code;
108
- const gather = async (input, re)=>{
109
- for(;;){
110
- const m = re.exec(input);
111
- if (!m) {
112
- break;
113
- }
114
- const spec = m[2];
115
- if (spec.startsWith('./') || spec.startsWith('../')) {
116
- await this.getDependencies(spec, normalizedId, dependencies);
117
- }
118
- }
119
- };
120
- await gather(code, reStatic);
121
- await gather(code, reDynamic);
122
- }
123
- async build(id) {
124
- const key = String(id);
125
- const cached = this._built.get(key);
126
- if (cached) {
127
- return cached;
128
- }
129
- const srcPath = await this.resolveSourcePath(key);
130
- if (!srcPath) {
131
- return '';
132
- }
133
- const code = await this._vfs.readFile(srcPath.path, {
134
- encoding: 'utf8'
135
- });
136
- const rewritten = await this.rewriteImports(code, key);
137
- const js = await this.transpile(rewritten, key, srcPath.type);
138
- const url = toDataUrl(js, key);
139
- this._built.set(key, url);
140
- return url;
141
- }
142
- async transpile(code, _id, type) {
143
- const logicalId = String(_id);
144
- if (type === 'js') {
145
- return `${code}\n//# sourceURL=${logicalId}`;
146
- }
147
- const ts = window.ts;
148
- if (!ts) {
149
- throw new Error('TypeScript runtime (window.ts) not found. Load typescript.js first.');
150
- }
151
- const res = ts.transpileModule(code, {
152
- compilerOptions: {
153
- target: ts.ScriptTarget.ES2015,
154
- module: ts.ModuleKind.ESNext,
155
- sourceMap: true,
156
- inlineSources: true,
157
- experimentalDecorators: true,
158
- useDefineForClassFields: false
159
- },
160
- fileName: logicalId
161
- });
162
- let out = res.outputText || '';
163
- if (res.sourceMapText) {
164
- const mapBase64 = btoa(unescape(encodeURIComponent(res.sourceMapText)));
165
- out += `\n//# sourceMappingURL=data:application/json;base64,${mapBase64}`;
166
- }
167
- out += `\n//# sourceURL=${logicalId}`;
168
- return out;
169
- }
170
- async rewriteImports(code, fromId) {
171
- const reStatic = /\b(?:import|export)\s+[^"']*?from\s+(['"])([^'"]+)\1/g;
172
- const reDynamic = /\bimport\s*\(\s*(['"])([^'"]+)\1\s*\)/g;
173
- const replaceAsync = async (input, re)=>{
174
- let out = '';
175
- let last = 0;
176
- for(;;){
177
- const m = re.exec(input);
178
- if (!m) {
179
- break;
180
- }
181
- out += input.slice(last, m.index);
182
- const quote = m[1];
183
- const spec = m[2];
184
- let replacement = spec;
185
- if (isAbsoluteUrl(spec) || isSpecialUrl(spec) || isBareModule(spec)) {
186
- replacement = spec;
187
- } else {
188
- const depId = this.resolveLogicalId(spec, String(fromId));
189
- replacement = await this.build(depId); // 递归构建为 data URL
190
- }
191
- const replaced = m[0].replace(`${quote}${spec}${quote}`, `${quote}${replacement}${quote}`);
192
- out += replaced;
193
- last = m.index + m[0].length;
194
- }
195
- out += input.slice(last);
196
- return out;
197
- };
198
- let out = await replaceAsync(code, reStatic);
199
- out = await replaceAsync(out, reDynamic);
200
- return out;
201
- }
202
- resolveLogicalId(spec, fromId) {
203
- let path;
204
- if (spec.startsWith('#/')) {
205
- path = this._vfs.normalizePath(this._vfs.join(this._scriptsRoot, spec.slice(2)));
206
- } else if (spec.startsWith('./') || spec.startsWith('../')) {
207
- if (!fromId) {
208
- throw new Error(`Relative import "${spec}" requires fromId`);
209
- }
210
- path = this._vfs.normalizePath(this._vfs.join(this._vfs.dirname(this._vfs.normalizePath(fromId)), spec));
211
- } else if (spec.startsWith('/')) {
212
- path = spec.replace(/^\/+/, '/');
213
- } else {
214
- return spec;
215
- }
216
- return path;
217
- }
218
- async resolveSourcePath(logicalId) {
219
- let type = null;
220
- let pathWithExt = '';
221
- if (logicalId.endsWith('.ts')) {
222
- pathWithExt = logicalId;
223
- type = 'ts';
224
- } else if (logicalId.endsWith('.js')) {
225
- pathWithExt = logicalId;
226
- type = 'js';
227
- }
228
- if (type) {
229
- const exists = await this._vfs.exists(pathWithExt);
230
- if (!exists) {
231
- type = null;
232
- }
233
- const stat = await this._vfs.stat(pathWithExt);
234
- if (stat.isDirectory) {
235
- type = null;
236
- }
237
- }
238
- const types = [
239
- 'ts',
240
- 'js'
241
- ];
242
- if (!type) {
243
- for (const t of types){
244
- pathWithExt = `${logicalId}.${t}`;
245
- const exists = await this._vfs.exists(pathWithExt);
246
- if (exists) {
247
- const stats = await this._vfs.stat(pathWithExt);
248
- if (stats.isFile) {
249
- type = t;
250
- break;
251
- }
252
- }
253
- }
254
- }
255
- return type ? {
256
- type,
257
- path: pathWithExt
258
- } : null;
259
- }
260
- }
261
-
262
- export { ScriptRegistry };
263
- //# sourceMappingURL=scriptregistry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scriptregistry.js","sources":["../../../../../../node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js"],"sourcesContent":["import { textToBase64 } from '@zephyr3d/base';\n\nfunction toDataUrl(js, id) {\n const b64 = textToBase64(js);\n return `data:text/javascript;base64,${b64}#${encodeURIComponent(String(id))}`;\n}\nfunction isAbsoluteUrl(spec) {\n return /^https?:\\/\\//i.test(spec);\n}\nfunction isSpecialUrl(spec) {\n return /^(data|blob):/i.test(spec);\n}\nfunction isBareModule(spec) {\n return !spec.startsWith('./') && !spec.startsWith('../') && !spec.startsWith('/') && !spec.startsWith('#/');\n}\nclass ScriptRegistry {\n _vfs;\n _scriptsRoot;\n _built = new Map();\n _editorMode = false;\n constructor(vfs, scriptsRoot, editorMode){\n this._vfs = vfs;\n this._scriptsRoot = scriptsRoot;\n this._editorMode = editorMode;\n }\n get VFS() {\n return this._vfs;\n }\n set VFS(vfs) {\n this._vfs = vfs;\n }\n get editorMode() {\n return this._editorMode;\n }\n set editorMode(val) {\n this._editorMode = val;\n }\n get scriptsRoot() {\n return this._scriptsRoot;\n }\n set scriptsRoot(path) {\n this._scriptsRoot = path;\n }\n async fetchSource(_id) {\n let type = null;\n let pathWithExt = '';\n if (_id.endsWith('.ts')) {\n pathWithExt = _id;\n type = 'ts';\n } else if (_id.endsWith('.js')) {\n pathWithExt = _id;\n type = 'js';\n }\n if (type) {\n const exists = await this._vfs.exists(pathWithExt);\n if (!exists) {\n type = null;\n }\n const stat = await this._vfs.stat(pathWithExt);\n if (stat.isDirectory) {\n type = null;\n }\n }\n const types = [\n 'ts',\n 'js'\n ];\n if (!type) {\n for (const t of types){\n pathWithExt = `${_id}.${t}`;\n const exists = await this._vfs.exists(pathWithExt);\n if (exists) {\n const stats = await this._vfs.stat(pathWithExt);\n if (stats.isFile) {\n type = t;\n break;\n }\n }\n }\n }\n if (type) {\n const code = await this._vfs.readFile(pathWithExt, {\n encoding: 'utf8'\n });\n return {\n code,\n type,\n path: pathWithExt\n };\n }\n }\n async resolveRuntimeUrl(entryId) {\n const id = this.resolveLogicalId(entryId);\n return this._editorMode ? await this.build(String(id)) : id;\n }\n async getDependencies(entryId, fromId, dependencies) {\n const reStatic = /\\b(?:import|export)\\s+[^\"']*?from\\s+(['\"])([^'\"]+)\\1/g;\n const reDynamic = /\\bimport\\s*\\(\\s*(['\"])([^'\"]+)\\1\\s*\\)/g;\n const normalizedId = this.resolveLogicalId(entryId, fromId);\n const srcPath = await this.resolveSourcePath(normalizedId);\n if (!srcPath || dependencies[srcPath.path] !== undefined) {\n return;\n }\n const code = await this._vfs.readFile(srcPath.path, {\n encoding: 'utf8'\n });\n dependencies[srcPath.path] = code;\n const gather = async (input, re)=>{\n for(;;){\n const m = re.exec(input);\n if (!m) {\n break;\n }\n const spec = m[2];\n if (spec.startsWith('./') || spec.startsWith('../')) {\n await this.getDependencies(spec, normalizedId, dependencies);\n }\n }\n };\n await gather(code, reStatic);\n await gather(code, reDynamic);\n }\n async build(id) {\n const key = String(id);\n const cached = this._built.get(key);\n if (cached) {\n return cached;\n }\n const srcPath = await this.resolveSourcePath(key);\n if (!srcPath) {\n return '';\n }\n const code = await this._vfs.readFile(srcPath.path, {\n encoding: 'utf8'\n });\n const rewritten = await this.rewriteImports(code, key);\n const js = await this.transpile(rewritten, key, srcPath.type);\n const url = toDataUrl(js, key);\n this._built.set(key, url);\n return url;\n }\n async transpile(code, _id, type) {\n const logicalId = String(_id);\n if (type === 'js') {\n return `${code}\\n//# sourceURL=${logicalId}`;\n }\n const ts = window.ts;\n if (!ts) {\n throw new Error('TypeScript runtime (window.ts) not found. Load typescript.js first.');\n }\n const res = ts.transpileModule(code, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2015,\n module: ts.ModuleKind.ESNext,\n sourceMap: true,\n inlineSources: true,\n experimentalDecorators: true,\n useDefineForClassFields: false\n },\n fileName: logicalId\n });\n let out = res.outputText || '';\n if (res.sourceMapText) {\n const mapBase64 = btoa(unescape(encodeURIComponent(res.sourceMapText)));\n out += `\\n//# sourceMappingURL=data:application/json;base64,${mapBase64}`;\n }\n out += `\\n//# sourceURL=${logicalId}`;\n return out;\n }\n async rewriteImports(code, fromId) {\n const reStatic = /\\b(?:import|export)\\s+[^\"']*?from\\s+(['\"])([^'\"]+)\\1/g;\n const reDynamic = /\\bimport\\s*\\(\\s*(['\"])([^'\"]+)\\1\\s*\\)/g;\n const replaceAsync = async (input, re)=>{\n let out = '';\n let last = 0;\n for(;;){\n const m = re.exec(input);\n if (!m) {\n break;\n }\n out += input.slice(last, m.index);\n const quote = m[1];\n const spec = m[2];\n let replacement = spec;\n if (isAbsoluteUrl(spec) || isSpecialUrl(spec) || isBareModule(spec)) {\n replacement = spec;\n } else {\n const depId = this.resolveLogicalId(spec, String(fromId));\n replacement = await this.build(depId); // 递归构建为 data URL\n }\n const replaced = m[0].replace(`${quote}${spec}${quote}`, `${quote}${replacement}${quote}`);\n out += replaced;\n last = m.index + m[0].length;\n }\n out += input.slice(last);\n return out;\n };\n let out = await replaceAsync(code, reStatic);\n out = await replaceAsync(out, reDynamic);\n return out;\n }\n resolveLogicalId(spec, fromId) {\n let path;\n if (spec.startsWith('#/')) {\n path = this._vfs.normalizePath(this._vfs.join(this._scriptsRoot, spec.slice(2)));\n } else if (spec.startsWith('./') || spec.startsWith('../')) {\n if (!fromId) {\n throw new Error(`Relative import \"${spec}\" requires fromId`);\n }\n path = this._vfs.normalizePath(this._vfs.join(this._vfs.dirname(this._vfs.normalizePath(fromId)), spec));\n } else if (spec.startsWith('/')) {\n path = spec.replace(/^\\/+/, '/');\n } else {\n return spec;\n }\n return path;\n }\n async resolveSourcePath(logicalId) {\n let type = null;\n let pathWithExt = '';\n if (logicalId.endsWith('.ts')) {\n pathWithExt = logicalId;\n type = 'ts';\n } else if (logicalId.endsWith('.js')) {\n pathWithExt = logicalId;\n type = 'js';\n }\n if (type) {\n const exists = await this._vfs.exists(pathWithExt);\n if (!exists) {\n type = null;\n }\n const stat = await this._vfs.stat(pathWithExt);\n if (stat.isDirectory) {\n type = null;\n }\n }\n const types = [\n 'ts',\n 'js'\n ];\n if (!type) {\n for (const t of types){\n pathWithExt = `${logicalId}.${t}`;\n const exists = await this._vfs.exists(pathWithExt);\n if (exists) {\n const stats = await this._vfs.stat(pathWithExt);\n if (stats.isFile) {\n type = t;\n break;\n }\n }\n }\n }\n return type ? {\n type,\n path: pathWithExt\n } : null;\n }\n}\n\nexport { ScriptRegistry };\n//# sourceMappingURL=scriptregistry.js.map\n"],"names":[],"mappings":";;AAEA,SAAS,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE;AAC3B,IAAI,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,CAAC;AAChC,IAAI,OAAO,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACjF;AACA,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B,IAAI,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;AACrC;AACA,SAAS,YAAY,CAAC,IAAI,EAAE;AAC5B,IAAI,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;AACtC;AACA,SAAS,YAAY,CAAC,IAAI,EAAE;AAC5B,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;AAC/G;AACA,MAAM,cAAc,CAAC;AACrB,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,MAAM,GAAG,IAAI,GAAG,EAAE;AACtB,IAAI,WAAW,GAAG,KAAK;AACvB,IAAI,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC;AAC7C,QAAQ,IAAI,CAAC,IAAI,GAAG,GAAG;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