@hellpig/anarchy-engine 22.0.2 → 22.0.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 (371) hide show
  1. package/dist/Abstract/Entities/AbstractEntity.js.map +1 -1
  2. package/dist/Abstract/Factories/AbstractFactory.js.map +1 -1
  3. package/dist/Abstract/Factories/ReactiveFactory.js.map +1 -1
  4. package/dist/Abstract/Loaders/AbstractLoader.js.map +1 -1
  5. package/dist/Abstract/Mixins/WithWrapperIdMixin.js.map +1 -1
  6. package/dist/Abstract/Models/THtmlElementStyleDeclaration.d.ts +4 -4
  7. package/dist/Abstract/Registries/AbstractEntityAsyncRegistry.js.map +1 -1
  8. package/dist/Abstract/Registries/AbstractEntityRegistry.js.map +1 -1
  9. package/dist/Abstract/Registries/AbstractResourceAsyncRegistry.js.map +1 -1
  10. package/dist/Abstract/Registries/AbstractSimpleRegistry.js.map +1 -1
  11. package/dist/Abstract/Registries/AbstractWatcherRegistry.js.map +1 -1
  12. package/dist/Abstract/Registries/Mixin/Registry/WithBaseAccessorsRegistry.js.map +1 -1
  13. package/dist/Abstract/Registries/Mixin/Registry/WithReactiveRegistry.js.map +1 -1
  14. package/dist/Abstract/Services/AbstractService.js.map +1 -1
  15. package/dist/Abstract/Watchers/AbstractWatcher.js.map +1 -1
  16. package/dist/Abstract/Watchers/AbstractWatcherWithState.js.map +1 -1
  17. package/dist/Abstract/Wrappers/AbstractWrapper.js.map +1 -1
  18. package/dist/Actor/Adapters/ConfigToParams.js.map +1 -1
  19. package/dist/Actor/Adapters/EntityToConfig.js.map +1 -1
  20. package/dist/Actor/Adapters/Helpers/ActorStatesConfigToParams.js.map +1 -1
  21. package/dist/Actor/Adapters/Helpers/Model3dSettingsConfigToParams.js.map +1 -1
  22. package/dist/Actor/Entities/Actor/Actor.js.map +1 -1
  23. package/dist/Actor/Factories/ActorFactory.js.map +1 -1
  24. package/dist/Actor/Mixins/WithActorStates.js.map +1 -1
  25. package/dist/Actor/Registries/ActorRegistry.js.map +1 -1
  26. package/dist/Actor/Registries/Model3dToActorConnectionRegistry.js.map +1 -1
  27. package/dist/Actor/Services/ActorService.js.map +1 -1
  28. package/dist/Actor/TransformDrive/ActorTransformDrive.js.map +1 -1
  29. package/dist/Actor/Utils/ActorUtils.js.map +1 -1
  30. package/dist/Animations/Adapters/EntityToConfig.js.map +1 -1
  31. package/dist/Animations/Loader/AnimationsLoader.js.map +1 -1
  32. package/dist/Animations/Registries/AnimationsMetaInfoRegistry.js.map +1 -1
  33. package/dist/Animations/Registries/AnimationsResourceAsyncRegistry.js.map +1 -1
  34. package/dist/Animations/Services/AnimationsService.js.map +1 -1
  35. package/dist/Animations/Utils/SerializationUtils.js.map +1 -1
  36. package/dist/Audio/Adapters/AudioConfigToParams.js.map +1 -1
  37. package/dist/Audio/Adapters/EntityToConfig.js.map +1 -1
  38. package/dist/Audio/Factories/AudioFactory.js.map +1 -1
  39. package/dist/Audio/Loader/AudioLoader.js.map +1 -1
  40. package/dist/Audio/Registries/AudioListenersRegistry.js.map +1 -1
  41. package/dist/Audio/Registries/AudioMetaInfoRegistry.js.map +1 -1
  42. package/dist/Audio/Registries/AudioRegistry.js.map +1 -1
  43. package/dist/Audio/Registries/AudioResourceAsyncRegistry.js.map +1 -1
  44. package/dist/Audio/Services/AudioService.js.map +1 -1
  45. package/dist/Audio/TransformDrive/Audio3dTransformDrive.js.map +1 -1
  46. package/dist/Audio/Utils/AudioUtils.js.map +1 -1
  47. package/dist/Audio/Utils/DebugAudioRenderer.js.map +1 -1
  48. package/dist/Audio/Wrappers/AbstractAudioWrapper.js.map +1 -1
  49. package/dist/Audio/Wrappers/Audio3dWrapper.js.map +1 -1
  50. package/dist/Audio/Wrappers/AudioWrapper.js.map +1 -1
  51. package/dist/Camera/Adapters/ConfigToParams.js.map +1 -1
  52. package/dist/Camera/Adapters/EntityToConfig.js.map +1 -1
  53. package/dist/Camera/Factories/CameraFactory.js.map +1 -1
  54. package/dist/Camera/Registries/AbstractCameraRegistry.js.map +1 -1
  55. package/dist/Camera/Services/CameraService.js.map +1 -1
  56. package/dist/Camera/TransformDrive/CameraTransformDrive.js.map +1 -1
  57. package/dist/Camera/Utils/CameraUtils.js.map +1 -1
  58. package/dist/Camera/Wrappers/Accessors.js.map +1 -1
  59. package/dist/Camera/Wrappers/OrthographicCameraWrapper.js.map +1 -1
  60. package/dist/Camera/Wrappers/PerspectiveCameraWrapper.js.map +1 -1
  61. package/dist/Collisions/Mixins/WithCollisions.js.map +1 -1
  62. package/dist/Collisions/Services/BvhService.js.map +1 -1
  63. package/dist/Collisions/Services/CollisionsService.js.map +1 -1
  64. package/dist/Color/Adapters/EntityToConfig.js.map +1 -1
  65. package/dist/Color/Wrappers/ColorWrapper.js.map +1 -1
  66. package/dist/Context/AmbientContext/AmbientContext.js.map +1 -1
  67. package/dist/Controls/Adapters/ConfigToParams.js.map +1 -1
  68. package/dist/Controls/Adapters/EntityToConfig.js.map +1 -1
  69. package/dist/Controls/Factories/ControlsFactory.js.map +1 -1
  70. package/dist/Controls/Loop/ControlsLoopEffect.js.map +1 -1
  71. package/dist/Controls/Registries/ControlsRegistry.js.map +1 -1
  72. package/dist/Controls/Services/ControlsService.js.map +1 -1
  73. package/dist/Controls/Utils/ControlsUtils.js.map +1 -1
  74. package/dist/Controls/Wrappers/FpsControls/FpsControlsAccessors.js.map +1 -1
  75. package/dist/Controls/Wrappers/FpsControls/FpsControlsWrapper.js.map +1 -1
  76. package/dist/Controls/Wrappers/FpsControls/FpsControlsWrapperHelper.js.map +1 -1
  77. package/dist/Controls/Wrappers/OrbitControls/OrbitControlsAccessors.js.map +1 -1
  78. package/dist/Controls/Wrappers/OrbitControls/OrbitControlsWrapper.js.map +1 -1
  79. package/dist/Controls/Wrappers/OrbitControls/OrbitControlsWrapperHelper.js.map +1 -1
  80. package/dist/Distance/Utils/DistanceUtils.js.map +1 -1
  81. package/dist/EnvMap/Adapters/ConfigToParams.js.map +1 -1
  82. package/dist/EnvMap/Adapters/EntityToConfig.js.map +1 -1
  83. package/dist/EnvMap/Factories/EnvMapFactory.js.map +1 -1
  84. package/dist/EnvMap/Loader/EnvMapLoader.js.map +1 -1
  85. package/dist/EnvMap/Registries/EnvMapMetaInfoRegistry.js.map +1 -1
  86. package/dist/EnvMap/Registries/EnvMapRegistry.js.map +1 -1
  87. package/dist/EnvMap/Registries/EnvMapTextureAsyncRegistry.js.map +1 -1
  88. package/dist/EnvMap/Services/EnvMapService.js.map +1 -1
  89. package/dist/EnvMap/Wrappers/EnvMapWrapper.js.map +1 -1
  90. package/dist/Fog/Adapters/ConfigToParams.js.map +1 -1
  91. package/dist/Fog/Adapters/EntityToConfig.js.map +1 -1
  92. package/dist/Fog/Factories/FogFactory.js.map +1 -1
  93. package/dist/Fog/Registries/FogRegistry.js.map +1 -1
  94. package/dist/Fog/Services/FogService.js.map +1 -1
  95. package/dist/Fog/Wrappers/FogWrapper.js.map +1 -1
  96. package/dist/Fsm/Adapters/ConfigToParams.js.map +1 -1
  97. package/dist/Fsm/Adapters/EntityToConfig.js.map +1 -1
  98. package/dist/Fsm/Entities/FsmSource.js.map +1 -1
  99. package/dist/Fsm/Factories/FsmInstanceFactory.js.map +1 -1
  100. package/dist/Fsm/Factories/FsmSourceFactory.js.map +1 -1
  101. package/dist/Fsm/Registries/FsmInstanceRegistry.js.map +1 -1
  102. package/dist/Fsm/Registries/FsmSourceRegistry.js.map +1 -1
  103. package/dist/Fsm/Services/FsmInstanceService.js.map +1 -1
  104. package/dist/Fsm/Services/FsmService.js.map +1 -1
  105. package/dist/Fsm/Services/FsmSourceService.js.map +1 -1
  106. package/dist/Fsm/Wrappers/FsmWrapper.js.map +1 -1
  107. package/dist/Global/Decorators/ContainerDecorator.js.map +1 -1
  108. package/dist/Global/Utils/ContainerUtils.js.map +1 -1
  109. package/dist/Intersections/Adapters/ConfigToParams.js.map +1 -1
  110. package/dist/Intersections/Adapters/EntityToConfig.js.map +1 -1
  111. package/dist/Intersections/Factories/IntersectionsWatcherFactory.js.map +1 -1
  112. package/dist/Intersections/Registries/IntersectionsWatcherRegistry.js.map +1 -1
  113. package/dist/Intersections/Services/IntersectionsWatcherService.js.map +1 -1
  114. package/dist/Intersections/Utils/IntersectionsWatcherUtils.js.map +1 -1
  115. package/dist/Intersections/Watchers/AbstractIntersectionsWatcher.js.map +1 -1
  116. package/dist/Intersections/Watchers/IntersectionsCameraWatcher.js.map +1 -1
  117. package/dist/Intersections/Watchers/IntersectionsDirectionWatcher.js.map +1 -1
  118. package/dist/Keyboard/Factories/KeyWatcherFactory.js.map +1 -1
  119. package/dist/Keyboard/Registries/KeyWatcherRegistry.js.map +1 -1
  120. package/dist/Keyboard/Services/KeyboardService.js.map +1 -1
  121. package/dist/Keyboard/Utils/KeysRxJsUtils.js.map +1 -1
  122. package/dist/Keyboard/Utils/KeysUtils.js.map +1 -1
  123. package/dist/Keyboard/Watchers/KeyComboWatcher.js.map +1 -1
  124. package/dist/Keyboard/Watchers/KeyPressWatcher.js.map +1 -1
  125. package/dist/Keyboard/Watchers/KeyReleaseWatcher.js.map +1 -1
  126. package/dist/Kinematic/Adapters/ConfigToParams.js.map +1 -1
  127. package/dist/Kinematic/Adapters/EntityToConfig.js.map +1 -1
  128. package/dist/Kinematic/Constants/KinematicConstants.js.map +1 -1
  129. package/dist/Kinematic/Utils/KinematicUtils.js.map +1 -1
  130. package/dist/Light/Adapters/ConfigToParams.js.map +1 -1
  131. package/dist/Light/Adapters/EntityToConfig.js.map +1 -1
  132. package/dist/Light/Factories/LightFactory.js.map +1 -1
  133. package/dist/Light/Registries/LightRegistry.js.map +1 -1
  134. package/dist/Light/Services/LightService.js.map +1 -1
  135. package/dist/Light/TransformDrive/LightTransformDrive.js.map +1 -1
  136. package/dist/Light/Utils/Utils.js.map +1 -1
  137. package/dist/Light/Wrappers/AbstractLightWrapper.js.map +1 -1
  138. package/dist/Light/Wrappers/AmbientLightWrapper.js.map +1 -1
  139. package/dist/Light/Wrappers/DirectionalLightWrapper.js.map +1 -1
  140. package/dist/Light/Wrappers/HemisphereLightWrapper.js.map +1 -1
  141. package/dist/Light/Wrappers/LightWrapperHelper.js.map +1 -1
  142. package/dist/Light/Wrappers/PointLightWrapper.js.map +1 -1
  143. package/dist/Light/Wrappers/RectAreaLightWrapper.js.map +1 -1
  144. package/dist/Light/Wrappers/SpotLightWrapper.js.map +1 -1
  145. package/dist/LoadingManager/Factories/LoadingManagerFactory.js.map +1 -1
  146. package/dist/LoadingManager/Registries/LoadingManagerRegistry.js.map +1 -1
  147. package/dist/LoadingManager/Services/LoadingManagerService.js.map +1 -1
  148. package/dist/LoadingManager/Wrappers/LoadingManagerWrapper.js.map +1 -1
  149. package/dist/Loop/Constants/LoopsDefaultSettings.js.map +1 -1
  150. package/dist/Loop/Entities/DeltaCalculator.js.map +1 -1
  151. package/dist/Loop/Entities/Loop.js.map +1 -1
  152. package/dist/Loop/Factories/LoopFactory.js.map +1 -1
  153. package/dist/Loop/Registries/LoopRegistry.js.map +1 -1
  154. package/dist/Loop/Services/LoopService.js.map +1 -1
  155. package/dist/Loop/Utils/LoopDebugUtils.js.map +1 -1
  156. package/dist/Loop/Utils/LoopUtils.js.map +1 -1
  157. package/dist/Material/Adapters/ConfigToParams.js.map +1 -1
  158. package/dist/Material/Adapters/EntityToConfig.js.map +1 -1
  159. package/dist/Material/Constants/Material/MaterialMap.js.map +1 -1
  160. package/dist/Material/Factories/MaterialFactory.js.map +1 -1
  161. package/dist/Material/Mixins/WithMaterial.js.map +1 -1
  162. package/dist/Material/Registries/MaterialRegistry.js.map +1 -1
  163. package/dist/Material/Services/MaterialService.js.map +1 -1
  164. package/dist/Material/Utils/MaterialUtils.js.map +1 -1
  165. package/dist/Material/Wrappers/MaterialWrapper.js.map +1 -1
  166. package/dist/Math/Utils/AnglesUtils.js.map +1 -1
  167. package/dist/Math/Utils/DistanceUtils.js.map +1 -1
  168. package/dist/Measurements/Constants/Distance.js.map +1 -1
  169. package/dist/Measurements/Constants/Time.js.map +1 -1
  170. package/dist/Measurements/Utils/MeasurementsUtils.d.ts +1 -1
  171. package/dist/Measurements/Utils/MeasurementsUtils.js.map +1 -1
  172. package/dist/Mixins/GameObjects/Mixins/Movable/WithMoveBy2dMixin.js.map +1 -1
  173. package/dist/Mixins/GameObjects/Mixins/Movable/WithMoveBy3dMixin.js.map +1 -1
  174. package/dist/Mixins/GameObjects/Mixins/Movable/WithMoveBy4dMixin.js.map +1 -1
  175. package/dist/Mixins/GameObjects/Mixins/Movable/WithMoveByWMixin.js.map +1 -1
  176. package/dist/Mixins/GameObjects/Mixins/Movable/WithMoveByXMixin.js.map +1 -1
  177. package/dist/Mixins/GameObjects/Mixins/Movable/WithMoveByYMixin.js.map +1 -1
  178. package/dist/Mixins/GameObjects/Mixins/Movable/WithMoveByZMixin.js.map +1 -1
  179. package/dist/Mixins/GameObjects/Mixins/Position/WithPosition2dMixin.js.map +1 -1
  180. package/dist/Mixins/GameObjects/Mixins/Position/WithPosition3dMixin.js.map +1 -1
  181. package/dist/Mixins/GameObjects/Mixins/Position/WithPosition4dMixin.js.map +1 -1
  182. package/dist/Mixins/GameObjects/Mixins/Position/WithPositionMixin.js.map +1 -1
  183. package/dist/Mixins/GameObjects/Mixins/Rotatable/WithRotationByWMixin.js.map +1 -1
  184. package/dist/Mixins/GameObjects/Mixins/Rotatable/WithRotationByXMixin.js.map +1 -1
  185. package/dist/Mixins/GameObjects/Mixins/Rotatable/WithRotationByXyzMixin.js.map +1 -1
  186. package/dist/Mixins/GameObjects/Mixins/Rotatable/WithRotationByYMixin.js.map +1 -1
  187. package/dist/Mixins/GameObjects/Mixins/Rotatable/WithRotationByZMixin.js.map +1 -1
  188. package/dist/Mixins/GameObjects/Mixins/Rotatable/WithRotationMixin.js.map +1 -1
  189. package/dist/Mixins/GameObjects/Mixins/Scalable/WithScaleMixin.js.map +1 -1
  190. package/dist/Mixins/GameObjects/Mixins/WithObject3D.js.map +1 -1
  191. package/dist/Mixins/Generics/DestroyableMixin.js.map +1 -1
  192. package/dist/Mixins/Generics/ExtractSerializableRegistrableFields.js.map +1 -1
  193. package/dist/Mixins/Generics/WithActiveEntityServiceMixin.js.map +1 -1
  194. package/dist/Mixins/Generics/WithActiveMixin.js.map +1 -1
  195. package/dist/Mixins/Generics/WithNameAndNameAccessorsMixin.js.map +1 -1
  196. package/dist/Mixins/Services/WithCreateFromConfigService.js.map +1 -1
  197. package/dist/Mixins/Services/WithCreateService.js.map +1 -1
  198. package/dist/Mixins/Services/WithFactoryService.js.map +1 -1
  199. package/dist/Mixins/Services/WithRegistryService.js.map +1 -1
  200. package/dist/Mixins/Services/WithSceneGetterService.js.map +1 -1
  201. package/dist/Mixins/Services/WithSerializableEntities.js.map +1 -1
  202. package/dist/Mixins/Services/WithSerializeAllResources.js.map +1 -1
  203. package/dist/Models3d/Adapters/ConfigToParams.js.map +1 -1
  204. package/dist/Models3d/Adapters/EntityToConfig.js.map +1 -1
  205. package/dist/Models3d/Entities/Model3d.js.map +1 -1
  206. package/dist/Models3d/Factories/Models3dFactory.js.map +1 -1
  207. package/dist/Models3d/Loaders/Loader3dCore.js.map +1 -1
  208. package/dist/Models3d/Loaders/Models3dLoader.js.map +1 -1
  209. package/dist/Models3d/Mixins/WithModel3dEntities.js.map +1 -1
  210. package/dist/Models3d/Registries/Model3dRawToModel3dConnectionRegistry.js.map +1 -1
  211. package/dist/Models3d/Registries/Models3dMetaInfoRegistry.js.map +1 -1
  212. package/dist/Models3d/Registries/Models3dRegistry.js.map +1 -1
  213. package/dist/Models3d/Registries/Models3dResourceAsyncRegistry.js.map +1 -1
  214. package/dist/Models3d/Services/Models3dService.js.map +1 -1
  215. package/dist/Models3d/Utils/SerializationUtils.js.map +1 -1
  216. package/dist/Models3d/Utils/UtilsModel3d.js.map +1 -1
  217. package/dist/Models3d/Utils/UtilsModels3dService.js.map +1 -1
  218. package/dist/Models3d/Utils/UtilsPrimitiveModels3d.js.map +1 -1
  219. package/dist/Mouse/Factories/MouseClickWatcherFactory.js.map +1 -1
  220. package/dist/Mouse/Factories/MousePositionWatcherFactory.js.map +1 -1
  221. package/dist/Mouse/Registries/MouseClickWatcherRegistry.js.map +1 -1
  222. package/dist/Mouse/Registries/MousePositionWatcherRegistry.js.map +1 -1
  223. package/dist/Mouse/Services/MouseService.js.map +1 -1
  224. package/dist/Mouse/Utils/MouseUtils.js.map +1 -1
  225. package/dist/Mouse/Watchers/MouseClickWatcher.js.map +1 -1
  226. package/dist/Mouse/Watchers/MousePositionWatcher.js.map +1 -1
  227. package/dist/Particles/Adapters/ConfigToParams.js.map +1 -1
  228. package/dist/Particles/Adapters/EntityToConfig.js.map +1 -1
  229. package/dist/Particles/Factories/ParticlesFactory.js.map +1 -1
  230. package/dist/Particles/Registries/ParticlesRegistry.js.map +1 -1
  231. package/dist/Particles/Services/ParticlesService.js.map +1 -1
  232. package/dist/Particles/TransformDrive/ParticlesTransformDrive.js.map +1 -1
  233. package/dist/Particles/Wrappers/ParticlesWrapper.js.map +1 -1
  234. package/dist/Physics/Adapters/EntityToConfig.d.ts +1 -1
  235. package/dist/Physics/Adapters/EntityToConfig.js.map +1 -1
  236. package/dist/Physics/Adapters/PhysicsBodyConfigToParams.js.map +1 -1
  237. package/dist/Physics/Adapters/PhysicsWorldConfigToParams.js.map +1 -1
  238. package/dist/Physics/Constants/RigidBodyTypesMap.d.ts +1 -1
  239. package/dist/Physics/Constants/RigidBodyTypesMap.js +1 -1
  240. package/dist/Physics/Constants/RigidBodyTypesMap.js.map +1 -1
  241. package/dist/Physics/Entities/PhysicsBody.js.map +1 -1
  242. package/dist/Physics/Entities/PhysicsBodyUtils.d.ts +1 -1
  243. package/dist/Physics/Entities/PhysicsBodyUtils.js +1 -1
  244. package/dist/Physics/Entities/PhysicsBodyUtils.js.map +1 -1
  245. package/dist/Physics/Factories/PhysicsBodyFactory.js.map +1 -1
  246. package/dist/Physics/Mixins/WithPhysicsBodyEntities.js.map +1 -1
  247. package/dist/Physics/Models/TPhysicsWorldService.d.ts +1 -1
  248. package/dist/Physics/Registries/PhysicsBodyRegistry.js.map +1 -1
  249. package/dist/Physics/Renderers/PhysicsDebugRenderer.d.ts +1 -1
  250. package/dist/Physics/Renderers/PhysicsDebugRenderer.js.map +1 -1
  251. package/dist/Physics/Services/PhysicsBodyService.js.map +1 -1
  252. package/dist/Physics/Services/PhysicsWorldService.js +1 -1
  253. package/dist/Physics/Services/PhysicsWorldService.js.map +1 -1
  254. package/dist/Physics/Utils/ParamsUtils.js.map +1 -1
  255. package/dist/Physics/Utils/PhysicsMovementUtils.d.ts +2 -2
  256. package/dist/Physics/Utils/PhysicsMovementUtils.js +1 -1
  257. package/dist/Physics/Utils/PhysicsMovementUtils.js.map +1 -1
  258. package/dist/Renderer/Adapters/ConfigToParams.js.map +1 -1
  259. package/dist/Renderer/Adapters/EntityToConfig.js.map +1 -1
  260. package/dist/Renderer/Factories/RendererFactory.js.map +1 -1
  261. package/dist/Renderer/Loop/RendererLoopEffect.js.map +1 -1
  262. package/dist/Renderer/Mixins/WithThreeJsRendererParamsAccessors.js.map +1 -1
  263. package/dist/Renderer/Mixins/WithThreeJsRendererPropsAccessors.js.map +1 -1
  264. package/dist/Renderer/Registries/RendererRegistry.js.map +1 -1
  265. package/dist/Renderer/Services/RendererService.js.map +1 -1
  266. package/dist/Renderer/Wrappers/Accessors.js.map +1 -1
  267. package/dist/Renderer/Wrappers/RendererWrapper.js.map +1 -1
  268. package/dist/Scene/Adapters/ConfigToParams.js.map +1 -1
  269. package/dist/Scene/Adapters/EntityToConfig.js.map +1 -1
  270. package/dist/Scene/Factories/SceneFactory.js.map +1 -1
  271. package/dist/Scene/Registries/SceneRegistry.js.map +1 -1
  272. package/dist/Scene/Services/ScenesService.js.map +1 -1
  273. package/dist/Scene/Wrappers/SceneWrapper.js.map +1 -1
  274. package/dist/Space/Adapters/ConfigToParams.js.map +1 -1
  275. package/dist/Space/Adapters/EntityToConfig.js.map +1 -1
  276. package/dist/Space/Entities/Space.js.map +1 -1
  277. package/dist/Space/Entities/SpaceFromConfig.js.map +1 -1
  278. package/dist/Space/Factories/SpaceFactory.js.map +1 -1
  279. package/dist/Space/Registries/SpaceRegistry.js.map +1 -1
  280. package/dist/Space/Services/SpaceService.js.map +1 -1
  281. package/dist/Space/Utils/CanvasUtils.js.map +1 -1
  282. package/dist/Space/Utils/CreateEntitiesUtils.js.map +1 -1
  283. package/dist/Space/Utils/CreateLoopsUtils.js.map +1 -1
  284. package/dist/Space/Utils/LoadResourcesUtils.js.map +1 -1
  285. package/dist/Space/Utils/PrepareServicesUtils.js.map +1 -1
  286. package/dist/Space/Utils/SchemaValidationUtils.js.map +1 -1
  287. package/dist/Space/Validators/SchemasValidator.js.map +1 -1
  288. package/dist/Space/Validators/ValidateConfig.js.map +1 -1
  289. package/dist/Space/Validators/ValidateSpace.js.map +1 -1
  290. package/dist/Spatial/Adapters/ConfigToParams.js.map +1 -1
  291. package/dist/Spatial/Adapters/ConfigToParamsSpatialData.js.map +1 -1
  292. package/dist/Spatial/Adapters/EntityToConfig.js.map +1 -1
  293. package/dist/Spatial/Factories/SpatialGridFactory.js.map +1 -1
  294. package/dist/Spatial/Mixins/WithReactivePosition.js.map +1 -1
  295. package/dist/Spatial/Mixins/WithReactiveRotation.js.map +1 -1
  296. package/dist/Spatial/Mixins/WithSpatial.js.map +1 -1
  297. package/dist/Spatial/Mixins/WithUpdateSpatialCell.js.map +1 -1
  298. package/dist/Spatial/Registries/SpatialGridRegistry.js.map +1 -1
  299. package/dist/Spatial/Services/SpatialGridService.js.map +1 -1
  300. package/dist/Spatial/Services/SpatialHelper.js.map +1 -1
  301. package/dist/Spatial/Wrappers/SpatialCellWrapper.js.map +1 -1
  302. package/dist/Spatial/Wrappers/SpatialGridWrapper.js.map +1 -1
  303. package/dist/Text/Adapters/ConfigToParams.js.map +1 -1
  304. package/dist/Text/Adapters/EntityToConfig.js.map +1 -1
  305. package/dist/Text/Factories/TextFactory.js.map +1 -1
  306. package/dist/Text/Loop/TextLoopEffect.js.map +1 -1
  307. package/dist/Text/Registries/Text2dRegistry.js.map +1 -1
  308. package/dist/Text/Registries/Text2dRendererRegistry.js.map +1 -1
  309. package/dist/Text/Registries/Text3dRegistry.js.map +1 -1
  310. package/dist/Text/Registries/Text3dRendererRegistry.js.map +1 -1
  311. package/dist/Text/Registries/Text3dTextureRegistry.js.map +1 -1
  312. package/dist/Text/Renderers/Text2dRenderer.js.map +1 -1
  313. package/dist/Text/Renderers/Text3dRenderer.js.map +1 -1
  314. package/dist/Text/Renderers/TextRendererBuilder.js.map +1 -1
  315. package/dist/Text/Services/TextService.js.map +1 -1
  316. package/dist/Text/TransformDrive/TextTransformDrive.js.map +1 -1
  317. package/dist/Text/Utils/TextUtils.js.map +1 -1
  318. package/dist/Text/Wrappers/Accessors.js.map +1 -1
  319. package/dist/Text/Wrappers/Text2dWrapper.js.map +1 -1
  320. package/dist/Text/Wrappers/Text3dTextureWrapper.js.map +1 -1
  321. package/dist/Text/Wrappers/Text3dWrapper.js.map +1 -1
  322. package/dist/Text/Wrappers/TextTextureWrapper.js.map +1 -1
  323. package/dist/Text/Wrappers/TextWrapper.js.map +1 -1
  324. package/dist/Text/Wrappers/TextWrapperBuilder.js.map +1 -1
  325. package/dist/Text/Wrappers/TextWrapperHelper.js.map +1 -1
  326. package/dist/Texture/Loaders/TexturesLoader.js.map +1 -1
  327. package/dist/Texture/Registries/TextureMetaInfoRegistry.js.map +1 -1
  328. package/dist/Texture/Registries/TextureResourceAsyncRegistry.js.map +1 -1
  329. package/dist/Texture/Services/TextureService.js.map +1 -1
  330. package/dist/Texture/Utils/TextureServiceHelper.js.map +1 -1
  331. package/dist/ThreeLib/Utils/Object3dUtils.js.map +1 -1
  332. package/dist/TransformDrive/Adapters/EntityToConfig.js.map +1 -1
  333. package/dist/TransformDrive/Entities/Agents/AbstractTransformAgent.js.map +1 -1
  334. package/dist/TransformDrive/Entities/Agents/ConnectedTransformAgent.js.map +1 -1
  335. package/dist/TransformDrive/Entities/Agents/DefaultTransformAgent.js.map +1 -1
  336. package/dist/TransformDrive/Entities/Agents/KinematicTransformAgent.js.map +1 -1
  337. package/dist/TransformDrive/Entities/Agents/PhysicsTransformAgent.js.map +1 -1
  338. package/dist/TransformDrive/Entities/Connectors/DriveToTargetConnector.js.map +1 -1
  339. package/dist/TransformDrive/Entities/Drive/TransformDrive.js.map +1 -1
  340. package/dist/TransformDrive/Factories/TransformDriveFactory.js.map +1 -1
  341. package/dist/TransformDrive/Mixins/WithMutablePositionConnector.js.map +1 -1
  342. package/dist/TransformDrive/Mixins/WithMutableRotationConnector.js.map +1 -1
  343. package/dist/TransformDrive/Mixins/WithMutableScaleConnector.js.map +1 -1
  344. package/dist/TransformDrive/Mixins/WithProxyTransform.js.map +1 -1
  345. package/dist/TransformDrive/Registries/TransformDriveRegistry.js.map +1 -1
  346. package/dist/TransformDrive/Services/TransformDriveService.js.map +1 -1
  347. package/dist/TransformDrive/Utils/ActorDriveUtils.js.map +1 -1
  348. package/dist/TransformDrive/Utils/AgentUtils.js.map +1 -1
  349. package/dist/TransformDrive/Utils/KinematicAgentUtils.js.map +1 -1
  350. package/dist/TransformDrive/Utils/PhysicsTransformAgentUtils.d.ts +1 -1
  351. package/dist/TransformDrive/Utils/PhysicsTransformAgentUtils.js.map +1 -1
  352. package/dist/TransformDrive/Utils/TransformDriveUtils.js.map +1 -1
  353. package/dist/Utils/CheckUtils.js.map +1 -1
  354. package/dist/Utils/CoordsUtils.js.map +1 -1
  355. package/dist/Utils/DestroyUtils.js.map +1 -1
  356. package/dist/Utils/DomUtils.js.map +1 -1
  357. package/dist/Utils/EntityUtils.js.map +1 -1
  358. package/dist/Utils/RegistryAsyncUtils.js.map +1 -1
  359. package/dist/Utils/RegistryUtils.js.map +1 -1
  360. package/dist/Utils/RxJsUtils.js.map +1 -1
  361. package/dist/Utils/ScreenUtils.js.map +1 -1
  362. package/dist/Utils/TagsUtils.js.map +1 -1
  363. package/dist/Utils/TransformUtils.js.map +1 -1
  364. package/dist/Utils/WrapperHelpers.js.map +1 -1
  365. package/dist/assets/Loop.worker-D1bMWlsN.js.map +1 -1
  366. package/dist/packages/anarchy-shared/src/Utils/AsyncUtils.js.map +1 -1
  367. package/dist/packages/anarchy-shared/src/Utils/CssUtils.js.map +1 -1
  368. package/dist/packages/anarchy-shared/src/Utils/ObjectUtils.js.map +1 -1
  369. package/legal/NOTICE.md +1 -1
  370. package/legal/THIRD_PARTY_LICENSES.md +1 -1
  371. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LightWrapperHelper.js","sources":["../../../src/Light/Wrappers/LightWrapperHelper.ts"],"sourcesContent":["import type {\n TAbstractLightParams,\n TAnyLight,\n TDirectionalLight,\n TLightParams,\n TPointLight,\n TShadowCameraParams,\n TShadowOrthographicCameraParams,\n TShadowPerspectiveCameraParams,\n TSpotLight\n} from '@Anarchy/Engine/Light/Models';\nimport { isDirectionalLight, isPointLight, isSpotLight } from '@Anarchy/Engine/Light/Utils';\nimport type { TWriteable } from '@Anarchy/Shared/Utils';\nimport { isDefined, isNotDefined } from '@Anarchy/Shared/Utils';\nimport { Vector3 } from 'three';\n\nexport function applyShadowParams<T extends TAnyLight, P extends TLightParams>(params: P, entity: TWriteable<T>): void {\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(params.castShadow)) entity.castShadow = params.castShadow;\n\n if (isDefined(params.shadow)) {\n if (isDefined(params.shadow.mapSize)) entity.shadow?.mapSize.copy(params.shadow.mapSize);\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(params.shadow.normalBias) && entity.shadow) entity.shadow.normalBias = params.shadow.normalBias;\n if (isDefined(params.shadow?.camera)) applyShadowCameraParams(params, entity);\n }\n}\n\nfunction applyShadowCameraParams(params: TAbstractLightParams, entity: TWriteable<TAnyLight>): void {\n const { shadow } = params;\n if (isNotDefined(shadow?.camera)) return;\n\n if (isDirectionalLight(entity)) applyDirectionalLightShadowCameraParams(params, entity);\n if (isPointLight(entity)) applyPointLightShadowCameraParams(params, entity);\n if (isSpotLight(entity)) applySpotLightShadowCameraParams(params, entity);\n}\n\nfunction applyCommonCameraParams(params: TShadowCameraParams, entity: TWriteable<TDirectionalLight | TPointLight | TSpotLight>): void {\n if (isNotDefined(params)) return;\n\n const { far, near, lookAt, up, layers, zoom } = params;\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(far)) entity.shadow.camera.far = far;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(near)) entity.shadow.camera.near = near;\n\n if (isDefined(lookAt)) entity.shadow.camera.lookAt(lookAt);\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(up)) entity.shadow.camera.up = new Vector3().copy(params.up ?? { x: 0, y: 1, z: 0 });\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(layers) && isDefined(entity.shadow.camera.layers?.mask)) entity.shadow.camera.layers.mask = layers ?? 1;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(zoom)) entity.shadow.camera.zoom = zoom;\n}\n\nfunction applyOrthographicCameraParams(params: TShadowOrthographicCameraParams, entity: TWriteable<TDirectionalLight>): void {\n const { left, right, top, bottom } = params;\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(left)) entity.shadow.camera.left = left;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(right)) entity.shadow.camera.right = right;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(bottom)) entity.shadow.camera.bottom = bottom;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(top)) entity.shadow.camera.top = top;\n}\n\nfunction applyPerspectiveCameraParams(params: TShadowPerspectiveCameraParams, entity: TWriteable<TPointLight | TSpotLight>): void {\n const { filmGauge, filmOffset, focus, fov } = params;\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(filmGauge)) entity.shadow.camera.filmGauge = filmGauge;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(filmOffset)) entity.shadow.camera.filmOffset = filmOffset;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(focus)) entity.shadow.camera.focus = focus;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(fov)) entity.shadow.camera.fov = fov;\n}\n\nfunction applyDirectionalLightShadowCameraParams({ shadow }: TAbstractLightParams, entity: TWriteable<TDirectionalLight>): void {\n if (isNotDefined(shadow?.camera)) return;\n\n applyCommonCameraParams(shadow.camera, entity);\n applyOrthographicCameraParams(shadow.camera, entity);\n}\n\nfunction applyPointLightShadowCameraParams({ shadow }: TAbstractLightParams, entity: TWriteable<TPointLight>): void {\n if (isNotDefined(shadow?.camera)) return;\n\n applyCommonCameraParams(shadow.camera, entity);\n applyPerspectiveCameraParams(shadow.camera, entity);\n}\n\nfunction applySpotLightShadowCameraParams({ shadow }: TAbstractLightParams, entity: TWriteable<TSpotLight>): void {\n if (isNotDefined(shadow?.camera)) return;\n\n applyCommonCameraParams(shadow.camera, entity);\n applyPerspectiveCameraParams(shadow.camera, entity);\n}\n"],"names":["applyShadowParams","params","entity","isDefined","castShadow","shadow","mapSize","copy","normalBias","camera","isNotDefined","isDirectionalLight","applyCommonCameraParams","left","right","top","bottom","applyOrthographicCameraParams","applyDirectionalLightShadowCameraParams","isPointLight","applyPerspectiveCameraParams","applyPointLightShadowCameraParams","isSpotLight","applySpotLightShadowCameraParams","applyShadowCameraParams","far","near","lookAt","up","layers","zoom","Vector3","x","y","z","mask","filmGauge","filmOffset","focus","fov"],"mappings":"gMAgBO,SAASA,kBAA+DC,OAAWC,QAEpFC,UAAUF,OAAOG,cAAaF,OAAOE,WAAaH,OAAOG,YAEzDD,UAAUF,OAAOI,UACfF,UAAUF,OAAOI,OAAOC,UAAUJ,OAAOG,QAAQC,QAAQC,KAAKN,OAAOI,OAAOC,SAG5EH,UAAUF,OAAOI,OAAOG,aAAeN,OAAOG,SAAQH,OAAOG,OAAOG,WAAaP,OAAOI,OAAOG,YAC/FL,UAAUF,OAAOI,QAAQI,SAIjC,SAAiCR,OAA8BC,QAC7D,MAAMG,OAAEA,QAAWJ,OACfS,aAAaL,QAAQI,UAErBE,mBAAmBT,SAm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UxB,KAAKN,OAAO2B,IAAM,CAAEI,EAAG,EAAGC,EAAG,EAAGC,EAAG,KAG1F/B,UAAU0B,SAAW1B,UAAUD,OAAOG,OAAOI,OAAOoB,QAAQM,QAAOjC,OAAOG,OAAOI,OAAOoB,OAAOM,KAAON,QAAU,GAEhH1B,UAAU2B,QAAO5B,OAAOG,OAAOI,OAAOqB,KAAOA,KACnD,CAeA,SAASV,6BAA6BnB,OAAwCC,QAC5E,MAAMkC,UAAEA,UAAAC,WAAWA,WAAAC,MAAYA,MAAAC,IAAOA,KAAQtC,OAG1CE,UAAUiC,aAAYlC,OAAOG,OAAOI,OAAO2B,UAAYA,WAEvDjC,UAAUkC,cAAanC,OAAOG,OAAOI,OAAO4B,WAAaA,YAEzDlC,UAAUmC,SAAQpC,OAAOG,OAAOI,OAAO6B,MAAQA,OAE/CnC,UAAUoC,OAAMrC,OAAOG,OAAOI,OAAO8B,IAAMA,IACjD"}
1
+ {"version":3,"file":"LightWrapperHelper.js","sources":["../../../src/Light/Wrappers/LightWrapperHelper.ts"],"sourcesContent":["import type {\n TAbstractLightParams,\n TAnyLight,\n TDirectionalLight,\n TLightParams,\n TPointLight,\n TShadowCameraParams,\n TShadowOrthographicCameraParams,\n TShadowPerspectiveCameraParams,\n TSpotLight\n} from '@hellpig/anarchy-engine/Light/Models';\nimport { isDirectionalLight, isPointLight, isSpotLight } from '@hellpig/anarchy-engine/Light/Utils';\nimport type { TWriteable } from '@hellpig/anarchy-shared/Utils';\nimport { isDefined, isNotDefined } from '@hellpig/anarchy-shared/Utils';\nimport { Vector3 } from 'three';\n\nexport function applyShadowParams<T extends TAnyLight, P extends TLightParams>(params: P, entity: TWriteable<T>): void {\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(params.castShadow)) entity.castShadow = params.castShadow;\n\n if (isDefined(params.shadow)) {\n if (isDefined(params.shadow.mapSize)) entity.shadow?.mapSize.copy(params.shadow.mapSize);\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(params.shadow.normalBias) && entity.shadow) entity.shadow.normalBias = params.shadow.normalBias;\n if (isDefined(params.shadow?.camera)) applyShadowCameraParams(params, entity);\n }\n}\n\nfunction applyShadowCameraParams(params: TAbstractLightParams, entity: TWriteable<TAnyLight>): void {\n const { shadow } = params;\n if (isNotDefined(shadow?.camera)) return;\n\n if (isDirectionalLight(entity)) applyDirectionalLightShadowCameraParams(params, entity);\n if (isPointLight(entity)) applyPointLightShadowCameraParams(params, entity);\n if (isSpotLight(entity)) applySpotLightShadowCameraParams(params, entity);\n}\n\nfunction applyCommonCameraParams(params: TShadowCameraParams, entity: TWriteable<TDirectionalLight | TPointLight | TSpotLight>): void {\n if (isNotDefined(params)) return;\n\n const { far, near, lookAt, up, layers, zoom } = params;\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(far)) entity.shadow.camera.far = far;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(near)) entity.shadow.camera.near = near;\n\n if (isDefined(lookAt)) entity.shadow.camera.lookAt(lookAt);\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(up)) entity.shadow.camera.up = new Vector3().copy(params.up ?? { x: 0, y: 1, z: 0 });\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(layers) && isDefined(entity.shadow.camera.layers?.mask)) entity.shadow.camera.layers.mask = layers ?? 1;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(zoom)) entity.shadow.camera.zoom = zoom;\n}\n\nfunction applyOrthographicCameraParams(params: TShadowOrthographicCameraParams, entity: TWriteable<TDirectionalLight>): void {\n const { left, right, top, bottom } = params;\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(left)) entity.shadow.camera.left = left;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(right)) entity.shadow.camera.right = right;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(bottom)) entity.shadow.camera.bottom = bottom;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(top)) entity.shadow.camera.top = top;\n}\n\nfunction applyPerspectiveCameraParams(params: TShadowPerspectiveCameraParams, entity: TWriteable<TPointLight | TSpotLight>): void {\n const { filmGauge, filmOffset, focus, fov } = params;\n\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(filmGauge)) entity.shadow.camera.filmGauge = filmGauge;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(filmOffset)) entity.shadow.camera.filmOffset = filmOffset;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(focus)) entity.shadow.camera.focus = focus;\n // eslint-disable-next-line functional/immutable-data\n if (isDefined(fov)) entity.shadow.camera.fov = fov;\n}\n\nfunction applyDirectionalLightShadowCameraParams({ shadow }: TAbstractLightParams, entity: TWriteable<TDirectionalLight>): void {\n if (isNotDefined(shadow?.camera)) return;\n\n applyCommonCameraParams(shadow.camera, entity);\n applyOrthographicCameraParams(shadow.camera, entity);\n}\n\nfunction applyPointLightShadowCameraParams({ shadow }: TAbstractLightParams, entity: TWriteable<TPointLight>): void {\n if (isNotDefined(shadow?.camera)) return;\n\n applyCommonCameraParams(shadow.camera, entity);\n applyPerspectiveCameraParams(shadow.camera, entity);\n}\n\nfunction applySpotLightShadowCameraParams({ shadow }: TAbstractLightParams, entity: TWriteable<TSpotLight>): void {\n if (isNotDefined(shadow?.camera)) return;\n\n applyCommonCameraParams(shadow.camera, entity);\n applyPerspectiveCameraParams(shadow.camera, entity);\n}\n"],"names":["applyShadowParams","params","entity","isDefined","castShadow","shadow","mapSize","copy","normalBias","camera","isNotDefined","isDirectionalLight","applyCommonCameraParams","left","right","top","bottom","applyOrthographicCameraParams","applyDirectionalLightShadowCameraParams","isPointLight","applyPerspectiveCameraParams","applyPointLightShadowCameraParams","isSpotLight","applySpotLightShadowCameraParams","applyShadowCameraParams","far","near","lookAt","up","layers","zoom","Vector3","x","y","z","mask","filmGauge","filmOffset","focus","fov"],"mappings":"gMAgBO,SAASA,kBAA+DC,OAAWC,QAEpFC,UAAUF,OAAOG,cAAaF,OAAOE,WAAaH,OAAOG,YAEzDD,UAAUF,O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C,KAAKA,KAAAC,OAAMA,UAAQC,GAAAC,OAAIA,OAAAC,KAAQA,MAAS7B,OAG5CE,UAAUsB,OAAMvB,OAAOG,OAAOI,OAAOgB,IAAMA,KAE3CtB,UAAUuB,QAAOxB,OAAOG,OAAOI,OAAOiB,KAAOA,MAE7CvB,UAAUwB,gBAAgBtB,OAAOI,OAAOkB,OAAOA,QAE/CxB,UAAUyB,MAAK1B,OAAOG,OAAOI,OAAOmB,IAAK,IAAIG,SAAUxB,KAAKN,OAAO2B,IAAM,CAAEI,EAAG,EAAGC,EAAG,EAAGC,EAAG,KAG1F/B,UAAU0B,SAAW1B,UAAUD,OAAOG,OAAOI,OAAOoB,QAAQM,QAAOjC,OAAOG,OAAOI,OAAOoB,OAAOM,KAAON,QAAU,GAEhH1B,UAAU2B,QAAO5B,OAAOG,OAAOI,OAAOqB,KAAOA,KACnD,CAeA,SAASV,6BAA6BnB,OAAwCC,QAC5E,MAAMkC,UAAEA,UAAAC,WAAWA,WAAAC,MAAYA,MAAAC,IAAOA,KAAQtC,OAG1CE,UAAUiC,aAAYlC,OAAOG,OAAOI,OAAO2B,UAAYA,WAEvDjC,UAAUkC,cAAanC,OAAOG,OAAOI,OAAO4B,WAAaA,YAEzDlC,UAAUmC,SAAQpC,OAAOG,OAAOI,OAAO6B,MAAQA,OAE/CnC,UAAUoC,OAAMrC,OAAOG,OAAOI,OAAO8B,IAAMA,IACjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"PointLightWrapper.js","sources":["../../../src/Light/Wrappers/PointLightWrapper.ts"],"sourcesContent":["import type { TAbstractLightWrapper, TLightServiceDependencies, TPointLight, TPointLightParams } from '@Anarchy/Engine/Light/Models';\nimport { PointLight } from 'three';\n\nimport { AbstractLightWrapper } from './AbstractLightWrapper';\n\nexport function PointLightWrapper(params: TPointLightParams, dependencies: TLightServiceDependencies): TAbstractLightWrapper<TPointLight> {\n const entity: TPointLight = new PointLight(params.color, params.intensity, params.distance, params.decay);\n return AbstractLightWrapper(entity, params, dependencies);\n}\n"],"names":["PointLightWrapper","params","dependencies","entity","PointLight","color","intensity","distance","decay","AbstractLightWrapper"],"mappings":"0FAKO,SAASA,kBAAkBC,OAA2BC,cAC3D,MAAMC,OAAsB,IAAIC,WAAWH,OAAOI,MAAOJ,OAAOK,UAAWL,OAAOM,SAAUN,OAAOO,OACnG,OAAOC,qBAAqBN,OAAQF,OAAQC,aAC9C"}
1
+ {"version":3,"file":"PointLightWrapper.js","sources":["../../../src/Light/Wrappers/PointLightWrapper.ts"],"sourcesContent":["import type { TAbstractLightWrapper, TLightServiceDependencies, TPointLight, TPointLightParams } from '@hellpig/anarchy-engine/Light/Models';\nimport { PointLight } from 'three';\n\nimport { AbstractLightWrapper } from './AbstractLightWrapper';\n\nexport function PointLightWrapper(params: TPointLightParams, dependencies: TLightServiceDependencies): TAbstractLightWrapper<TPointLight> {\n const entity: TPointLight = new PointLight(params.color, params.intensity, params.distance, params.decay);\n return AbstractLightWrapper(entity, params, dependencies);\n}\n"],"names":["PointLightWrapper","params","dependencies","entity","PointLight","color","intensity","distance","decay","AbstractLightWrapper"],"mappings":"0FAKO,SAASA,kBAAkBC,OAA2BC,cAC3D,MAAMC,OAAsB,IAAIC,WAAWH,OAAOI,MAAOJ,OAAOK,UAAWL,OAAOM,SAAUN,OAAOO,OACnG,OAAOC,qBAAqBN,OAAQF,OAAQC,aAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"RectAreaLightWrapper.js","sources":["../../../src/Light/Wrappers/RectAreaLightWrapper.ts"],"sourcesContent":["import type { TAbstractLightWrapper, TLightServiceDependencies, TRectAreaLight, TRectAreaLightParams } from '@Anarchy/Engine/Light/Models';\nimport { RectAreaLight } from 'three';\n\nimport { AbstractLightWrapper } from './AbstractLightWrapper';\n\nexport function RectAreaLightWrapper(params: TRectAreaLightParams, dependencies: TLightServiceDependencies): TAbstractLightWrapper<TRectAreaLight> {\n const entity: TRectAreaLight = new RectAreaLight(params.color, params.intensity, params.height, params.width);\n return AbstractLightWrapper(entity, params, dependencies);\n}\n"],"names":["RectAreaLightWrapper","params","dependencies","entity","RectAreaLight","color","intensity","height","width","AbstractLightWrapper"],"mappings":"6FAKO,SAASA,qBAAqBC,OAA8BC,cACjE,MAAMC,OAAyB,IAAIC,cAAcH,OAAOI,MAAOJ,OAAOK,UAAWL,OAAOM,OAAQN,OAAOO,OACvG,OAAOC,qBAAqBN,OAAQF,OAAQC,aAC9C"}
1
+ {"version":3,"file":"RectAreaLightWrapper.js","sources":["../../../src/Light/Wrappers/RectAreaLightWrapper.ts"],"sourcesContent":["import type { TAbstractLightWrapper, TLightServiceDependencies, TRectAreaLight, TRectAreaLightParams } from '@hellpig/anarchy-engine/Light/Models';\nimport { RectAreaLight } from 'three';\n\nimport { AbstractLightWrapper } from './AbstractLightWrapper';\n\nexport function RectAreaLightWrapper(params: TRectAreaLightParams, dependencies: TLightServiceDependencies): TAbstractLightWrapper<TRectAreaLight> {\n const entity: TRectAreaLight = new RectAreaLight(params.color, params.intensity, params.height, params.width);\n return AbstractLightWrapper(entity, params, dependencies);\n}\n"],"names":["RectAreaLightWrapper","params","dependencies","entity","RectAreaLight","color","intensity","height","width","AbstractLightWrapper"],"mappings":"6FAKO,SAASA,qBAAqBC,OAA8BC,cACjE,MAAMC,OAAyB,IAAIC,cAAcH,OAAOI,MAAOJ,OAAOK,UAAWL,OAAOM,OAAQN,OAAOO,OACvG,OAAOC,qBAAqBN,OAAQF,OAAQC,aAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpotLightWrapper.js","sources":["../../../src/Light/Wrappers/SpotLightWrapper.ts"],"sourcesContent":["import type { TAbstractLightWrapper, TLightServiceDependencies, TSpotLight, TSpotLightParams } from '@Anarchy/Engine/Light/Models';\nimport { SpotLight } from 'three';\n\nimport { AbstractLightWrapper } from './AbstractLightWrapper';\n\nexport function SpotLightWrapper(params: TSpotLightParams, dependencies: TLightServiceDependencies): TAbstractLightWrapper<TSpotLight> {\n const entity: TSpotLight = new SpotLight(params.color, params.intensity, params.distance, params.angle, params.penumbra, params.decay);\n return AbstractLightWrapper(entity, params, dependencies);\n}\n"],"names":["SpotLightWrapper","params","dependencies","entity","SpotLight","color","intensity","distance","angle","penumbra","decay","AbstractLightWrapper"],"mappings":"yFAKO,SAASA,iBAAiBC,OAA0BC,cACzD,MAAMC,OAAqB,IAAIC,UAAUH,OAAOI,MAAOJ,OAAOK,UAAWL,OAAOM,SAAUN,OAAOO,MAAOP,OAAOQ,SAAUR,OAAOS,OAChI,OAAOC,qBAAqBR,OAAQF,OAAQC,aAC9C"}
1
+ {"version":3,"file":"SpotLightWrapper.js","sources":["../../../src/Light/Wrappers/SpotLightWrapper.ts"],"sourcesContent":["import type { TAbstractLightWrapper, TLightServiceDependencies, TSpotLight, TSpotLightParams } from '@hellpig/anarchy-engine/Light/Models';\nimport { SpotLight } from 'three';\n\nimport { AbstractLightWrapper } from './AbstractLightWrapper';\n\nexport function SpotLightWrapper(params: TSpotLightParams, dependencies: TLightServiceDependencies): TAbstractLightWrapper<TSpotLight> {\n const entity: TSpotLight = new SpotLight(params.color, params.intensity, params.distance, params.angle, params.penumbra, params.decay);\n return AbstractLightWrapper(entity, params, dependencies);\n}\n"],"names":["SpotLightWrapper","params","dependencies","entity","SpotLight","color","intensity","distance","angle","penumbra","decay","AbstractLightWrapper"],"mappings":"yFAKO,SAASA,iBAAiBC,OAA0BC,cACzD,MAAMC,OAAqB,IAAIC,UAAUH,OAAOI,MAAOJ,OAAOK,UAAWL,OAAOM,SAAUN,OAAOO,MAAOP,OAAOQ,SAAUR,OAAOS,OAChI,OAAOC,qBAAqBR,OAAQF,OAAQC,aAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingManagerFactory.js","sources":["../../../src/LoadingManager/Factories/LoadingManagerFactory.ts"],"sourcesContent":["import { FactoryType, ReactiveFactory } from '@Anarchy/Engine/Abstract';\nimport type { TLoadingManagerFactory } from '@Anarchy/Engine/LoadingManager/Models';\nimport { LoadingManagerWrapper } from '@Anarchy/Engine/LoadingManager/Wrappers';\n\nexport function LoadingManagerFactory(): TLoadingManagerFactory {\n return ReactiveFactory(FactoryType.LoadingManager, LoadingManagerWrapper);\n}\n"],"names":["LoadingManagerFactory","ReactiveFactory","FactoryType","LoadingManager","LoadingManagerWrapper"],"mappings":"kNAIO,SAASA,wBACd,OAAOC,gBAAgBC,YAAYC,eAAgBC,sBACrD"}
1
+ {"version":3,"file":"LoadingManagerFactory.js","sources":["../../../src/LoadingManager/Factories/LoadingManagerFactory.ts"],"sourcesContent":["import { FactoryType, ReactiveFactory } from '@hellpig/anarchy-engine/Abstract';\nimport type { TLoadingManagerFactory } from '@hellpig/anarchy-engine/LoadingManager/Models';\nimport { LoadingManagerWrapper } from '@hellpig/anarchy-engine/LoadingManager/Wrappers';\n\nexport function LoadingManagerFactory(): TLoadingManagerFactory {\n return ReactiveFactory(FactoryType.LoadingManager, LoadingManagerWrapper);\n}\n"],"names":["LoadingManagerFactory","ReactiveFactory","FactoryType","LoadingManager","LoadingManagerWrapper"],"mappings":"kNAIO,SAASA,wBACd,OAAOC,gBAAgBC,YAAYC,eAAgBC,sBACrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingManagerRegistry.js","sources":["../../../src/LoadingManager/Registries/LoadingManagerRegistry.ts"],"sourcesContent":["import { RegistryType } from '@Anarchy/Engine/Abstract/Constants';\nimport { AbstractEntityRegistry } from '@Anarchy/Engine/Abstract/Registries';\nimport type { TLoadingManagerRegistry, TLoadingManagerWrapper } from '@Anarchy/Engine/LoadingManager/Models';\n\nexport function LoadingManagerRegistry(): TLoadingManagerRegistry {\n return AbstractEntityRegistry<TLoadingManagerWrapper>(RegistryType.LoadingManager);\n}\n"],"names":["LoadingManagerRegistry","AbstractEntityRegistry","RegistryType","LoadingManager"],"mappings":"2JAIO,SAASA,yBACd,OAAOC,uBAA+CC,aAAaC,eACrE"}
1
+ {"version":3,"file":"LoadingManagerRegistry.js","sources":["../../../src/LoadingManager/Registries/LoadingManagerRegistry.ts"],"sourcesContent":["import { RegistryType } from '@hellpig/anarchy-engine/Abstract/Constants';\nimport { AbstractEntityRegistry } from '@hellpig/anarchy-engine/Abstract/Registries';\nimport type { TLoadingManagerRegistry, TLoadingManagerWrapper } from '@hellpig/anarchy-engine/LoadingManager/Models';\n\nexport function LoadingManagerRegistry(): TLoadingManagerRegistry {\n return AbstractEntityRegistry<TLoadingManagerWrapper>(RegistryType.LoadingManager);\n}\n"],"names":["LoadingManagerRegistry","AbstractEntityRegistry","RegistryType","LoadingManager"],"mappings":"2JAIO,SAASA,yBACd,OAAOC,uBAA+CC,aAAaC,eACrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingManagerService.js","sources":["../../../src/LoadingManager/Services/LoadingManagerService.ts"],"sourcesContent":["import type { TAbstractService } from '@Anarchy/Engine/Abstract';\nimport { AbstractService } from '@Anarchy/Engine/Abstract';\nimport { DEFAULT_SPACE_LOADING_MANAGER_NAME } from '@Anarchy/Engine/LoadingManager/Constants';\nimport type {\n TLoadingManagerFactory,\n TLoadingManagerRegistry,\n TLoadingManagerService,\n TLoadingManagerServiceWithCreate,\n TLoadingManagerServiceWithFactory,\n TLoadingManagerServiceWithRegistry,\n TLoadingManagerWrapper\n} from '@Anarchy/Engine/LoadingManager/Models';\nimport type { TDisposable } from '@Anarchy/Engine/Mixins';\nimport { withCreateServiceMixin, withFactoryService, withRegistryService } from '@Anarchy/Engine/Mixins';\nimport { mergeAll } from '@Anarchy/Engine/Utils';\nimport type { Subscription } from 'rxjs';\n\nexport function LoadingManagerService(factory: TLoadingManagerFactory, registry: TLoadingManagerRegistry): TLoadingManagerService {\n const factorySub$: Subscription = factory.entityCreated$.subscribe((manager: TLoadingManagerWrapper): void => registry.add(manager));\n const disposable: ReadonlyArray<TDisposable> = [registry, factory, factorySub$];\n const abstractService: TAbstractService = AbstractService(disposable);\n\n const withCreateService: TLoadingManagerServiceWithCreate = withCreateServiceMixin(factory, undefined);\n const withFactory: TLoadingManagerServiceWithFactory = withFactoryService(factory);\n const withRegistry: TLoadingManagerServiceWithRegistry = withRegistryService(registry);\n\n function getDefault(): TLoadingManagerWrapper {\n return registry.getByName(DEFAULT_SPACE_LOADING_MANAGER_NAME);\n }\n\n return mergeAll(abstractService, withCreateService, withFactory, withRegistry, { getDefault });\n}\n"],"names":["LoadingManagerService","factory","registry","factorySub$","entityCreated$","subscribe","manager","add","abstractService","AbstractService","withCreateService","withCreateServiceMixin","withFactory","withFactoryService","withRegistry","withRegistryService","mergeAll","getDefault","getByName","DEFAULT_SPACE_LOADING_MANAGER_NAME"],"mappings":"icAiBO,SAASA,sBAAsBC,QAAiCC,UACrE,MAAMC,YAA4BF,QAAQG,eAAeC,UAAWC,SAA0CJ,SAASK,IAAID,UAErHE,gBAAoCC,gBADK,CAACP,SAAUD,QAASE,cAG7DO,kBAAsDC,uBAAuBV,gBAC7EW,YAAiDC,mBAAmBZ,SACpEa,aAAmDC,oBAAoBb,UAM7E,OAAOc,SAASR,gBAAiBE,kBAAmBE,YAAaE,aAAc,CAAEG,WAJjF,WACE,OAAOf,SAASgB,UAAUC,mCAC5B,GAGF"}
1
+ {"version":3,"file":"LoadingManagerService.js","sources":["../../../src/LoadingManager/Services/LoadingManagerService.ts"],"sourcesContent":["import type { TAbstractService } from '@hellpig/anarchy-engine/Abstract';\nimport { AbstractService } from '@hellpig/anarchy-engine/Abstract';\nimport { DEFAULT_SPACE_LOADING_MANAGER_NAME } from '@hellpig/anarchy-engine/LoadingManager/Constants';\nimport type {\n TLoadingManagerFactory,\n TLoadingManagerRegistry,\n TLoadingManagerService,\n TLoadingManagerServiceWithCreate,\n TLoadingManagerServiceWithFactory,\n TLoadingManagerServiceWithRegistry,\n TLoadingManagerWrapper\n} from '@hellpig/anarchy-engine/LoadingManager/Models';\nimport type { TDisposable } from '@hellpig/anarchy-engine/Mixins';\nimport { withCreateServiceMixin, withFactoryService, withRegistryService } from '@hellpig/anarchy-engine/Mixins';\nimport { mergeAll } from '@hellpig/anarchy-engine/Utils';\nimport type { Subscription } from 'rxjs';\n\nexport function LoadingManagerService(factory: TLoadingManagerFactory, registry: TLoadingManagerRegistry): TLoadingManagerService {\n const factorySub$: Subscription = factory.entityCreated$.subscribe((manager: TLoadingManagerWrapper): void => registry.add(manager));\n const disposable: ReadonlyArray<TDisposable> = [registry, factory, factorySub$];\n const abstractService: TAbstractService = AbstractService(disposable);\n\n const withCreateService: TLoadingManagerServiceWithCreate = withCreateServiceMixin(factory, undefined);\n const withFactory: TLoadingManagerServiceWithFactory = withFactoryService(factory);\n const withRegistry: TLoadingManagerServiceWithRegistry = withRegistryService(registry);\n\n function getDefault(): TLoadingManagerWrapper {\n return registry.getByName(DEFAULT_SPACE_LOADING_MANAGER_NAME);\n }\n\n return mergeAll(abstractService, withCreateService, withFactory, withRegistry, { getDefault });\n}\n"],"names":["LoadingManagerService","factory","registry","factorySub$","entityCreated$","subscribe","manager","add","abstractService","AbstractService","withCreateService","withCreateServiceMixin","withFactory","withFactoryService","withRegistry","withRegistryService","mergeAll","getDefault","getByName","DEFAULT_SPACE_LOADING_MANAGER_NAME"],"mappings":"icAiBO,SAASA,sBAAsBC,QAAiCC,UACrE,MAAMC,YAA4BF,QAAQG,eAAeC,UAAWC,SAA0CJ,SAASK,IAAID,UAErHE,gBAAoCC,gBADK,CAACP,SAAUD,QAASE,cAG7DO,kBAAsDC,uBAAuBV,gBAC7EW,YAAiDC,mBAAmBZ,SACpEa,aAAmDC,oBAAoBb,UAM7E,OAAOc,SAASR,gBAAiBE,kBAAmBE,YAAaE,aAAc,CAAEG,WAJjF,WACE,OAAOf,SAASgB,UAAUC,mCAC5B,GAGF"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingManagerWrapper.js","sources":["../../../src/LoadingManager/Wrappers/LoadingManagerWrapper.ts"],"sourcesContent":["import type { TAbstractWrapper } from '@Anarchy/Engine/Abstract';\nimport { AbstractWrapper, WrapperType } from '@Anarchy/Engine/Abstract';\nimport { LoadingEventType } from '@Anarchy/Engine/LoadingManager/Constants';\nimport type { TLoadingEvent, TLoadingManagerParams, TLoadingManagerWrapper } from '@Anarchy/Engine/LoadingManager/Models';\nimport { isNotDefined } from '@Anarchy/Shared/Utils';\nimport type { Subscription } from 'rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { LoadingManager } from 'three';\n\nconst { NOT_STARTED, START, PROGRESS, ERROR, DONE } = LoadingEventType;\n\nexport function LoadingManagerWrapper(params: TLoadingManagerParams): TLoadingManagerWrapper {\n let lastLoaded: number = 0;\n let lastTotal: number = 0;\n\n const onProgress = (url: string, loaded: number, total: number): void => {\n setLastCounters(loaded, total);\n progress$.next({ type: PROGRESS, url, loaded, total, progress: getProgress(loaded, total) });\n params.onProgress?.(url, loaded, total);\n };\n\n const onLoad = (): void => {\n const loaded: number = lastTotal > 0 ? lastTotal : lastLoaded;\n const total: number = lastTotal;\n progress$.next({ type: DONE, loaded, total, progress: getProgress(loaded, total) });\n ready$.next(true);\n params.onLoad?.();\n };\n\n const onError = (url: string): void => {\n progress$.next({ type: ERROR, url, loaded: lastLoaded, total: lastTotal, progress: getProgress(lastLoaded, lastTotal) });\n ready$.next(true);\n params.onError?.(url);\n };\n\n const entity: LoadingManager = new LoadingManager(onLoad, onProgress, onError);\n const progress$: BehaviorSubject<TLoadingEvent> = new BehaviorSubject<TLoadingEvent>({ type: NOT_STARTED, loaded: 0, total: 0, progress: 0 });\n const ready$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);\n\n function getProgress(loaded: number, total: number): number {\n if (total <= 0) return 0;\n\n const percentRaw: number = (loaded / total) * 100;\n if (!Number.isFinite(percentRaw)) return 0;\n\n const percentClamped: number = Math.max(0, Math.min(100, percentRaw));\n\n return Number(percentClamped.toFixed(2));\n }\n\n function setLastCounters(loaded: number, total: number): void {\n lastLoaded = loaded;\n lastTotal = total;\n }\n\n // eslint-disable-next-line functional/immutable-data\n entity.onStart = (url: string, loaded: number, total: number): void => {\n setLastCounters(loaded, total);\n progress$.next({ type: START, url, loaded, total, progress: getProgress(loaded, total) });\n ready$.next(false);\n };\n\n async function waitLoading<T>(label: string, loadingTask: () => Promise<T>): Promise<T> {\n entity.itemStart(label);\n\n try {\n const res = await loadingTask();\n entity.itemEnd(label);\n return res;\n } catch (e) {\n // Mark as ended (otherwise manager might hang \"loading\" forever)\n entity.itemError(label);\n entity.itemEnd(label);\n progress$.next({ type: ERROR, url: label, loaded: lastLoaded, total: lastTotal, progress: getProgress(lastLoaded, lastTotal) });\n throw e;\n }\n }\n\n function waitFontsLoading(label = 'fonts:document.fonts.ready'): Promise<void> {\n return waitLoading(label, async (): Promise<void> => {\n const fontsAny: FontFaceSet | undefined = (document as unknown as { fonts?: FontFaceSet }).fonts;\n if (isNotDefined(fontsAny)) return;\n await fontsAny.ready;\n });\n }\n\n const wrapper: TAbstractWrapper<LoadingManager> = AbstractWrapper(entity, WrapperType.LoadingManager, params);\n\n const destroySub$: Subscription = wrapper.destroy$.subscribe((): void => {\n progress$.complete();\n ready$.complete();\n destroySub$.unsubscribe();\n // eslint-disable-next-line functional/immutable-data\n entity.onLoad = (): null => null;\n // eslint-disable-next-line functional/immutable-data\n entity.onProgress = (): null => null;\n // eslint-disable-next-line functional/immutable-data\n entity.onError = (): null => null;\n });\n\n waitFontsLoading();\n\n // eslint-disable-next-line functional/immutable-data\n return Object.assign(wrapper, {\n entity,\n progress$,\n ready$,\n waitFontsLoading,\n waitLoading\n });\n}\n"],"names":["NOT_STARTED","START","PROGRESS","ERROR","DONE","LoadingEventType","LoadingManagerWrapper","params","lastLoaded","lastTotal","entity","LoadingManager","loaded","progress$","next","type","total","progress","getProgress","ready$","onLoad","url","setLastCounters","onProgress","onError","BehaviorSubject","percentRaw","Number","isFinite","percentClamped","Math","max","min","toFixed","async","waitLoading","label","loadingTask","itemStart","res","itemEnd","e","itemError","waitFontsLoading","fontsAny","document","fonts","isNotDefined","ready","onStart","wrapper","AbstractWrapper","WrapperType","destroySub$","destroy$","subscribe","complete","unsubscribe","Object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AASE,GAKP,MAHA/B,OAAOgC,UAAUN,OACjB1B,OAAO8B,QAAQJ,OACfvB,UAAUC,KAAK,CAAEC,KAAMZ,MAAOkB,IAAKe,MAAOxB,OAAQJ,WAAYQ,MAAOP,UAAWQ,SAAUC,YAAYV,WAAYC,aAC5GgC,CACR,CACF,CAEA,SAASE,iBAAiBP,MAAQ,8BAChC,OAAOD,YAAYC,MAAOF,UACxB,MAAMU,SAAqCC,SAAgDC,MACvFC,aAAaH,iBACXA,SAASI,OAEnB,CA5BAtC,OAAOuC,QAAU,CAAC5B,IAAaT,OAAgBI,SAC7CM,gBAAgBV,OAAQI,OACxBH,UAAUC,KAAK,CAAEC,KAAMd,MAAOoB,QAAKT,cAAQI,YAAOC,SAAUC,YAAYN,OAAQI,SAChFG,OAAOL,MAAK,IA2Bd,MAAMoC,QAA4CC,gBAAgBzC,OAAQ0C,YAAYzC,eAAgBJ,QAEhG8C,YAA4BH,QAAQI,SAASC,UAAU,KAC3D1C,UAAU2C,WACVrC,OAAOqC,WACPH,YAAYI,cAEZ/C,OAAOU,OAAS,IAAY,KAE5BV,OAAOa,WAAa,IAAY,KAEhCb,OAAOc,QAAU,IAAY,OAM/B,OAHAmB,mBAGOe,OAAOC,OAAOT,QAAS,CAC5BxC,cACAG,oBACAM,cACAwB,kCACAR,yBAEJ"}
1
+ {"version":3,"file":"LoadingManagerWrapper.js","sources":["../../../src/LoadingManager/Wrappers/LoadingManagerWrapper.ts"],"sourcesContent":["import type { TAbstractWrapper } from '@hellpig/anarchy-engine/Abstract';\nimport { AbstractWrapper, WrapperType } from '@hellpig/anarchy-engine/Abstract';\nimport { LoadingEventType } from '@hellpig/anarchy-engine/LoadingManager/Constants';\nimport type { TLoadingEvent, TLoadingManagerParams, TLoadingManagerWrapper } from '@hellpig/anarchy-engine/LoadingManager/Models';\nimport { isNotDefined } from '@hellpig/anarchy-shared/Utils';\nimport type { Subscription } from 'rxjs';\nimport { BehaviorSubject } from 'rxjs';\nimport { LoadingManager } from 'three';\n\nconst { NOT_STARTED, START, PROGRESS, ERROR, DONE } = LoadingEventType;\n\nexport function LoadingManagerWrapper(params: TLoadingManagerParams): TLoadingManagerWrapper {\n let lastLoaded: number = 0;\n let lastTotal: number = 0;\n\n const onProgress = (url: string, loaded: number, total: number): void => {\n setLastCounters(loaded, total);\n progress$.next({ type: PROGRESS, url, loaded, total, progress: getProgress(loaded, total) });\n params.onProgress?.(url, loaded, total);\n };\n\n const onLoad = (): void => {\n const loaded: number = lastTotal > 0 ? lastTotal : lastLoaded;\n const total: number = lastTotal;\n progress$.next({ type: DONE, loaded, total, progress: getProgress(loaded, total) });\n ready$.next(true);\n params.onLoad?.();\n };\n\n const onError = (url: string): void => {\n progress$.next({ type: ERROR, url, loaded: lastLoaded, total: lastTotal, progress: getProgress(lastLoaded, lastTotal) });\n ready$.next(true);\n params.onError?.(url);\n };\n\n const entity: LoadingManager = new LoadingManager(onLoad, onProgress, onError);\n const progress$: BehaviorSubject<TLoadingEvent> = new BehaviorSubject<TLoadingEvent>({ type: NOT_STARTED, loaded: 0, total: 0, progress: 0 });\n const ready$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);\n\n function getProgress(loaded: number, total: number): number {\n if (total <= 0) return 0;\n\n const percentRaw: number = (loaded / total) * 100;\n if (!Number.isFinite(percentRaw)) return 0;\n\n const percentClamped: number = Math.max(0, Math.min(100, percentRaw));\n\n return Number(percentClamped.toFixed(2));\n }\n\n function setLastCounters(loaded: number, total: number): void {\n lastLoaded = loaded;\n lastTotal = total;\n }\n\n // eslint-disable-next-line functional/immutable-data\n entity.onStart = (url: string, loaded: number, total: number): void => {\n setLastCounters(loaded, total);\n progress$.next({ type: START, url, loaded, total, progress: getProgress(loaded, total) });\n ready$.next(false);\n };\n\n async function waitLoading<T>(label: string, loadingTask: () => Promise<T>): Promise<T> {\n entity.itemStart(label);\n\n try {\n const res = await loadingTask();\n entity.itemEnd(label);\n return res;\n } catch (e) {\n // Mark as ended (otherwise manager might hang \"loading\" forever)\n entity.itemError(label);\n entity.itemEnd(label);\n progress$.next({ type: ERROR, url: label, loaded: lastLoaded, total: lastTotal, progress: getProgress(lastLoaded, lastTotal) });\n throw e;\n }\n }\n\n function waitFontsLoading(label = 'fonts:document.fonts.ready'): Promise<void> {\n return waitLoading(label, async (): Promise<void> => {\n const fontsAny: FontFaceSet | undefined = (document as unknown as { fonts?: FontFaceSet }).fonts;\n if (isNotDefined(fontsAny)) return;\n await fontsAny.ready;\n });\n }\n\n const wrapper: TAbstractWrapper<LoadingManager> = AbstractWrapper(entity, WrapperType.LoadingManager, params);\n\n const destroySub$: Subscription = wrapper.destroy$.subscribe((): void => {\n progress$.complete();\n ready$.complete();\n destroySub$.unsubscribe();\n // eslint-disable-next-line functional/immutable-data\n entity.onLoad = (): null => null;\n // eslint-disable-next-line functional/immutable-data\n entity.onProgress = (): null => null;\n // eslint-disable-next-line functional/immutable-data\n entity.onError = (): null => null;\n });\n\n waitFontsLoading();\n\n // eslint-disable-next-line functional/immutable-data\n return Object.assign(wrapper, {\n entity,\n progress$,\n ready$,\n waitFontsLoading,\n waitLoading\n });\n}\n"],"names":["NOT_STARTED","START","PROGRESS","ERROR","DONE","LoadingEventType","LoadingManagerWrapper","params","lastLoaded","lastTotal","entity","LoadingManager","loaded","progress$","next","type","total","progress","getProgress","ready$","onLoad","url","setLastCounters","onProgress","onError","BehaviorSubject","percentRaw","Number","isFinite","percentClamped","Math","max","min","toFixed","async","waitLoading","label","loadingTask","itemStart","res","itemEnd","e","itemError","waitFontsLoading","fontsAny","document","fonts","isNotDefined","ready","onStart","wrapper","AbstractWrapper","WrapperType","destroySub$","destroy$","subscribe","complete","unsubscribe","Object","assign"],"mappings":"qZASA,MAAMA,YAAEA,YAAAC,MAAaA,MAAAC,SAAOA,SAAAC,MAAUA,MAAAC,KAAOA,MAASC,iBAE/C,SAASC,sBAAsBC,QACpC,IAAIC,WAAqB,EACrBC,UAAoB,EAExB,MAoBMC,OAAyB,IAAIC,eAdpB,KAC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AEA,SAASE,iBAAiBP,MAAQ,8BAChC,OAAOD,YAAYC,MAAOF,UACxB,MAAMU,SAAqCC,SAAgDC,MACvFC,aAAaH,iBACXA,SAASI,OAEnB,CA5BAtC,OAAOuC,QAAU,CAAC5B,IAAaT,OAAgBI,SAC7CM,gBAAgBV,OAAQI,OACxBH,UAAUC,KAAK,CAAEC,KAAMd,MAAOoB,QAAKT,cAAQI,YAAOC,SAAUC,YAAYN,OAAQI,SAChFG,OAAOL,MAAK,IA2Bd,MAAMoC,QAA4CC,gBAAgBzC,OAAQ0C,YAAYzC,eAAgBJ,QAEhG8C,YAA4BH,QAAQI,SAASC,UAAU,KAC3D1C,UAAU2C,WACVrC,OAAOqC,WACPH,YAAYI,cAEZ/C,OAAOU,OAAS,IAAY,KAE5BV,OAAOa,WAAa,IAAY,KAEhCb,OAAOc,QAAU,IAAY,OAM/B,OAHAmB,mBAGOe,OAAOC,OAAOT,QAAS,CAC5BxC,cACAG,oBACAM,cACAwB,kCACAR,yBAEJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoopsDefaultSettings.js","sources":["../../../src/Loop/Constants/LoopsDefaultSettings.ts"],"sourcesContent":["import type { TLoopsSettings, TLoopsSettingsModes, TLoopsSettingsSteps } from '@Anarchy/Engine/Loop/Models';\nimport { mergeAll } from '@Anarchy/Engine/Utils';\n\nexport const LOOPS_DEFAULT_STEPS: TLoopsSettingsSteps = {\n audioLoopStep: 16,\n collisionsLoopStep: 16,\n controlsLoopStep: 16,\n intersectionsLoopStep: 16,\n kinematicLoopStep: 16,\n mouseLoopStep: 16,\n physicsLoopStep: 16,\n spatialLoopStep: 16,\n textLoopStep: 16,\n transformLoopStep: 16\n};\n\nexport const LOOPS_MODES: TLoopsSettingsModes = {\n isAudioParallel: false,\n isCollisionsParallel: false,\n isControlsParallel: false,\n isIntersectionsParallel: false,\n isKinematicParallel: false,\n isMouseParallel: false,\n isPhysicsParallel: false,\n isSpatialParallel: false,\n isTextParallel: false,\n isTransformParallel: false\n};\n\nexport const LOOPS_DEFAULT_SETTINGS: TLoopsSettings = mergeAll(LOOPS_DEFAULT_STEPS, LOOPS_MODES);\n"],"names":["LOOPS_DEFAULT_STEPS","audioLoopStep","collisionsLoopStep","controlsLoopStep","intersectionsLoopStep","kinematicLoopStep","mouseLoopStep","physicsLoopStep","spatialLoopStep","textLoopStep","transformLoopStep","LOOPS_MODES","isAudioParallel","isCollisionsParallel","isControlsParallel","isIntersectionsParallel","isKinematicParallel","isMouseParallel","isPhysicsParallel","isSpatialParallel","isTextParallel","isTransformParallel","LOOPS_DEFAULT_SETTINGS","mergeAll"],"mappings":"iDAGO,MAAMA,oBAA2C,CACtDC,cAAe,GACfC,mBAAoB,GACpBC,iBAAkB,GAClBC,sBAAuB,GACvBC,kBAAmB,GACnBC,cAAe,GACfC,gBAAiB,GACjBC,gBAAiB,GACjBC,aAAc,GACdC,kBAAmB,IAGRC,YAAmC,CAC9CC,iBAAiB,EACjBC,sBAAsB,EACtBC,oBAAoB,EACpBC,yBAAyB,EACzBC,qBAAqB,EACrBC,iBAAiB,EACjBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,EAChBC,qBAAqB,GAGVC,uBAAyCC,SAASvB,oBAAqBW"}
1
+ {"version":3,"file":"LoopsDefaultSettings.js","sources":["../../../src/Loop/Constants/LoopsDefaultSettings.ts"],"sourcesContent":["import type { TLoopsSettings, TLoopsSettingsModes, TLoopsSettingsSteps } from '@hellpig/anarchy-engine/Loop/Models';\nimport { mergeAll } from '@hellpig/anarchy-engine/Utils';\n\nexport const LOOPS_DEFAULT_STEPS: TLoopsSettingsSteps = {\n audioLoopStep: 16,\n collisionsLoopStep: 16,\n controlsLoopStep: 16,\n intersectionsLoopStep: 16,\n kinematicLoopStep: 16,\n mouseLoopStep: 16,\n physicsLoopStep: 16,\n spatialLoopStep: 16,\n textLoopStep: 16,\n transformLoopStep: 16\n};\n\nexport const LOOPS_MODES: TLoopsSettingsModes = {\n isAudioParallel: false,\n isCollisionsParallel: false,\n isControlsParallel: false,\n isIntersectionsParallel: false,\n isKinematicParallel: false,\n isMouseParallel: false,\n isPhysicsParallel: false,\n isSpatialParallel: false,\n isTextParallel: false,\n isTransformParallel: false\n};\n\nexport const LOOPS_DEFAULT_SETTINGS: TLoopsSettings = mergeAll(LOOPS_DEFAULT_STEPS, LOOPS_MODES);\n"],"names":["LOOPS_DEFAULT_STEPS","audioLoopStep","collisionsLoopStep","controlsLoopStep","intersectionsLoopStep","kinematicLoopStep","mouseLoopStep","physicsLoopStep","spatialLoopStep","textLoopStep","transformLoopStep","LOOPS_MODES","isAudioParallel","isCollisionsParallel","isControlsParallel","isIntersectionsParallel","isKinematicParallel","isMouseParallel","isPhysicsParallel","isSpatialParallel","isTextParallel","isTransformParallel","LOOPS_DEFAULT_SETTINGS","mergeAll"],"mappings":"iDAGO,MAAMA,oBAA2C,CACtDC,cAAe,GACfC,mBAAoB,GACpBC,iBAAkB,GAClBC,sBAAuB,GACvBC,kBAAmB,GACnBC,cAAe,GACfC,gBAAiB,GACjBC,gBAAiB,GACjBC,aAAc,GACdC,kBAAmB,IAGRC,YAAmC,CAC9CC,iBAAiB,EACjBC,sBAAsB,EACtBC,oBAAoB,EACpBC,yBAAyB,EACzBC,qBAAqB,EACrBC,iBAAiB,EACjBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,EAChBC,qBAAqB,GAGVC,uBAAyCC,SAASvB,oBAAqBW"}
@@ -1 +1 @@
1
- {"version":3,"file":"DeltaCalculator.js","sources":["../../../src/Loop/Entities/DeltaCalculator.ts"],"sourcesContent":["import type { TDeltaCalculator } from '@Anarchy/Engine/Loop/Models';\nimport type { TMilliseconds } from '@Anarchy/Engine/Math';\nimport { isDefined } from '@Anarchy/Shared/Utils';\nimport { Clock } from 'three';\n\nexport function DeltaCalculator(useClock: boolean = true): TDeltaCalculator {\n let clock: Clock | undefined = useClock ? new Clock() : undefined;\n\n const result = {\n isPaused: false,\n lastElapsedTime: getLastTime(clock),\n update(): TMilliseconds {\n if (result.isPaused) return 0;\n\n const now: number = getLastTime(clock);\n const delta: number = (now - result.lastElapsedTime) / 1000;\n // eslint-disable-next-line functional/immutable-data\n result.lastElapsedTime = now as TMilliseconds;\n\n // Limit the delta to 0.1 seconds (to prevent too big delta)\n return Math.min(delta, 0.1) as TMilliseconds;\n },\n reset(): TMilliseconds {\n // eslint-disable-next-line functional/immutable-data\n result.lastElapsedTime = getLastTime(clock);\n return 0;\n },\n pause(): void {\n // eslint-disable-next-line functional/immutable-data\n result.isPaused = true;\n if (isDefined(clock)) clock.stop();\n },\n resume(): void {\n // eslint-disable-next-line functional/immutable-data\n result.isPaused = false;\n if (isDefined(clock)) clock.start();\n // eslint-disable-next-line functional/immutable-data\n result.lastElapsedTime = getLastTime(clock);\n },\n getClock(): Clock | undefined {\n return clock;\n },\n destroy(): void {\n if (isDefined(clock)) clock.stop();\n clock = undefined;\n }\n };\n\n return result;\n}\n\nconst getLastTime = (clock: Clock | undefined): TMilliseconds => ((clock && clock.getElapsedTime() * 1000) || performance.now()) as TMilliseconds;\n"],"names":["DeltaCalculator","useClock","clock","Clock","result","isPaused","lastElapsedTime","getLastTime","update","now","delta","Math","min","reset","pause","isDefined","stop","resume","start","getClock","destroy","getElapsedTime","performance"],"mappings":"sGAKO,SAASA,gBAAgBC,UAAoB,GAClD,IAAIC,MAA2BD,SAAW,IAAIE,WAAU,EAExD,MAAMC,OAAS,CACbC,UAAU,EACVC,gBAAiBC,YAAYL,OAC7B,MAAAM,GACE,GAAIJ,OAAOC,SAAU,OAAO,EAE5B,MAAMI,IAAcF,YAAYL,OAC1BQ,OAAiBD,IAAML,OAAOE,iBAAmB,IAKvD,OAHAF,OAAOE,gBAAkBG,IAGlBE,KAAKC,IAAIF,MAAO,GACzB,EACAG,MAAA,KAEET,OAAOE,gBAAkBC,YAAYL,OAC9B,GAET,KAAAY,GAEEV,OAAOC,UAAW,EACdU,UAAUb,QAAQA,MAAMc,MAC9B,EACA,MAAAC,GAEEb,OAAOC,UAAW,EACdU,UAAUb,QAAQA,MAAMgB,QAE5Bd,OAAOE,gBAAkBC,YAAYL,MACvC,EACAiB,SAAA,IACSjB,MAET,OAAAkB,GACML,UAAUb,QAAQA,MAAMc,OAC5Bd,WAAQ,CACV,GAGF,OAAOE,MACT,CAEA,MAAMG,YAAeL,OAA8CA,OAAkC,IAAzBA,MAAMmB,kBAA4BC,YAAYb"}
1
+ {"version":3,"file":"DeltaCalculator.js","sources":["../../../src/Loop/Entities/DeltaCalculator.ts"],"sourcesContent":["import type { TDeltaCalculator } from '@hellpig/anarchy-engine/Loop/Models';\nimport type { TMilliseconds } from '@hellpig/anarchy-engine/Math';\nimport { isDefined } from '@hellpig/anarchy-shared/Utils';\nimport { Clock } from 'three';\n\nexport function DeltaCalculator(useClock: boolean = true): TDeltaCalculator {\n let clock: Clock | undefined = useClock ? new Clock() : undefined;\n\n const result = {\n isPaused: false,\n lastElapsedTime: getLastTime(clock),\n update(): TMilliseconds {\n if (result.isPaused) return 0;\n\n const now: number = getLastTime(clock);\n const delta: number = (now - result.lastElapsedTime) / 1000;\n // eslint-disable-next-line functional/immutable-data\n result.lastElapsedTime = now as TMilliseconds;\n\n // Limit the delta to 0.1 seconds (to prevent too big delta)\n return Math.min(delta, 0.1) as TMilliseconds;\n },\n reset(): TMilliseconds {\n // eslint-disable-next-line functional/immutable-data\n result.lastElapsedTime = getLastTime(clock);\n return 0;\n },\n pause(): void {\n // eslint-disable-next-line functional/immutable-data\n result.isPaused = true;\n if (isDefined(clock)) clock.stop();\n },\n resume(): void {\n // eslint-disable-next-line functional/immutable-data\n result.isPaused = false;\n if (isDefined(clock)) clock.start();\n // eslint-disable-next-line functional/immutable-data\n result.lastElapsedTime = getLastTime(clock);\n },\n getClock(): Clock | undefined {\n return clock;\n },\n destroy(): void {\n if (isDefined(clock)) clock.stop();\n clock = undefined;\n }\n };\n\n return result;\n}\n\nconst getLastTime = (clock: Clock | undefined): TMilliseconds => ((clock && clock.getElapsedTime() * 1000) || performance.now()) as TMilliseconds;\n"],"names":["DeltaCalculator","useClock","clock","Clock","result","isPaused","lastElapsedTime","getLastTime","update","now","delta","Math","min","reset","pause","isDefined","stop","resume","start","getClock","destroy","getElapsedTime","performance"],"mappings":"sGAKO,SAASA,gBAAgBC,UAAoB,GAClD,IAAIC,MAA2BD,SAAW,IAAIE,WAAU,EAExD,MAAMC,OAAS,CACbC,UAAU,EACVC,gBAAiBC,YAAYL,OAC7B,MAAAM,GACE,GAAIJ,OAAOC,SAAU,OAAO,EAE5B,MAAMI,IAAcF,YAAYL,OAC1BQ,OAAiBD,IAAML,OAAOE,iBAAmB,IAKvD,OAHAF,OAAOE,gBAAkBG,IAGlBE,KAAKC,IAAIF,MAAO,GACzB,EACAG,MAAA,KAEET,OAAOE,gBAAkBC,YAAYL,OAC9B,GAET,KAAAY,GAEEV,OAAOC,UAAW,EACdU,UAAUb,QAAQA,MAAMc,MAC9B,EACA,MAAAC,GAEEb,OAAOC,UAAW,EACdU,UAAUb,QAAQA,MAAMgB,QAE5Bd,OAAOE,gBAAkBC,YAAYL,MACvC,EACAiB,SAAA,IACSjB,MAET,OAAAkB,GACML,UAAUb,QAAQA,MAAMc,OAC5Bd,WAAQ,CACV,GAGF,OAAOE,MACT,CAEA,MAAMG,YAAeL,OAA8CA,OAAkC,IAAzBA,MAAMmB,kBAA4BC,YAAYb"}
@@ -1 +1 @@
1
- {"version":3,"file":"Loop.js","sources":["../../../src/Loop/Entities/Loop.ts"],"sourcesContent":["import type { LoopUpdatePriority } from '@Anarchy/Engine/Loop/Constants';\nimport { LoopTrigger, LoopWorkerActions, MaxTicks } from '@Anarchy/Engine/Loop/Constants';\nimport type {\n TDelta,\n TDeltaCalculator,\n TLoop,\n TLoopParams,\n TLoopTriggerFn,\n TLoopWorkerDestroyRequestData,\n TLoopWorkerResponseData,\n TLoopWorkerStartRequestData,\n TLoopWorkerStopRequestData\n} from '@Anarchy/Engine/Loop/Models';\nimport type { TDestroyable } from '@Anarchy/Engine/Mixins';\nimport { destroyableMixin } from '@Anarchy/Engine/Mixins';\nimport { isDefined, isNotDefined } from '@Anarchy/Shared/Utils';\nimport { nanoid } from 'nanoid';\nimport type { Observable, Subscription } from 'rxjs';\nimport { BehaviorSubject, distinctUntilChanged, EMPTY, Subject, switchMap, takeUntil, takeWhile } from 'rxjs';\n\nimport { DeltaCalculator } from './DeltaCalculator';\n\nexport function Loop({ name, type, trigger, maxPriority, isParallelMode }: TLoopParams): TLoop | never {\n const id: string = `${nanoid()}_${type}`;\n const enabled$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\n const tick$: Subject<TDelta> = new Subject<TDelta>();\n let tickCounter: number = 0;\n\n //An additional variable to make sure that the tick$ is not called after destroy$\n let isDestroyed: boolean = false;\n\n let worker: Worker | null = null;\n const isTriggerFn: boolean = typeof trigger === 'function';\n if (isParallelMode && isTriggerFn) throw new Error('Loop: Trigger function is not supported in parallel mode, only interval is supported');\n\n const deltaCalc: TDeltaCalculator | null = isParallelMode ? null : DeltaCalculator(isTriggerFn);\n\n if (isParallelMode) {\n worker = new Worker(new URL('./Loop.worker.ts', import.meta.url), { type: 'module' });\n // eslint-disable-next-line functional/immutable-data\n worker.onmessage = ({ data }: MessageEvent<TLoopWorkerResponseData>): void => tick$.next(data.delta);\n }\n\n const loopSub$: Subscription = tick$.pipe(takeWhile((): boolean => maxPriority !== undefined)).subscribe((): void => {\n tickCounter = (tickCounter + 1) % MaxTicks;\n });\n\n function shouldUpdateWithPriority(priority: LoopUpdatePriority): boolean {\n const period: number = 1 << priority;\n return (tickCounter & (period - 1)) === 0;\n }\n\n const destroyable: TDestroyable = destroyableMixin();\n\n enabled$\n .pipe(\n switchMap((isEnabled: boolean): Subject<TDelta> | Observable<never> => (isEnabled && !isParallelMode && isTriggerFn ? tick$ : EMPTY)),\n takeUntil(destroyable.destroy$)\n )\n .subscribe((): number | void => {\n return (trigger as TLoopTriggerFn)((): void => {\n if (!isDestroyed) tick$.next(deltaCalc!.update());\n });\n });\n\n const runInterval = (): number | never => {\n if (isParallelMode || isNotDefined(deltaCalc)) throw new Error('Loop: must not use \"runInterval\" in parallel mode (use worker instead)');\n return setInterval((): void => tick$.next(deltaCalc.update()), trigger as number) as unknown as number;\n };\n\n let intervalId: number | undefined;\n\n enabled$.pipe(distinctUntilChanged(), takeUntil(destroyable.destroy$)).subscribe((isEnabled: boolean): void => {\n if (isEnabled) {\n if (isTriggerFn) {\n tick$.next(0);\n } else {\n if (isParallelMode && isDefined(worker))\n worker.postMessage({\n loopId: id,\n interval: trigger as number,\n action: LoopWorkerActions.Start\n } satisfies TLoopWorkerStartRequestData);\n if (!isParallelMode) intervalId = runInterval();\n }\n } else {\n deltaCalc?.reset();\n if (isParallelMode && isDefined(worker)) worker.postMessage({ action: LoopWorkerActions.Stop } satisfies TLoopWorkerStopRequestData);\n if (isDefined(intervalId)) clearInterval(intervalId);\n }\n });\n\n const destroySub$: Subscription = destroyable.destroy$.subscribe((): void => {\n isDestroyed = true;\n destroySub$.unsubscribe();\n loopSub$.unsubscribe();\n\n if (isDefined(intervalId)) {\n clearInterval(intervalId);\n intervalId = null as any;\n }\n\n tickCounter = 0;\n\n enabled$.next(false);\n enabled$.complete();\n\n worker?.postMessage({ loopId: id, action: LoopWorkerActions.Destroy } satisfies TLoopWorkerDestroyRequestData);\n worker?.terminate();\n worker = null;\n deltaCalc?.destroy();\n\n tick$.complete();\n });\n\n return Object.assign(\n {\n id,\n name,\n tick$,\n type,\n triggerMode: isTriggerFn ? LoopTrigger.Function : LoopTrigger.Interval,\n isParallelMode: isParallelMode ?? false,\n trigger,\n start: (): void => void enabled$.next(true),\n stop: (): void => void enabled$.next(false),\n enabled$,\n shouldUpdateWithPriority\n },\n destroyable\n );\n}\n"],"names":["Loop","name","type","trigger","maxPriority","isParallelMode","id","nanoid","enabled$","BehaviorSubject","tick$","Subject","tickCounter","isDestroyed","worker","isTriggerFn","Error","deltaCalc","DeltaCalculator","Worker","URL","url","onmessage","data","next","delta","loopSub$","pipe","takeWhile","subscribe","MaxTicks","destroyable","destroyableMixin","intervalId","switchMap","isEnabled","EMPTY","takeUntil","destroy$","update","distinctUntilChanged","isDefined","postMessage","loopId","interval","action","LoopWorkerActions","Start","isNotDefined","setInterval","runInterval","reset","Stop","clearInterval","destroySub$","unsubscribe","complete","Destroy","terminate","destroy","Object","assign","triggerMode","LoopTrigger","Function","Interval","start","stop","shouldUpdateWithPriority","priority"],"mappings":"kkCAsBO,SAASA,MAAKC,KAAEA,KAAAC,KAAMA,aAAMC,QAAAC,YAASA,YAAAC,eAAaA,iBACvD,MAAMC,GAAa,GAAGC,YAAYL,OAC5BM,SAAqC,IAAIC,iBAAyB,GAClEC,MAAyB,IAAIC,QACnC,IAAIC,YAAsB,EAGtBC,aAAuB,EAEvBC,OAAwB,KAC5B,MAAMC,YAA0C,mBAAZZ,QACpC,GAAIE,gBAAkBU,YAAa,MAAM,IAAIC,MAAM,wFAEnD,MAAMC,UAAqCZ,eAAiB,KAAOa,gBAAgBH,aAE/EV,iBACFS,OAAS,IAAIK,OAAO,IAAAC,IAAA,oFAAAC,KAA8C,CAAEnB,KAAM,WAE1EY,OAAOQ,UAAY,EAAGC,aAAwDb,MAAMc,KAAKD,KAAKE,QAGhG,MAAMC,SAAyBhB,MAAMiB,KAAKC,UAAU,SAA+B,IAAhBxB,cAA4ByB,UAAU,KACvGjB,aAAeA,YAAc,GAAKkB,WAQ9BC,YAA4BC,mBAkBlC,IAAIC,WAhBJzB,SACGmB,KACCO,UAAWC,WAA6DA,YAAc9B,gBAAkBU,YAAcL,MAAQ0B,OAC9HC,UAAUN,YAAYO,WAEvBT,UAAU,IACD1B,QAA2B,KAC5BU,aAAaH,MAAMc,KAAKP,UAAWsB,aAW9C/B,SAASmB,KAAKa,uBAAwBH,UAAUN,YAAYO,WAAWT,UAAWM,YAC5EA,UACEpB,YACFL,MAAMc,KAAK,IAEPnB,gBAAkBoC,UAAU3B,SAC9BA,OAAO4B,YAAY,CACjBC,OAAQrC,GACRsC,SAAUzC,QACV0C,OAAQC,kBAAkBC,QAEzB1C,iBAAgB4B,WAlBP,MAClB,GAAI5B,gBAAkB2C,aAAa/B,WAAY,MAAM,IAAID,MAAM,0EAC/D,OAAOiC,YAAY,IAAYvC,MAAMc,KAAKP,UAAUsB,UAAWpC,UAgBzB+C,MAGpCjC,WAAWkC,QACP9C,gBAAkBoC,UAAU3B,SAASA,OAAO4B,YAAY,CAAEG,OAAQC,kBAAkBM,OACpFX,UAAUR,aAAaoB,cAAcpB,eAI7C,MAAMqB,YAA4BvB,YAAYO,SAAST,UAAU,KAC/DhB,aAAc,EACdyC,YAAYC,cACZ7B,SAAS6B,cAELd,UAAUR,cACZoB,cAAcpB,YACdA,WAAa,MAGfrB,YAAc,EAEdJ,SAASgB,MAAK,GACdhB,SAASgD,WAET1C,QAAQ4B,YAAY,CAAEC,OAAQrC,GAAIuC,OAAQC,kBAAkBW,UAC5D3C,QAAQ4C,YACR5C,OAAS,KACTG,WAAW0C,UAEXjD,MAAM8C,aAGR,OAAOI,OAAOC,OACZ,CACEvD,MACAL,UACAS,YACAR,UACA4D,YAAa/C,YAAcgD,YAAYC,SAAWD,YAAYE,SAC9D5D,eAAgBA,iBAAkB,EAClCF,gBACA+D,MAAO,KAAiB1D,SAASgB,MAAK,IACtC2C,KAAM,KAAiB3D,SAASgB,MAAK,IACrChB,kBACA4D,yBAhFJ,SAAkCC,UAEhC,QAAQzD,aADe,GAAKyD,UACI,EAClC,GA+EEtC,YAEJ"}
1
+ {"version":3,"file":"Loop.js","sources":["../../../src/Loop/Entities/Loop.ts"],"sourcesContent":["import type { LoopUpdatePriority } from '@hellpig/anarchy-engine/Loop/Constants';\nimport { LoopTrigger, LoopWorkerActions, MaxTicks } from '@hellpig/anarchy-engine/Loop/Constants';\nimport type {\n TDelta,\n TDeltaCalculator,\n TLoop,\n TLoopParams,\n TLoopTriggerFn,\n TLoopWorkerDestroyRequestData,\n TLoopWorkerResponseData,\n TLoopWorkerStartRequestData,\n TLoopWorkerStopRequestData\n} from '@hellpig/anarchy-engine/Loop/Models';\nimport type { TDestroyable } from '@hellpig/anarchy-engine/Mixins';\nimport { destroyableMixin } from '@hellpig/anarchy-engine/Mixins';\nimport { isDefined, isNotDefined } from '@hellpig/anarchy-shared/Utils';\nimport { nanoid } from 'nanoid';\nimport type { Observable, Subscription } from 'rxjs';\nimport { BehaviorSubject, distinctUntilChanged, EMPTY, Subject, switchMap, takeUntil, takeWhile } from 'rxjs';\n\nimport { DeltaCalculator } from './DeltaCalculator';\n\nexport function Loop({ name, type, trigger, maxPriority, isParallelMode }: TLoopParams): TLoop | never {\n const id: string = `${nanoid()}_${type}`;\n const enabled$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\n const tick$: Subject<TDelta> = new Subject<TDelta>();\n let tickCounter: number = 0;\n\n //An additional variable to make sure that the tick$ is not called after destroy$\n let isDestroyed: boolean = false;\n\n let worker: Worker | null = null;\n const isTriggerFn: boolean = typeof trigger === 'function';\n if (isParallelMode && isTriggerFn) throw new Error('Loop: Trigger function is not supported in parallel mode, only interval is supported');\n\n const deltaCalc: TDeltaCalculator | null = isParallelMode ? null : DeltaCalculator(isTriggerFn);\n\n if (isParallelMode) {\n worker = new Worker(new URL('./Loop.worker.ts', import.meta.url), { type: 'module' });\n // eslint-disable-next-line functional/immutable-data\n worker.onmessage = ({ data }: MessageEvent<TLoopWorkerResponseData>): void => tick$.next(data.delta);\n }\n\n const loopSub$: Subscription = tick$.pipe(takeWhile((): boolean => maxPriority !== undefined)).subscribe((): void => {\n tickCounter = (tickCounter + 1) % MaxTicks;\n });\n\n function shouldUpdateWithPriority(priority: LoopUpdatePriority): boolean {\n const period: number = 1 << priority;\n return (tickCounter & (period - 1)) === 0;\n }\n\n const destroyable: TDestroyable = destroyableMixin();\n\n enabled$\n .pipe(\n switchMap((isEnabled: boolean): Subject<TDelta> | Observable<never> => (isEnabled && !isParallelMode && isTriggerFn ? tick$ : EMPTY)),\n takeUntil(destroyable.destroy$)\n )\n .subscribe((): number | void => {\n return (trigger as TLoopTriggerFn)((): void => {\n if (!isDestroyed) tick$.next(deltaCalc!.update());\n });\n });\n\n const runInterval = (): number | never => {\n if (isParallelMode || isNotDefined(deltaCalc)) throw new Error('Loop: must not use \"runInterval\" in parallel mode (use worker instead)');\n return setInterval((): void => tick$.next(deltaCalc.update()), trigger as number) as unknown as number;\n };\n\n let intervalId: number | undefined;\n\n enabled$.pipe(distinctUntilChanged(), takeUntil(destroyable.destroy$)).subscribe((isEnabled: boolean): void => {\n if (isEnabled) {\n if (isTriggerFn) {\n tick$.next(0);\n } else {\n if (isParallelMode && isDefined(worker))\n worker.postMessage({\n loopId: id,\n interval: trigger as number,\n action: LoopWorkerActions.Start\n } satisfies TLoopWorkerStartRequestData);\n if (!isParallelMode) intervalId = runInterval();\n }\n } else {\n deltaCalc?.reset();\n if (isParallelMode && isDefined(worker)) worker.postMessage({ action: LoopWorkerActions.Stop } satisfies TLoopWorkerStopRequestData);\n if (isDefined(intervalId)) clearInterval(intervalId);\n }\n });\n\n const destroySub$: Subscription = destroyable.destroy$.subscribe((): void => {\n isDestroyed = true;\n destroySub$.unsubscribe();\n loopSub$.unsubscribe();\n\n if (isDefined(intervalId)) {\n clearInterval(intervalId);\n intervalId = null as any;\n }\n\n tickCounter = 0;\n\n enabled$.next(false);\n enabled$.complete();\n\n worker?.postMessage({ loopId: id, action: LoopWorkerActions.Destroy } satisfies TLoopWorkerDestroyRequestData);\n worker?.terminate();\n worker = null;\n deltaCalc?.destroy();\n\n tick$.complete();\n });\n\n return Object.assign(\n {\n id,\n name,\n tick$,\n type,\n triggerMode: isTriggerFn ? LoopTrigger.Function : LoopTrigger.Interval,\n isParallelMode: isParallelMode ?? false,\n trigger,\n start: (): void => void enabled$.next(true),\n stop: (): void => void enabled$.next(false),\n enabled$,\n shouldUpdateWithPriority\n },\n destroyable\n );\n}\n"],"names":["Loop","name","type","trigger","maxPriority","isParallelMode","id","nanoid","enabled$","BehaviorSubject","tick$","Subject","tickCounter","isDestroyed","worker","isTriggerFn","Error","deltaCalc","DeltaCalculator","Worker","URL","url","onmessage","data","next","delta","loopSub$","pipe","takeWhile","subscribe","MaxTicks","destroyable","destroyableMixin","intervalId","switchMap","isEnabled","EMPTY","takeUntil","destroy$","update","distinctUntilChanged","isDefined","postMessage","loopId","interval","action","LoopWorkerActions","Start","isNotDefined","setInterval","runInterval","reset","Stop","clearInterval","destroySub$","unsubscribe","complete","Destroy","terminate","destroy","Object","assign","triggerMode","LoopTrigger","Function","Interval","start","stop","shouldUpdateWithPriority","priority"],"mappings":"kkCAsBO,SAASA,MAAKC,KAAEA,KAAAC,KAAMA,aAAMC,QAAAC,YAASA,YAAAC,eAAaA,iBACvD,MAAMC,GAAa,GAAGC,YAAYL,OAC5BM,SAAqC,IAAIC,iBAAyB,GAClEC,MAAyB,IAAIC,QACnC,IAAIC,YAAsB,EAGtBC,aAAuB,EAEvBC,OAAwB,KAC5B,MAAMC,YAA0C,mBAAZZ,QACpC,GAAIE,gBAAkBU,YAAa,MAAM,IAAIC,MAAM,wFAEnD,MAAMC,UAAqCZ,eAAiB,KAAOa,gBAAgBH,aAE/EV,iBACFS,OAAS,IAAIK,OAAO,IAAAC,IAAA,oFAAAC,KAA8C,CAAEnB,KAAM,WAE1EY,OAAOQ,UAAY,EAAGC,aAAwDb,MAAMc,KAAKD,KAAKE,QAGhG,MAAMC,SAAyBhB,MAAMiB,KAAKC,UAAU,SAA+B,IAAhBxB,cAA4ByB,UAAU,KACvGjB,aAAeA,YAAc,GAAKkB,WAQ9BC,YAA4BC,mBAkBlC,IAAIC,WAhBJzB,SACGmB,KACCO,UAAWC,WAA6DA,YAAc9B,gBAAkBU,YAAcL,MAAQ0B,OAC9HC,UAAUN,YAAYO,WAEvBT,UAAU,IACD1B,QAA2B,KAC5BU,aAAaH,MAAMc,KAAKP,UAAWsB,aAW9C/B,SAASmB,KAAKa,uBAAwBH,UAAUN,YAAYO,WAAWT,UAAWM,YAC5EA,UACEpB,YACFL,MAAMc,KAAK,IAEPnB,gBAAkBoC,UAAU3B,SAC9BA,OAAO4B,YAAY,CACjBC,OAAQrC,GACRsC,SAAUzC,QACV0C,OAAQC,kBAAkBC,QAEzB1C,iBAAgB4B,WAlBP,MAClB,GAAI5B,gBAAkB2C,aAAa/B,WAAY,MAAM,IAAID,MAAM,0EAC/D,OAAOiC,YAAY,IAAYvC,MAAMc,KAAKP,UAAUsB,UAAWpC,UAgBzB+C,MAGpCjC,WAAWkC,QACP9C,gBAAkBoC,UAAU3B,SAASA,OAAO4B,YAAY,CAAEG,OAAQC,kBAAkBM,OACpFX,UAAUR,aAAaoB,cAAcpB,eAI7C,MAAMqB,YAA4BvB,YAAYO,SAAST,UAAU,KAC/DhB,aAAc,EACdyC,YAAYC,cACZ7B,SAAS6B,cAELd,UAAUR,cACZoB,cAAcpB,YACdA,WAAa,MAGfrB,YAAc,EAEdJ,SAASgB,MAAK,GACdhB,SAASgD,WAET1C,QAAQ4B,YAAY,CAAEC,OAAQrC,GAAIuC,OAAQC,kBAAkBW,UAC5D3C,QAAQ4C,YACR5C,OAAS,KACTG,WAAW0C,UAEXjD,MAAM8C,aAGR,OAAOI,OAAOC,OACZ,CACEvD,MACAL,UACAS,YACAR,UACA4D,YAAa/C,YAAcgD,YAAYC,SAAWD,YAAYE,SAC9D5D,eAAgBA,iBAAkB,EAClCF,gBACA+D,MAAO,KAAiB1D,SAASgB,MAAK,IACtC2C,KAAM,KAAiB3D,SAASgB,MAAK,IACrChB,kBACA4D,yBAhFJ,SAAkCC,UAEhC,QAAQzD,aADe,GAAKyD,UACI,EAClC,GA+EEtC,YAEJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoopFactory.js","sources":["../../../src/Loop/Factories/LoopFactory.ts"],"sourcesContent":["import { FactoryType, ReactiveFactory } from '@Anarchy/Engine/Abstract';\nimport { Loop } from '@Anarchy/Engine/Loop/Entities';\nimport type { TLoopFactory } from '@Anarchy/Engine/Loop/Models';\n\nexport function LoopFactory(): TLoopFactory {\n return ReactiveFactory(FactoryType.Loop, Loop);\n}\n"],"names":["LoopFactory","ReactiveFactory","FactoryType","Loop"],"mappings":"gLAIO,SAASA,cACd,OAAOC,gBAAgBC,YAAYC,KAAMA,KAC3C"}
1
+ {"version":3,"file":"LoopFactory.js","sources":["../../../src/Loop/Factories/LoopFactory.ts"],"sourcesContent":["import { FactoryType, ReactiveFactory } from '@hellpig/anarchy-engine/Abstract';\nimport { Loop } from '@hellpig/anarchy-engine/Loop/Entities';\nimport type { TLoopFactory } from '@hellpig/anarchy-engine/Loop/Models';\n\nexport function LoopFactory(): TLoopFactory {\n return ReactiveFactory(FactoryType.Loop, Loop);\n}\n"],"names":["LoopFactory","ReactiveFactory","FactoryType","Loop"],"mappings":"gLAIO,SAASA,cACd,OAAOC,gBAAgBC,YAAYC,KAAMA,KAC3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoopRegistry.js","sources":["../../../src/Loop/Registries/LoopRegistry.ts"],"sourcesContent":["import { AbstractEntityRegistry, RegistryType } from '@Anarchy/Engine/Abstract';\nimport type { TLoop, TLoopRegistry } from '@Anarchy/Engine/Loop/Models';\n\nexport function LoopRegistry(): TLoopRegistry {\n return AbstractEntityRegistry<TLoop>(RegistryType.Loop);\n}\n"],"names":["LoopRegistry","AbstractEntityRegistry","RegistryType","Loop"],"mappings":"2JAGO,SAASA,eACd,OAAOC,uBAA8BC,aAAaC,KACpD"}
1
+ {"version":3,"file":"LoopRegistry.js","sources":["../../../src/Loop/Registries/LoopRegistry.ts"],"sourcesContent":["import { AbstractEntityRegistry, RegistryType } from '@hellpig/anarchy-engine/Abstract';\nimport type { TLoop, TLoopRegistry } from '@hellpig/anarchy-engine/Loop/Models';\n\nexport function LoopRegistry(): TLoopRegistry {\n return AbstractEntityRegistry<TLoop>(RegistryType.Loop);\n}\n"],"names":["LoopRegistry","AbstractEntityRegistry","RegistryType","Loop"],"mappings":"2JAGO,SAASA,eACd,OAAOC,uBAA8BC,aAAaC,KACpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoopService.js","sources":["../../../src/Loop/Services/LoopService.ts"],"sourcesContent":["import type { TAbstractService } from '@Anarchy/Engine/Abstract';\nimport { AbstractService } from '@Anarchy/Engine/Abstract';\nimport type { TAudioLoop } from '@Anarchy/Engine/Audio';\nimport type { TCollisionsLoop } from '@Anarchy/Engine/Collisions';\nimport type { TControlsLoop } from '@Anarchy/Engine/Controls';\nimport type { TIntersectionsLoop } from '@Anarchy/Engine/Intersections';\nimport type { TKinematicLoop } from '@Anarchy/Engine/Kinematic';\nimport { LoopType } from '@Anarchy/Engine/Loop/Constants';\nimport type { TLoop, TLoopFactory, TLoopRegistry, TLoopService, TLoopServiceWithCreate, TLoopServiceWithFactory, TLoopServiceWithRegistry } from '@Anarchy/Engine/Loop/Models';\nimport { getMainLoopNameByType } from '@Anarchy/Engine/Loop/Utils';\nimport type { TDisposable } from '@Anarchy/Engine/Mixins';\nimport { withCreateServiceMixin, withFactoryService, withRegistryService } from '@Anarchy/Engine/Mixins';\nimport type { TMouseLoop } from '@Anarchy/Engine/Mouse';\nimport type { TPhysicsLoop } from '@Anarchy/Engine/Physics';\nimport type { TRenderLoop } from '@Anarchy/Engine/Space';\nimport type { TSpatialLoop } from '@Anarchy/Engine/Spatial';\nimport type { TTextLoop } from '@Anarchy/Engine/Text';\nimport type { TTransformLoop } from '@Anarchy/Engine/TransformDrive';\nimport { mergeAll } from '@Anarchy/Engine/Utils';\nimport type { Subscription } from 'rxjs';\n\nexport function LoopService(factory: TLoopFactory, registry: TLoopRegistry): TLoopService {\n const factorySub$: Subscription = factory.entityCreated$.subscribe((wrapper: TLoop): void => registry.add(wrapper));\n const disposable: ReadonlyArray<TDisposable> = [registry, factory, factorySub$];\n const abstractService: TAbstractService = AbstractService(disposable);\n\n const withCreateService: TLoopServiceWithCreate = withCreateServiceMixin(factory, undefined);\n const withFactory: TLoopServiceWithFactory = withFactoryService(factory);\n const withRegistry: TLoopServiceWithRegistry = withRegistryService(registry);\n\n function getLoop(name: string | undefined, type: LoopType): TLoop {\n const searchName: string = name ?? getMainLoopNameByType(type);\n // If no name is provided, return the main loop\n // otherwise, return the loop with the specified name or throw an error\n return registry.get((loop: TLoop): boolean => loop.name === searchName);\n }\n\n return mergeAll(abstractService, withCreateService, withFactory, withRegistry, {\n getLoop,\n getRenderLoop: (name?: string): TRenderLoop => getLoop(name, LoopType.Render) as TRenderLoop,\n getAudioLoop: (name?: string): TAudioLoop => getLoop(name, LoopType.Audio) as TAudioLoop,\n getPhysicsLoop: (name?: string): TPhysicsLoop => getLoop(name, LoopType.Physics) as TPhysicsLoop,\n getCollisionsLoop: (name?: string): TCollisionsLoop => getLoop(name, LoopType.Collisions) as TCollisionsLoop,\n getKinematicLoop: (name?: string): TKinematicLoop => getLoop(name, LoopType.Kinematic) as TKinematicLoop,\n getSpatialLoop: (name?: string): TSpatialLoop => getLoop(name, LoopType.Spatial) as TSpatialLoop,\n getTransformLoop: (name?: string): TTransformLoop => getLoop(name, LoopType.Transform) as TTransformLoop,\n getTextLoop: (name?: string): TTextLoop => getLoop(name, LoopType.Text) as TTextLoop,\n getMouseLoop: (name?: string): TMouseLoop => getLoop(name, LoopType.Mouse) as TMouseLoop,\n getIntersectionsLoop: (name?: string): TIntersectionsLoop => getLoop(name, LoopType.Intersections) as TIntersectionsLoop,\n getControlsLoop: (name?: string): TControlsLoop => getLoop(name, LoopType.Controls) as TControlsLoop\n });\n}\n"],"names":["LoopService","factory","registry","factorySub$","entityCreated$","subscribe","wrapper","add","abstractService","AbstractService","withCreateService","withCreateServiceMixin","withFactory","withFactoryService","withRegistry","withRegistryService","getLoop","name","type","searchName","getMainLoopNameByType","get","loop","mergeAll","getRenderLoop","LoopType","Render","getAudioLoop","Audio","getPhysicsLoop","Physics","getCollisionsLoop","Collisions","getKinematicLoop","Kinematic","getSpatialLoop","Spatial","getTransformLoop","Transform","getTextLoop","Text","getMouseLoop","Mouse","getIntersectionsLoop","Intersections","getControlsLoop","Controls"],"mappings":"0cAqBO,SAASA,YAAYC,QAAuBC,UACjD,MAAMC,YAA4BF,QAAQG,eAAeC,UAAWC,SAAyBJ,SAASK,IAAID,UAEpGE,gBAAoCC,gBADK,CAACP,SAAUD,QAASE,cAG7DO,kBAA4CC,uBAAuBV,gBACnEW,YAAuCC,mBAAmBZ,SAC1Da,aAAyCC,oBAAoBb,UAEnE,SAASc,QAAQC,KAA0BC,MACzC,MAAMC,WAAqBF,MAAQG,sBAAsBF,MAGzD,OAAOhB,SAASmB,IAAKC,MAAyBA,KAAKL,OAASE,WAC9D,CAEA,OAAOI,SAASf,gBAAiBE,kBAAmBE,YAAaE,aAAc,CAC7EE,gBACAQ,cAAgBP,MAA+BD,QAAQC,KAAMQ,SAASC,QACtEC,aAAeV,MAA8BD,QAAQC,KAAMQ,SAASG,OACpEC,eAAiBZ,MAAgCD,QAAQC,KAAMQ,SAASK,SACxEC,kBAAoBd,MAAmCD,QAAQC,KAAMQ,SAASO,YAC9EC,iBAAmBhB,MAAkCD,QAAQC,KAAMQ,SAASS,WAC5EC,eAAiBlB,MAAgCD,QAAQC,KAAMQ,SAASW,SACxEC,iBAAmBpB,MAAkCD,QAAQC,KAAMQ,SAASa,WAC5EC,YAActB,MAA6BD,QAAQC,KAAMQ,SAASe,MAClEC,aAAexB,MAA8BD,QAAQC,KAAMQ,SAASiB,OACpEC,qBAAuB1B,MAAsCD,QAAQC,KAAMQ,SAASmB,eACpFC,gBAAkB5B,MAAiCD,QAAQC,KAAMQ,SAASqB,WAE9E"}
1
+ {"version":3,"file":"LoopService.js","sources":["../../../src/Loop/Services/LoopService.ts"],"sourcesContent":["import type { TAbstractService } from '@hellpig/anarchy-engine/Abstract';\nimport { AbstractService } from '@hellpig/anarchy-engine/Abstract';\nimport type { TAudioLoop } from '@hellpig/anarchy-engine/Audio';\nimport type { TCollisionsLoop } from '@hellpig/anarchy-engine/Collisions';\nimport type { TControlsLoop } from '@hellpig/anarchy-engine/Controls';\nimport type { TIntersectionsLoop } from '@hellpig/anarchy-engine/Intersections';\nimport type { TKinematicLoop } from '@hellpig/anarchy-engine/Kinematic';\nimport { LoopType } from '@hellpig/anarchy-engine/Loop/Constants';\nimport type { TLoop, TLoopFactory, TLoopRegistry, TLoopService, TLoopServiceWithCreate, TLoopServiceWithFactory, TLoopServiceWithRegistry } from '@hellpig/anarchy-engine/Loop/Models';\nimport { getMainLoopNameByType } from '@hellpig/anarchy-engine/Loop/Utils';\nimport type { TDisposable } from '@hellpig/anarchy-engine/Mixins';\nimport { withCreateServiceMixin, withFactoryService, withRegistryService } from '@hellpig/anarchy-engine/Mixins';\nimport type { TMouseLoop } from '@hellpig/anarchy-engine/Mouse';\nimport type { TPhysicsLoop } from '@hellpig/anarchy-engine/Physics';\nimport type { TRenderLoop } from '@hellpig/anarchy-engine/Space';\nimport type { TSpatialLoop } from '@hellpig/anarchy-engine/Spatial';\nimport type { TTextLoop } from '@hellpig/anarchy-engine/Text';\nimport type { TTransformLoop } from '@hellpig/anarchy-engine/TransformDrive';\nimport { mergeAll } from '@hellpig/anarchy-engine/Utils';\nimport type { Subscription } from 'rxjs';\n\nexport function LoopService(factory: TLoopFactory, registry: TLoopRegistry): TLoopService {\n const factorySub$: Subscription = factory.entityCreated$.subscribe((wrapper: TLoop): void => registry.add(wrapper));\n const disposable: ReadonlyArray<TDisposable> = [registry, factory, factorySub$];\n const abstractService: TAbstractService = AbstractService(disposable);\n\n const withCreateService: TLoopServiceWithCreate = withCreateServiceMixin(factory, undefined);\n const withFactory: TLoopServiceWithFactory = withFactoryService(factory);\n const withRegistry: TLoopServiceWithRegistry = withRegistryService(registry);\n\n function getLoop(name: string | undefined, type: LoopType): TLoop {\n const searchName: string = name ?? getMainLoopNameByType(type);\n // If no name is provided, return the main loop\n // otherwise, return the loop with the specified name or throw an error\n return registry.get((loop: TLoop): boolean => loop.name === searchName);\n }\n\n return mergeAll(abstractService, withCreateService, withFactory, withRegistry, {\n getLoop,\n getRenderLoop: (name?: string): TRenderLoop => getLoop(name, LoopType.Render) as TRenderLoop,\n getAudioLoop: (name?: string): TAudioLoop => getLoop(name, LoopType.Audio) as TAudioLoop,\n getPhysicsLoop: (name?: string): TPhysicsLoop => getLoop(name, LoopType.Physics) as TPhysicsLoop,\n getCollisionsLoop: (name?: string): TCollisionsLoop => getLoop(name, LoopType.Collisions) as TCollisionsLoop,\n getKinematicLoop: (name?: string): TKinematicLoop => getLoop(name, LoopType.Kinematic) as TKinematicLoop,\n getSpatialLoop: (name?: string): TSpatialLoop => getLoop(name, LoopType.Spatial) as TSpatialLoop,\n getTransformLoop: (name?: string): TTransformLoop => getLoop(name, LoopType.Transform) as TTransformLoop,\n getTextLoop: (name?: string): TTextLoop => getLoop(name, LoopType.Text) as TTextLoop,\n getMouseLoop: (name?: string): TMouseLoop => getLoop(name, LoopType.Mouse) as TMouseLoop,\n getIntersectionsLoop: (name?: string): TIntersectionsLoop => getLoop(name, LoopType.Intersections) as TIntersectionsLoop,\n getControlsLoop: (name?: string): TControlsLoop => getLoop(name, LoopType.Controls) as TControlsLoop\n });\n}\n"],"names":["LoopService","factory","registry","factorySub$","entityCreated$","subscribe","wrapper","add","abstractService","AbstractService","withCreateService","withCreateServiceMixin","withFactory","withFactoryService","withRegistry","withRegistryService","getLoop","name","type","searchName","getMainLoopNameByType","get","loop","mergeAll","getRenderLoop","LoopType","Render","getAudioLoop","Audio","getPhysicsLoop","Physics","getCollisionsLoop","Collisions","getKinematicLoop","Kinematic","getSpatialLoop","Spatial","getTransformLoop","Transform","getTextLoop","Text","getMouseLoop","Mouse","getIntersectionsLoop","Intersections","getControlsLoop","Controls"],"mappings":"0cAqBO,SAASA,YAAYC,QAAuBC,UACjD,MAAMC,YAA4BF,QAAQG,eAAeC,UAAWC,SAAyBJ,SAASK,IAAID,UAEpGE,gBAAoCC,gBADK,CAACP,SAAUD,QAASE,cAG7DO,kBAA4CC,uBAAuBV,gBACnEW,YAAuCC,mBAAmBZ,SAC1Da,aAAyCC,oBAAoBb,UAEnE,SAASc,QAAQC,KAA0BC,MACzC,MAAMC,WAAqBF,MAAQG,sBAAsBF,MAGzD,OAAOhB,SAASmB,IAAKC,MAAyBA,KAAKL,OAASE,WAC9D,CAEA,OAAOI,SAASf,gBAAiBE,kBAAmBE,YAAaE,aAAc,CAC7EE,gBACAQ,cAAgBP,MAA+BD,QAAQC,KAAMQ,SAASC,QACtEC,aAAeV,MAA8BD,QAAQC,KAAMQ,SAASG,OACpEC,eAAiBZ,MAAgCD,QAAQC,KAAMQ,SAASK,SACxEC,kBAAoBd,MAAmCD,QAAQC,KAAMQ,SAASO,YAC9EC,iBAAmBhB,MAAkCD,QAAQC,KAAMQ,SAASS,WAC5EC,eAAiBlB,MAAgCD,QAAQC,KAAMQ,SAASW,SACxEC,iBAAmBpB,MAAkCD,QAAQC,KAAMQ,SAASa,WAC5EC,YAActB,MAA6BD,QAAQC,KAAMQ,SAASe,MAClEC,aAAexB,MAA8BD,QAAQC,KAAMQ,SAASiB,OACpEC,qBAAuB1B,MAAsCD,QAAQC,KAAMQ,SAASmB,eACpFC,gBAAkB5B,MAAiCD,QAAQC,KAAMQ,SAASqB,WAE9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoopDebugUtils.js","sources":["../../../src/Loop/Utils/LoopDebugUtils.ts"],"sourcesContent":["import type { TLoop } from '@Anarchy/Engine/Loop/Models';\nimport type { Subscription } from 'rxjs';\n\n//calculate tick rate (useful to compare the same tick rate in the main stream and in the worker, cause in worker could be a way faster, and in the main stream could be slowed down by the browser)\nexport function testTickRate(loop: TLoop, durationMs: number = 3000): void {\n let tickCount: number = 0;\n\n const subscription: Subscription = loop.tick$.subscribe((): number => tickCount++);\n\n setTimeout((): void => {\n subscription.unsubscribe();\n console.log(`Loop \"${loop.name}\" called tick$.next() ${tickCount} times in ${durationMs / 1000} seconds.`);\n }, durationMs);\n}\n"],"names":["testTickRate","loop","durationMs","tickCount","subscription","tick$","subscribe","setTimeout","unsubscribe","console","log","name"],"mappings":"AAIO,SAASA,aAAaC,KAAaC,WAAqB,KAC7D,IAAIC,UAAoB,EAExB,MAAMC,aAA6BH,KAAKI,MAAMC,UAAU,IAAcH,aAEtEI,WAAW,KACTH,aAAaI,cACbC,QAAQC,IAAI,SAAST,KAAKU,6BAA6BR,sBAAsBD,WAAa,iBACzFA,WACL"}
1
+ {"version":3,"file":"LoopDebugUtils.js","sources":["../../../src/Loop/Utils/LoopDebugUtils.ts"],"sourcesContent":["import type { TLoop } from '@hellpig/anarchy-engine/Loop/Models';\nimport type { Subscription } from 'rxjs';\n\n//calculate tick rate (useful to compare the same tick rate in the main stream and in the worker, cause in worker could be a way faster, and in the main stream could be slowed down by the browser)\nexport function testTickRate(loop: TLoop, durationMs: number = 3000): void {\n let tickCount: number = 0;\n\n const subscription: Subscription = loop.tick$.subscribe((): number => tickCount++);\n\n setTimeout((): void => {\n subscription.unsubscribe();\n console.log(`Loop \"${loop.name}\" called tick$.next() ${tickCount} times in ${durationMs / 1000} seconds.`);\n }, durationMs);\n}\n"],"names":["testTickRate","loop","durationMs","tickCount","subscription","tick$","subscribe","setTimeout","unsubscribe","console","log","name"],"mappings":"AAIO,SAASA,aAAaC,KAAaC,WAAqB,KAC7D,IAAIC,UAAoB,EAExB,MAAMC,aAA6BH,KAAKI,MAAMC,UAAU,IAAcH,aAEtEI,WAAW,KACTH,aAAaI,cACbC,QAAQC,IAAI,SAAST,KAAKU,6BAA6BR,sBAAsBD,WAAa,iBACzFA,WACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoopUtils.js","sources":["../../../src/Loop/Utils/LoopUtils.ts"],"sourcesContent":["import type { LoopType } from '@Anarchy/Engine/Loop/Constants';\n\nexport const getMainLoopNameByType = (type: LoopType): string => `${type}_main_loop`;\n"],"names":["getMainLoopNameByType","type"],"mappings":"AAEO,MAAMA,sBAAyBC,MAA2B,GAAGA"}
1
+ {"version":3,"file":"LoopUtils.js","sources":["../../../src/Loop/Utils/LoopUtils.ts"],"sourcesContent":["import type { LoopType } from '@hellpig/anarchy-engine/Loop/Constants';\n\nexport const getMainLoopNameByType = (type: LoopType): string => `${type}_main_loop`;\n"],"names":["getMainLoopNameByType","type"],"mappings":"AAEO,MAAMA,sBAAyBC,MAA2B,GAAGA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigToParams.js","sources":["../../../src/Material/Adapters/ConfigToParams.ts"],"sourcesContent":["import {\n BlendEquationMap,\n BlendingDstFactorMap,\n BlendingMap,\n BlendingSrcFactorMap,\n CombineMap,\n DepthPackingStrategiesMap,\n NormalMapTypesMap,\n SideMap,\n StencilOpMap\n} from '@Anarchy/Engine/Material/Constants';\nimport { StencilFuncMap } from '@Anarchy/Engine/Material/Constants/StencilFuncName';\nimport type { TMaterialConfig, TMaterialConfigToParamsDependencies, TMaterialParams, TMaterialParamsOptions, TMaterialParamsTextures } from '@Anarchy/Engine/Material/Models';\nimport type { TTexture } from '@Anarchy/Engine/Texture';\nimport { isDefined } from '@Anarchy/Shared/Utils';\nimport type { Vector2Like } from 'three';\nimport { Vector2 } from 'three';\n\nexport function materialConfigToParams(config: TMaterialConfig, { textureService }: TMaterialConfigToParamsDependencies): TMaterialParams {\n let options: TMaterialParamsOptions = {} as TMaterialParamsOptions;\n\n if (isDefined(config.options)) {\n const { blending, blendDst, blendEquation, blendSrc, side, stencilFunc, stencilFail, stencilZFail, stencilZPass, normalScale, combine, depthPacking, normalMapType, ...rest } =\n config.options as typeof config.options & Readonly<{ normalScale?: Vector2Like }>;\n\n options = { ...rest };\n\n if (isDefined(blending)) options = { ...options, blending: BlendingMap[blending] };\n if (isDefined(blendDst)) options = { ...options, blendDst: BlendingDstFactorMap[blendDst] };\n if (isDefined(blendEquation)) options = { ...options, blendEquation: BlendEquationMap[blendEquation] };\n if (isDefined(blendSrc)) options = { ...options, blendSrc: { ...BlendingSrcFactorMap, ...BlendingDstFactorMap }[blendSrc] };\n if (isDefined(side)) options = { ...options, side: SideMap[side] };\n // if (isDefined(format)) options = { ...options, format: PixelFormatMap[format] };\n if (isDefined(stencilFunc)) options = { ...options, stencilFunc: StencilFuncMap[stencilFunc] };\n if (isDefined(stencilFail)) options = { ...options, stencilFail: StencilOpMap[stencilFail] };\n if (isDefined(stencilZFail)) options = { ...options, stencilZFail: StencilOpMap[stencilZFail] };\n if (isDefined(stencilZPass)) options = { ...options, stencilZPass: StencilOpMap[stencilZPass] };\n if (isDefined(combine)) options = { ...options, combine: CombineMap[combine] };\n if (isDefined(depthPacking)) options = { ...options, depthPacking: DepthPackingStrategiesMap[depthPacking] };\n if (isDefined(normalMapType)) options = { ...options, normalMapType: NormalMapTypesMap[normalMapType] };\n // if (isDefined(referencePosition)) options = { ...options, referencePosition: new Vector3(referencePosition.x, referencePosition.y, referencePosition.z) };\n if (isDefined(normalScale)) options = { ...options, normalScale: new Vector2(normalScale.x, normalScale.y) };\n }\n\n let textures: TMaterialParamsTextures | undefined = undefined;\n if (isDefined(config.textures)) {\n textures = {};\n\n Object.entries(config.textures).forEach(([key, value]: [string, string]): void => {\n const textureEntity: TTexture = textureService.getResourceRegistry().getByKey(value);\n textures = { ...textures, [key]: textureEntity };\n });\n }\n\n return {\n ...config,\n textures,\n options\n };\n}\n"],"names":["materialConfigToParams","config","textureService","textures","options","isDefined","blending","blendDst","blendEquation","blendSrc","side","stencilFunc","stencilFail","stencilZFail","stencilZPass","normalScale","combine","depthPacking","normalMapType","rest","BlendingMap","BlendingDstFactorMap","BlendEquationMap","BlendingSrcFactorMap","SideMap","StencilFuncMap","StencilOpMap","CombineMap","DepthPackingStrategiesMap","NormalMapTypesMap","Vector2","x","y","Object","entries","forEach","key","value","textureEntity","getResourceRegistry","getByKey"],"mappings":"o1BAkBO,SAASA,uBAAuBC,QAAyBC,eAAEA,iBAChE,IAyBIC,SAzBAC,QAAkC,CAAA,EAEtC,GAAIC,UAAUJ,OAAOG,SAAU,CAC7B,MAAME,SAAEA,SAAAC,SAAUA,SAAAC,cAAUA,cAAAC,SAAeA,SAAAC,KAAUA,iBAAMC,YAAAC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figToParams.ts"],"sourcesContent":["import {\n BlendEquationMap,\n BlendingDstFactorMap,\n BlendingMap,\n BlendingSrcFactorMap,\n CombineMap,\n DepthPackingStrategiesMap,\n NormalMapTypesMap,\n SideMap,\n StencilOpMap\n} from '@hellpig/anarchy-engine/Material/Constants';\nimport { StencilFuncMap } from '@hellpig/anarchy-engine/Material/Constants/StencilFuncName';\nimport type { TMaterialConfig, TMaterialConfigToParamsDependencies, TMaterialParams, TMaterialParamsOptions, TMaterialParamsTextures } from '@hellpig/anarchy-engine/Material/Models';\nimport type { TTexture } from '@hellpig/anarchy-engine/Texture';\nimport { isDefined } from '@hellpig/anarchy-shared/Utils';\nimport type { Vector2Like } from 'three';\nimport { Vector2 } from 'three';\n\nexport function materialConfigToParams(config: TMaterialConfig, { textureService }: TMaterialConfigToParamsDependencies): TMaterialParams {\n let options: TMaterialParamsOptions = {} as TMaterialParamsOptions;\n\n if (isDefined(config.options)) {\n const { blending, blendDst, blendEquation, blendSrc, side, stencilFunc, stencilFail, stencilZFail, stencilZPass, normalScale, combine, depthPacking, normalMapType, ...rest } =\n config.options as typeof config.options & Readonly<{ normalScale?: Vector2Like }>;\n\n options = { ...rest };\n\n if (isDefined(blending)) options = { ...options, blending: BlendingMap[blending] };\n if (isDefined(blendDst)) options = { ...options, blendDst: BlendingDstFactorMap[blendDst] };\n if (isDefined(blendEquation)) options = { ...options, blendEquation: BlendEquationMap[blendEquation] };\n if (isDefined(blendSrc)) options = { ...options, blendSrc: { ...BlendingSrcFactorMap, ...BlendingDstFactorMap }[blendSrc] };\n if (isDefined(side)) options = { ...options, side: SideMap[side] };\n // if (isDefined(format)) options = { ...options, format: PixelFormatMap[format] };\n if (isDefined(stencilFunc)) options = { ...options, stencilFunc: StencilFuncMap[stencilFunc] };\n if (isDefined(stencilFail)) options = { ...options, stencilFail: StencilOpMap[stencilFail] };\n if (isDefined(stencilZFail)) options = { ...options, stencilZFail: StencilOpMap[stencilZFail] };\n if (isDefined(stencilZPass)) options = { ...options, stencilZPass: StencilOpMap[stencilZPass] };\n if (isDefined(combine)) options = { ...options, combine: CombineMap[combine] };\n if (isDefined(depthPacking)) options = { ...options, depthPacking: DepthPackingStrategiesMap[depthPacking] };\n if (isDefined(normalMapType)) options = { ...options, normalMapType: NormalMapTypesMap[normalMapType] };\n // if (isDefined(referencePosition)) options = { ...options, referencePosition: new Vector3(referencePosition.x, referencePosition.y, referencePosition.z) };\n if (isDefined(normalScale)) options = { ...options, normalScale: new Vector2(normalScale.x, normalScale.y) };\n }\n\n let textures: TMaterialParamsTextures | undefined = undefined;\n if (isDefined(config.textures)) {\n textures = {};\n\n Object.entries(config.textures).forEach(([key, value]: [string, string]): void => {\n const textureEntity: TTexture = textureService.getResourceRegistry().getByKey(value);\n textures = { ...textures, [key]: textureEntity };\n });\n }\n\n return {\n ...config,\n textures,\n options\n };\n}\n"],"names":["materialConfigToParams","config","textureService","textures","options","isDefined","blending","blendDst","blendEquation","blendSrc","side","stencilFunc","stencilFail","stencilZFail","stencilZPass","normalScale","combine","depthPacking","normalMapType","rest","BlendingMap","BlendingDstFactorMap","BlendEquationMap","BlendingSrcFactorMap","SideMap","StencilFuncMap","StencilOpMap","CombineMap","DepthPackingStrategiesMap","NormalMapTypesMap","Vector2","x","y","Object","entries","forEach","key","value","textureEntity","getResourceRegistry","getByKey"],"mappings":"o1BAkBO,SAASA,uBAAuBC,QAAyBC,eAAEA,iBAChE,IAyBIC,SAzBAC,QAAkC,CAAA,EAEtC,GAAIC,UAAUJ,OAAOG,SAAU,CAC7B,MAAME,SAAEA,SAAAC,SAAUA,SAAAC,cAAUA,cAAAC,SAAeA,SAAAC,KAAUA,iBAAMC,YAAAC,YAAaA,YAAAC,aAAaA,aAAAC,aAAcA,aAAAC,YAAcA,oBAAaC,QAAAC,aAASA,aAAAC,cAAcA,iBAAkBC,MACrKlB,OAAOG,QAETA,QAAU,IAAKe,MAEXd,UAAUC,YAAWF,QAAU,IAAKA,QAASE,SAAUc,YAAYd,YACnED,UAAUE,YAAWH,QAAU,IAAKA,QAASG,SAAUc,qBAAqBd,YAC5EF,UAAUG,iBAAgBJ,QAAU,IAAKA,QAASI,cAAec,iBAAiBd,iBAClFH,UAAUI,YAAWL,QAAU,IAAKA,QAASK,SAAU,IAAKc,wBAAyBF,sBAAuBZ,YAC5GJ,UAAUK,QAAON,QAAU,IAAKA,QAASM,KAAMc,QAAQd,QAEvDL,UAAUM,eAAcP,QAAU,IAAKA,QAASO,YAAac,eAAed,eAC5EN,UAAUO,eAAcR,QAAU,IAAKA,QAASQ,YAAac,aAAad,eAC1EP,UAAUQ,gBAAeT,QAAU,IAAKA,QAASS,aAAca,aAAab,gBAC5ER,UAAUS,gBAAeV,QAAU,IAAKA,QAASU,aAAcY,aAAaZ,gBAC5ET,UAAUW,WAAUZ,QAAU,IAAKA,QAASY,QAASW,WAAWX,WAChEX,UAAUY,gBAAeb,QAAU,IAAKA,QAASa,aAAcW,0BAA0BX,gBACzFZ,UAAUa,iBAAgBd,QAAU,IAAKA,QAASc,cAAeW,kBAAkBX,iBAEnFb,UAAUU,eAAcX,QAAU,IAAKA,QAASW,YAAa,IAAIe,QAAQf,YAAYgB,EAAGhB,YAAYiB,IAC1G,CAYA,OATI3B,UAAUJ,OAAOE,YACnBA,SAAW,CAAA,EAEX8B,OAAOC,QAAQjC,OAAOE,UAAUgC,QAAQ,EAAEC,IAAKC,UAC7C,MAAMC,cAA0BpC,eAAeqC,sBAAsBC,SAASH,OAC9ElC,SAAW,IAAKA,SAAUiC,CAACA,KAAME,kBAI9B,IACFrC,OACHE,kBACAC,gBAEJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityToConfig.js","sources":["../../../src/Material/Adapters/EntityToConfig.ts"],"sourcesContent":["import { serializeColorWhenPossible } from '@Anarchy/Engine/Color';\nimport type { MaterialType } from '@Anarchy/Engine/Material/Constants';\nimport {\n BlendEquationMap,\n BlendingDstFactorMap,\n BlendingMap,\n BlendingSrcFactorMap,\n CombineMap,\n DepthPackingStrategiesMap,\n NormalMapTypesMap,\n SideMap,\n StencilFailMap,\n StencilFuncMap,\n StencilOpMap\n} from '@Anarchy/Engine/Material/Constants';\nimport type {\n TAnyMaterialWrapper,\n TMaterialConfig,\n TMaterialConfigOptions,\n TMaterialConfigTextures,\n TMaterialEntityToConfigDependencies,\n TMaterialParamsTextures,\n TMaterials\n} from '@Anarchy/Engine/Material/Models';\nimport { eulerToXyzIfPossible, getOptionNameIfPossible, vector2ToXyIfPossible } from '@Anarchy/Engine/Material/Utils';\nimport { extractSerializableRegistrableFields } from '@Anarchy/Engine/Mixins';\nimport type { TTexture, TTextureAsyncRegistry } from '@Anarchy/Engine/Texture';\nimport type { TOptional } from '@Anarchy/Shared/Utils';\nimport { filterOutEmptyFields, nullsToUndefined } from '@Anarchy/Shared/Utils';\nimport { isEmpty } from 'lodash-es';\nimport type {\n LineDashedMaterial,\n MeshBasicMaterial,\n MeshDepthMaterial,\n MeshLambertMaterial,\n MeshMatcapMaterial,\n MeshPhongMaterial,\n MeshPhysicalMaterial,\n MeshStandardMaterial,\n PointsMaterial\n} from 'three';\nimport type { SpriteNodeMaterial } from 'three/src/materials/nodes/NodeMaterials';\n\nexport function materialEntityToConfig(entity: TAnyMaterialWrapper, { textureResourceRegistry }: TMaterialEntityToConfigDependencies): TMaterialConfig {\n const options: TMaterialConfigOptions | undefined = getMaterialOptions(entity);\n const textures: TMaterialConfigTextures | undefined = getMaterialTextures(entity, textureResourceRegistry);\n\n return filterOutEmptyFields({\n type: entity.entity.type as MaterialType,\n options,\n textures,\n ...extractSerializableRegistrableFields(entity)\n });\n}\n\nfunction getMaterialOptions({ entity }: TAnyMaterialWrapper): TOptional<TMaterialConfigOptions> | undefined {\n return filterOutEmptyFields(\n nullsToUndefined({\n alphaHash: entity.alphaHash,\n // alphaTest: entity.alphaTest,\n alphaToCoverage: entity.alphaToCoverage,\n anisotropy: (entity as MeshPhysicalMaterial).anisotropy,\n anisotropyRotation: (entity as MeshPhysicalMaterial).anisotropyRotation,\n aoMapIntensity: (entity as MeshPhongMaterial).aoMapIntensity,\n attenuationColor: serializeColorWhenPossible((entity as MeshPhysicalMaterial).attenuationColor),\n attenuationDistance: (entity as MeshPhysicalMaterial).attenuationDistance,\n blendAlpha: entity.blendAlpha,\n blendColor: serializeColorWhenPossible(entity.blendColor),\n blendDst: getOptionNameIfPossible(entity.blendDst, BlendingDstFactorMap, 'blendDst'),\n blendDstAlpha: entity.blendDstAlpha,\n blendEquation: getOptionNameIfPossible(entity.blendEquation, BlendEquationMap, 'blendEquation'),\n blendEquationAlpha: entity.blendEquationAlpha,\n blendSrc: getOptionNameIfPossible(entity.blendSrc, { ...BlendingSrcFactorMap, ...BlendingDstFactorMap }, 'blendSrc'),\n blendSrcAlpha: entity.blendSrcAlpha,\n blending: getOptionNameIfPossible(entity.blending, BlendingMap, 'blending'),\n bumpScale: (entity as MeshPhongMaterial).bumpScale,\n clearcoat: (entity as MeshPhysicalMaterial).clearcoat,\n clearcoatNormalScale: vector2ToXyIfPossible((entity as MeshPhysicalMaterial).clearcoatNormalScale),\n clearcoatRoughness: (entity as MeshPhysicalMaterial).clearcoatRoughness,\n clipIntersection: entity.clipIntersection,\n clipShadows: entity.clipShadows,\n clippingPlanes: entity.clippingPlanes,\n color: serializeColorWhenPossible((entity as MeshBasicMaterial).color),\n colorWrite: entity.colorWrite,\n combine: getOptionNameIfPossible((entity as MeshBasicMaterial).combine, CombineMap, 'combine'),\n dashSize: (entity as LineDashedMaterial).dashSize,\n depthFunc: entity.depthFunc,\n depthPacking: getOptionNameIfPossible((entity as MeshDepthMaterial).depthPacking, DepthPackingStrategiesMap, 'depthPacking'),\n depthTest: entity.depthTest,\n depthWrite: entity.depthWrite,\n displacementBias: (entity as MeshPhongMaterial).displacementBias,\n displacementScale: (entity as MeshPhongMaterial).displacementScale,\n dithering: entity.dithering,\n emissive: serializeColorWhenPossible((entity as MeshLambertMaterial).emissive),\n emissiveIntensity: (entity as MeshLambertMaterial).emissiveIntensity,\n envMapIntensity: (entity as MeshStandardMaterial).envMapIntensity,\n envMapRotation: eulerToXyzIfPossible((entity as MeshPhongMaterial).envMapRotation),\n // farDistance: (entity as MeshDistanceMaterialParameters).farDistance,\n flatShading: (entity as MeshStandardMaterial).flatShading,\n fog: (entity as MeshPhongMaterial).fog,\n forceSinglePass: entity.forceSinglePass,\n gapSize: (entity as LineDashedMaterial).gapSize,\n ior: (entity as MeshPhysicalMaterial).ior,\n iridescence: (entity as MeshPhysicalMaterial).iridescence,\n iridescenceIOR: (entity as MeshPhysicalMaterial).iridescenceIOR,\n iridescenceThicknessRange: (entity as MeshPhysicalMaterial).iridescenceThicknessRange,\n lightMapIntensity: (entity as MeshPhongMaterial).lightMapIntensity,\n linewidth: (entity as LineDashedMaterial).linewidth,\n matcap: (entity as MeshMatcapMaterial).matcap,\n metalness: (entity as MeshStandardMaterial).metalness,\n // nearDistance: (entity as MeshDistanceMaterialParameters).nearDistance,\n normalMapType: getOptionNameIfPossible((entity as MeshStandardMaterial).normalMapType, NormalMapTypesMap, 'normalMapType'),\n normalScale: vector2ToXyIfPossible((entity as MeshStandardMaterial).normalScale),\n opacity: entity.opacity,\n polygonOffset: entity.polygonOffset,\n polygonOffsetFactor: entity.polygonOffsetFactor,\n polygonOffsetUnits: entity.polygonOffsetUnits,\n precision: entity.precision,\n premultipliedAlpha: entity.premultipliedAlpha,\n // referencePosition: vector3ToXyzIfPossible((entity as MeshDistanceMaterialParameters).referencePosition),\n reflectivity: (entity as MeshPhysicalMaterial).reflectivity,\n refractionRatio: (entity as MeshBasicMaterial).refractionRatio,\n rotation: (entity as SpriteNodeMaterial).rotation,\n roughness: (entity as MeshStandardMaterial).roughness,\n scale: (entity as LineDashedMaterial).scale,\n shadowSide: entity.shadowSide,\n sheen: (entity as MeshPhysicalMaterial).sheen,\n sheenColor: serializeColorWhenPossible((entity as MeshPhysicalMaterial).sheenColor),\n sheenRoughness: (entity as MeshPhysicalMaterial).sheenRoughness,\n shininess: (entity as MeshPhongMaterial).shininess,\n side: getOptionNameIfPossible(entity.side, SideMap, 'side'),\n size: (entity as PointsMaterial).size,\n sizeAttenuation: (entity as PointsMaterial).sizeAttenuation,\n specular: serializeColorWhenPossible((entity as MeshPhongMaterial).specular),\n specularColor: serializeColorWhenPossible((entity as MeshPhysicalMaterial).specularColor),\n specularIntensity: (entity as MeshPhysicalMaterial).specularIntensity,\n stencilFail: getOptionNameIfPossible(entity.stencilFail, StencilFailMap, 'stencilFail'),\n stencilFunc: getOptionNameIfPossible(entity.stencilFunc, StencilFuncMap, 'stencilFunc'),\n stencilFuncMask: entity.stencilFuncMask,\n stencilRef: entity.stencilRef,\n stencilWrite: entity.stencilWrite,\n stencilWriteMask: entity.stencilWriteMask,\n stencilZFail: getOptionNameIfPossible(entity.stencilZFail, StencilOpMap, 'stencilZFail'),\n stencilZPass: getOptionNameIfPossible(entity.stencilZPass, StencilOpMap, 'stencilZPass'),\n thickness: (entity as MeshPhysicalMaterial).thickness,\n toneMapped: entity.toneMapped,\n transmission: (entity as MeshPhysicalMaterial).transmission,\n transparent: entity.transparent,\n vertexColors: entity.vertexColors,\n visible: entity.visible,\n wireframe: (entity as MeshPhongMaterial).wireframe,\n // wireframeLinecap: (entity as MeshPhongMaterial).wireframeLinecap\n // wireframeLinejoin: (entity as MeshPhongMaterial).wireframeLinejoin\n wireframeLinewidth: (entity as MeshPhongMaterial).wireframeLinewidth\n })\n );\n}\n\nfunction getMaterialTextures({ entity }: TAnyMaterialWrapper, textureResourceRegistry: TTextureAsyncRegistry): TMaterialConfigTextures | undefined | never {\n const maps: TMaterialParamsTextures = getMaps(entity);\n const mapsKeys: { [key: string]: string } = {};\n\n Object.entries(maps).forEach(([key, value]: [string, TTexture]): void | never => {\n // eslint-disable-next-line functional/immutable-data\n mapsKeys[key] = textureResourceRegistry.getKeyByValue(value);\n });\n\n return isEmpty(mapsKeys) ? undefined : mapsKeys;\n}\n\nfunction isTextureKey(key: string): key is keyof TMaterialParamsTextures {\n return key.toLowerCase().endsWith('map');\n}\n\nfunction getMaps(entity: TMaterials): TMaterialParamsTextures {\n return filterOutEmptyFields(\n Object.entries(entity).reduce((acc: TMaterialParamsTextures, [key, value]): TMaterialParamsTextures => {\n if (isTextureKey(key)) {\n // eslint-disable-next-line functional/immutable-data\n acc[key] = value as TMaterialParamsTextures[typeof key];\n }\n return acc;\n }, {})\n );\n}\n"],"names":["materialEntityToConfig","entity","textureResourceRegistry","options","filterOutEmptyFields","nullsToUndefined","alphaHash","alphaToCoverage","anisotropy","anisotropyRotation","aoMapIntensity","attenuationColor","serializeColorWhenPossible","attenuationDistance","blendAlpha","blendColor","blendDst","getOptionNameIfPossible","BlendingDstFactorMap","blendDstAlpha","blendEquation","BlendEquationMap","blendEquationAlpha","blendSrc","BlendingSrcFactorMap","blendSrcAlpha","blending","BlendingMap","bumpScale","clearcoat","clearcoatNormalScale","vector2ToXyIfPossible","clearcoatRoughness","clipIntersection","clipShadows","clippingPlanes","color","colorWrite","combine","CombineMap","dashSize","depthFunc","depthPacking","DepthPackingStrategiesMap","depthTest","depthWrite","displacementBias","displacementScale","dithering","emissive","emissiveIntensity","envMapIntensity","envMapRotation","eulerToXyzIfPossible","flatShading","fog","forceSinglePass","gapSize","ior","iridescence","iridescenceIOR","iridescenceThicknessRange","lightMapIntensity","linewidth","matcap","metalness","normalMapType","NormalMapTypesMap","normalScale","opacity","polygonOffset","polygonOffsetFactor","polygonOffsetUnits","precision","premultipliedAlpha","reflectivity","refractionRatio","rotation","roughness","scale","shadowSide","sheen","sheenColor","sheenRoughness","shininess","side","SideMap","size","sizeAttenuation","specular","specularColor","specularIntensity","stencilFail","StencilFailMap","stencilFunc","StencilFuncMap","stencilFuncMask","stencilRef","stencilWrite","stencilWriteMask","stencilZFail","StencilOpMap","stencilZPass","thickness","toneMapped","transmission","transparent","vertexColors","visible","wireframe","wireframeLinewidth","getMaterialOptions","textures","maps","Object","entries","reduce","acc","key","value","toLowerCase","endsWith","isTextureKey","getMaps","mapsKeys","forEach","getKe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hB,OAAO6F,YAAaC,eAAgB,eACzEC,gBAAiB/F,OAAO+F,gBACxBC,WAAYhG,OAAOgG,WACnBC,aAAcjG,OAAOiG,aACrBC,iBAAkBlG,OAAOkG,iBACzBC,aAAcnF,wBAAwBhB,OAAOmG,aAAcC,aAAc,gBACzEC,aAAcrF,wBAAwBhB,OAAOqG,aAAcD,aAAc,gBACzEE,UAAYtG,OAAgCsG,UAC5CC,WAAYvG,OAAOuG,WACnBC,aAAexG,OAAgCwG,aAC/CC,YAAazG,OAAOyG,YACpBC,aAAc1G,OAAO0G,aACrBC,QAAS3G,OAAO2G,QAChBC,UAAY5G,OAA6B4G,UAGzCC,mBAAqB7G,OAA6B6G,qBAGxD,CAhHsDC,CAAmB9G,QACjE+G,SAiHR,UAA6B/G,OAAEA,QAA+BC,yBAC5D,MAAM+G,KAeR,SAAiBhH,QACf,OAAOG,qBACL8G,OAAOC,QAAQlH,QAAQmH,OAAO,CAACC,KAA+BC,IAAKC,UANvE,SAAsBD,KACpB,OAAOA,IAAIE,cAAcC,SAAS,MACpC,CAKUC,CAAaJ,OAEfD,IAAIC,KAAOC,OAENF,KACN,CAAA,GAEP,CAzBwCM,CAAQ1H,QACxC2H,SAAsC,CAAA,EAO5C,OALAV,OAAOC,QAAQF,MAAMY,QAAQ,EAAEP,IAAKC,UAElCK,SAASN,KAAOpH,wBAAwB4H,cAAcP,SAGjDQ,QAAQH,eAAY,EAAYA,QACzC,CA3HwDI,CAAoB/H,OAAQC,yBAElF,OAAOE,qBAAqB,CAC1B6H,KAAMhI,OAAOA,OAAOgI,KACpB9H,gBACA6G,qBACGkB,qCAAqCjI,SAE5C"}
1
+ {"version":3,"file":"EntityToConfig.js","sources":["../../../src/Material/Adapters/EntityToConfig.ts"],"sourcesContent":["import { serializeColorWhenPossible } from '@hellpig/anarchy-engine/Color';\nimport type { MaterialType } from '@hellpig/anarchy-engine/Material/Constants';\nimport {\n BlendEquationMap,\n BlendingDstFactorMap,\n BlendingMap,\n BlendingSrcFactorMap,\n CombineMap,\n DepthPackingStrategiesMap,\n NormalMapTypesMap,\n SideMap,\n StencilFailMap,\n StencilFuncMap,\n StencilOpMap\n} from '@hellpig/anarchy-engine/Material/Constants';\nimport type {\n TAnyMaterialWrapper,\n TMaterialConfig,\n TMaterialConfigOptions,\n TMaterialConfigTextures,\n TMaterialEntityToConfigDependencies,\n TMaterialParamsTextures,\n TMaterials\n} from '@hellpig/anarchy-engine/Material/Models';\nimport { eulerToXyzIfPossible, getOptionNameIfPossible, vector2ToXyIfPossible } from '@hellpig/anarchy-engine/Material/Utils';\nimport { extractSerializableRegistrableFields } from '@hellpig/anarchy-engine/Mixins';\nimport type { TTexture, TTextureAsyncRegistry } from '@hellpig/anarchy-engine/Texture';\nimport type { TOptional } from '@hellpig/anarchy-shared/Utils';\nimport { filterOutEmptyFields, nullsToUndefined } from '@hellpig/anarchy-shared/Utils';\nimport { isEmpty } from 'lodash-es';\nimport type {\n LineDashedMaterial,\n MeshBasicMaterial,\n MeshDepthMaterial,\n MeshLambertMaterial,\n MeshMatcapMaterial,\n MeshPhongMaterial,\n MeshPhysicalMaterial,\n MeshStandardMaterial,\n PointsMaterial\n} from 'three';\nimport type { SpriteNodeMaterial } from 'three/src/materials/nodes/NodeMaterials';\n\nexport function materialEntityToConfig(entity: TAnyMaterialWrapper, { textureResourceRegistry }: TMaterialEntityToConfigDependencies): TMaterialConfig {\n const options: TMaterialConfigOptions | undefined = getMaterialOptions(entity);\n const textures: TMaterialConfigTextures | undefined = getMaterialTextures(entity, textureResourceRegistry);\n\n return filterOutEmptyFields({\n type: entity.entity.type as MaterialType,\n options,\n textures,\n ...extractSerializableRegistrableFields(entity)\n });\n}\n\nfunction getMaterialOptions({ entity }: TAnyMaterialWrapper): TOptional<TMaterialConfigOptions> | undefined {\n return filterOutEmptyFields(\n nullsToUndefined({\n alphaHash: entity.alphaHash,\n // alphaTest: entity.alphaTest,\n alphaToCoverage: entity.alphaToCoverage,\n anisotropy: (entity as MeshPhysicalMaterial).anisotropy,\n anisotropyRotation: (entity as MeshPhysicalMaterial).anisotropyRotation,\n aoMapIntensity: (entity as MeshPhongMaterial).aoMapIntensity,\n attenuationColor: serializeColorWhenPossible((entity as MeshPhysicalMaterial).attenuationColor),\n attenuationDistance: (entity as MeshPhysicalMaterial).attenuationDistance,\n blendAlpha: entity.blendAlpha,\n blendColor: serializeColorWhenPossible(entity.blendColor),\n blendDst: getOptionNameIfPossible(entity.blendDst, BlendingDstFactorMap, 'blendDst'),\n blendDstAlpha: entity.blendDstAlpha,\n blendEquation: getOptionNameIfPossible(entity.blendEquation, BlendEquationMap, 'blendEquation'),\n blendEquationAlpha: entity.blendEquationAlpha,\n blendSrc: getOptionNameIfPossible(entity.blendSrc, { ...BlendingSrcFactorMap, ...BlendingDstFactorMap }, 'blendSrc'),\n blendSrcAlpha: entity.blendSrcAlpha,\n blending: getOptionNameIfPossible(entity.blending, BlendingMap, 'blending'),\n bumpScale: (entity as MeshPhongMaterial).bumpScale,\n clearcoat: (entity as MeshPhysicalMaterial).clearcoat,\n clearcoatNormalScale: vector2ToXyIfPossible((entity as MeshPhysicalMaterial).clearcoatNormalScale),\n clearcoatRoughness: (entity as MeshPhysicalMaterial).clearcoatRoughness,\n clipIntersection: entity.clipIntersection,\n clipShadows: entity.clipShadows,\n clippingPlanes: entity.clippingPlanes,\n color: serializeColorWhenPossible((entity as MeshBasicMaterial).color),\n colorWrite: entity.colorWrite,\n combine: getOptionNameIfPossible((entity as MeshBasicMaterial).combine, CombineMap, 'combine'),\n dashSize: (entity as LineDashedMaterial).dashSize,\n depthFunc: entity.depthFunc,\n depthPacking: getOptionNameIfPossible((entity as MeshDepthMaterial).depthPacking, DepthPackingStrategiesMap, 'depthPacking'),\n depthTest: entity.depthTest,\n depthWrite: entity.depthWrite,\n displacementBias: (entity as MeshPhongMaterial).displacementBias,\n displacementScale: (entity as MeshPhongMaterial).displacementScale,\n dithering: entity.dithering,\n emissive: serializeColorWhenPossible((entity as MeshLambertMaterial).emissive),\n emissiveIntensity: (entity as MeshLambertMaterial).emissiveIntensity,\n envMapIntensity: (entity as MeshStandardMaterial).envMapIntensity,\n envMapRotation: eulerToXyzIfPossible((entity as MeshPhongMaterial).envMapRotation),\n // farDistance: (entity as MeshDistanceMaterialParameters).farDistance,\n flatShading: (entity as MeshStandardMaterial).flatShading,\n fog: (entity as MeshPhongMaterial).fog,\n forceSinglePass: entity.forceSinglePass,\n gapSize: (entity as LineDashedMaterial).gapSize,\n ior: (entity as MeshPhysicalMaterial).ior,\n iridescence: (entity as MeshPhysicalMaterial).iridescence,\n iridescenceIOR: (entity as MeshPhysicalMaterial).iridescenceIOR,\n iridescenceThicknessRange: (entity as MeshPhysicalMaterial).iridescenceThicknessRange,\n lightMapIntensity: (entity as MeshPhongMaterial).lightMapIntensity,\n linewidth: (entity as LineDashedMaterial).linewidth,\n matcap: (entity as MeshMatcapMaterial).matcap,\n metalness: (entity as MeshStandardMaterial).metalness,\n // nearDistance: (entity as MeshDistanceMaterialParameters).nearDistance,\n normalMapType: getOptionNameIfPossible((entity as MeshStandardMaterial).normalMapType, NormalMapTypesMap, 'normalMapType'),\n normalScale: vector2ToXyIfPossible((entity as MeshStandardMaterial).normalScale),\n opacity: entity.opacity,\n polygonOffset: entity.polygonOffset,\n polygonOffsetFactor: entity.polygonOffsetFactor,\n polygonOffsetUnits: entity.polygonOffsetUnits,\n precision: entity.precision,\n premultipliedAlpha: entity.premultipliedAlpha,\n // referencePosition: vector3ToXyzIfPossible((entity as MeshDistanceMaterialParameters).referencePosition),\n reflectivity: (entity as MeshPhysicalMaterial).reflectivity,\n refractionRatio: (entity as MeshBasicMaterial).refractionRatio,\n rotation: (entity as SpriteNodeMaterial).rotation,\n roughness: (entity as MeshStandardMaterial).roughness,\n scale: (entity as LineDashedMaterial).scale,\n shadowSide: entity.shadowSide,\n sheen: (entity as MeshPhysicalMaterial).sheen,\n sheenColor: serializeColorWhenPossible((entity as MeshPhysicalMaterial).sheenColor),\n sheenRoughness: (entity as MeshPhysicalMaterial).sheenRoughness,\n shininess: (entity as MeshPhongMaterial).shininess,\n side: getOptionNameIfPossible(entity.side, SideMap, 'side'),\n size: (entity as PointsMaterial).size,\n sizeAttenuation: (entity as PointsMaterial).sizeAttenuation,\n specular: serializeColorWhenPossible((entity as MeshPhongMaterial).specular),\n specularColor: serializeColorWhenPossible((entity as MeshPhysicalMaterial).specularColor),\n specularIntensity: (entity as MeshPhysicalMaterial).specularIntensity,\n stencilFail: getOptionNameIfPossible(entity.stencilFail, StencilFailMap, 'stencilFail'),\n stencilFunc: getOptionNameIfPossible(entity.stencilFunc, StencilFuncMap, 'stencilFunc'),\n stencilFuncMask: entity.stencilFuncMask,\n stencilRef: entity.stencilRef,\n stencilWrite: entity.stencilWrite,\n stencilWriteMask: entity.stencilWriteMask,\n stencilZFail: getOptionNameIfPossible(entity.stencilZFail, StencilOpMap, 'stencilZFail'),\n stencilZPass: getOptionNameIfPossible(entity.stencilZPass, StencilOpMap, 'stencilZPass'),\n thickness: (entity as MeshPhysicalMaterial).thickness,\n toneMapped: entity.toneMapped,\n transmission: (entity as MeshPhysicalMaterial).transmission,\n transparent: entity.transparent,\n vertexColors: entity.vertexColors,\n visible: entity.visible,\n wireframe: (entity as MeshPhongMaterial).wireframe,\n // wireframeLinecap: (entity as MeshPhongMaterial).wireframeLinecap\n // wireframeLinejoin: (entity as MeshPhongMaterial).wireframeLinejoin\n wireframeLinewidth: (entity as MeshPhongMaterial).wireframeLinewidth\n })\n );\n}\n\nfunction getMaterialTextures({ entity }: TAnyMaterialWrapper, textureResourceRegistry: TTextureAsyncRegistry): TMaterialConfigTextures | undefined | never {\n const maps: TMaterialParamsTextures = getMaps(entity);\n const mapsKeys: { [key: string]: string } = {};\n\n Object.entries(maps).forEach(([key, value]: [string, TTexture]): void | never => {\n // eslint-disable-next-line functional/immutable-data\n mapsKeys[key] = textureResourceRegistry.getKeyByValue(value);\n });\n\n return isEmpty(mapsKeys) ? undefined : mapsKeys;\n}\n\nfunction isTextureKey(key: string): key is keyof TMaterialParamsTextures {\n return key.toLowerCase().endsWith('map');\n}\n\nfunction getMaps(entity: TMaterials): TMaterialParamsTextures {\n return filterOutEmptyFields(\n Object.entries(entity).reduce((acc: TMaterialParamsTextures, [key, value]): TMaterialParamsTextures => {\n if (isTextureKey(key)) {\n // eslint-disable-next-line functional/immutable-data\n acc[key] = value as TMaterialParamsTextures[typeof key];\n }\n return acc;\n }, {})\n );\n}\n"],"names":["materialEntityToConfig","entity","textureResourceRegistry","options","filterOutEmptyFields","nullsToUndefined","alphaHash","alphaToCoverage","anisotropy","anisotropyRotation","aoMapIntensity","attenuationColor","serializeColorWhenPossible","attenuationDistance","blendAlpha","blendColor","blendDst","getOptionNameIfPossible","BlendingDstFactorMap","blendDstAlpha","blendEquation","BlendEquationMap","blendEquationAlpha","blendSrc","BlendingSrcFactorMap","blendSrcAlpha","blending","BlendingMap","bumpScale","clearcoat","clearcoatNormalScale","vector2ToXyIfPossible","clearcoatRoughness","clipIntersection","clipShadows","clippingPlanes","color","colorWrite","combine","CombineMap","dashSize","depthFunc","depthPacking","DepthPackingStrategiesMap","depthTest","depthWrite","displacementBias","displacementScale","dithering","emissive","emissiveIntensity","envMapIntensity","envMapRotation","eulerToXyzIfPossible","flatShading","fog","forceSinglePass","gapSize","ior","iridescence","iridescenceIOR","iridescenceThicknessRange","lightMapIntensity","linewidth","matcap","metalness","normalMapType","NormalMapTypesMap","normalScale","opacity","polygonOffset","polygonOffsetFactor","polygonOffsetUnits","precision","premultipliedAlpha","reflectivity","refractionRatio","rotation","roughness","scale","shadowSide","sheen","sheenColor","sheenRoughness","shininess","side","SideMap","size","sizeAttenuation","specular","specularColor","specularIntensity","stencilFail","StencilFailMap","stencilFunc","StencilFuncMap","stencilFuncMask","stencilRef","stencilWrite","stencilWriteMask","stencilZFail","StencilOpMap","stencilZPass","thickness","toneMapped","transmission","transparent","vertexColors","visible","wireframe","wireframeLinewidth","getMaterialOptions","textures","maps","Object","entries","reduce","acc","key","value","toLowerCase","endsWith","isTextureKey","getMaps","mapsKeys","forEach","getKeyByValue","isEmpty","getMaterialTextures","type","extractSerializableRegistrableFields"],"mappings":"s0CA2CO,SAASA,uBAAuBC,QAA6BC,wBAAEA,0BACpE,MAAMC,QAWR,UAA4BF,OAAEA,SAC5B,OAAOG,qBACLC,iBAAiB,CACfC,UAAWL,OAAOK,UAElBC,gBAAiBN,OAAOM,gBACxBC,WAAaP,OAAgCO,WAC7CC,mBAAqBR,OAAgCQ,mBACrDC,eAAiBT,OAA6BS,eAC9CC,iBAAkBC,2BAA4BX,OAAgCU,kBAC9EE,oBAAsBZ,OAAgCY,oBACtDC,WAAYb,OAAOa,WACnBC,WAAYH,2BAA2BX,OAAOc,YAC9CC,SAAUC,wBAAwBhB,OAAOe,SAAUE,qBAAsB,YACzEC,cAAelB,OAAOkB,cACtBC,cAAeH,wBAAwBhB,OAAOmB,cAAeC,iBAAkB,iBAC/EC,mBAAoBrB,OAAOqB,mBAC3BC,SAAUN,wBAAwBhB,OAAOsB,SAAU,IAAKC,wBAAyBN,sBAAwB,YACzGO,cAAexB,OAAOwB,cACtBC,SAAUT,wBAAwBhB,OAAOyB,SAAUC,YAAa,YAChEC,UAAY3B,OAA6B2B,UACzCC,UAAY5B,OAAgC4B,UAC5CC,qBAAsBC,sBAAuB9B,OAAgC6B,sBAC7EE,mBAAqB/B,OAAgC+B,mBACrDC,iBAAkBhC,OAAOgC,iBACzBC,YAAajC,OAAOiC,YACpBC,eAAgBlC,OAAOkC,eACvBC,MAAOxB,2BAA4BX,OAA6BmC,OAChEC,WAAYpC,OAAOoC,WACnBC,QAASrB,wBAAyBhB,OAA6BqC,QAASC,WAAY,WACpFC,SAAWvC,OAA8BuC,SACzCC,UAAWxC,OAAOwC,UAClBC,aAAczB,wBAAyBhB,OAA6ByC,aAAcC,0BAA2B,gBAC7GC,UAAW3C,OAAO2C,UAClBC,WAAY5C,OAAO4C,WACnBC,iBAAmB7C,OAA6B6C,iBAChDC,k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AAwBhB,OAAO2F,YAAaC,eAAgB,eACzEC,YAAa7E,wBAAwBhB,OAAO6F,YAAaC,eAAgB,eACzEC,gBAAiB/F,OAAO+F,gBACxBC,WAAYhG,OAAOgG,WACnBC,aAAcjG,OAAOiG,aACrBC,iBAAkBlG,OAAOkG,iBACzBC,aAAcnF,wBAAwBhB,OAAOmG,aAAcC,aAAc,gBACzEC,aAAcrF,wBAAwBhB,OAAOqG,aAAcD,aAAc,gBACzEE,UAAYtG,OAAgCsG,UAC5CC,WAAYvG,OAAOuG,WACnBC,aAAexG,OAAgCwG,aAC/CC,YAAazG,OAAOyG,YACpBC,aAAc1G,OAAO0G,aACrBC,QAAS3G,OAAO2G,QAChBC,UAAY5G,OAA6B4G,UAGzCC,mBAAqB7G,OAA6B6G,qBAGxD,CAhHsDC,CAAmB9G,QACjE+G,SAiHR,UAA6B/G,OAAEA,QAA+BC,yBAC5D,MAAM+G,KAeR,SAAiBhH,QACf,OAAOG,qBACL8G,OAAOC,QAAQlH,QAAQmH,OAAO,CAACC,KAA+BC,IAAKC,UANvE,SAAsBD,KACpB,OAAOA,IAAIE,cAAcC,SAAS,MACpC,CAKUC,CAAaJ,OAEfD,IAAIC,KAAOC,OAENF,KACN,CAAA,GAEP,CAzBwCM,CAAQ1H,QACxC2H,SAAsC,CAAA,EAO5C,OALAV,OAAOC,QAAQF,MAAMY,QAAQ,EAAEP,IAAKC,UAElCK,SAASN,KAAOpH,wBAAwB4H,cAAcP,SAGjDQ,QAAQH,eAAY,EAAYA,QACzC,CA3HwDI,CAAoB/H,OAAQC,yBAElF,OAAOE,qBAAqB,CAC1B6H,KAAMhI,OAAOA,OAAOgI,KACpB9H,gBACA6G,qBACGkB,qCAAqCjI,SAE5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialMap.js","sources":["../../../../src/Material/Constants/Material/MaterialMap.ts"],"sourcesContent":["import type { TTypeOfMaterials } from '@Anarchy/Engine/Material/Models';\nimport {\n LineBasicMaterial,\n LineDashedMaterial,\n MeshBasicMaterial,\n MeshDepthMaterial,\n MeshDistanceMaterial,\n MeshLambertMaterial,\n MeshMatcapMaterial,\n MeshNormalMaterial,\n MeshPhongMaterial,\n MeshPhysicalMaterial,\n MeshStandardMaterial,\n MeshToonMaterial,\n PointsMaterial,\n RawShaderMaterial,\n ShaderMaterial,\n ShadowMaterial,\n SpriteMaterial\n} from 'three';\n\nimport { MaterialType } from './MaterialType';\n\nexport const MaterialMap: Readonly<Record<MaterialType, TTypeOfMaterials>> = {\n [MaterialType.Basic]: MeshBasicMaterial,\n [MaterialType.Depth]: MeshDepthMaterial,\n [MaterialType.Distance]: MeshDistanceMaterial,\n [MaterialType.Lambert]: MeshLambertMaterial,\n [MaterialType.LineBasic]: LineBasicMaterial,\n [MaterialType.LineDashed]: LineDashedMaterial,\n [MaterialType.Matcap]: MeshMatcapMaterial,\n [MaterialType.Normal]: MeshNormalMaterial,\n [MaterialType.Phong]: MeshPhongMaterial,\n [MaterialType.Physical]: MeshPhysicalMaterial,\n [MaterialType.Points]: PointsMaterial,\n [MaterialType.RawShader]: RawShaderMaterial,\n [MaterialType.Shader]: ShaderMaterial,\n [MaterialType.Shadow]: ShadowMaterial,\n [MaterialType.Sprite]: SpriteMaterial,\n [MaterialType.Standard]: MeshStandardMaterial,\n [MaterialType.Toon]: MeshToonMaterial\n};\n"],"names":["MaterialMap","MaterialType","Basic","MeshBasicMaterial","Depth","MeshDepthMaterial","Distance","MeshDistanceMaterial","Lambert","MeshLambertMaterial","LineBasic","LineBasicMaterial","LineDashed","LineDashedMaterial","Matcap","MeshMatcapMaterial","Normal","MeshNormalMaterial","Phong","MeshPhongMaterial","Physical","MeshPhysicalMaterial","Points","PointsMaterial","RawShader","RawShaderMaterial","Shader","ShaderMaterial","Shadow","ShadowMaterial","Sprite","SpriteMaterial","Standard","MeshStandardMaterial","Toon","MeshToonMaterial"],"mappings":"kXAuBO,MAAMA,YAAgE,CAC3E,CAACC,aAAaC,OAAQC,kBACtB,CAACF,aAAaG,OAAQC,kBACtB,CAACJ,aAAaK,UAAWC,qBACzB,CAACN,aAAaO,SAAUC,oBACxB,CAACR,aAAaS,WAAYC,kBAC1B,CAACV,aAAaW,YAAaC,mBAC3B,CAACZ,aAAaa,QAASC,mBACvB,CAACd,aAAae,QAASC,mBACvB,CAAChB,aAAaiB,OAAQC,kBACtB,CAAClB,aAAamB,UAAWC,qBACzB,CAACpB,aAAaqB,QAASC,eACvB,CAACtB,aAAauB,WAAYC,kBAC1B,CAACxB,aAAayB,QAASC,eACvB,CAAC1B,aAAa2B,QAASC,eACvB,CAAC5B,aAAa6B,QAASC,eACvB,CAAC9B,aAAa+B,UAAWC,qBACzB,CAAChC,aAAaiC,MAAOC"}
1
+ {"version":3,"file":"MaterialMap.js","sources":["../../../../src/Material/Constants/Material/MaterialMap.ts"],"sourcesContent":["import type { TTypeOfMaterials } from '@hellpig/anarchy-engine/Material/Models';\nimport {\n LineBasicMaterial,\n LineDashedMaterial,\n MeshBasicMaterial,\n MeshDepthMaterial,\n MeshDistanceMaterial,\n MeshLambertMaterial,\n MeshMatcapMaterial,\n MeshNormalMaterial,\n MeshPhongMaterial,\n MeshPhysicalMaterial,\n MeshStandardMaterial,\n MeshToonMaterial,\n PointsMaterial,\n RawShaderMaterial,\n ShaderMaterial,\n ShadowMaterial,\n SpriteMaterial\n} from 'three';\n\nimport { MaterialType } from './MaterialType';\n\nexport const MaterialMap: Readonly<Record<MaterialType, TTypeOfMaterials>> = {\n [MaterialType.Basic]: MeshBasicMaterial,\n [MaterialType.Depth]: MeshDepthMaterial,\n [MaterialType.Distance]: MeshDistanceMaterial,\n [MaterialType.Lambert]: MeshLambertMaterial,\n [MaterialType.LineBasic]: LineBasicMaterial,\n [MaterialType.LineDashed]: LineDashedMaterial,\n [MaterialType.Matcap]: MeshMatcapMaterial,\n [MaterialType.Normal]: MeshNormalMaterial,\n [MaterialType.Phong]: MeshPhongMaterial,\n [MaterialType.Physical]: MeshPhysicalMaterial,\n [MaterialType.Points]: PointsMaterial,\n [MaterialType.RawShader]: RawShaderMaterial,\n [MaterialType.Shader]: ShaderMaterial,\n [MaterialType.Shadow]: ShadowMaterial,\n [MaterialType.Sprite]: SpriteMaterial,\n [MaterialType.Standard]: MeshStandardMaterial,\n [MaterialType.Toon]: MeshToonMaterial\n};\n"],"names":["MaterialMap","MaterialType","Basic","MeshBasicMaterial","Depth","MeshDepthMaterial","Distance","MeshDistanceMaterial","Lambert","MeshLambertMaterial","LineBasic","LineBasicMaterial","LineDashed","LineDashedMaterial","Matcap","MeshMatcapMaterial","Normal","MeshNormalMaterial","Phong","MeshPhongMaterial","Physical","MeshPhysicalMaterial","Points","PointsMaterial","RawShader","RawShaderMaterial","Shader","ShaderMaterial","Shadow","ShadowMaterial","Sprite","SpriteMaterial","Standard","MeshStandardMaterial","Toon","MeshToonMaterial"],"mappings":"kXAuBO,MAAMA,YAAgE,CAC3E,CAACC,aAAaC,OAAQC,kBACtB,CAACF,aAAaG,OAAQC,kBACtB,CAACJ,aAAaK,UAAWC,qBACzB,CAACN,aAAaO,SAAUC,oBACxB,CAACR,aAAaS,WAAYC,kBAC1B,CAACV,aAAaW,YAAaC,mBAC3B,CAACZ,aAAaa,QAASC,mBACvB,CAACd,aAAae,QAASC,mBACvB,CAAChB,aAAaiB,OAAQC,kBACtB,CAAClB,aAAamB,UAAWC,qBACzB,CAACpB,aAAaqB,QAASC,eACvB,CAACtB,aAAauB,WAAYC,kBAC1B,CAACxB,aAAayB,QAASC,eACvB,CAAC1B,aAAa2B,QAASC,eACvB,CAAC5B,aAAa6B,QAASC,eACvB,CAAC9B,aAAa+B,UAAWC,qBACzB,CAAChC,aAAaiC,MAAOC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialFactory.js","sources":["../../../src/Material/Factories/MaterialFactory.ts"],"sourcesContent":["import type { TReactiveFactory } from '@Anarchy/Engine/Abstract';\nimport { FactoryType, ReactiveFactory } from '@Anarchy/Engine/Abstract';\nimport { materialConfigToParams } from '@Anarchy/Engine/Material/Adapters';\nimport type { TAnyMaterialWrapper, TMaterialFactory, TMaterialParams } from '@Anarchy/Engine/Material/Models';\nimport { MaterialWrapper } from '@Anarchy/Engine/Material/Wrappers';\n\nexport function MaterialFactory(): TMaterialFactory {\n const factory: TReactiveFactory<TAnyMaterialWrapper, TMaterialParams> = ReactiveFactory(FactoryType.Material, MaterialWrapper);\n // eslint-disable-next-line functional/immutable-data\n return Object.assign(factory, { configToParams: materialConfigToParams });\n}\n"],"names":["MaterialFactory","factory","ReactiveFactory","FactoryType","Material","MaterialWrapper","Object","assign","configToParams","materialConfigToParams"],"mappings":"wQAMO,SAASA,kBACd,MAAMC,QAAkEC,gBAAgBC,YAAYC,SAAUC,iBAE9G,OAAOC,OAAOC,OAAON,QAAS,CAAEO,eAAgBC,wBAClD"}
1
+ {"version":3,"file":"MaterialFactory.js","sources":["../../../src/Material/Factories/MaterialFactory.ts"],"sourcesContent":["import type { TReactiveFactory } from '@hellpig/anarchy-engine/Abstract';\nimport { FactoryType, ReactiveFactory } from '@hellpig/anarchy-engine/Abstract';\nimport { materialConfigToParams } from '@hellpig/anarchy-engine/Material/Adapters';\nimport type { TAnyMaterialWrapper, TMaterialFactory, TMaterialParams } from '@hellpig/anarchy-engine/Material/Models';\nimport { MaterialWrapper } from '@hellpig/anarchy-engine/Material/Wrappers';\n\nexport function MaterialFactory(): TMaterialFactory {\n const factory: TReactiveFactory<TAnyMaterialWrapper, TMaterialParams> = ReactiveFactory(FactoryType.Material, MaterialWrapper);\n // eslint-disable-next-line functional/immutable-data\n return Object.assign(factory, { configToParams: materialConfigToParams });\n}\n"],"names":["MaterialFactory","factory","ReactiveFactory","FactoryType","Material","MaterialWrapper","Object","assign","configToParams","materialConfigToParams"],"mappings":"wQAMO,SAASA,kBACd,MAAMC,QAAkEC,gBAAgBC,YAAYC,SAAUC,iBAE9G,OAAOC,OAAOC,OAAON,QAAS,CAAEO,eAAgBC,wBAClD"}
@@ -1 +1 @@
1
- {"version":3,"file":"WithMaterial.js","sources":["../../../src/Material/Mixins/WithMaterial.ts"],"sourcesContent":["import type { TWithMaterial } from '@Anarchy/Engine/Material/Models';\nimport type { TRawModel3d } from '@Anarchy/Engine/Models3d';\nimport type { TWriteable } from '@Anarchy/Shared/Utils';\nimport { isDefined } from '@Anarchy/Shared/Utils';\nimport type { Group, Material, Mesh, Object3D } from 'three';\nimport type { Points } from 'three/src/objects/Points';\n\nexport function withMaterial<T extends TWriteable<TRawModel3d | Points>>(entity: T): TWithMaterial {\n function useMaterial(material: Material): Material {\n if ((entity as Group).isGroup) {\n entity.traverse((object) => hasMaterial(object) && applyMaterial(object, material));\n } else if (hasMaterial(entity)) applyMaterial(entity, material);\n return material;\n }\n\n return {\n useMaterial\n };\n}\n\nconst hasMaterial = (entity: Mesh | Group | Points | Object3D): boolean => isDefined((entity as Mesh).material);\n// eslint-disable-next-line functional/immutable-data\nconst applyMaterial = (entity: Mesh | Group | Points | Object3D, material: Material): void => void ((entity as Mesh).material = material);\n"],"names":["withMaterial","entity","useMaterial","material","isGroup","traverse","object","hasMaterial","applyMaterial","isDefined"],"mappings":"6EAOO,SAASA,aAAyDC,QAQvE,MAAO,CACLC,YARF,SAAqBC,UAInB,OAHKF,OAAiBG,QACpBH,OAAOI,SAAUC,QAAWC,YAAYD,SAAWE,cAAcF,OAAQH,WAChEI,YAAYN,SAASO,cAAcP,OAAQE,UAC/CA,QACT,EAKF,CAEA,MAAMI,YAAeN,QAAsDQ,UAAWR,OAAgBE,UAEhGK,cAAgB,CAACP,OAA0CE,YAAoCF,OAAgBE,SAAWA"}
1
+ {"version":3,"file":"WithMaterial.js","sources":["../../../src/Material/Mixins/WithMaterial.ts"],"sourcesContent":["import type { TWithMaterial } from '@hellpig/anarchy-engine/Material/Models';\nimport type { TRawModel3d } from '@hellpig/anarchy-engine/Models3d';\nimport type { TWriteable } from '@hellpig/anarchy-shared/Utils';\nimport { isDefined } from '@hellpig/anarchy-shared/Utils';\nimport type { Group, Material, Mesh, Object3D } from 'three';\nimport type { Points } from 'three/src/objects/Points';\n\nexport function withMaterial<T extends TWriteable<TRawModel3d | Points>>(entity: T): TWithMaterial {\n function useMaterial(material: Material): Material {\n if ((entity as Group).isGroup) {\n entity.traverse((object) => hasMaterial(object) && applyMaterial(object, material));\n } else if (hasMaterial(entity)) applyMaterial(entity, material);\n return material;\n }\n\n return {\n useMaterial\n };\n}\n\nconst hasMaterial = (entity: Mesh | Group | Points | Object3D): boolean => isDefined((entity as Mesh).material);\n// eslint-disable-next-line functional/immutable-data\nconst applyMaterial = (entity: Mesh | Group | Points | Object3D, material: Material): void => void ((entity as Mesh).material = material);\n"],"names":["withMaterial","entity","useMaterial","material","isGroup","traverse","object","hasMaterial","applyMaterial","isDefined"],"mappings":"6EAOO,SAASA,aAAyDC,QAQvE,MAAO,CACLC,YARF,SAAqBC,UAInB,OAHKF,OAAiBG,QACpBH,OAAOI,SAAUC,QAAWC,YAAYD,SAAWE,cAAcF,OAAQH,WAChEI,YAAYN,SAASO,cAAcP,OAAQE,UAC/CA,QACT,EAKF,CAEA,MAAMI,YAAeN,QAAsDQ,UAAWR,OAAgBE,UAEhGK,cAAgB,CAACP,OAA0CE,YAAoCF,OAAgBE,SAAWA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialRegistry.js","sources":["../../../src/Material/Registries/MaterialRegistry.ts"],"sourcesContent":["import { AbstractEntityRegistry, RegistryType } from '@Anarchy/Engine/Abstract';\nimport type { TAnyMaterialWrapper, TMaterialRegistry } from '@Anarchy/Engine/Material/Models';\n\nexport function MaterialRegistry(): TMaterialRegistry {\n return AbstractEntityRegistry<TAnyMaterialWrapper>(RegistryType.Material);\n}\n"],"names":["MaterialRegistry","AbstractEntityRegistry","RegistryType","Material"],"mappings":"2JAGO,SAASA,mBACd,OAAOC,uBAA4CC,aAAaC,SAClE"}
1
+ {"version":3,"file":"MaterialRegistry.js","sources":["../../../src/Material/Registries/MaterialRegistry.ts"],"sourcesContent":["import { AbstractEntityRegistry, RegistryType } from '@hellpig/anarchy-engine/Abstract';\nimport type { TAnyMaterialWrapper, TMaterialRegistry } from '@hellpig/anarchy-engine/Material/Models';\n\nexport function MaterialRegistry(): TMaterialRegistry {\n return AbstractEntityRegistry<TAnyMaterialWrapper>(RegistryType.Material);\n}\n"],"names":["MaterialRegistry","AbstractEntityRegistry","RegistryType","Material"],"mappings":"2JAGO,SAASA,mBACd,OAAOC,uBAA4CC,aAAaC,SAClE"}
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialService.js","sources":["../../../src/Material/Services/MaterialService.ts"],"sourcesContent":["import type { TAbstractService } from '@Anarchy/Engine/Abstract';\nimport { AbstractService } from '@Anarchy/Engine/Abstract';\nimport type {\n TAnyMaterialWrapper,\n TMaterialConfig,\n TMaterialEntityToConfigDependencies,\n TMaterialFactory,\n TMaterialRegistry,\n TMaterialService,\n TMaterialServiceDependencies,\n TMaterialServiceWithCreate,\n TMaterialServiceWithCreateFromConfig,\n TMaterialServiceWithFactory,\n TMaterialServiceWithRegistry\n} from '@Anarchy/Engine/Material/Models';\nimport type { TDisposable } from '@Anarchy/Engine/Mixins';\nimport { withCreateFromConfigServiceMixin, withCreateServiceMixin, withFactoryService, withRegistryService, withSerializableEntities } from '@Anarchy/Engine/Mixins';\nimport { mergeAll } from '@Anarchy/Engine/Utils';\nimport type { Subscription } from 'rxjs';\n\nexport function MaterialService(factory: TMaterialFactory, registry: TMaterialRegistry, dependencies: TMaterialServiceDependencies): TMaterialService {\n const factorySub$: Subscription = factory.entityCreated$.subscribe((wrapper: TAnyMaterialWrapper): void => registry.add(wrapper));\n const disposable: ReadonlyArray<TDisposable> = [registry, factory, factorySub$];\n const abstractService: TAbstractService = AbstractService(disposable);\n\n const withCreateService: TMaterialServiceWithCreate = withCreateServiceMixin(factory, undefined);\n const withCreateFromConfigService: TMaterialServiceWithCreateFromConfig = withCreateFromConfigServiceMixin(withCreateService.create, factory.configToParams, dependencies);\n const withFactory: TMaterialServiceWithFactory = withFactoryService(factory);\n const withRegistry: TMaterialServiceWithRegistry = withRegistryService(registry);\n\n return mergeAll(\n abstractService,\n withCreateService,\n withCreateFromConfigService,\n withFactory,\n withRegistry,\n withSerializableEntities<TAnyMaterialWrapper, TMaterialConfig, TMaterialEntityToConfigDependencies>(registry, { textureResourceRegistry: dependencies.textureService.getResourceRegistry() })\n );\n}\n"],"names":["MaterialService","factory","registry","dependencies","factorySub$","entityCreated$","subscribe","wrapper","add","abstractService","AbstractService","withCreateService","withCreateServiceMixin","withCreateFromConfigService","withCreateFromConfigServiceMixin","create","configToParams","withFactory","withFactoryService","withRegistry","withRegistryService","mergeAll","withSerializableEntities","textureResourceRegistry","textureService","getResourceRegistry"],"mappings":"6hBAoBO,SAASA,gBAAgBC,QAA2BC,SAA6BC,cACtF,MAAMC,YAA4BH,QAAQI,eAAeC,UAAWC,SAAuCL,SAASM,IAAID,UAElHE,gBAAoCC,gBADK,CAACR,SAAUD,QAASG,cAG7DO,kBAAgDC,uBAAuBX,gBACvEY,4BAAoEC,iCAAiCH,kBAAkBI,OAAQd,QAAQe,eAAgBb,cACvJc,YAA2CC,mBAAmBjB,SAC9DkB,aAA6CC,oBAAoBlB,UAEvE,OAAOmB,SACLZ,gBACAE,kBACAE,4BACAI,YACAE,aACAG,yBAAoGpB,SAAU,CAAEqB,wBAAyBpB,aAAaqB,eAAeC,wBAEzK"}
1
+ {"version":3,"file":"MaterialService.js","sources":["../../../src/Material/Services/MaterialService.ts"],"sourcesContent":["import type { TAbstractService } from '@hellpig/anarchy-engine/Abstract';\nimport { AbstractService } from '@hellpig/anarchy-engine/Abstract';\nimport type {\n TAnyMaterialWrapper,\n TMaterialConfig,\n TMaterialEntityToConfigDependencies,\n TMaterialFactory,\n TMaterialRegistry,\n TMaterialService,\n TMaterialServiceDependencies,\n TMaterialServiceWithCreate,\n TMaterialServiceWithCreateFromConfig,\n TMaterialServiceWithFactory,\n TMaterialServiceWithRegistry\n} from '@hellpig/anarchy-engine/Material/Models';\nimport type { TDisposable } from '@hellpig/anarchy-engine/Mixins';\nimport { withCreateFromConfigServiceMixin, withCreateServiceMixin, withFactoryService, withRegistryService, withSerializableEntities } from '@hellpig/anarchy-engine/Mixins';\nimport { mergeAll } from '@hellpig/anarchy-engine/Utils';\nimport type { Subscription } from 'rxjs';\n\nexport function MaterialService(factory: TMaterialFactory, registry: TMaterialRegistry, dependencies: TMaterialServiceDependencies): TMaterialService {\n const factorySub$: Subscription = factory.entityCreated$.subscribe((wrapper: TAnyMaterialWrapper): void => registry.add(wrapper));\n const disposable: ReadonlyArray<TDisposable> = [registry, factory, factorySub$];\n const abstractService: TAbstractService = AbstractService(disposable);\n\n const withCreateService: TMaterialServiceWithCreate = withCreateServiceMixin(factory, undefined);\n const withCreateFromConfigService: TMaterialServiceWithCreateFromConfig = withCreateFromConfigServiceMixin(withCreateService.create, factory.configToParams, dependencies);\n const withFactory: TMaterialServiceWithFactory = withFactoryService(factory);\n const withRegistry: TMaterialServiceWithRegistry = withRegistryService(registry);\n\n return mergeAll(\n abstractService,\n withCreateService,\n withCreateFromConfigService,\n withFactory,\n withRegistry,\n withSerializableEntities<TAnyMaterialWrapper, TMaterialConfig, TMaterialEntityToConfigDependencies>(registry, { textureResourceRegistry: dependencies.textureService.getResourceRegistry() })\n );\n}\n"],"names":["MaterialService","factory","registry","dependencies","factorySub$","entityCreated$","subscribe","wrapper","add","abstractService","AbstractService","withCreateService","withCreateServiceMixin","withCreateFromConfigService","withCreateFromConfigServiceMixin","create","configToParams","withFactory","withFactoryService","withRegistry","withRegistryService","mergeAll","withSerializableEntities","textureResourceRegistry","textureService","getResourceRegistry"],"mappings":"6hBAoBO,SAASA,gBAAgBC,QAA2BC,SAA6BC,cACtF,MAAMC,YAA4BH,QAAQI,eAAeC,UAAWC,SAAuCL,SAASM,IAAID,UAElHE,gBAAoCC,gBADK,CAACR,SAAUD,QAASG,cAG7DO,kBAAgDC,uBAAuBX,gBACvEY,4BAAoEC,iCAAiCH,kBAAkBI,OAAQd,QAAQe,eAAgBb,cACvJc,YAA2CC,mBAAmBjB,SAC9DkB,aAA6CC,oBAAoBlB,UAEvE,OAAOmB,SACLZ,gBACAE,kBACAE,4BACAI,YACAE,aACAG,yBAAoGpB,SAAU,CAAEqB,wBAAyBpB,aAAaqB,eAAeC,wBAEzK"}
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialUtils.js","sources":["../../../src/Material/Utils/MaterialUtils.ts"],"sourcesContent":["import { MaterialMap, MaterialType } from '@Anarchy/Engine/Material/Constants';\nimport type { TMaterialParams, TMaterialParamsOptions, TMaterials, TTypeOfMaterials } from '@Anarchy/Engine/Material/Models';\nimport type { TEulerLike, TEulerString } from '@Anarchy/Engine/ThreeLib';\nimport { eulerToXyz, vector2ToXy, vector3ToXyz } from '@Anarchy/Engine/Utils';\nimport type { TWithoutNull } from '@Anarchy/Shared/Utils';\nimport { isNotDefined } from '@Anarchy/Shared/Utils';\nimport type {\n LineDashedMaterial,\n Material,\n MeshBasicMaterial,\n MeshDepthMaterial,\n MeshLambertMaterial,\n MeshMatcapMaterial,\n MeshPhongMaterial,\n MeshPhysicalMaterial,\n MeshStandardMaterial,\n PointsMaterial,\n SpriteMaterial,\n Vector2Like,\n Vector3Like\n} from 'three';\n\nexport function isPointsMaterial<T extends Material | ReadonlyArray<Material>>(material: PointsMaterial | T): material is PointsMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Points;\n}\n\nexport function isPhysicalMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshPhysicalMaterial | T): material is MeshPhysicalMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Physical;\n}\n\nexport function isLineDashedMaterial<T extends Material | ReadonlyArray<Material>>(material: LineDashedMaterial | T): material is LineDashedMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.LineDashed;\n}\n\nexport function isBasicMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshBasicMaterial | T): material is MeshBasicMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Basic;\n}\n\nexport function isStandardMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshStandardMaterial | T): material is MeshStandardMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Standard;\n}\n\nexport function isLambertMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshLambertMaterial | T): material is MeshLambertMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Lambert;\n}\n\nexport function isDepthMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshDepthMaterial | T): material is MeshDepthMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Depth;\n}\nexport function isMatcapMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshMatcapMaterial | T): material is MeshMatcapMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Matcap;\n}\n\nexport function isNodeMaterial<T extends Material | ReadonlyArray<Material>>(material: SpriteMaterial | T): material is SpriteMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Sprite;\n}\n\nexport function isPhongMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshPhongMaterial | T): material is MeshPhongMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Phong;\n}\n\nexport function buildMaterial(params: TMaterialParams): TMaterials {\n const { type, options, textures } = params;\n\n const MaterialConstructor: TTypeOfMaterials = MaterialMap[type];\n if (isNotDefined(MaterialConstructor)) throw new Error(`Unsupported material type: ${type}`);\n return new MaterialConstructor({ ...(options as TWithoutNull<TMaterialParamsOptions>), ...textures });\n}\n\nexport function getOptionName<T extends string, V>(option: V, optionsMap: Readonly<Record<T, V>>, name: string): T | never {\n const optionName: T | undefined = Object.entries(optionsMap).find(([, value]: [string, unknown]): boolean => value === option)?.[0] as T | undefined;\n if (!optionName) throw new Error(`Cannot get option name of material's option \"${name}\": Unsupported option \"${option}\". Possible options: ${Object.values(optionsMap).join(', ')}`);\n return optionName;\n}\n\nexport function getOptionNameIfPossible<T extends string, V>(option: V | undefined, optionsMap: Readonly<Record<T, V>>, name: string): T | undefined {\n if (option === undefined) return undefined;\n return getOptionName(option, optionsMap, name);\n}\n\nexport function vector2ToXyIfPossible(vector: Vector2Like | undefined): Readonly<{ x: number; y: number }> {\n if (isNotDefined(vector)) return { x: 0, y: 0 };\n return vector2ToXy(vector);\n}\n\nexport function vector3ToXyzIfPossible(vector: Vector3Like | undefined): Readonly<{ x: number; y: number; z: number }> {\n if (isNotDefined(vector)) return { x: 0, y: 0, z: 0 };\n return vector3ToXyz(vector);\n}\n\nexport function eulerToXyzIfPossible(euler: TEulerLike | TEulerString | undefined): Readonly<{\n x: number;\n y: number;\n z: number;\n order?: 'XYZ' | 'XZY' | 'YXZ' | 'YZX' | 'ZXY' | 'ZYX';\n}> {\n if (isNotDefined(euler)) return { x: 0, y: 0, z: 0 };\n return eulerToXyz(euler);\n}\n"],"names":["isPointsMaterial","material","Array","isArray","type","MaterialType","Points","isPhysicalMaterial","Physical","isLineDashedMaterial","LineDashed","isBasicMaterial","Basic","isStandardMaterial","Standard","isLambertMaterial","Lambert","isDepthMaterial","Depth","isMatcapMaterial","Matcap","isNodeMaterial","Sprite","isPhongMaterial","Phong","buildMaterial","params","options","textures","MaterialConstructor","MaterialMap","isNotDefined","Error","getOptionName","option","optionsMap","name","optionName","Object","entries","find","value","values","join","getOptionNameIfPossible","vector2ToXyIfPossible","vector","x","y","vector2ToXy","vector3ToXyzIfPossible","z","vector3ToXyz","eulerToXyzIfPossible","euler","eulerToXyz"],"mappings":"6RAsBO,SAASA,iBAA+DC,UAC7E,OAAQC,MAAMC,QAAQF,WAAcA,SAAsBG,OAASC,aAAaC,MAClF,CAEO,SAASC,mBAAiEN,UAC/E,OAAQC,MAAMC,QAAQF,WAAcA,SAAsBG,OAASC,aAAaG,QAClF,CAEO,SAASC,qBAAmER,UACjF,OAAQC,MAAMC,QAAQF,WAAcA,SAAsBG,OAASC,aAAaK,UAClF,CAEO,SAASC,gBAA8DV,UAC5E,OAAQC,MAAMC,QAAQF,WAAcA,SAAsBG,OAASC,aAAaO,K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EAAGC,EAAG,EAAGG,EAAG,GAC3CC,aAAaN,OACtB,CAEO,SAASO,qBAAqBC,OAMnC,OAAIvB,aAAauB,OAAe,CAAEP,EAAG,EAAGC,EAAG,EAAGG,EAAG,GAC1CI,WAAWD,MACpB"}
1
+ {"version":3,"file":"MaterialUtils.js","sources":["../../../src/Material/Utils/MaterialUtils.ts"],"sourcesContent":["import { MaterialMap, MaterialType } from '@hellpig/anarchy-engine/Material/Constants';\nimport type { TMaterialParams, TMaterialParamsOptions, TMaterials, TTypeOfMaterials } from '@hellpig/anarchy-engine/Material/Models';\nimport type { TEulerLike, TEulerString } from '@hellpig/anarchy-engine/ThreeLib';\nimport { eulerToXyz, vector2ToXy, vector3ToXyz } from '@hellpig/anarchy-engine/Utils';\nimport type { TWithoutNull } from '@hellpig/anarchy-shared/Utils';\nimport { isNotDefined } from '@hellpig/anarchy-shared/Utils';\nimport type {\n LineDashedMaterial,\n Material,\n MeshBasicMaterial,\n MeshDepthMaterial,\n MeshLambertMaterial,\n MeshMatcapMaterial,\n MeshPhongMaterial,\n MeshPhysicalMaterial,\n MeshStandardMaterial,\n PointsMaterial,\n SpriteMaterial,\n Vector2Like,\n Vector3Like\n} from 'three';\n\nexport function isPointsMaterial<T extends Material | ReadonlyArray<Material>>(material: PointsMaterial | T): material is PointsMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Points;\n}\n\nexport function isPhysicalMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshPhysicalMaterial | T): material is MeshPhysicalMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Physical;\n}\n\nexport function isLineDashedMaterial<T extends Material | ReadonlyArray<Material>>(material: LineDashedMaterial | T): material is LineDashedMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.LineDashed;\n}\n\nexport function isBasicMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshBasicMaterial | T): material is MeshBasicMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Basic;\n}\n\nexport function isStandardMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshStandardMaterial | T): material is MeshStandardMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Standard;\n}\n\nexport function isLambertMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshLambertMaterial | T): material is MeshLambertMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Lambert;\n}\n\nexport function isDepthMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshDepthMaterial | T): material is MeshDepthMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Depth;\n}\nexport function isMatcapMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshMatcapMaterial | T): material is MeshMatcapMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Matcap;\n}\n\nexport function isNodeMaterial<T extends Material | ReadonlyArray<Material>>(material: SpriteMaterial | T): material is SpriteMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Sprite;\n}\n\nexport function isPhongMaterial<T extends Material | ReadonlyArray<Material>>(material: MeshPhongMaterial | T): material is MeshPhongMaterial {\n return !Array.isArray(material) && (material as Material).type === MaterialType.Phong;\n}\n\nexport function buildMaterial(params: TMaterialParams): TMaterials {\n const { type, options, textures } = params;\n\n const MaterialConstructor: TTypeOfMaterials = MaterialMap[type];\n if (isNotDefined(MaterialConstructor)) throw new Error(`Unsupported material type: ${type}`);\n return new MaterialConstructor({ ...(options as TWithoutNull<TMaterialParamsOptions>), ...textures });\n}\n\nexport function getOptionName<T extends string, V>(option: V, optionsMap: Readonly<Record<T, V>>, name: string): T | never {\n const optionName: T | undefined = Object.entries(optionsMap).find(([, value]: [string, unknown]): boolean => value === option)?.[0] as T | undefined;\n if (!optionName) throw new Error(`Cannot get option name of material's option \"${name}\": Unsupported option \"${option}\". Possible options: ${Object.values(optionsMap).join(', ')}`);\n return optionName;\n}\n\nexport function getOptionNameIfPossible<T extends string, V>(option: V | undefined, optionsMap: Readonly<Record<T, V>>, name: string): T | undefined {\n if (option === undefined) return undefined;\n return getOptionName(option, optionsMap, name);\n}\n\nexport function vector2ToXyIfPossible(vector: Vector2Like | undefined): Readonly<{ x: number; y: number }> {\n if (isNotDefined(vector)) return { x: 0, y: 0 };\n return vector2ToXy(vector);\n}\n\nexport function vector3ToXyzIfPossible(vector: Vector3Like | undefined): Readonly<{ x: number; y: number; z: number }> {\n if (isNotDefined(vector)) return { x: 0, y: 0, z: 0 };\n return vector3ToXyz(vector);\n}\n\nexport function eulerToXyzIfPossible(euler: TEulerLike | TEulerString | undefined): Readonly<{\n x: number;\n y: number;\n z: number;\n order?: 'XYZ' | 'XZY' | 'YXZ' | 'YZX' | 'ZXY' | 'ZYX';\n}> {\n if (isNotDefined(euler)) return { x: 0, y: 0, z: 0 };\n return eulerToXyz(euler);\n}\n"],"names":["isPointsMaterial","material","Array","isArray","type","MaterialType","Points","isPhysicalMaterial","Physical","isLineDashedMaterial","LineDashed","isBasicMaterial","Basic","isStandardMaterial","Standard","isLambertMaterial","Lambert","isDepthMaterial","Depth","isMatcapMaterial","Matcap","isNodeMaterial","Sprite","isPhongMaterial","Phong","buildMaterial","params","options","textures","MaterialConstructor","MaterialMap","isNotDefined","Error","getOptionName","option","optionsMap","name","optionName","Object","entries","find","value","values","join","getOptionNameIfPossible","vector2ToXyIfPossible","vector","x","y","vector2ToXy","vector3ToXyzIfPossible","z","vector3ToXyz","eulerToXyzIfPossible","euler","eulerToXyz"],"mappings":"6RAsBO,SAASA,iBAA+DC,UAC7E,OAAQC,MAAMC,QAAQF,WAAcA,SAAsBG,OAASC,aAAaC,MAClF,CAEO,SAASC,mBAAiEN,UAC/E,OAAQC,MAAMC,QAAQF,WAAcA,SAAsBG,OAASC,aAAaG,QAClF,CAEO,SAASC,qBAAmER,UACjF,OAAQC,MAAMC,QAAQF,WAAcA,SAAsBG,OAASC,aAAaK,UAClF,CAEO,SAASC,gBAA8DV,UAC5E,OAAQC,MAAMC,QAAQF,WAAcA,SAAsBG,OAASC,aAAaO,KAClF,CAEO,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G,EAAGG,EAAG,GAC3CC,aAAaN,OACtB,CAEO,SAASO,qBAAqBC,OAMnC,OAAIvB,aAAauB,OAAe,CAAEP,EAAG,EAAGC,EAAG,EAAGG,EAAG,GAC1CI,WAAWD,MACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialWrapper.js","sources":["../../../src/Material/Wrappers/MaterialWrapper.ts"],"sourcesContent":["import { AbstractWrapper, WrapperType } from '@Anarchy/Engine/Abstract';\nimport { materialEntityToConfig } from '@Anarchy/Engine/Material/Adapters';\nimport type { TAnyMaterialWrapper, TMaterialConfig, TMaterialEntityToConfigDependencies, TMaterialParams, TMaterials } from '@Anarchy/Engine/Material/Models';\nimport { buildMaterial } from '@Anarchy/Engine/Material/Utils';\n\nexport function MaterialWrapper(params: TMaterialParams): TAnyMaterialWrapper {\n const entity: TMaterials = buildMaterial(params);\n\n const result: TAnyMaterialWrapper = Object.assign(AbstractWrapper(entity, WrapperType.Material, params), {\n entity,\n serialize: (dependencies: TMaterialEntityToConfigDependencies): TMaterialConfig => materialEntityToConfig(result, dependencies)\n }) as TAnyMaterialWrapper;\n\n return result;\n}\n"],"names":["MaterialWrapper","params","entity","buildMaterial","result","Object","assign","AbstractWrapper","WrapperType","Material","serialize","dependencies","materialEntityToConfig"],"mappings":"gQAKO,SAASA,gBAAgBC,QAC9B,MAAMC,OAAqBC,cAAcF,QAEnCG,OAA8BC,OAAOC,OAAOC,gBAAgBL,OAAQM,YAAYC,SAAUR,QAAS,CACvGC,cACAQ,UAAYC,cAAuEC,uBAAuBR,OAAQO,gBAGpH,OAAOP,MACT"}
1
+ {"version":3,"file":"MaterialWrapper.js","sources":["../../../src/Material/Wrappers/MaterialWrapper.ts"],"sourcesContent":["import { AbstractWrapper, WrapperType } from '@hellpig/anarchy-engine/Abstract';\nimport { materialEntityToConfig } from '@hellpig/anarchy-engine/Material/Adapters';\nimport type { TAnyMaterialWrapper, TMaterialConfig, TMaterialEntityToConfigDependencies, TMaterialParams, TMaterials } from '@hellpig/anarchy-engine/Material/Models';\nimport { buildMaterial } from '@hellpig/anarchy-engine/Material/Utils';\n\nexport function MaterialWrapper(params: TMaterialParams): TAnyMaterialWrapper {\n const entity: TMaterials = buildMaterial(params);\n\n const result: TAnyMaterialWrapper = Object.assign(AbstractWrapper(entity, WrapperType.Material, params), {\n entity,\n serialize: (dependencies: TMaterialEntityToConfigDependencies): TMaterialConfig => materialEntityToConfig(result, dependencies)\n }) as TAnyMaterialWrapper;\n\n return result;\n}\n"],"names":["MaterialWrapper","params","entity","buildMaterial","result","Object","assign","AbstractWrapper","WrapperType","Material","serialize","dependencies","materialEntityToConfig"],"mappings":"gQAKO,SAASA,gBAAgBC,QAC9B,MAAMC,OAAqBC,cAAcF,QAEnCG,OAA8BC,OAAOC,OAAOC,gBAAgBL,OAAQM,YAAYC,SAAUR,QAAS,CACvGC,cACAQ,UAAYC,cAAuEC,uBAAuBR,OAAQO,gBAGpH,OAAOP,MACT"}