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,30 @@
1
+ import { Vector } from './vector';
2
+ export class GlobalCoordinates {
3
+ constructor(worldPos, pagePos, screenPos) {
4
+ this.worldPos = worldPos;
5
+ this.pagePos = pagePos;
6
+ this.screenPos = screenPos;
7
+ }
8
+ static fromPagePosition(xOrPos, yOrEngine, engineOrUndefined) {
9
+ let pageX;
10
+ let pageY;
11
+ let pagePos;
12
+ let engine;
13
+ if (arguments.length === 3) {
14
+ pageX = xOrPos;
15
+ pageY = yOrEngine;
16
+ pagePos = new Vector(pageX, pageY);
17
+ engine = engineOrUndefined;
18
+ }
19
+ else {
20
+ pagePos = xOrPos;
21
+ pageX = pagePos.x;
22
+ pageY = pagePos.y;
23
+ engine = yOrEngine;
24
+ }
25
+ const screenPos = engine.screen.pageToScreenCoordinates(pagePos);
26
+ const worldPos = engine.screen.screenToWorldCoordinates(screenPos);
27
+ return new GlobalCoordinates(worldPos, pagePos, screenPos);
28
+ }
29
+ }
30
+ //# sourceMappingURL=global-coordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-coordinates.js","sourceRoot":"","sources":["../../../src/engine/Math/global-coordinates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,OAAO,iBAAiB;IA2B5B,YAAmB,QAAgB,EAAS,OAAe,EAAS,SAAiB;QAAlE,aAAQ,GAAR,QAAQ,CAAQ;QAAS,YAAO,GAAP,OAAO,CAAQ;QAAS,cAAS,GAAT,SAAS,CAAQ;IAAG,CAAC;IAxBlF,MAAM,CAAC,gBAAgB,CAAC,MAAuB,EAAE,SAA0B,EAAE,iBAA0B;QAC5G,IAAI,KAAa,CAAC;QAClB,IAAI,KAAa,CAAC;QAClB,IAAI,OAAe,CAAC;QACpB,IAAI,MAAc,CAAC;QAEnB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,KAAK,GAAW,MAAM,CAAC;YACvB,KAAK,GAAW,SAAS,CAAC;YAC1B,OAAO,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACnC,MAAM,GAAG,iBAAiB,CAAC;SAC5B;aAAM;YACL,OAAO,GAAW,MAAM,CAAC;YACzB,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;YAClB,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;YAClB,MAAM,GAAW,SAAS,CAAC;SAC5B;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACjE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;QAEnE,OAAO,IAAI,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;CAGF"}
@@ -0,0 +1,194 @@
1
+ import { Vector } from './vector';
2
+ /**
3
+ * A 2D line segment
4
+ */
5
+ export class Line {
6
+ /**
7
+ * @param begin The starting point of the line segment
8
+ * @param end The ending point of the line segment
9
+ */
10
+ constructor(begin, end) {
11
+ this.begin = begin;
12
+ this.end = end;
13
+ }
14
+ /**
15
+ * Gets the raw slope (m) of the line. Will return (+/-)Infinity for vertical lines.
16
+ */
17
+ get slope() {
18
+ return (this.end.y - this.begin.y) / (this.end.x - this.begin.x);
19
+ }
20
+ /**
21
+ * Gets the Y-intercept (b) of the line. Will return (+/-)Infinity if there is no intercept.
22
+ */
23
+ get intercept() {
24
+ return this.begin.y - this.slope * this.begin.x;
25
+ }
26
+ /**
27
+ * Gets the normal of the line
28
+ */
29
+ normal() {
30
+ return this.end.sub(this.begin).normal();
31
+ }
32
+ dir() {
33
+ return this.end.sub(this.begin);
34
+ }
35
+ getPoints() {
36
+ return [this.begin, this.end];
37
+ }
38
+ /**
39
+ * Returns the slope of the line in the form of a vector of length 1
40
+ */
41
+ getSlope() {
42
+ const begin = this.begin;
43
+ const end = this.end;
44
+ const distance = begin.distance(end);
45
+ return end.sub(begin).scale(1 / distance);
46
+ }
47
+ /**
48
+ * Returns the edge of the line as vector, the length of the vector is the length of the edge
49
+ */
50
+ getEdge() {
51
+ const begin = this.begin;
52
+ const end = this.end;
53
+ return end.sub(begin);
54
+ }
55
+ /**
56
+ * Returns the length of the line segment in pixels
57
+ */
58
+ getLength() {
59
+ const begin = this.begin;
60
+ const end = this.end;
61
+ const distance = begin.distance(end);
62
+ return distance;
63
+ }
64
+ /**
65
+ * Returns the midpoint of the edge
66
+ */
67
+ get midpoint() {
68
+ return this.begin.add(this.end).scale(0.5);
69
+ }
70
+ /**
71
+ * Flips the direction of the line segment
72
+ */
73
+ flip() {
74
+ return new Line(this.end, this.begin);
75
+ }
76
+ /**
77
+ * Tests if a given point is below the line, points in the normal direction above the line are considered above.
78
+ * @param point
79
+ */
80
+ below(point) {
81
+ const above2 = (this.end.x - this.begin.x) * (point.y - this.begin.y) - (this.end.y - this.begin.y) * (point.x - this.begin.x);
82
+ return above2 >= 0;
83
+ }
84
+ /**
85
+ * Returns the clip point
86
+ * @param sideVector Vector that traces the line
87
+ * @param length Length to clip along side
88
+ */
89
+ clip(sideVector, length) {
90
+ let dir = sideVector;
91
+ dir = dir.normalize();
92
+ const near = dir.dot(this.begin) - length;
93
+ const far = dir.dot(this.end) - length;
94
+ const results = [];
95
+ if (near <= 0) {
96
+ results.push(this.begin);
97
+ }
98
+ if (far <= 0) {
99
+ results.push(this.end);
100
+ }
101
+ if (near * far < 0) {
102
+ const clipTime = near / (near - far);
103
+ results.push(this.begin.add(this.end.sub(this.begin).scale(clipTime)));
104
+ }
105
+ if (results.length !== 2) {
106
+ return null;
107
+ }
108
+ return new Line(results[0], results[1]);
109
+ }
110
+ /**
111
+ * Find the perpendicular distance from the line to a point
112
+ * https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
113
+ * @param point
114
+ */
115
+ distanceToPoint(point, signed = false) {
116
+ const x0 = point.x;
117
+ const y0 = point.y;
118
+ const l = this.getLength();
119
+ const dy = this.end.y - this.begin.y;
120
+ const dx = this.end.x - this.begin.x;
121
+ const distance = (dy * x0 - dx * y0 + this.end.x * this.begin.y - this.end.y * this.begin.x) / l;
122
+ return signed ? distance : Math.abs(distance);
123
+ }
124
+ /**
125
+ * Find the perpendicular line from the line to a point
126
+ * https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
127
+ * (a - p) - ((a - p) * n)n
128
+ * a is a point on the line
129
+ * p is the arbitrary point above the line
130
+ * n is a unit vector in direction of the line
131
+ * @param point
132
+ */
133
+ findVectorToPoint(point) {
134
+ const aMinusP = this.begin.sub(point);
135
+ const n = this.getSlope();
136
+ return aMinusP.sub(n.scale(aMinusP.dot(n)));
137
+ }
138
+ /**
139
+ * Finds a point on the line given only an X or a Y value. Given an X value, the function returns
140
+ * a new point with the calculated Y value and vice-versa.
141
+ *
142
+ * @param x The known X value of the target point
143
+ * @param y The known Y value of the target point
144
+ * @returns A new point with the other calculated axis value
145
+ */
146
+ findPoint(x = null, y = null) {
147
+ const m = this.slope;
148
+ const b = this.intercept;
149
+ if (x !== null) {
150
+ return new Vector(x, m * x + b);
151
+ }
152
+ else if (y !== null) {
153
+ return new Vector((y - b) / m, y);
154
+ }
155
+ else {
156
+ throw new Error('You must provide an X or a Y value');
157
+ }
158
+ }
159
+ /**
160
+ * @see http://stackoverflow.com/a/11908158/109458
161
+ */
162
+ hasPoint() {
163
+ let currPoint;
164
+ let threshold = 0;
165
+ if (typeof arguments[0] === 'number' && typeof arguments[1] === 'number') {
166
+ currPoint = new Vector(arguments[0], arguments[1]);
167
+ threshold = arguments[2] || 0;
168
+ }
169
+ else if (arguments[0] instanceof Vector) {
170
+ currPoint = arguments[0];
171
+ threshold = arguments[1] || 0;
172
+ }
173
+ else {
174
+ throw 'Could not determine the arguments for Vector.hasPoint';
175
+ }
176
+ const dxc = currPoint.x - this.begin.x;
177
+ const dyc = currPoint.y - this.begin.y;
178
+ const dx1 = this.end.x - this.begin.x;
179
+ const dy1 = this.end.y - this.begin.y;
180
+ const cross = dxc * dy1 - dyc * dx1;
181
+ // check whether point lines on the line
182
+ if (Math.abs(cross) > threshold) {
183
+ return false;
184
+ }
185
+ // check whether point lies in-between start and end
186
+ if (Math.abs(dx1) >= Math.abs(dy1)) {
187
+ return dx1 > 0 ? this.begin.x <= currPoint.x && currPoint.x <= this.end.x : this.end.x <= currPoint.x && currPoint.x <= this.begin.x;
188
+ }
189
+ else {
190
+ return dy1 > 0 ? this.begin.y <= currPoint.y && currPoint.y <= this.end.y : this.end.y <= currPoint.y && currPoint.y <= this.begin.y;
191
+ }
192
+ }
193
+ }
194
+ //# sourceMappingURL=line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.js","sourceRoot":"","sources":["../../../src/engine/Math/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;GAEG;AAEH,MAAM,OAAO,IAAI;IACf;;;OAGG;IACH,YAAmB,KAAa,EAAS,GAAW;QAAjC,UAAK,GAAL,KAAK,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAExD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3C,CAAC;IAEM,GAAG;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAEM,SAAS;QACd,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,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AG,GAAG,CAAC;QAEpC,wCAAwC;QACxC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,SAAS,EAAE;YAC/B,OAAO,KAAK,CAAC;SACd;QAED,oDAAoD;QACpD,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAClC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SACtI;aAAM;YACL,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SACtI;IACH,CAAC;CACF"}
@@ -0,0 +1,446 @@
1
+ import { sign } from './util';
2
+ import { Vector, vec } from './vector';
3
+ import { canonicalizeAngle } from './util';
4
+ export var MatrixLocations;
5
+ (function (MatrixLocations) {
6
+ MatrixLocations[MatrixLocations["X"] = 12] = "X";
7
+ MatrixLocations[MatrixLocations["Y"] = 13] = "Y";
8
+ })(MatrixLocations || (MatrixLocations = {}));
9
+ /**
10
+ * Excalibur Matrix helper for 4x4 matrices
11
+ *
12
+ * Useful for webgl 4x4 matrices
13
+ */
14
+ export class Matrix {
15
+ constructor() {
16
+ /**
17
+ * 4x4 matrix in column major order
18
+ *
19
+ * | | | | |
20
+ * | ------- | ------- | -------- | |
21
+ * | data[0] | data[4] | data[8] | data[12] |
22
+ * | data[1] | data[5] | data[9] | data[13] |
23
+ * | data[2] | data[6] | data[10] | data[14] |
24
+ * | data[3] | data[7] | data[11] | data[15] |
25
+ *
26
+ */
27
+ this.data = new Float32Array(16);
28
+ this._scaleSignX = 1;
29
+ this._scaleSignY = 1;
30
+ }
31
+ /**
32
+ * Creates an orthographic (flat non-perspective) projection
33
+ * https://en.wikipedia.org/wiki/Orthographic_projection
34
+ * @param left
35
+ * @param right
36
+ * @param bottom
37
+ * @param top
38
+ * @param near
39
+ * @param far
40
+ */
41
+ static ortho(left, right, bottom, top, near, far) {
42
+ const mat = new Matrix();
43
+ mat.data[0] = 2 / (right - left);
44
+ mat.data[1] = 0;
45
+ mat.data[2] = 0;
46
+ mat.data[3] = 0;
47
+ mat.data[4] = 0;
48
+ mat.data[5] = 2 / (top - bottom);
49
+ mat.data[6] = 0;
50
+ mat.data[7] = 0;
51
+ mat.data[8] = 0;
52
+ mat.data[9] = 0;
53
+ mat.data[10] = -2 / (far - near);
54
+ mat.data[11] = 0;
55
+ mat.data[12] = -(right + left) / (right - left);
56
+ mat.data[13] = -(top + bottom) / (top - bottom);
57
+ mat.data[14] = -(far + near) / (far - near);
58
+ mat.data[15] = 1;
59
+ return mat;
60
+ }
61
+ /**
62
+ * Creates a new Matrix with the same data as the current 4x4
63
+ */
64
+ clone() {
65
+ const mat = new Matrix();
66
+ mat.data[0] = this.data[0];
67
+ mat.data[1] = this.data[1];
68
+ mat.data[2] = this.data[2];
69
+ mat.data[3] = this.data[3];
70
+ mat.data[4] = this.data[4];
71
+ mat.data[5] = this.data[5];
72
+ mat.data[6] = this.data[6];
73
+ mat.data[7] = this.data[7];
74
+ mat.data[8] = this.data[8];
75
+ mat.data[9] = this.data[9];
76
+ mat.data[10] = this.data[10];
77
+ mat.data[11] = this.data[11];
78
+ mat.data[12] = this.data[12];
79
+ mat.data[13] = this.data[13];
80
+ mat.data[14] = this.data[14];
81
+ mat.data[15] = this.data[15];
82
+ return mat;
83
+ }
84
+ /**
85
+ * Converts the current matrix into a DOMMatrix
86
+ *
87
+ * This is useful when working with the browser Canvas context
88
+ * @returns {DOMMatrix} DOMMatrix
89
+ */
90
+ toDOMMatrix() {
91
+ return new DOMMatrix([...this.data]);
92
+ }
93
+ /**
94
+ * Creates a new identity matrix (a matrix that when applied does nothing)
95
+ */
96
+ static identity() {
97
+ const mat = new Matrix();
98
+ mat.data[0] = 1;
99
+ mat.data[1] = 0;
100
+ mat.data[2] = 0;
101
+ mat.data[3] = 0;
102
+ mat.data[4] = 0;
103
+ mat.data[5] = 1;
104
+ mat.data[6] = 0;
105
+ mat.data[7] = 0;
106
+ mat.data[8] = 0;
107
+ mat.data[9] = 0;
108
+ mat.data[10] = 1;
109
+ mat.data[11] = 0;
110
+ mat.data[12] = 0;
111
+ mat.data[13] = 0;
112
+ mat.data[14] = 0;
113
+ mat.data[15] = 1;
114
+ return mat;
115
+ }
116
+ /**
117
+ * Resets the current matrix to the identity matrix, mutating it
118
+ * @returns {Matrix} Current matrix as identity
119
+ */
120
+ reset() {
121
+ const mat = this;
122
+ mat.data[0] = 1;
123
+ mat.data[1] = 0;
124
+ mat.data[2] = 0;
125
+ mat.data[3] = 0;
126
+ mat.data[4] = 0;
127
+ mat.data[5] = 1;
128
+ mat.data[6] = 0;
129
+ mat.data[7] = 0;
130
+ mat.data[8] = 0;
131
+ mat.data[9] = 0;
132
+ mat.data[10] = 1;
133
+ mat.data[11] = 0;
134
+ mat.data[12] = 0;
135
+ mat.data[13] = 0;
136
+ mat.data[14] = 0;
137
+ mat.data[15] = 1;
138
+ return mat;
139
+ }
140
+ /**
141
+ * Creates a brand new translation matrix at the specified 3d point
142
+ * @param x
143
+ * @param y
144
+ */
145
+ static translation(x, y) {
146
+ const mat = Matrix.identity();
147
+ mat.data[12] = x;
148
+ mat.data[13] = y;
149
+ return mat;
150
+ }
151
+ /**
152
+ * Creates a brand new scaling matrix with the specified scaling factor
153
+ * @param sx
154
+ * @param sy
155
+ */
156
+ static scale(sx, sy) {
157
+ const mat = Matrix.identity();
158
+ mat.data[0] = sx;
159
+ mat.data[5] = sy;
160
+ mat.data[10] = 1;
161
+ mat.data[15] = 1;
162
+ return mat;
163
+ }
164
+ /**
165
+ * Creates a brand new rotation matrix with the specified angle
166
+ * @param angleRadians
167
+ */
168
+ static rotation(angleRadians) {
169
+ const mat = Matrix.identity();
170
+ mat.data[0] = Math.cos(angleRadians);
171
+ mat.data[4] = -Math.sin(angleRadians);
172
+ mat.data[1] = Math.sin(angleRadians);
173
+ mat.data[5] = Math.cos(angleRadians);
174
+ return mat;
175
+ }
176
+ multv(other) {
177
+ const z = 0;
178
+ if (other instanceof Vector) {
179
+ return new Vector(other.x * this.data[0] + other.y * this.data[4] + z * this.data[6] + 1 * this.data[12], other.x * this.data[1] + other.y * this.data[5] + z * this.data[9] + 1 * this.data[13]);
180
+ }
181
+ else {
182
+ const dest = [
183
+ other[0] * this.data[0] + other[1] * this.data[4] + z * this.data[6] + 1 * this.data[12],
184
+ other[0] * this.data[1] + other[1] * this.data[5] + z * this.data[9] + 1 * this.data[13]
185
+ ];
186
+ return dest;
187
+ }
188
+ }
189
+ /**
190
+ * Multiplies the current matrix by another and returns the resulting matrix
191
+ * @param other
192
+ */
193
+ multm(other) {
194
+ const dest = new Matrix();
195
+ const a11 = this.data[0];
196
+ const a21 = this.data[1];
197
+ const a31 = this.data[2];
198
+ const a41 = this.data[3];
199
+ const a12 = this.data[4];
200
+ const a22 = this.data[5];
201
+ const a32 = this.data[6];
202
+ const a42 = this.data[7];
203
+ const a13 = this.data[8];
204
+ const a23 = this.data[9];
205
+ const a33 = this.data[10];
206
+ const a43 = this.data[11];
207
+ const a14 = this.data[12];
208
+ const a24 = this.data[13];
209
+ const a34 = this.data[14];
210
+ const a44 = this.data[15];
211
+ const b11 = other.data[0];
212
+ const b21 = other.data[1];
213
+ const b31 = other.data[2];
214
+ const b41 = other.data[3];
215
+ const b12 = other.data[4];
216
+ const b22 = other.data[5];
217
+ const b32 = other.data[6];
218
+ const b42 = other.data[7];
219
+ const b13 = other.data[8];
220
+ const b23 = other.data[9];
221
+ const b33 = other.data[10];
222
+ const b43 = other.data[11];
223
+ const b14 = other.data[12];
224
+ const b24 = other.data[13];
225
+ const b34 = other.data[14];
226
+ const b44 = other.data[15];
227
+ dest.data[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;
228
+ dest.data[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;
229
+ dest.data[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;
230
+ dest.data[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;
231
+ dest.data[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;
232
+ dest.data[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;
233
+ dest.data[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;
234
+ dest.data[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;
235
+ dest.data[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;
236
+ dest.data[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;
237
+ dest.data[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;
238
+ dest.data[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;
239
+ dest.data[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;
240
+ dest.data[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;
241
+ dest.data[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;
242
+ dest.data[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;
243
+ const s = this.getScale();
244
+ dest._scaleSignX = sign(s.x) * sign(dest._scaleSignX);
245
+ dest._scaleSignY = sign(s.y) * sign(dest._scaleSignY);
246
+ return dest;
247
+ }
248
+ /**
249
+ * Applies translation to the current matrix mutating it
250
+ * @param x
251
+ * @param y
252
+ */
253
+ translate(x, y) {
254
+ const a11 = this.data[0];
255
+ const a21 = this.data[1];
256
+ const a31 = this.data[2];
257
+ const a41 = this.data[3];
258
+ const a12 = this.data[4];
259
+ const a22 = this.data[5];
260
+ const a32 = this.data[6];
261
+ const a42 = this.data[7];
262
+ const a13 = this.data[8];
263
+ const a23 = this.data[9];
264
+ const a33 = this.data[10];
265
+ const a43 = this.data[11];
266
+ const a14 = this.data[12];
267
+ const a24 = this.data[13];
268
+ const a34 = this.data[14];
269
+ const a44 = this.data[15];
270
+ // Doesn't change z
271
+ const z = 0;
272
+ const w = 1;
273
+ this.data[12] = a11 * x + a12 * y + a13 * z + a14 * w;
274
+ this.data[13] = a21 * x + a22 * y + a23 * z + a24 * w;
275
+ this.data[14] = a31 * x + a32 * y + a33 * z + a34 * w;
276
+ this.data[15] = a41 * x + a42 * y + a43 * z + a44 * w;
277
+ return this;
278
+ }
279
+ setPosition(x, y) {
280
+ this.data[12] = x;
281
+ this.data[13] = y;
282
+ }
283
+ getPosition() {
284
+ return vec(this.data[12], this.data[13]);
285
+ }
286
+ /**
287
+ * Applies rotation to the current matrix mutating it
288
+ * @param angle in Radians
289
+ */
290
+ rotate(angle) {
291
+ const a11 = this.data[0];
292
+ const a21 = this.data[1];
293
+ const a31 = this.data[2];
294
+ const a41 = this.data[3];
295
+ const a12 = this.data[4];
296
+ const a22 = this.data[5];
297
+ const a32 = this.data[6];
298
+ const a42 = this.data[7];
299
+ const sine = Math.sin(angle);
300
+ const cosine = Math.cos(angle);
301
+ this.data[0] = cosine * a11 + sine * a12;
302
+ this.data[1] = cosine * a21 + sine * a22;
303
+ this.data[2] = cosine * a31 + sine * a32;
304
+ this.data[3] = cosine * a41 + sine * a42;
305
+ this.data[4] = cosine * a12 - sine * a11;
306
+ this.data[5] = cosine * a22 - sine * a21;
307
+ this.data[6] = cosine * a32 - sine * a31;
308
+ this.data[7] = cosine * a42 - sine * a41;
309
+ return this;
310
+ }
311
+ /**
312
+ * Applies scaling to the current matrix mutating it
313
+ * @param x
314
+ * @param y
315
+ */
316
+ scale(x, y) {
317
+ const a11 = this.data[0];
318
+ const a21 = this.data[1];
319
+ const a31 = this.data[2];
320
+ const a41 = this.data[3];
321
+ const a12 = this.data[4];
322
+ const a22 = this.data[5];
323
+ const a32 = this.data[6];
324
+ const a42 = this.data[7];
325
+ this.data[0] = a11 * x;
326
+ this.data[1] = a21 * x;
327
+ this.data[2] = a31 * x;
328
+ this.data[3] = a41 * x;
329
+ this.data[4] = a12 * y;
330
+ this.data[5] = a22 * y;
331
+ this.data[6] = a32 * y;
332
+ this.data[7] = a42 * y;
333
+ return this;
334
+ }
335
+ setRotation(angle) {
336
+ const currentScale = this.getScale();
337
+ const sine = Math.sin(angle);
338
+ const cosine = Math.cos(angle);
339
+ this.data[0] = cosine * currentScale.x;
340
+ this.data[1] = sine * currentScale.y;
341
+ this.data[4] = -sine * currentScale.x;
342
+ this.data[5] = cosine * currentScale.y;
343
+ }
344
+ getRotation() {
345
+ const angle = Math.atan2(this.data[1] / this.getScaleY(), this.data[0] / this.getScaleX());
346
+ return canonicalizeAngle(angle);
347
+ }
348
+ getScaleX() {
349
+ // absolute scale of the matrix (we lose sign so need to add it back)
350
+ const xscale = vec(this.data[0], this.data[4]).size;
351
+ return this._scaleSignX * xscale;
352
+ }
353
+ getScaleY() {
354
+ // absolute scale of the matrix (we lose sign so need to add it back)
355
+ const yscale = vec(this.data[1], this.data[5]).size;
356
+ return this._scaleSignY * yscale;
357
+ }
358
+ /**
359
+ * Get the scale of the matrix
360
+ */
361
+ getScale() {
362
+ return vec(this.getScaleX(), this.getScaleY());
363
+ }
364
+ setScaleX(val) {
365
+ this._scaleSignX = sign(val);
366
+ // negative scale acts like a 180 rotation, so flip
367
+ const xscale = vec(this.data[0] * this._scaleSignX, this.data[4] * this._scaleSignX).normalize();
368
+ this.data[0] = xscale.x * val;
369
+ this.data[4] = xscale.y * val;
370
+ }
371
+ setScaleY(val) {
372
+ this._scaleSignY = sign(val);
373
+ // negative scale acts like a 180 rotation, so flip
374
+ const yscale = vec(this.data[1] * this._scaleSignY, this.data[5] * this._scaleSignY).normalize();
375
+ this.data[1] = yscale.x * val;
376
+ this.data[5] = yscale.y * val;
377
+ }
378
+ setScale(scale) {
379
+ this.setScaleX(scale.x);
380
+ this.setScaleY(scale.y);
381
+ }
382
+ /**
383
+ * Determinant of the upper left 2x2 matrix
384
+ */
385
+ getBasisDeterminant() {
386
+ return this.data[0] * this.data[5] - this.data[1] * this.data[4];
387
+ }
388
+ /**
389
+ * Return the affine inverse, optionally store it in a target matrix.
390
+ *
391
+ * It's recommended you call .reset() the target unless you know what you're doing
392
+ * @param target
393
+ */
394
+ getAffineInverse(target) {
395
+ // See http://negativeprobability.blogspot.com/2011/11/affine-transformations-and-their.html
396
+ // See https://www.mathsisfun.com/algebra/matrix-inverse.html
397
+ // Since we are actually only doing 2D transformations we can use this hack
398
+ // We don't actually use the 3rd or 4th dimension
399
+ const det = this.getBasisDeterminant();
400
+ const inverseDet = 1 / det; // todo zero check
401
+ const a = this.data[0];
402
+ const b = this.data[4];
403
+ const c = this.data[1];
404
+ const d = this.data[5];
405
+ const m = target || Matrix.identity();
406
+ // inverts rotation and scale
407
+ m.data[0] = d * inverseDet;
408
+ m.data[1] = -c * inverseDet;
409
+ m.data[4] = -b * inverseDet;
410
+ m.data[5] = a * inverseDet;
411
+ const tx = this.data[12];
412
+ const ty = this.data[13];
413
+ // invert translation
414
+ // transform translation into the matrix basis created by rot/scale
415
+ m.data[12] = -(tx * m.data[0] + ty * m.data[4]);
416
+ m.data[13] = -(tx * m.data[1] + ty * m.data[5]);
417
+ return m;
418
+ }
419
+ isIdentity() {
420
+ return (this.data[0] === 1 &&
421
+ this.data[1] === 0 &&
422
+ this.data[2] === 0 &&
423
+ this.data[3] === 0 &&
424
+ this.data[4] === 0 &&
425
+ this.data[5] === 1 &&
426
+ this.data[6] === 0 &&
427
+ this.data[7] === 0 &&
428
+ this.data[8] === 0 &&
429
+ this.data[9] === 0 &&
430
+ this.data[10] === 1 &&
431
+ this.data[11] === 0 &&
432
+ this.data[12] === 0 &&
433
+ this.data[13] === 0 &&
434
+ this.data[14] === 0 &&
435
+ this.data[15] === 1);
436
+ }
437
+ toString() {
438
+ return `
439
+ [${this.data[0]} ${this.data[4]} ${this.data[8]} ${this.data[12]}]
440
+ [${this.data[1]} ${this.data[5]} ${this.data[9]} ${this.data[13]}]
441
+ [${this.data[2]} ${this.data[6]} ${this.data[10]} ${this.data[14]}]
442
+ [${this.data[3]} ${this.data[7]} ${this.data[11]} ${this.data[15]}]
443
+ `;
444
+ }
445
+ }
446
+ //# sourceMappingURL=matrix.js.map