@ue-too/board 0.5.2 → 0.7.0

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 (276) hide show
  1. package/README.md +188 -0
  2. package/board.tsbuildinfo +1 -0
  3. package/{dist/boardify → boardify}/index.d.ts +26 -44
  4. package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/base.d.ts +1 -1
  5. package/camera/camera-edge-auto-input.d.ts +13 -0
  6. package/{dist/camera → camera}/camera-rig/camera-rig.d.ts +1 -0
  7. package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-rig/pan-handler.d.ts +1 -0
  8. package/{dist/camera → camera}/default-camera.d.ts +3 -3
  9. package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/index.d.ts +1 -0
  10. package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/utils/position.d.ts +2 -2
  11. package/index.js +2 -0
  12. package/index.js.map +1 -0
  13. package/{dist/input-interpretation → input-interpretation}/input-state-machine/kmt-input-context.d.ts +77 -11
  14. package/{dist/input-interpretation → input-interpretation}/input-state-machine/kmt-input-state-machine.d.ts +26 -16
  15. package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation → input-interpretation}/input-state-machine/touch-input-context.d.ts +4 -4
  16. package/{dist/input-interpretation → input-interpretation}/raw-input-parser/vanilla-kmt-event-parser.d.ts +3 -2
  17. package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation → input-interpretation}/raw-input-parser/vanilla-touch-event-parser.d.ts +2 -7
  18. package/package.json +10 -11
  19. package/{dist/utils → utils}/canvas-position-dimension.d.ts +7 -5
  20. package/utils/observable.d.ts +18 -0
  21. package/{dist/utils → utils}/zoomlevel-adjustment.d.ts +1 -1
  22. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/board.tsbuildinfo +0 -1
  23. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/boardify/index.d.ts +0 -192
  24. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/boardify/index.js +0 -475
  25. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/boardify/index.js.map +0 -1
  26. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/base.js +0 -340
  27. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/base.js.map +0 -1
  28. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/animation-and-lock.js +0 -88
  29. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/animation-and-lock.js.map +0 -1
  30. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/index.js +0 -5
  31. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/index.js.map +0 -1
  32. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/pan-control-state-machine.js +0 -157
  33. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/pan-control-state-machine.js.map +0 -1
  34. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/rotation-control-state-machine.js +0 -151
  35. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/rotation-control-state-machine.js.map +0 -1
  36. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/zoom-control-state-machine.js +0 -153
  37. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/animation-and-lock/zoom-control-state-machine.js.map +0 -1
  38. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/index.js +0 -4
  39. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/index.js.map +0 -1
  40. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/interface.js +0 -2
  41. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/interface.js.map +0 -1
  42. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/relay.js +0 -38
  43. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-mux/relay.js.map +0 -1
  44. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/camera-rig.d.ts +0 -207
  45. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/camera-rig.js +0 -454
  46. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/camera-rig.js.map +0 -1
  47. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/index.js +0 -6
  48. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/index.js.map +0 -1
  49. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/pan-handler.js +0 -124
  50. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/pan-handler.js.map +0 -1
  51. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/rotation-handler.js +0 -71
  52. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/rotation-handler.js.map +0 -1
  53. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/update-batcher/index.js +0 -4
  54. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/update-batcher/index.js.map +0 -1
  55. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/update-batcher/position-update-batcher.js +0 -97
  56. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/update-batcher/position-update-batcher.js.map +0 -1
  57. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/update-batcher/rotation-update-batcher.js +0 -91
  58. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/update-batcher/rotation-update-batcher.js.map +0 -1
  59. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/update-batcher/zoom-udpate-batcher.js +0 -128
  60. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/update-batcher/zoom-udpate-batcher.js.map +0 -1
  61. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/zoom-handler.js +0 -76
  62. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/camera-rig/zoom-handler.js.map +0 -1
  63. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/default-camera.d.ts +0 -170
  64. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/default-camera.js +0 -258
  65. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/default-camera.js.map +0 -1
  66. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/index.js +0 -9
  67. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/index.js.map +0 -1
  68. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/interface.js +0 -2
  69. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/interface.js.map +0 -1
  70. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/update-publisher.js +0 -74
  71. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/update-publisher.js.map +0 -1
  72. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/coordinate-conversion.js +0 -150
  73. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/coordinate-conversion.js.map +0 -1
  74. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/index.js +0 -6
  75. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/index.js.map +0 -1
  76. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/matrix.js +0 -421
  77. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/matrix.js.map +0 -1
  78. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/position.js +0 -177
  79. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/position.js.map +0 -1
  80. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/rotation.js +0 -122
  81. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/rotation.js.map +0 -1
  82. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/zoom.js +0 -46
  83. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera/utils/zoom.js.map +0 -1
  84. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/index.js +0 -6
  85. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/index.js.map +0 -1
  86. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/index.js +0 -4
  87. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/index.js.map +0 -1
  88. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/index.js +0 -5
  89. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/index.js.map +0 -1
  90. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/kmt-input-context.d.ts +0 -130
  91. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/kmt-input-context.js +0 -191
  92. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/kmt-input-context.js.map +0 -1
  93. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/kmt-input-state-machine.d.ts +0 -194
  94. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/kmt-input-state-machine.js +0 -342
  95. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/kmt-input-state-machine.js.map +0 -1
  96. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/touch-input-context.js +0 -62
  97. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/touch-input-context.js.map +0 -1
  98. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/touch-input-state-machine.js +0 -173
  99. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/input-state-machine/touch-input-state-machine.js.map +0 -1
  100. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-parser/index.js +0 -3
  101. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-parser/index.js.map +0 -1
  102. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-parser/vanilla-kmt-event-parser.d.ts +0 -87
  103. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-parser/vanilla-kmt-event-parser.js +0 -123
  104. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-parser/vanilla-kmt-event-parser.js.map +0 -1
  105. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-parser/vanilla-touch-event-parser.js +0 -118
  106. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-parser/vanilla-touch-event-parser.js.map +0 -1
  107. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-publisher/index.js +0 -2
  108. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-publisher/index.js.map +0 -1
  109. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-publisher/raw-input-publisher.js +0 -99
  110. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation/raw-input-publisher/raw-input-publisher.js.map +0 -1
  111. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/canvas-position-dimension.d.ts +0 -18
  112. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/canvas-position-dimension.js +0 -184
  113. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/canvas-position-dimension.js.map +0 -1
  114. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/coorindate-conversion.js +0 -10
  115. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/coorindate-conversion.js.map +0 -1
  116. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/drawing-utils.js +0 -450
  117. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/drawing-utils.js.map +0 -1
  118. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/drawing.js +0 -192
  119. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/drawing.js.map +0 -1
  120. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/handler-pipeline.js +0 -27
  121. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/handler-pipeline.js.map +0 -1
  122. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/index.js +0 -9
  123. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/index.js.map +0 -1
  124. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/observable.d.ts +0 -9
  125. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/observable.js +0 -47
  126. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/observable.js.map +0 -1
  127. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/ruler.js +0 -21
  128. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/ruler.js.map +0 -1
  129. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/zoomlevel-adjustment.d.ts +0 -28
  130. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/zoomlevel-adjustment.js +0 -102
  131. package/.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils/zoomlevel-adjustment.js.map +0 -1
  132. package/dist/board.tsbuildinfo +0 -1
  133. package/dist/camera/base.d.ts +0 -189
  134. package/dist/camera/camera-mux/animation-and-lock/animation-and-lock.d.ts +0 -50
  135. package/dist/camera/camera-mux/animation-and-lock/index.d.ts +0 -4
  136. package/dist/camera/camera-mux/animation-and-lock/pan-control-state-machine.d.ts +0 -137
  137. package/dist/camera/camera-mux/animation-and-lock/rotation-control-state-machine.d.ts +0 -131
  138. package/dist/camera/camera-mux/animation-and-lock/zoom-control-state-machine.d.ts +0 -143
  139. package/dist/camera/camera-mux/index.d.ts +0 -3
  140. package/dist/camera/camera-mux/interface.d.ts +0 -12
  141. package/dist/camera/camera-mux/relay.d.ts +0 -27
  142. package/dist/camera/camera-rig/index.d.ts +0 -5
  143. package/dist/camera/camera-rig/pan-handler.d.ts +0 -113
  144. package/dist/camera/camera-rig/rotation-handler.d.ts +0 -78
  145. package/dist/camera/camera-rig/update-batcher/index.d.ts +0 -3
  146. package/dist/camera/camera-rig/update-batcher/position-update-batcher.d.ts +0 -58
  147. package/dist/camera/camera-rig/update-batcher/rotation-update-batcher.d.ts +0 -54
  148. package/dist/camera/camera-rig/update-batcher/zoom-udpate-batcher.d.ts +0 -60
  149. package/dist/camera/camera-rig/zoom-handler.d.ts +0 -77
  150. package/dist/camera/index.d.ts +0 -8
  151. package/dist/camera/interface.d.ts +0 -59
  152. package/dist/camera/update-publisher.d.ts +0 -172
  153. package/dist/camera/utils/coordinate-conversion.d.ts +0 -75
  154. package/dist/camera/utils/index.d.ts +0 -5
  155. package/dist/camera/utils/matrix.d.ts +0 -114
  156. package/dist/camera/utils/position.d.ts +0 -71
  157. package/dist/camera/utils/rotation.d.ts +0 -64
  158. package/dist/camera/utils/zoom.d.ts +0 -25
  159. package/dist/index.d.ts +0 -5
  160. package/dist/index.js +0 -2
  161. package/dist/index.js.map +0 -1
  162. package/dist/input-interpretation/index.d.ts +0 -3
  163. package/dist/input-interpretation/input-state-machine/index.d.ts +0 -4
  164. package/dist/input-interpretation/input-state-machine/touch-input-context.d.ts +0 -44
  165. package/dist/input-interpretation/input-state-machine/touch-input-state-machine.d.ts +0 -64
  166. package/dist/input-interpretation/raw-input-parser/index.d.ts +0 -2
  167. package/dist/input-interpretation/raw-input-parser/vanilla-touch-event-parser.d.ts +0 -55
  168. package/dist/input-interpretation/raw-input-publisher/index.d.ts +0 -1
  169. package/dist/input-interpretation/raw-input-publisher/raw-input-publisher.d.ts +0 -130
  170. package/dist/package.json +0 -39
  171. package/dist/utils/coorindate-conversion.d.ts +0 -5
  172. package/dist/utils/drawing-utils.d.ts +0 -55
  173. package/dist/utils/drawing.d.ts +0 -30
  174. package/dist/utils/handler-pipeline.d.ts +0 -30
  175. package/dist/utils/index.d.ts +0 -8
  176. package/dist/utils/observable.d.ts +0 -9
  177. package/dist/utils/ruler.d.ts +0 -1
  178. package/jest.config.js +0 -18
  179. package/project.json +0 -34
  180. package/rollup.config.js +0 -29
  181. package/src/boardify/index.ts +0 -562
  182. package/src/camera/base.ts +0 -387
  183. package/src/camera/camera-mux/animation-and-lock/animation-and-lock.ts +0 -114
  184. package/src/camera/camera-mux/animation-and-lock/index.ts +0 -4
  185. package/src/camera/camera-mux/animation-and-lock/pan-control-state-machine.ts +0 -248
  186. package/src/camera/camera-mux/animation-and-lock/rotation-control-state-machine.ts +0 -237
  187. package/src/camera/camera-mux/animation-and-lock/zoom-control-state-machine.ts +0 -263
  188. package/src/camera/camera-mux/index.ts +0 -3
  189. package/src/camera/camera-mux/interface.ts +0 -13
  190. package/src/camera/camera-mux/relay.ts +0 -50
  191. package/src/camera/camera-rig/camera-rig.ts +0 -560
  192. package/src/camera/camera-rig/index.ts +0 -5
  193. package/src/camera/camera-rig/pan-handler.ts +0 -192
  194. package/src/camera/camera-rig/rotation-handler.ts +0 -124
  195. package/src/camera/camera-rig/update-batcher/index.ts +0 -3
  196. package/src/camera/camera-rig/update-batcher/position-update-batcher.ts +0 -133
  197. package/src/camera/camera-rig/update-batcher/rotation-update-batcher.ts +0 -123
  198. package/src/camera/camera-rig/update-batcher/zoom-udpate-batcher.ts +0 -157
  199. package/src/camera/camera-rig/zoom-handler.ts +0 -123
  200. package/src/camera/default-camera.ts +0 -297
  201. package/src/camera/index.ts +0 -8
  202. package/src/camera/interface.ts +0 -45
  203. package/src/camera/update-publisher.ts +0 -222
  204. package/src/camera/utils/coordinate-conversion.ts +0 -160
  205. package/src/camera/utils/index.ts +0 -5
  206. package/src/camera/utils/matrix.ts +0 -558
  207. package/src/camera/utils/position.ts +0 -196
  208. package/src/camera/utils/rotation.ts +0 -147
  209. package/src/camera/utils/zoom.ts +0 -55
  210. package/src/index.ts +0 -5
  211. package/src/input-interpretation/index.ts +0 -3
  212. package/src/input-interpretation/input-state-machine/index.ts +0 -4
  213. package/src/input-interpretation/input-state-machine/kmt-input-context.ts +0 -283
  214. package/src/input-interpretation/input-state-machine/kmt-input-state-machine.ts +0 -491
  215. package/src/input-interpretation/input-state-machine/touch-input-context.ts +0 -106
  216. package/src/input-interpretation/input-state-machine/touch-input-state-machine.ts +0 -215
  217. package/src/input-interpretation/raw-input-parser/index.ts +0 -2
  218. package/src/input-interpretation/raw-input-parser/vanilla-kmt-event-parser.ts +0 -207
  219. package/src/input-interpretation/raw-input-parser/vanilla-touch-event-parser.ts +0 -169
  220. package/src/input-interpretation/raw-input-publisher/index.ts +0 -1
  221. package/src/input-interpretation/raw-input-publisher/raw-input-publisher.ts +0 -227
  222. package/src/utils/canvas-position-dimension.ts +0 -215
  223. package/src/utils/coorindate-conversion.ts +0 -12
  224. package/src/utils/drawing-utils.ts +0 -439
  225. package/src/utils/drawing.ts +0 -266
  226. package/src/utils/handler-pipeline.ts +0 -41
  227. package/src/utils/index.ts +0 -8
  228. package/src/utils/observable.ts +0 -63
  229. package/src/utils/ruler.ts +0 -18
  230. package/src/utils/zoomlevel-adjustment.ts +0 -108
  231. package/test/board-camera/camera-rig.test.ts +0 -78
  232. package/test/board-camera/camera-utils.test.ts +0 -263
  233. package/test/board-camera/utils/coordinate-conversion.test.ts +0 -26
  234. package/test/board-camera/utils/matrix.test.ts +0 -35
  235. package/test/boardify/utils/canvas.test.ts +0 -20
  236. package/test/util/drawing.test.ts +0 -83
  237. package/test/util/handler-pipeline.test.ts +0 -74
  238. package/test/util/observable.test.ts +0 -42
  239. package/test/util/ruler.test.ts +0 -41
  240. package/tsconfig.json +0 -23
  241. package/tsconfig.spec.json +0 -12
  242. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-mux/animation-and-lock/animation-and-lock.d.ts +0 -0
  243. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-mux/animation-and-lock/index.d.ts +0 -0
  244. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-mux/animation-and-lock/pan-control-state-machine.d.ts +0 -0
  245. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-mux/animation-and-lock/rotation-control-state-machine.d.ts +0 -0
  246. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-mux/animation-and-lock/zoom-control-state-machine.d.ts +0 -0
  247. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-mux/index.d.ts +0 -0
  248. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-mux/interface.d.ts +0 -0
  249. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-mux/relay.d.ts +0 -0
  250. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-rig/index.d.ts +0 -0
  251. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-rig/rotation-handler.d.ts +0 -0
  252. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-rig/update-batcher/index.d.ts +0 -0
  253. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-rig/update-batcher/position-update-batcher.d.ts +0 -0
  254. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-rig/update-batcher/rotation-update-batcher.d.ts +0 -0
  255. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-rig/update-batcher/zoom-udpate-batcher.d.ts +0 -0
  256. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/camera-rig/zoom-handler.d.ts +0 -0
  257. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/interface.d.ts +0 -0
  258. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/update-publisher.d.ts +0 -0
  259. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/utils/coordinate-conversion.d.ts +0 -0
  260. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/utils/index.d.ts +0 -0
  261. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/utils/matrix.d.ts +0 -0
  262. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/utils/rotation.d.ts +0 -0
  263. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/camera → camera}/utils/zoom.d.ts +0 -0
  264. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/index.d.ts → index.d.ts} +0 -0
  265. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation → input-interpretation}/index.d.ts +0 -0
  266. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation → input-interpretation}/input-state-machine/index.d.ts +0 -0
  267. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation → input-interpretation}/input-state-machine/touch-input-state-machine.d.ts +0 -0
  268. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation → input-interpretation}/raw-input-parser/index.d.ts +0 -0
  269. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation → input-interpretation}/raw-input-publisher/index.d.ts +0 -0
  270. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/input-interpretation → input-interpretation}/raw-input-publisher/raw-input-publisher.d.ts +0 -0
  271. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils → utils}/coorindate-conversion.d.ts +0 -0
  272. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils → utils}/drawing-utils.d.ts +0 -0
  273. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils → utils}/drawing.d.ts +0 -0
  274. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils → utils}/handler-pipeline.d.ts +0 -0
  275. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils → utils}/index.d.ts +0 -0
  276. /package/{.rollup.cache/home/runner/work/ue-too/ue-too/packages/board/dist/utils → utils}/ruler.d.ts +0 -0
@@ -1,387 +0,0 @@
1
- import { Point } from '@ue-too/math';
2
- import { Boundaries, withinBoundaries } from './utils/position';
3
- import { zoomLevelWithinLimits, ZoomLevelLimits, clampZoomLevel } from './utils/zoom';
4
- import { RotationLimits, rotationWithinLimits, normalizeAngleZero2TwoPI, clampRotation } from './utils/rotation';
5
- import { convert2WorldSpaceAnchorAtCenter, convert2ViewPortSpaceAnchorAtCenter } from './utils/coordinate-conversion';
6
- import { PointCal } from '@ue-too/math';
7
- import { BoardCamera } from './interface';
8
- import { decomposeCameraMatrix, decomposeTRS, TransformationMatrix } from './utils/matrix';
9
-
10
- /**
11
- *
12
- * @description This is the base class for the camera. It is used to create a camera that can be used to view a board.
13
- *
14
- * If there's only one class that you want to use in this library, it is this one. The is the back bone of the board camera system.
15
- *
16
- * With the {@link CameraRig} class, you can create a camera system that can be used to achieve the infinite canvas effect.
17
- *
18
- * This class is not observable (you can not register a callback for camera state changes). If you need to observe the camera state, use the {@link DefaultBoardCamera} class instead.
19
- * @category Camera
20
- */
21
- export default class BaseCamera implements BoardCamera {
22
-
23
- private _position: Point;
24
- private _rotation: number;
25
- private _zoomLevel: number;
26
-
27
- private currentCachedTransform: {transform: {a: number, b: number, c: number, d: number, e: number, f: number}, position: Point, rotation: number, zoomLevel: number, alignCoorindate: boolean, devicePixelRatio: number, viewPortWidth: number, viewPortHeight: number} | undefined;
28
-
29
- private _viewPortWidth: number;
30
- private _viewPortHeight: number;
31
-
32
- private _boundaries?: Boundaries;
33
- private _zoomBoundaries?: ZoomLevelLimits;
34
- private _rotationBoundaries?: RotationLimits;
35
-
36
- /**
37
- * @param position The position of the camera in the world coordinate system
38
- * @param rotation The rotation of the camera in the world coordinate system
39
- * @param zoomLevel The zoom level of the camera
40
- * @param viewPortWidth The width of the viewport. (The width of the canvas in css pixels)
41
- * @param viewPortHeight The height of the viewport. (The height of the canvas in css pixels)
42
- * @param boundaries The boundaries of the camera in the world coordinate system
43
- * @param zoomLevelBoundaries The boundaries of the zoom level of the camera
44
- * @param rotationBoundaries The boundaries of the rotation of the camera
45
- */
46
- constructor(viewPortWidth: number = 1000, viewPortHeight: number = 1000, position: Point = {x: 0, y: 0}, rotation: number = 0, zoomLevel: number = 1, boundaries: Boundaries = {min: {x: -10000, y: -10000}, max: {x: 10000, y: 10000}}, zoomLevelBoundaries: ZoomLevelLimits = {min: 0.1, max: 10}, rotationBoundaries: RotationLimits = undefined){
47
- this._position = position;
48
- this._zoomLevel = zoomLevel;
49
- this._rotation = rotation;
50
- this._viewPortHeight = viewPortHeight;
51
- this._viewPortWidth = viewPortWidth;
52
- this._zoomBoundaries = zoomLevelBoundaries;
53
- this._rotationBoundaries = rotationBoundaries;
54
- this._boundaries = boundaries;
55
- }
56
-
57
- /**
58
- * @description The translation boundaries of the camera in the world coordinate system.
59
- *
60
- * @category Camera
61
- */
62
- get boundaries(): Boundaries | undefined{
63
- return this._boundaries;
64
- }
65
-
66
- set boundaries(boundaries: Boundaries | undefined){
67
- this._boundaries = boundaries;
68
- }
69
-
70
- /**
71
- * @description The width of the viewport. (The width of the canvas in css pixels)
72
- *
73
- * @category Camera
74
- */
75
- get viewPortWidth(): number{
76
- return this._viewPortWidth;
77
- }
78
-
79
- set viewPortWidth(width: number){
80
- this._viewPortWidth = width;
81
- }
82
-
83
- /**
84
- * @description The height of the viewport. (The height of the canvas in css pixels)
85
- *
86
- * @category Camera
87
- */
88
- get viewPortHeight(): number{
89
- return this._viewPortHeight;
90
- }
91
-
92
- set viewPortHeight(height: number){
93
- this._viewPortHeight = height;
94
- }
95
-
96
- /**
97
- * @description The position of the camera in the world coordinate system.
98
- *
99
- * @category Camera
100
- */
101
- get position(): Point{
102
- return this._position;
103
- }
104
-
105
- /**
106
- * @description This function is used to set the position of the camera.
107
- * @param destination The destination point of the camera.
108
- * @returns Whether the position is set successfully.
109
- *
110
- * @description This function has a guard that checks if the destination point is within the boundaries of the camera.
111
- * If the destination point is not within the boundaries, the function will return false and the position will not be updated.
112
- * If the destination point is within the boundaries, the function will return true and the position will be updated.
113
- */
114
- setPosition(destination: Point){
115
- if(!withinBoundaries(destination, this._boundaries)){
116
- return false;
117
- }
118
- const diff = PointCal.subVector(destination, this._position);
119
- if(PointCal.magnitude(diff) < 10E-10 && PointCal.magnitude(diff) < 1 / this._zoomLevel){
120
- return false;
121
- }
122
- this._position = destination;
123
- return true;
124
- }
125
-
126
- /**
127
- * @description The zoom level of the camera.
128
- *
129
- * @category Camera
130
- */
131
- get zoomLevel(): number{
132
- return this._zoomLevel;
133
- }
134
-
135
- /**
136
- * @description The boundaries of the zoom level of the camera.
137
- *
138
- * @category Camera
139
- */
140
- get zoomBoundaries(): ZoomLevelLimits | undefined{
141
- return this._zoomBoundaries;
142
- }
143
-
144
- /**
145
- * @description The boundaries of the zoom level of the camera.
146
- *
147
- * @category Camera
148
- */
149
- set zoomBoundaries(zoomBoundaries: ZoomLevelLimits | undefined){
150
- if(zoomBoundaries !== undefined && zoomBoundaries.min !== undefined && zoomBoundaries.max !== undefined && zoomBoundaries.min > zoomBoundaries.max){
151
- let temp = zoomBoundaries.max;
152
- zoomBoundaries.max = zoomBoundaries.min;
153
- zoomBoundaries.min = temp;
154
- }
155
- this._zoomBoundaries = zoomBoundaries;
156
- }
157
-
158
- setMaxZoomLevel(maxZoomLevel: number){
159
- if(this._zoomBoundaries == undefined){
160
- this._zoomBoundaries = {min: undefined, max: undefined};
161
- }
162
- if((this._zoomBoundaries.min != undefined && this._zoomBoundaries.min > maxZoomLevel) || this._zoomLevel > maxZoomLevel){
163
- return false;
164
- }
165
- this._zoomBoundaries.max = maxZoomLevel;
166
- return true
167
- }
168
-
169
- setMinZoomLevel(minZoomLevel: number){
170
- if(this._zoomBoundaries == undefined){
171
- this._zoomBoundaries = {min: undefined, max: undefined};
172
- }
173
- if((this._zoomBoundaries.max != undefined && this._zoomBoundaries.max < minZoomLevel)){
174
- return false;
175
- }
176
- this._zoomBoundaries.min = minZoomLevel;
177
- if(this._zoomLevel < minZoomLevel){
178
- this._zoomLevel = minZoomLevel;
179
- }
180
- return true;
181
- }
182
-
183
- /**
184
- * @description This function is used to set the zoom level of the camera.
185
- * @param zoomLevel The zoom level of the camera.
186
- * @returns Whether the zoom level is set successfully.
187
- *
188
- * @description This function has a guard that checks if the zoom level is within the boundaries of the camera.
189
- * If the zoom level is not within the boundaries, the function will return false and the zoom level will not be updated.
190
- * If the zoom level is within the boundaries, the function will return true and the zoom level will be updated.
191
- */
192
- setZoomLevel(zoomLevel: number){
193
- if(!zoomLevelWithinLimits(zoomLevel, this._zoomBoundaries)){
194
- return false;
195
- }
196
- if(this._zoomBoundaries !== undefined && this._zoomBoundaries.max !== undefined && clampZoomLevel(zoomLevel, this._zoomBoundaries) == this._zoomBoundaries.max && this._zoomLevel == this._zoomBoundaries.max){
197
- return false;
198
- }
199
- if(this._zoomBoundaries !== undefined && this._zoomBoundaries.min !== undefined && clampZoomLevel(zoomLevel, this._zoomBoundaries) == this._zoomBoundaries.min && this._zoomLevel == this._zoomBoundaries.min){
200
- return false;
201
- }
202
- this._zoomLevel = zoomLevel;
203
- return true;
204
- }
205
-
206
- get rotation(): number{
207
- return this._rotation;
208
- }
209
-
210
- get rotationBoundaries(): RotationLimits | undefined{
211
- return this._rotationBoundaries;
212
- }
213
-
214
- set rotationBoundaries(rotationBoundaries: RotationLimits | undefined){
215
- if(rotationBoundaries !== undefined && rotationBoundaries.start !== undefined && rotationBoundaries.end !== undefined && rotationBoundaries.start > rotationBoundaries.end){
216
- let temp = rotationBoundaries.end;
217
- rotationBoundaries.end = rotationBoundaries.start;
218
- rotationBoundaries.start = temp;
219
- }
220
- this._rotationBoundaries = rotationBoundaries;
221
- }
222
-
223
- /**
224
- * @description The order of the transformation is as follows:
225
- * 1. Scale (scale the context using the device pixel ratio)
226
- * 2. Translation (move the origin of the context to the center of the canvas)
227
- * 3. Rotation (rotate the context negatively the rotation of the camera)
228
- * 4. Zoom (scale the context using the zoom level of the camera)
229
- * 5. Translation (move the origin of the context to the position of the camera in the context coordinate system)
230
- *
231
- * @param devicePixelRatio The device pixel ratio of the canvas
232
- * @param alignCoorindate Whether to align the coordinate system to the camera's position
233
- * @returns The transformation matrix
234
- */
235
- getTransform(devicePixelRatio: number, alignCoorindate: boolean) {
236
- if(this.currentCachedTransform !== undefined
237
- && this.currentCachedTransform.devicePixelRatio === devicePixelRatio
238
- && this.currentCachedTransform.alignCoorindate === alignCoorindate
239
- && this.currentCachedTransform.position.x === this._position.x
240
- && this.currentCachedTransform.position.y === this._position.y
241
- && this.currentCachedTransform.rotation === this._rotation
242
- && this.currentCachedTransform.zoomLevel === this._zoomLevel
243
- && this.currentCachedTransform.viewPortWidth === this._viewPortWidth
244
- && this.currentCachedTransform.viewPortHeight === this._viewPortHeight
245
- ){
246
- return {...this.currentCachedTransform.transform, cached: true};
247
- }
248
- const tx = devicePixelRatio * this._viewPortWidth / 2;
249
- const ty = devicePixelRatio * this._viewPortHeight / 2;
250
- const tx2 = -this._position.x;
251
- const ty2 = alignCoorindate ? -this._position.y : this._position.y;
252
-
253
- const s = devicePixelRatio;
254
- const s2 = this._zoomLevel;
255
- const θ = alignCoorindate ? -this._rotation : this._rotation;
256
-
257
- const sin = Math.sin(θ);
258
- const cos = Math.cos(θ);
259
-
260
- const a = s2 * s * cos;
261
- const b = s2 * s * sin;
262
- const c = -s * s2 * sin;
263
- const d = s2 * s * cos;
264
- const e = s * s2 * cos * tx2 - s * s2 * sin * ty2 + tx;
265
- const f = s * s2 * sin * tx2 + s * s2 * cos * ty2 + ty;
266
- this.currentCachedTransform = {transform: {a, b, c, d, e, f}, position: this._position, rotation: this._rotation, zoomLevel: this._zoomLevel, alignCoorindate, devicePixelRatio, viewPortWidth: this._viewPortWidth, viewPortHeight: this._viewPortHeight};
267
- return {a, b, c, d, e, f, cached: false};
268
- }
269
-
270
- getTRS(devicePixelRatio: number, alignCoorindate: boolean){
271
- const transform = this.getTransform(devicePixelRatio, alignCoorindate);
272
- const decompositionRes = decomposeTRS(transform);
273
- return decompositionRes;
274
- }
275
-
276
- /**
277
- * @description This function is used to set the camera using a transformation matrix.
278
- * The transformation matrix is the same as the one returned by the {@link getTransform} function. (by performing the transformations in the same order)
279
- * The transformation matrix would be decomposed into SCALE(devicePixelRatio), TRANSLATION(center of the canvas), ROTATION(-rotation), SCALE(zoom level), and TRANSLATION(position).
280
- * The position, zoom level, and rotation are still bounded by the boundaries of the camera.
281
- *
282
- * @param transformationMatrix The transformation matrix.
283
- *
284
- * @category Camera
285
- */
286
- setUsingTransformationMatrix(transformationMatrix: TransformationMatrix){
287
- const decomposed = decomposeCameraMatrix(transformationMatrix, this._viewPortWidth, this._viewPortHeight, this._zoomLevel);
288
- this.setPosition(decomposed.position);
289
- this.setRotation(decomposed.rotation);
290
- this.setZoomLevel(decomposed.zoom);
291
- }
292
-
293
- setRotation(rotation: number){
294
- if(!rotationWithinLimits(rotation, this._rotationBoundaries)){
295
- return false;
296
- }
297
- rotation = normalizeAngleZero2TwoPI(rotation);
298
- if(this._rotationBoundaries !== undefined && this._rotationBoundaries.end !== undefined && clampRotation(rotation, this._rotationBoundaries) == this._rotationBoundaries.end && this._rotation == this._rotationBoundaries.end){
299
- return false;
300
- }
301
- if(this._rotationBoundaries !== undefined && this.rotationBoundaries.start !== undefined && clampRotation(rotation, this._rotationBoundaries) == this._rotationBoundaries.start && this._rotation == this._rotationBoundaries.start){
302
- return false;
303
- }
304
- this._rotation = rotation;
305
- return true;
306
- }
307
-
308
- /**
309
- * @description The origin of the camera in the window coordinate system.
310
- * @deprecated
311
- *
312
- * @category Camera
313
- */
314
- getCameraOriginInWindow(centerInWindow: Point): Point{
315
- return centerInWindow;
316
- }
317
-
318
- /**
319
- * @description Converts a point from the viewport coordinate system to the world coordinate system.
320
- *
321
- * @param point The point in the viewport coordinate system.
322
- * @returns The point in the world coordinate system.
323
- *
324
- * @category Camera
325
- */
326
- convertFromViewPort2WorldSpace(point: Point): Point{
327
- return convert2WorldSpaceAnchorAtCenter(point, this._position, this._zoomLevel, this._rotation);
328
- }
329
-
330
- /**
331
- * @description Converts a point from the world coordinate system to the viewport coordinate system.
332
- *
333
- * @param point The point in the world coordinate system.
334
- * @returns The point in the viewport coordinate system.
335
- *
336
- * @category Camera
337
- */
338
- convertFromWorld2ViewPort(point: Point): Point{
339
- return convert2ViewPortSpaceAnchorAtCenter(point, this._position, this._zoomLevel, this._rotation);
340
- }
341
-
342
- /**
343
- * @description Inverts a point from the world coordinate system to the viewport coordinate system.
344
- *
345
- * @param point The point in the world coordinate system.
346
- * @returns The point in the viewport coordinate system.
347
- *
348
- * @category Camera
349
- */
350
- invertFromWorldSpace2ViewPort(point: Point): Point{
351
- let cameraFrameCenter = {x: this.viewPortWidth / 2, y: this._viewPortHeight / 2};
352
- let delta2Point = PointCal.subVector(point, this._position);
353
- delta2Point = PointCal.rotatePoint(delta2Point, -this._rotation);
354
- delta2Point = PointCal.multiplyVectorByScalar(delta2Point, this._zoomLevel);
355
- return PointCal.addVector(cameraFrameCenter, delta2Point);
356
- }
357
-
358
- setHorizontalBoundaries(min: number, max: number){
359
- if (min > max){
360
- let temp = max;
361
- max = min;
362
- min = temp;
363
- }
364
- if(this._boundaries == undefined){
365
- this._boundaries = {min: {x: undefined, y: undefined}, max: {x: undefined, y: undefined}};
366
- }
367
- this._boundaries.min.x = min;
368
- this._boundaries.max.x = max;
369
- //NOTE leave for future optimization when setting the boundaries if the camera lies outside the boundaries clamp the position of the camera
370
- // if(!this.withinBoundaries(this.position)){
371
- // this.position = this.clampPoint(this.position);
372
- // }
373
- }
374
-
375
- setVerticalBoundaries(min: number, max: number){
376
- if (min > max){
377
- let temp = max;
378
- max = min;
379
- min = temp;
380
- }
381
- if(this._boundaries == undefined){
382
- this._boundaries = {min: {x: undefined, y: undefined}, max: {x: undefined, y: undefined}};
383
- }
384
- this._boundaries.min.y = min;
385
- this._boundaries.max.y = max;
386
- }
387
- }
@@ -1,114 +0,0 @@
1
-
2
- import { CameraMux } from "../interface";
3
- import { Point } from "@ue-too/math";
4
- import { ObservableBoardCamera } from "../../interface";
5
- import { createDefaultPanControlStateMachine, PanControlStateMachine } from "./pan-control-state-machine";
6
- import { createDefaultZoomControlStateMachine, ZoomControlStateMachine } from "./zoom-control-state-machine";
7
- import { createDefaultRotateControlStateMachine, RotateControlStateMachine } from "./rotation-control-state-machine";
8
- import { CameraRig } from "../../camera-rig";
9
- import { createDefaultCameraRig } from "../../camera-rig";
10
-
11
- /**
12
- * @description The flow control with animation and lock input.
13
- *
14
- * This is a customized input flow control that suits a specific use case.
15
- *
16
- * You can use the default one ({@link SimpleRelayFlowControl}) instead or implement your own.
17
- *
18
- * The internal ruleset on which input is used and which is ignored is controlled by the state machines.
19
- *
20
- * @category Input Flow Control
21
- */
22
- export class CameraMuxWithAnimationAndLock implements CameraMux {
23
-
24
- private _panStateMachine: PanControlStateMachine;
25
- private _zoomStateMachine: ZoomControlStateMachine;
26
- private _rotateStateMachine: RotateControlStateMachine;
27
-
28
- constructor(panStateMachine: PanControlStateMachine, zoomStateMachine: ZoomControlStateMachine, rotateStateMachine: RotateControlStateMachine){
29
- this._panStateMachine = panStateMachine;
30
- this._zoomStateMachine = zoomStateMachine;
31
- this._rotateStateMachine = rotateStateMachine;
32
- }
33
-
34
- notifyPanToAnimationInput(target: Point): void {
35
- this._panStateMachine.notifyPanToAnimationInput(target);
36
- }
37
-
38
- notifyPanInput(delta: Point): void {
39
- this._panStateMachine.notifyPanInput(delta);
40
- }
41
-
42
- notifyZoomInput(delta: number, at: Point): void {
43
- this._zoomStateMachine.notifyZoomByAtInput(delta, at);
44
- }
45
-
46
- notifyRotateByInput(delta: number): void {
47
- this._rotateStateMachine.notifyRotateByInput(delta);
48
- }
49
-
50
- notifyRotateToAnimationInput(target: number): void {
51
- this._rotateStateMachine.notifyRotateToAnimationInput(target);
52
- }
53
-
54
- notifyZoomInputAnimation(targetZoom: number, at: Point = {x: 0, y: 0}): void {
55
- this._zoomStateMachine.notifyZoomToAtCenterInput(targetZoom, at);
56
- }
57
-
58
- notifyZoomInputAnimationWorld(targetZoom: number, at: Point = {x: 0, y: 0}): void {
59
- this._zoomStateMachine.notifyZoomToAtWorldInput(targetZoom, at);
60
- }
61
-
62
- notifyRotationInput(delta: number): void {
63
- console.error("Rotation input is not implemented");
64
- }
65
-
66
- initatePanTransition(): void {
67
- this._panStateMachine.initateTransition();
68
- }
69
-
70
- initateZoomTransition(): void {
71
- this._zoomStateMachine.initateTransition();
72
- }
73
-
74
- initateRotateTransition(): void {
75
- this._rotateStateMachine.initateTransition();
76
- }
77
-
78
- get rotateStateMachine(): RotateControlStateMachine {
79
- return this._rotateStateMachine;
80
- }
81
-
82
- get panStateMachine(): PanControlStateMachine {
83
- return this._panStateMachine;
84
- }
85
-
86
- get zoomStateMachine(): ZoomControlStateMachine {
87
- return this._zoomStateMachine;
88
- }
89
- }
90
-
91
- /**
92
- * @description Create a flow control that allows animation and lock inputs.
93
- *
94
- * @category Input Flow Control
95
- */
96
- export function createCameraMuxWithAnimationAndLock(camera: ObservableBoardCamera): CameraMux {
97
- const context = createDefaultCameraRig(camera);
98
- const panStateMachine = createDefaultPanControlStateMachine(context);
99
- const zoomStateMachine = createDefaultZoomControlStateMachine(context);
100
- const rotateStateMachine = createDefaultRotateControlStateMachine(context);
101
- return new CameraMuxWithAnimationAndLock(panStateMachine, zoomStateMachine, rotateStateMachine);
102
- }
103
-
104
- /**
105
- * @description Create a default flow control with a camera rig.
106
- *
107
- * @category Input Flow Control
108
- */
109
- export function createCameraMuxWithAnimationAndLockWithCameraRig(cameraRig: CameraRig): CameraMux {
110
- const panStateMachine = createDefaultPanControlStateMachine(cameraRig);
111
- const zoomStateMachine = createDefaultZoomControlStateMachine(cameraRig);
112
- const rotateStateMachine = createDefaultRotateControlStateMachine(cameraRig);
113
- return new CameraMuxWithAnimationAndLock(panStateMachine, zoomStateMachine, rotateStateMachine);
114
- }
@@ -1,4 +0,0 @@
1
- export * from "./animation-and-lock";
2
- export * from "./pan-control-state-machine";
3
- export * from "./zoom-control-state-machine";
4
- export * from "./rotation-control-state-machine";