excalibur 0.25.2 → 0.25.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 (446) hide show
  1. package/CHANGELOG.md +7 -2
  2. package/build/dist/Actions/Action/Blink.js +51 -0
  3. package/build/dist/Actions/Action/Blink.js.map +1 -0
  4. package/build/dist/Actions/Action/CallMethod.js +21 -0
  5. package/build/dist/Actions/Action/CallMethod.js.map +1 -0
  6. package/build/dist/Actions/Action/Delay.js +25 -0
  7. package/build/dist/Actions/Action/Delay.js.map +1 -0
  8. package/build/dist/Actions/Action/Die.js +22 -0
  9. package/build/dist/Actions/Action/Die.js.map +1 -0
  10. package/build/dist/Actions/Action/EaseTo.js +69 -0
  11. package/build/dist/Actions/Action/EaseTo.js.map +1 -0
  12. package/build/dist/Actions/Action/Fade.js +46 -0
  13. package/build/dist/Actions/Action/Fade.js.map +1 -0
  14. package/build/dist/Actions/Action/Follow.js +55 -0
  15. package/build/dist/Actions/Action/Follow.js.map +1 -0
  16. package/build/dist/Actions/Action/Meet.js +52 -0
  17. package/build/dist/Actions/Action/Meet.js.map +1 -0
  18. package/build/dist/Actions/Action/MoveBy.js +47 -0
  19. package/build/dist/Actions/Action/MoveBy.js.map +1 -0
  20. package/build/dist/Actions/Action/MoveTo.js +40 -0
  21. package/build/dist/Actions/Action/MoveTo.js.map +1 -0
  22. package/build/dist/Actions/Action/Repeat.js +31 -0
  23. package/build/dist/Actions/Action/Repeat.js.map +1 -0
  24. package/build/dist/Actions/Action/RepeatForever.js +37 -0
  25. package/build/dist/Actions/Action/RepeatForever.js.map +1 -0
  26. package/build/dist/Actions/Action/RotateBy.js +91 -0
  27. package/build/dist/Actions/Action/RotateBy.js.map +1 -0
  28. package/build/dist/Actions/Action/RotateTo.js +90 -0
  29. package/build/dist/Actions/Action/RotateTo.js.map +1 -0
  30. package/build/dist/Actions/Action/ScaleBy.js +45 -0
  31. package/build/dist/Actions/Action/ScaleBy.js.map +1 -0
  32. package/build/dist/Actions/Action/ScaleTo.js +56 -0
  33. package/build/dist/Actions/Action/ScaleTo.js.map +1 -0
  34. package/build/dist/Actions/Action.js +2 -0
  35. package/build/dist/Actions/Action.js.map +1 -0
  36. package/build/dist/Actions/ActionContext.js +305 -0
  37. package/build/dist/Actions/ActionContext.js.map +1 -0
  38. package/build/dist/Actions/ActionQueue.js +87 -0
  39. package/build/dist/Actions/ActionQueue.js.map +1 -0
  40. package/build/dist/Actions/Actionable.js +2 -0
  41. package/build/dist/Actions/Actionable.js.map +1 -0
  42. package/build/dist/Actions/ActionsComponent.js +198 -0
  43. package/build/dist/Actions/ActionsComponent.js.map +1 -0
  44. package/build/dist/Actions/ActionsSystem.js +18 -0
  45. package/build/dist/Actions/ActionsSystem.js.map +1 -0
  46. package/build/dist/Actions/Index.js +22 -0
  47. package/build/dist/Actions/Index.js.map +1 -0
  48. package/build/dist/Actions/RotationType.js +27 -0
  49. package/build/dist/Actions/RotationType.js.map +1 -0
  50. package/build/dist/Actor.js +831 -0
  51. package/build/dist/Actor.js.map +1 -0
  52. package/build/dist/Camera.js +663 -0
  53. package/build/dist/Camera.js.map +1 -0
  54. package/build/dist/Class.js +48 -0
  55. package/build/dist/Class.js.map +1 -0
  56. package/build/dist/Collision/BodyComponent.js +351 -0
  57. package/build/dist/Collision/BodyComponent.js.map +1 -0
  58. package/build/dist/Collision/BoundingBox.js +361 -0
  59. package/build/dist/Collision/BoundingBox.js.map +1 -0
  60. package/build/dist/Collision/ColliderComponent.js +198 -0
  61. package/build/dist/Collision/ColliderComponent.js.map +1 -0
  62. package/build/dist/Collision/Colliders/CircleCollider.js +264 -0
  63. package/build/dist/Collision/Colliders/CircleCollider.js.map +1 -0
  64. package/build/dist/Collision/Colliders/ClosestLineJumpTable.js +211 -0
  65. package/build/dist/Collision/Colliders/ClosestLineJumpTable.js.map +1 -0
  66. package/build/dist/Collision/Colliders/Collider.js +26 -0
  67. package/build/dist/Collision/Colliders/Collider.js.map +1 -0
  68. package/build/dist/Collision/Colliders/CollisionJumpTable.js +301 -0
  69. package/build/dist/Collision/Colliders/CollisionJumpTable.js.map +1 -0
  70. package/build/dist/Collision/Colliders/CompositeCollider.js +232 -0
  71. package/build/dist/Collision/Colliders/CompositeCollider.js.map +1 -0
  72. package/build/dist/Collision/Colliders/EdgeCollider.js +253 -0
  73. package/build/dist/Collision/Colliders/EdgeCollider.js.map +1 -0
  74. package/build/dist/Collision/Colliders/PolygonCollider.js +389 -0
  75. package/build/dist/Collision/Colliders/PolygonCollider.js.map +1 -0
  76. package/build/dist/Collision/Colliders/SeparatingAxis.js +67 -0
  77. package/build/dist/Collision/Colliders/SeparatingAxis.js.map +1 -0
  78. package/build/dist/Collision/Colliders/Shape.js +102 -0
  79. package/build/dist/Collision/Colliders/Shape.js.map +1 -0
  80. package/build/dist/Collision/CollisionSystem.js +116 -0
  81. package/build/dist/Collision/CollisionSystem.js.map +1 -0
  82. package/build/dist/Collision/CollisionType.js +33 -0
  83. package/build/dist/Collision/CollisionType.js.map +1 -0
  84. package/build/dist/Collision/Detection/CollisionContact.js +46 -0
  85. package/build/dist/Collision/Detection/CollisionContact.js.map +1 -0
  86. package/build/dist/Collision/Detection/CollisionProcessor.js +2 -0
  87. package/build/dist/Collision/Detection/CollisionProcessor.js.map +1 -0
  88. package/build/dist/Collision/Detection/DynamicTree.js +442 -0
  89. package/build/dist/Collision/Detection/DynamicTree.js.map +1 -0
  90. package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js +211 -0
  91. package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js.map +1 -0
  92. package/build/dist/Collision/Detection/Pair.js +92 -0
  93. package/build/dist/Collision/Detection/Pair.js.map +1 -0
  94. package/build/dist/Collision/Group/CollisionGroup.js +114 -0
  95. package/build/dist/Collision/Group/CollisionGroup.js.map +1 -0
  96. package/build/dist/Collision/Group/CollisionGroupManager.js +52 -0
  97. package/build/dist/Collision/Group/CollisionGroupManager.js.map +1 -0
  98. package/build/dist/Collision/Index.js +29 -0
  99. package/build/dist/Collision/Index.js.map +1 -0
  100. package/build/dist/Collision/Integrator.js +11 -0
  101. package/build/dist/Collision/Integrator.js.map +1 -0
  102. package/build/dist/Collision/MotionSystem.js +42 -0
  103. package/build/dist/Collision/MotionSystem.js.map +1 -0
  104. package/build/dist/Collision/Physics.js +163 -0
  105. package/build/dist/Collision/Physics.js.map +1 -0
  106. package/build/dist/Collision/Side.js +51 -0
  107. package/build/dist/Collision/Side.js.map +1 -0
  108. package/build/dist/Collision/Solver/ArcadeSolver.js +101 -0
  109. package/build/dist/Collision/Solver/ArcadeSolver.js.map +1 -0
  110. package/build/dist/Collision/Solver/ContactConstraintPoint.js +83 -0
  111. package/build/dist/Collision/Solver/ContactConstraintPoint.js.map +1 -0
  112. package/build/dist/Collision/Solver/RealisticSolver.js +248 -0
  113. package/build/dist/Collision/Solver/RealisticSolver.js.map +1 -0
  114. package/build/dist/Collision/Solver/Solver.js +37 -0
  115. package/build/dist/Collision/Solver/Solver.js.map +1 -0
  116. package/build/dist/Color.js +461 -0
  117. package/build/dist/Color.js.map +1 -0
  118. package/build/dist/Configurable.js +32 -0
  119. package/build/dist/Configurable.js.map +1 -0
  120. package/build/dist/Debug/Debug.js +375 -0
  121. package/build/dist/Debug/Debug.js.map +1 -0
  122. package/build/dist/Debug/DebugFlags.js +40 -0
  123. package/build/dist/Debug/DebugFlags.js.map +1 -0
  124. package/build/dist/Debug/DebugSystem.js +251 -0
  125. package/build/dist/Debug/DebugSystem.js.map +1 -0
  126. package/build/dist/Debug/index.js +4 -0
  127. package/build/dist/Debug/index.js.map +1 -0
  128. package/build/dist/Deprecated.js +2 -0
  129. package/build/dist/Deprecated.js.map +1 -0
  130. package/build/dist/Drawing/Animation.js +294 -0
  131. package/build/dist/Drawing/Animation.js.map +1 -0
  132. package/build/dist/Drawing/CanvasDrawComponent.js +16 -0
  133. package/build/dist/Drawing/CanvasDrawComponent.js.map +1 -0
  134. package/build/dist/Drawing/CanvasDrawingSystem.js +95 -0
  135. package/build/dist/Drawing/CanvasDrawingSystem.js.map +1 -0
  136. package/build/dist/Drawing/Index.js +10 -0
  137. package/build/dist/Drawing/Index.js.map +1 -0
  138. package/build/dist/Drawing/Polygon.js +139 -0
  139. package/build/dist/Drawing/Polygon.js.map +1 -0
  140. package/build/dist/Drawing/Sprite.js +355 -0
  141. package/build/dist/Drawing/Sprite.js.map +1 -0
  142. package/build/dist/Drawing/SpriteEffects.js +246 -0
  143. package/build/dist/Drawing/SpriteEffects.js.map +1 -0
  144. package/build/dist/Drawing/SpriteSheet.js +413 -0
  145. package/build/dist/Drawing/SpriteSheet.js.map +1 -0
  146. package/build/dist/Drawing/Texture.js +69 -0
  147. package/build/dist/Drawing/Texture.js.map +1 -0
  148. package/build/dist/Engine.d.ts +4 -1
  149. package/build/dist/Engine.js +985 -0
  150. package/build/dist/Engine.js.map +1 -0
  151. package/build/dist/EntityComponentSystem/Component.js +65 -0
  152. package/build/dist/EntityComponentSystem/Component.js.map +1 -0
  153. package/build/dist/EntityComponentSystem/Components/MotionComponent.js +33 -0
  154. package/build/dist/EntityComponentSystem/Components/MotionComponent.js.map +1 -0
  155. package/build/dist/EntityComponentSystem/Components/TransformComponent.js +249 -0
  156. package/build/dist/EntityComponentSystem/Components/TransformComponent.js.map +1 -0
  157. package/build/dist/EntityComponentSystem/Entity.js +452 -0
  158. package/build/dist/EntityComponentSystem/Entity.js.map +1 -0
  159. package/build/dist/EntityComponentSystem/EntityManager.js +128 -0
  160. package/build/dist/EntityComponentSystem/EntityManager.js.map +1 -0
  161. package/build/dist/EntityComponentSystem/Query.js +91 -0
  162. package/build/dist/EntityComponentSystem/Query.js.map +1 -0
  163. package/build/dist/EntityComponentSystem/QueryManager.js +90 -0
  164. package/build/dist/EntityComponentSystem/QueryManager.js.map +1 -0
  165. package/build/dist/EntityComponentSystem/System.js +76 -0
  166. package/build/dist/EntityComponentSystem/System.js.map +1 -0
  167. package/build/dist/EntityComponentSystem/SystemManager.js +102 -0
  168. package/build/dist/EntityComponentSystem/SystemManager.js.map +1 -0
  169. package/build/dist/EntityComponentSystem/Util.js +5 -0
  170. package/build/dist/EntityComponentSystem/Util.js.map +1 -0
  171. package/build/dist/EntityComponentSystem/World.js +55 -0
  172. package/build/dist/EntityComponentSystem/World.js.map +1 -0
  173. package/build/dist/EntityComponentSystem/index.js +11 -0
  174. package/build/dist/EntityComponentSystem/index.js.map +1 -0
  175. package/build/dist/EventDispatcher.js +114 -0
  176. package/build/dist/EventDispatcher.js.map +1 -0
  177. package/build/dist/Events/ExEvent.js +12 -0
  178. package/build/dist/Events/ExEvent.js.map +1 -0
  179. package/build/dist/Events/MediaEvents.js +75 -0
  180. package/build/dist/Events/MediaEvents.js.map +1 -0
  181. package/build/dist/Events/PointerEvents.js +52 -0
  182. package/build/dist/Events/PointerEvents.js.map +1 -0
  183. package/build/dist/Events.js +497 -0
  184. package/build/dist/Events.js.map +1 -0
  185. package/build/dist/Flags.js +90 -0
  186. package/build/dist/Flags.js.map +1 -0
  187. package/build/dist/Graphics/Animation.js +310 -0
  188. package/build/dist/Graphics/Animation.js.map +1 -0
  189. package/build/dist/Graphics/Canvas.js +38 -0
  190. package/build/dist/Graphics/Canvas.js.map +1 -0
  191. package/build/dist/Graphics/Circle.js +47 -0
  192. package/build/dist/Graphics/Circle.js.map +1 -0
  193. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js +2 -0
  194. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js.map +1 -0
  195. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js +207 -0
  196. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js.map +1 -0
  197. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js +331 -0
  198. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js.map +1 -0
  199. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js +160 -0
  200. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js.map +1 -0
  201. package/build/dist/Graphics/Context/debug-text.js +47 -0
  202. package/build/dist/Graphics/Context/debug-text.js.map +1 -0
  203. package/build/dist/Graphics/Context/image-renderer/image-renderer.js +209 -0
  204. package/build/dist/Graphics/Context/image-renderer/image-renderer.js.map +1 -0
  205. package/build/dist/Graphics/Context/line-renderer/line-renderer.js +87 -0
  206. package/build/dist/Graphics/Context/line-renderer/line-renderer.js.map +1 -0
  207. package/build/dist/Graphics/Context/point-renderer/point-renderer.js +82 -0
  208. package/build/dist/Graphics/Context/point-renderer/point-renderer.js.map +1 -0
  209. package/build/dist/Graphics/Context/quad-index-buffer.js +69 -0
  210. package/build/dist/Graphics/Context/quad-index-buffer.js.map +1 -0
  211. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js +272 -0
  212. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js.map +1 -0
  213. package/build/dist/Graphics/Context/render-source.js +16 -0
  214. package/build/dist/Graphics/Context/render-source.js.map +1 -0
  215. package/build/dist/Graphics/Context/render-target.js +65 -0
  216. package/build/dist/Graphics/Context/render-target.js.map +1 -0
  217. package/build/dist/Graphics/Context/renderer.js +2 -0
  218. package/build/dist/Graphics/Context/renderer.js.map +1 -0
  219. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js +53 -0
  220. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js.map +1 -0
  221. package/build/dist/Graphics/Context/shader.js +236 -0
  222. package/build/dist/Graphics/Context/shader.js.map +1 -0
  223. package/build/dist/Graphics/Context/state-stack.js +27 -0
  224. package/build/dist/Graphics/Context/state-stack.js.map +1 -0
  225. package/build/dist/Graphics/Context/texture-loader.d.ts +8 -0
  226. package/build/dist/Graphics/Context/texture-loader.js +121 -0
  227. package/build/dist/Graphics/Context/texture-loader.js.map +1 -0
  228. package/build/dist/Graphics/Context/transform-stack.js +30 -0
  229. package/build/dist/Graphics/Context/transform-stack.js.map +1 -0
  230. package/build/dist/Graphics/Context/vertex-buffer.js +45 -0
  231. package/build/dist/Graphics/Context/vertex-buffer.js.map +1 -0
  232. package/build/dist/Graphics/Context/vertex-layout.js +93 -0
  233. package/build/dist/Graphics/Context/vertex-layout.js.map +1 -0
  234. package/build/dist/Graphics/Context/webgl-adapter.js +19 -0
  235. package/build/dist/Graphics/Context/webgl-adapter.js.map +1 -0
  236. package/build/dist/Graphics/Context/webgl-util.js +105 -0
  237. package/build/dist/Graphics/Context/webgl-util.js.map +1 -0
  238. package/build/dist/Graphics/DebugGraphicsComponent.js +15 -0
  239. package/build/dist/Graphics/DebugGraphicsComponent.js.map +1 -0
  240. package/build/dist/Graphics/Filtering.js +17 -0
  241. package/build/dist/Graphics/Filtering.js.map +1 -0
  242. package/build/dist/Graphics/Font.js +293 -0
  243. package/build/dist/Graphics/Font.js.map +1 -0
  244. package/build/dist/Graphics/FontCommon.js +109 -0
  245. package/build/dist/Graphics/FontCommon.js.map +1 -0
  246. package/build/dist/Graphics/Graphic.js +200 -0
  247. package/build/dist/Graphics/Graphic.js.map +1 -0
  248. package/build/dist/Graphics/GraphicsComponent.js +290 -0
  249. package/build/dist/Graphics/GraphicsComponent.js.map +1 -0
  250. package/build/dist/Graphics/GraphicsDiagnostics.js +9 -0
  251. package/build/dist/Graphics/GraphicsDiagnostics.js.map +1 -0
  252. package/build/dist/Graphics/GraphicsGroup.js +69 -0
  253. package/build/dist/Graphics/GraphicsGroup.js.map +1 -0
  254. package/build/dist/Graphics/GraphicsSystem.js +153 -0
  255. package/build/dist/Graphics/GraphicsSystem.js.map +1 -0
  256. package/build/dist/Graphics/ImageSource.js +116 -0
  257. package/build/dist/Graphics/ImageSource.js.map +1 -0
  258. package/build/dist/Graphics/Polygon.js +59 -0
  259. package/build/dist/Graphics/Polygon.js.map +1 -0
  260. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js +7 -0
  261. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js.map +1 -0
  262. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js +52 -0
  263. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js.map +1 -0
  264. package/build/dist/Graphics/PostProcessor/PostProcessor.js +2 -0
  265. package/build/dist/Graphics/PostProcessor/PostProcessor.js.map +1 -0
  266. package/build/dist/Graphics/PostProcessor/ScreenShader.js +56 -0
  267. package/build/dist/Graphics/PostProcessor/ScreenShader.js.map +1 -0
  268. package/build/dist/Graphics/Raster.js +207 -0
  269. package/build/dist/Graphics/Raster.js.map +1 -0
  270. package/build/dist/Graphics/Rectangle.js +29 -0
  271. package/build/dist/Graphics/Rectangle.js.map +1 -0
  272. package/build/dist/Graphics/Sprite.js +103 -0
  273. package/build/dist/Graphics/Sprite.js.map +1 -0
  274. package/build/dist/Graphics/SpriteFont.js +120 -0
  275. package/build/dist/Graphics/SpriteFont.js.map +1 -0
  276. package/build/dist/Graphics/SpriteSheet.js +115 -0
  277. package/build/dist/Graphics/SpriteSheet.js.map +1 -0
  278. package/build/dist/Graphics/Text.js +94 -0
  279. package/build/dist/Graphics/Text.js.map +1 -0
  280. package/build/dist/Graphics/index.js +42 -0
  281. package/build/dist/Graphics/index.js.map +1 -0
  282. package/build/dist/Id.js +8 -0
  283. package/build/dist/Id.js.map +1 -0
  284. package/build/dist/Input/CapturePointerConfig.js +5 -0
  285. package/build/dist/Input/CapturePointerConfig.js.map +1 -0
  286. package/build/dist/Input/EngineInput.js +2 -0
  287. package/build/dist/Input/EngineInput.js.map +1 -0
  288. package/build/dist/Input/Gamepad.js +358 -0
  289. package/build/dist/Input/Gamepad.js.map +1 -0
  290. package/build/dist/Input/Index.js +22 -0
  291. package/build/dist/Input/Index.js.map +1 -0
  292. package/build/dist/Input/Keyboard.js +267 -0
  293. package/build/dist/Input/Keyboard.js.map +1 -0
  294. package/build/dist/Input/NativePointerButton.js +12 -0
  295. package/build/dist/Input/NativePointerButton.js.map +1 -0
  296. package/build/dist/Input/PointerAbstraction.js +41 -0
  297. package/build/dist/Input/PointerAbstraction.js.map +1 -0
  298. package/build/dist/Input/PointerButton.js +12 -0
  299. package/build/dist/Input/PointerButton.js.map +1 -0
  300. package/build/dist/Input/PointerComponent.js +28 -0
  301. package/build/dist/Input/PointerComponent.js.map +1 -0
  302. package/build/dist/Input/PointerEvent.js +25 -0
  303. package/build/dist/Input/PointerEvent.js.map +1 -0
  304. package/build/dist/Input/PointerEventReceiver.js +414 -0
  305. package/build/dist/Input/PointerEventReceiver.js.map +1 -0
  306. package/build/dist/Input/PointerScope.js +16 -0
  307. package/build/dist/Input/PointerScope.js.map +1 -0
  308. package/build/dist/Input/PointerSystem.js +217 -0
  309. package/build/dist/Input/PointerSystem.js.map +1 -0
  310. package/build/dist/Input/PointerType.js +11 -0
  311. package/build/dist/Input/PointerType.js.map +1 -0
  312. package/build/dist/Input/WheelDeltaMode.js +7 -0
  313. package/build/dist/Input/WheelDeltaMode.js.map +1 -0
  314. package/build/dist/Input/WheelEvent.js +21 -0
  315. package/build/dist/Input/WheelEvent.js.map +1 -0
  316. package/build/dist/Interfaces/Audio.js +2 -0
  317. package/build/dist/Interfaces/Audio.js.map +1 -0
  318. package/build/dist/Interfaces/AudioImplementation.js +11 -0
  319. package/build/dist/Interfaces/AudioImplementation.js.map +1 -0
  320. package/build/dist/Interfaces/Clonable.js +2 -0
  321. package/build/dist/Interfaces/Clonable.js.map +1 -0
  322. package/build/dist/Interfaces/Drawable.js +2 -0
  323. package/build/dist/Interfaces/Drawable.js.map +1 -0
  324. package/build/dist/Interfaces/Evented.js +2 -0
  325. package/build/dist/Interfaces/Evented.js.map +1 -0
  326. package/build/dist/Interfaces/Index.js +10 -0
  327. package/build/dist/Interfaces/Index.js.map +1 -0
  328. package/build/dist/Interfaces/LifecycleEvents.js +51 -0
  329. package/build/dist/Interfaces/LifecycleEvents.js.map +1 -0
  330. package/build/dist/Interfaces/Loadable.js +2 -0
  331. package/build/dist/Interfaces/Loadable.js.map +1 -0
  332. package/build/dist/Interfaces/PointerEventHandlers.js +2 -0
  333. package/build/dist/Interfaces/PointerEventHandlers.js.map +1 -0
  334. package/build/dist/Interfaces/Trait.js +2 -0
  335. package/build/dist/Interfaces/Trait.js.map +1 -0
  336. package/build/dist/Label.js +273 -0
  337. package/build/dist/Label.js.map +1 -0
  338. package/build/dist/Loader.js +367 -0
  339. package/build/dist/Loader.js.map +1 -0
  340. package/build/dist/Math/Index.js +10 -0
  341. package/build/dist/Math/Index.js.map +1 -0
  342. package/build/dist/Math/Random.js +239 -0
  343. package/build/dist/Math/Random.js.map +1 -0
  344. package/build/dist/Math/global-coordinates.js +30 -0
  345. package/build/dist/Math/global-coordinates.js.map +1 -0
  346. package/build/dist/Math/line.js +194 -0
  347. package/build/dist/Math/line.js.map +1 -0
  348. package/build/dist/Math/matrix.js +446 -0
  349. package/build/dist/Math/matrix.js.map +1 -0
  350. package/build/dist/Math/projection.js +24 -0
  351. package/build/dist/Math/projection.js.map +1 -0
  352. package/build/dist/Math/ray.js +52 -0
  353. package/build/dist/Math/ray.js.map +1 -0
  354. package/build/dist/Math/util.js +82 -0
  355. package/build/dist/Math/util.js.map +1 -0
  356. package/build/dist/Math/vector-view.js +25 -0
  357. package/build/dist/Math/vector-view.js.map +1 -0
  358. package/build/dist/Math/vector.js +326 -0
  359. package/build/dist/Math/vector.js.map +1 -0
  360. package/build/dist/Particles.js +449 -0
  361. package/build/dist/Particles.js.map +1 -0
  362. package/build/dist/Polyfill.js +56 -0
  363. package/build/dist/Polyfill.js.map +1 -0
  364. package/build/dist/Promises.js +205 -0
  365. package/build/dist/Promises.js.map +1 -0
  366. package/build/dist/Resources/Gif.js +479 -0
  367. package/build/dist/Resources/Gif.js.map +1 -0
  368. package/build/dist/Resources/Index.js +4 -0
  369. package/build/dist/Resources/Index.js.map +1 -0
  370. package/build/dist/Resources/Resource.js +74 -0
  371. package/build/dist/Resources/Resource.js.map +1 -0
  372. package/build/dist/Resources/Sound/AudioContext.js +16 -0
  373. package/build/dist/Resources/Sound/AudioContext.js.map +1 -0
  374. package/build/dist/Resources/Sound/Index.js +4 -0
  375. package/build/dist/Resources/Sound/Index.js.map +1 -0
  376. package/build/dist/Resources/Sound/Sound.js +240 -0
  377. package/build/dist/Resources/Sound/Sound.js.map +1 -0
  378. package/build/dist/Resources/Sound/WebAudioInstance.js +160 -0
  379. package/build/dist/Resources/Sound/WebAudioInstance.js.map +1 -0
  380. package/build/dist/Scene.js +458 -0
  381. package/build/dist/Scene.js.map +1 -0
  382. package/build/dist/Screen.js +634 -0
  383. package/build/dist/Screen.js.map +1 -0
  384. package/build/dist/ScreenElement.js +29 -0
  385. package/build/dist/ScreenElement.js.map +1 -0
  386. package/build/dist/TileMap.js +488 -0
  387. package/build/dist/TileMap.js.map +1 -0
  388. package/build/dist/Timer.js +198 -0
  389. package/build/dist/Timer.js.map +1 -0
  390. package/build/dist/Traits/Index.js +5 -0
  391. package/build/dist/Traits/Index.js.map +1 -0
  392. package/build/dist/Traits/OffscreenCulling.js +35 -0
  393. package/build/dist/Traits/OffscreenCulling.js.map +1 -0
  394. package/build/dist/Trigger.js +113 -0
  395. package/build/dist/Trigger.js.map +1 -0
  396. package/build/dist/Util/Actors.js +19 -0
  397. package/build/dist/Util/Actors.js.map +1 -0
  398. package/build/dist/Util/Browser.js +66 -0
  399. package/build/dist/Util/Browser.js.map +1 -0
  400. package/build/dist/Util/Clock.js +219 -0
  401. package/build/dist/Util/Clock.js.map +1 -0
  402. package/build/dist/Util/CullingBox.js +104 -0
  403. package/build/dist/Util/CullingBox.js.map +1 -0
  404. package/build/dist/Util/Decorators.js +78 -0
  405. package/build/dist/Util/Decorators.js.map +1 -0
  406. package/build/dist/Util/Detector.js +167 -0
  407. package/build/dist/Util/Detector.js.map +1 -0
  408. package/build/dist/Util/DrawUtil.js +117 -0
  409. package/build/dist/Util/DrawUtil.js.map +1 -0
  410. package/build/dist/Util/EasingFunctions.js +118 -0
  411. package/build/dist/Util/EasingFunctions.js.map +1 -0
  412. package/build/dist/Util/Fps.js +47 -0
  413. package/build/dist/Util/Fps.js.map +1 -0
  414. package/build/dist/Util/Index.js +7 -0
  415. package/build/dist/Util/Index.js.map +1 -0
  416. package/build/dist/Util/Log.js +195 -0
  417. package/build/dist/Util/Log.js.map +1 -0
  418. package/build/dist/Util/Observable.js +60 -0
  419. package/build/dist/Util/Observable.js.map +1 -0
  420. package/build/dist/Util/Pool.js +66 -0
  421. package/build/dist/Util/Pool.js.map +1 -0
  422. package/build/dist/Util/SortedList.js +261 -0
  423. package/build/dist/Util/SortedList.js.map +1 -0
  424. package/build/dist/Util/Sound.js +22 -0
  425. package/build/dist/Util/Sound.js.map +1 -0
  426. package/build/dist/Util/Util.js +294 -0
  427. package/build/dist/Util/Util.js.map +1 -0
  428. package/build/dist/Util/Watch.js +67 -0
  429. package/build/dist/Util/Watch.js.map +1 -0
  430. package/build/dist/Util/WebAudio.js +62 -0
  431. package/build/dist/Util/WebAudio.js.map +1 -0
  432. package/build/dist/excalibur.js +101 -22
  433. package/build/dist/excalibur.js.map +1 -1
  434. package/build/dist/excalibur.min.js +1 -1
  435. package/build/dist/excalibur.min.js.LICENSE.txt +1 -1
  436. package/build/dist/excalibur.min.js.map +1 -1
  437. package/build/dist/index.js +74 -0
  438. package/build/dist/index.js.map +1 -0
  439. package/build/esm/Engine.d.ts +4 -1
  440. package/build/esm/Graphics/Context/texture-loader.d.ts +8 -0
  441. package/build/esm/excalibur.js +101 -22
  442. package/build/esm/excalibur.js.map +1 -1
  443. package/build/esm/excalibur.min.js +1 -1
  444. package/build/esm/excalibur.min.js.LICENSE.txt +1 -1
  445. package/build/esm/excalibur.min.js.map +1 -1
  446. package/package.json +23 -22
@@ -0,0 +1,375 @@
1
+ import { ColorBlindFlags } from './DebugFlags';
2
+ import { Color } from '../Color';
3
+ /**
4
+ * Debug statistics and flags for Excalibur. If polling these values, it would be
5
+ * best to do so on the `postupdate` event for [[Engine]], after all values have been
6
+ * updated during a frame.
7
+ */
8
+ export class Debug {
9
+ constructor(engine) {
10
+ /**
11
+ * Performance statistics
12
+ */
13
+ this.stats = {
14
+ /**
15
+ * Current frame statistics. Engine reuses this instance, use [[FrameStats.clone]] to copy frame stats.
16
+ * Best accessed on [[postframe]] event. See [[FrameStats]]
17
+ */
18
+ currFrame: new FrameStats(),
19
+ /**
20
+ * Previous frame statistics. Engine reuses this instance, use [[FrameStats.clone]] to copy frame stats.
21
+ * Best accessed on [[preframe]] event. Best inspected on engine event `preframe`. See [[FrameStats]]
22
+ */
23
+ prevFrame: new FrameStats()
24
+ };
25
+ /**
26
+ * Filter debug context to named entities or entity ids
27
+ */
28
+ this.filter = {
29
+ /**
30
+ * Toggle filter on or off (default off) must be on for DebugDraw to use filters
31
+ */
32
+ useFilter: false,
33
+ /**
34
+ * Query for entities by name, if the entity name contains `nameQuery` it will be included
35
+ */
36
+ nameQuery: '',
37
+ /**
38
+ * Query for Entity ids, if the id matches it will be included
39
+ */
40
+ ids: []
41
+ };
42
+ /**
43
+ * Entity debug settings
44
+ */
45
+ this.entity = {
46
+ showAll: false,
47
+ showId: true,
48
+ showName: false
49
+ };
50
+ /**
51
+ * Transform component debug settings
52
+ */
53
+ this.transform = {
54
+ showAll: false,
55
+ showPosition: false,
56
+ showPositionLabel: false,
57
+ positionColor: Color.Yellow,
58
+ showScale: false,
59
+ scaleColor: Color.Green,
60
+ showRotation: false,
61
+ rotationColor: Color.Blue
62
+ };
63
+ /**
64
+ * Graphics component debug settings
65
+ */
66
+ this.graphics = {
67
+ showAll: false,
68
+ showBounds: true,
69
+ boundsColor: Color.Yellow
70
+ };
71
+ /**
72
+ * Collider component debug settings
73
+ */
74
+ this.collider = {
75
+ showAll: false,
76
+ showBounds: true,
77
+ boundsColor: Color.Blue,
78
+ showOwner: false,
79
+ showGeometry: true,
80
+ geometryColor: Color.Green
81
+ };
82
+ /**
83
+ * Physics simulation debug settings
84
+ */
85
+ this.physics = {
86
+ showAll: false,
87
+ showBroadphaseSpacePartitionDebug: false,
88
+ showCollisionNormals: false,
89
+ collisionNormalColor: Color.Cyan,
90
+ showCollisionContacts: true,
91
+ collisionContactColor: Color.Red
92
+ };
93
+ /**
94
+ * Motion component debug settings
95
+ */
96
+ this.motion = {
97
+ showAll: false,
98
+ showVelocity: false,
99
+ velocityColor: Color.Yellow,
100
+ showAcceleration: false,
101
+ accelerationColor: Color.Red
102
+ };
103
+ /**
104
+ * Body component debug settings
105
+ */
106
+ this.body = {
107
+ showAll: false,
108
+ showCollisionGroup: false,
109
+ showCollisionType: false,
110
+ showSleeping: false,
111
+ showMotion: false,
112
+ showMass: false
113
+ };
114
+ /**
115
+ * Camera debug settings
116
+ */
117
+ this.camera = {
118
+ showAll: false,
119
+ showFocus: false,
120
+ focusColor: Color.Red,
121
+ showZoom: false
122
+ };
123
+ this._engine = engine;
124
+ this.colorBlindMode = new ColorBlindFlags(this._engine);
125
+ }
126
+ /**
127
+ * Switch the current excalibur clock with the [[TestClock]] and return
128
+ * it in the same running state.
129
+ *
130
+ * This is useful when you need to debug frame by frame.
131
+ */
132
+ useTestClock() {
133
+ const clock = this._engine.clock;
134
+ const wasRunning = clock.isRunning();
135
+ clock.stop();
136
+ const testClock = clock.toTestClock();
137
+ if (wasRunning) {
138
+ testClock.start();
139
+ }
140
+ this._engine.clock = testClock;
141
+ return testClock;
142
+ }
143
+ /**
144
+ * Switch the current excalibur clock with the [[StandardClock]] and
145
+ * return it in the same running state.
146
+ *
147
+ * This is useful when you need to switch back to normal mode after
148
+ * debugging.
149
+ */
150
+ useStandardClock() {
151
+ const currentClock = this._engine.clock;
152
+ const wasRunning = currentClock.isRunning();
153
+ currentClock.stop();
154
+ const standardClock = currentClock.toStandardClock();
155
+ if (wasRunning) {
156
+ standardClock.start();
157
+ }
158
+ this._engine.clock = standardClock;
159
+ return standardClock;
160
+ }
161
+ }
162
+ /**
163
+ * Implementation of a frame's stats. Meant to have values copied via [[FrameStats.reset]], avoid
164
+ * creating instances of this every frame.
165
+ */
166
+ export class FrameStats {
167
+ constructor() {
168
+ this._id = 0;
169
+ this._delta = 0;
170
+ this._fps = 0;
171
+ this._actorStats = {
172
+ alive: 0,
173
+ killed: 0,
174
+ ui: 0,
175
+ get remaining() {
176
+ return this.alive - this.killed;
177
+ },
178
+ get total() {
179
+ return this.remaining + this.ui;
180
+ }
181
+ };
182
+ this._durationStats = {
183
+ update: 0,
184
+ draw: 0,
185
+ get total() {
186
+ return this.update + this.draw;
187
+ }
188
+ };
189
+ this._physicsStats = new PhysicsStats();
190
+ this._graphicsStats = {
191
+ drawCalls: 0,
192
+ drawnImages: 0
193
+ };
194
+ }
195
+ /**
196
+ * Zero out values or clone other IFrameStat stats. Allows instance reuse.
197
+ *
198
+ * @param [otherStats] Optional stats to clone
199
+ */
200
+ reset(otherStats) {
201
+ if (otherStats) {
202
+ this.id = otherStats.id;
203
+ this.delta = otherStats.delta;
204
+ this.fps = otherStats.fps;
205
+ this.actors.alive = otherStats.actors.alive;
206
+ this.actors.killed = otherStats.actors.killed;
207
+ this.actors.ui = otherStats.actors.ui;
208
+ this.duration.update = otherStats.duration.update;
209
+ this.duration.draw = otherStats.duration.draw;
210
+ this._physicsStats.reset(otherStats.physics);
211
+ this.graphics.drawCalls = otherStats.graphics.drawCalls;
212
+ this.graphics.drawnImages = otherStats.graphics.drawnImages;
213
+ }
214
+ else {
215
+ this.id = this.delta = this.fps = 0;
216
+ this.actors.alive = this.actors.killed = this.actors.ui = 0;
217
+ this.duration.update = this.duration.draw = 0;
218
+ this._physicsStats.reset();
219
+ this.graphics.drawnImages = this.graphics.drawCalls = 0;
220
+ }
221
+ }
222
+ /**
223
+ * Provides a clone of this instance.
224
+ */
225
+ clone() {
226
+ const fs = new FrameStats();
227
+ fs.reset(this);
228
+ return fs;
229
+ }
230
+ /**
231
+ * Gets the frame's id
232
+ */
233
+ get id() {
234
+ return this._id;
235
+ }
236
+ /**
237
+ * Sets the frame's id
238
+ */
239
+ set id(value) {
240
+ this._id = value;
241
+ }
242
+ /**
243
+ * Gets the frame's delta (time since last frame)
244
+ */
245
+ get delta() {
246
+ return this._delta;
247
+ }
248
+ /**
249
+ * Sets the frame's delta (time since last frame). Internal use only.
250
+ * @internal
251
+ */
252
+ set delta(value) {
253
+ this._delta = value;
254
+ }
255
+ /**
256
+ * Gets the frame's frames-per-second (FPS)
257
+ */
258
+ get fps() {
259
+ return this._fps;
260
+ }
261
+ /**
262
+ * Sets the frame's frames-per-second (FPS). Internal use only.
263
+ * @internal
264
+ */
265
+ set fps(value) {
266
+ this._fps = value;
267
+ }
268
+ /**
269
+ * Gets the frame's actor statistics
270
+ */
271
+ get actors() {
272
+ return this._actorStats;
273
+ }
274
+ /**
275
+ * Gets the frame's duration statistics
276
+ */
277
+ get duration() {
278
+ return this._durationStats;
279
+ }
280
+ /**
281
+ * Gets the frame's physics statistics
282
+ */
283
+ get physics() {
284
+ return this._physicsStats;
285
+ }
286
+ /**
287
+ * Gets the frame's graphics statistics
288
+ */
289
+ get graphics() {
290
+ return this._graphicsStats;
291
+ }
292
+ }
293
+ export class PhysicsStats {
294
+ constructor() {
295
+ this._pairs = 0;
296
+ this._collisions = 0;
297
+ this._contacts = new Map();
298
+ this._fastBodies = 0;
299
+ this._fastBodyCollisions = 0;
300
+ this._broadphase = 0;
301
+ this._narrowphase = 0;
302
+ }
303
+ /**
304
+ * Zero out values or clone other IPhysicsStats stats. Allows instance reuse.
305
+ *
306
+ * @param [otherStats] Optional stats to clone
307
+ */
308
+ reset(otherStats) {
309
+ if (otherStats) {
310
+ this.pairs = otherStats.pairs;
311
+ this.collisions = otherStats.collisions;
312
+ this.contacts = otherStats.contacts;
313
+ this.fastBodies = otherStats.fastBodies;
314
+ this.fastBodyCollisions = otherStats.fastBodyCollisions;
315
+ this.broadphase = otherStats.broadphase;
316
+ this.narrowphase = otherStats.narrowphase;
317
+ }
318
+ else {
319
+ this.pairs = this.collisions = this.fastBodies = 0;
320
+ this.fastBodyCollisions = this.broadphase = this.narrowphase = 0;
321
+ this.contacts.clear();
322
+ }
323
+ }
324
+ /**
325
+ * Provides a clone of this instance.
326
+ */
327
+ clone() {
328
+ const ps = new PhysicsStats();
329
+ ps.reset(this);
330
+ return ps;
331
+ }
332
+ get pairs() {
333
+ return this._pairs;
334
+ }
335
+ set pairs(value) {
336
+ this._pairs = value;
337
+ }
338
+ get collisions() {
339
+ return this._collisions;
340
+ }
341
+ set collisions(value) {
342
+ this._collisions = value;
343
+ }
344
+ get contacts() {
345
+ return this._contacts;
346
+ }
347
+ set contacts(contacts) {
348
+ this._contacts = contacts;
349
+ }
350
+ get fastBodies() {
351
+ return this._fastBodies;
352
+ }
353
+ set fastBodies(value) {
354
+ this._fastBodies = value;
355
+ }
356
+ get fastBodyCollisions() {
357
+ return this._fastBodyCollisions;
358
+ }
359
+ set fastBodyCollisions(value) {
360
+ this._fastBodyCollisions = value;
361
+ }
362
+ get broadphase() {
363
+ return this._broadphase;
364
+ }
365
+ set broadphase(value) {
366
+ this._broadphase = value;
367
+ }
368
+ get narrowphase() {
369
+ return this._narrowphase;
370
+ }
371
+ set narrowphase(value) {
372
+ this._narrowphase = value;
373
+ }
374
+ }
375
+ //# sourceMappingURL=Debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Debug.js","sourceRoot":"","sources":["../../../src/engine/Debug/Debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAmJjC;;;;GAIG;AACH,MAAM,OAAO,KAAK;IAGhB,YAAY,MAAc;QA6C1B;;WAEG;QACI,UAAK,GAAe;YACzB;;;eAGG;YACH,SAAS,EAAE,IAAI,UAAU,EAAE;YAE3B;;;eAGG;YACH,SAAS,EAAE,IAAI,UAAU,EAAE;SAC5B,CAAC;QAQF;;WAEG;QACI,WAAM,GAA6D;YACxE;;eAEG;YACH,SAAS,EAAE,KAAK;YAChB;;eAEG;YACH,SAAS,EAAE,EAAE;YACb;;eAEG;YACH,GAAG,EAAE,EAAE;SACR,CAAC;QAEF;;WAEG;QACI,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CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAW,WAAW,CAAC,KAAa;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ import { ColorBlindnessMode } from '../Graphics/PostProcessor/ColorBlindnessMode';
2
+ import { ColorBlindnessPostProcessor } from '../Graphics/PostProcessor/ColorBlindnessPostProcessor';
3
+ import { ExcaliburGraphicsContextWebGL } from '..';
4
+ export class ColorBlindFlags {
5
+ constructor(engine) {
6
+ this._engine = engine;
7
+ this._colorBlindPostProcessor = new ColorBlindnessPostProcessor(ColorBlindnessMode.Protanope);
8
+ }
9
+ /**
10
+ * Correct colors for a specified color blindness
11
+ * @param colorBlindness
12
+ */
13
+ correct(colorBlindness) {
14
+ if (this._engine.graphicsContext instanceof ExcaliburGraphicsContextWebGL) {
15
+ this.clear();
16
+ this._colorBlindPostProcessor.colorBlindnessMode = colorBlindness;
17
+ this._colorBlindPostProcessor.simulate = false;
18
+ this._engine.graphicsContext.addPostProcessor(this._colorBlindPostProcessor);
19
+ }
20
+ }
21
+ /**
22
+ * Simulate colors for a specified color blindness
23
+ * @param colorBlindness
24
+ */
25
+ simulate(colorBlindness) {
26
+ if (this._engine.graphicsContext instanceof ExcaliburGraphicsContextWebGL) {
27
+ this.clear();
28
+ this._colorBlindPostProcessor.colorBlindnessMode = colorBlindness;
29
+ this._colorBlindPostProcessor.simulate = true;
30
+ this._engine.graphicsContext.addPostProcessor(this._colorBlindPostProcessor);
31
+ }
32
+ }
33
+ /**
34
+ * Remove color blindness post processor
35
+ */
36
+ clear() {
37
+ this._engine.graphicsContext.removePostProcessor(this._colorBlindPostProcessor);
38
+ }
39
+ }
40
+ //# sourceMappingURL=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Ae,CAAC,mBAAmB,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAClF,CAAC;CACF"}
@@ -0,0 +1,251 @@
1
+ import { MotionComponent } from '../EntityComponentSystem/Components/MotionComponent';
2
+ import { ColliderComponent } from '../Collision/ColliderComponent';
3
+ import { CoordPlane, TransformComponent } from '../EntityComponentSystem';
4
+ import { System, SystemType } from '../EntityComponentSystem/System';
5
+ import { vec, Vector } from '../Math/vector';
6
+ import { toDegrees } from '../Math/util';
7
+ import { BodyComponent, CollisionSystem, CompositeCollider, GraphicsComponent, Particle } from '..';
8
+ import { DebugGraphicsComponent } from '../Graphics/DebugGraphicsComponent';
9
+ export class DebugSystem extends System {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.types = ['ex.transform'];
13
+ this.systemType = SystemType.Draw;
14
+ this.priority = 999; // lowest priority
15
+ }
16
+ initialize(scene) {
17
+ this._graphicsContext = scene.engine.graphicsContext;
18
+ this._camera = scene.camera;
19
+ this._engine = scene.engine;
20
+ this._collisionSystem = scene.world.systemManager.get(CollisionSystem);
21
+ }
22
+ update(entities, _delta) {
23
+ var _a, _b;
24
+ if (!this._engine.isDebug) {
25
+ return;
26
+ }
27
+ const filterSettings = this._engine.debug.filter;
28
+ let id;
29
+ let name;
30
+ const entitySettings = this._engine.debug.entity;
31
+ let tx;
32
+ const txSettings = this._engine.debug.transform;
33
+ let motion;
34
+ const motionSettings = this._engine.debug.motion;
35
+ let colliderComp;
36
+ const colliderSettings = this._engine.debug.collider;
37
+ const physicsSettings = this._engine.debug.physics;
38
+ let graphics;
39
+ const graphicsSettings = this._engine.debug.graphics;
40
+ let debugDraw;
41
+ let body;
42
+ const bodySettings = this._engine.debug.body;
43
+ const cameraSettings = this._engine.debug.camera;
44
+ for (const entity of entities) {
45
+ if (entity.hasTag('offscreen')) {
46
+ // skip offscreen entities
47
+ continue;
48
+ }
49
+ if (entity instanceof Particle) {
50
+ // Particles crush the renderer :(
51
+ continue;
52
+ }
53
+ if (filterSettings.useFilter) {
54
+ const allIds = filterSettings.ids.length === 0;
55
+ const idMatch = allIds || filterSettings.ids.includes(entity.id);
56
+ if (!idMatch) {
57
+ continue;
58
+ }
59
+ const allNames = filterSettings.nameQuery === '';
60
+ const nameMatch = allNames || entity.name.includes(filterSettings.nameQuery);
61
+ if (!nameMatch) {
62
+ continue;
63
+ }
64
+ }
65
+ let cursor = Vector.Zero;
66
+ const lineHeight = vec(0, 16);
67
+ id = entity.id;
68
+ name = entity.name;
69
+ tx = entity.get(TransformComponent);
70
+ // This optionally sets our camera based on the entity coord plan (world vs. screen)
71
+ this._pushCameraTransform(tx);
72
+ this._graphicsContext.save();
73
+ this._applyTransform(entity);
74
+ if (tx) {
75
+ if (txSettings.showAll || txSettings.showPosition) {
76
+ this._graphicsContext.debug.drawPoint(Vector.Zero, { size: 4, color: txSettings.positionColor });
77
+ }
78
+ if (txSettings.showAll || txSettings.showPositionLabel) {
79
+ this._graphicsContext.debug.drawText(`pos${tx.pos.toString(2)}`, cursor);
80
+ cursor = cursor.add(lineHeight);
81
+ }
82
+ if (entitySettings.showAll || entitySettings.showId) {
83
+ this._graphicsContext.debug.drawText(`id(${id}) ${tx.parent ? 'child of id(' + ((_b = (_a = tx.parent) === null || _a === void 0 ? void 0 : _a.owner) === null || _b === void 0 ? void 0 : _b.id) + ')' : ''}`, cursor);
84
+ cursor = cursor.add(lineHeight);
85
+ }
86
+ if (entitySettings.showAll || entitySettings.showName) {
87
+ this._graphicsContext.debug.drawText(`name(${name})`, cursor);
88
+ cursor = cursor.add(lineHeight);
89
+ }
90
+ if (txSettings.showAll || txSettings.showRotation) {
91
+ this._graphicsContext.drawLine(Vector.Zero, Vector.fromAngle(tx.rotation).scale(50).add(Vector.Zero), txSettings.rotationColor, 2);
92
+ this._graphicsContext.debug.drawText(`rot deg(${toDegrees(tx.rotation).toFixed(2)})`, cursor);
93
+ cursor = cursor.add(lineHeight);
94
+ }
95
+ if (txSettings.showAll || txSettings.showScale) {
96
+ this._graphicsContext.drawLine(Vector.Zero, tx.scale.add(Vector.Zero), txSettings.scaleColor, 2);
97
+ }
98
+ }
99
+ graphics = entity.get(GraphicsComponent);
100
+ if (graphics) {
101
+ if (graphicsSettings.showAll || graphicsSettings.showBounds) {
102
+ const bounds = graphics.localBounds;
103
+ bounds.draw(this._graphicsContext, graphicsSettings.boundsColor);
104
+ }
105
+ }
106
+ debugDraw = entity.get(DebugGraphicsComponent);
107
+ if (debugDraw) {
108
+ debugDraw.draw(this._graphicsContext);
109
+ }
110
+ body = entity.get(BodyComponent);
111
+ if (body) {
112
+ if (bodySettings.showAll || bodySettings.showCollisionGroup) {
113
+ this._graphicsContext.debug.drawText(`collision group(${body.group.name})`, cursor);
114
+ cursor = cursor.add(lineHeight);
115
+ }
116
+ if (bodySettings.showAll || bodySettings.showCollisionType) {
117
+ this._graphicsContext.debug.drawText(`collision type(${body.collisionType})`, cursor);
118
+ cursor = cursor.add(lineHeight);
119
+ }
120
+ if (bodySettings.showAll || bodySettings.showMass) {
121
+ this._graphicsContext.debug.drawText(`mass(${body.mass})`, cursor);
122
+ cursor = cursor.add(lineHeight);
123
+ }
124
+ if (bodySettings.showAll || bodySettings.showMotion) {
125
+ this._graphicsContext.debug.drawText(`motion(${body.sleepMotion})`, cursor);
126
+ cursor = cursor.add(lineHeight);
127
+ }
128
+ if (bodySettings.showAll || bodySettings.showSleeping) {
129
+ this._graphicsContext.debug.drawText(`sleeping(${body.canSleep ? body.sleeping : 'cant sleep'})`, cursor);
130
+ cursor = cursor.add(lineHeight);
131
+ }
132
+ }
133
+ this._graphicsContext.restore();
134
+ motion = entity.get(MotionComponent);
135
+ if (motion) {
136
+ if (motionSettings.showAll || motionSettings.showVelocity) {
137
+ this._graphicsContext.debug.drawText(`vel${motion.vel.toString(2)}`, cursor.add(tx.globalPos));
138
+ this._graphicsContext.drawLine(tx.globalPos, tx.globalPos.add(motion.vel), motionSettings.velocityColor, 2);
139
+ cursor = cursor.add(lineHeight);
140
+ }
141
+ if (motionSettings.showAll || motionSettings.showAcceleration) {
142
+ this._graphicsContext.drawLine(tx.globalPos, tx.globalPos.add(motion.acc), motionSettings.accelerationColor, 2);
143
+ }
144
+ }
145
+ // Colliders live in world space already so after the restore()
146
+ colliderComp = entity.get(ColliderComponent);
147
+ if (colliderComp) {
148
+ const collider = colliderComp.get();
149
+ if ((colliderSettings.showAll || colliderSettings.showGeometry) && collider) {
150
+ collider.debug(this._graphicsContext, colliderSettings.geometryColor);
151
+ }
152
+ if (colliderSettings.showAll || colliderSettings.showBounds) {
153
+ if (collider instanceof CompositeCollider) {
154
+ const colliders = collider.getColliders();
155
+ for (const collider of colliders) {
156
+ const bounds = collider.bounds;
157
+ const pos = vec(bounds.left, bounds.top);
158
+ this._graphicsContext.debug.drawRect(pos.x, pos.y, bounds.width, bounds.height, { color: colliderSettings.boundsColor });
159
+ if (colliderSettings.showAll || colliderSettings.showOwner) {
160
+ this._graphicsContext.debug.drawText(`owner id(${collider.owner.id})`, pos);
161
+ }
162
+ }
163
+ colliderComp.bounds.draw(this._graphicsContext, colliderSettings.boundsColor);
164
+ }
165
+ else if (collider) {
166
+ const bounds = colliderComp.bounds;
167
+ const pos = vec(bounds.left, bounds.top);
168
+ this._graphicsContext.debug.drawRect(pos.x, pos.y, bounds.width, bounds.height, { color: colliderSettings.boundsColor });
169
+ if (colliderSettings.showAll || colliderSettings.showOwner) {
170
+ this._graphicsContext.debug.drawText(`owner id(${colliderComp.owner.id})`, pos);
171
+ }
172
+ }
173
+ }
174
+ }
175
+ this._popCameraTransform(tx);
176
+ }
177
+ this._graphicsContext.save();
178
+ this._camera.draw(this._graphicsContext);
179
+ if (physicsSettings.showAll || physicsSettings.showBroadphaseSpacePartitionDebug) {
180
+ this._collisionSystem.debug(this._graphicsContext);
181
+ }
182
+ if (physicsSettings.showAll || physicsSettings.showCollisionContacts || physicsSettings.showCollisionNormals) {
183
+ for (const [_, contact] of this._engine.debug.stats.currFrame.physics.contacts) {
184
+ if (physicsSettings.showAll || physicsSettings.showCollisionContacts) {
185
+ for (const point of contact.points) {
186
+ this._graphicsContext.debug.drawPoint(point, { size: 5, color: physicsSettings.collisionContactColor });
187
+ }
188
+ }
189
+ if (physicsSettings.showAll || physicsSettings.showCollisionNormals) {
190
+ for (const point of contact.points) {
191
+ this._graphicsContext.debug.drawLine(point, contact.normal.scale(30).add(point), {
192
+ color: physicsSettings.collisionNormalColor
193
+ });
194
+ }
195
+ }
196
+ }
197
+ }
198
+ this._graphicsContext.restore();
199
+ if (cameraSettings) {
200
+ this._graphicsContext.save();
201
+ this._camera.draw(this._graphicsContext);
202
+ if (cameraSettings.showAll || cameraSettings.showFocus) {
203
+ this._graphicsContext.drawCircle(this._camera.pos, 4, cameraSettings.focusColor);
204
+ }
205
+ if (cameraSettings.showAll || cameraSettings.showZoom) {
206
+ this._graphicsContext.debug.drawText(`zoom(${this._camera.zoom})`, this._camera.pos);
207
+ }
208
+ this._graphicsContext.restore();
209
+ }
210
+ this._graphicsContext.flush();
211
+ }
212
+ /**
213
+ * This applies the current entity transform to the graphics context
214
+ * @param entity
215
+ */
216
+ _applyTransform(entity) {
217
+ const ancestors = entity.getAncestors();
218
+ for (const ancestor of ancestors) {
219
+ const transform = ancestor === null || ancestor === void 0 ? void 0 : ancestor.get(TransformComponent);
220
+ if (transform) {
221
+ this._graphicsContext.translate(transform.pos.x, transform.pos.y);
222
+ this._graphicsContext.scale(transform.scale.x, transform.scale.y);
223
+ this._graphicsContext.rotate(transform.rotation);
224
+ }
225
+ }
226
+ }
227
+ /**
228
+ * Applies the current camera transform if in world coordinates
229
+ * @param transform
230
+ */
231
+ _pushCameraTransform(transform) {
232
+ // Establish camera offset per entity
233
+ if (transform.coordPlane === CoordPlane.World) {
234
+ this._graphicsContext.save();
235
+ if (this._camera) {
236
+ this._camera.draw(this._graphicsContext);
237
+ }
238
+ }
239
+ }
240
+ /**
241
+ * Resets the current camera transform if in world coordinates
242
+ * @param transform
243
+ */
244
+ _popCameraTransform(transform) {
245
+ if (transform.coordPlane === CoordPlane.World) {
246
+ // Apply camera world offset
247
+ this._graphicsContext.restore();
248
+ }
249
+ }
250
+ }
251
+ //# sourceMappingURL=DebugSystem.js.map