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,264 @@
1
+ import { BoundingBox } from '../BoundingBox';
2
+ import { CollisionJumpTable } from './CollisionJumpTable';
3
+ import { PolygonCollider } from './PolygonCollider';
4
+ import { EdgeCollider } from './EdgeCollider';
5
+ import { Projection } from '../../Math/projection';
6
+ import { Vector } from '../../Math/vector';
7
+ import { Color } from '../../Color';
8
+ import { Collider } from './Collider';
9
+ import { ClosestLineJumpTable } from './ClosestLineJumpTable';
10
+ /**
11
+ * This is a circle collider for the excalibur rigid body physics simulation
12
+ */
13
+ export class CircleCollider extends Collider {
14
+ constructor(options) {
15
+ super();
16
+ /**
17
+ * Position of the circle relative to the collider, by default (0, 0).
18
+ */
19
+ this.offset = Vector.Zero;
20
+ this.offset = options.offset || Vector.Zero;
21
+ this.radius = options.radius || 0;
22
+ }
23
+ get worldPos() {
24
+ var _a, _b, _c, _d;
25
+ const tx = this._transform;
26
+ const scale = (_a = tx === null || tx === void 0 ? void 0 : tx.globalScale) !== null && _a !== void 0 ? _a : Vector.One;
27
+ const rotation = (_b = tx === null || tx === void 0 ? void 0 : tx.globalRotation) !== null && _b !== void 0 ? _b : 0;
28
+ const pos = ((_c = tx === null || tx === void 0 ? void 0 : tx.globalPos) !== null && _c !== void 0 ? _c : Vector.Zero);
29
+ return ((_d = this.offset) !== null && _d !== void 0 ? _d : Vector.Zero).scale(scale).rotate(rotation).add(pos);
30
+ }
31
+ /**
32
+ * Get the radius of the circle
33
+ */
34
+ get radius() {
35
+ var _a;
36
+ const tx = this._transform;
37
+ const scale = (_a = tx === null || tx === void 0 ? void 0 : tx.globalScale) !== null && _a !== void 0 ? _a : Vector.One;
38
+ // This is a trade off, the alternative is retooling circles to support ellipse collisions
39
+ return this._naturalRadius * Math.min(scale.x, scale.y);
40
+ }
41
+ /**
42
+ * Set the radius of the circle
43
+ */
44
+ set radius(val) {
45
+ var _a;
46
+ const tx = this._transform;
47
+ const scale = (_a = tx === null || tx === void 0 ? void 0 : tx.globalScale) !== null && _a !== void 0 ? _a : Vector.One;
48
+ // This is a trade off, the alternative is retooling circles to support ellipse collisions
49
+ this._naturalRadius = val / Math.min(scale.x, scale.y);
50
+ }
51
+ /**
52
+ * Returns a clone of this shape, not associated with any collider
53
+ */
54
+ clone() {
55
+ return new CircleCollider({
56
+ offset: this.offset.clone(),
57
+ radius: this.radius
58
+ });
59
+ }
60
+ /**
61
+ * Get the center of the collider in world coordinates
62
+ */
63
+ get center() {
64
+ var _a, _b, _c, _d;
65
+ const tx = this._transform;
66
+ const scale = (_a = tx === null || tx === void 0 ? void 0 : tx.globalScale) !== null && _a !== void 0 ? _a : Vector.One;
67
+ const rotation = (_b = tx === null || tx === void 0 ? void 0 : tx.globalRotation) !== null && _b !== void 0 ? _b : 0;
68
+ const pos = ((_c = tx === null || tx === void 0 ? void 0 : tx.globalPos) !== null && _c !== void 0 ? _c : Vector.Zero);
69
+ return ((_d = this.offset) !== null && _d !== void 0 ? _d : Vector.Zero).scale(scale).rotate(rotation).add(pos);
70
+ }
71
+ /**
72
+ * Tests if a point is contained in this collider
73
+ */
74
+ contains(point) {
75
+ var _a, _b;
76
+ const pos = (_b = (_a = this._transform) === null || _a === void 0 ? void 0 : _a.pos) !== null && _b !== void 0 ? _b : this.offset;
77
+ const distance = pos.distance(point);
78
+ if (distance <= this.radius) {
79
+ return true;
80
+ }
81
+ return false;
82
+ }
83
+ /**
84
+ * Casts a ray at the Circle collider and returns the nearest point of collision
85
+ * @param ray
86
+ */
87
+ rayCast(ray, max = Infinity) {
88
+ //https://en.wikipedia.org/wiki/Line%E2%80%93sphere_intersection
89
+ const c = this.center;
90
+ const dir = ray.dir;
91
+ const orig = ray.pos;
92
+ const discriminant = Math.sqrt(Math.pow(dir.dot(orig.sub(c)), 2) - Math.pow(orig.sub(c).distance(), 2) + Math.pow(this.radius, 2));
93
+ if (discriminant < 0) {
94
+ // no intersection
95
+ return null;
96
+ }
97
+ else {
98
+ let toi = 0;
99
+ if (discriminant === 0) {
100
+ toi = -dir.dot(orig.sub(c));
101
+ if (toi > 0 && toi < max) {
102
+ return ray.getPoint(toi);
103
+ }
104
+ return null;
105
+ }
106
+ else {
107
+ const toi1 = -dir.dot(orig.sub(c)) + discriminant;
108
+ const toi2 = -dir.dot(orig.sub(c)) - discriminant;
109
+ const positiveToi = [];
110
+ if (toi1 >= 0) {
111
+ positiveToi.push(toi1);
112
+ }
113
+ if (toi2 >= 0) {
114
+ positiveToi.push(toi2);
115
+ }
116
+ const mintoi = Math.min(...positiveToi);
117
+ if (mintoi <= max) {
118
+ return ray.getPoint(mintoi);
119
+ }
120
+ return null;
121
+ }
122
+ }
123
+ }
124
+ getClosestLineBetween(shape) {
125
+ if (shape instanceof CircleCollider) {
126
+ return ClosestLineJumpTable.CircleCircleClosestLine(this, shape);
127
+ }
128
+ else if (shape instanceof PolygonCollider) {
129
+ return ClosestLineJumpTable.PolygonCircleClosestLine(shape, this).flip();
130
+ }
131
+ else if (shape instanceof EdgeCollider) {
132
+ return ClosestLineJumpTable.CircleEdgeClosestLine(this, shape).flip();
133
+ }
134
+ else {
135
+ throw new Error(`Polygon could not collide with unknown CollisionShape ${typeof shape}`);
136
+ }
137
+ }
138
+ /**
139
+ * @inheritdoc
140
+ */
141
+ collide(collider) {
142
+ if (collider instanceof CircleCollider) {
143
+ return CollisionJumpTable.CollideCircleCircle(this, collider);
144
+ }
145
+ else if (collider instanceof PolygonCollider) {
146
+ return CollisionJumpTable.CollideCirclePolygon(this, collider);
147
+ }
148
+ else if (collider instanceof EdgeCollider) {
149
+ return CollisionJumpTable.CollideCircleEdge(this, collider);
150
+ }
151
+ else {
152
+ throw new Error(`Circle could not collide with unknown CollisionShape ${typeof collider}`);
153
+ }
154
+ }
155
+ /**
156
+ * Find the point on the collider furthest in the direction specified
157
+ */
158
+ getFurthestPoint(direction) {
159
+ return this.center.add(direction.normalize().scale(this.radius));
160
+ }
161
+ /**
162
+ * Find the local point on the shape in the direction specified
163
+ * @param direction
164
+ */
165
+ getFurthestLocalPoint(direction) {
166
+ const dir = direction.normalize();
167
+ return dir.scale(this.radius);
168
+ }
169
+ /**
170
+ * Get the axis aligned bounding box for the circle collider in world coordinates
171
+ */
172
+ get bounds() {
173
+ var _a, _b, _c;
174
+ const tx = this._transform;
175
+ const scale = (_a = tx === null || tx === void 0 ? void 0 : tx.globalScale) !== null && _a !== void 0 ? _a : Vector.One;
176
+ const rotation = (_b = tx === null || tx === void 0 ? void 0 : tx.globalRotation) !== null && _b !== void 0 ? _b : 0;
177
+ const pos = ((_c = tx === null || tx === void 0 ? void 0 : tx.globalPos) !== null && _c !== void 0 ? _c : Vector.Zero);
178
+ return new BoundingBox(this.offset.x - this._naturalRadius, this.offset.y - this._naturalRadius, this.offset.x + this._naturalRadius, this.offset.y + this._naturalRadius).rotate(rotation).scale(scale).translate(pos);
179
+ }
180
+ /**
181
+ * Get the axis aligned bounding box for the circle collider in local coordinates
182
+ */
183
+ get localBounds() {
184
+ return new BoundingBox(this.offset.x - this._naturalRadius, this.offset.y - this._naturalRadius, this.offset.x + this._naturalRadius, this.offset.y + this._naturalRadius);
185
+ }
186
+ /**
187
+ * Get axis not implemented on circles, since there are infinite axis in a circle
188
+ */
189
+ get axes() {
190
+ return [];
191
+ }
192
+ /**
193
+ * Returns the moment of inertia of a circle given it's mass
194
+ * https://en.wikipedia.org/wiki/List_of_moments_of_inertia
195
+ */
196
+ getInertia(mass) {
197
+ return (mass * this.radius * this.radius) / 2;
198
+ }
199
+ /* istanbul ignore next */
200
+ update(transform) {
201
+ this._transform = transform;
202
+ }
203
+ /**
204
+ * Project the circle along a specified axis
205
+ */
206
+ project(axis) {
207
+ const scalars = [];
208
+ const point = this.center;
209
+ const dotProduct = point.dot(axis);
210
+ scalars.push(dotProduct);
211
+ scalars.push(dotProduct + this.radius);
212
+ scalars.push(dotProduct - this.radius);
213
+ return new Projection(Math.min.apply(Math, scalars), Math.max.apply(Math, scalars));
214
+ }
215
+ /**
216
+ * @deprecated signature will change in v0.26.0
217
+ * @param ctx
218
+ * @param color
219
+ * @param pos
220
+ */
221
+ draw(ctx, color = Color.Green, pos = Vector.Zero) {
222
+ const newPos = pos.add(this.offset);
223
+ ctx.beginPath();
224
+ ctx.fillStyle = color.toString();
225
+ ctx.arc(newPos.x, newPos.y, this.radius, 0, Math.PI * 2);
226
+ ctx.closePath();
227
+ ctx.fill();
228
+ }
229
+ debug(ex, color) {
230
+ var _a, _b, _c, _d;
231
+ const tx = this._transform;
232
+ const scale = (_a = tx === null || tx === void 0 ? void 0 : tx.globalScale) !== null && _a !== void 0 ? _a : Vector.One;
233
+ const rotation = (_b = tx === null || tx === void 0 ? void 0 : tx.globalRotation) !== null && _b !== void 0 ? _b : 0;
234
+ const pos = ((_c = tx === null || tx === void 0 ? void 0 : tx.globalPos) !== null && _c !== void 0 ? _c : Vector.Zero);
235
+ ex.save();
236
+ ex.translate(pos.x, pos.y);
237
+ ex.rotate(rotation);
238
+ ex.scale(scale.x, scale.y);
239
+ ex.drawCircle(((_d = this.offset) !== null && _d !== void 0 ? _d : Vector.Zero), this._naturalRadius, Color.Transparent, color, 2);
240
+ ex.restore();
241
+ }
242
+ /**
243
+ * @deprecated signature will change in v0.26.0
244
+ * @param ctx
245
+ * @param color
246
+ */
247
+ /* istanbul ignore next */
248
+ debugDraw(ctx, color = Color.Green) {
249
+ const transform = this._transform;
250
+ const pos = transform ? transform.pos.add(this.offset) : this.offset;
251
+ const rotation = transform ? transform.rotation : 0;
252
+ ctx.beginPath();
253
+ ctx.strokeStyle = color.toString();
254
+ ctx.arc(pos.x, pos.y, this.radius, 0, Math.PI * 2);
255
+ ctx.closePath();
256
+ ctx.stroke();
257
+ ctx.beginPath();
258
+ ctx.moveTo(pos.x, pos.y);
259
+ ctx.lineTo(Math.cos(rotation) * this.radius + pos.x, Math.sin(rotation) * this.radius + pos.y);
260
+ ctx.closePath();
261
+ ctx.stroke();
262
+ }
263
+ }
264
+ //# sourceMappingURL=CircleCollider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CircleCollider.js","sourceRoot":"","sources":["../../../../src/engine/Collision/Colliders/CircleCollider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE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AE,GAAG,CAAC,CAAC,CAAC;QACnD,GAAG,CAAC,SAAS,EAAE,CAAC;QAChB,GAAG,CAAC,MAAM,EAAE,CAAC;QACb,GAAG,CAAC,SAAS,EAAE,CAAC;QAChB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QACzB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/F,GAAG,CAAC,SAAS,EAAE,CAAC;QAChB,GAAG,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,211 @@
1
+ import { Line } from '../../Math/line';
2
+ import { Vector } from '../../Math/vector';
3
+ import { Ray } from '../../Math/ray';
4
+ /**
5
+ * Finds the closes line between 2 line segments, were the magnitude of u, v are the lengths of each segment
6
+ * L1 = P(s) = p0 + s * u, where s is time and p0 is the start of the line
7
+ * L2 = Q(t) = q0 + t * v, where t is time and q0 is the start of the line
8
+ * @param p0 Point where L1 begins
9
+ * @param u Direction and length of L1
10
+ * @param q0 Point were L2 begins
11
+ * @param v Direction and length of L2
12
+ */
13
+ export function ClosestLine(p0, u, q0, v) {
14
+ // Distance between 2 lines http://geomalgorithms.com/a07-_distance.html
15
+ // w(s, t) = P(s) - Q(t)
16
+ // The w(s, t) that has the minimum distance we will say is w(sClosest, tClosest) = wClosest
17
+ //
18
+ // wClosest is the vector that is uniquely perpendicular to the 2 line directions u & v.
19
+ // wClosest = w0 + sClosest * u - tClosest * v, where w0 is p0 - q0
20
+ //
21
+ // The closest point between 2 lines then satisfies this pair of equations
22
+ // 1: u * wClosest = 0
23
+ // 2: v * wClosest = 0
24
+ //
25
+ // Substituting wClosest into the equations we get
26
+ //
27
+ // 1: (u * u) * sClosest - (u * v) tClosest = -u * w0
28
+ // 2: (v * u) * sClosest - (v * v) tClosest = -v * w0
29
+ // simplify w0
30
+ const w0 = p0.sub(q0);
31
+ // simplify (u * u);
32
+ const a = u.dot(u);
33
+ // simplify (u * v);
34
+ const b = u.dot(v);
35
+ // simplify (v * v)
36
+ const c = v.dot(v);
37
+ // simplify (u * w0)
38
+ const d = u.dot(w0);
39
+ // simplify (v * w0)
40
+ const e = v.dot(w0);
41
+ // denominator ac - b^2
42
+ const denom = a * c - b * b;
43
+ let sDenom = denom;
44
+ let tDenom = denom;
45
+ // if denom is 0 they are parallel, use any point from either as the start in this case p0
46
+ if (denom === 0 || denom <= 0.01) {
47
+ const tClosestParallel = d / b;
48
+ return new Line(p0, q0.add(v.scale(tClosestParallel)));
49
+ }
50
+ // Solve for sClosest for infinite line
51
+ let sClosest = b * e - c * d; // / denom;
52
+ // Solve for tClosest for infinite line
53
+ let tClosest = a * e - b * d; // / denom;
54
+ // Solve for segments candidate edges, if sClosest and tClosest are outside their segments
55
+ if (sClosest < 0) {
56
+ sClosest = 0;
57
+ tClosest = e;
58
+ tDenom = c;
59
+ }
60
+ else if (sClosest > sDenom) {
61
+ sClosest = sDenom;
62
+ tClosest = e + b;
63
+ tDenom = c;
64
+ }
65
+ if (tClosest < 0) {
66
+ tClosest = 0;
67
+ if (-d < 0) {
68
+ sClosest = 0;
69
+ }
70
+ else if (-d > a) {
71
+ sClosest = sDenom;
72
+ }
73
+ else {
74
+ sClosest = -d;
75
+ sDenom = a;
76
+ }
77
+ }
78
+ else if (tClosest > tDenom) {
79
+ tClosest = tDenom;
80
+ if (-d + b < 0) {
81
+ sClosest = 0;
82
+ }
83
+ else if (-d + b > a) {
84
+ sClosest = sDenom;
85
+ }
86
+ else {
87
+ sClosest = -d + b;
88
+ sDenom = a;
89
+ }
90
+ }
91
+ sClosest = Math.abs(sClosest) < 0.001 ? 0 : sClosest / sDenom;
92
+ tClosest = Math.abs(tClosest) < 0.001 ? 0 : tClosest / tDenom;
93
+ return new Line(p0.add(u.scale(sClosest)), q0.add(v.scale(tClosest)));
94
+ }
95
+ export const ClosestLineJumpTable = {
96
+ PolygonPolygonClosestLine(polygonA, polygonB) {
97
+ // Find the 2 closest faces on each polygon
98
+ const otherWorldPos = polygonB.worldPos;
99
+ const otherDirection = otherWorldPos.sub(polygonA.worldPos);
100
+ const thisDirection = otherDirection.negate();
101
+ const rayTowardsOther = new Ray(polygonA.worldPos, otherDirection);
102
+ const rayTowardsThis = new Ray(otherWorldPos, thisDirection);
103
+ const thisPoint = polygonA.rayCast(rayTowardsOther).add(rayTowardsOther.dir.scale(0.1));
104
+ const otherPoint = polygonB.rayCast(rayTowardsThis).add(rayTowardsThis.dir.scale(0.1));
105
+ const thisFace = polygonA.getClosestFace(thisPoint);
106
+ const otherFace = polygonB.getClosestFace(otherPoint);
107
+ // L1 = P(s) = p0 + s * u, where s is time and p0 is the start of the line
108
+ const p0 = thisFace.face.begin;
109
+ const u = thisFace.face.getEdge();
110
+ // L2 = Q(t) = q0 + t * v, where t is time and q0 is the start of the line
111
+ const q0 = otherFace.face.begin;
112
+ const v = otherFace.face.getEdge();
113
+ return ClosestLine(p0, u, q0, v);
114
+ },
115
+ PolygonEdgeClosestLine(polygon, edge) {
116
+ // Find the 2 closest faces on each polygon
117
+ const otherWorldPos = edge.worldPos;
118
+ const otherDirection = otherWorldPos.sub(polygon.worldPos);
119
+ const rayTowardsOther = new Ray(polygon.worldPos, otherDirection);
120
+ const thisPoint = polygon.rayCast(rayTowardsOther).add(rayTowardsOther.dir.scale(0.1));
121
+ const thisFace = polygon.getClosestFace(thisPoint);
122
+ // L1 = P(s) = p0 + s * u, where s is time and p0 is the start of the line
123
+ const p0 = thisFace.face.begin;
124
+ const u = thisFace.face.getEdge();
125
+ // L2 = Q(t) = q0 + t * v, where t is time and q0 is the start of the line
126
+ const edgeLine = edge.asLine();
127
+ const edgeStart = edgeLine.begin;
128
+ const edgeVector = edgeLine.getEdge();
129
+ const q0 = edgeStart;
130
+ const v = edgeVector;
131
+ return ClosestLine(p0, u, q0, v);
132
+ },
133
+ PolygonCircleClosestLine(polygon, circle) {
134
+ // https://math.stackexchange.com/questions/1919177/how-to-find-point-on-line-closest-to-sphere
135
+ // Find the 2 closest faces on each polygon
136
+ const otherWorldPos = circle.worldPos;
137
+ const otherDirection = otherWorldPos.sub(polygon.worldPos);
138
+ const rayTowardsOther = new Ray(polygon.worldPos, otherDirection.normalize());
139
+ const thisPoint = polygon.rayCast(rayTowardsOther).add(rayTowardsOther.dir.scale(0.1));
140
+ const thisFace = polygon.getClosestFace(thisPoint);
141
+ // L1 = P(s) = p0 + s * u, where s is time and p0 is the start of the line
142
+ const p0 = thisFace.face.begin;
143
+ const u = thisFace.face.getEdge();
144
+ // Time of minimum distance
145
+ let t = (u.x * (otherWorldPos.x - p0.x) + u.y * (otherWorldPos.y - p0.y)) / (u.x * u.x + u.y * u.y);
146
+ // If time of minimum is past the edge clamp
147
+ if (t > 1) {
148
+ t = 1;
149
+ }
150
+ else if (t < 0) {
151
+ t = 0;
152
+ }
153
+ // Minimum distance
154
+ const d = Math.sqrt(Math.pow(p0.x + u.x * t - otherWorldPos.x, 2) + Math.pow(p0.y + u.y * t - otherWorldPos.y, 2)) - circle.radius;
155
+ const circlex = ((p0.x + u.x * t - otherWorldPos.x) * circle.radius) / (circle.radius + d);
156
+ const circley = ((p0.y + u.y * t - otherWorldPos.y) * circle.radius) / (circle.radius + d);
157
+ return new Line(u.scale(t).add(p0), new Vector(otherWorldPos.x + circlex, otherWorldPos.y + circley));
158
+ },
159
+ CircleCircleClosestLine(circleA, circleB) {
160
+ // Find the 2 closest faces on each polygon
161
+ const otherWorldPos = circleB.worldPos;
162
+ const otherDirection = otherWorldPos.sub(circleA.worldPos);
163
+ const thisWorldPos = circleA.worldPos;
164
+ const thisDirection = thisWorldPos.sub(circleB.worldPos);
165
+ const rayTowardsOther = new Ray(circleA.worldPos, otherDirection);
166
+ const rayTowardsThis = new Ray(circleB.worldPos, thisDirection);
167
+ const thisPoint = circleA.rayCast(rayTowardsOther);
168
+ const otherPoint = circleB.rayCast(rayTowardsThis);
169
+ return new Line(thisPoint, otherPoint);
170
+ },
171
+ CircleEdgeClosestLine(circle, edge) {
172
+ // https://math.stackexchange.com/questions/1919177/how-to-find-point-on-line-closest-to-sphere
173
+ const circleWorlPos = circle.worldPos;
174
+ // L1 = P(s) = p0 + s * u, where s is time and p0 is the start of the line
175
+ const edgeLine = edge.asLine();
176
+ const edgeStart = edgeLine.begin;
177
+ const edgeVector = edgeLine.getEdge();
178
+ const p0 = edgeStart;
179
+ const u = edgeVector;
180
+ // Time of minimum distance
181
+ let t = (u.x * (circleWorlPos.x - p0.x) + u.y * (circleWorlPos.y - p0.y)) / (u.x * u.x + u.y * u.y);
182
+ // If time of minimum is past the edge clamp to edge
183
+ if (t > 1) {
184
+ t = 1;
185
+ }
186
+ else if (t < 0) {
187
+ t = 0;
188
+ }
189
+ // Minimum distance
190
+ const d = Math.sqrt(Math.pow(p0.x + u.x * t - circleWorlPos.x, 2) + Math.pow(p0.y + u.y * t - circleWorlPos.y, 2)) - circle.radius;
191
+ const circlex = ((p0.x + u.x * t - circleWorlPos.x) * circle.radius) / (circle.radius + d);
192
+ const circley = ((p0.y + u.y * t - circleWorlPos.y) * circle.radius) / (circle.radius + d);
193
+ return new Line(u.scale(t).add(p0), new Vector(circleWorlPos.x + circlex, circleWorlPos.y + circley));
194
+ },
195
+ EdgeEdgeClosestLine(edgeA, edgeB) {
196
+ // L1 = P(s) = p0 + s * u, where s is time and p0 is the start of the line
197
+ const edgeLineA = edgeA.asLine();
198
+ const edgeStartA = edgeLineA.begin;
199
+ const edgeVectorA = edgeLineA.getEdge();
200
+ const p0 = edgeStartA;
201
+ const u = edgeVectorA;
202
+ // L2 = Q(t) = q0 + t * v, where t is time and q0 is the start of the line
203
+ const edgeLineB = edgeB.asLine();
204
+ const edgeStartB = edgeLineB.begin;
205
+ const edgeVectorB = edgeLineB.getEdge();
206
+ const q0 = edgeStartB;
207
+ const v = edgeVectorB;
208
+ return ClosestLine(p0, u, q0, v);
209
+ }
210
+ };
211
+ //# sourceMappingURL=ClosestLineJumpTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClosestLineJumpTable.js","sourceRoot":"","sources":["../../../../src/engine/Collision/Colliders/ClosestLineJumpTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAKrC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,EAAU,EAAE,CAAS,EAAE,EAAU,EAAE,CAAS;IACtE,wEAAwE;IAExE,wBAAwB;IACxB,4FAA4F;IAC5F,EAAE;IACF,wFAAwF;IACxF,mEAAmE;IACnE,EAAE;IACF,0EAA0E;IAC1E,sBAAsB;IACtB,sBAAsB;IACtB,EAAE;IACF,kDAAkD;IAClD,EAAE;IACF,qDAAqD;IACrD,qDAAqD;IAErD,cAAc;IACd,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEtB,oBAAoB;IACpB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnB,oBAAoB;IACpB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnB,mBAAmB;IACnB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnB,oBAAoB;IACpB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpB,oBAAoB;IACpB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEpB,uBAAuB;IACvB,MAAM,KAAK,GAAG,CAAC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I,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,aAAa,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IACxG,CAAC;IAED,mBAAmB,CAAC,KAAmB,EAAE,KAAmB;QAC1D,0EAA0E;QAC1E,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC;QACnC,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;QACxC,MAAM,EAAE,GAAG,UAAU,CAAC;QACtB,MAAM,CAAC,GAAG,WAAW,CAAC;QAEtB,0EAA0E;QAC1E,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC;QACnC,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;QACxC,MAAM,EAAE,GAAG,UAAU,CAAC;QACtB,MAAM,CAAC,GAAG,WAAW,CAAC;QAEtB,OAAO,WAAW,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { createId } from '../../Id';
2
+ import { EventDispatcher } from '../../EventDispatcher';
3
+ /**
4
+ * A collision collider specifies the geometry that can detect when other collision colliders intersect
5
+ * for the purposes of colliding 2 objects in excalibur.
6
+ */
7
+ export class Collider {
8
+ constructor() {
9
+ this.id = createId('collider', Collider._ID++);
10
+ this.events = new EventDispatcher();
11
+ }
12
+ /**
13
+ * Returns a boolean indicating whether this body collided with
14
+ * or was in stationary contact with
15
+ * the body of the other [[Collider]]
16
+ */
17
+ touching(other) {
18
+ const contact = this.collide(other);
19
+ if (contact) {
20
+ return true;
21
+ }
22
+ return false;
23
+ }
24
+ }
25
+ Collider._ID = 0;
26
+ //# sourceMappingURL=Collider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collider.js","sourceRoot":"","sources":["../../../../src/engine/Collision/Colliders/Collider.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAM,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IAA9B;QAEkB,OAAE,GAAmB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QACnE,WAAM,GAA8B,IAAI,eAAe,EAAY,CAAC;IAuG7E,CAAC;IArGC;;;;OAIG;IACI,QAAQ,CAAC,KAAe;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,OAAO,EAAE;YACX,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;IACf,CAAC;;AAjBc,YAAG,GAAG,CAAC,CAAC"}