@zephyr3d/scene 0.9.2 → 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 (420) hide show
  1. package/dist/animation/animationset.js +135 -135
  2. package/dist/animation/animationset.js.map +1 -1
  3. package/dist/animation/ik/ik_chain_builder.js +68 -0
  4. package/dist/animation/ik/ik_chain_builder.js.map +1 -0
  5. package/dist/animation/ik/ik_pole_constraint.js +2 -7
  6. package/dist/animation/ik/ik_pole_constraint.js.map +1 -1
  7. package/dist/animation/joint_dynamics/controller.js +146 -146
  8. package/dist/animation/joint_dynamics/controller.js.map +1 -1
  9. package/dist/animation/joint_dynamics/math.js +16 -0
  10. package/dist/animation/joint_dynamics/math.js.map +1 -0
  11. package/dist/animation/spring/spring_particle.js +4 -4
  12. package/dist/animation/spring/spring_particle.js.map +1 -1
  13. package/dist/animation/spring/spring_system.js +75 -75
  14. package/dist/animation/spring/spring_system.js.map +1 -1
  15. package/dist/animation/spring2/constraints.js.map +1 -1
  16. package/dist/animation/spring2/controller.js +64 -64
  17. package/dist/animation/spring2/controller.js.map +1 -1
  18. package/dist/animation/spring2/math.js.map +1 -1
  19. package/dist/animation/spring2/spring_system.js +8 -8
  20. package/dist/animation/spring2/spring_system.js.map +1 -1
  21. package/dist/asset/model.js +57 -57
  22. package/dist/asset/model.js.map +1 -1
  23. package/dist/camera/camera.js +184 -184
  24. package/dist/camera/camera.js.map +1 -1
  25. package/dist/index.d.ts +2 -6
  26. package/dist/index.js +1 -1
  27. package/dist/material/material.js +288 -288
  28. package/dist/material/material.js.map +1 -1
  29. package/dist/material/shader/helper.js +281 -278
  30. package/dist/material/shader/helper.js.map +1 -1
  31. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js +38 -0
  32. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js.map +1 -0
  33. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js +10 -0
  34. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js.map +1 -0
  35. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js +127 -0
  36. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js.map +1 -0
  37. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js +263 -0
  38. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js.map +1 -0
  39. package/dist/render/cluster_light.js +3 -4
  40. package/dist/render/cluster_light.js.map +1 -1
  41. package/dist/render/rendergraph/history_resource_manager.js +93 -93
  42. package/dist/render/rendergraph/history_resource_manager.js.map +1 -1
  43. package/dist/render/rendergraph/history_resources.js +3 -3
  44. package/dist/render/rendergraph/history_resources.js.map +1 -1
  45. package/dist/render/rendergraph/types.js +22 -22
  46. package/dist/render/rendergraph/types.js.map +1 -1
  47. package/dist/scene/mesh.js +80 -80
  48. package/dist/scene/mesh.js.map +1 -1
  49. package/dist/scene/scene_node.js +228 -228
  50. package/dist/scene/scene_node.js.map +1 -1
  51. package/dist/shapes/torus.js +90 -59
  52. package/dist/shapes/torus.js.map +1 -1
  53. package/dist/src/animation/animation.js +127 -0
  54. package/dist/src/animation/animation.js.map +1 -0
  55. package/dist/src/animation/animationset.js +255 -0
  56. package/dist/src/animation/animationset.js.map +1 -0
  57. package/dist/src/animation/animationtrack.js +34 -0
  58. package/dist/src/animation/animationtrack.js.map +1 -0
  59. package/dist/src/animation/eulerrotationtrack.js +52 -0
  60. package/dist/src/animation/eulerrotationtrack.js.map +1 -0
  61. package/dist/src/animation/morphtarget.js +93 -0
  62. package/dist/src/animation/morphtarget.js.map +1 -0
  63. package/dist/src/animation/morphtrack.js +70 -0
  64. package/dist/src/animation/morphtrack.js.map +1 -0
  65. package/dist/src/animation/proptrack.js +161 -0
  66. package/dist/src/animation/proptrack.js.map +1 -0
  67. package/dist/src/animation/rotationtrack.js +51 -0
  68. package/dist/src/animation/rotationtrack.js.map +1 -0
  69. package/dist/src/animation/scaletrack.js +50 -0
  70. package/dist/src/animation/scaletrack.js.map +1 -0
  71. package/dist/src/animation/skeleton.js +204 -0
  72. package/dist/src/animation/skeleton.js.map +1 -0
  73. package/dist/src/animation/translationtrack.js +50 -0
  74. package/dist/src/animation/translationtrack.js.map +1 -0
  75. package/dist/src/app/app.js +129 -0
  76. package/dist/src/app/app.js.map +1 -0
  77. package/dist/src/app/inputmgr.js +267 -0
  78. package/dist/src/app/inputmgr.js.map +1 -0
  79. package/dist/src/asset/assetmanager.js +404 -0
  80. package/dist/src/asset/assetmanager.js.map +1 -0
  81. package/dist/src/asset/builtin.js +337 -0
  82. package/dist/src/asset/builtin.js.map +1 -0
  83. package/dist/src/asset/loaders/dds/dds.js +470 -0
  84. package/dist/src/asset/loaders/dds/dds.js.map +1 -0
  85. package/dist/src/asset/loaders/dds/dds_loader.js +28 -0
  86. package/dist/src/asset/loaders/dds/dds_loader.js.map +1 -0
  87. package/dist/src/asset/loaders/gltf/gltf_loader.js +1265 -0
  88. package/dist/src/asset/loaders/gltf/gltf_loader.js.map +1 -0
  89. package/dist/src/asset/loaders/gltf/helpers.js +327 -0
  90. package/dist/src/asset/loaders/gltf/helpers.js.map +1 -0
  91. package/dist/src/asset/loaders/hdr/hdr.js +180 -0
  92. package/dist/src/asset/loaders/hdr/hdr.js.map +1 -0
  93. package/dist/src/asset/loaders/image/tga_Loader.js +116 -0
  94. package/dist/src/asset/loaders/image/tga_Loader.js.map +1 -0
  95. package/dist/src/asset/loaders/image/webimage_loader.js +63 -0
  96. package/dist/src/asset/loaders/image/webimage_loader.js.map +1 -0
  97. package/dist/src/asset/loaders/loader.js +45 -0
  98. package/dist/src/asset/loaders/loader.js.map +1 -0
  99. package/dist/src/asset/model.js +414 -0
  100. package/dist/src/asset/model.js.map +1 -0
  101. package/dist/src/blitter/bilateralblur.js +221 -0
  102. package/dist/src/blitter/bilateralblur.js.map +1 -0
  103. package/dist/src/blitter/blitter.js +390 -0
  104. package/dist/src/blitter/blitter.js.map +1 -0
  105. package/dist/src/blitter/box.js +118 -0
  106. package/dist/src/blitter/box.js.map +1 -0
  107. package/dist/src/blitter/copy.js +22 -0
  108. package/dist/src/blitter/copy.js.map +1 -0
  109. package/dist/src/blitter/gaussianblur.js +228 -0
  110. package/dist/src/blitter/gaussianblur.js.map +1 -0
  111. package/dist/src/camera/base.js +92 -0
  112. package/dist/src/camera/base.js.map +1 -0
  113. package/dist/src/camera/camera.js +1005 -0
  114. package/dist/src/camera/camera.js.map +1 -0
  115. package/dist/src/camera/fps.js +238 -0
  116. package/dist/src/camera/fps.js.map +1 -0
  117. package/dist/src/camera/orbit.js +245 -0
  118. package/dist/src/camera/orbit.js.map +1 -0
  119. package/dist/src/camera/orthocamera.js +167 -0
  120. package/dist/src/camera/orthocamera.js.map +1 -0
  121. package/dist/src/camera/perspectivecamera.js +141 -0
  122. package/dist/src/camera/perspectivecamera.js.map +1 -0
  123. package/dist/src/index.js +120 -0
  124. package/dist/src/index.js.map +1 -0
  125. package/dist/src/material/blinn.js +81 -0
  126. package/dist/src/material/blinn.js.map +1 -0
  127. package/dist/src/material/grassmaterial.js +113 -0
  128. package/dist/src/material/grassmaterial.js.map +1 -0
  129. package/dist/src/material/lambert.js +92 -0
  130. package/dist/src/material/lambert.js.map +1 -0
  131. package/dist/src/material/material.js +301 -0
  132. package/dist/src/material/material.js.map +1 -0
  133. package/dist/src/material/meshmaterial.js +704 -0
  134. package/dist/src/material/meshmaterial.js.map +1 -0
  135. package/dist/src/material/mixins/albedocolor.js +76 -0
  136. package/dist/src/material/mixins/albedocolor.js.map +1 -0
  137. package/dist/src/material/mixins/foliage.js +47 -0
  138. package/dist/src/material/mixins/foliage.js.map +1 -0
  139. package/dist/src/material/mixins/lightmodel/blinnphong.js +112 -0
  140. package/dist/src/material/mixins/lightmodel/blinnphong.js.map +1 -0
  141. package/dist/src/material/mixins/lightmodel/lambert.js +58 -0
  142. package/dist/src/material/mixins/lightmodel/lambert.js.map +1 -0
  143. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js +178 -0
  144. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -0
  145. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js +139 -0
  146. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -0
  147. package/dist/src/material/mixins/lit.js +476 -0
  148. package/dist/src/material/mixins/lit.js.map +1 -0
  149. package/dist/src/material/mixins/pbr/common.js +918 -0
  150. package/dist/src/material/mixins/pbr/common.js.map +1 -0
  151. package/dist/src/material/mixins/texture.js +172 -0
  152. package/dist/src/material/mixins/texture.js.map +1 -0
  153. package/dist/src/material/mixins/vertexcolor.js +56 -0
  154. package/dist/src/material/mixins/vertexcolor.js.map +1 -0
  155. package/dist/src/material/particle.js +178 -0
  156. package/dist/src/material/particle.js.map +1 -0
  157. package/dist/src/material/pbrmr.js +97 -0
  158. package/dist/src/material/pbrmr.js.map +1 -0
  159. package/dist/src/material/pbrsg.js +97 -0
  160. package/dist/src/material/pbrsg.js.map +1 -0
  161. package/dist/src/material/shader/helper.js +1209 -0
  162. package/dist/src/material/shader/helper.js.map +1 -0
  163. package/dist/src/material/terrain-cm.js +606 -0
  164. package/dist/src/material/terrain-cm.js.map +1 -0
  165. package/dist/src/material/terrainmaterial.js +375 -0
  166. package/dist/src/material/terrainmaterial.js.map +1 -0
  167. package/dist/src/material/unlit.js +41 -0
  168. package/dist/src/material/unlit.js.map +1 -0
  169. package/dist/src/material/water.js +417 -0
  170. package/dist/src/material/water.js.map +1 -0
  171. package/dist/src/posteffect/bloom.js +361 -0
  172. package/dist/src/posteffect/bloom.js.map +1 -0
  173. package/dist/src/posteffect/compositor.js +226 -0
  174. package/dist/src/posteffect/compositor.js.map +1 -0
  175. package/dist/src/posteffect/fxaa.js +273 -0
  176. package/dist/src/posteffect/fxaa.js.map +1 -0
  177. package/dist/src/posteffect/grayscale.js +69 -0
  178. package/dist/src/posteffect/grayscale.js.map +1 -0
  179. package/dist/src/posteffect/motionblur.js +96 -0
  180. package/dist/src/posteffect/motionblur.js.map +1 -0
  181. package/dist/src/posteffect/posteffect.js +126 -0
  182. package/dist/src/posteffect/posteffect.js.map +1 -0
  183. package/dist/src/posteffect/sao.js +324 -0
  184. package/dist/src/posteffect/sao.js.map +1 -0
  185. package/dist/src/posteffect/ssr.js +489 -0
  186. package/dist/src/posteffect/ssr.js.map +1 -0
  187. package/dist/src/posteffect/taa.js +172 -0
  188. package/dist/src/posteffect/taa.js.map +1 -0
  189. package/dist/src/posteffect/tonemap.js +94 -0
  190. package/dist/src/posteffect/tonemap.js.map +1 -0
  191. package/dist/src/render/abuffer_oit.js +361 -0
  192. package/dist/src/render/abuffer_oit.js.map +1 -0
  193. package/dist/src/render/clipmap.js +851 -0
  194. package/dist/src/render/clipmap.js.map +1 -0
  195. package/dist/src/render/cluster_light.js +333 -0
  196. package/dist/src/render/cluster_light.js.map +1 -0
  197. package/dist/src/render/cull_visitor.js +187 -0
  198. package/dist/src/render/cull_visitor.js.map +1 -0
  199. package/dist/src/render/depthpass.js +68 -0
  200. package/dist/src/render/depthpass.js.map +1 -0
  201. package/dist/src/render/drawable_mixin.js +227 -0
  202. package/dist/src/render/drawable_mixin.js.map +1 -0
  203. package/dist/src/render/envlight.js +463 -0
  204. package/dist/src/render/envlight.js.map +1 -0
  205. package/dist/src/render/fbm_wavegenerator.js +251 -0
  206. package/dist/src/render/fbm_wavegenerator.js.map +1 -0
  207. package/dist/src/render/fft_wavegenerator.js +1006 -0
  208. package/dist/src/render/fft_wavegenerator.js.map +1 -0
  209. package/dist/src/render/fullscreenquad.js +38 -0
  210. package/dist/src/render/fullscreenquad.js.map +1 -0
  211. package/dist/src/render/gerstner_wavegenerator.js +314 -0
  212. package/dist/src/render/gerstner_wavegenerator.js.map +1 -0
  213. package/dist/src/render/globalbindgroup_allocator.js +60 -0
  214. package/dist/src/render/globalbindgroup_allocator.js.map +1 -0
  215. package/dist/src/render/hzb.js +273 -0
  216. package/dist/src/render/hzb.js.map +1 -0
  217. package/dist/src/render/lightpass.js +172 -0
  218. package/dist/src/render/lightpass.js.map +1 -0
  219. package/dist/src/render/objectcolorpass.js +51 -0
  220. package/dist/src/render/objectcolorpass.js.map +1 -0
  221. package/dist/src/render/primitive.js +364 -0
  222. package/dist/src/render/primitive.js.map +1 -0
  223. package/dist/src/render/render_queue.js +467 -0
  224. package/dist/src/render/render_queue.js.map +1 -0
  225. package/dist/src/render/renderbundle_wrapper.js +152 -0
  226. package/dist/src/render/renderbundle_wrapper.js.map +1 -0
  227. package/dist/src/render/renderer.js +455 -0
  228. package/dist/src/render/renderer.js.map +1 -0
  229. package/dist/src/render/renderpass.js +200 -0
  230. package/dist/src/render/renderpass.js.map +1 -0
  231. package/dist/src/render/shadowmap_pass.js +56 -0
  232. package/dist/src/render/shadowmap_pass.js.map +1 -0
  233. package/dist/src/render/sky.js +1103 -0
  234. package/dist/src/render/sky.js.map +1 -0
  235. package/dist/src/render/weightedblended_oit.js +168 -0
  236. package/dist/src/render/weightedblended_oit.js.map +1 -0
  237. package/dist/src/scene/batchgroup.js +162 -0
  238. package/dist/src/scene/batchgroup.js.map +1 -0
  239. package/dist/src/scene/environment.js +209 -0
  240. package/dist/src/scene/environment.js.map +1 -0
  241. package/dist/src/scene/graph_node.js +72 -0
  242. package/dist/src/scene/graph_node.js.map +1 -0
  243. package/dist/src/scene/light.js +416 -0
  244. package/dist/src/scene/light.js.map +1 -0
  245. package/dist/src/scene/mesh.js +341 -0
  246. package/dist/src/scene/mesh.js.map +1 -0
  247. package/dist/src/scene/octree.js +649 -0
  248. package/dist/src/scene/octree.js.map +1 -0
  249. package/dist/src/scene/particlesys.js +738 -0
  250. package/dist/src/scene/particlesys.js.map +1 -0
  251. package/dist/src/scene/raycast_visitor.js +103 -0
  252. package/dist/src/scene/raycast_visitor.js.map +1 -0
  253. package/dist/src/scene/scene.js +284 -0
  254. package/dist/src/scene/scene.js.map +1 -0
  255. package/dist/src/scene/scene_node.js +732 -0
  256. package/dist/src/scene/scene_node.js.map +1 -0
  257. package/dist/src/scene/terrain/grass.js +278 -0
  258. package/dist/src/scene/terrain/grass.js.map +1 -0
  259. package/dist/src/scene/terrain/heightfield.js +475 -0
  260. package/dist/src/scene/terrain/heightfield.js.map +1 -0
  261. package/dist/src/scene/terrain/patch.js +530 -0
  262. package/dist/src/scene/terrain/patch.js.map +1 -0
  263. package/dist/src/scene/terrain/quadtree.js +461 -0
  264. package/dist/src/scene/terrain/quadtree.js.map +1 -0
  265. package/dist/src/scene/terrain/terrain.js +246 -0
  266. package/dist/src/scene/terrain/terrain.js.map +1 -0
  267. package/dist/src/scene/terrain-cm/grass.js +594 -0
  268. package/dist/src/scene/terrain-cm/grass.js.map +1 -0
  269. package/dist/src/scene/terrain-cm/grassmaterial.js +159 -0
  270. package/dist/src/scene/terrain-cm/grassmaterial.js.map +1 -0
  271. package/dist/src/scene/terrain-cm/terrain-cm.js +538 -0
  272. package/dist/src/scene/terrain-cm/terrain-cm.js.map +1 -0
  273. package/dist/src/scene/water.js +374 -0
  274. package/dist/src/scene/water.js.map +1 -0
  275. package/dist/src/shaders/atmosphere.js +957 -0
  276. package/dist/src/shaders/atmosphere.js.map +1 -0
  277. package/dist/src/shaders/fog.js +112 -0
  278. package/dist/src/shaders/fog.js.map +1 -0
  279. package/dist/src/shaders/misc.js +266 -0
  280. package/dist/src/shaders/misc.js.map +1 -0
  281. package/dist/src/shaders/noise.js +222 -0
  282. package/dist/src/shaders/noise.js.map +1 -0
  283. package/dist/src/shaders/pbr.js +51 -0
  284. package/dist/src/shaders/pbr.js.map +1 -0
  285. package/dist/src/shaders/shadow.js +636 -0
  286. package/dist/src/shaders/shadow.js.map +1 -0
  287. package/dist/src/shaders/ssr.js +490 -0
  288. package/dist/src/shaders/ssr.js.map +1 -0
  289. package/dist/src/shaders/temporal.js +215 -0
  290. package/dist/src/shaders/temporal.js.map +1 -0
  291. package/dist/src/shaders/water.js +756 -0
  292. package/dist/src/shaders/water.js.map +1 -0
  293. package/dist/src/shadow/esm.js +237 -0
  294. package/dist/src/shadow/esm.js.map +1 -0
  295. package/dist/src/shadow/pcf_opt.js +181 -0
  296. package/dist/src/shadow/pcf_opt.js.map +1 -0
  297. package/dist/src/shadow/pcf_pd.js +189 -0
  298. package/dist/src/shadow/pcf_pd.js.map +1 -0
  299. package/dist/src/shadow/shader.js +37 -0
  300. package/dist/src/shadow/shader.js.map +1 -0
  301. package/dist/src/shadow/shadow_impl.js +15 -0
  302. package/dist/src/shadow/shadow_impl.js.map +1 -0
  303. package/dist/src/shadow/shadowmapper.js +790 -0
  304. package/dist/src/shadow/shadowmapper.js.map +1 -0
  305. package/dist/src/shadow/ssm.js +159 -0
  306. package/dist/src/shadow/ssm.js.map +1 -0
  307. package/dist/src/shadow/vsm.js +297 -0
  308. package/dist/src/shadow/vsm.js.map +1 -0
  309. package/dist/src/shapes/box.js +386 -0
  310. package/dist/src/shapes/box.js.map +1 -0
  311. package/dist/src/shapes/cylinder.js +125 -0
  312. package/dist/src/shapes/cylinder.js.map +1 -0
  313. package/dist/src/shapes/plane.js +88 -0
  314. package/dist/src/shapes/plane.js.map +1 -0
  315. package/dist/src/shapes/shape.js +87 -0
  316. package/dist/src/shapes/shape.js.map +1 -0
  317. package/dist/src/shapes/sphere.js +114 -0
  318. package/dist/src/shapes/sphere.js.map +1 -0
  319. package/dist/src/shapes/tetrahedron.js +188 -0
  320. package/dist/src/shapes/tetrahedron.js.map +1 -0
  321. package/dist/src/shapes/torus.js +111 -0
  322. package/dist/src/shapes/torus.js.map +1 -0
  323. package/dist/src/utility/aabbtree.js +400 -0
  324. package/dist/src/utility/aabbtree.js.map +1 -0
  325. package/dist/src/utility/bounding_volume.js +29 -0
  326. package/dist/src/utility/bounding_volume.js.map +1 -0
  327. package/dist/src/utility/debug.js +28 -0
  328. package/dist/src/utility/debug.js.map +1 -0
  329. package/dist/src/utility/draco/decoder.js +116 -0
  330. package/dist/src/utility/draco/decoder.js.map +1 -0
  331. package/dist/src/utility/misc.js +105 -0
  332. package/dist/src/utility/misc.js.map +1 -0
  333. package/dist/src/utility/panorama.js +163 -0
  334. package/dist/src/utility/panorama.js.map +1 -0
  335. package/dist/src/utility/pmrem.js +354 -0
  336. package/dist/src/utility/pmrem.js.map +1 -0
  337. package/dist/src/utility/rendermipmap.js +115 -0
  338. package/dist/src/utility/rendermipmap.js.map +1 -0
  339. package/dist/src/utility/serialization/json.js +402 -0
  340. package/dist/src/utility/serialization/json.js.map +1 -0
  341. package/dist/src/utility/serialization/manager.js +623 -0
  342. package/dist/src/utility/serialization/manager.js.map +1 -0
  343. package/dist/src/utility/serialization/scene/animation.js +248 -0
  344. package/dist/src/utility/serialization/scene/animation.js.map +1 -0
  345. package/dist/src/utility/serialization/scene/batch.js +59 -0
  346. package/dist/src/utility/serialization/scene/batch.js.map +1 -0
  347. package/dist/src/utility/serialization/scene/camera.js +790 -0
  348. package/dist/src/utility/serialization/scene/camera.js.map +1 -0
  349. package/dist/src/utility/serialization/scene/common.js +222 -0
  350. package/dist/src/utility/serialization/scene/common.js.map +1 -0
  351. package/dist/src/utility/serialization/scene/light.js +575 -0
  352. package/dist/src/utility/serialization/scene/light.js.map +1 -0
  353. package/dist/src/utility/serialization/scene/material.js +1111 -0
  354. package/dist/src/utility/serialization/scene/material.js.map +1 -0
  355. package/dist/src/utility/serialization/scene/mesh.js +148 -0
  356. package/dist/src/utility/serialization/scene/mesh.js.map +1 -0
  357. package/dist/src/utility/serialization/scene/misc.js +39 -0
  358. package/dist/src/utility/serialization/scene/misc.js.map +1 -0
  359. package/dist/src/utility/serialization/scene/node.js +451 -0
  360. package/dist/src/utility/serialization/scene/node.js.map +1 -0
  361. package/dist/src/utility/serialization/scene/particle.js +425 -0
  362. package/dist/src/utility/serialization/scene/particle.js.map +1 -0
  363. package/dist/src/utility/serialization/scene/primitive.js +692 -0
  364. package/dist/src/utility/serialization/scene/primitive.js.map +1 -0
  365. package/dist/src/utility/serialization/scene/scene.js +704 -0
  366. package/dist/src/utility/serialization/scene/scene.js.map +1 -0
  367. package/dist/src/utility/serialization/scene/terrain.js +488 -0
  368. package/dist/src/utility/serialization/scene/terrain.js.map +1 -0
  369. package/dist/src/utility/serialization/scene/water.js +465 -0
  370. package/dist/src/utility/serialization/scene/water.js.map +1 -0
  371. package/dist/src/utility/shprojector.js +297 -0
  372. package/dist/src/utility/shprojector.js.map +1 -0
  373. package/dist/src/utility/textures/ggxlut.js +213 -0
  374. package/dist/src/utility/textures/ggxlut.js.map +1 -0
  375. package/dist/src/utility/textures/gradientnoise.js +62 -0
  376. package/dist/src/utility/textures/gradientnoise.js.map +1 -0
  377. package/dist/src/utility/textures/randomnoise.js +41 -0
  378. package/dist/src/utility/textures/randomnoise.js.map +1 -0
  379. package/dist/src/values.js +162 -0
  380. package/dist/src/values.js.map +1 -0
  381. package/dist/utility/blueprint/material/common.js +7 -0
  382. package/dist/utility/blueprint/material/common.js.map +1 -0
  383. package/dist/utility/blueprint/material/ir.js +489 -489
  384. package/dist/utility/blueprint/material/ir.js.map +1 -1
  385. package/dist/utility/serialization/blueprint/constants.js +255 -0
  386. package/dist/utility/serialization/blueprint/constants.js.map +1 -0
  387. package/dist/utility/serialization/blueprint/material/constants.js +203 -0
  388. package/dist/utility/serialization/blueprint/material/constants.js.map +1 -0
  389. package/dist/utility/serialization/blueprint/material/texture.js +165 -0
  390. package/dist/utility/serialization/blueprint/material/texture.js.map +1 -0
  391. package/dist/utility/serialization/manager.js +271 -271
  392. package/dist/utility/serialization/manager.js.map +1 -1
  393. package/dist/utility/serialization/scene/animation.js.map +1 -1
  394. package/dist/utility/serialization/scene/camera.js.map +1 -1
  395. package/dist/utility/serialization/scene/common.js.map +1 -1
  396. package/dist/utility/serialization/scene/light.js.map +1 -1
  397. package/dist/utility/serialization/scene/material.js.map +1 -1
  398. package/dist/utility/serialization/scene/mesh.js.map +1 -1
  399. package/dist/utility/serialization/scene/node.js.map +1 -1
  400. package/dist/utility/serialization/scene/particle.js.map +1 -1
  401. package/dist/utility/serialization/scene/primitive.js.map +1 -1
  402. package/dist/utility/serialization/scene/scene.js.map +1 -1
  403. package/dist/utility/serialization/scene/terrain.js.map +1 -1
  404. package/dist/utility/serialization/types.js +4 -4
  405. package/dist/utility/serialization/types.js.map +1 -1
  406. package/dist/values.js +49 -53
  407. package/dist/values.js.map +1 -1
  408. package/package.json +1 -1
  409. package/dist/animation/joint_dynamics/vrm_spring_bone.js +0 -46
  410. package/dist/animation/joint_dynamics/vrm_spring_bone.js.map +0 -1
  411. package/dist/animation/spring/spring_bone.js +0 -240
  412. package/dist/animation/spring/spring_bone.js.map +0 -1
  413. package/dist/animation/spring/spring_bone_collider.js +0 -198
  414. package/dist/animation/spring/spring_bone_collider.js.map +0 -1
  415. package/dist/animation/spring/spring_bone_constraint.js +0 -170
  416. package/dist/animation/spring/spring_bone_constraint.js.map +0 -1
  417. package/dist/animation/spring/spring_bone_system.js +0 -328
  418. package/dist/animation/spring/spring_bone_system.js.map +0 -1
  419. package/dist/render/sky_motion_vector.js +0 -85
  420. package/dist/render/sky_motion_vector.js.map +0 -1
@@ -0,0 +1,204 @@
1
+ import { Vector3, Matrix4x4, nextPowerOf2 } from '@zephyr3d/base';
2
+ import { BoundingBox } from '../utility/bounding_volume.js';
3
+ import { Application } from '../app/app.js';
4
+
5
+ const tmpV0 = new Vector3();
6
+ const tmpV1 = new Vector3();
7
+ const tmpV2 = new Vector3();
8
+ const tmpV3 = new Vector3();
9
+ /**
10
+ * Skeleton for skinned animation
11
+ * @public
12
+ */ class Skeleton {
13
+ /** @internal */ _meshes;
14
+ /** @internal */ _joints;
15
+ /** @internal */ _inverseBindMatrices;
16
+ /** @internal */ _bindPoseMatrices;
17
+ /** @internal */ _jointMatrices;
18
+ /** @internal */ _jointOffsets;
19
+ /** @internal */ _jointMatrixArray;
20
+ /** @internal */ _jointTexture;
21
+ /**
22
+ * Creates an instance of skeleton
23
+ * @param joints - The joint nodes
24
+ * @param inverseBindMatrices - The inverse binding matrices of the joints
25
+ * @param bindPoseMatrices - The binding pose matrices of the joints
26
+ */ constructor(joints, inverseBindMatrices, bindPoseMatrices, meshes, bounding){
27
+ this._joints = joints;
28
+ this._inverseBindMatrices = inverseBindMatrices;
29
+ this._bindPoseMatrices = bindPoseMatrices;
30
+ this._jointMatrixArray = null;
31
+ this._jointMatrices = null;
32
+ this._jointOffsets = null;
33
+ this._jointTexture = null;
34
+ this.updateJointMatrices();
35
+ this._meshes = meshes.map((mesh, index)=>{
36
+ return {
37
+ mesh,
38
+ bounding: this.getBoundingInfo(bounding[index]),
39
+ box: new BoundingBox()
40
+ };
41
+ });
42
+ }
43
+ /**
44
+ * Disposes self
45
+ */ dispose() {
46
+ this._jointTexture?.dispose();
47
+ this._jointTexture = null;
48
+ this._joints = null;
49
+ this._inverseBindMatrices = null;
50
+ this._bindPoseMatrices = null;
51
+ this._jointMatrices = null;
52
+ this._jointMatrixArray = null;
53
+ }
54
+ /**
55
+ * The texture that contains the transform matrices of all the joints
56
+ */ get jointTexture() {
57
+ return this._jointTexture;
58
+ }
59
+ /** @internal */ updateJointMatrices(jointTransforms, worldMatrix) {
60
+ if (!this._jointTexture) {
61
+ this._createJointTexture();
62
+ }
63
+ if (this._jointOffsets[0] === 0) {
64
+ this._jointOffsets[0] = 1;
65
+ this._jointOffsets[1] = 1;
66
+ } else {
67
+ this._jointOffsets[1] = this._jointOffsets[0];
68
+ this._jointOffsets[0] = this._joints.length - this._jointOffsets[0] + 2;
69
+ }
70
+ for(let i = 0; i < this._joints.length; i++){
71
+ const mat = this._jointMatrices[i + this._jointOffsets[0] - 1];
72
+ const jointTransform = jointTransforms ? jointTransforms[i] : this._joints[i].worldMatrix;
73
+ if (worldMatrix) {
74
+ Matrix4x4.multiplyAffine(worldMatrix, jointTransform, jointTransform);
75
+ }
76
+ Matrix4x4.multiply(jointTransform, this._inverseBindMatrices[i], mat);
77
+ }
78
+ }
79
+ /** @internal */ computeBindPose(model) {
80
+ this.updateJointMatrices(this._bindPoseMatrices, model.worldMatrix);
81
+ this._jointOffsets[1] = this._jointOffsets[0];
82
+ this._jointTexture.update(this._jointMatrixArray, 0, 0, this._jointTexture.width, this._jointTexture.height);
83
+ }
84
+ /** @internal */ computeJoints() {
85
+ this.updateJointMatrices();
86
+ this._jointTexture.update(this._jointMatrixArray, 0, 0, this._jointTexture.width, this._jointTexture.height);
87
+ }
88
+ /** @internal */ apply() {
89
+ this.computeJoints();
90
+ for (const mesh of this._meshes){
91
+ this.computeBoundingBox(mesh.bounding, mesh.mesh.invWorldMatrix);
92
+ mesh.mesh.setBoneMatrices(this.jointTexture);
93
+ mesh.mesh.setAnimatedBoundingBox(mesh.bounding.boundingBox);
94
+ }
95
+ }
96
+ /** @internal */ reset() {
97
+ for (const mesh of this._meshes){
98
+ mesh.mesh.setBoneMatrices(null);
99
+ mesh.mesh.setAnimatedBoundingBox(null);
100
+ }
101
+ }
102
+ /** @internal */ computeBoundingBox(info, invWorldMatrix) {
103
+ info.boundingBox.beginExtend();
104
+ for(let i = 0; i < info.boundingVertices.length; i++){
105
+ this._jointMatrices[info.boundingVertexBlendIndices[i * 4 + 0] + this._jointOffsets[0] - 1].transformPointAffine(info.boundingVertices[i], tmpV0).scaleBy(info.boundingVertexJointWeights[i * 4 + 0]);
106
+ this._jointMatrices[info.boundingVertexBlendIndices[i * 4 + 1] + this._jointOffsets[0] - 1].transformPointAffine(info.boundingVertices[i], tmpV1).scaleBy(info.boundingVertexJointWeights[i * 4 + 1]);
107
+ this._jointMatrices[info.boundingVertexBlendIndices[i * 4 + 2] + this._jointOffsets[0] - 1].transformPointAffine(info.boundingVertices[i], tmpV2).scaleBy(info.boundingVertexJointWeights[i * 4 + 2]);
108
+ this._jointMatrices[info.boundingVertexBlendIndices[i * 4 + 3] + this._jointOffsets[0] - 1].transformPointAffine(info.boundingVertices[i], tmpV3).scaleBy(info.boundingVertexJointWeights[i * 4 + 3]);
109
+ tmpV0.addBy(tmpV1).addBy(tmpV2).addBy(tmpV3);
110
+ invWorldMatrix.transformPointAffine(tmpV0, tmpV0);
111
+ info.boundingBox.extend(tmpV0);
112
+ }
113
+ }
114
+ /** @internal */ _createJointTexture() {
115
+ const textureWidth = nextPowerOf2(Math.max(4, Math.ceil(Math.sqrt((this._joints.length * 2 + 1) * 4))));
116
+ const device = Application.instance.device;
117
+ this._jointTexture = device.createTexture2D('rgba32f', textureWidth, textureWidth, {
118
+ samplerOptions: {
119
+ magFilter: 'nearest',
120
+ minFilter: 'nearest',
121
+ mipFilter: 'none'
122
+ }
123
+ });
124
+ this._jointMatrixArray = new Float32Array(textureWidth * textureWidth * 4);
125
+ const buffer = this._jointMatrixArray.buffer;
126
+ this._jointOffsets = new Float32Array(buffer);
127
+ this._jointOffsets[0] = 0;
128
+ this._jointOffsets[1] = 0;
129
+ this._jointMatrices = Array.from({
130
+ length: this._joints.length * 2
131
+ }).map((val, index)=>new Matrix4x4(buffer, (index + 1) * 16 * Float32Array.BYTES_PER_ELEMENT));
132
+ }
133
+ /** @internal */ getBoundingInfo(meshData) {
134
+ const indices = [
135
+ 0,
136
+ 0,
137
+ 0,
138
+ 0,
139
+ 0,
140
+ 0
141
+ ];
142
+ let minx = Number.MAX_VALUE;
143
+ let maxx = -Number.MAX_VALUE;
144
+ let miny = Number.MAX_VALUE;
145
+ let maxy = -Number.MAX_VALUE;
146
+ let minz = Number.MAX_VALUE;
147
+ let maxz = -Number.MAX_VALUE;
148
+ const v = meshData.rawPositions;
149
+ const vert = new Vector3();
150
+ const tmpV0 = new Vector3();
151
+ const tmpV1 = new Vector3();
152
+ const tmpV2 = new Vector3();
153
+ const tmpV3 = new Vector3();
154
+ const numVertices = Math.floor(v.length / 3);
155
+ for(let i = 0; i < numVertices; i++){
156
+ vert.setXYZ(v[i * 3], v[i * 3 + 1], v[i * 3 + 2]);
157
+ this._jointMatrices[meshData.rawBlendIndices[i * 4 + 0] + this._jointOffsets[0] - 1].transformPointAffine(vert, tmpV0).scaleBy(meshData.rawJointWeights[i * 4 + 0]);
158
+ this._jointMatrices[meshData.rawBlendIndices[i * 4 + 1] + this._jointOffsets[0] - 1].transformPointAffine(vert, tmpV1).scaleBy(meshData.rawJointWeights[i * 4 + 1]);
159
+ this._jointMatrices[meshData.rawBlendIndices[i * 4 + 2] + this._jointOffsets[0] - 1].transformPointAffine(vert, tmpV2).scaleBy(meshData.rawJointWeights[i * 4 + 2]);
160
+ this._jointMatrices[meshData.rawBlendIndices[i * 4 + 3] + this._jointOffsets[0] - 1].transformPointAffine(vert, tmpV3).scaleBy(meshData.rawJointWeights[i * 4 + 3]);
161
+ tmpV0.addBy(tmpV1).addBy(tmpV2).addBy(tmpV3);
162
+ if (tmpV0.x < minx) {
163
+ minx = tmpV0.x;
164
+ indices[0] = i;
165
+ }
166
+ if (tmpV0.x > maxx) {
167
+ maxx = tmpV0.x;
168
+ indices[1] = i;
169
+ }
170
+ if (tmpV0.y < miny) {
171
+ miny = tmpV0.y;
172
+ indices[2] = i;
173
+ }
174
+ if (tmpV0.y > maxy) {
175
+ maxy = tmpV0.y;
176
+ indices[3] = i;
177
+ }
178
+ if (tmpV0.z < minz) {
179
+ minz = tmpV0.z;
180
+ indices[4] = i;
181
+ }
182
+ if (tmpV0.z > maxz) {
183
+ maxz = tmpV0.z;
184
+ indices[5] = i;
185
+ }
186
+ }
187
+ const info = {
188
+ boundingVertexBlendIndices: new Float32Array(Array.from({
189
+ length: 6 * 4
190
+ }).map((val, index)=>meshData.rawBlendIndices[indices[index >> 2] * 4 + index % 4])),
191
+ boundingVertexJointWeights: new Float32Array(Array.from({
192
+ length: 6 * 4
193
+ }).map((val, index)=>meshData.rawJointWeights[indices[index >> 2] * 4 + index % 4])),
194
+ boundingVertices: Array.from({
195
+ length: 6
196
+ }).map((val, index)=>new Vector3(meshData.rawPositions[indices[index] * 3], meshData.rawPositions[indices[index] * 3 + 1], meshData.rawPositions[indices[index] * 3 + 2])),
197
+ boundingBox: new BoundingBox()
198
+ };
199
+ return info;
200
+ }
201
+ }
202
+
203
+ export { Skeleton };
204
+ //# sourceMappingURL=skeleton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.js","sources":["../../../src/animation/skeleton.ts"],"sourcesContent":["import { Matrix4x4, Vector3, nextPowerOf2 } from '@zephyr3d/base';\r\nimport type { Texture2D } from '@zephyr3d/device';\r\nimport type { SceneNode } from '../scene/scene_node';\r\nimport type { Mesh } from '../scene';\r\nimport { BoundingBox } from '../utility/bounding_volume';\r\nimport type { AssetSubMeshData } from '../asset';\r\nimport { Application } from '../app/app';\r\n\r\ninterface SkinnedBoundingBox {\r\n boundingVertices: Vector3[];\r\n boundingVertexBlendIndices: Float32Array;\r\n boundingVertexJointWeights: Float32Array;\r\n boundingBox: BoundingBox;\r\n}\r\n\r\nconst tmpV0 = new Vector3();\r\nconst tmpV1 = new Vector3();\r\nconst tmpV2 = new Vector3();\r\nconst tmpV3 = new Vector3();\r\n\r\n/**\r\n * Skeleton for skinned animation\r\n * @public\r\n */\r\nexport class Skeleton {\r\n /** @internal */\r\n protected _meshes: { mesh: Mesh; bounding: SkinnedBoundingBox; box: BoundingBox }[];\r\n /** @internal */\r\n protected _joints: SceneNode[];\r\n /** @internal */\r\n protected _inverseBindMatrices: Matrix4x4[];\r\n /** @internal */\r\n protected _bindPoseMatrices: Matrix4x4[];\r\n /** @internal */\r\n protected _jointMatrices: Matrix4x4[];\r\n /** @internal */\r\n protected _jointOffsets: Float32Array<ArrayBuffer>;\r\n /** @internal */\r\n protected _jointMatrixArray: Float32Array<ArrayBuffer>;\r\n /** @internal */\r\n protected _jointTexture: Texture2D;\r\n /**\r\n * Creates an instance of skeleton\r\n * @param joints - The joint nodes\r\n * @param inverseBindMatrices - The inverse binding matrices of the joints\r\n * @param bindPoseMatrices - The binding pose matrices of the joints\r\n */\r\n constructor(\r\n joints: SceneNode[],\r\n inverseBindMatrices: Matrix4x4[],\r\n bindPoseMatrices: Matrix4x4[],\r\n meshes: Mesh[],\r\n bounding: AssetSubMeshData[]\r\n ) {\r\n this._joints = joints;\r\n this._inverseBindMatrices = inverseBindMatrices;\r\n this._bindPoseMatrices = bindPoseMatrices;\r\n this._jointMatrixArray = null;\r\n this._jointMatrices = null;\r\n this._jointOffsets = null;\r\n this._jointTexture = null;\r\n this.updateJointMatrices();\r\n this._meshes = meshes.map((mesh, index) => {\r\n return {\r\n mesh,\r\n bounding: this.getBoundingInfo(bounding[index]),\r\n box: new BoundingBox()\r\n };\r\n });\r\n }\r\n /**\r\n * Disposes self\r\n */\r\n dispose() {\r\n this._jointTexture?.dispose();\r\n this._jointTexture = null;\r\n this._joints = null;\r\n this._inverseBindMatrices = null;\r\n this._bindPoseMatrices = null;\r\n this._jointMatrices = null;\r\n this._jointMatrixArray = null;\r\n }\r\n /**\r\n * The texture that contains the transform matrices of all the joints\r\n */\r\n get jointTexture(): Texture2D {\r\n return this._jointTexture;\r\n }\r\n /** @internal */\r\n updateJointMatrices(jointTransforms?: Matrix4x4[], worldMatrix?: Matrix4x4) {\r\n if (!this._jointTexture) {\r\n this._createJointTexture();\r\n }\r\n if (this._jointOffsets[0] === 0) {\r\n this._jointOffsets[0] = 1;\r\n this._jointOffsets[1] = 1;\r\n } else {\r\n this._jointOffsets[1] = this._jointOffsets[0];\r\n this._jointOffsets[0] = this._joints.length - this._jointOffsets[0] + 2;\r\n }\r\n for (let i = 0; i < this._joints.length; i++) {\r\n const mat = this._jointMatrices[i + this._jointOffsets[0] - 1];\r\n const jointTransform = jointTransforms ? jointTransforms[i] : this._joints[i].worldMatrix;\r\n if (worldMatrix) {\r\n Matrix4x4.multiplyAffine(worldMatrix, jointTransform, jointTransform);\r\n }\r\n Matrix4x4.multiply(jointTransform, this._inverseBindMatrices[i], mat);\r\n }\r\n }\r\n /** @internal */\r\n computeBindPose(model: SceneNode) {\r\n this.updateJointMatrices(this._bindPoseMatrices, model.worldMatrix);\r\n this._jointOffsets[1] = this._jointOffsets[0];\r\n this._jointTexture.update(\r\n this._jointMatrixArray,\r\n 0,\r\n 0,\r\n this._jointTexture.width,\r\n this._jointTexture.height\r\n );\r\n }\r\n /** @internal */\r\n computeJoints() {\r\n this.updateJointMatrices();\r\n this._jointTexture.update(\r\n this._jointMatrixArray,\r\n 0,\r\n 0,\r\n this._jointTexture.width,\r\n this._jointTexture.height\r\n );\r\n }\r\n /** @internal */\r\n apply() {\r\n this.computeJoints();\r\n for (const mesh of this._meshes) {\r\n this.computeBoundingBox(mesh.bounding, mesh.mesh.invWorldMatrix);\r\n mesh.mesh.setBoneMatrices(this.jointTexture);\r\n mesh.mesh.setAnimatedBoundingBox(mesh.bounding.boundingBox);\r\n }\r\n }\r\n /** @internal */\r\n reset() {\r\n for (const mesh of this._meshes) {\r\n mesh.mesh.setBoneMatrices(null);\r\n mesh.mesh.setAnimatedBoundingBox(null);\r\n }\r\n }\r\n /** @internal */\r\n computeBoundingBox(info: SkinnedBoundingBox, invWorldMatrix: Matrix4x4) {\r\n info.boundingBox.beginExtend();\r\n for (let i = 0; i < info.boundingVertices.length; i++) {\r\n this._jointMatrices[info.boundingVertexBlendIndices[i * 4 + 0] + this._jointOffsets[0] - 1]\r\n .transformPointAffine(info.boundingVertices[i], tmpV0)\r\n .scaleBy(info.boundingVertexJointWeights[i * 4 + 0]);\r\n this._jointMatrices[info.boundingVertexBlendIndices[i * 4 + 1] + this._jointOffsets[0] - 1]\r\n .transformPointAffine(info.boundingVertices[i], tmpV1)\r\n .scaleBy(info.boundingVertexJointWeights[i * 4 + 1]);\r\n this._jointMatrices[info.boundingVertexBlendIndices[i * 4 + 2] + this._jointOffsets[0] - 1]\r\n .transformPointAffine(info.boundingVertices[i], tmpV2)\r\n .scaleBy(info.boundingVertexJointWeights[i * 4 + 2]);\r\n this._jointMatrices[info.boundingVertexBlendIndices[i * 4 + 3] + this._jointOffsets[0] - 1]\r\n .transformPointAffine(info.boundingVertices[i], tmpV3)\r\n .scaleBy(info.boundingVertexJointWeights[i * 4 + 3]);\r\n tmpV0.addBy(tmpV1).addBy(tmpV2).addBy(tmpV3);\r\n invWorldMatrix.transformPointAffine(tmpV0, tmpV0);\r\n info.boundingBox.extend(tmpV0);\r\n }\r\n }\r\n /** @internal */\r\n private _createJointTexture() {\r\n const textureWidth = nextPowerOf2(Math.max(4, Math.ceil(Math.sqrt((this._joints.length * 2 + 1) * 4))));\r\n const device = Application.instance.device;\r\n this._jointTexture = device.createTexture2D('rgba32f', textureWidth, textureWidth, {\r\n samplerOptions: {\r\n magFilter: 'nearest',\r\n minFilter: 'nearest',\r\n mipFilter: 'none'\r\n }\r\n });\r\n this._jointMatrixArray = new Float32Array(textureWidth * textureWidth * 4);\r\n const buffer = this._jointMatrixArray.buffer;\r\n this._jointOffsets = new Float32Array(buffer);\r\n this._jointOffsets[0] = 0;\r\n this._jointOffsets[1] = 0;\r\n this._jointMatrices = Array.from({ length: this._joints.length * 2 }).map(\r\n (val, index) => new Matrix4x4(buffer, (index + 1) * 16 * Float32Array.BYTES_PER_ELEMENT)\r\n );\r\n }\r\n /** @internal */\r\n private getBoundingInfo(meshData: AssetSubMeshData): SkinnedBoundingBox {\r\n const indices = [0, 0, 0, 0, 0, 0];\r\n let minx = Number.MAX_VALUE;\r\n let maxx = -Number.MAX_VALUE;\r\n let miny = Number.MAX_VALUE;\r\n let maxy = -Number.MAX_VALUE;\r\n let minz = Number.MAX_VALUE;\r\n let maxz = -Number.MAX_VALUE;\r\n const v = meshData.rawPositions;\r\n const vert = new Vector3();\r\n const tmpV0 = new Vector3();\r\n const tmpV1 = new Vector3();\r\n const tmpV2 = new Vector3();\r\n const tmpV3 = new Vector3();\r\n const numVertices = Math.floor(v.length / 3);\r\n for (let i = 0; i < numVertices; i++) {\r\n vert.setXYZ(v[i * 3], v[i * 3 + 1], v[i * 3 + 2]);\r\n this._jointMatrices[meshData.rawBlendIndices[i * 4 + 0] + this._jointOffsets[0] - 1]\r\n .transformPointAffine(vert, tmpV0)\r\n .scaleBy(meshData.rawJointWeights[i * 4 + 0]);\r\n this._jointMatrices[meshData.rawBlendIndices[i * 4 + 1] + this._jointOffsets[0] - 1]\r\n .transformPointAffine(vert, tmpV1)\r\n .scaleBy(meshData.rawJointWeights[i * 4 + 1]);\r\n this._jointMatrices[meshData.rawBlendIndices[i * 4 + 2] + this._jointOffsets[0] - 1]\r\n .transformPointAffine(vert, tmpV2)\r\n .scaleBy(meshData.rawJointWeights[i * 4 + 2]);\r\n this._jointMatrices[meshData.rawBlendIndices[i * 4 + 3] + this._jointOffsets[0] - 1]\r\n .transformPointAffine(vert, tmpV3)\r\n .scaleBy(meshData.rawJointWeights[i * 4 + 3]);\r\n tmpV0.addBy(tmpV1).addBy(tmpV2).addBy(tmpV3);\r\n if (tmpV0.x < minx) {\r\n minx = tmpV0.x;\r\n indices[0] = i;\r\n }\r\n if (tmpV0.x > maxx) {\r\n maxx = tmpV0.x;\r\n indices[1] = i;\r\n }\r\n if (tmpV0.y < miny) {\r\n miny = tmpV0.y;\r\n indices[2] = i;\r\n }\r\n if (tmpV0.y > maxy) {\r\n maxy = tmpV0.y;\r\n indices[3] = i;\r\n }\r\n if (tmpV0.z < minz) {\r\n minz = tmpV0.z;\r\n indices[4] = i;\r\n }\r\n if (tmpV0.z > maxz) {\r\n maxz = tmpV0.z;\r\n indices[5] = i;\r\n }\r\n }\r\n const info: SkinnedBoundingBox = {\r\n boundingVertexBlendIndices: new Float32Array(\r\n Array.from({ length: 6 * 4 }).map(\r\n (val, index) => meshData.rawBlendIndices[indices[index >> 2] * 4 + (index % 4)]\r\n )\r\n ),\r\n boundingVertexJointWeights: new Float32Array(\r\n Array.from({ length: 6 * 4 }).map(\r\n (val, index) => meshData.rawJointWeights[indices[index >> 2] * 4 + (index % 4)]\r\n )\r\n ),\r\n boundingVertices: Array.from({ length: 6 }).map(\r\n (val, index) =>\r\n new Vector3(\r\n meshData.rawPositions[indices[index] * 3],\r\n meshData.rawPositions[indices[index] * 3 + 1],\r\n meshData.rawPositions[indices[index] * 3 + 2]\r\n )\r\n ),\r\n boundingBox: new BoundingBox()\r\n };\r\n return info;\r\n }\r\n}\r\n"],"names":["tmpV0","Vector3","tmpV1","tmpV2","tmpV3","Skeleton","joints","inverseBindMatrices","bindPoseMatrices","meshes","bounding","_joints","_inverseBindMatrices","_bindPoseMatrices","_jointMatrixArray","_jointMatrices","_jointOffsets","_jointTexture","updateJointMatrices","_meshes","map","mesh","index","getBoundingInfo","box","BoundingBox","dispose","jointTexture","jointTransforms","worldMatrix","_createJointTexture","length","i","mat","jointTransform","Matrix4x4","multiplyAffine","multiply","computeBindPose","model","update","width","height","computeJoints","apply","computeBoundingBox","invWorldMatrix","setBoneMatrices","setAnimatedBoundingBox","boundingBox","reset","info","beginExtend","boundingVertices","boundingVertexBlendIndices","transformPointAffine","scaleBy","boundingVertexJointWeights","addBy","extend","textureWidth","nextPowerOf2","Math","max","ceil","sqrt","device","Application","instance","createTexture2D","samplerOptions","magFilter","minFilter","mipFilter","Float32Array","buffer","Array","from","val","BYTES_PER_ELEMENT","meshData","indices","minx","Number","MAX_VALUE","maxx","miny","maxy","minz","maxz","v","rawPositions","vert","numVertices","floor","setXYZ","rawBlendIndices","rawJointWeights","x","y","z"],"mappings":";;;;AAeA,MAAMA,QAAQ,IAAIC,OAAAA,EAAAA;AAClB,MAAMC,QAAQ,IAAID,OAAAA,EAAAA;AAClB,MAAME,QAAQ,IAAIF,OAAAA,EAAAA;AAClB,MAAMG,QAAQ,IAAIH,OAAAA,EAAAA;AAElB;;;AAGC,IACM,MAAMI,QAAAA,CAAAA;qBAEX,OAAoF;qBAEpF,OAA+B;qBAE/B,oBAA4C;qBAE5C,iBAAyC;qBAEzC,cAAsC;qBAEtC,aAAmD;qBAEnD,iBAAuD;qBAEvD,aAAmC;AACnC;;;;;MAMA,WAAA,CACEC,MAAmB,EACnBC,mBAAgC,EAChCC,gBAA6B,EAC7BC,MAAc,EACdC,QAA4B,CAC5B;QACA,IAAI,CAACC,OAAO,GAAGL,MAAAA;QACf,IAAI,CAACM,oBAAoB,GAAGL,mBAAAA;QAC5B,IAAI,CAACM,iBAAiB,GAAG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,CAC9BE,KAAMC,CAAAA,IAAI,CAAC;AAAE9C,gBAAAA,MAAAA,EAAQ,CAAI,GAAA;AAAE,aAAA,CAAA,CAAGX,GAAG,CAC/B,CAAC0D,GAAAA,EAAKxD,QAAU0D,QAASgB,CAAAA,eAAe,CAACf,OAAO,CAAC3D,KAAS,IAAA,CAAA,CAAE,GAAG,CAAA,GAAKA,QAAQ,CAAG,CAAA,CAAA,CAAA;AAGnFmC,YAAAA,0BAAAA,EAA4B,IAAIiB,YAAAA,CAC9BE,KAAMC,CAAAA,IAAI,CAAC;AAAE9C,gBAAAA,MAAAA,EAAQ,CAAI,GAAA;AAAE,aAAA,CAAA,CAAGX,GAAG,CAC/B,CAAC0D,GAAAA,EAAKxD,QAAU0D,QAASiB,CAAAA,eAAe,CAAChB,OAAO,CAAC3D,KAAS,IAAA,CAAA,CAAE,GAAG,CAAA,GAAKA,QAAQ,CAAG,CAAA,CAAA,CAAA;YAGnF+B,gBAAkBuB,EAAAA,KAAAA,CAAMC,IAAI,CAAC;gBAAE9C,MAAQ,EAAA;AAAE,aAAA,CAAA,CAAGX,GAAG,CAC7C,CAAC0D,GAAAA,EAAKxD,QACJ,IAAIrB,OAAAA,CACF+E,QAASW,CAAAA,YAAY,CAACV,OAAO,CAAC3D,KAAM,CAAA,GAAG,EAAE,EACzC0D,QAAAA,CAASW,YAAY,CAACV,OAAO,CAAC3D,KAAM,CAAA,GAAG,IAAI,CAAE,CAAA,EAC7C0D,QAASW,CAAAA,YAAY,CAACV,OAAO,CAAC3D,KAAM,CAAA,GAAG,IAAI,CAAE,CAAA,CAAA,CAAA;AAGnD2B,YAAAA,WAAAA,EAAa,IAAIxB,WAAAA;AACnB,SAAA;QACA,OAAO0B,IAAAA;AACT;AACF;;;;"}
@@ -0,0 +1,50 @@
1
+ import { Interpolator, Vector3 } from '@zephyr3d/base';
2
+ import { AnimationTrack } from './animationtrack.js';
3
+
4
+ /**
5
+ * Translate animation track
6
+ * @public
7
+ */ class NodeTranslationTrack extends AnimationTrack {
8
+ _state;
9
+ _interpolator;
10
+ constructor(modeOrInterpolator, keyFramesOrEmbedded, embedded){
11
+ if (modeOrInterpolator instanceof Interpolator) {
12
+ if (modeOrInterpolator.target !== 'vec3') {
13
+ throw new Error(`TranslationTrack(): interpolator target must be 'vec3'`);
14
+ }
15
+ super(keyFramesOrEmbedded ?? false);
16
+ this._interpolator = modeOrInterpolator;
17
+ } else {
18
+ const keyFrames = keyFramesOrEmbedded;
19
+ const inputs = new Float32Array(keyFrames.map((val)=>val.time));
20
+ const outputs = new Float32Array(keyFrames.length * 3);
21
+ for(let i = 0; i < keyFrames.length; i++){
22
+ outputs[i * 3 + 0] = keyFrames[i].value.x;
23
+ outputs[i * 3 + 1] = keyFrames[i].value.y;
24
+ outputs[i * 3 + 2] = keyFrames[i].value.z;
25
+ }
26
+ super(embedded ?? false);
27
+ this._interpolator = new Interpolator(modeOrInterpolator, 'vec3', inputs, outputs);
28
+ }
29
+ this._state = new Vector3();
30
+ }
31
+ calculateState(target, currentTime) {
32
+ this._interpolator.interpolate(currentTime, this._state);
33
+ return this._state;
34
+ }
35
+ applyState(node, state) {
36
+ node.position.set(state);
37
+ }
38
+ mixState(a, b, t) {
39
+ return new Vector3(a.x + t * (b.x - a.x), a.y + t * (b.y - a.y), a.z + t * (b.z - a.z));
40
+ }
41
+ getBlendId() {
42
+ return 'node-translation';
43
+ }
44
+ getDuration() {
45
+ return this._interpolator.maxTime;
46
+ }
47
+ }
48
+
49
+ export { NodeTranslationTrack };
50
+ //# sourceMappingURL=translationtrack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translationtrack.js","sources":["../../../src/animation/translationtrack.ts"],"sourcesContent":["import type { InterpolationMode } from '@zephyr3d/base';\r\nimport { Interpolator, Vector3 } from '@zephyr3d/base';\r\nimport { AnimationTrack } from './animationtrack';\r\nimport type { SceneNode } from '../scene';\r\n\r\n/**\r\n * Translate animation track\r\n * @public\r\n */\r\nexport class NodeTranslationTrack extends AnimationTrack<Vector3> {\r\n private readonly _state: Vector3;\r\n private readonly _interpolator: Interpolator;\r\n /**\r\n * Create an instance of TranslationTrack from keyframe values\r\n * @param interpolator - Interpolator object that contains the keyframe values\r\n * @param embedded - Whether this track be an embedded track\r\n */\r\n constructor(interpolator: Interpolator, embedded?: boolean);\r\n /**\r\n * Create an instance of TranslationTrack from keyframe values\r\n * @param mode - The interpolation mode of keyframes\r\n * @param keyFrames - Keyframe values\r\n * @param embedded - Whether this track be an embedded track\r\n */\r\n constructor(mode: InterpolationMode, keyFrames: { time: number; value: Vector3 }[], embedded?: boolean);\r\n constructor(\r\n modeOrInterpolator?: Interpolator | InterpolationMode,\r\n keyFramesOrEmbedded?: { time: number; value: Vector3 }[] | boolean,\r\n embedded?: boolean\r\n ) {\r\n if (modeOrInterpolator instanceof Interpolator) {\r\n if (modeOrInterpolator.target !== 'vec3') {\r\n throw new Error(`TranslationTrack(): interpolator target must be 'vec3'`);\r\n }\r\n super((keyFramesOrEmbedded as boolean) ?? false);\r\n this._interpolator = modeOrInterpolator;\r\n } else {\r\n const keyFrames = keyFramesOrEmbedded as { time: number; value: Vector3 }[];\r\n const inputs = new Float32Array(keyFrames.map((val) => val.time));\r\n const outputs = new Float32Array(keyFrames.length * 3);\r\n for (let i = 0; i < keyFrames.length; i++) {\r\n outputs[i * 3 + 0] = keyFrames[i].value.x;\r\n outputs[i * 3 + 1] = keyFrames[i].value.y;\r\n outputs[i * 3 + 2] = keyFrames[i].value.z;\r\n }\r\n super(embedded ?? false);\r\n this._interpolator = new Interpolator(modeOrInterpolator, 'vec3', inputs, outputs);\r\n }\r\n this._state = new Vector3();\r\n }\r\n calculateState(target: object, currentTime: number): Vector3 {\r\n this._interpolator.interpolate(currentTime, this._state);\r\n return this._state;\r\n }\r\n applyState(node: SceneNode, state: Vector3) {\r\n node.position.set(state);\r\n }\r\n mixState(a: Vector3, b: Vector3, t: number): Vector3 {\r\n return new Vector3(a.x + t * (b.x - a.x), a.y + t * (b.y - a.y), a.z + t * (b.z - a.z));\r\n }\r\n getBlendId(): unknown {\r\n return 'node-translation';\r\n }\r\n getDuration(): number {\r\n return this._interpolator.maxTime;\r\n }\r\n}\r\n"],"names":["NodeTranslationTrack","AnimationTrack","_state","_interpolator","modeOrInterpolator","keyFramesOrEmbedded","embedded","Interpolator","target","Error","keyFrames","inputs","Float32Array","map","val","time","outputs","length","i","value","x","y","z","Vector3","calculateState","currentTime","interpolate","applyState","node","state","position","set","mixState","a","b","t","getBlendId","getDuration","maxTime"],"mappings":";;;AAKA;;;IAIO,MAAMA,oBAA6BC,SAAAA,cAAAA,CAAAA;IACvBC,MAAgB;IAChBC,aAA4B;AAc7C,IAAA,WAAA,CACEC,kBAAqD,EACrDC,mBAAkE,EAClEC,QAAkB,CAClB;AACA,QAAA,IAAIF,8BAA8BG,YAAc,EAAA;YAC9C,IAAIH,kBAAAA,CAAmBI,MAAM,KAAK,MAAQ,EAAA;AACxC,gBAAA,MAAM,IAAIC,KAAAA,CAAM,CAAC,sDAAsD,CAAC,CAAA;AAC1E;YACA,KAAK,CAAC,mBAAoC,IAAA,KAAA,CAAA;YAC1C,IAAI,CAACN,aAAa,GAAGC,kBAAAA;SAChB,MAAA;AACL,YAAA,MAAMM,SAAYL,GAAAA,mBAAAA;YAClB,MAAMM,MAAAA,GAAS,IAAIC,YAAaF,CAAAA,SAAAA,CAAUG,GAAG,CAAC,CAACC,GAAQA,GAAAA,GAAAA,CAAIC,IAAI,CAAA,CAAA;AAC/D,YAAA,MAAMC,OAAU,GAAA,IAAIJ,YAAaF,CAAAA,SAAAA,CAAUO,MAAM,GAAG,CAAA,CAAA;AACpD,YAAA,IAAK,IAAIC,CAAI,GAAA,CAAA,EAAGA,IAAIR,SAAUO,CAAAA,MAAM,EAAEC,CAAK,EAAA,CAAA;gBACzCF,OAAO,CAACE,CAAI,GAAA,CAAA,GAAI,CAAE,CAAA,GAAGR,SAAS,CAACQ,CAAE,CAAA,CAACC,KAAK,CAACC,CAAC;gBACzCJ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,aAAa,CAACmC,OAAO;AACnC;AACF;;;;"}
@@ -0,0 +1,129 @@
1
+ import { Observable, flushPendingDisposals } from '@zephyr3d/base';
2
+ import { InputManager } from './inputmgr.js';
3
+ import { RuntimeManager } from '../../node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js';
4
+
5
+ /**
6
+ * Application class
7
+ *
8
+ * @remarks
9
+ * This is the entry point of your application.
10
+ * The Application is responsible for initializing the rendering device
11
+ * and doing the rendering loop.
12
+ * The Application can not be created more than once. You can get the
13
+ * instance by calling the 'Application.instance' static method.
14
+ *
15
+ * @public
16
+ */ class Application extends Observable {
17
+ _options;
18
+ _device;
19
+ _inputManager;
20
+ _runtimeManager;
21
+ _ready;
22
+ _logger;
23
+ static _instance;
24
+ /**
25
+ * Creates an instance of Application
26
+ * @param opt - The creation options
27
+ */ constructor(opt){
28
+ super();
29
+ if (Application._instance) {
30
+ throw new Error('It is not allowed to have multiple Application instances');
31
+ }
32
+ Application._instance = this;
33
+ this._options = {
34
+ backend: opt.backend,
35
+ enableMSAA: opt.enableMSAA ?? false,
36
+ pixelRatio: opt.pixelRatio ?? window.devicePixelRatio ?? 1,
37
+ canvas: opt.canvas
38
+ };
39
+ this._inputManager = new InputManager(this);
40
+ this._runtimeManager = new RuntimeManager(opt.runtimeOptions.VFS, opt.runtimeOptions.scriptsRoot, opt.runtimeOptions.editorMode, opt.runtimeOptions.enabled);
41
+ this._ready = false;
42
+ this._logger = {
43
+ log (text, mode) {
44
+ if (mode === 'warn') {
45
+ console.warn(text);
46
+ } else if (mode === 'error') {
47
+ console.error(text);
48
+ } else if (mode === 'debug') {
49
+ console.debug(text);
50
+ } else if (mode === 'info') {
51
+ console.info(text);
52
+ } else {
53
+ console.log(text);
54
+ }
55
+ }
56
+ };
57
+ }
58
+ /** The input manager instance */ get inputManager() {
59
+ return this._inputManager;
60
+ }
61
+ /** The runtime manager instance */ get runtimeManager() {
62
+ return this._runtimeManager;
63
+ }
64
+ /** The options that was used to create the application */ get options() {
65
+ return this._options;
66
+ }
67
+ /** Gets the singleton instance of the application */ static get instance() {
68
+ return this._instance;
69
+ }
70
+ /** The rendering device that was initialized by the application */ get device() {
71
+ return this._device;
72
+ }
73
+ /** Gets the device type */ get deviceType() {
74
+ return this._options.backend.typeName();
75
+ }
76
+ /** The logger object */ get logger() {
77
+ return this._logger;
78
+ }
79
+ set logger(val) {
80
+ this._logger = val;
81
+ }
82
+ /** Set focus */ focus() {
83
+ this._device.canvas.focus();
84
+ }
85
+ /** Wait until the application is ready. */ async ready() {
86
+ if (!this._ready) {
87
+ this._device = await this._options.backend.createDevice(this._options.canvas, {
88
+ dpr: this._options.pixelRatio,
89
+ msaa: !!this._options.enableMSAA
90
+ });
91
+ if (!this._device) {
92
+ throw new Error('App.init(): create device failed');
93
+ }
94
+ this._device.canvas.focus();
95
+ this._inputManager.start();
96
+ this._device.on('resize', (width, height)=>{
97
+ this.dispatchEvent('resize', width, height);
98
+ });
99
+ this._ready = true;
100
+ }
101
+ }
102
+ /** Render one frame */ frame() {
103
+ // Processes all pending disposals from the previous frame.
104
+ flushPendingDisposals();
105
+ if (this._ready) {
106
+ this.device.setFramebuffer(null);
107
+ this.device.setViewport(null);
108
+ this.device.setScissor(null);
109
+ const dt = this.device.frameInfo.elapsedFrame;
110
+ const elapsed = this.device.frameInfo.elapsedOverall;
111
+ this._runtimeManager.update(dt, elapsed);
112
+ this.dispatchEvent('tick', dt, elapsed);
113
+ }
114
+ }
115
+ /** Start running the rendering loop */ run() {
116
+ this.device.runLoop(()=>{
117
+ this.frame();
118
+ });
119
+ }
120
+ /** Stop running the rendering loop */ stop() {
121
+ this.device.exitLoop();
122
+ }
123
+ /** Message log */ log(text, mode) {
124
+ this._logger?.log(text, mode);
125
+ }
126
+ }
127
+
128
+ export { Application };
129
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sources":["../../../src/app/app.ts"],"sourcesContent":["import { Observable, VFS, flushPendingDisposals } from '@zephyr3d/base';\r\nimport type { AbstractDevice, DeviceBackend } from '@zephyr3d/device';\r\nimport { InputManager } from './inputmgr';\r\nimport { RuntimeManager } from '@zephyr3d/runtime';\r\n\r\ntype appEventMap = {\r\n resize: [width: number, height: number];\r\n tick: [deltaTimeMs: number, elapsedTimeMs: number];\r\n click: [evt: PointerEvent];\r\n dblclick: [evt: PointerEvent];\r\n pointerdown: [evt: PointerEvent];\r\n pointerup: [evt: PointerEvent];\r\n pointermove: [evt: PointerEvent];\r\n pointercancel: [evt: PointerEvent];\r\n pointerenter: [evt: PointerEvent];\r\n pointerleave: [evt: PointerEvent];\r\n pointerover: [evt: PointerEvent];\r\n pointerout: [evt: PointerEvent];\r\n wheel: [evt: WheelEvent];\r\n keydown: [evt: KeyboardEvent];\r\n keyup: [evt: KeyboardEvent];\r\n keypress: [evt: KeyboardEvent];\r\n drag: [evt: DragEvent];\r\n dragenter: [evt: DragEvent];\r\n dragleave: [evt: DragEvent];\r\n dragover: [evt: DragEvent];\r\n dragstart: [evt: DragEvent];\r\n dragend: [evt: DragEvent];\r\n drop: [evt: DragEvent];\r\n};\r\n\r\n/**\r\n * The creation options for Application\r\n * @public\r\n */\r\nexport type AppOptions = {\r\n /** The canvas element */\r\n canvas: HTMLCanvasElement;\r\n /** The backend that will be used to create the rendering device */\r\n backend: DeviceBackend;\r\n /** Whether to enable MSAA */\r\n enableMSAA?: boolean;\r\n /** The device pixel ratio */\r\n pixelRatio?: number;\r\n /** Options for runtime scripting system */\r\n runtimeOptions?: {\r\n /** VFS for reading script files, default is HttpFS at '.' */\r\n VFS?: VFS;\r\n /** Root directory for script files, default is '/' */\r\n scriptsRoot?: string;\r\n /** Whether application is running in editor mode, should always be true for user application */\r\n editorMode?: boolean;\r\n /** Wether enable runtime scripting system, should always be true for user application */\r\n enabled?: boolean;\r\n };\r\n};\r\n\r\n/**\r\n * Log mode\r\n * @public\r\n */\r\nexport type LogMode = 'info' | 'warn' | 'error' | 'debug';\r\n\r\n/**\r\n * Logger interface\r\n * @public\r\n */\r\nexport interface Logger {\r\n log(text: string, mode?: LogMode): void;\r\n}\r\n\r\n/**\r\n * Application class\r\n *\r\n * @remarks\r\n * This is the entry point of your application.\r\n * The Application is responsible for initializing the rendering device\r\n * and doing the rendering loop.\r\n * The Application can not be created more than once. You can get the\r\n * instance by calling the 'Application.instance' static method.\r\n *\r\n * @public\r\n */\r\nexport class Application extends Observable<appEventMap> {\r\n private readonly _options: AppOptions;\r\n private _device: AbstractDevice;\r\n private readonly _inputManager: InputManager;\r\n private readonly _runtimeManager: RuntimeManager;\r\n private _ready: boolean;\r\n private _logger: Logger;\r\n private static _instance: Application;\r\n /**\r\n * Creates an instance of Application\r\n * @param opt - The creation options\r\n */\r\n constructor(opt: Partial<AppOptions>) {\r\n super();\r\n if (Application._instance) {\r\n throw new Error('It is not allowed to have multiple Application instances');\r\n }\r\n Application._instance = this;\r\n this._options = {\r\n backend: opt.backend,\r\n enableMSAA: opt.enableMSAA ?? false,\r\n pixelRatio: opt.pixelRatio ?? window.devicePixelRatio ?? 1,\r\n canvas: opt.canvas\r\n };\r\n this._inputManager = new InputManager(this);\r\n this._runtimeManager = new RuntimeManager(\r\n opt.runtimeOptions.VFS,\r\n opt.runtimeOptions.scriptsRoot,\r\n opt.runtimeOptions.editorMode,\r\n opt.runtimeOptions.enabled\r\n );\r\n this._ready = false;\r\n this._logger = {\r\n log(text: string, mode?: LogMode) {\r\n if (mode === 'warn') {\r\n console.warn(text);\r\n } else if (mode === 'error') {\r\n console.error(text);\r\n } else if (mode === 'debug') {\r\n console.debug(text);\r\n } else if (mode === 'info') {\r\n console.info(text);\r\n } else {\r\n console.log(text);\r\n }\r\n }\r\n };\r\n }\r\n /** The input manager instance */\r\n get inputManager(): InputManager {\r\n return this._inputManager;\r\n }\r\n /** The runtime manager instance */\r\n get runtimeManager(): RuntimeManager {\r\n return this._runtimeManager;\r\n }\r\n /** The options that was used to create the application */\r\n get options(): AppOptions {\r\n return this._options;\r\n }\r\n /** Gets the singleton instance of the application */\r\n static get instance(): Application {\r\n return this._instance;\r\n }\r\n /** The rendering device that was initialized by the application */\r\n get device(): AbstractDevice {\r\n return this._device;\r\n }\r\n /** Gets the device type */\r\n get deviceType(): string {\r\n return this._options.backend.typeName();\r\n }\r\n /** The logger object */\r\n get logger(): Logger {\r\n return this._logger;\r\n }\r\n set logger(val: Logger) {\r\n this._logger = val;\r\n }\r\n /** Set focus */\r\n focus() {\r\n this._device.canvas.focus();\r\n }\r\n /** Wait until the application is ready. */\r\n async ready() {\r\n if (!this._ready) {\r\n this._device = await this._options.backend.createDevice(this._options.canvas, {\r\n dpr: this._options.pixelRatio,\r\n msaa: !!this._options.enableMSAA\r\n });\r\n if (!this._device) {\r\n throw new Error('App.init(): create device failed');\r\n }\r\n this._device.canvas.focus();\r\n this._inputManager.start();\r\n this._device.on('resize', (width, height) => {\r\n this.dispatchEvent('resize', width, height);\r\n });\r\n this._ready = true;\r\n }\r\n }\r\n /** Render one frame */\r\n frame() {\r\n // Processes all pending disposals from the previous frame.\r\n flushPendingDisposals();\r\n if (this._ready) {\r\n this.device.setFramebuffer(null);\r\n this.device.setViewport(null);\r\n this.device.setScissor(null);\r\n const dt = this.device.frameInfo.elapsedFrame;\r\n const elapsed = this.device.frameInfo.elapsedOverall;\r\n this._runtimeManager.update(dt, elapsed);\r\n this.dispatchEvent('tick', dt, elapsed);\r\n }\r\n }\r\n /** Start running the rendering loop */\r\n run() {\r\n this.device.runLoop(() => {\r\n this.frame();\r\n });\r\n }\r\n /** Stop running the rendering loop */\r\n stop() {\r\n this.device.exitLoop();\r\n }\r\n /** Message log */\r\n log(text: string, mode?: LogMode) {\r\n this._logger?.log(text, mode);\r\n }\r\n}\r\n"],"names":["Application","Observable","_options","_device","_inputManager","_runtimeManager","_ready","_logger","_instance","opt","Error","backend","enableMSAA","pixelRatio","window","devicePixelRatio","canvas","InputManager","RuntimeManager","runtimeOptions","VFS","scriptsRoot","editorMode","enabled","log","text","mode","console","warn","error","debug","info","inputManager","runtimeManager","options","instance","device","deviceType","typeName","logger","val","focus","ready","createDevice","dpr","msaa","start","on","width","height","dispatchEvent","frame","flushPendingDisposals","setFramebuffer","setViewport","setScissor","dt","frameInfo","elapsedFrame","elapsed","elapsedOverall","update","run","runLoop","stop","exitLoop"],"mappings":";;;;AAuEA;;;;;;;;;;;IAYO,MAAMA,WAAoBC,SAAAA,UAAAA,CAAAA;IACdC,QAAqB;IAC9BC,OAAwB;IACfC,aAA4B;IAC5BC,eAAgC;IACzCC,MAAgB;IAChBC,OAAgB;AACxB,IAAA,OAAeC,SAAuB;AACtC;;;MAIA,WAAA,CAAYC,GAAwB,CAAE;QACpC,KAAK,EAAA;QACL,IAAIT,WAAAA,CAAYQ,SAAS,EAAE;AACzB,YAAA,MAAM,IAAIE,KAAM,CAAA,0DAAA,CAAA;AAClB;QACAV,WAAYQ,CAAAA,SAAS,GAAG,IAAI;QAC5B,IAAI,CAACN,QAAQ,GAAG;AACdS,YAAAA,OAAAA,EAASF,IAAIE,OAAO;YACpBC,UAAYH,EAAAA,GAAAA,CAAIG,UAAU,IAAI,KAAA;AAC9BC,YAAAA,UAAAA,EAAYJ,GAAII,CAAAA,UAAU,IAAIC,MAAAA,CAAOC,gBAAgB,IAAI,CAAA;AACzDC,YAAAA,MAAAA,EAAQP,IAAIO;AACd,SAAA;AACA,QAAA,IAAI,CAACZ,aAAa,GAAG,IAAIa,aAAa,IAAI,CAAA;QAC1C,IAAI,CAACZ,eAAe,GAAG,IAAIa,eACzBT,GAAIU,CAAAA,cAAc,CAACC,GAAG,EACtBX,GAAAA,CAAIU,cAAc,CAACE,WAAW,EAC9BZ,GAAAA,CAAIU,cAAc,CAACG,UAAU,EAC7Bb,GAAAA,CAAIU,cAAc,CAACI,OAAO,CAAA;QAE5B,IAAI,CAACjB,MAAM,GAAG,KAAA;QACd,IAAI,CAACC,OAAO,GAAG;YACbiB,GAAIC,CAAAA,CAAAA,IAAY,EAAEC,IAAc,EAAA;AAC9B,gBAAA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