@dcl/hammurabi-server 1.0.0-17268386187.commit-b609629

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 (520) hide show
  1. package/CLAUDE.md +90 -0
  2. package/LICENSE +201 -0
  3. package/README.md +125 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +79 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/lib/babylon/avatar-rendering-system.d.ts +16 -0
  9. package/dist/lib/babylon/avatar-rendering-system.d.ts.map +1 -0
  10. package/dist/lib/babylon/avatar-rendering-system.js +96 -0
  11. package/dist/lib/babylon/avatar-rendering-system.js.map +1 -0
  12. package/dist/lib/babylon/avatars/AvatarRenderer.d.ts +40 -0
  13. package/dist/lib/babylon/avatars/AvatarRenderer.d.ts.map +1 -0
  14. package/dist/lib/babylon/avatars/AvatarRenderer.js +260 -0
  15. package/dist/lib/babylon/avatars/AvatarRenderer.js.map +1 -0
  16. package/dist/lib/babylon/avatars/CharacterController.d.ts +88 -0
  17. package/dist/lib/babylon/avatars/CharacterController.d.ts.map +1 -0
  18. package/dist/lib/babylon/avatars/CharacterController.js +463 -0
  19. package/dist/lib/babylon/avatars/CharacterController.js.map +1 -0
  20. package/dist/lib/babylon/avatars/adr-65/body.d.ts +4 -0
  21. package/dist/lib/babylon/avatars/adr-65/body.d.ts.map +1 -0
  22. package/dist/lib/babylon/avatars/adr-65/body.js +47 -0
  23. package/dist/lib/babylon/avatars/adr-65/body.js.map +1 -0
  24. package/dist/lib/babylon/avatars/adr-65/customizations.d.ts +11 -0
  25. package/dist/lib/babylon/avatars/adr-65/customizations.d.ts.map +1 -0
  26. package/dist/lib/babylon/avatars/adr-65/customizations.js +111 -0
  27. package/dist/lib/babylon/avatars/adr-65/customizations.js.map +1 -0
  28. package/dist/lib/babylon/avatars/adr-65/emote.d.ts +9 -0
  29. package/dist/lib/babylon/avatars/adr-65/emote.d.ts.map +1 -0
  30. package/dist/lib/babylon/avatars/adr-65/emote.js +46 -0
  31. package/dist/lib/babylon/avatars/adr-65/emote.js.map +1 -0
  32. package/dist/lib/babylon/avatars/adr-65/loader.d.ts +8 -0
  33. package/dist/lib/babylon/avatars/adr-65/loader.d.ts.map +1 -0
  34. package/dist/lib/babylon/avatars/adr-65/loader.js +54 -0
  35. package/dist/lib/babylon/avatars/adr-65/loader.js.map +1 -0
  36. package/dist/lib/babylon/avatars/adr-65/representation.d.ts +12 -0
  37. package/dist/lib/babylon/avatars/adr-65/representation.d.ts.map +1 -0
  38. package/dist/lib/babylon/avatars/adr-65/representation.js +77 -0
  39. package/dist/lib/babylon/avatars/adr-65/representation.js.map +1 -0
  40. package/dist/lib/babylon/avatars/adr-65/slots.d.ts +5 -0
  41. package/dist/lib/babylon/avatars/adr-65/slots.d.ts.map +1 -0
  42. package/dist/lib/babylon/avatars/adr-65/slots.js +62 -0
  43. package/dist/lib/babylon/avatars/adr-65/slots.js.map +1 -0
  44. package/dist/lib/babylon/avatars/adr-65/types.d.ts +17 -0
  45. package/dist/lib/babylon/avatars/adr-65/types.d.ts.map +1 -0
  46. package/dist/lib/babylon/avatars/adr-65/types.js +3 -0
  47. package/dist/lib/babylon/avatars/adr-65/types.js.map +1 -0
  48. package/dist/lib/babylon/avatars/adr-65/utils.d.ts +8 -0
  49. package/dist/lib/babylon/avatars/adr-65/utils.d.ts.map +1 -0
  50. package/dist/lib/babylon/avatars/adr-65/utils.js +29 -0
  51. package/dist/lib/babylon/avatars/adr-65/utils.js.map +1 -0
  52. package/dist/lib/babylon/avatars/adr-65/wearable.d.ts +7 -0
  53. package/dist/lib/babylon/avatars/adr-65/wearable.d.ts.map +1 -0
  54. package/dist/lib/babylon/avatars/adr-65/wearable.js +64 -0
  55. package/dist/lib/babylon/avatars/adr-65/wearable.js.map +1 -0
  56. package/dist/lib/babylon/avatars/avatar-asset-manager.d.ts +12 -0
  57. package/dist/lib/babylon/avatars/avatar-asset-manager.d.ts.map +1 -0
  58. package/dist/lib/babylon/avatars/avatar-asset-manager.js +31 -0
  59. package/dist/lib/babylon/avatars/avatar-asset-manager.js.map +1 -0
  60. package/dist/lib/babylon/avatars/loader.d.ts +6 -0
  61. package/dist/lib/babylon/avatars/loader.d.ts.map +1 -0
  62. package/dist/lib/babylon/avatars/loader.js +108 -0
  63. package/dist/lib/babylon/avatars/loader.js.map +1 -0
  64. package/dist/lib/babylon/avatars/urn.d.ts +2 -0
  65. package/dist/lib/babylon/avatars/urn.d.ts.map +1 -0
  66. package/dist/lib/babylon/avatars/urn.js +9 -0
  67. package/dist/lib/babylon/avatars/urn.js.map +1 -0
  68. package/dist/lib/babylon/index.d.ts +6 -0
  69. package/dist/lib/babylon/index.d.ts.map +1 -0
  70. package/dist/lib/babylon/index.js +85 -0
  71. package/dist/lib/babylon/index.js.map +1 -0
  72. package/dist/lib/babylon/input.d.ts +35 -0
  73. package/dist/lib/babylon/input.d.ts.map +1 -0
  74. package/dist/lib/babylon/input.js +137 -0
  75. package/dist/lib/babylon/input.js.map +1 -0
  76. package/dist/lib/babylon/scene/AssetManager.d.ts +19 -0
  77. package/dist/lib/babylon/scene/AssetManager.d.ts.map +1 -0
  78. package/dist/lib/babylon/scene/AssetManager.js +271 -0
  79. package/dist/lib/babylon/scene/AssetManager.js.map +1 -0
  80. package/dist/lib/babylon/scene/BabylonEntity.d.ts +84 -0
  81. package/dist/lib/babylon/scene/BabylonEntity.d.ts.map +1 -0
  82. package/dist/lib/babylon/scene/BabylonEntity.js +174 -0
  83. package/dist/lib/babylon/scene/BabylonEntity.js.map +1 -0
  84. package/dist/lib/babylon/scene/connect-context-rpc.d.ts +8 -0
  85. package/dist/lib/babylon/scene/connect-context-rpc.d.ts.map +1 -0
  86. package/dist/lib/babylon/scene/connect-context-rpc.js +210 -0
  87. package/dist/lib/babylon/scene/connect-context-rpc.js.map +1 -0
  88. package/dist/lib/babylon/scene/coordinates.d.ts +5 -0
  89. package/dist/lib/babylon/scene/coordinates.d.ts.map +1 -0
  90. package/dist/lib/babylon/scene/coordinates.js +17 -0
  91. package/dist/lib/babylon/scene/coordinates.js.map +1 -0
  92. package/dist/lib/babylon/scene/hot-reload.d.ts +9 -0
  93. package/dist/lib/babylon/scene/hot-reload.d.ts.map +1 -0
  94. package/dist/lib/babylon/scene/hot-reload.js +65 -0
  95. package/dist/lib/babylon/scene/hot-reload.js.map +1 -0
  96. package/dist/lib/babylon/scene/load.d.ts +54 -0
  97. package/dist/lib/babylon/scene/load.d.ts.map +1 -0
  98. package/dist/lib/babylon/scene/load.js +154 -0
  99. package/dist/lib/babylon/scene/load.js.map +1 -0
  100. package/dist/lib/babylon/scene/logic/apply-animations.d.ts +3 -0
  101. package/dist/lib/babylon/scene/logic/apply-animations.d.ts.map +1 -0
  102. package/dist/lib/babylon/scene/logic/apply-animations.js +50 -0
  103. package/dist/lib/babylon/scene/logic/apply-animations.js.map +1 -0
  104. package/dist/lib/babylon/scene/logic/billboards.d.ts +3 -0
  105. package/dist/lib/babylon/scene/logic/billboards.d.ts.map +1 -0
  106. package/dist/lib/babylon/scene/logic/billboards.js +12 -0
  107. package/dist/lib/babylon/scene/logic/billboards.js.map +1 -0
  108. package/dist/lib/babylon/scene/logic/camera-follows-player.d.ts +7 -0
  109. package/dist/lib/babylon/scene/logic/camera-follows-player.d.ts.map +1 -0
  110. package/dist/lib/babylon/scene/logic/camera-follows-player.js +35 -0
  111. package/dist/lib/babylon/scene/logic/camera-follows-player.js.map +1 -0
  112. package/dist/lib/babylon/scene/logic/colliders.d.ts +9 -0
  113. package/dist/lib/babylon/scene/logic/colliders.d.ts.map +1 -0
  114. package/dist/lib/babylon/scene/logic/colliders.js +79 -0
  115. package/dist/lib/babylon/scene/logic/colliders.js.map +1 -0
  116. package/dist/lib/babylon/scene/logic/cyclic-transform.d.ts +12 -0
  117. package/dist/lib/babylon/scene/logic/cyclic-transform.d.ts.map +1 -0
  118. package/dist/lib/babylon/scene/logic/cyclic-transform.js +67 -0
  119. package/dist/lib/babylon/scene/logic/cyclic-transform.js.map +1 -0
  120. package/dist/lib/babylon/scene/logic/delayed-interpolation.d.ts +27 -0
  121. package/dist/lib/babylon/scene/logic/delayed-interpolation.d.ts.map +1 -0
  122. package/dist/lib/babylon/scene/logic/delayed-interpolation.js +49 -0
  123. package/dist/lib/babylon/scene/logic/delayed-interpolation.js.map +1 -0
  124. package/dist/lib/babylon/scene/logic/easings.d.ts +7 -0
  125. package/dist/lib/babylon/scene/logic/easings.d.ts.map +1 -0
  126. package/dist/lib/babylon/scene/logic/easings.js +100 -0
  127. package/dist/lib/babylon/scene/logic/easings.js.map +1 -0
  128. package/dist/lib/babylon/scene/logic/hide-camera-obstuction-system.d.ts +5 -0
  129. package/dist/lib/babylon/scene/logic/hide-camera-obstuction-system.d.ts.map +1 -0
  130. package/dist/lib/babylon/scene/logic/hide-camera-obstuction-system.js +145 -0
  131. package/dist/lib/babylon/scene/logic/hide-camera-obstuction-system.js.map +1 -0
  132. package/dist/lib/babylon/scene/logic/local-avatar-scene.d.ts +10 -0
  133. package/dist/lib/babylon/scene/logic/local-avatar-scene.d.ts.map +1 -0
  134. package/dist/lib/babylon/scene/logic/local-avatar-scene.js +50 -0
  135. package/dist/lib/babylon/scene/logic/local-avatar-scene.js.map +1 -0
  136. package/dist/lib/babylon/scene/logic/pointer-events.d.ts +12 -0
  137. package/dist/lib/babylon/scene/logic/pointer-events.d.ts.map +1 -0
  138. package/dist/lib/babylon/scene/logic/pointer-events.js +199 -0
  139. package/dist/lib/babylon/scene/logic/pointer-events.js.map +1 -0
  140. package/dist/lib/babylon/scene/logic/raycasts.d.ts +21 -0
  141. package/dist/lib/babylon/scene/logic/raycasts.d.ts.map +1 -0
  142. package/dist/lib/babylon/scene/logic/raycasts.js +142 -0
  143. package/dist/lib/babylon/scene/logic/raycasts.js.map +1 -0
  144. package/dist/lib/babylon/scene/logic/static-entities.d.ts +18 -0
  145. package/dist/lib/babylon/scene/logic/static-entities.d.ts.map +1 -0
  146. package/dist/lib/babylon/scene/logic/static-entities.js +64 -0
  147. package/dist/lib/babylon/scene/logic/static-entities.js.map +1 -0
  148. package/dist/lib/babylon/scene/nodejs-runtime.d.ts +4 -0
  149. package/dist/lib/babylon/scene/nodejs-runtime.d.ts.map +1 -0
  150. package/dist/lib/babylon/scene/nodejs-runtime.js +100 -0
  151. package/dist/lib/babylon/scene/nodejs-runtime.js.map +1 -0
  152. package/dist/lib/babylon/scene/scene-context.d.ts +116 -0
  153. package/dist/lib/babylon/scene/scene-context.d.ts.map +1 -0
  154. package/dist/lib/babylon/scene/scene-context.js +492 -0
  155. package/dist/lib/babylon/scene/scene-context.js.map +1 -0
  156. package/dist/lib/babylon/scene/scene-culling.d.ts +6 -0
  157. package/dist/lib/babylon/scene/scene-culling.d.ts.map +1 -0
  158. package/dist/lib/babylon/scene/scene-culling.js +23 -0
  159. package/dist/lib/babylon/scene/scene-culling.js.map +1 -0
  160. package/dist/lib/babylon/scene/update-scheduler.d.ts +7 -0
  161. package/dist/lib/babylon/scene/update-scheduler.d.ts.map +1 -0
  162. package/dist/lib/babylon/scene/update-scheduler.js +40 -0
  163. package/dist/lib/babylon/scene/update-scheduler.js.map +1 -0
  164. package/dist/lib/babylon/time-based-animation.d.ts +13 -0
  165. package/dist/lib/babylon/time-based-animation.d.ts.map +1 -0
  166. package/dist/lib/babylon/time-based-animation.js +35 -0
  167. package/dist/lib/babylon/time-based-animation.js.map +1 -0
  168. package/dist/lib/babylon/visual/ambientLights.d.ts +6 -0
  169. package/dist/lib/babylon/visual/ambientLights.d.ts.map +1 -0
  170. package/dist/lib/babylon/visual/ambientLights.js +65 -0
  171. package/dist/lib/babylon/visual/ambientLights.js.map +1 -0
  172. package/dist/lib/babylon/visual/glowLayer.d.ts +6 -0
  173. package/dist/lib/babylon/visual/glowLayer.d.ts.map +1 -0
  174. package/dist/lib/babylon/visual/glowLayer.js +59 -0
  175. package/dist/lib/babylon/visual/glowLayer.js.map +1 -0
  176. package/dist/lib/babylon/visual/parcelOutline.d.ts +7 -0
  177. package/dist/lib/babylon/visual/parcelOutline.d.ts.map +1 -0
  178. package/dist/lib/babylon/visual/parcelOutline.js +88 -0
  179. package/dist/lib/babylon/visual/parcelOutline.js.map +1 -0
  180. package/dist/lib/babylon/visual/reticle.d.ts +3 -0
  181. package/dist/lib/babylon/visual/reticle.d.ts.map +1 -0
  182. package/dist/lib/babylon/visual/reticle.js +60 -0
  183. package/dist/lib/babylon/visual/reticle.js.map +1 -0
  184. package/dist/lib/babylon/visual/ui.d.ts +8 -0
  185. package/dist/lib/babylon/visual/ui.d.ts.map +1 -0
  186. package/dist/lib/babylon/visual/ui.js +54 -0
  187. package/dist/lib/babylon/visual/ui.js.map +1 -0
  188. package/dist/lib/common-runtime/game-loop.d.ts +4 -0
  189. package/dist/lib/common-runtime/game-loop.d.ts.map +1 -0
  190. package/dist/lib/common-runtime/game-loop.js +31 -0
  191. package/dist/lib/common-runtime/game-loop.js.map +1 -0
  192. package/dist/lib/common-runtime/modules.d.ts +244 -0
  193. package/dist/lib/common-runtime/modules.d.ts.map +1 -0
  194. package/dist/lib/common-runtime/modules.js +74 -0
  195. package/dist/lib/common-runtime/modules.js.map +1 -0
  196. package/dist/lib/common-runtime/startup.d.ts +8 -0
  197. package/dist/lib/common-runtime/startup.d.ts.map +1 -0
  198. package/dist/lib/common-runtime/startup.js +45 -0
  199. package/dist/lib/common-runtime/startup.js.map +1 -0
  200. package/dist/lib/common-runtime/types.d.ts +15 -0
  201. package/dist/lib/common-runtime/types.d.ts.map +1 -0
  202. package/dist/lib/common-runtime/types.js +7 -0
  203. package/dist/lib/common-runtime/types.js.map +1 -0
  204. package/dist/lib/decentraland/ByteBuffer/index.d.ts +75 -0
  205. package/dist/lib/decentraland/ByteBuffer/index.d.ts.map +1 -0
  206. package/dist/lib/decentraland/ByteBuffer/index.js +279 -0
  207. package/dist/lib/decentraland/ByteBuffer/index.js.map +1 -0
  208. package/dist/lib/decentraland/ByteBuffer/types.d.ts +109 -0
  209. package/dist/lib/decentraland/ByteBuffer/types.d.ts.map +1 -0
  210. package/dist/lib/decentraland/ByteBuffer/types.js +3 -0
  211. package/dist/lib/decentraland/ByteBuffer/types.js.map +1 -0
  212. package/dist/lib/decentraland/communications/CommsTransportWrapper.d.ts +45 -0
  213. package/dist/lib/decentraland/communications/CommsTransportWrapper.d.ts.map +1 -0
  214. package/dist/lib/decentraland/communications/CommsTransportWrapper.js +174 -0
  215. package/dist/lib/decentraland/communications/CommsTransportWrapper.js.map +1 -0
  216. package/dist/lib/decentraland/communications/avatar-communication-system.d.ts +18 -0
  217. package/dist/lib/decentraland/communications/avatar-communication-system.d.ts.map +1 -0
  218. package/dist/lib/decentraland/communications/avatar-communication-system.js +203 -0
  219. package/dist/lib/decentraland/communications/avatar-communication-system.js.map +1 -0
  220. package/dist/lib/decentraland/communications/connect-adapter.d.ts +5 -0
  221. package/dist/lib/decentraland/communications/connect-adapter.d.ts.map +1 -0
  222. package/dist/lib/decentraland/communications/connect-adapter.js +110 -0
  223. package/dist/lib/decentraland/communications/connect-adapter.js.map +1 -0
  224. package/dist/lib/decentraland/communications/connect-transport.d.ts +5 -0
  225. package/dist/lib/decentraland/communications/connect-transport.d.ts.map +1 -0
  226. package/dist/lib/decentraland/communications/connect-transport.js +32 -0
  227. package/dist/lib/decentraland/communications/connect-transport.js.map +1 -0
  228. package/dist/lib/decentraland/communications/networked-profile-system.d.ts +10 -0
  229. package/dist/lib/decentraland/communications/networked-profile-system.d.ts.map +1 -0
  230. package/dist/lib/decentraland/communications/networked-profile-system.js +73 -0
  231. package/dist/lib/decentraland/communications/networked-profile-system.js.map +1 -0
  232. package/dist/lib/decentraland/communications/player-entity-manager.d.ts +55 -0
  233. package/dist/lib/decentraland/communications/player-entity-manager.d.ts.map +1 -0
  234. package/dist/lib/decentraland/communications/player-entity-manager.js +167 -0
  235. package/dist/lib/decentraland/communications/player-entity-manager.js.map +1 -0
  236. package/dist/lib/decentraland/communications/position-report-system.d.ts +8 -0
  237. package/dist/lib/decentraland/communications/position-report-system.d.ts.map +1 -0
  238. package/dist/lib/decentraland/communications/position-report-system.js +51 -0
  239. package/dist/lib/decentraland/communications/position-report-system.js.map +1 -0
  240. package/dist/lib/decentraland/communications/realm-communications-system.d.ts +17 -0
  241. package/dist/lib/decentraland/communications/realm-communications-system.d.ts.map +1 -0
  242. package/dist/lib/decentraland/communications/realm-communications-system.js +111 -0
  243. package/dist/lib/decentraland/communications/realm-communications-system.js.map +1 -0
  244. package/dist/lib/decentraland/communications/scene-comms.d.ts +9 -0
  245. package/dist/lib/decentraland/communications/scene-comms.d.ts.map +1 -0
  246. package/dist/lib/decentraland/communications/scene-comms.js +20 -0
  247. package/dist/lib/decentraland/communications/scene-comms.js.map +1 -0
  248. package/dist/lib/decentraland/communications/transports/livekit.d.ts +27 -0
  249. package/dist/lib/decentraland/communications/transports/livekit.d.ts.map +1 -0
  250. package/dist/lib/decentraland/communications/transports/livekit.js +135 -0
  251. package/dist/lib/decentraland/communications/transports/livekit.js.map +1 -0
  252. package/dist/lib/decentraland/communications/transports/ws-room.d.ts +26 -0
  253. package/dist/lib/decentraland/communications/transports/ws-room.d.ts.map +1 -0
  254. package/dist/lib/decentraland/communications/transports/ws-room.js +235 -0
  255. package/dist/lib/decentraland/communications/transports/ws-room.js.map +1 -0
  256. package/dist/lib/decentraland/communications/types.d.ts +76 -0
  257. package/dist/lib/decentraland/communications/types.d.ts.map +1 -0
  258. package/dist/lib/decentraland/communications/types.js +6 -0
  259. package/dist/lib/decentraland/communications/types.js.map +1 -0
  260. package/dist/lib/decentraland/communications/ws-async-channel.d.ts +6 -0
  261. package/dist/lib/decentraland/communications/ws-async-channel.d.ts.map +1 -0
  262. package/dist/lib/decentraland/communications/ws-async-channel.js +52 -0
  263. package/dist/lib/decentraland/communications/ws-async-channel.js.map +1 -0
  264. package/dist/lib/decentraland/crdt-internal/components.d.ts +156 -0
  265. package/dist/lib/decentraland/crdt-internal/components.d.ts.map +1 -0
  266. package/dist/lib/decentraland/crdt-internal/components.js +8 -0
  267. package/dist/lib/decentraland/crdt-internal/components.js.map +1 -0
  268. package/dist/lib/decentraland/crdt-internal/conflict-resolution.d.ts +45 -0
  269. package/dist/lib/decentraland/crdt-internal/conflict-resolution.d.ts.map +1 -0
  270. package/dist/lib/decentraland/crdt-internal/conflict-resolution.js +49 -0
  271. package/dist/lib/decentraland/crdt-internal/conflict-resolution.js.map +1 -0
  272. package/dist/lib/decentraland/crdt-internal/dataCompare.d.ts +6 -0
  273. package/dist/lib/decentraland/crdt-internal/dataCompare.d.ts.map +1 -0
  274. package/dist/lib/decentraland/crdt-internal/dataCompare.js +34 -0
  275. package/dist/lib/decentraland/crdt-internal/dataCompare.js.map +1 -0
  276. package/dist/lib/decentraland/crdt-internal/generational-index-pool.d.ts +22 -0
  277. package/dist/lib/decentraland/crdt-internal/generational-index-pool.d.ts.map +1 -0
  278. package/dist/lib/decentraland/crdt-internal/generational-index-pool.js +91 -0
  279. package/dist/lib/decentraland/crdt-internal/generational-index-pool.js.map +1 -0
  280. package/dist/lib/decentraland/crdt-internal/grow-only-set.d.ts +10 -0
  281. package/dist/lib/decentraland/crdt-internal/grow-only-set.d.ts.map +1 -0
  282. package/dist/lib/decentraland/crdt-internal/grow-only-set.js +129 -0
  283. package/dist/lib/decentraland/crdt-internal/grow-only-set.js.map +1 -0
  284. package/dist/lib/decentraland/crdt-internal/last-write-win-element-set.d.ts +11 -0
  285. package/dist/lib/decentraland/crdt-internal/last-write-win-element-set.d.ts.map +1 -0
  286. package/dist/lib/decentraland/crdt-internal/last-write-win-element-set.js +224 -0
  287. package/dist/lib/decentraland/crdt-internal/last-write-win-element-set.js.map +1 -0
  288. package/dist/lib/decentraland/crdt-wire-protocol/appendValue.d.ts +15 -0
  289. package/dist/lib/decentraland/crdt-wire-protocol/appendValue.d.ts.map +1 -0
  290. package/dist/lib/decentraland/crdt-wire-protocol/appendValue.js +50 -0
  291. package/dist/lib/decentraland/crdt-wire-protocol/appendValue.js.map +1 -0
  292. package/dist/lib/decentraland/crdt-wire-protocol/crdtMessageProtocol.d.ts +31 -0
  293. package/dist/lib/decentraland/crdt-wire-protocol/crdtMessageProtocol.d.ts.map +1 -0
  294. package/dist/lib/decentraland/crdt-wire-protocol/crdtMessageProtocol.js +72 -0
  295. package/dist/lib/decentraland/crdt-wire-protocol/crdtMessageProtocol.js.map +1 -0
  296. package/dist/lib/decentraland/crdt-wire-protocol/deleteComponent.d.ts +14 -0
  297. package/dist/lib/decentraland/crdt-wire-protocol/deleteComponent.d.ts.map +1 -0
  298. package/dist/lib/decentraland/crdt-wire-protocol/deleteComponent.js +44 -0
  299. package/dist/lib/decentraland/crdt-wire-protocol/deleteComponent.js.map +1 -0
  300. package/dist/lib/decentraland/crdt-wire-protocol/deleteEntity.d.ts +11 -0
  301. package/dist/lib/decentraland/crdt-wire-protocol/deleteEntity.d.ts.map +1 -0
  302. package/dist/lib/decentraland/crdt-wire-protocol/deleteEntity.js +35 -0
  303. package/dist/lib/decentraland/crdt-wire-protocol/deleteEntity.js.map +1 -0
  304. package/dist/lib/decentraland/crdt-wire-protocol/index.d.ts +8 -0
  305. package/dist/lib/decentraland/crdt-wire-protocol/index.d.ts.map +1 -0
  306. package/dist/lib/decentraland/crdt-wire-protocol/index.js +24 -0
  307. package/dist/lib/decentraland/crdt-wire-protocol/index.js.map +1 -0
  308. package/dist/lib/decentraland/crdt-wire-protocol/message.d.ts +17 -0
  309. package/dist/lib/decentraland/crdt-wire-protocol/message.d.ts.map +1 -0
  310. package/dist/lib/decentraland/crdt-wire-protocol/message.js +49 -0
  311. package/dist/lib/decentraland/crdt-wire-protocol/message.js.map +1 -0
  312. package/dist/lib/decentraland/crdt-wire-protocol/prettyPrint.d.ts +4 -0
  313. package/dist/lib/decentraland/crdt-wire-protocol/prettyPrint.d.ts.map +1 -0
  314. package/dist/lib/decentraland/crdt-wire-protocol/prettyPrint.js +26 -0
  315. package/dist/lib/decentraland/crdt-wire-protocol/prettyPrint.js.map +1 -0
  316. package/dist/lib/decentraland/crdt-wire-protocol/putComponent.d.ts +15 -0
  317. package/dist/lib/decentraland/crdt-wire-protocol/putComponent.d.ts.map +1 -0
  318. package/dist/lib/decentraland/crdt-wire-protocol/putComponent.js +48 -0
  319. package/dist/lib/decentraland/crdt-wire-protocol/putComponent.js.map +1 -0
  320. package/dist/lib/decentraland/crdt-wire-protocol/types.d.ts +80 -0
  321. package/dist/lib/decentraland/crdt-wire-protocol/types.d.ts.map +1 -0
  322. package/dist/lib/decentraland/crdt-wire-protocol/types.js +15 -0
  323. package/dist/lib/decentraland/crdt-wire-protocol/types.js.map +1 -0
  324. package/dist/lib/decentraland/identifiers.d.ts +6 -0
  325. package/dist/lib/decentraland/identifiers.d.ts.map +1 -0
  326. package/dist/lib/decentraland/identifiers.js +22 -0
  327. package/dist/lib/decentraland/identifiers.js.map +1 -0
  328. package/dist/lib/decentraland/identity/avatar.d.ts +4 -0
  329. package/dist/lib/decentraland/identity/avatar.d.ts.map +1 -0
  330. package/dist/lib/decentraland/identity/avatar.js +57 -0
  331. package/dist/lib/decentraland/identity/avatar.js.map +1 -0
  332. package/dist/lib/decentraland/identity/login.d.ts +8 -0
  333. package/dist/lib/decentraland/identity/login.d.ts.map +1 -0
  334. package/dist/lib/decentraland/identity/login.js +121 -0
  335. package/dist/lib/decentraland/identity/login.js.map +1 -0
  336. package/dist/lib/decentraland/identity/signed-fetch.d.ts +17 -0
  337. package/dist/lib/decentraland/identity/signed-fetch.d.ts.map +1 -0
  338. package/dist/lib/decentraland/identity/signed-fetch.js +47 -0
  339. package/dist/lib/decentraland/identity/signed-fetch.js.map +1 -0
  340. package/dist/lib/decentraland/identity/types.d.ts +11 -0
  341. package/dist/lib/decentraland/identity/types.d.ts.map +1 -0
  342. package/dist/lib/decentraland/identity/types.js +3 -0
  343. package/dist/lib/decentraland/identity/types.js.map +1 -0
  344. package/dist/lib/decentraland/positions.d.ts +15 -0
  345. package/dist/lib/decentraland/positions.d.ts.map +1 -0
  346. package/dist/lib/decentraland/positions.js +40 -0
  347. package/dist/lib/decentraland/positions.js.map +1 -0
  348. package/dist/lib/decentraland/realm/resolution.d.ts +2 -0
  349. package/dist/lib/decentraland/realm/resolution.d.ts.map +1 -0
  350. package/dist/lib/decentraland/realm/resolution.js +39 -0
  351. package/dist/lib/decentraland/realm/resolution.js.map +1 -0
  352. package/dist/lib/decentraland/scene/content-server-entity.d.ts +34 -0
  353. package/dist/lib/decentraland/scene/content-server-entity.d.ts.map +1 -0
  354. package/dist/lib/decentraland/scene/content-server-entity.js +22 -0
  355. package/dist/lib/decentraland/scene/content-server-entity.js.map +1 -0
  356. package/dist/lib/decentraland/scene/spawn-points.d.ts +16 -0
  357. package/dist/lib/decentraland/scene/spawn-points.d.ts.map +1 -0
  358. package/dist/lib/decentraland/scene/spawn-points.js +78 -0
  359. package/dist/lib/decentraland/scene/spawn-points.js.map +1 -0
  360. package/dist/lib/decentraland/scene/types.d.ts +38 -0
  361. package/dist/lib/decentraland/scene/types.d.ts.map +1 -0
  362. package/dist/lib/decentraland/scene/types.js +3 -0
  363. package/dist/lib/decentraland/scene/types.js.map +1 -0
  364. package/dist/lib/decentraland/sdk-components/animator-component.d.ts +3 -0
  365. package/dist/lib/decentraland/sdk-components/animator-component.d.ts.map +1 -0
  366. package/dist/lib/decentraland/sdk-components/animator-component.js +12 -0
  367. package/dist/lib/decentraland/sdk-components/animator-component.js.map +1 -0
  368. package/dist/lib/decentraland/sdk-components/avatar-base.d.ts +5 -0
  369. package/dist/lib/decentraland/sdk-components/avatar-base.d.ts.map +1 -0
  370. package/dist/lib/decentraland/sdk-components/avatar-base.js +40 -0
  371. package/dist/lib/decentraland/sdk-components/avatar-base.js.map +1 -0
  372. package/dist/lib/decentraland/sdk-components/avatar-customizations.d.ts +5 -0
  373. package/dist/lib/decentraland/sdk-components/avatar-customizations.d.ts.map +1 -0
  374. package/dist/lib/decentraland/sdk-components/avatar-customizations.js +9 -0
  375. package/dist/lib/decentraland/sdk-components/avatar-customizations.js.map +1 -0
  376. package/dist/lib/decentraland/sdk-components/avatar-shape.d.ts +5 -0
  377. package/dist/lib/decentraland/sdk-components/avatar-shape.d.ts.map +1 -0
  378. package/dist/lib/decentraland/sdk-components/avatar-shape.js +33 -0
  379. package/dist/lib/decentraland/sdk-components/avatar-shape.js.map +1 -0
  380. package/dist/lib/decentraland/sdk-components/billboard-component.d.ts +3 -0
  381. package/dist/lib/decentraland/sdk-components/billboard-component.d.ts.map +1 -0
  382. package/dist/lib/decentraland/sdk-components/billboard-component.js +15 -0
  383. package/dist/lib/decentraland/sdk-components/billboard-component.js.map +1 -0
  384. package/dist/lib/decentraland/sdk-components/delayed-interpolation.d.ts +3 -0
  385. package/dist/lib/decentraland/sdk-components/delayed-interpolation.d.ts.map +1 -0
  386. package/dist/lib/decentraland/sdk-components/delayed-interpolation.js +15 -0
  387. package/dist/lib/decentraland/sdk-components/delayed-interpolation.js.map +1 -0
  388. package/dist/lib/decentraland/sdk-components/engine-info.d.ts +3 -0
  389. package/dist/lib/decentraland/sdk-components/engine-info.d.ts.map +1 -0
  390. package/dist/lib/decentraland/sdk-components/engine-info.js +7 -0
  391. package/dist/lib/decentraland/sdk-components/engine-info.js.map +1 -0
  392. package/dist/lib/decentraland/sdk-components/gltf-component.d.ts +3 -0
  393. package/dist/lib/decentraland/sdk-components/gltf-component.d.ts.map +1 -0
  394. package/dist/lib/decentraland/sdk-components/gltf-component.js +114 -0
  395. package/dist/lib/decentraland/sdk-components/gltf-component.js.map +1 -0
  396. package/dist/lib/decentraland/sdk-components/gltf-loading-state.d.ts +3 -0
  397. package/dist/lib/decentraland/sdk-components/gltf-loading-state.d.ts.map +1 -0
  398. package/dist/lib/decentraland/sdk-components/gltf-loading-state.js +7 -0
  399. package/dist/lib/decentraland/sdk-components/gltf-loading-state.js.map +1 -0
  400. package/dist/lib/decentraland/sdk-components/material-component.d.ts +5 -0
  401. package/dist/lib/decentraland/sdk-components/material-component.d.ts.map +1 -0
  402. package/dist/lib/decentraland/sdk-components/material-component.js +92 -0
  403. package/dist/lib/decentraland/sdk-components/material-component.js.map +1 -0
  404. package/dist/lib/decentraland/sdk-components/mesh-collider-component.d.ts +3 -0
  405. package/dist/lib/decentraland/sdk-components/mesh-collider-component.d.ts.map +1 -0
  406. package/dist/lib/decentraland/sdk-components/mesh-collider-component.js +37 -0
  407. package/dist/lib/decentraland/sdk-components/mesh-collider-component.js.map +1 -0
  408. package/dist/lib/decentraland/sdk-components/mesh-renderer-component.d.ts +5 -0
  409. package/dist/lib/decentraland/sdk-components/mesh-renderer-component.d.ts.map +1 -0
  410. package/dist/lib/decentraland/sdk-components/mesh-renderer-component.js +111 -0
  411. package/dist/lib/decentraland/sdk-components/mesh-renderer-component.js.map +1 -0
  412. package/dist/lib/decentraland/sdk-components/pb-based-component-helper.d.ts +10 -0
  413. package/dist/lib/decentraland/sdk-components/pb-based-component-helper.d.ts.map +1 -0
  414. package/dist/lib/decentraland/sdk-components/pb-based-component-helper.js +23 -0
  415. package/dist/lib/decentraland/sdk-components/pb-based-component-helper.js.map +1 -0
  416. package/dist/lib/decentraland/sdk-components/player-identity-data.d.ts +3 -0
  417. package/dist/lib/decentraland/sdk-components/player-identity-data.d.ts.map +1 -0
  418. package/dist/lib/decentraland/sdk-components/player-identity-data.js +7 -0
  419. package/dist/lib/decentraland/sdk-components/player-identity-data.js.map +1 -0
  420. package/dist/lib/decentraland/sdk-components/pointer-events-result.d.ts +3 -0
  421. package/dist/lib/decentraland/sdk-components/pointer-events-result.d.ts.map +1 -0
  422. package/dist/lib/decentraland/sdk-components/pointer-events-result.js +7 -0
  423. package/dist/lib/decentraland/sdk-components/pointer-events-result.js.map +1 -0
  424. package/dist/lib/decentraland/sdk-components/pointer-events.d.ts +3 -0
  425. package/dist/lib/decentraland/sdk-components/pointer-events.d.ts.map +1 -0
  426. package/dist/lib/decentraland/sdk-components/pointer-events.js +15 -0
  427. package/dist/lib/decentraland/sdk-components/pointer-events.js.map +1 -0
  428. package/dist/lib/decentraland/sdk-components/raycast-component.d.ts +5 -0
  429. package/dist/lib/decentraland/sdk-components/raycast-component.d.ts.map +1 -0
  430. package/dist/lib/decentraland/sdk-components/raycast-component.js +66 -0
  431. package/dist/lib/decentraland/sdk-components/raycast-component.js.map +1 -0
  432. package/dist/lib/decentraland/sdk-components/transform-component.d.ts +13 -0
  433. package/dist/lib/decentraland/sdk-components/transform-component.d.ts.map +1 -0
  434. package/dist/lib/decentraland/sdk-components/transform-component.js +84 -0
  435. package/dist/lib/decentraland/sdk-components/transform-component.js.map +1 -0
  436. package/dist/lib/decentraland/sdk-components/tween.d.ts +3 -0
  437. package/dist/lib/decentraland/sdk-components/tween.d.ts.map +1 -0
  438. package/dist/lib/decentraland/sdk-components/tween.js +15 -0
  439. package/dist/lib/decentraland/sdk-components/tween.js.map +1 -0
  440. package/dist/lib/decentraland/state.d.ts +24 -0
  441. package/dist/lib/decentraland/state.d.ts.map +1 -0
  442. package/dist/lib/decentraland/state.js +16 -0
  443. package/dist/lib/decentraland/state.js.map +1 -0
  444. package/dist/lib/decentraland/system.d.ts +7 -0
  445. package/dist/lib/decentraland/system.d.ts.map +1 -0
  446. package/dist/lib/decentraland/system.js +13 -0
  447. package/dist/lib/decentraland/system.js.map +1 -0
  448. package/dist/lib/decentraland/types.d.ts +9 -0
  449. package/dist/lib/decentraland/types.d.ts.map +1 -0
  450. package/dist/lib/decentraland/types.js +3 -0
  451. package/dist/lib/decentraland/types.js.map +1 -0
  452. package/dist/lib/decentraland/virtual-scene.d.ts +12 -0
  453. package/dist/lib/decentraland/virtual-scene.d.ts.map +1 -0
  454. package/dist/lib/decentraland/virtual-scene.js +3 -0
  455. package/dist/lib/decentraland/virtual-scene.js.map +1 -0
  456. package/dist/lib/engine-main.d.ts +8 -0
  457. package/dist/lib/engine-main.d.ts.map +1 -0
  458. package/dist/lib/engine-main.js +103 -0
  459. package/dist/lib/engine-main.js.map +1 -0
  460. package/dist/lib/misc/atom.d.ts +13 -0
  461. package/dist/lib/misc/atom.d.ts.map +1 -0
  462. package/dist/lib/misc/atom.js +66 -0
  463. package/dist/lib/misc/atom.js.map +1 -0
  464. package/dist/lib/misc/bit-operations.d.ts +3 -0
  465. package/dist/lib/misc/bit-operations.d.ts.map +1 -0
  466. package/dist/lib/misc/bit-operations.js +14 -0
  467. package/dist/lib/misc/bit-operations.js.map +1 -0
  468. package/dist/lib/misc/flat-fetch.d.ts +16 -0
  469. package/dist/lib/misc/flat-fetch.d.ts.map +1 -0
  470. package/dist/lib/misc/flat-fetch.js +26 -0
  471. package/dist/lib/misc/flat-fetch.js.map +1 -0
  472. package/dist/lib/misc/json.d.ts +3 -0
  473. package/dist/lib/misc/json.d.ts.map +1 -0
  474. package/dist/lib/misc/json.js +24 -0
  475. package/dist/lib/misc/json.js.map +1 -0
  476. package/dist/lib/misc/logger.d.ts +6 -0
  477. package/dist/lib/misc/logger.d.ts.map +1 -0
  478. package/dist/lib/misc/logger.js +24 -0
  479. package/dist/lib/misc/logger.js.map +1 -0
  480. package/dist/lib/misc/memoize.d.ts +2 -0
  481. package/dist/lib/misc/memoize.d.ts.map +1 -0
  482. package/dist/lib/misc/memoize.js +16 -0
  483. package/dist/lib/misc/memoize.js.map +1 -0
  484. package/dist/lib/misc/promises.d.ts +3 -0
  485. package/dist/lib/misc/promises.d.ts.map +1 -0
  486. package/dist/lib/misc/promises.js +14 -0
  487. package/dist/lib/misc/promises.js.map +1 -0
  488. package/dist/lib/polyfills/xmlhttprequest.d.ts +6 -0
  489. package/dist/lib/polyfills/xmlhttprequest.d.ts.map +1 -0
  490. package/dist/lib/polyfills/xmlhttprequest.js +127 -0
  491. package/dist/lib/polyfills/xmlhttprequest.js.map +1 -0
  492. package/dist/lib/quick-js/convert-handles.d.ts +14 -0
  493. package/dist/lib/quick-js/convert-handles.d.ts.map +1 -0
  494. package/dist/lib/quick-js/convert-handles.js +83 -0
  495. package/dist/lib/quick-js/convert-handles.js.map +1 -0
  496. package/dist/lib/quick-js/index.d.ts +12 -0
  497. package/dist/lib/quick-js/index.d.ts.map +1 -0
  498. package/dist/lib/quick-js/index.js +159 -0
  499. package/dist/lib/quick-js/index.js.map +1 -0
  500. package/dist/lib/quick-js/rpc-scene-runtime.d.ts +13 -0
  501. package/dist/lib/quick-js/rpc-scene-runtime.d.ts.map +1 -0
  502. package/dist/lib/quick-js/rpc-scene-runtime.js +32 -0
  503. package/dist/lib/quick-js/rpc-scene-runtime.js.map +1 -0
  504. package/dist/lib/quick-js/types.d.ts +35 -0
  505. package/dist/lib/quick-js/types.d.ts.map +1 -0
  506. package/dist/lib/quick-js/types.js +3 -0
  507. package/dist/lib/quick-js/types.js.map +1 -0
  508. package/dist/lib/web-worker-runtime/context.d.ts +12 -0
  509. package/dist/lib/web-worker-runtime/context.d.ts.map +1 -0
  510. package/dist/lib/web-worker-runtime/context.js +97 -0
  511. package/dist/lib/web-worker-runtime/context.js.map +1 -0
  512. package/dist/lib/web-worker-runtime/sandbox.d.ts +9 -0
  513. package/dist/lib/web-worker-runtime/sandbox.d.ts.map +1 -0
  514. package/dist/lib/web-worker-runtime/sandbox.js +98 -0
  515. package/dist/lib/web-worker-runtime/sandbox.js.map +1 -0
  516. package/dist/lib/web-worker-runtime/web-worker-scene-runtime.d.ts +13 -0
  517. package/dist/lib/web-worker-runtime/web-worker-scene-runtime.d.ts.map +1 -0
  518. package/dist/lib/web-worker-runtime/web-worker-scene-runtime.js +32 -0
  519. package/dist/lib/web-worker-runtime/web-worker-scene-runtime.js.map +1 -0
  520. package/package.json +73 -0
@@ -0,0 +1,492 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
26
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
27
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
28
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
29
+ };
30
+ var __importDefault = (this && this.__importDefault) || function (mod) {
31
+ return (mod && mod.__esModule) ? mod : { "default": mod };
32
+ };
33
+ var _SceneContext_ref;
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.encodeMessage = exports.MsgType = exports.SceneContext = void 0;
36
+ const BABYLON = __importStar(require("@babylonjs/core"));
37
+ const fp_future_1 = __importDefault(require("fp-future"));
38
+ const crdt_wire_protocol_1 = require("../../decentraland/crdt-wire-protocol");
39
+ const ByteBuffer_1 = require("../../decentraland/ByteBuffer");
40
+ const content_server_entity_1 = require("../../decentraland/scene/content-server-entity");
41
+ const BabylonEntity_1 = require("./BabylonEntity");
42
+ const transform_component_1 = require("../../decentraland/sdk-components/transform-component");
43
+ const last_write_win_element_set_1 = require("../../decentraland/crdt-internal/last-write-win-element-set");
44
+ const cyclic_transform_1 = require("./logic/cyclic-transform");
45
+ const core_1 = require("@babylonjs/core");
46
+ const billboard_component_1 = require("../../decentraland/sdk-components/billboard-component");
47
+ const raycast_component_1 = require("../../decentraland/sdk-components/raycast-component");
48
+ const mesh_renderer_component_1 = require("../../decentraland/sdk-components/mesh-renderer-component");
49
+ const raycasts_1 = require("./logic/raycasts");
50
+ const mesh_collider_component_1 = require("../../decentraland/sdk-components/mesh-collider-component");
51
+ const positions_1 = require("../../decentraland/positions");
52
+ const parcelOutline_1 = require("../visual/parcelOutline");
53
+ const gltf_component_1 = require("../../decentraland/sdk-components/gltf-component");
54
+ const AssetManager_1 = require("./AssetManager");
55
+ const pointer_events_1 = require("../../decentraland/sdk-components/pointer-events");
56
+ const static_entities_1 = require("./logic/static-entities");
57
+ const animator_component_1 = require("../../decentraland/sdk-components/animator-component");
58
+ const engine_info_1 = require("../../decentraland/sdk-components/engine-info");
59
+ const gltf_loading_state_1 = require("../../decentraland/sdk-components/gltf-loading-state");
60
+ const loading_state_gen_1 = require("@dcl/protocol/out-js/decentraland/sdk/components/common/loading_state.gen");
61
+ const pointer_events_result_1 = require("../../decentraland/sdk-components/pointer-events-result");
62
+ const grow_only_set_1 = require("../../decentraland/crdt-internal/grow-only-set");
63
+ const generational_index_pool_1 = require("../../decentraland/crdt-internal/generational-index-pool");
64
+ const avatar_shape_1 = require("../../decentraland/sdk-components/avatar-shape");
65
+ const avatar_base_1 = require("../../decentraland/sdk-components/avatar-base");
66
+ const delayed_interpolation_1 = require("../../decentraland/sdk-components/delayed-interpolation");
67
+ const tween_1 = require("../../decentraland/sdk-components/tween");
68
+ const material_component_1 = require("../../decentraland/sdk-components/material-component");
69
+ const avatar_communication_system_1 = require("../../decentraland/communications/avatar-communication-system");
70
+ const SCENE_ENTITY_RANGE = [1, generational_index_pool_1.MAX_ENTITY_NUMBER];
71
+ let incrementalId = 0;
72
+ class SceneContext {
73
+ constructor(babylonScene, loadableScene, isGlobalScene, entityId) {
74
+ this.babylonScene = babylonScene;
75
+ this.loadableScene = loadableScene;
76
+ this.isGlobalScene = isGlobalScene;
77
+ this.entities = new Map();
78
+ _SceneContext_ref.set(this, new WeakRef(this));
79
+ // this future is resolved when the scene is disposed
80
+ this.stopped = (0, fp_future_1.default)();
81
+ // after the "tick" is completed, resolving the futures will send back the CRDT
82
+ // updates to the scripting scene
83
+ this.nextFrameFutures = [];
84
+ // stash of incoming CRDT messages from the scripting scene, processed using a
85
+ // quota each renderer frame. ByteBuffer reading is continuable using iterators.
86
+ // the incoming messages also include the range of allowe entities that the origin
87
+ // transports had access to
88
+ this.incomingMessages = [];
89
+ // stash of outgoing messages ready to be sent to back to the scripting scene
90
+ this.outgoingMessagesBuffer = new ByteBuffer_1.ReadWriteByteBuffer();
91
+ // when we finish to process all the income messages of a tick,
92
+ // set finishedProcessingFrame to true to send the outgoing messages, then to false.
93
+ this.finishedProcessingIncomingMessagesOfTick = false;
94
+ // the follwing set contains a list of pending raycast queries. if a query is continous,
95
+ // it won't be removed from the set
96
+ this.pendingRaycastOperations = new Set();
97
+ // log function for tests
98
+ this.log = (...args) => console.log(this.rootNode.name, ...args);
99
+ // tick counter for EngineInfo
100
+ this.currentTick = 0;
101
+ // start time for EngineInfo
102
+ this.startTime = performance.now();
103
+ // start frame for EngineInfo
104
+ this.startFrame = this.babylonScene.getEngine().frameId;
105
+ // contents of the main.crdt file
106
+ this.mainCrdt = Uint8Array.of();
107
+ this.components = {
108
+ [transform_component_1.transformComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(transform_component_1.transformComponent),
109
+ [billboard_component_1.billboardComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(billboard_component_1.billboardComponent),
110
+ [raycast_component_1.raycastComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(raycast_component_1.raycastComponent),
111
+ [raycast_component_1.raycastResultComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(raycast_component_1.raycastResultComponent),
112
+ [mesh_renderer_component_1.meshRendererComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(mesh_renderer_component_1.meshRendererComponent),
113
+ [mesh_collider_component_1.meshColliderComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(mesh_collider_component_1.meshColliderComponent),
114
+ [gltf_component_1.gltfContainerComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(gltf_component_1.gltfContainerComponent),
115
+ [pointer_events_1.pointerEventsComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(pointer_events_1.pointerEventsComponent),
116
+ [pointer_events_result_1.pointerEventsResultComponent.componentId]: (0, grow_only_set_1.createValueSetComponentStore)(pointer_events_result_1.pointerEventsResultComponent, {
117
+ maxElements: 10,
118
+ timestampFunction(value) {
119
+ return value.tickNumber;
120
+ },
121
+ }),
122
+ [animator_component_1.animatorComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(animator_component_1.animatorComponent),
123
+ [gltf_loading_state_1.gltfContainerLoadingStateComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(gltf_loading_state_1.gltfContainerLoadingStateComponent),
124
+ [engine_info_1.engineInfoComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(engine_info_1.engineInfoComponent),
125
+ [avatar_shape_1.avatarShapeComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(avatar_shape_1.avatarShapeComponent),
126
+ [avatar_base_1.avatarBaseComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(avatar_base_1.avatarBaseComponent),
127
+ [tween_1.tweenComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(tween_1.tweenComponent),
128
+ [delayed_interpolation_1.delayedInterpolationComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(delayed_interpolation_1.delayedInterpolationComponent),
129
+ [material_component_1.materialComponent.componentId]: (0, last_write_win_element_set_1.createLwwStore)(material_component_1.materialComponent),
130
+ };
131
+ // this flag is changed every time an entity changed its parent. the change
132
+ // in the hierarchy is not immediately applied, instead, it should be queued
133
+ // in the unparentedEntities set. Once there, at the end of the "tick", the
134
+ // scene will perform all possible acyclic updates of entities to prevent
135
+ // breaking the Babylon's hierarcy and generating stack overflows while calculating
136
+ // the world matrix of the entitiesg
137
+ this.hierarchyChanged = false;
138
+ this.unparentedEntities = new Set;
139
+ // the assetmanager is used to centralize all the loading/unloading of assets
140
+ // of this scene.
141
+ this.assetManager = new AssetManager_1.AssetManager(this.loadableScene, this.babylonScene);
142
+ // subscriptions to other scene's CRDT updates
143
+ this.subscriptions = [];
144
+ this.subscriptionsBuffer = new ByteBuffer_1.ReadWriteByteBuffer();
145
+ // TODO: this should be the optimized data structure to keep track of deleted entities
146
+ // instead of a set
147
+ this.deletedEntities = new Set();
148
+ this.id = incrementalId++;
149
+ this.incomingNetworkMessages = [];
150
+ this.entityId = entityId;
151
+ this.rootNode = this.getOrCreateEntity(static_entities_1.StaticEntities.RootEntity);
152
+ // the rootNode must be positioned according to the value of the "scenes.base" of the scene metadata (scene.json)
153
+ this.metadata = loadableScene.entity.metadata;
154
+ if (this.metadata.scene?.base) {
155
+ const base = (0, positions_1.parseParcelPosition)(this.metadata.scene.base);
156
+ this.rootNode.name = this.metadata.scene.base;
157
+ (0, positions_1.gridToWorld)(base.x, base.y, this.rootNode.position);
158
+ const r = (0, parcelOutline_1.createParcelOutline)(babylonScene, this.metadata.scene.base, this.metadata.scene.parcels);
159
+ r.result.parent = this.rootNode;
160
+ // position the GlobalCenterOfCoordinates entity
161
+ const GlobalCenterOfCoordinates = this.getOrCreateEntity(static_entities_1.StaticEntities.GlobalCenterOfCoordinates);
162
+ GlobalCenterOfCoordinates.position.set(-this.rootNode.position.x, 0, -this.rootNode.position.z);
163
+ GlobalCenterOfCoordinates.parent = this.rootNode;
164
+ }
165
+ // calculate a naive bounding box for the scene to calculate the distance to the outer bounds
166
+ // and use that distance to prioritize the message quota for ADR-148
167
+ if (this.metadata.scene?.parcels) {
168
+ let minX = null;
169
+ let minZ = null;
170
+ let maxX = null;
171
+ let maxZ = null;
172
+ for (const position of this.metadata.scene.parcels) {
173
+ const vec = (0, positions_1.parseParcelPosition)(position);
174
+ if (minX == null || vec.x < minX)
175
+ minX = vec.x;
176
+ if (minZ == null || vec.y < minZ)
177
+ minZ = vec.y;
178
+ if (maxX == null || vec.x > maxX)
179
+ maxX = vec.x;
180
+ if (maxZ == null || vec.y > maxZ)
181
+ maxZ = vec.y;
182
+ }
183
+ // as per https://docs.decentraland.org/creator/development-guide/scene-limitations/
184
+ const height = Math.log2(this.metadata.scene.parcels.length + 1) * 20;
185
+ if (minX) {
186
+ this.boundingBox = new BABYLON.BoundingBox(new core_1.Vector3(minX * positions_1.PARCEL_SIZE_METERS, -1, minZ * positions_1.PARCEL_SIZE_METERS), new core_1.Vector3((maxX + 1) * positions_1.PARCEL_SIZE_METERS, height, (maxZ + 1) * positions_1.PARCEL_SIZE_METERS));
187
+ }
188
+ }
189
+ }
190
+ async initAsyncJobs() {
191
+ // load the main.crdt as specified by ADR-133 and ADR-148. the tick number zero
192
+ // is always completed by either the contents of main.crdt or by an empty array
193
+ try {
194
+ const file = 'main.crdt';
195
+ if ((0, content_server_entity_1.resolveFileAbsolute)(this.loadableScene, file)) {
196
+ const { content } = await this.readFile(file);
197
+ this.mainCrdt = content;
198
+ this.incomingMessages.push({ buffer: new ByteBuffer_1.ReadWriteByteBuffer(content), allowedEntityRange: SCENE_ENTITY_RANGE });
199
+ }
200
+ }
201
+ catch (err) {
202
+ this.log(err);
203
+ }
204
+ }
205
+ // this function returns the total elapsed time in seconds since the SceneContext was created
206
+ getElapsedTime() {
207
+ return (performance.now() - this.startTime) / 1000;
208
+ }
209
+ // naivest implementation of the distance to the outer bounds of the scene
210
+ distanceToPoint(point) {
211
+ if (!this.boundingBox)
212
+ return 0;
213
+ if (this.boundingBox?.intersectsPoint(point))
214
+ return 0;
215
+ return this.boundingBox?.centerWorld.subtract(point).length();
216
+ }
217
+ removeEntity(entityId) {
218
+ this.deletedEntities.add(entityId);
219
+ const entity = this.getEntityOrNull(entityId);
220
+ if (entity) {
221
+ entity.dispose();
222
+ this.entities.delete(entityId);
223
+ this.unparentedEntities.delete(entityId);
224
+ }
225
+ }
226
+ getOrCreateEntity(entityId) {
227
+ let entity = this.entities.get(entityId);
228
+ if (!entity) {
229
+ entity = new BabylonEntity_1.BabylonEntity(entityId, __classPrivateFieldGet(this, _SceneContext_ref, "f"));
230
+ // every new entity is parented to the scene's rootEntity by default
231
+ entity.parent = this.rootNode;
232
+ this.entities.set(entityId, entity);
233
+ }
234
+ return entity;
235
+ }
236
+ getEntityOrNull(entityId) {
237
+ return this.entities.get(entityId) || null;
238
+ }
239
+ /**
240
+ * The "update" function handles all the incoming messages from the scene and
241
+ * applies the changes to the renderer entities.
242
+ *
243
+ * This function is declared as a property to be added and removed to the
244
+ * rendering engine without binding the SceneContext object.
245
+ *
246
+ * Returns false if the quota was exceeded. True if there is still time to continue
247
+ * processing more messages, similar to cooperative scheduling.
248
+ */
249
+ update(hasQuota) {
250
+ let rollingOperationCounter = 0;
251
+ // process all the incoming messages
252
+ while (this.incomingMessages.length) {
253
+ const message = this.incomingMessages[0];
254
+ for (const crdtMessage of (0, crdt_wire_protocol_1.readAllMessages)(message.buffer)) {
255
+ if (this.deletedEntities.has(crdtMessage.entityId))
256
+ continue;
257
+ // STUB create or delete entities based on putComponent and deleteEntity
258
+ switch (crdtMessage.type) {
259
+ case crdt_wire_protocol_1.CrdtMessageType.APPEND_VALUE:
260
+ case crdt_wire_protocol_1.CrdtMessageType.DELETE_COMPONENT:
261
+ case crdt_wire_protocol_1.CrdtMessageType.PUT_COMPONENT: {
262
+ // ignore updates of entities outside range
263
+ // if (!entityIsInRange(crdtMessage.entityId, message.allowedEntityRange)) continue
264
+ const entity = this.getOrCreateEntity(crdtMessage.entityId);
265
+ const component = this.components[crdtMessage.componentId];
266
+ // if the change is accepted, then we instruct the entity to update its internal state
267
+ // via putComponent or deleteComponent calls
268
+ if (component && component.updateFromCrdt(crdtMessage, this.outgoingMessagesBuffer)) {
269
+ if (crdtMessage.type === crdt_wire_protocol_1.CrdtMessageType.PUT_COMPONENT ||
270
+ crdtMessage.type === crdt_wire_protocol_1.CrdtMessageType.APPEND_VALUE) {
271
+ entity.putComponent(component);
272
+ }
273
+ else {
274
+ entity.deleteComponent(component);
275
+ }
276
+ }
277
+ break;
278
+ }
279
+ case crdt_wire_protocol_1.CrdtMessageType.DELETE_ENTITY: {
280
+ // ignore updates of entities outside range
281
+ if (!(0, static_entities_1.entityIsInRange)(crdtMessage.entityId, message.allowedEntityRange))
282
+ continue;
283
+ this.removeEntity(crdtMessage.entityId);
284
+ break;
285
+ }
286
+ }
287
+ // if we exceeded the quota, finish the processing of this "message" and yield
288
+ // the execution control back to the event loop
289
+ if ((++rollingOperationCounter % 10) == 0 && !hasQuota()) {
290
+ return false;
291
+ }
292
+ }
293
+ // at this point, the whole "message" was consumed, we proceed to its removal
294
+ this.incomingMessages.shift();
295
+ // this process resolves the re parenting of all entities preventing cycles
296
+ (0, cyclic_transform_1.resolveCyclicParening)(this);
297
+ }
298
+ // Update avatar system if it exists
299
+ if (this._avatarSystem) {
300
+ this._avatarSystem.update();
301
+ }
302
+ // mark the frame as processed. this signals the lateUpdate to respond to the scene with updates
303
+ this.finishedProcessingIncomingMessagesOfTick = true;
304
+ return true;
305
+ }
306
+ /**
307
+ * lateUpdate should run in each frame AFTER the physics are processed. This is described
308
+ * in ADR-148.
309
+ *
310
+ * The lateUpdate function is declared as a property to be added and removed to the
311
+ * rendering engine without binding the SceneContext object.
312
+ */
313
+ lateUpdate() {
314
+ // only emit messages if there are receiver promises
315
+ if (!this.nextFrameFutures.length)
316
+ return;
317
+ // only finalize the frame once the incoming messages were cleared
318
+ if (!this.finishedProcessingIncomingMessagesOfTick)
319
+ return;
320
+ // on the first frame, as per ADR-148, the crdtSendToRenderer should only respond
321
+ // if and only if all assets finished loading to properly process the raycasts
322
+ //
323
+ // to compy with that statement, we early-finalize this procedure if a component is in
324
+ // LOADING state. the engine will catch up and finish the crdtSendToRenderer on the
325
+ // next renderer frame
326
+ if (this.currentTick === 0) {
327
+ const loadingComponents = this.components[gltf_loading_state_1.gltfContainerLoadingStateComponent.componentId];
328
+ let has = false;
329
+ for (const [_entity, component] of loadingComponents.iterator()) {
330
+ has = true;
331
+ if (component.currentState === loading_state_gen_1.LoadingState.LOADING) {
332
+ return;
333
+ }
334
+ }
335
+ this.log('\n\n\n\n======================= Starting Scene Logs: ======================= \n\n');
336
+ }
337
+ const outMessages = [];
338
+ (0, raycasts_1.processRaycasts)(this);
339
+ // TODO: Execute queries into this.outgoingMessages
340
+ // TODO: Collect events into this.outgoingMessages
341
+ // update the components of the static entities to be sent to the scene
342
+ this.updateStaticEntities();
343
+ // write all the CRDT updates in the outgoingMessagesBuffer
344
+ for (const component of Object.values(this.components)) {
345
+ component.dumpCrdtUpdates(this.outgoingMessagesBuffer);
346
+ }
347
+ // forward all messages from all subscriptions
348
+ for (const subscription of this.subscriptions) {
349
+ subscription.getUpdates(this.subscriptionsBuffer);
350
+ if (this.subscriptionsBuffer.currentWriteOffset()) {
351
+ const binary = this.subscriptionsBuffer.toBinary();
352
+ // send the messages from the subscriptions to the scenes
353
+ outMessages.push(binary);
354
+ // auto process the messages from the subscriptions
355
+ this.incomingMessages.push({ buffer: new ByteBuffer_1.ReadWriteByteBuffer(binary), allowedEntityRange: subscription.range });
356
+ // reset the buffer
357
+ this.subscriptionsBuffer.incrementWriteOffset(-this.subscriptionsBuffer.currentWriteOffset());
358
+ this.subscriptionsBuffer.incrementReadOffset(-this.subscriptionsBuffer.currentReadOffset());
359
+ }
360
+ }
361
+ if (this.outgoingMessagesBuffer.currentWriteOffset()) {
362
+ outMessages.push(this.outgoingMessagesBuffer.toBinary());
363
+ this.outgoingMessagesBuffer.incrementWriteOffset(-this.outgoingMessagesBuffer.currentWriteOffset());
364
+ this.outgoingMessagesBuffer.incrementReadOffset(-this.outgoingMessagesBuffer.currentReadOffset());
365
+ }
366
+ // finally resolve the future so the function "receiveBatch" is unblocked
367
+ // and the next scripting frame is allowed to happen
368
+ this.nextFrameFutures.forEach((fut) => fut.resolve({ data: outMessages }));
369
+ // finally clean the futures
370
+ this.nextFrameFutures.length = 0;
371
+ // increment the tick number, as per ADR-148
372
+ this.currentTick++;
373
+ this.finishedProcessingIncomingMessagesOfTick = false;
374
+ }
375
+ dispose() {
376
+ for (const [entityId] of this.entities) {
377
+ this.removeEntity(entityId);
378
+ }
379
+ for (const s of this.subscriptions) {
380
+ s.dispose();
381
+ }
382
+ this.subscriptions.length = 0;
383
+ // Dispose avatar system if it exists
384
+ if (this._avatarSystem) {
385
+ this._avatarSystem.dispose();
386
+ this._avatarSystem = undefined;
387
+ }
388
+ // Disconnect transport if it exists
389
+ if (this._transport) {
390
+ this._transport.disconnect().catch(() => {
391
+ // Ignore disconnection errors during dispose
392
+ });
393
+ this._transport = undefined;
394
+ }
395
+ this.stopped.resolve();
396
+ this.assetManager.dispose();
397
+ this.rootNode.parent = null;
398
+ this.rootNode.dispose(false);
399
+ }
400
+ // this method exists to be a wrapper of the function. so it can be mocked for tests without wizzardy
401
+ updateStaticEntities() {
402
+ (0, static_entities_1.updateStaticEntities)(this);
403
+ }
404
+ // impl RuntimeApi {
405
+ async readFile(file) {
406
+ return this.assetManager.readFile(file);
407
+ }
408
+ // }
409
+ // returns a future that will be resolved when the next frame is processed
410
+ async nextTick() {
411
+ const fut = (0, fp_future_1.default)();
412
+ this.nextFrameFutures.push(fut);
413
+ return fut;
414
+ }
415
+ async _crdtSendToRenderer(data) {
416
+ if (data.byteLength) {
417
+ this.incomingMessages.push({ buffer: new ByteBuffer_1.ReadWriteByteBuffer(data), allowedEntityRange: SCENE_ENTITY_RANGE });
418
+ }
419
+ // create a future to wait until all the messages are processed. even if there
420
+ // are no updates, we must return the future for CRDT updates like the camera
421
+ // position
422
+ return this.nextTick();
423
+ }
424
+ // impl EngineApiInterface {
425
+ async crdtGetState() {
426
+ const result = await this._crdtSendToRenderer(new Uint8Array(0));
427
+ const hasEntities = this.mainCrdt.byteLength > 0;
428
+ if (hasEntities) {
429
+ // prepend the main.crdt to the response (if not empty). crdt messages are
430
+ // processed sequentially, so the main.crdt will be processed first.
431
+ // if the renderer has any modifications to the main.crdt, they will be
432
+ // applied because they will be processed after
433
+ result.data.unshift(this.mainCrdt);
434
+ }
435
+ return { hasEntities, data: result.data };
436
+ }
437
+ async crdtSendToRenderer(payload) {
438
+ return this._crdtSendToRenderer(payload.data);
439
+ }
440
+ get transport() {
441
+ return this._transport;
442
+ }
443
+ getNetworkMessages() {
444
+ const messages = [...this.incomingNetworkMessages];
445
+ this.incomingNetworkMessages.length = 0;
446
+ return messages;
447
+ }
448
+ attachLivekitTransport(transport) {
449
+ this._transport = transport;
450
+ // Create avatar communication system for this scene
451
+ this._avatarSystem = (0, avatar_communication_system_1.createAvatarCommunicationSystem)(transport);
452
+ // Add the avatar system subscription to this scene's subscriptions
453
+ this.subscriptions.push(this._avatarSystem.createSubscription());
454
+ transport.events.on('sceneMessageBus', (event) => {
455
+ if (event.data.sceneId === this.entityId) {
456
+ if (event.data.data.byteLength) {
457
+ const [_, data] = decodeMessage(event.data.data);
458
+ const senderBytes = new TextEncoder().encode(event.address);
459
+ const messageLength = senderBytes.byteLength + data.byteLength + 1;
460
+ const serializedMessage = new Uint8Array(messageLength);
461
+ serializedMessage.set(new Uint8Array([senderBytes.byteLength]), 0);
462
+ serializedMessage.set(senderBytes, 1);
463
+ serializedMessage.set(data, senderBytes.byteLength + 1);
464
+ this.incomingNetworkMessages.push(serializedMessage);
465
+ }
466
+ }
467
+ });
468
+ }
469
+ }
470
+ exports.SceneContext = SceneContext;
471
+ _SceneContext_ref = new WeakMap();
472
+ /**
473
+ * MsgType utils to diff between old string messages, and new uint8Array messages.
474
+ */
475
+ var MsgType;
476
+ (function (MsgType) {
477
+ MsgType[MsgType["String"] = 1] = "String";
478
+ MsgType[MsgType["Uint8Array"] = 2] = "Uint8Array";
479
+ })(MsgType = exports.MsgType || (exports.MsgType = {}));
480
+ function decodeMessage(value) {
481
+ const msgType = value.at(0);
482
+ const data = value.subarray(1);
483
+ return [msgType, data];
484
+ }
485
+ function encodeMessage(data, type) {
486
+ const message = new Uint8Array(data.byteLength + 1);
487
+ message.set([type]);
488
+ message.set(data, 1);
489
+ return message;
490
+ }
491
+ exports.encodeMessage = encodeMessage;
492
+ //# sourceMappingURL=scene-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene-context.js","sourceRoot":"","sources":["../../../../src/lib/babylon/scene/scene-context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA0C;AAC1C,0DAA2C;AAI3C,8EAAwF;AACxF,8DAA+E;AAC/E,0FAAgH;AAChH,mDAA+C;AAC/C,+FAA0F;AAC1F,4GAA4F;AAE5F,+DAAgE;AAChE,0CAAyC;AAEzC,+FAA0F;AAC1F,2FAA8G;AAC9G,uGAAiG;AACjG,+CAAkD;AAClD,uGAAiG;AACjG,4DAAmG;AACnG,2DAA6D;AAE7D,qFAAyF;AACzF,iDAA6C;AAC7C,qFAAyF;AACzF,6DAA+F;AAC/F,6FAAwF;AACxF,+EAAmF;AACnF,6FAAyG;AACzG,iHAAwG;AACxG,mGAAsG;AACtG,kFAA6F;AAE7F,sGAA4F;AAC5F,iFAAqF;AACrF,+EAAmF;AACnF,mGAAuG;AACvG,mEAAwE;AACxE,6FAAwF;AAExF,+GAA0I;AAE1I,MAAM,kBAAkB,GAAqB,CAAC,CAAC,EAAE,2CAAiB,CAAC,CAAA;AAEnE,IAAI,aAAa,GAAG,CAAC,CAAA;AAErB,MAAa,YAAY;IAoGvB,YAAmB,YAA2B,EAAS,aAA4B,EAAS,aAAsB,EAAE,QAAgB;QAAjH,iBAAY,GAAZ,YAAY,CAAe;QAAS,kBAAa,GAAb,aAAa,CAAe;QAAS,kBAAa,GAAb,aAAa,CAAS;QAnGlH,aAAQ,GAAG,IAAI,GAAG,EAAyB,CAAA;QAC3C,4BAAO,IAAI,OAAO,CAAC,IAAI,CAAC,EAAA;QAOxB,qDAAqD;QAC5C,YAAO,GAAG,IAAA,mBAAM,GAAQ,CAAA;QAIjC,+EAA+E;QAC/E,i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C,IAAI,UAAU,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;oBAClE,iBAAiB,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;oBACrC,iBAAiB,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,UAAU,GAAG,CAAC,CAAC,CAAA;oBACvD,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;iBACrD;aACF;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAzdD,oCAydC;;AAED;;GAEG;AACH,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,yCAAU,CAAA;IACV,iDAAc,CAAA;AAChB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB;AAED,SAAS,aAAa,CAAC,KAAiB;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAY,CAAA;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC9B,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACxB,CAAC;AAED,SAAgB,aAAa,CAAC,IAAgB,EAAE,IAAa;IAC3D,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAA;IACnD,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACnB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACpB,OAAO,OAAO,CAAA;AAChB,CAAC;AALD,sCAKC"}
@@ -0,0 +1,6 @@
1
+ import { Scene } from "@babylonjs/core";
2
+ import { SceneContext } from "./scene-context";
3
+ export declare function createSceneCullingSystem(babylonScene: Scene, getScenes: () => Iterable<SceneContext>): {
4
+ update(): void;
5
+ };
6
+ //# sourceMappingURL=scene-culling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene-culling.d.ts","sourceRoot":"","sources":["../../../../src/lib/babylon/scene/scene-culling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAI9C,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC,YAAY,CAAC;;EAepG"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSceneCullingSystem = void 0;
4
+ // the sceneCullingSystem rapidly checks whether the bounding box of the scene are
5
+ // colliding with the frustum of the camera to enable/disable their root entity
6
+ function createSceneCullingSystem(babylonScene, getScenes) {
7
+ return {
8
+ update() {
9
+ const planes = babylonScene.frustumPlanes;
10
+ if (planes) {
11
+ for (const scene of getScenes()) {
12
+ // we know the static bounding box of the scene in advance. we can disable the
13
+ // whole tree for rendering if it is not in the frustum.
14
+ if (scene.boundingBox) {
15
+ scene.rootNode.setEnabled(scene.boundingBox.isInFrustum(planes));
16
+ }
17
+ }
18
+ }
19
+ }
20
+ };
21
+ }
22
+ exports.createSceneCullingSystem = createSceneCullingSystem;
23
+ //# sourceMappingURL=scene-culling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene-culling.js","sourceRoot":"","sources":["../../../../src/lib/babylon/scene/scene-culling.ts"],"names":[],"mappings":";;;AAGA,kFAAkF;AAClF,+EAA+E;AAC/E,SAAgB,wBAAwB,CAAC,YAAmB,EAAE,SAAuC;IACnG,OAAO;QACL,MAAM;YACJ,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,CAAA;YACzC,IAAI,MAAM,EAAE;gBACV,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,EAAE;oBAC/B,8EAA8E;oBAC9E,wDAAwD;oBACxD,IAAI,KAAK,CAAC,WAAW,EAAE;wBACrB,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;qBACjE;iBACF;aACF;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAfD,4DAeC"}
@@ -0,0 +1,7 @@
1
+ import { Scene } from "@babylonjs/core";
2
+ import { SceneContext } from "./scene-context";
3
+ export declare function createSceneTickSystem(scene: Scene, getScenes: () => Iterable<SceneContext>, quotaMs: number): {
4
+ update(): void;
5
+ lateUpdate(): void;
6
+ };
7
+ //# sourceMappingURL=update-scheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-scheduler.d.ts","sourceRoot":"","sources":["../../../../src/lib/babylon/scene/update-scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,EAAW,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM;;;EAqC3G"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSceneTickSystem = void 0;
4
+ const core_1 = require("@babylonjs/core");
5
+ // SceneTickSystem adds hooks to the babylon engine to start processing the updates from the workers
6
+ function createSceneTickSystem(scene, getScenes, quotaMs) {
7
+ function getSortedScenes() {
8
+ const scenes = getScenes();
9
+ const cameraPosition = scene.activeCamera?.position || core_1.Vector3.Zero();
10
+ const scenesWithDistance = Array.from(scenes).map(scene => ({
11
+ scene,
12
+ distance: (scene.currentTick == 0 || scene.isGlobalScene) ? 0
13
+ : scene.distanceToPoint(cameraPosition)
14
+ }));
15
+ return scenesWithDistance.sort((a, b) => a.distance - b.distance);
16
+ }
17
+ return {
18
+ // this function runs the initial part of the tick defined in ADR-148,
19
+ // before sending GPU commands
20
+ update() {
21
+ const sortedScenes = getSortedScenes();
22
+ const start = core_1.PrecisionDate.Now;
23
+ const hasQuota = () => (core_1.PrecisionDate.Now - start) < quotaMs;
24
+ for (const { scene } of sortedScenes) {
25
+ // if the processing quota has been exceeded for this frame we will skip it for now.
26
+ if (!scene.update(hasQuota))
27
+ return;
28
+ }
29
+ },
30
+ // this function runs the final part of the tick defined in ADR-148.
31
+ // ideally in parallel with GPU commands or while we wait for their completion
32
+ lateUpdate() {
33
+ for (const scene of getScenes()) {
34
+ scene.lateUpdate();
35
+ }
36
+ }
37
+ };
38
+ }
39
+ exports.createSceneTickSystem = createSceneTickSystem;
40
+ //# sourceMappingURL=update-scheduler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-scheduler.js","sourceRoot":"","sources":["../../../../src/lib/babylon/scene/update-scheduler.ts"],"names":[],"mappings":";;;AAAA,0CAAgE;AAGhE,oGAAoG;AACpG,SAAgB,qBAAqB,CAAC,KAAY,EAAE,SAAuC,EAAE,OAAe;IAC1G,SAAS,eAAe;QACtB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,MAAM,cAAc,GAAG,KAAK,CAAC,YAAY,EAAE,QAAQ,IAAI,cAAO,CAAC,IAAI,EAAE,CAAA;QACrE,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAC/C,KAAK,CAAC,EAAE,CAAC,CAAC;YACR,KAAK;YACL,QAAQ,EACN,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjD,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,cAAc,CAAC;SAC5C,CAAC,CACH,CAAA;QAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAA;IACnE,CAAC;IAED,OAAO;QACL,sEAAsE;QACtE,8BAA8B;QAC9B,MAAM;YACJ,MAAM,YAAY,GAAG,eAAe,EAAE,CAAA;YACtC,MAAM,KAAK,GAAG,oBAAa,CAAC,GAAG,CAAA;YAC/B,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,CAAC,oBAAa,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,OAAO,CAAA;YAE5D,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,YAAY,EAAE;gBACpC,oFAAoF;gBACpF,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;oBAAE,OAAM;aACpC;QACH,CAAC;QACD,qEAAqE;QACrE,8EAA8E;QAC9E,UAAU;YACR,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,EAAE;gBAC/B,KAAK,CAAC,UAAU,EAAE,CAAA;aACnB;QACH,CAAC;KACF,CAAA;AACH,CAAC;AArCD,sDAqCC"}
@@ -0,0 +1,13 @@
1
+ export declare class LinearlyAnimatedScalar {
2
+ animationStart: number;
3
+ animationEnd: number;
4
+ finalValue: number;
5
+ initialValue: number;
6
+ animateTo(now: number, targetValue: number, linearSpeed: number): number;
7
+ getCurrentWeight(now: number): {
8
+ value: number;
9
+ µ: number;
10
+ };
11
+ getValue(now: number): number;
12
+ }
13
+ //# sourceMappingURL=time-based-animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time-based-animation.d.ts","sourceRoot":"","sources":["../../../src/lib/babylon/time-based-animation.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IACjC,cAAc,EAAE,MAAM,CAAI;IAC1B,YAAY,EAAE,MAAM,CAAI;IACxB,UAAU,EAAE,MAAM,CAAI;IACtB,YAAY,EAAE,MAAM,CAAI;IAExB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAgB/D,gBAAgB,CAAC,GAAG,EAAE,MAAM;;;;IAM5B,QAAQ,CAAC,GAAG,EAAE,MAAM;CAGrB"}