@zephyr3d/scene 0.9.1 → 0.9.3

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 (522) hide show
  1. package/dist/animation/animationset.js +2 -0
  2. package/dist/animation/animationset.js.map +1 -1
  3. package/dist/animation/cloth/gpu_cloth_system.js +9 -1
  4. package/dist/animation/cloth/gpu_cloth_system.js.map +1 -1
  5. package/dist/animation/fixed_geometry_cache_track.js +5 -1
  6. package/dist/animation/fixed_geometry_cache_track.js.map +1 -1
  7. package/dist/animation/geometry_cache_utils.js +20 -4
  8. package/dist/animation/geometry_cache_utils.js.map +1 -1
  9. package/dist/animation/ik/ik_angle_constraint.js +2 -6
  10. package/dist/animation/ik/ik_angle_constraint.js.map +1 -1
  11. package/dist/animation/ik/ik_chain_builder.js +68 -0
  12. package/dist/animation/ik/ik_chain_builder.js.map +1 -0
  13. package/dist/animation/ik/ik_pole_constraint.js +2 -7
  14. package/dist/animation/ik/ik_pole_constraint.js.map +1 -1
  15. package/dist/animation/ik/two_bone_ik_solver.js +2 -6
  16. package/dist/animation/ik/two_bone_ik_solver.js.map +1 -1
  17. package/dist/animation/joint_dynamics/collision.js +60 -12
  18. package/dist/animation/joint_dynamics/collision.js.map +1 -1
  19. package/dist/animation/joint_dynamics/constraints.js +20 -4
  20. package/dist/animation/joint_dynamics/constraints.js.map +1 -1
  21. package/dist/animation/joint_dynamics/controller.js +94 -46
  22. package/dist/animation/joint_dynamics/controller.js.map +1 -1
  23. package/dist/animation/joint_dynamics/math.js +16 -0
  24. package/dist/animation/joint_dynamics/math.js.map +1 -0
  25. package/dist/animation/joint_dynamics/solver.js +21 -11
  26. package/dist/animation/joint_dynamics/solver.js.map +1 -1
  27. package/dist/animation/joint_dynamics/types.js +15 -3
  28. package/dist/animation/joint_dynamics/types.js.map +1 -1
  29. package/dist/animation/pca_geometry_cache_track.js +5 -1
  30. package/dist/animation/pca_geometry_cache_track.js.map +1 -1
  31. package/dist/animation/skeleton.js +2 -2
  32. package/dist/animation/skeleton.js.map +1 -1
  33. package/dist/animation/skeleton_modifier.js +2 -6
  34. package/dist/animation/skeleton_modifier.js.map +1 -1
  35. package/dist/animation/spring/spring_particle.js +4 -4
  36. package/dist/animation/spring/spring_particle.js.map +1 -1
  37. package/dist/animation/spring/spring_system.js +13 -40
  38. package/dist/animation/spring/spring_system.js.map +1 -1
  39. package/dist/animation/spring2/constraints.js.map +1 -1
  40. package/dist/animation/spring2/controller.js +64 -64
  41. package/dist/animation/spring2/controller.js.map +1 -1
  42. package/dist/animation/spring2/math.js.map +1 -1
  43. package/dist/animation/spring2/spring_system.js +8 -8
  44. package/dist/animation/spring2/spring_system.js.map +1 -1
  45. package/dist/app/app.js.map +1 -1
  46. package/dist/app/engine.js +1 -1
  47. package/dist/app/engine.js.map +1 -1
  48. package/dist/app/screen.js +4 -4
  49. package/dist/app/screen.js.map +1 -1
  50. package/dist/app/scriptingsystem.js +24 -1
  51. package/dist/app/scriptingsystem.js.map +1 -1
  52. package/dist/app/scriptregistry.js +22 -1
  53. package/dist/app/scriptregistry.js.map +1 -1
  54. package/dist/asset/assetmanager.js +2 -2
  55. package/dist/asset/assetmanager.js.map +1 -1
  56. package/dist/asset/model.js +60 -60
  57. package/dist/asset/model.js.map +1 -1
  58. package/dist/camera/camera.js +1 -1
  59. package/dist/camera/camera.js.map +1 -1
  60. package/dist/camera/orbit.js.map +1 -1
  61. package/dist/index.d.ts +795 -266
  62. package/dist/index.js +3 -2
  63. package/dist/index.js.map +1 -1
  64. package/dist/material/material.js +3 -1
  65. package/dist/material/material.js.map +1 -1
  66. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
  67. package/dist/material/shader/helper.js +281 -278
  68. package/dist/material/shader/helper.js.map +1 -1
  69. package/dist/material/sprite.js +6 -6
  70. package/dist/material/sprite.js.map +1 -1
  71. package/dist/material/terrain-cm.js +2 -2
  72. package/dist/material/terrain-cm.js.map +1 -1
  73. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js +38 -0
  74. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js.map +1 -0
  75. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js +10 -0
  76. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js.map +1 -0
  77. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js +127 -0
  78. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js.map +1 -0
  79. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js +263 -0
  80. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js.map +1 -0
  81. package/dist/posteffect/taa.js +31 -39
  82. package/dist/posteffect/taa.js.map +1 -1
  83. package/dist/render/cluster_light.js +3 -4
  84. package/dist/render/cluster_light.js.map +1 -1
  85. package/dist/render/drawable.js +5 -1
  86. package/dist/render/drawable.js.map +1 -1
  87. package/dist/render/rendergraph/device_pool_allocator.js +29 -3
  88. package/dist/render/rendergraph/device_pool_allocator.js.map +1 -1
  89. package/dist/render/rendergraph/executor.js +283 -33
  90. package/dist/render/rendergraph/executor.js.map +1 -1
  91. package/dist/render/rendergraph/forward_plus_builder.js +338 -108
  92. package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
  93. package/dist/render/rendergraph/history_resource_manager.js +195 -115
  94. package/dist/render/rendergraph/history_resource_manager.js.map +1 -1
  95. package/dist/render/rendergraph/history_resources.js +10 -0
  96. package/dist/render/rendergraph/history_resources.js.map +1 -0
  97. package/dist/render/rendergraph/rendergraph.js +162 -35
  98. package/dist/render/rendergraph/rendergraph.js.map +1 -1
  99. package/dist/render/rendergraph/types.js +25 -5
  100. package/dist/render/rendergraph/types.js.map +1 -1
  101. package/dist/render/rendertarget.js +5 -1
  102. package/dist/render/rendertarget.js.map +1 -1
  103. package/dist/render/screenrendertarget.js +5 -1
  104. package/dist/render/screenrendertarget.js.map +1 -1
  105. package/dist/render/sky.js +4 -4
  106. package/dist/render/sky.js.map +1 -1
  107. package/dist/scene/basesprite.js +2 -2
  108. package/dist/scene/basesprite.js.map +1 -1
  109. package/dist/scene/graph_node.js +1 -1
  110. package/dist/scene/graph_node.js.map +1 -1
  111. package/dist/scene/mesh.js +81 -97
  112. package/dist/scene/mesh.js.map +1 -1
  113. package/dist/scene/particlesys.js +1 -1
  114. package/dist/scene/particlesys.js.map +1 -1
  115. package/dist/scene/scene_node.js +228 -228
  116. package/dist/scene/scene_node.js.map +1 -1
  117. package/dist/scene/script_attachment.js +15 -3
  118. package/dist/scene/script_attachment.js.map +1 -1
  119. package/dist/scene/terrain-cm/terrain-cm.js +3 -3
  120. package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
  121. package/dist/shadow/shadowmapper.js.map +1 -1
  122. package/dist/shapes/box.js +1 -1
  123. package/dist/shapes/box.js.map +1 -1
  124. package/dist/shapes/capsule.js +0 -3
  125. package/dist/shapes/capsule.js.map +1 -1
  126. package/dist/shapes/cylinder.js +0 -3
  127. package/dist/shapes/cylinder.js.map +1 -1
  128. package/dist/shapes/plane.js +0 -3
  129. package/dist/shapes/plane.js.map +1 -1
  130. package/dist/shapes/tetrahedron.js +3 -9
  131. package/dist/shapes/tetrahedron.js.map +1 -1
  132. package/dist/shapes/torus.js +94 -66
  133. package/dist/shapes/torus.js.map +1 -1
  134. package/dist/src/animation/animation.js +127 -0
  135. package/dist/src/animation/animation.js.map +1 -0
  136. package/dist/src/animation/animationset.js +255 -0
  137. package/dist/src/animation/animationset.js.map +1 -0
  138. package/dist/src/animation/animationtrack.js +34 -0
  139. package/dist/src/animation/animationtrack.js.map +1 -0
  140. package/dist/src/animation/eulerrotationtrack.js +52 -0
  141. package/dist/src/animation/eulerrotationtrack.js.map +1 -0
  142. package/dist/src/animation/morphtarget.js +93 -0
  143. package/dist/src/animation/morphtarget.js.map +1 -0
  144. package/dist/src/animation/morphtrack.js +70 -0
  145. package/dist/src/animation/morphtrack.js.map +1 -0
  146. package/dist/src/animation/proptrack.js +161 -0
  147. package/dist/src/animation/proptrack.js.map +1 -0
  148. package/dist/src/animation/rotationtrack.js +51 -0
  149. package/dist/src/animation/rotationtrack.js.map +1 -0
  150. package/dist/src/animation/scaletrack.js +50 -0
  151. package/dist/src/animation/scaletrack.js.map +1 -0
  152. package/dist/src/animation/skeleton.js +204 -0
  153. package/dist/src/animation/skeleton.js.map +1 -0
  154. package/dist/src/animation/translationtrack.js +50 -0
  155. package/dist/src/animation/translationtrack.js.map +1 -0
  156. package/dist/src/app/app.js +129 -0
  157. package/dist/src/app/app.js.map +1 -0
  158. package/dist/src/app/inputmgr.js +267 -0
  159. package/dist/src/app/inputmgr.js.map +1 -0
  160. package/dist/src/asset/assetmanager.js +404 -0
  161. package/dist/src/asset/assetmanager.js.map +1 -0
  162. package/dist/src/asset/builtin.js +337 -0
  163. package/dist/src/asset/builtin.js.map +1 -0
  164. package/dist/src/asset/loaders/dds/dds.js +470 -0
  165. package/dist/src/asset/loaders/dds/dds.js.map +1 -0
  166. package/dist/src/asset/loaders/dds/dds_loader.js +28 -0
  167. package/dist/src/asset/loaders/dds/dds_loader.js.map +1 -0
  168. package/dist/src/asset/loaders/gltf/gltf_loader.js +1265 -0
  169. package/dist/src/asset/loaders/gltf/gltf_loader.js.map +1 -0
  170. package/dist/src/asset/loaders/gltf/helpers.js +327 -0
  171. package/dist/src/asset/loaders/gltf/helpers.js.map +1 -0
  172. package/dist/src/asset/loaders/hdr/hdr.js +180 -0
  173. package/dist/src/asset/loaders/hdr/hdr.js.map +1 -0
  174. package/dist/src/asset/loaders/image/tga_Loader.js +116 -0
  175. package/dist/src/asset/loaders/image/tga_Loader.js.map +1 -0
  176. package/dist/src/asset/loaders/image/webimage_loader.js +63 -0
  177. package/dist/src/asset/loaders/image/webimage_loader.js.map +1 -0
  178. package/dist/src/asset/loaders/loader.js +45 -0
  179. package/dist/src/asset/loaders/loader.js.map +1 -0
  180. package/dist/src/asset/model.js +414 -0
  181. package/dist/src/asset/model.js.map +1 -0
  182. package/dist/src/blitter/bilateralblur.js +221 -0
  183. package/dist/src/blitter/bilateralblur.js.map +1 -0
  184. package/dist/src/blitter/blitter.js +390 -0
  185. package/dist/src/blitter/blitter.js.map +1 -0
  186. package/dist/src/blitter/box.js +118 -0
  187. package/dist/src/blitter/box.js.map +1 -0
  188. package/dist/src/blitter/copy.js +22 -0
  189. package/dist/src/blitter/copy.js.map +1 -0
  190. package/dist/src/blitter/gaussianblur.js +228 -0
  191. package/dist/src/blitter/gaussianblur.js.map +1 -0
  192. package/dist/src/camera/base.js +92 -0
  193. package/dist/src/camera/base.js.map +1 -0
  194. package/dist/src/camera/camera.js +1005 -0
  195. package/dist/src/camera/camera.js.map +1 -0
  196. package/dist/src/camera/fps.js +238 -0
  197. package/dist/src/camera/fps.js.map +1 -0
  198. package/dist/src/camera/orbit.js +245 -0
  199. package/dist/src/camera/orbit.js.map +1 -0
  200. package/dist/src/camera/orthocamera.js +167 -0
  201. package/dist/src/camera/orthocamera.js.map +1 -0
  202. package/dist/src/camera/perspectivecamera.js +141 -0
  203. package/dist/src/camera/perspectivecamera.js.map +1 -0
  204. package/dist/src/index.js +120 -0
  205. package/dist/src/index.js.map +1 -0
  206. package/dist/src/material/blinn.js +81 -0
  207. package/dist/src/material/blinn.js.map +1 -0
  208. package/dist/src/material/grassmaterial.js +113 -0
  209. package/dist/src/material/grassmaterial.js.map +1 -0
  210. package/dist/src/material/lambert.js +92 -0
  211. package/dist/src/material/lambert.js.map +1 -0
  212. package/dist/src/material/material.js +301 -0
  213. package/dist/src/material/material.js.map +1 -0
  214. package/dist/src/material/meshmaterial.js +704 -0
  215. package/dist/src/material/meshmaterial.js.map +1 -0
  216. package/dist/src/material/mixins/albedocolor.js +76 -0
  217. package/dist/src/material/mixins/albedocolor.js.map +1 -0
  218. package/dist/src/material/mixins/foliage.js +47 -0
  219. package/dist/src/material/mixins/foliage.js.map +1 -0
  220. package/dist/src/material/mixins/lightmodel/blinnphong.js +112 -0
  221. package/dist/src/material/mixins/lightmodel/blinnphong.js.map +1 -0
  222. package/dist/src/material/mixins/lightmodel/lambert.js +58 -0
  223. package/dist/src/material/mixins/lightmodel/lambert.js.map +1 -0
  224. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js +178 -0
  225. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -0
  226. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js +139 -0
  227. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -0
  228. package/dist/src/material/mixins/lit.js +476 -0
  229. package/dist/src/material/mixins/lit.js.map +1 -0
  230. package/dist/src/material/mixins/pbr/common.js +918 -0
  231. package/dist/src/material/mixins/pbr/common.js.map +1 -0
  232. package/dist/src/material/mixins/texture.js +172 -0
  233. package/dist/src/material/mixins/texture.js.map +1 -0
  234. package/dist/src/material/mixins/vertexcolor.js +56 -0
  235. package/dist/src/material/mixins/vertexcolor.js.map +1 -0
  236. package/dist/src/material/particle.js +178 -0
  237. package/dist/src/material/particle.js.map +1 -0
  238. package/dist/src/material/pbrmr.js +97 -0
  239. package/dist/src/material/pbrmr.js.map +1 -0
  240. package/dist/src/material/pbrsg.js +97 -0
  241. package/dist/src/material/pbrsg.js.map +1 -0
  242. package/dist/src/material/shader/helper.js +1209 -0
  243. package/dist/src/material/shader/helper.js.map +1 -0
  244. package/dist/src/material/terrain-cm.js +606 -0
  245. package/dist/src/material/terrain-cm.js.map +1 -0
  246. package/dist/src/material/terrainmaterial.js +375 -0
  247. package/dist/src/material/terrainmaterial.js.map +1 -0
  248. package/dist/src/material/unlit.js +41 -0
  249. package/dist/src/material/unlit.js.map +1 -0
  250. package/dist/src/material/water.js +417 -0
  251. package/dist/src/material/water.js.map +1 -0
  252. package/dist/src/posteffect/bloom.js +361 -0
  253. package/dist/src/posteffect/bloom.js.map +1 -0
  254. package/dist/src/posteffect/compositor.js +226 -0
  255. package/dist/src/posteffect/compositor.js.map +1 -0
  256. package/dist/src/posteffect/fxaa.js +273 -0
  257. package/dist/src/posteffect/fxaa.js.map +1 -0
  258. package/dist/src/posteffect/grayscale.js +69 -0
  259. package/dist/src/posteffect/grayscale.js.map +1 -0
  260. package/dist/src/posteffect/motionblur.js +96 -0
  261. package/dist/src/posteffect/motionblur.js.map +1 -0
  262. package/dist/src/posteffect/posteffect.js +126 -0
  263. package/dist/src/posteffect/posteffect.js.map +1 -0
  264. package/dist/src/posteffect/sao.js +324 -0
  265. package/dist/src/posteffect/sao.js.map +1 -0
  266. package/dist/src/posteffect/ssr.js +489 -0
  267. package/dist/src/posteffect/ssr.js.map +1 -0
  268. package/dist/src/posteffect/taa.js +172 -0
  269. package/dist/src/posteffect/taa.js.map +1 -0
  270. package/dist/src/posteffect/tonemap.js +94 -0
  271. package/dist/src/posteffect/tonemap.js.map +1 -0
  272. package/dist/src/render/abuffer_oit.js +361 -0
  273. package/dist/src/render/abuffer_oit.js.map +1 -0
  274. package/dist/src/render/clipmap.js +851 -0
  275. package/dist/src/render/clipmap.js.map +1 -0
  276. package/dist/src/render/cluster_light.js +333 -0
  277. package/dist/src/render/cluster_light.js.map +1 -0
  278. package/dist/src/render/cull_visitor.js +187 -0
  279. package/dist/src/render/cull_visitor.js.map +1 -0
  280. package/dist/src/render/depthpass.js +68 -0
  281. package/dist/src/render/depthpass.js.map +1 -0
  282. package/dist/src/render/drawable_mixin.js +227 -0
  283. package/dist/src/render/drawable_mixin.js.map +1 -0
  284. package/dist/src/render/envlight.js +463 -0
  285. package/dist/src/render/envlight.js.map +1 -0
  286. package/dist/src/render/fbm_wavegenerator.js +251 -0
  287. package/dist/src/render/fbm_wavegenerator.js.map +1 -0
  288. package/dist/src/render/fft_wavegenerator.js +1006 -0
  289. package/dist/src/render/fft_wavegenerator.js.map +1 -0
  290. package/dist/src/render/fullscreenquad.js +38 -0
  291. package/dist/src/render/fullscreenquad.js.map +1 -0
  292. package/dist/src/render/gerstner_wavegenerator.js +314 -0
  293. package/dist/src/render/gerstner_wavegenerator.js.map +1 -0
  294. package/dist/src/render/globalbindgroup_allocator.js +60 -0
  295. package/dist/src/render/globalbindgroup_allocator.js.map +1 -0
  296. package/dist/src/render/hzb.js +273 -0
  297. package/dist/src/render/hzb.js.map +1 -0
  298. package/dist/src/render/lightpass.js +172 -0
  299. package/dist/src/render/lightpass.js.map +1 -0
  300. package/dist/src/render/objectcolorpass.js +51 -0
  301. package/dist/src/render/objectcolorpass.js.map +1 -0
  302. package/dist/src/render/primitive.js +364 -0
  303. package/dist/src/render/primitive.js.map +1 -0
  304. package/dist/src/render/render_queue.js +467 -0
  305. package/dist/src/render/render_queue.js.map +1 -0
  306. package/dist/src/render/renderbundle_wrapper.js +152 -0
  307. package/dist/src/render/renderbundle_wrapper.js.map +1 -0
  308. package/dist/src/render/renderer.js +455 -0
  309. package/dist/src/render/renderer.js.map +1 -0
  310. package/dist/src/render/renderpass.js +200 -0
  311. package/dist/src/render/renderpass.js.map +1 -0
  312. package/dist/src/render/shadowmap_pass.js +56 -0
  313. package/dist/src/render/shadowmap_pass.js.map +1 -0
  314. package/dist/src/render/sky.js +1103 -0
  315. package/dist/src/render/sky.js.map +1 -0
  316. package/dist/src/render/weightedblended_oit.js +168 -0
  317. package/dist/src/render/weightedblended_oit.js.map +1 -0
  318. package/dist/src/scene/batchgroup.js +162 -0
  319. package/dist/src/scene/batchgroup.js.map +1 -0
  320. package/dist/src/scene/environment.js +209 -0
  321. package/dist/src/scene/environment.js.map +1 -0
  322. package/dist/src/scene/graph_node.js +72 -0
  323. package/dist/src/scene/graph_node.js.map +1 -0
  324. package/dist/src/scene/light.js +416 -0
  325. package/dist/src/scene/light.js.map +1 -0
  326. package/dist/src/scene/mesh.js +341 -0
  327. package/dist/src/scene/mesh.js.map +1 -0
  328. package/dist/src/scene/octree.js +649 -0
  329. package/dist/src/scene/octree.js.map +1 -0
  330. package/dist/src/scene/particlesys.js +738 -0
  331. package/dist/src/scene/particlesys.js.map +1 -0
  332. package/dist/src/scene/raycast_visitor.js +103 -0
  333. package/dist/src/scene/raycast_visitor.js.map +1 -0
  334. package/dist/src/scene/scene.js +284 -0
  335. package/dist/src/scene/scene.js.map +1 -0
  336. package/dist/src/scene/scene_node.js +732 -0
  337. package/dist/src/scene/scene_node.js.map +1 -0
  338. package/dist/src/scene/terrain/grass.js +278 -0
  339. package/dist/src/scene/terrain/grass.js.map +1 -0
  340. package/dist/src/scene/terrain/heightfield.js +475 -0
  341. package/dist/src/scene/terrain/heightfield.js.map +1 -0
  342. package/dist/src/scene/terrain/patch.js +530 -0
  343. package/dist/src/scene/terrain/patch.js.map +1 -0
  344. package/dist/src/scene/terrain/quadtree.js +461 -0
  345. package/dist/src/scene/terrain/quadtree.js.map +1 -0
  346. package/dist/src/scene/terrain/terrain.js +246 -0
  347. package/dist/src/scene/terrain/terrain.js.map +1 -0
  348. package/dist/src/scene/terrain-cm/grass.js +594 -0
  349. package/dist/src/scene/terrain-cm/grass.js.map +1 -0
  350. package/dist/src/scene/terrain-cm/grassmaterial.js +159 -0
  351. package/dist/src/scene/terrain-cm/grassmaterial.js.map +1 -0
  352. package/dist/src/scene/terrain-cm/terrain-cm.js +538 -0
  353. package/dist/src/scene/terrain-cm/terrain-cm.js.map +1 -0
  354. package/dist/src/scene/water.js +374 -0
  355. package/dist/src/scene/water.js.map +1 -0
  356. package/dist/src/shaders/atmosphere.js +957 -0
  357. package/dist/src/shaders/atmosphere.js.map +1 -0
  358. package/dist/src/shaders/fog.js +112 -0
  359. package/dist/src/shaders/fog.js.map +1 -0
  360. package/dist/src/shaders/misc.js +266 -0
  361. package/dist/src/shaders/misc.js.map +1 -0
  362. package/dist/src/shaders/noise.js +222 -0
  363. package/dist/src/shaders/noise.js.map +1 -0
  364. package/dist/src/shaders/pbr.js +51 -0
  365. package/dist/src/shaders/pbr.js.map +1 -0
  366. package/dist/src/shaders/shadow.js +636 -0
  367. package/dist/src/shaders/shadow.js.map +1 -0
  368. package/dist/src/shaders/ssr.js +490 -0
  369. package/dist/src/shaders/ssr.js.map +1 -0
  370. package/dist/src/shaders/temporal.js +215 -0
  371. package/dist/src/shaders/temporal.js.map +1 -0
  372. package/dist/src/shaders/water.js +756 -0
  373. package/dist/src/shaders/water.js.map +1 -0
  374. package/dist/src/shadow/esm.js +237 -0
  375. package/dist/src/shadow/esm.js.map +1 -0
  376. package/dist/src/shadow/pcf_opt.js +181 -0
  377. package/dist/src/shadow/pcf_opt.js.map +1 -0
  378. package/dist/src/shadow/pcf_pd.js +189 -0
  379. package/dist/src/shadow/pcf_pd.js.map +1 -0
  380. package/dist/src/shadow/shader.js +37 -0
  381. package/dist/src/shadow/shader.js.map +1 -0
  382. package/dist/src/shadow/shadow_impl.js +15 -0
  383. package/dist/src/shadow/shadow_impl.js.map +1 -0
  384. package/dist/src/shadow/shadowmapper.js +790 -0
  385. package/dist/src/shadow/shadowmapper.js.map +1 -0
  386. package/dist/src/shadow/ssm.js +159 -0
  387. package/dist/src/shadow/ssm.js.map +1 -0
  388. package/dist/src/shadow/vsm.js +297 -0
  389. package/dist/src/shadow/vsm.js.map +1 -0
  390. package/dist/src/shapes/box.js +386 -0
  391. package/dist/src/shapes/box.js.map +1 -0
  392. package/dist/src/shapes/cylinder.js +125 -0
  393. package/dist/src/shapes/cylinder.js.map +1 -0
  394. package/dist/src/shapes/plane.js +88 -0
  395. package/dist/src/shapes/plane.js.map +1 -0
  396. package/dist/src/shapes/shape.js +87 -0
  397. package/dist/src/shapes/shape.js.map +1 -0
  398. package/dist/src/shapes/sphere.js +114 -0
  399. package/dist/src/shapes/sphere.js.map +1 -0
  400. package/dist/src/shapes/tetrahedron.js +188 -0
  401. package/dist/src/shapes/tetrahedron.js.map +1 -0
  402. package/dist/src/shapes/torus.js +111 -0
  403. package/dist/src/shapes/torus.js.map +1 -0
  404. package/dist/src/utility/aabbtree.js +400 -0
  405. package/dist/src/utility/aabbtree.js.map +1 -0
  406. package/dist/src/utility/bounding_volume.js +29 -0
  407. package/dist/src/utility/bounding_volume.js.map +1 -0
  408. package/dist/src/utility/debug.js +28 -0
  409. package/dist/src/utility/debug.js.map +1 -0
  410. package/dist/src/utility/draco/decoder.js +116 -0
  411. package/dist/src/utility/draco/decoder.js.map +1 -0
  412. package/dist/src/utility/misc.js +105 -0
  413. package/dist/src/utility/misc.js.map +1 -0
  414. package/dist/src/utility/panorama.js +163 -0
  415. package/dist/src/utility/panorama.js.map +1 -0
  416. package/dist/src/utility/pmrem.js +354 -0
  417. package/dist/src/utility/pmrem.js.map +1 -0
  418. package/dist/src/utility/rendermipmap.js +115 -0
  419. package/dist/src/utility/rendermipmap.js.map +1 -0
  420. package/dist/src/utility/serialization/json.js +402 -0
  421. package/dist/src/utility/serialization/json.js.map +1 -0
  422. package/dist/src/utility/serialization/manager.js +623 -0
  423. package/dist/src/utility/serialization/manager.js.map +1 -0
  424. package/dist/src/utility/serialization/scene/animation.js +248 -0
  425. package/dist/src/utility/serialization/scene/animation.js.map +1 -0
  426. package/dist/src/utility/serialization/scene/batch.js +59 -0
  427. package/dist/src/utility/serialization/scene/batch.js.map +1 -0
  428. package/dist/src/utility/serialization/scene/camera.js +790 -0
  429. package/dist/src/utility/serialization/scene/camera.js.map +1 -0
  430. package/dist/src/utility/serialization/scene/common.js +222 -0
  431. package/dist/src/utility/serialization/scene/common.js.map +1 -0
  432. package/dist/src/utility/serialization/scene/light.js +575 -0
  433. package/dist/src/utility/serialization/scene/light.js.map +1 -0
  434. package/dist/src/utility/serialization/scene/material.js +1111 -0
  435. package/dist/src/utility/serialization/scene/material.js.map +1 -0
  436. package/dist/src/utility/serialization/scene/mesh.js +148 -0
  437. package/dist/src/utility/serialization/scene/mesh.js.map +1 -0
  438. package/dist/src/utility/serialization/scene/misc.js +39 -0
  439. package/dist/src/utility/serialization/scene/misc.js.map +1 -0
  440. package/dist/src/utility/serialization/scene/node.js +451 -0
  441. package/dist/src/utility/serialization/scene/node.js.map +1 -0
  442. package/dist/src/utility/serialization/scene/particle.js +425 -0
  443. package/dist/src/utility/serialization/scene/particle.js.map +1 -0
  444. package/dist/src/utility/serialization/scene/primitive.js +692 -0
  445. package/dist/src/utility/serialization/scene/primitive.js.map +1 -0
  446. package/dist/src/utility/serialization/scene/scene.js +704 -0
  447. package/dist/src/utility/serialization/scene/scene.js.map +1 -0
  448. package/dist/src/utility/serialization/scene/terrain.js +488 -0
  449. package/dist/src/utility/serialization/scene/terrain.js.map +1 -0
  450. package/dist/src/utility/serialization/scene/water.js +465 -0
  451. package/dist/src/utility/serialization/scene/water.js.map +1 -0
  452. package/dist/src/utility/shprojector.js +297 -0
  453. package/dist/src/utility/shprojector.js.map +1 -0
  454. package/dist/src/utility/textures/ggxlut.js +213 -0
  455. package/dist/src/utility/textures/ggxlut.js.map +1 -0
  456. package/dist/src/utility/textures/gradientnoise.js +62 -0
  457. package/dist/src/utility/textures/gradientnoise.js.map +1 -0
  458. package/dist/src/utility/textures/randomnoise.js +41 -0
  459. package/dist/src/utility/textures/randomnoise.js.map +1 -0
  460. package/dist/src/values.js +162 -0
  461. package/dist/src/values.js.map +1 -0
  462. package/dist/utility/blueprint/material/common.js +7 -0
  463. package/dist/utility/blueprint/material/common.js.map +1 -0
  464. package/dist/utility/blueprint/material/inputs.js +3 -3
  465. package/dist/utility/blueprint/material/inputs.js.map +1 -1
  466. package/dist/utility/blueprint/material/ir.js +4 -4
  467. package/dist/utility/blueprint/material/ir.js.map +1 -1
  468. package/dist/utility/serialization/blueprint/constants.js +255 -0
  469. package/dist/utility/serialization/blueprint/constants.js.map +1 -0
  470. package/dist/utility/serialization/blueprint/material/constants.js +203 -0
  471. package/dist/utility/serialization/blueprint/material/constants.js.map +1 -0
  472. package/dist/utility/serialization/blueprint/material/texture.js +165 -0
  473. package/dist/utility/serialization/blueprint/material/texture.js.map +1 -0
  474. package/dist/utility/serialization/manager.js +299 -268
  475. package/dist/utility/serialization/manager.js.map +1 -1
  476. package/dist/utility/serialization/scene/animation.js +45 -0
  477. package/dist/utility/serialization/scene/animation.js.map +1 -1
  478. package/dist/utility/serialization/scene/camera.js +53 -0
  479. package/dist/utility/serialization/scene/camera.js.map +1 -1
  480. package/dist/utility/serialization/scene/common.js +10 -0
  481. package/dist/utility/serialization/scene/common.js.map +1 -1
  482. package/dist/utility/serialization/scene/light.js +30 -0
  483. package/dist/utility/serialization/scene/light.js.map +1 -1
  484. package/dist/utility/serialization/scene/material.js +63 -0
  485. package/dist/utility/serialization/scene/material.js.map +1 -1
  486. package/dist/utility/serialization/scene/mesh.js +11 -0
  487. package/dist/utility/serialization/scene/mesh.js.map +1 -1
  488. package/dist/utility/serialization/scene/misc.js +2 -0
  489. package/dist/utility/serialization/scene/misc.js.map +1 -1
  490. package/dist/utility/serialization/scene/node.js +19 -0
  491. package/dist/utility/serialization/scene/node.js.map +1 -1
  492. package/dist/utility/serialization/scene/particle.js +22 -0
  493. package/dist/utility/serialization/scene/particle.js.map +1 -1
  494. package/dist/utility/serialization/scene/primitive.js +33 -0
  495. package/dist/utility/serialization/scene/primitive.js.map +1 -1
  496. package/dist/utility/serialization/scene/scene.js +39 -0
  497. package/dist/utility/serialization/scene/scene.js.map +1 -1
  498. package/dist/utility/serialization/scene/script.js +2 -0
  499. package/dist/utility/serialization/scene/script.js.map +1 -1
  500. package/dist/utility/serialization/scene/sprite.js +6 -0
  501. package/dist/utility/serialization/scene/sprite.js.map +1 -1
  502. package/dist/utility/serialization/scene/terrain.js +9 -0
  503. package/dist/utility/serialization/scene/terrain.js.map +1 -1
  504. package/dist/utility/serialization/scene/water.js +21 -0
  505. package/dist/utility/serialization/scene/water.js.map +1 -1
  506. package/dist/utility/serialization/types.js +5 -1
  507. package/dist/utility/serialization/types.js.map +1 -1
  508. package/dist/values.js +49 -53
  509. package/dist/values.js.map +1 -1
  510. package/package.json +2 -2
  511. package/dist/animation/joint_dynamics/vrm_spring_bone.js +0 -46
  512. package/dist/animation/joint_dynamics/vrm_spring_bone.js.map +0 -1
  513. package/dist/animation/spring/spring_bone.js +0 -240
  514. package/dist/animation/spring/spring_bone.js.map +0 -1
  515. package/dist/animation/spring/spring_bone_collider.js +0 -198
  516. package/dist/animation/spring/spring_bone_collider.js.map +0 -1
  517. package/dist/animation/spring/spring_bone_constraint.js +0 -170
  518. package/dist/animation/spring/spring_bone_constraint.js.map +0 -1
  519. package/dist/animation/spring/spring_bone_system.js +0 -328
  520. package/dist/animation/spring/spring_bone_system.js.map +0 -1
  521. package/dist/render/sky_motion_vector.js +0 -85
  522. package/dist/render/sky_motion_vector.js.map +0 -1
package/dist/values.js CHANGED
@@ -1,60 +1,56 @@
1
1
  import { Vector3 } from '@zephyr3d/base';
2
2
 
3
- /**
4
- * Forward render pass type
5
- * @public
3
+ /**
4
+ * Forward render pass type
5
+ * @public
6
6
  */ const RENDER_PASS_TYPE_LIGHT = 0;
7
- /**
8
- * Shadow map render pass type
9
- * @public
7
+ /**
8
+ * Shadow map render pass type
9
+ * @public
10
10
  */ const RENDER_PASS_TYPE_SHADOWMAP = 1;
11
- /**
12
- * Depth only render pass type
13
- * @public
11
+ /**
12
+ * Depth only render pass type
13
+ * @public
14
14
  */ const RENDER_PASS_TYPE_DEPTH = 2;
15
- /**
16
- * Object color render pass type
17
- * @public
15
+ /**
16
+ * Object color render pass type
17
+ * @public
18
18
  */ const RENDER_PASS_TYPE_OBJECT_COLOR = 3;
19
- /**
20
- * Builtin texture name for sheen LUT
21
- * @public
19
+ /**
20
+ * Builtin texture name for sheen LUT
21
+ * @public
22
22
  */ const BUILTIN_ASSET_TEXTURE_SHEEN_LUT = 'LUT_Sheen';
23
- /**
24
- * Builtin cube texture for test
25
- * @public
23
+ /**
24
+ * Builtin cube texture for test
25
+ * @public
26
26
  */ const BUILTIN_ASSET_TEST_CUBEMAP = 'TEST_Cubemap';
27
- /**
28
- * No light
29
- * @public
27
+ /**
28
+ * No light
29
+ * @public
30
30
  */ const LIGHT_TYPE_NONE = 0;
31
- /**
32
- * Directional light type
33
- * @public
31
+ /**
32
+ * Directional light type
33
+ * @public
34
34
  */ const LIGHT_TYPE_DIRECTIONAL = 1;
35
- /**
36
- * Point light type
37
- * @public
35
+ /**
36
+ * Point light type
37
+ * @public
38
38
  */ const LIGHT_TYPE_POINT = 2;
39
- /**
40
- * Spot light type
41
- * @public
39
+ /**
40
+ * Spot light type
41
+ * @public
42
42
  */ const LIGHT_TYPE_SPOT = 3;
43
- /**
44
- * Rectangular area light type
45
- * @public
43
+ /**
44
+ * Rectangular area light type
45
+ * @public
46
46
  */ const LIGHT_TYPE_RECT = 4;
47
- /**
48
- * Max light size for clustered lighting
49
- * @public
50
- */ const MAX_CLUSTERED_LIGHTS = 255;
51
- /**
52
- * Opaque render queue type
53
- * @public
47
+ /**
48
+ * Opaque render queue type
49
+ * @public
54
50
  */ const QUEUE_OPAQUE = 1;
55
- /**
56
- * Transparent render queue type
57
- * @public
51
+ /**
52
+ * Transparent render queue type
53
+ * @public
58
54
  */ const QUEUE_TRANSPARENT = 2;
59
55
  // Morph target attributes
60
56
  /** @public */ const MORPH_TARGET_POSITION = 0;
@@ -71,9 +67,9 @@ import { Vector3 } from '@zephyr3d/base';
71
67
  /** @public */ const MORPH_ATTRIBUTE_VECTOR_COUNT = MAX_MORPH_ATTRIBUTES + 3 >> 2;
72
68
  /** @public */ const MAX_TERRAIN_MIPMAP_LEVELS = 64;
73
69
  /** @public */ const MAX_GERSTNER_WAVE_COUNT = 16;
74
- /**
75
- * Material varying flags
76
- * @public
70
+ /**
71
+ * Material varying flags
72
+ * @public
77
73
  */ var MaterialVaryingFlags = /*#__PURE__*/ function(MaterialVaryingFlags) {
78
74
  MaterialVaryingFlags[MaterialVaryingFlags["MORPH_ANIMATION"] = 1] = "MORPH_ANIMATION";
79
75
  MaterialVaryingFlags[MaterialVaryingFlags["SKIN_ANIMATION"] = 2] = "SKIN_ANIMATION";
@@ -82,13 +78,13 @@ import { Vector3 } from '@zephyr3d/base';
82
78
  MaterialVaryingFlags[MaterialVaryingFlags["APPLY_FOG"] = 16] = "APPLY_FOG";
83
79
  return MaterialVaryingFlags;
84
80
  }({});
85
- /**
86
- * Atmospheric Fog flag
87
- * @public
81
+ /**
82
+ * Atmospheric Fog flag
83
+ * @public
88
84
  */ const ATMOSPHERIC_FOG_BIT = 1 << 0;
89
- /**
90
- * Exponential Fog flag
91
- * @public
85
+ /**
86
+ * Exponential Fog flag
87
+ * @public
92
88
  */ const HEIGHT_FOG_BIT = 1 << 1;
93
89
  /** @internal */ const uniformSphereSamples = [
94
90
  new Vector3(-0.7838, -0.620933, 0.00996137),
@@ -162,5 +158,5 @@ import { Vector3 } from '@zephyr3d/base';
162
158
  return Fog;
163
159
  }({});
164
160
 
165
- export { ATMOSPHERIC_FOG_BIT, BUILTIN_ASSET_TEST_CUBEMAP, BUILTIN_ASSET_TEXTURE_SHEEN_LUT, Fog, HEIGHT_FOG_BIT, LIGHT_TYPE_DIRECTIONAL, LIGHT_TYPE_NONE, LIGHT_TYPE_POINT, LIGHT_TYPE_RECT, LIGHT_TYPE_SPOT, MAX_CLUSTERED_LIGHTS, MAX_GERSTNER_WAVE_COUNT, MAX_MORPH_ATTRIBUTES, MAX_MORPH_TARGETS, MAX_TERRAIN_MIPMAP_LEVELS, MORPH_ATTRIBUTE_VECTOR_COUNT, MORPH_TARGET_COLOR, MORPH_TARGET_NORMAL, MORPH_TARGET_POSITION, MORPH_TARGET_TANGENT, MORPH_TARGET_TEX0, MORPH_TARGET_TEX1, MORPH_TARGET_TEX2, MORPH_TARGET_TEX3, MORPH_WEIGHTS_VECTOR_COUNT, MaterialVaryingFlags, QUEUE_OPAQUE, QUEUE_TRANSPARENT, RENDER_PASS_TYPE_DEPTH, RENDER_PASS_TYPE_LIGHT, RENDER_PASS_TYPE_OBJECT_COLOR, RENDER_PASS_TYPE_SHADOWMAP, uniformSphereSamples };
161
+ export { ATMOSPHERIC_FOG_BIT, BUILTIN_ASSET_TEST_CUBEMAP, BUILTIN_ASSET_TEXTURE_SHEEN_LUT, Fog, HEIGHT_FOG_BIT, LIGHT_TYPE_DIRECTIONAL, LIGHT_TYPE_NONE, LIGHT_TYPE_POINT, LIGHT_TYPE_RECT, LIGHT_TYPE_SPOT, MAX_GERSTNER_WAVE_COUNT, MAX_MORPH_ATTRIBUTES, MAX_MORPH_TARGETS, MAX_TERRAIN_MIPMAP_LEVELS, MORPH_ATTRIBUTE_VECTOR_COUNT, MORPH_TARGET_COLOR, MORPH_TARGET_NORMAL, MORPH_TARGET_POSITION, MORPH_TARGET_TANGENT, MORPH_TARGET_TEX0, MORPH_TARGET_TEX1, MORPH_TARGET_TEX2, MORPH_TARGET_TEX3, MORPH_WEIGHTS_VECTOR_COUNT, MaterialVaryingFlags, QUEUE_OPAQUE, QUEUE_TRANSPARENT, RENDER_PASS_TYPE_DEPTH, RENDER_PASS_TYPE_LIGHT, RENDER_PASS_TYPE_OBJECT_COLOR, RENDER_PASS_TYPE_SHADOWMAP, uniformSphereSamples };
166
162
  //# sourceMappingURL=values.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"values.js","sources":["../src/values.ts"],"sourcesContent":["import { Vector3 } from '@zephyr3d/base';\r\n\r\n/**\r\n * Forward render pass type\r\n * @public\r\n */\r\nexport const RENDER_PASS_TYPE_LIGHT = 0;\r\n/**\r\n * Shadow map render pass type\r\n * @public\r\n */\r\nexport const RENDER_PASS_TYPE_SHADOWMAP = 1;\r\n/**\r\n * Depth only render pass type\r\n * @public\r\n */\r\nexport const RENDER_PASS_TYPE_DEPTH = 2;\r\n/**\r\n * Object color render pass type\r\n * @public\r\n */\r\nexport const RENDER_PASS_TYPE_OBJECT_COLOR = 3;\r\n\r\n/**\r\n * Builtin texture name for sheen LUT\r\n * @public\r\n */\r\nexport const BUILTIN_ASSET_TEXTURE_SHEEN_LUT = 'LUT_Sheen';\r\n\r\n/**\r\n * Builtin cube texture for test\r\n * @public\r\n */\r\nexport const BUILTIN_ASSET_TEST_CUBEMAP = 'TEST_Cubemap';\r\n\r\n/**\r\n * No light\r\n * @public\r\n */\r\nexport const LIGHT_TYPE_NONE = 0;\r\n\r\n/**\r\n * Directional light type\r\n * @public\r\n */\r\nexport const LIGHT_TYPE_DIRECTIONAL = 1;\r\n\r\n/**\r\n * Point light type\r\n * @public\r\n */\r\nexport const LIGHT_TYPE_POINT = 2;\r\n\r\n/**\r\n * Spot light type\r\n * @public\r\n */\r\nexport const LIGHT_TYPE_SPOT = 3;\r\n\r\n/**\r\n * Rectangular area light type\r\n * @public\r\n */\r\nexport const LIGHT_TYPE_RECT = 4;\r\n\r\n/**\r\n * Max light size for clustered lighting\r\n * @public\r\n */\r\nexport const MAX_CLUSTERED_LIGHTS = 255;\r\n\r\n/**\r\n * Opaque render queue type\r\n * @public\r\n */\r\nexport const QUEUE_OPAQUE = 1;\r\n\r\n/**\r\n * Transparent render queue type\r\n * @public\r\n */\r\nexport const QUEUE_TRANSPARENT = 2;\r\n\r\n// Morph target attributes\r\n\r\n/** @public */\r\nexport const MORPH_TARGET_POSITION = 0;\r\n/** @public */\r\nexport const MORPH_TARGET_NORMAL = 1;\r\n/** @public */\r\nexport const MORPH_TARGET_TANGENT = 2;\r\n/** @public */\r\nexport const MORPH_TARGET_COLOR = 3;\r\n/** @public */\r\nexport const MORPH_TARGET_TEX0 = 4;\r\n/** @public */\r\nexport const MORPH_TARGET_TEX1 = 5;\r\n/** @public */\r\nexport const MORPH_TARGET_TEX2 = 6;\r\n/** @public */\r\nexport const MORPH_TARGET_TEX3 = 7;\r\n/** @public */\r\nexport const MAX_MORPH_ATTRIBUTES = 8;\r\n/** @public */\r\nexport const MAX_MORPH_TARGETS = 256;\r\n/** @public */\r\nexport const MORPH_WEIGHTS_VECTOR_COUNT = (MAX_MORPH_TARGETS + 3) >> 2;\r\n/** @public */\r\nexport const MORPH_ATTRIBUTE_VECTOR_COUNT = (MAX_MORPH_ATTRIBUTES + 3) >> 2;\r\n\r\n/** @public */\r\nexport const MAX_TERRAIN_MIPMAP_LEVELS = 64;\r\n\r\n/** @public */\r\nexport const MAX_GERSTNER_WAVE_COUNT = 16;\r\n\r\n/**\r\n * Material varying flags\r\n * @public\r\n */\r\nexport const enum MaterialVaryingFlags {\r\n MORPH_ANIMATION = 1 << 0,\r\n SKIN_ANIMATION = 1 << 1,\r\n INSTANCING = 1 << 2,\r\n SSR_STORE_ROUGHNESS = 1 << 3,\r\n APPLY_FOG = 1 << 4\r\n}\r\n\r\n/**\r\n * Atmospheric Fog flag\r\n * @public\r\n */\r\nexport const ATMOSPHERIC_FOG_BIT = 1 << 0;\r\n/**\r\n * Exponential Fog flag\r\n * @public\r\n */\r\nexport const HEIGHT_FOG_BIT = 1 << 1;\r\n\r\n/** @internal */\r\nexport const uniformSphereSamples = [\r\n new Vector3(-0.7838, -0.620933, 0.00996137),\r\n new Vector3(0.106751, 0.965982, 0.235549),\r\n new Vector3(-0.215177, -0.687115, -0.693954),\r\n new Vector3(0.318002, 0.0640084, -0.945927),\r\n new Vector3(0.357396, 0.555673, 0.750664),\r\n new Vector3(0.866397, -0.19756, 0.458613),\r\n new Vector3(0.130216, 0.232736, -0.963783),\r\n new Vector3(-0.00174431, 0.376657, 0.926351),\r\n new Vector3(0.663478, 0.704806, -0.251089),\r\n new Vector3(0.0327851, 0.110534, -0.993331),\r\n new Vector3(0.0561973, 0.0234288, 0.998145),\r\n new Vector3(0.0905264, -0.169771, 0.981317),\r\n new Vector3(0.26694, 0.95222, -0.148393),\r\n new Vector3(-0.812874, -0.559051, -0.163393),\r\n new Vector3(-0.323378, -0.25855, -0.910263),\r\n new Vector3(-0.1333, 0.591356, -0.795317),\r\n new Vector3(0.480876, 0.408711, 0.775702),\r\n new Vector3(-0.332263, -0.533895, -0.777533),\r\n new Vector3(-0.0392473, -0.704457, -0.708661),\r\n new Vector3(0.427015, 0.239811, 0.871865),\r\n new Vector3(-0.416624, -0.563856, 0.713085),\r\n new Vector3(0.12793, 0.334479, -0.933679),\r\n new Vector3(-0.0343373, -0.160593, -0.986423),\r\n new Vector3(0.580614, 0.0692947, 0.811225),\r\n new Vector3(-0.459187, 0.43944, 0.772036),\r\n new Vector3(0.215474, -0.539436, -0.81399),\r\n new Vector3(-0.378969, -0.31988, -0.868366),\r\n new Vector3(-0.279978, -0.0109692, 0.959944),\r\n new Vector3(0.692547, 0.690058, 0.210234),\r\n new Vector3(0.53227, -0.123044, -0.837585),\r\n new Vector3(-0.772313, -0.283334, -0.568555),\r\n new Vector3(-0.0311218, 0.995988, -0.0838977),\r\n new Vector3(-0.366931, -0.276531, -0.888196),\r\n new Vector3(0.488778, 0.367878, -0.791051),\r\n new Vector3(-0.885561, -0.453445, 0.100842),\r\n new Vector3(0.71656, 0.443635, 0.538265),\r\n new Vector3(0.645383, -0.152576, -0.748466),\r\n new Vector3(-0.171259, 0.91907, 0.354939),\r\n new Vector3(-0.0031122, 0.9457, 0.325026),\r\n new Vector3(0.731503, 0.623089, -0.276881),\r\n new Vector3(-0.91466, 0.186904, 0.358419),\r\n new Vector3(0.15595, 0.828193, -0.538309),\r\n new Vector3(0.175396, 0.584732, 0.792038),\r\n new Vector3(-0.0838381, -0.943461, 0.320707),\r\n new Vector3(0.305876, 0.727604, 0.614029),\r\n new Vector3(0.754642, -0.197903, -0.62558),\r\n new Vector3(0.217255, -0.0177771, -0.975953),\r\n new Vector3(0.140412, -0.844826, 0.516287),\r\n new Vector3(-0.549042, 0.574859, -0.606705),\r\n new Vector3(0.570057, 0.17459, 0.802841),\r\n new Vector3(-0.0330304, 0.775077, 0.631003),\r\n new Vector3(-0.938091, 0.138937, 0.317304),\r\n new Vector3(0.483197, -0.726405, -0.48873),\r\n new Vector3(0.485263, 0.52926, 0.695991),\r\n new Vector3(0.224189, 0.742282, -0.631472),\r\n new Vector3(-0.322429, 0.662214, -0.676396),\r\n new Vector3(0.625577, -0.12711, 0.769738),\r\n new Vector3(-0.714032, -0.584461, -0.385439),\r\n new Vector3(-0.0652053, -0.892579, -0.446151),\r\n new Vector3(0.408421, -0.912487, 0.0236566),\r\n new Vector3(0.0900381, 0.319983, 0.943135),\r\n new Vector3(-0.708553, 0.483646, 0.513847),\r\n new Vector3(0.803855, -0.0902273, 0.587942),\r\n new Vector3(-0.0555802, -0.374602, -0.925519)\r\n];\r\n\r\n/** @internal */\r\nexport enum Fog {\r\n FOG_TYPE_NONE = 0,\r\n FOG_TYPE_HEIGHT = 4\r\n}\r\n"],"names":["RENDER_PASS_TYPE_LIGHT","RENDER_PASS_TYPE_SHADOWMAP","RENDER_PASS_TYPE_DEPTH","RENDER_PASS_TYPE_OBJECT_COLOR","BUILTIN_ASSET_TEXTURE_SHEEN_LUT","BUILTIN_ASSET_TEST_CUBEMAP","LIGHT_TYPE_NONE","LIGHT_TYPE_DIRECTIONAL","LIGHT_TYPE_POINT","LIGHT_TYPE_SPOT","LIGHT_TYPE_RECT","MAX_CLUSTERED_LIGHTS","QUEUE_OPAQUE","QUEUE_TRANSPARENT","MORPH_TARGET_POSITION","MORPH_TARGET_NORMAL","MORPH_TARGET_TANGENT","MORPH_TARGET_COLOR","MORPH_TARGET_TEX0","MORPH_TARGET_TEX1","MORPH_TARGET_TEX2","MORPH_TARGET_TEX3","MAX_MORPH_ATTRIBUTES","MAX_MORPH_TARGETS","MORPH_WEIGHTS_VECTOR_COUNT","MORPH_ATTRIBUTE_VECTOR_COUNT","MAX_TERRAIN_MIPMAP_LEVELS","MAX_GERSTNER_WAVE_COUNT","MaterialVaryingFlags","ATMOSPHERIC_FOG_BIT","HEIGHT_FOG_BIT","uniformSphereSamples","Vector3","Fog"],"mappings":";;AAEA;;;IAIaA,MAAAA,sBAAAA,GAAyB;AACtC;;;IAIaC,MAAAA,0BAAAA,GAA6B;AAC1C;;;IAIaC,MAAAA,sBAAAA,GAAyB;AACtC;;;IAIaC,MAAAA,6BAAAA,GAAgC;AAE7C;;;IAIaC,MAAAA,+BAAAA,GAAkC;AAE/C;;;IAIaC,MAAAA,0BAAAA,GAA6B;AAE1C;;;IAIaC,MAAAA,eAAAA,GAAkB;AAE/B;;;IAIaC,MAAAA,sBAAAA,GAAyB;AAEtC;;;IAIaC,MAAAA,gBAAAA,GAAmB;AAEh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AAA,CAAQ,QAAU,EAAA,UAAY,EAAA,QAAA,CAAA;AAClC,IAAA,IAAIA,OAAQ,CAAA,UAAY,EAAA,WAAW,SAAC;;AAGtC,iBACO,IAAKC,GAAAA,iBAAAA,SAAAA,GAAAA,EAAAA;;;AAAAA,IAAAA,OAAAA,GAAAA;AAGX,CAAA,CAAA,EAAA;;;;"}
1
+ {"version":3,"file":"values.js","sources":["../src/values.ts"],"sourcesContent":["import { Vector3 } from '@zephyr3d/base';\n\n/**\n * Forward render pass type\n * @public\n */\nexport const RENDER_PASS_TYPE_LIGHT = 0;\n/**\n * Shadow map render pass type\n * @public\n */\nexport const RENDER_PASS_TYPE_SHADOWMAP = 1;\n/**\n * Depth only render pass type\n * @public\n */\nexport const RENDER_PASS_TYPE_DEPTH = 2;\n/**\n * Object color render pass type\n * @public\n */\nexport const RENDER_PASS_TYPE_OBJECT_COLOR = 3;\n\n/**\n * Builtin texture name for sheen LUT\n * @public\n */\nexport const BUILTIN_ASSET_TEXTURE_SHEEN_LUT = 'LUT_Sheen';\n\n/**\n * Builtin cube texture for test\n * @public\n */\nexport const BUILTIN_ASSET_TEST_CUBEMAP = 'TEST_Cubemap';\n\n/**\n * No light\n * @public\n */\nexport const LIGHT_TYPE_NONE = 0;\n\n/**\n * Directional light type\n * @public\n */\nexport const LIGHT_TYPE_DIRECTIONAL = 1;\n\n/**\n * Point light type\n * @public\n */\nexport const LIGHT_TYPE_POINT = 2;\n\n/**\n * Spot light type\n * @public\n */\nexport const LIGHT_TYPE_SPOT = 3;\n\n/**\n * Rectangular area light type\n * @public\n */\nexport const LIGHT_TYPE_RECT = 4;\n\n/**\n * Opaque render queue type\n * @public\n */\nexport const QUEUE_OPAQUE = 1;\n\n/**\n * Transparent render queue type\n * @public\n */\nexport const QUEUE_TRANSPARENT = 2;\n\n// Morph target attributes\n\n/** @public */\nexport const MORPH_TARGET_POSITION = 0;\n/** @public */\nexport const MORPH_TARGET_NORMAL = 1;\n/** @public */\nexport const MORPH_TARGET_TANGENT = 2;\n/** @public */\nexport const MORPH_TARGET_COLOR = 3;\n/** @public */\nexport const MORPH_TARGET_TEX0 = 4;\n/** @public */\nexport const MORPH_TARGET_TEX1 = 5;\n/** @public */\nexport const MORPH_TARGET_TEX2 = 6;\n/** @public */\nexport const MORPH_TARGET_TEX3 = 7;\n/** @public */\nexport const MAX_MORPH_ATTRIBUTES = 8;\n/** @public */\nexport const MAX_MORPH_TARGETS = 256;\n/** @public */\nexport const MORPH_WEIGHTS_VECTOR_COUNT = (MAX_MORPH_TARGETS + 3) >> 2;\n/** @public */\nexport const MORPH_ATTRIBUTE_VECTOR_COUNT = (MAX_MORPH_ATTRIBUTES + 3) >> 2;\n\n/** @public */\nexport const MAX_TERRAIN_MIPMAP_LEVELS = 64;\n\n/** @public */\nexport const MAX_GERSTNER_WAVE_COUNT = 16;\n\n/**\n * Material varying flags\n * @public\n */\nexport const enum MaterialVaryingFlags {\n MORPH_ANIMATION = 1 << 0,\n SKIN_ANIMATION = 1 << 1,\n INSTANCING = 1 << 2,\n SSR_STORE_ROUGHNESS = 1 << 3,\n APPLY_FOG = 1 << 4\n}\n\n/**\n * Atmospheric Fog flag\n * @public\n */\nexport const ATMOSPHERIC_FOG_BIT = 1 << 0;\n/**\n * Exponential Fog flag\n * @public\n */\nexport const HEIGHT_FOG_BIT = 1 << 1;\n\n/** @internal */\nexport const uniformSphereSamples = [\n new Vector3(-0.7838, -0.620933, 0.00996137),\n new Vector3(0.106751, 0.965982, 0.235549),\n new Vector3(-0.215177, -0.687115, -0.693954),\n new Vector3(0.318002, 0.0640084, -0.945927),\n new Vector3(0.357396, 0.555673, 0.750664),\n new Vector3(0.866397, -0.19756, 0.458613),\n new Vector3(0.130216, 0.232736, -0.963783),\n new Vector3(-0.00174431, 0.376657, 0.926351),\n new Vector3(0.663478, 0.704806, -0.251089),\n new Vector3(0.0327851, 0.110534, -0.993331),\n new Vector3(0.0561973, 0.0234288, 0.998145),\n new Vector3(0.0905264, -0.169771, 0.981317),\n new Vector3(0.26694, 0.95222, -0.148393),\n new Vector3(-0.812874, -0.559051, -0.163393),\n new Vector3(-0.323378, -0.25855, -0.910263),\n new Vector3(-0.1333, 0.591356, -0.795317),\n new Vector3(0.480876, 0.408711, 0.775702),\n new Vector3(-0.332263, -0.533895, -0.777533),\n new Vector3(-0.0392473, -0.704457, -0.708661),\n new Vector3(0.427015, 0.239811, 0.871865),\n new Vector3(-0.416624, -0.563856, 0.713085),\n new Vector3(0.12793, 0.334479, -0.933679),\n new Vector3(-0.0343373, -0.160593, -0.986423),\n new Vector3(0.580614, 0.0692947, 0.811225),\n new Vector3(-0.459187, 0.43944, 0.772036),\n new Vector3(0.215474, -0.539436, -0.81399),\n new Vector3(-0.378969, -0.31988, -0.868366),\n new Vector3(-0.279978, -0.0109692, 0.959944),\n new Vector3(0.692547, 0.690058, 0.210234),\n new Vector3(0.53227, -0.123044, -0.837585),\n new Vector3(-0.772313, -0.283334, -0.568555),\n new Vector3(-0.0311218, 0.995988, -0.0838977),\n new Vector3(-0.366931, -0.276531, -0.888196),\n new Vector3(0.488778, 0.367878, -0.791051),\n new Vector3(-0.885561, -0.453445, 0.100842),\n new Vector3(0.71656, 0.443635, 0.538265),\n new Vector3(0.645383, -0.152576, -0.748466),\n new Vector3(-0.171259, 0.91907, 0.354939),\n new Vector3(-0.0031122, 0.9457, 0.325026),\n new Vector3(0.731503, 0.623089, -0.276881),\n new Vector3(-0.91466, 0.186904, 0.358419),\n new Vector3(0.15595, 0.828193, -0.538309),\n new Vector3(0.175396, 0.584732, 0.792038),\n new Vector3(-0.0838381, -0.943461, 0.320707),\n new Vector3(0.305876, 0.727604, 0.614029),\n new Vector3(0.754642, -0.197903, -0.62558),\n new Vector3(0.217255, -0.0177771, -0.975953),\n new Vector3(0.140412, -0.844826, 0.516287),\n new Vector3(-0.549042, 0.574859, -0.606705),\n new Vector3(0.570057, 0.17459, 0.802841),\n new Vector3(-0.0330304, 0.775077, 0.631003),\n new Vector3(-0.938091, 0.138937, 0.317304),\n new Vector3(0.483197, -0.726405, -0.48873),\n new Vector3(0.485263, 0.52926, 0.695991),\n new Vector3(0.224189, 0.742282, -0.631472),\n new Vector3(-0.322429, 0.662214, -0.676396),\n new Vector3(0.625577, -0.12711, 0.769738),\n new Vector3(-0.714032, -0.584461, -0.385439),\n new Vector3(-0.0652053, -0.892579, -0.446151),\n new Vector3(0.408421, -0.912487, 0.0236566),\n new Vector3(0.0900381, 0.319983, 0.943135),\n new Vector3(-0.708553, 0.483646, 0.513847),\n new Vector3(0.803855, -0.0902273, 0.587942),\n new Vector3(-0.0555802, -0.374602, -0.925519)\n];\n\n/** @internal */\nexport enum Fog {\n FOG_TYPE_NONE = 0,\n FOG_TYPE_HEIGHT = 4\n}\n"],"names":["RENDER_PASS_TYPE_LIGHT","RENDER_PASS_TYPE_SHADOWMAP","RENDER_PASS_TYPE_DEPTH","RENDER_PASS_TYPE_OBJECT_COLOR","BUILTIN_ASSET_TEXTURE_SHEEN_LUT","BUILTIN_ASSET_TEST_CUBEMAP","LIGHT_TYPE_NONE","LIGHT_TYPE_DIRECTIONAL","LIGHT_TYPE_POINT","LIGHT_TYPE_SPOT","LIGHT_TYPE_RECT","QUEUE_OPAQUE","QUEUE_TRANSPARENT","MORPH_TARGET_POSITION","MORPH_TARGET_NORMAL","MORPH_TARGET_TANGENT","MORPH_TARGET_COLOR","MORPH_TARGET_TEX0","MORPH_TARGET_TEX1","MORPH_TARGET_TEX2","MORPH_TARGET_TEX3","MAX_MORPH_ATTRIBUTES","MAX_MORPH_TARGETS","MORPH_WEIGHTS_VECTOR_COUNT","MORPH_ATTRIBUTE_VECTOR_COUNT","MAX_TERRAIN_MIPMAP_LEVELS","MAX_GERSTNER_WAVE_COUNT","MaterialVaryingFlags","ATMOSPHERIC_FOG_BIT","HEIGHT_FOG_BIT","uniformSphereSamples","Vector3","Fog"],"mappings":";;AAEA;;;IAIaA,MAAAA,sBAAAA,GAAyB;AACtC;;;IAIaC,MAAAA,0BAAAA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AIA,OAAQ,CAAA,UAAY,EAAA,WAAW,SAAC,CAAA;IACpC,IAAIA,OAAAA,CAAQ,QAAU,EAAA,SAAW,EAAA,SAAA,CAAA;IACjC,IAAIA,OAAAA,CAAQ,WAAW,QAAU,EAAA,QAAA,CAAA;IACjC,IAAIA,OAAAA,CAAQ,SAAC,EAAU,QAAU,EAAA,QAAA,CAAA;IACjC,IAAIA,OAAAA,CAAQ,QAAU,EAAA,UAAY,EAAA,QAAA,CAAA;AAClC,IAAA,IAAIA,OAAQ,CAAA,UAAY,EAAA,WAAW,SAAC;;AAGtC,iBACO,IAAKC,GAAAA,iBAAAA,SAAAA,GAAAA,EAAAA;;;AAAAA,IAAAA,OAAAA,GAAAA;AAGX,CAAA,CAAA,EAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zephyr3d/scene",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Scene API for zephyr3d",
5
5
  "homepage": "https://github.com/gavinyork/zephyr3d#readme",
6
6
  "type": "module",
@@ -67,7 +67,7 @@
67
67
  "dependencies": {
68
68
  "@types/draco3d": "^1.4.9",
69
69
  "@webgpu/types": "^0.1.65",
70
- "@zephyr3d/base": "^0.2.3",
70
+ "@zephyr3d/base": "^0.2.4",
71
71
  "@zephyr3d/device": "^0.2.8",
72
72
  "es-module-lexer": "^1.7.0"
73
73
  },
@@ -1,46 +0,0 @@
1
- import { clamp01, Vector3, InterpolatorScalar } from '@zephyr3d/base';
2
-
3
- /**
4
- * Converts one VRM SpringBone setting block into a JointDynamics controller
5
- * config fragment.
6
- *
7
- * Parameter mapping:
8
- * - gravityPower + gravityDir -> gravity vector
9
- * - stiffness / stiffnessForce -> curves.hardness
10
- * - dragForce -> curves.resistance = 1 - dragForce
11
- * - hitRadius -> curves.pointRadius
12
- *
13
- * The returned value is intended for JointDynamicsSystem.controllerConfig.
14
- *
15
- * @public
16
- */ function mapVrmSpringBoneToJointDynamicsConfig(params, options = {}) {
17
- const stiffnessScale = options.stiffnessScale ?? 0.01;
18
- const gravityScale = options.gravityScale ?? 1;
19
- const stiffness = Math.max(0, params.stiffness ?? 0);
20
- const dragForce = clamp01(params.dragForce ?? 0);
21
- const gravityPower = Math.max(0, params.gravityPower ?? 0);
22
- const gravityDir = normalizeGravityDir(params.gravityDir);
23
- const hitRadius = Math.max(0, params.hitRadius ?? options.defaultHitRadius ?? 0.05);
24
- return {
25
- gravity: Vector3.scale(gravityDir, gravityPower * gravityScale),
26
- curves: {
27
- hardness: InterpolatorScalar.constant(clamp01(stiffness * stiffnessScale)),
28
- resistance: InterpolatorScalar.constant(1 - dragForce),
29
- pointRadius: InterpolatorScalar.constant(hitRadius)
30
- },
31
- constraintOptions: {
32
- structuralVertical: options.structuralVertical ?? true,
33
- bendingVertical: options.bendingVertical ?? true
34
- }
35
- };
36
- }
37
- function normalizeGravityDir(dir) {
38
- const v = dir instanceof Vector3 ? dir.clone() : dir ? new Vector3(dir[0] ?? 0, dir[1] ?? 0, dir[2] ?? 0) : new Vector3(0, -1, 0);
39
- if (v.magnitudeSq <= 0) {
40
- return new Vector3(0, -1, 0);
41
- }
42
- return Vector3.normalize(v);
43
- }
44
-
45
- export { mapVrmSpringBoneToJointDynamicsConfig };
46
- //# sourceMappingURL=vrm_spring_bone.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vrm_spring_bone.js","sources":["../../../src/animation/joint_dynamics/vrm_spring_bone.ts"],"sourcesContent":["import type { DeepPartial } from '@zephyr3d/base';\nimport { InterpolatorScalar, Vector3, clamp01 } from '@zephyr3d/base';\nimport type { ControllerConfig } from './controller';\n\n/**\n * VRM 0.x secondaryAnimation.boneGroups and VRM 1.0 VRMC_springBone joints use\n * the same core parameters for spring simulation.\n *\n * Their stiffness is a force pulling the joint toward the animated pose, not a\n * distance-constraint stiffness. In JointDynamics this maps to hardness.\n *\n * @public\n */\nexport interface VrmSpringBoneParams {\n /** VRM stiffness / stiffnessForce. Restore force toward the animated pose. */\n stiffness?: number;\n /** VRM gravityPower. Magnitude of gravityDir. */\n gravityPower?: number;\n /** VRM gravityDir. Defaults to world down. */\n gravityDir?: readonly [number, number, number] | Vector3;\n /** VRM dragForce. 0 = no drag, 1 = no inertia. */\n dragForce?: number;\n /** VRM hitRadius. Point radius used for collider contacts. */\n hitRadius?: number;\n}\n\n/**\n * Tuning options for mapping VRM SpringBone parameters into JointDynamics.\n *\n * VRM values are intentionally small and engine-specific, while JointDynamics'\n * hardness is a per-substep positional correction ratio. Use stiffnessScale if\n * imported VRM springs feel too loose or too rigid.\n *\n * @public\n */\nexport interface VrmSpringBoneMappingOptions {\n /** Multiplies VRM stiffness before converting it to JointDynamics hardness. Defaults to 0.01. */\n stiffnessScale?: number;\n /** Multiplies VRM gravityPower. Defaults to 1. */\n gravityScale?: number;\n /** Fallback point radius when VRM hitRadius is omitted. Defaults to 0.05. */\n defaultHitRadius?: number;\n /** Enable vertical distance constraints for each imported chain. Defaults to true. */\n structuralVertical?: boolean;\n /** Enable skip-one bending constraints for smoother chains. Defaults to true. */\n bendingVertical?: boolean;\n}\n\n/**\n * Converts one VRM SpringBone setting block into a JointDynamics controller\n * config fragment.\n *\n * Parameter mapping:\n * - gravityPower + gravityDir -> gravity vector\n * - stiffness / stiffnessForce -> curves.hardness\n * - dragForce -> curves.resistance = 1 - dragForce\n * - hitRadius -> curves.pointRadius\n *\n * The returned value is intended for JointDynamicsSystem.controllerConfig.\n *\n * @public\n */\nexport function mapVrmSpringBoneToJointDynamicsConfig(\n params: VrmSpringBoneParams,\n options: VrmSpringBoneMappingOptions = {}\n): DeepPartial<ControllerConfig, 2> {\n const stiffnessScale = options.stiffnessScale ?? 0.01;\n const gravityScale = options.gravityScale ?? 1;\n const stiffness = Math.max(0, params.stiffness ?? 0);\n const dragForce = clamp01(params.dragForce ?? 0);\n const gravityPower = Math.max(0, params.gravityPower ?? 0);\n const gravityDir = normalizeGravityDir(params.gravityDir);\n const hitRadius = Math.max(0, params.hitRadius ?? options.defaultHitRadius ?? 0.05);\n\n return {\n gravity: Vector3.scale(gravityDir, gravityPower * gravityScale),\n curves: {\n hardness: InterpolatorScalar.constant(clamp01(stiffness * stiffnessScale)),\n resistance: InterpolatorScalar.constant(1 - dragForce),\n pointRadius: InterpolatorScalar.constant(hitRadius)\n },\n constraintOptions: {\n structuralVertical: options.structuralVertical ?? true,\n bendingVertical: options.bendingVertical ?? true\n }\n };\n}\n\nfunction normalizeGravityDir(dir?: readonly [number, number, number] | Vector3): Vector3 {\n const v =\n dir instanceof Vector3\n ? dir.clone()\n : dir\n ? new Vector3(dir[0] ?? 0, dir[1] ?? 0, dir[2] ?? 0)\n : new Vector3(0, -1, 0);\n if (v.magnitudeSq <= 0) {\n return new Vector3(0, -1, 0);\n }\n return Vector3.normalize(v);\n}\n"],"names":["mapVrmSpringBoneToJointDynamicsConfig","params","options","stiffnessScale","gravityScale","stiffness","Math","max","dragForce","clamp01","gravityPower","gravityDir","normalizeGravityDir","hitRadius","defaultHitRadius","gravity","Vector3","scale","curves","hardness","InterpolatorScalar","constant","resistance","pointRadius","constraintOptions","structuralVertical","bendingVertical","dir","v","clone","magnitudeSq","normalize"],"mappings":";;AAgDA;;;;;;;;;;;;;AAaC,IACM,SAASA,qCAAAA,CACdC,MAA2B,EAC3BC,OAAAA,GAAuC,EAAE,EAAA;IAEzC,MAAMC,cAAAA,GAAiBD,OAAQC,CAAAA,cAAc,IAAI,IAAA;IACjD,MAAMC,YAAAA,GAAeF,OAAQE,CAAAA,YAAY,IAAI,CAAA;AAC7C,IAAA,MAAMC,YAAYC,IAAKC,CAAAA,GAAG,CAAC,CAAGN,EAAAA,MAAAA,CAAOI,SAAS,IAAI,CAAA,CAAA;AAClD,IAAA,MAAMG,SAAYC,GAAAA,OAAAA,CAAQR,MAAOO,CAAAA,SAAS,IAAI,CAAA,CAAA;AAC9C,IAAA,MAAME,eAAeJ,IAAKC,CAAAA,GAAG,CAAC,CAAGN,EAAAA,MAAAA,CAAOS,YAAY,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AI,EAAA,CAAA,CAAA;AAC5B;IACA,OAAOA,OAAAA,CAAQe,SAAS,CAACH,CAAAA,CAAAA;AAC3B;;;;"}
@@ -1,240 +0,0 @@
1
- import { Vector3, Quaternion } from '@zephyr3d/base';
2
-
3
- /**
4
- * Spring bone for physics-based animation.
5
- *
6
- * @remarks
7
- * A spring bone simulates physics on a bone node, commonly used for:
8
- * - Skirts and dresses
9
- * - Hair strands
10
- * - Tails
11
- * - Capes and cloth
12
- *
13
- * The bone follows its parent's animation but adds secondary motion
14
- * based on physics simulation (springs, gravity, inertia).
15
- *
16
- * @public
17
- */ class SpringBone {
18
- /** The bone node this spring controls */ _bone;
19
- /** Current position in world space */ _currentPosition;
20
- /** Previous position in world space (for velocity calculation) */ _previousPosition;
21
- /** Initial local position relative to parent */ _initialLocalPosition;
22
- /** Initial bone length (distance from parent) */ _boneLength;
23
- /** Spring stiffness (0-1, higher = stiffer) */ _stiffness;
24
- /** Damping factor (0-1, higher = more damping) */ _damping;
25
- /** Mass of the bone (affects inertia) */ _mass;
26
- /** Gravity scale (1 = normal gravity, 0 = no gravity) */ _gravityScale;
27
- /** Radius for collision detection */ _radius;
28
- /**
29
- * Create a spring bone.
30
- *
31
- * @param bone - The bone node to control
32
- * @param stiffness - Spring stiffness (0-1, default: 0.1)
33
- * @param damping - Damping factor (0-1, default: 0.5)
34
- * @param mass - Mass of the bone (default: 1)
35
- * @param gravityScale - Gravity scale (default: 1)
36
- * @param radius - Collision radius (default: 0.05)
37
- */ constructor(bone, stiffness = 0.1, damping = 0.5, mass = 1, gravityScale = 1, radius = 0.05){
38
- this._bone = bone;
39
- this._stiffness = Math.max(0, Math.min(1, stiffness));
40
- this._damping = Math.max(0, Math.min(1, damping));
41
- this._mass = Math.max(0.01, mass);
42
- this._gravityScale = gravityScale;
43
- this._radius = Math.max(0, radius);
44
- // Store initial local transform
45
- this._initialLocalPosition = bone.position.clone();
46
- this._boneLength = this._initialLocalPosition.magnitude;
47
- // Initialize positions in world space
48
- const worldPos = new Vector3();
49
- bone.worldMatrix.decompose(null, null, worldPos);
50
- this._currentPosition = worldPos.clone();
51
- this._previousPosition = worldPos.clone();
52
- }
53
- /**
54
- * Get the bone node.
55
- */ get bone() {
56
- return this._bone;
57
- }
58
- /**
59
- * Get/set spring stiffness (0-1).
60
- */ get stiffness() {
61
- return this._stiffness;
62
- }
63
- set stiffness(value) {
64
- this._stiffness = Math.max(0, Math.min(1, value));
65
- }
66
- /**
67
- * Get/set damping factor (0-1).
68
- */ get damping() {
69
- return this._damping;
70
- }
71
- set damping(value) {
72
- this._damping = Math.max(0, Math.min(1, value));
73
- }
74
- /**
75
- * Get/set mass.
76
- */ get mass() {
77
- return this._mass;
78
- }
79
- set mass(value) {
80
- this._mass = Math.max(0.01, value);
81
- }
82
- /**
83
- * Get/set gravity scale.
84
- */ get gravityScale() {
85
- return this._gravityScale;
86
- }
87
- set gravityScale(value) {
88
- this._gravityScale = value;
89
- }
90
- /**
91
- * Get/set collision radius.
92
- */ get radius() {
93
- return this._radius;
94
- }
95
- set radius(value) {
96
- this._radius = Math.max(0, value);
97
- }
98
- /**
99
- * Get current position in world space.
100
- */ get currentPosition() {
101
- return this._currentPosition;
102
- }
103
- /**
104
- * Get initial local position relative to parent.
105
- */ get initialLocalPosition() {
106
- return this._initialLocalPosition;
107
- }
108
- /**
109
- * Reset the spring bone to its initial state.
110
- */ reset() {
111
- const worldPos = new Vector3();
112
- this._bone.worldMatrix.decompose(null, null, worldPos);
113
- this._currentPosition.set(worldPos);
114
- this._previousPosition.set(worldPos);
115
- }
116
- /**
117
- * Update spring physics.
118
- *
119
- * @param deltaTime - Time step in seconds
120
- * @param gravity - Gravity vector in world space
121
- * @param windForce - Wind force vector in world space
122
- */ update(deltaTime, gravity, windForce) {
123
- // Clamp delta time to avoid instability (1ms to 100ms)
124
- if (deltaTime <= 0.001 || deltaTime > 0.1) {
125
- return; // Skip invalid or too large time steps
126
- }
127
- // Get parent's world position
128
- const parent = this._bone.parent;
129
- if (!parent) {
130
- return; // Root bone, no spring simulation
131
- }
132
- const parentWorldPos = new Vector3();
133
- parent.worldMatrix.decompose(null, null, parentWorldPos);
134
- // Calculate velocity from previous frame
135
- const velocity = Vector3.sub(this._currentPosition, this._previousPosition, new Vector3());
136
- Vector3.scale(velocity, 1 / deltaTime, velocity);
137
- // Store current position as previous
138
- this._previousPosition.set(this._currentPosition);
139
- // Calculate forces
140
- const totalForce = new Vector3();
141
- // 1. Gravity force
142
- const gravityForce = Vector3.scale(gravity, this._gravityScale * this._mass, new Vector3());
143
- totalForce.addBy(gravityForce);
144
- // 2. Wind force
145
- totalForce.addBy(windForce);
146
- // 3. Damping force (opposes velocity)
147
- const dampingForce = Vector3.scale(velocity, -this._damping * this._mass, new Vector3());
148
- totalForce.addBy(dampingForce);
149
- // 4. Spring force (only if stretched beyond bone length)
150
- const toChild = Vector3.sub(this._currentPosition, parentWorldPos, new Vector3());
151
- const currentLength = toChild.magnitude;
152
- if (currentLength > this._boneLength + 0.001) {
153
- // Bone is stretched, apply restoring force
154
- const stretchAmount = currentLength - this._boneLength;
155
- const direction = Vector3.scale(toChild, -1 / currentLength, new Vector3());
156
- const springForce = Vector3.scale(direction, stretchAmount * this._stiffness * 100, new Vector3());
157
- totalForce.addBy(springForce);
158
- }
159
- // Calculate acceleration (F = ma, a = F/m)
160
- const acceleration = Vector3.scale(totalForce, 1 / this._mass, new Vector3());
161
- // Update velocity
162
- velocity.addBy(Vector3.scale(acceleration, deltaTime, new Vector3()));
163
- // Apply velocity damping (additional damping to prevent oscillation)
164
- const velocityMagnitude = velocity.magnitude;
165
- if (velocityMagnitude > 0.001) {
166
- const dampingFactor = Math.max(0, 1 - this._damping * deltaTime * 10);
167
- velocity.scaleBy(dampingFactor);
168
- }
169
- // Update position
170
- this._currentPosition.addBy(Vector3.scale(velocity, deltaTime, new Vector3()));
171
- // Constrain to bone length (hard constraint)
172
- const finalToChild = Vector3.sub(this._currentPosition, parentWorldPos, new Vector3());
173
- const finalLength = finalToChild.magnitude;
174
- if (finalLength > 0.000001) {
175
- const direction = Vector3.scale(finalToChild, 1 / finalLength, new Vector3());
176
- const targetPos = Vector3.add(parentWorldPos, Vector3.scale(direction, this._boneLength, new Vector3()), new Vector3());
177
- // Soft constraint: blend toward target position
178
- // This prevents the hard snap that causes oscillation
179
- const constraintStrength = 0.5; // 0 = no constraint, 1 = hard constraint
180
- this._currentPosition.x += (targetPos.x - this._currentPosition.x) * constraintStrength;
181
- this._currentPosition.y += (targetPos.y - this._currentPosition.y) * constraintStrength;
182
- this._currentPosition.z += (targetPos.z - this._currentPosition.z) * constraintStrength;
183
- }
184
- }
185
- /**
186
- * Apply the simulated position to the bone node.
187
- *
188
- * @remarks
189
- * This converts the world space position back to local rotation.
190
- */ applyToNode() {
191
- const parent = this._bone.parent;
192
- if (!parent) {
193
- return;
194
- }
195
- // Get parent's world position and rotation
196
- const parentWorldPos = new Vector3();
197
- const parentWorldRot = new Quaternion();
198
- parent.worldMatrix.decompose(null, parentWorldRot, parentWorldPos);
199
- // Calculate current direction from parent to simulated position (in world space)
200
- const currentDir = Vector3.sub(this._currentPosition, parentWorldPos, new Vector3());
201
- const currentLength = currentDir.magnitude;
202
- if (currentLength < 0.000001) {
203
- return; // Too close to parent
204
- }
205
- currentDir.scaleBy(1 / currentLength);
206
- // Transform current direction to parent's local space
207
- const parentInvRot = Quaternion.conjugate(parentWorldRot, new Quaternion());
208
- const currentDirLocal = parentInvRot.transform(currentDir, new Vector3());
209
- // Original direction in local space (normalized)
210
- const originalDirLocal = Vector3.normalize(this._initialLocalPosition, new Vector3());
211
- // Calculate local rotation from original to current
212
- const localRotation = new Quaternion();
213
- this._fromToRotation(originalDirLocal, currentDirLocal, localRotation);
214
- // Apply to bone
215
- this._bone.rotation = localRotation;
216
- }
217
- /**
218
- * Calculate rotation from one direction to another.
219
- */ _fromToRotation(from, to, result) {
220
- const dot = Vector3.dot(from, to);
221
- if (dot >= 0.999999) {
222
- return result.identity();
223
- }
224
- if (dot <= -0.999999) {
225
- let axis = Vector3.cross(Vector3.axisPX(), from, new Vector3());
226
- const lenSq = axis.x * axis.x + axis.y * axis.y + axis.z * axis.z;
227
- if (lenSq < 0.000001) {
228
- axis = Vector3.cross(Vector3.axisPY(), from, new Vector3());
229
- }
230
- axis.inplaceNormalize();
231
- return result.fromAxisAngle(axis, Math.PI);
232
- }
233
- const axis = Vector3.cross(from, to).inplaceNormalize();
234
- const angle = Math.acos(dot);
235
- return result.fromAxisAngle(axis, angle);
236
- }
237
- }
238
-
239
- export { SpringBone };
240
- //# sourceMappingURL=spring_bone.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spring_bone.js","sources":["../../../src/animation/spring/spring_bone.ts"],"sourcesContent":["import { Vector3, Quaternion } from '@zephyr3d/base';\r\nimport type { SceneNode } from '../../scene/scene_node';\r\n\r\n/**\r\n * Spring bone for physics-based animation.\r\n *\r\n * @remarks\r\n * A spring bone simulates physics on a bone node, commonly used for:\r\n * - Skirts and dresses\r\n * - Hair strands\r\n * - Tails\r\n * - Capes and cloth\r\n *\r\n * The bone follows its parent's animation but adds secondary motion\r\n * based on physics simulation (springs, gravity, inertia).\r\n *\r\n * @public\r\n */\r\nexport class SpringBone {\r\n /** The bone node this spring controls */\r\n private _bone: SceneNode;\r\n /** Current position in world space */\r\n private _currentPosition: Vector3;\r\n /** Previous position in world space (for velocity calculation) */\r\n private _previousPosition: Vector3;\r\n /** Initial local position relative to parent */\r\n private _initialLocalPosition: Vector3;\r\n /** Initial bone length (distance from parent) */\r\n private _boneLength: number;\r\n\r\n /** Spring stiffness (0-1, higher = stiffer) */\r\n private _stiffness: number;\r\n /** Damping factor (0-1, higher = more damping) */\r\n private _damping: number;\r\n /** Mass of the bone (affects inertia) */\r\n private _mass: number;\r\n /** Gravity scale (1 = normal gravity, 0 = no gravity) */\r\n private _gravityScale: number;\r\n\r\n /** Radius for collision detection */\r\n private _radius: number;\r\n\r\n /**\r\n * Create a spring bone.\r\n *\r\n * @param bone - The bone node to control\r\n * @param stiffness - Spring stiffness (0-1, default: 0.1)\r\n * @param damping - Damping factor (0-1, default: 0.5)\r\n * @param mass - Mass of the bone (default: 1)\r\n * @param gravityScale - Gravity scale (default: 1)\r\n * @param radius - Collision radius (default: 0.05)\r\n */\r\n constructor(\r\n bone: SceneNode,\r\n stiffness = 0.1,\r\n damping = 0.5,\r\n mass = 1,\r\n gravityScale = 1,\r\n radius = 0.05\r\n ) {\r\n this._bone = bone;\r\n this._stiffness = Math.max(0, Math.min(1, stiffness));\r\n this._damping = Math.max(0, Math.min(1, damping));\r\n this._mass = Math.max(0.01, mass);\r\n this._gravityScale = gravityScale;\r\n this._radius = Math.max(0, radius);\r\n\r\n // Store initial local transform\r\n this._initialLocalPosition = bone.position.clone();\r\n this._boneLength = this._initialLocalPosition.magnitude;\r\n\r\n // Initialize positions in world space\r\n const worldPos = new Vector3();\r\n bone.worldMatrix.decompose(null, null, worldPos);\r\n this._currentPosition = worldPos.clone();\r\n this._previousPosition = worldPos.clone();\r\n }\r\n\r\n /**\r\n * Get the bone node.\r\n */\r\n get bone(): SceneNode {\r\n return this._bone;\r\n }\r\n\r\n /**\r\n * Get/set spring stiffness (0-1).\r\n */\r\n get stiffness(): number {\r\n return this._stiffness;\r\n }\r\n\r\n set stiffness(value: number) {\r\n this._stiffness = Math.max(0, Math.min(1, value));\r\n }\r\n\r\n /**\r\n * Get/set damping factor (0-1).\r\n */\r\n get damping(): number {\r\n return this._damping;\r\n }\r\n\r\n set damping(value: number) {\r\n this._damping = Math.max(0, Math.min(1, value));\r\n }\r\n\r\n /**\r\n * Get/set mass.\r\n */\r\n get mass(): number {\r\n return this._mass;\r\n }\r\n\r\n set mass(value: number) {\r\n this._mass = Math.max(0.01, value);\r\n }\r\n\r\n /**\r\n * Get/set gravity scale.\r\n */\r\n get gravityScale(): number {\r\n return this._gravityScale;\r\n }\r\n\r\n set gravityScale(value: number) {\r\n this._gravityScale = value;\r\n }\r\n\r\n /**\r\n * Get/set collision radius.\r\n */\r\n get radius(): number {\r\n return this._radius;\r\n }\r\n\r\n set radius(value: number) {\r\n this._radius = Math.max(0, value);\r\n }\r\n\r\n /**\r\n * Get current position in world space.\r\n */\r\n get currentPosition(): Vector3 {\r\n return this._currentPosition;\r\n }\r\n\r\n /**\r\n * Get initial local position relative to parent.\r\n */\r\n get initialLocalPosition(): Vector3 {\r\n return this._initialLocalPosition;\r\n }\r\n\r\n /**\r\n * Reset the spring bone to its initial state.\r\n */\r\n reset(): void {\r\n const worldPos = new Vector3();\r\n this._bone.worldMatrix.decompose(null, null, worldPos);\r\n this._currentPosition.set(worldPos);\r\n this._previousPosition.set(worldPos);\r\n }\r\n\r\n /**\r\n * Update spring physics.\r\n *\r\n * @param deltaTime - Time step in seconds\r\n * @param gravity - Gravity vector in world space\r\n * @param windForce - Wind force vector in world space\r\n */\r\n update(deltaTime: number, gravity: Vector3, windForce: Vector3): void {\r\n // Clamp delta time to avoid instability (1ms to 100ms)\r\n if (deltaTime <= 0.001 || deltaTime > 0.1) {\r\n return; // Skip invalid or too large time steps\r\n }\r\n\r\n // Get parent's world position\r\n const parent = this._bone.parent;\r\n if (!parent) {\r\n return; // Root bone, no spring simulation\r\n }\r\n\r\n const parentWorldPos = new Vector3();\r\n parent.worldMatrix.decompose(null, null, parentWorldPos);\r\n\r\n // Calculate velocity from previous frame\r\n const velocity = Vector3.sub(this._currentPosition, this._previousPosition, new Vector3());\r\n Vector3.scale(velocity, 1 / deltaTime, velocity);\r\n\r\n // Store current position as previous\r\n this._previousPosition.set(this._currentPosition);\r\n\r\n // Calculate forces\r\n const totalForce = new Vector3();\r\n\r\n // 1. Gravity force\r\n const gravityForce = Vector3.scale(gravity, this._gravityScale * this._mass, new Vector3());\r\n totalForce.addBy(gravityForce);\r\n\r\n // 2. Wind force\r\n totalForce.addBy(windForce);\r\n\r\n // 3. Damping force (opposes velocity)\r\n const dampingForce = Vector3.scale(velocity, -this._damping * this._mass, new Vector3());\r\n totalForce.addBy(dampingForce);\r\n\r\n // 4. Spring force (only if stretched beyond bone length)\r\n const toChild = Vector3.sub(this._currentPosition, parentWorldPos, new Vector3());\r\n const currentLength = toChild.magnitude;\r\n\r\n if (currentLength > this._boneLength + 0.001) {\r\n // Bone is stretched, apply restoring force\r\n const stretchAmount = currentLength - this._boneLength;\r\n const direction = Vector3.scale(toChild, -1 / currentLength, new Vector3());\r\n const springForce = Vector3.scale(direction, stretchAmount * this._stiffness * 100, new Vector3());\r\n totalForce.addBy(springForce);\r\n }\r\n\r\n // Calculate acceleration (F = ma, a = F/m)\r\n const acceleration = Vector3.scale(totalForce, 1 / this._mass, new Vector3());\r\n\r\n // Update velocity\r\n velocity.addBy(Vector3.scale(acceleration, deltaTime, new Vector3()));\r\n\r\n // Apply velocity damping (additional damping to prevent oscillation)\r\n const velocityMagnitude = velocity.magnitude;\r\n if (velocityMagnitude > 0.001) {\r\n const dampingFactor = Math.max(0, 1 - this._damping * deltaTime * 10);\r\n velocity.scaleBy(dampingFactor);\r\n }\r\n\r\n // Update position\r\n this._currentPosition.addBy(Vector3.scale(velocity, deltaTime, new Vector3()));\r\n\r\n // Constrain to bone length (hard constraint)\r\n const finalToChild = Vector3.sub(this._currentPosition, parentWorldPos, new Vector3());\r\n const finalLength = finalToChild.magnitude;\r\n\r\n if (finalLength > 0.000001) {\r\n const direction = Vector3.scale(finalToChild, 1 / finalLength, new Vector3());\r\n const targetPos = Vector3.add(\r\n parentWorldPos,\r\n Vector3.scale(direction, this._boneLength, new Vector3()),\r\n new Vector3()\r\n );\r\n\r\n // Soft constraint: blend toward target position\r\n // This prevents the hard snap that causes oscillation\r\n const constraintStrength = 0.5; // 0 = no constraint, 1 = hard constraint\r\n this._currentPosition.x += (targetPos.x - this._currentPosition.x) * constraintStrength;\r\n this._currentPosition.y += (targetPos.y - this._currentPosition.y) * constraintStrength;\r\n this._currentPosition.z += (targetPos.z - this._currentPosition.z) * constraintStrength;\r\n }\r\n }\r\n\r\n /**\r\n * Apply the simulated position to the bone node.\r\n *\r\n * @remarks\r\n * This converts the world space position back to local rotation.\r\n */\r\n applyToNode(): void {\r\n const parent = this._bone.parent;\r\n if (!parent) {\r\n return;\r\n }\r\n\r\n // Get parent's world position and rotation\r\n const parentWorldPos = new Vector3();\r\n const parentWorldRot = new Quaternion();\r\n parent.worldMatrix.decompose(null, parentWorldRot, parentWorldPos);\r\n\r\n // Calculate current direction from parent to simulated position (in world space)\r\n const currentDir = Vector3.sub(this._currentPosition, parentWorldPos, new Vector3());\r\n const currentLength = currentDir.magnitude;\r\n\r\n if (currentLength < 0.000001) {\r\n return; // Too close to parent\r\n }\r\n\r\n currentDir.scaleBy(1 / currentLength);\r\n\r\n // Transform current direction to parent's local space\r\n const parentInvRot = Quaternion.conjugate(parentWorldRot, new Quaternion());\r\n const currentDirLocal = parentInvRot.transform(currentDir, new Vector3());\r\n\r\n // Original direction in local space (normalized)\r\n const originalDirLocal = Vector3.normalize(this._initialLocalPosition, new Vector3());\r\n\r\n // Calculate local rotation from original to current\r\n const localRotation = new Quaternion();\r\n this._fromToRotation(originalDirLocal, currentDirLocal, localRotation);\r\n\r\n // Apply to bone\r\n this._bone.rotation = localRotation;\r\n }\r\n\r\n /**\r\n * Calculate rotation from one direction to another.\r\n */\r\n private _fromToRotation(from: Vector3, to: Vector3, result: Quaternion): Quaternion {\r\n const dot = Vector3.dot(from, to);\r\n\r\n if (dot >= 0.999999) {\r\n return result.identity();\r\n }\r\n\r\n if (dot <= -0.999999) {\r\n let axis = Vector3.cross(Vector3.axisPX(), from, new Vector3());\r\n const lenSq = axis.x * axis.x + axis.y * axis.y + axis.z * axis.z;\r\n if (lenSq < 0.000001) {\r\n axis = Vector3.cross(Vector3.axisPY(), from, new Vector3());\r\n }\r\n axis.inplaceNormalize();\r\n return result.fromAxisAngle(axis, Math.PI);\r\n }\r\n\r\n const axis = Vector3.cross(from, to).inplaceNormalize();\r\n const angle = Math.acos(dot);\r\n return result.fromAxisAngle(axis, angle);\r\n }\r\n}\r\n\r\n"],"names":["SpringBone","bone","stiffness","damping","mass","gravityScale","radius","_bone","_stiffness","Math","max","min","_damping","_mass","_gravityScale","_radius","_initialLocalPosition","position","clone","_boneLength","magnitude","worldPos","Vector3","worldMatrix","decompose","_currentPosition","_previousPosition","value","currentPosition","initialLocalPosition","reset","set","update","deltaTime","gravity","windForce","parent","parentWorldPos","velocity","sub","scale","totalForce","gravityForce","addBy","dampingForce","toChild","currentLength","stretchAmount","direction","springForce","acceleration","velocityMagnitude","dampingFactor","scaleBy","finalToChild","finalLength","targetPos","add","constraintStrength","x","y","z","applyToNode","parentWorldRot","Quaternion","currentDir","parentInvRot","conjugate","currentDirLocal","transform","originalDirLocal","normalize","localRotation","_fromToRotation","rotation","from","to","result","dot","identity","axis","cross","axisPX","lenSq","axisPY","inplaceNormalize","fromAxisAngle","PI","angle","acos"],"mappings":";;AAGA;;;;;;;;;;;;;;AAcC,IACM,MAAMA,UAAAA,CAAAA;8CAEX,KAAyB;2CAEzB,gBAAkC;uEAElC,iBAAmC;qDAEnC,qBAAuC;sDAEvC,WAA4B;oDAG5B,UAA2B;uDAE3B,QAAyB;8CAEzB,KAAsB;8DAEtB,aAA8B;0CAG9B,OAAwB;AAExB;;;;;;;;;AASC,MACD,YACEC,IAAe,EACfC,SAAY,GAAA,GAAG,EACfC,OAAU,GAAA,GAAG,EACbC,IAAAA,GAAO,CAAC,EACRC,YAAAA,GAAe,CAAC,EAChBC,MAAAA,GAAS,IAAI,CACb;QACA,IAAI,CAACC,KAAK,GAAGN,IAAAA;QACb,IAAI,CAACO,UAAU,GAAGC,IAAKC,CAAAA,GAAG,CAAC,CAAGD,EAAAA,IAAAA,CAAKE,GAAG,CAAC,CAAGT,EAAAA,SAAAA,CAAAA,CAAAA;QAC1C,IAAI,CAACU,QAAQ,GAAGH,IAAKC,CAAAA,GAAG,CAAC,CAAGD,EAAAA,IAAAA,CAAKE,GAAG,CAAC,CAAGR,EAAAA,OAAAA,CAAAA,CAAAA;AACxC,QAAA,IAAI,CAACU,KAA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