@antv/g 5.1.0 → 5.1.3-alpha.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 (943) hide show
  1. package/dist/AbstractRenderer.d.ts +38 -0
  2. package/dist/AbstractRenderer.d.ts.map +1 -0
  3. package/dist/Canvas.d.ts +150 -0
  4. package/dist/Canvas.d.ts.map +1 -0
  5. package/dist/DisplayObjectPool.d.ts +10 -0
  6. package/dist/DisplayObjectPool.d.ts.map +1 -0
  7. package/dist/__tests__/utils.d.ts +2 -0
  8. package/dist/__tests__/utils.d.ts.map +1 -0
  9. package/dist/camera/Camera.d.ts +328 -0
  10. package/dist/camera/Camera.d.ts.map +1 -0
  11. package/dist/camera/Landmark.d.ts +24 -0
  12. package/dist/camera/Landmark.d.ts.map +1 -0
  13. package/dist/camera/index.d.ts +3 -0
  14. package/dist/camera/index.d.ts.map +1 -0
  15. package/dist/canvas-module.d.ts +2 -0
  16. package/dist/canvas-module.d.ts.map +1 -0
  17. package/dist/components/Cullable.d.ts +15 -0
  18. package/dist/components/Cullable.d.ts.map +1 -0
  19. package/dist/components/Geometry.d.ts +13 -0
  20. package/dist/components/Geometry.d.ts.map +1 -0
  21. package/dist/components/Renderable.d.ts +25 -0
  22. package/dist/components/Renderable.d.ts.map +1 -0
  23. package/dist/components/Sortable.d.ts +21 -0
  24. package/dist/components/Sortable.d.ts.map +1 -0
  25. package/dist/components/Transform.d.ts +29 -0
  26. package/dist/components/Transform.d.ts.map +1 -0
  27. package/dist/components/index.d.ts +6 -0
  28. package/dist/components/index.d.ts.map +1 -0
  29. package/dist/css/CSS.d.ts +89 -0
  30. package/dist/css/CSS.d.ts.map +1 -0
  31. package/dist/css/CSSProperty.d.ts +42 -0
  32. package/dist/css/CSSProperty.d.ts.map +1 -0
  33. package/dist/css/StyleValueRegistry.d.ts +124 -0
  34. package/dist/css/StyleValueRegistry.d.ts.map +1 -0
  35. package/dist/css/cssom/CSSColorValue.d.ts +24 -0
  36. package/dist/css/cssom/CSSColorValue.d.ts.map +1 -0
  37. package/dist/css/cssom/CSSGradientValue.d.ts +40 -0
  38. package/dist/css/cssom/CSSGradientValue.d.ts.map +1 -0
  39. package/dist/css/cssom/CSSKeywordValue.d.ts +16 -0
  40. package/dist/css/cssom/CSSKeywordValue.d.ts.map +1 -0
  41. package/dist/css/cssom/CSSMathOperator.d.ts +12 -0
  42. package/dist/css/cssom/CSSMathOperator.d.ts.map +1 -0
  43. package/dist/css/cssom/CSSNumericSumValue.d.ts +8 -0
  44. package/dist/css/cssom/CSSNumericSumValue.d.ts.map +1 -0
  45. package/dist/css/cssom/CSSNumericValue.d.ts +213 -0
  46. package/dist/css/cssom/CSSNumericValue.d.ts.map +1 -0
  47. package/dist/css/cssom/CSSRGB.d.ts +26 -0
  48. package/dist/css/cssom/CSSRGB.d.ts.map +1 -0
  49. package/dist/css/cssom/CSSStyleValue.d.ts +54 -0
  50. package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -0
  51. package/dist/css/cssom/index.d.ts +18 -0
  52. package/dist/css/cssom/index.d.ts.map +1 -0
  53. package/dist/css/cssom/types.d.ts +87 -0
  54. package/dist/css/cssom/types.d.ts.map +1 -0
  55. package/dist/css/index.d.ts +12 -0
  56. package/dist/css/index.d.ts.map +1 -0
  57. package/dist/css/interfaces.d.ts +117 -0
  58. package/dist/css/interfaces.d.ts.map +1 -0
  59. package/dist/css/layout/FragmentResult.d.ts +33 -0
  60. package/dist/css/layout/FragmentResult.d.ts.map +1 -0
  61. package/dist/css/layout/LayoutChildren.d.ts +24 -0
  62. package/dist/css/layout/LayoutChildren.d.ts.map +1 -0
  63. package/dist/css/layout/LayoutContext.d.ts +36 -0
  64. package/dist/css/layout/LayoutContext.d.ts.map +1 -0
  65. package/dist/css/layout/LayoutDefinition.d.ts +21 -0
  66. package/dist/css/layout/LayoutDefinition.d.ts.map +1 -0
  67. package/dist/css/layout/LayoutEdges.d.ts +25 -0
  68. package/dist/css/layout/LayoutEdges.d.ts.map +1 -0
  69. package/dist/css/layout/LayoutEngine.d.ts +42 -0
  70. package/dist/css/layout/LayoutEngine.d.ts.map +1 -0
  71. package/dist/css/layout/LayoutFragment.d.ts +27 -0
  72. package/dist/css/layout/LayoutFragment.d.ts.map +1 -0
  73. package/dist/css/layout/LayoutObject.d.ts +47 -0
  74. package/dist/css/layout/LayoutObject.d.ts.map +1 -0
  75. package/dist/css/layout/LayoutRegistry.d.ts +17 -0
  76. package/dist/css/layout/LayoutRegistry.d.ts.map +1 -0
  77. package/dist/css/layout/LayoutWorkTask.d.ts +15 -0
  78. package/dist/css/layout/LayoutWorkTask.d.ts.map +1 -0
  79. package/dist/css/layout/index.d.ts +12 -0
  80. package/dist/css/layout/index.d.ts.map +1 -0
  81. package/dist/css/layout/types.d.ts +105 -0
  82. package/dist/css/layout/types.d.ts.map +1 -0
  83. package/dist/css/parser/color.d.ts +7 -0
  84. package/dist/css/parser/color.d.ts.map +1 -0
  85. package/dist/css/parser/dimension.d.ts +38 -0
  86. package/dist/css/parser/dimension.d.ts.map +1 -0
  87. package/dist/css/parser/filter.d.ts +8 -0
  88. package/dist/css/parser/filter.d.ts.map +1 -0
  89. package/dist/css/parser/index.d.ts +16 -0
  90. package/dist/css/parser/index.d.ts.map +1 -0
  91. package/dist/css/parser/numeric.d.ts +20 -0
  92. package/dist/css/parser/numeric.d.ts.map +1 -0
  93. package/dist/css/parser/path.d.ts +6 -0
  94. package/dist/css/parser/path.d.ts.map +1 -0
  95. package/dist/css/parser/points.d.ts +13 -0
  96. package/dist/css/parser/points.d.ts.map +1 -0
  97. package/dist/css/parser/transform-origin.d.ts +7 -0
  98. package/dist/css/parser/transform-origin.d.ts.map +1 -0
  99. package/dist/css/parser/transform.d.ts +14 -0
  100. package/dist/css/parser/transform.d.ts.map +1 -0
  101. package/dist/css/parser/types.d.ts +3 -0
  102. package/dist/css/parser/types.d.ts.map +1 -0
  103. package/dist/css/properties/CSSPropertyClipPath.d.ts +21 -0
  104. package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -0
  105. package/dist/css/properties/CSSPropertyColor.d.ts +5 -0
  106. package/dist/css/properties/CSSPropertyColor.d.ts.map +1 -0
  107. package/dist/css/properties/CSSPropertyFilter.d.ts +4 -0
  108. package/dist/css/properties/CSSPropertyFilter.d.ts.map +1 -0
  109. package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts +7 -0
  110. package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -0
  111. package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts +12 -0
  112. package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts.map +1 -0
  113. package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts +22 -0
  114. package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts.map +1 -0
  115. package/dist/css/properties/CSSPropertyLocalPosition.d.ts +7 -0
  116. package/dist/css/properties/CSSPropertyLocalPosition.d.ts.map +1 -0
  117. package/dist/css/properties/CSSPropertyOffsetDistance.d.ts +4 -0
  118. package/dist/css/properties/CSSPropertyOffsetDistance.d.ts.map +1 -0
  119. package/dist/css/properties/CSSPropertyOffsetPath.d.ts +4 -0
  120. package/dist/css/properties/CSSPropertyOffsetPath.d.ts.map +1 -0
  121. package/dist/css/properties/CSSPropertyOpacity.d.ts +7 -0
  122. package/dist/css/properties/CSSPropertyOpacity.d.ts.map +1 -0
  123. package/dist/css/properties/CSSPropertyPath.d.ts +4 -0
  124. package/dist/css/properties/CSSPropertyPath.d.ts.map +1 -0
  125. package/dist/css/properties/CSSPropertyPoints.d.ts +11 -0
  126. package/dist/css/properties/CSSPropertyPoints.d.ts.map +1 -0
  127. package/dist/css/properties/CSSPropertyShadowBlur.d.ts +3 -0
  128. package/dist/css/properties/CSSPropertyShadowBlur.d.ts.map +1 -0
  129. package/dist/css/properties/CSSPropertyText.d.ts +4 -0
  130. package/dist/css/properties/CSSPropertyText.d.ts.map +1 -0
  131. package/dist/css/properties/CSSPropertyTextTransform.d.ts +4 -0
  132. package/dist/css/properties/CSSPropertyTextTransform.d.ts.map +1 -0
  133. package/dist/css/properties/CSSPropertyTransform.d.ts +33 -0
  134. package/dist/css/properties/CSSPropertyTransform.d.ts.map +1 -0
  135. package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +9 -0
  136. package/dist/css/properties/CSSPropertyTransformOrigin.d.ts.map +1 -0
  137. package/dist/css/properties/CSSPropertyZIndex.d.ts +4 -0
  138. package/dist/css/properties/CSSPropertyZIndex.d.ts.map +1 -0
  139. package/dist/css/properties/index.d.ts +19 -0
  140. package/dist/css/properties/index.d.ts.map +1 -0
  141. package/dist/display-objects/Circle.d.ts +18 -0
  142. package/dist/display-objects/Circle.d.ts.map +1 -0
  143. package/dist/display-objects/CustomElement.d.ts +25 -0
  144. package/dist/display-objects/CustomElement.d.ts.map +1 -0
  145. package/dist/display-objects/DisplayObject.d.ts +275 -0
  146. package/dist/display-objects/DisplayObject.d.ts.map +1 -0
  147. package/dist/display-objects/Ellipse.d.ts +20 -0
  148. package/dist/display-objects/Ellipse.d.ts.map +1 -0
  149. package/dist/display-objects/Group.d.ts +30 -0
  150. package/dist/display-objects/Group.d.ts.map +1 -0
  151. package/dist/display-objects/HTML.d.ts +42 -0
  152. package/dist/display-objects/HTML.d.ts.map +1 -0
  153. package/dist/display-objects/Image.d.ts +24 -0
  154. package/dist/display-objects/Image.d.ts.map +1 -0
  155. package/dist/display-objects/Line.d.ts +31 -0
  156. package/dist/display-objects/Line.d.ts.map +1 -0
  157. package/dist/display-objects/Path.d.ts +49 -0
  158. package/dist/display-objects/Path.d.ts.map +1 -0
  159. package/dist/display-objects/Polygon.d.ts +17 -0
  160. package/dist/display-objects/Polygon.d.ts.map +1 -0
  161. package/dist/display-objects/Polyline.d.ts +22 -0
  162. package/dist/display-objects/Polyline.d.ts.map +1 -0
  163. package/dist/display-objects/Rect.d.ts +25 -0
  164. package/dist/display-objects/Rect.d.ts.map +1 -0
  165. package/dist/display-objects/Text.d.ts +92 -0
  166. package/dist/display-objects/Text.d.ts.map +1 -0
  167. package/dist/display-objects/index.d.ts +14 -0
  168. package/dist/display-objects/index.d.ts.map +1 -0
  169. package/dist/dom/Animation.d.ts +133 -0
  170. package/dist/dom/Animation.d.ts.map +1 -0
  171. package/dist/dom/AnimationEffectTiming.d.ts +59 -0
  172. package/dist/dom/AnimationEffectTiming.d.ts.map +1 -0
  173. package/dist/dom/AnimationEvent.d.ts +12 -0
  174. package/dist/dom/AnimationEvent.d.ts.map +1 -0
  175. package/dist/dom/AnimationTimeline.d.ts +41 -0
  176. package/dist/dom/AnimationTimeline.d.ts.map +1 -0
  177. package/dist/dom/CustomElementRegistry.d.ts +16 -0
  178. package/dist/dom/CustomElementRegistry.d.ts.map +1 -0
  179. package/dist/dom/CustomEvent.d.ts +17 -0
  180. package/dist/dom/CustomEvent.d.ts.map +1 -0
  181. package/dist/dom/Document.d.ts +73 -0
  182. package/dist/dom/Document.d.ts.map +1 -0
  183. package/dist/dom/Element.d.ts +188 -0
  184. package/dist/dom/Element.d.ts.map +1 -0
  185. package/dist/dom/EventTarget.d.ts +41 -0
  186. package/dist/dom/EventTarget.d.ts.map +1 -0
  187. package/dist/dom/FederatedEvent.d.ts +146 -0
  188. package/dist/dom/FederatedEvent.d.ts.map +1 -0
  189. package/dist/dom/FederatedMouseEvent.d.ts +53 -0
  190. package/dist/dom/FederatedMouseEvent.d.ts.map +1 -0
  191. package/dist/dom/FederatedPointerEvent.d.ts +76 -0
  192. package/dist/dom/FederatedPointerEvent.d.ts.map +1 -0
  193. package/dist/dom/FederatedWheelEvent.d.ts +21 -0
  194. package/dist/dom/FederatedWheelEvent.d.ts.map +1 -0
  195. package/dist/dom/KeyframeEffect.d.ts +48 -0
  196. package/dist/dom/KeyframeEffect.d.ts.map +1 -0
  197. package/dist/dom/KeyframeList.d.ts +3 -0
  198. package/dist/dom/KeyframeList.d.ts.map +1 -0
  199. package/dist/dom/MutationEvent.d.ts +16 -0
  200. package/dist/dom/MutationEvent.d.ts.map +1 -0
  201. package/dist/dom/MutationObserver.d.ts +37 -0
  202. package/dist/dom/MutationObserver.d.ts.map +1 -0
  203. package/dist/dom/MutationRecord.d.ts +15 -0
  204. package/dist/dom/MutationRecord.d.ts.map +1 -0
  205. package/dist/dom/Node.d.ts +139 -0
  206. package/dist/dom/Node.d.ts.map +1 -0
  207. package/dist/dom/index.d.ts +21 -0
  208. package/dist/dom/index.d.ts.map +1 -0
  209. package/dist/dom/interfaces.d.ts +373 -0
  210. package/dist/dom/interfaces.d.ts.map +1 -0
  211. package/dist/global-module.d.ts +2 -0
  212. package/dist/global-module.d.ts.map +1 -0
  213. package/dist/index.d.ts +19 -0
  214. package/dist/index.d.ts.map +1 -0
  215. package/dist/index.esm.js +19679 -0
  216. package/dist/index.js +19851 -0
  217. package/dist/index.umd.js +29159 -0
  218. package/dist/index.umd.min.js +14 -28
  219. package/dist/plugins/CullingPlugin.d.ts +18 -0
  220. package/dist/plugins/CullingPlugin.d.ts.map +1 -0
  221. package/dist/plugins/DirtyCheckPlugin.d.ts +11 -0
  222. package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -0
  223. package/dist/plugins/EventPlugin.d.ts +30 -0
  224. package/dist/plugins/EventPlugin.d.ts.map +1 -0
  225. package/dist/plugins/FrustumCullingStrategy.d.ts +22 -0
  226. package/dist/plugins/FrustumCullingStrategy.d.ts.map +1 -0
  227. package/dist/plugins/PrepareRendererPlugin.d.ts +8 -0
  228. package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -0
  229. package/dist/services/ContextService.d.ts +14 -0
  230. package/dist/services/ContextService.d.ts.map +1 -0
  231. package/dist/services/EventService.d.ts +72 -0
  232. package/dist/services/EventService.d.ts.map +1 -0
  233. package/dist/services/OffscreenCanvasCreator.d.ts +14 -0
  234. package/dist/services/OffscreenCanvasCreator.d.ts.map +1 -0
  235. package/dist/services/RenderingContext.d.ts +27 -0
  236. package/dist/services/RenderingContext.d.ts.map +1 -0
  237. package/dist/services/RenderingService.d.ts +103 -0
  238. package/dist/services/RenderingService.d.ts.map +1 -0
  239. package/dist/services/SceneGraphSelector.d.ts +24 -0
  240. package/dist/services/SceneGraphSelector.d.ts.map +1 -0
  241. package/dist/services/SceneGraphService.d.ts +154 -0
  242. package/dist/services/SceneGraphService.d.ts.map +1 -0
  243. package/dist/services/TextService.d.ts +37 -0
  244. package/dist/services/TextService.d.ts.map +1 -0
  245. package/dist/services/aabb/CircleUpdater.d.ts +9 -0
  246. package/dist/services/aabb/CircleUpdater.d.ts.map +1 -0
  247. package/dist/services/aabb/EllipseUpdater.d.ts +9 -0
  248. package/dist/services/aabb/EllipseUpdater.d.ts.map +1 -0
  249. package/dist/services/aabb/LineUpdater.d.ts +9 -0
  250. package/dist/services/aabb/LineUpdater.d.ts.map +1 -0
  251. package/dist/services/aabb/PathUpdater.d.ts +9 -0
  252. package/dist/services/aabb/PathUpdater.d.ts.map +1 -0
  253. package/dist/services/aabb/PolylineUpdater.d.ts +9 -0
  254. package/dist/services/aabb/PolylineUpdater.d.ts.map +1 -0
  255. package/dist/services/aabb/RectUpdater.d.ts +9 -0
  256. package/dist/services/aabb/RectUpdater.d.ts.map +1 -0
  257. package/dist/services/aabb/TextUpdater.d.ts +22 -0
  258. package/dist/services/aabb/TextUpdater.d.ts.map +1 -0
  259. package/dist/services/aabb/index.d.ts +9 -0
  260. package/dist/services/aabb/index.d.ts.map +1 -0
  261. package/dist/services/aabb/interfaces.d.ts +16 -0
  262. package/dist/services/aabb/interfaces.d.ts.map +1 -0
  263. package/dist/services/index.d.ts +11 -0
  264. package/dist/services/index.d.ts.map +1 -0
  265. package/dist/shapes/AABB.d.ts +36 -0
  266. package/dist/shapes/AABB.d.ts.map +1 -0
  267. package/dist/shapes/BoundingSphere.d.ts +9 -0
  268. package/dist/shapes/BoundingSphere.d.ts.map +1 -0
  269. package/dist/shapes/Frustum.d.ts +17 -0
  270. package/dist/shapes/Frustum.d.ts.map +1 -0
  271. package/dist/shapes/Plane.d.ts +15 -0
  272. package/dist/shapes/Plane.d.ts.map +1 -0
  273. package/dist/shapes/Point.d.ts +12 -0
  274. package/dist/shapes/Point.d.ts.map +1 -0
  275. package/dist/shapes/Ray.d.ts +25 -0
  276. package/dist/shapes/Ray.d.ts.map +1 -0
  277. package/dist/shapes/Rectangle.d.ts +13 -0
  278. package/dist/shapes/Rectangle.d.ts.map +1 -0
  279. package/dist/shapes/index.d.ts +8 -0
  280. package/dist/shapes/index.d.ts.map +1 -0
  281. package/dist/types.d.ts +270 -0
  282. package/dist/types.d.ts.map +1 -0
  283. package/dist/utils/animation.d.ts +16 -0
  284. package/dist/utils/animation.d.ts.map +1 -0
  285. package/dist/utils/assert.d.ts +10 -0
  286. package/dist/utils/assert.d.ts.map +1 -0
  287. package/dist/utils/bezier-easing.d.ts +21 -0
  288. package/dist/utils/bezier-easing.d.ts.map +1 -0
  289. package/dist/utils/canvas.d.ts +7 -0
  290. package/dist/utils/canvas.d.ts.map +1 -0
  291. package/dist/utils/custom-easing.d.ts +16 -0
  292. package/dist/utils/custom-easing.d.ts.map +1 -0
  293. package/dist/utils/deferred.d.ts +44 -0
  294. package/dist/utils/deferred.d.ts.map +1 -0
  295. package/dist/utils/dom.d.ts +3 -0
  296. package/dist/utils/dom.d.ts.map +1 -0
  297. package/dist/utils/event.d.ts +36 -0
  298. package/dist/utils/event.d.ts.map +1 -0
  299. package/dist/utils/index.d.ts +12 -0
  300. package/dist/utils/index.d.ts.map +1 -0
  301. package/dist/utils/interpolation.d.ts +5 -0
  302. package/dist/utils/interpolation.d.ts.map +1 -0
  303. package/dist/utils/math.d.ts +30 -0
  304. package/dist/utils/math.d.ts.map +1 -0
  305. package/dist/utils/path.d.ts +16 -0
  306. package/dist/utils/path.d.ts.map +1 -0
  307. package/dist/utils/string.d.ts +3 -0
  308. package/dist/utils/string.d.ts.map +1 -0
  309. package/dist/utils/text.d.ts +3 -0
  310. package/dist/utils/text.d.ts.map +1 -0
  311. package/package.json +27 -33
  312. package/es/AbstractRenderer.d.ts +0 -37
  313. package/es/AbstractRenderer.js +0 -62
  314. package/es/Canvas.d.ts +0 -149
  315. package/es/Canvas.js +0 -518
  316. package/es/DisplayObjectPool.d.ts +0 -7
  317. package/es/DisplayObjectPool.js +0 -27
  318. package/es/camera/Camera.d.ts +0 -327
  319. package/es/camera/Camera.js +0 -1154
  320. package/es/camera/Landmark.d.ts +0 -23
  321. package/es/camera/Landmark.js +0 -1
  322. package/es/camera/index.d.ts +0 -2
  323. package/es/camera/index.js +0 -2
  324. package/es/canvas-module.d.ts +0 -1
  325. package/es/canvas-module.js +0 -25
  326. package/es/components/Cullable.d.ts +0 -14
  327. package/es/components/Cullable.js +0 -28
  328. package/es/components/Geometry.d.ts +0 -12
  329. package/es/components/Geometry.js +0 -10
  330. package/es/components/Renderable.d.ts +0 -24
  331. package/es/components/Renderable.js +0 -18
  332. package/es/components/Sortable.d.ts +0 -20
  333. package/es/components/Sortable.js +0 -20
  334. package/es/components/Transform.d.ts +0 -28
  335. package/es/components/Transform.js +0 -64
  336. package/es/components/index.d.ts +0 -5
  337. package/es/components/index.js +0 -5
  338. package/es/css/CSS.d.ts +0 -85
  339. package/es/css/CSS.js +0 -117
  340. package/es/css/CSSProperty.d.ts +0 -41
  341. package/es/css/CSSProperty.js +0 -1
  342. package/es/css/StyleValueRegistry.d.ts +0 -124
  343. package/es/css/StyleValueRegistry.js +0 -896
  344. package/es/css/cssom/CSSColorValue.d.ts +0 -23
  345. package/es/css/cssom/CSSColorValue.js +0 -43
  346. package/es/css/cssom/CSSGradientValue.d.ts +0 -39
  347. package/es/css/cssom/CSSGradientValue.js +0 -54
  348. package/es/css/cssom/CSSImageValue.d.ts +0 -1
  349. package/es/css/cssom/CSSImageValue.js +0 -0
  350. package/es/css/cssom/CSSKeywordValue.d.ts +0 -15
  351. package/es/css/cssom/CSSKeywordValue.js +0 -37
  352. package/es/css/cssom/CSSMathOperator.d.ts +0 -11
  353. package/es/css/cssom/CSSMathOperator.js +0 -32
  354. package/es/css/cssom/CSSNumericSumValue.d.ts +0 -7
  355. package/es/css/cssom/CSSNumericSumValue.js +0 -1
  356. package/es/css/cssom/CSSNumericValue.d.ts +0 -212
  357. package/es/css/cssom/CSSNumericValue.js +0 -1661
  358. package/es/css/cssom/CSSRGB.d.ts +0 -25
  359. package/es/css/cssom/CSSRGB.js +0 -48
  360. package/es/css/cssom/CSSStyleValue.d.ts +0 -53
  361. package/es/css/cssom/CSSStyleValue.js +0 -625
  362. package/es/css/cssom/CSSTransformComponent.d.ts +0 -22
  363. package/es/css/cssom/CSSTransformComponent.js +0 -32
  364. package/es/css/cssom/CSSTransformValue.d.ts +0 -30
  365. package/es/css/cssom/CSSTransformValue.js +0 -48
  366. package/es/css/cssom/CSSTranslate.d.ts +0 -15
  367. package/es/css/cssom/CSSTranslate.js +0 -44
  368. package/es/css/cssom/index.d.ts +0 -19
  369. package/es/css/cssom/index.js +0 -19
  370. package/es/css/cssom/types.d.ts +0 -86
  371. package/es/css/cssom/types.js +0 -119
  372. package/es/css/index.d.ts +0 -11
  373. package/es/css/index.js +0 -11
  374. package/es/css/interfaces.d.ts +0 -6
  375. package/es/css/interfaces.js +0 -2
  376. package/es/css/layout/FragmentResult.d.ts +0 -32
  377. package/es/css/layout/FragmentResult.js +0 -32
  378. package/es/css/layout/LayoutChildren.d.ts +0 -23
  379. package/es/css/layout/LayoutChildren.js +0 -55
  380. package/es/css/layout/LayoutContext.d.ts +0 -35
  381. package/es/css/layout/LayoutContext.js +0 -35
  382. package/es/css/layout/LayoutDefinition.d.ts +0 -20
  383. package/es/css/layout/LayoutDefinition.js +0 -9
  384. package/es/css/layout/LayoutEdges.d.ts +0 -24
  385. package/es/css/layout/LayoutEdges.js +0 -41
  386. package/es/css/layout/LayoutEngine.d.ts +0 -41
  387. package/es/css/layout/LayoutEngine.js +0 -332
  388. package/es/css/layout/LayoutFragment.d.ts +0 -26
  389. package/es/css/layout/LayoutFragment.js +0 -28
  390. package/es/css/layout/LayoutObject.d.ts +0 -46
  391. package/es/css/layout/LayoutObject.js +0 -172
  392. package/es/css/layout/LayoutRegistry.d.ts +0 -16
  393. package/es/css/layout/LayoutRegistry.js +0 -78
  394. package/es/css/layout/LayoutWorkTask.d.ts +0 -14
  395. package/es/css/layout/LayoutWorkTask.js +0 -1
  396. package/es/css/layout/index.d.ts +0 -11
  397. package/es/css/layout/index.js +0 -11
  398. package/es/css/layout/types.d.ts +0 -104
  399. package/es/css/layout/types.js +0 -66
  400. package/es/css/parser/color.d.ts +0 -6
  401. package/es/css/parser/color.js +0 -241
  402. package/es/css/parser/dimension.d.ts +0 -37
  403. package/es/css/parser/dimension.js +0 -149
  404. package/es/css/parser/filter.d.ts +0 -7
  405. package/es/css/parser/filter.js +0 -43
  406. package/es/css/parser/index.d.ts +0 -15
  407. package/es/css/parser/index.js +0 -15
  408. package/es/css/parser/numeric.d.ts +0 -19
  409. package/es/css/parser/numeric.js +0 -62
  410. package/es/css/parser/path.d.ts +0 -5
  411. package/es/css/parser/path.js +0 -207
  412. package/es/css/parser/points.d.ts +0 -12
  413. package/es/css/parser/points.js +0 -58
  414. package/es/css/parser/transform-origin.d.ts +0 -6
  415. package/es/css/parser/transform-origin.js +0 -45
  416. package/es/css/parser/transform.d.ts +0 -13
  417. package/es/css/parser/transform.js +0 -289
  418. package/es/css/parser/types.d.ts +0 -2
  419. package/es/css/parser/types.js +0 -1
  420. package/es/css/properties/CSSPropertyAnchor.d.ts +0 -8
  421. package/es/css/properties/CSSPropertyAnchor.js +0 -25
  422. package/es/css/properties/CSSPropertyClipPath.d.ts +0 -22
  423. package/es/css/properties/CSSPropertyClipPath.js +0 -56
  424. package/es/css/properties/CSSPropertyColor.d.ts +0 -14
  425. package/es/css/properties/CSSPropertyColor.js +0 -30
  426. package/es/css/properties/CSSPropertyFilter.d.ts +0 -6
  427. package/es/css/properties/CSSPropertyFilter.js +0 -16
  428. package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -21
  429. package/es/css/properties/CSSPropertyLengthOrPercentage.js +0 -75
  430. package/es/css/properties/CSSPropertyLineDash.d.ts +0 -9
  431. package/es/css/properties/CSSPropertyLineDash.js +0 -25
  432. package/es/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
  433. package/es/css/properties/CSSPropertyLocalPosition.js +0 -90
  434. package/es/css/properties/CSSPropertyOffsetDistance.d.ts +0 -9
  435. package/es/css/properties/CSSPropertyOffsetDistance.js +0 -34
  436. package/es/css/properties/CSSPropertyOffsetPath.d.ts +0 -5
  437. package/es/css/properties/CSSPropertyOffsetPath.js +0 -31
  438. package/es/css/properties/CSSPropertyOpacity.d.ts +0 -10
  439. package/es/css/properties/CSSPropertyOpacity.js +0 -20
  440. package/es/css/properties/CSSPropertyPath.d.ts +0 -27
  441. package/es/css/properties/CSSPropertyPath.js +0 -55
  442. package/es/css/properties/CSSPropertyPoints.d.ts +0 -18
  443. package/es/css/properties/CSSPropertyPoints.js +0 -27
  444. package/es/css/properties/CSSPropertyShadowBlur.d.ts +0 -4
  445. package/es/css/properties/CSSPropertyShadowBlur.js +0 -22
  446. package/es/css/properties/CSSPropertyText.d.ts +0 -7
  447. package/es/css/properties/CSSPropertyText.js +0 -30
  448. package/es/css/properties/CSSPropertyTextTransform.d.ts +0 -5
  449. package/es/css/properties/CSSPropertyTextTransform.js +0 -29
  450. package/es/css/properties/CSSPropertyTransform.d.ts +0 -38
  451. package/es/css/properties/CSSPropertyTransform.js +0 -128
  452. package/es/css/properties/CSSPropertyTransformOrigin.d.ts +0 -11
  453. package/es/css/properties/CSSPropertyTransformOrigin.js +0 -21
  454. package/es/css/properties/CSSPropertyVisibility.d.ts +0 -13
  455. package/es/css/properties/CSSPropertyVisibility.js +0 -24
  456. package/es/css/properties/CSSPropertyZIndex.d.ts +0 -8
  457. package/es/css/properties/CSSPropertyZIndex.js +0 -33
  458. package/es/css/properties/index.d.ts +0 -18
  459. package/es/css/properties/index.js +0 -18
  460. package/es/display-objects/Circle.d.ts +0 -17
  461. package/es/display-objects/Circle.js +0 -34
  462. package/es/display-objects/CustomElement.d.ts +0 -22
  463. package/es/display-objects/CustomElement.js +0 -92
  464. package/es/display-objects/DisplayObject.d.ts +0 -274
  465. package/es/display-objects/DisplayObject.js +0 -887
  466. package/es/display-objects/Ellipse.d.ts +0 -19
  467. package/es/display-objects/Ellipse.js +0 -35
  468. package/es/display-objects/Group.d.ts +0 -29
  469. package/es/display-objects/Group.js +0 -42
  470. package/es/display-objects/HTML.d.ts +0 -41
  471. package/es/display-objects/HTML.js +0 -100
  472. package/es/display-objects/Image.d.ts +0 -23
  473. package/es/display-objects/Image.js +0 -34
  474. package/es/display-objects/Line.d.ts +0 -30
  475. package/es/display-objects/Line.js +0 -63
  476. package/es/display-objects/Path.d.ts +0 -48
  477. package/es/display-objects/Path.js +0 -131
  478. package/es/display-objects/Polygon.d.ts +0 -16
  479. package/es/display-objects/Polygon.js +0 -31
  480. package/es/display-objects/Polyline.d.ts +0 -21
  481. package/es/display-objects/Polyline.js +0 -74
  482. package/es/display-objects/Rect.d.ts +0 -21
  483. package/es/display-objects/Rect.js +0 -34
  484. package/es/display-objects/Text.d.ts +0 -91
  485. package/es/display-objects/Text.js +0 -118
  486. package/es/display-objects/index.d.ts +0 -13
  487. package/es/display-objects/index.js +0 -13
  488. package/es/dom/Animation.d.ts +0 -132
  489. package/es/dom/Animation.js +0 -503
  490. package/es/dom/AnimationEffectTiming.d.ts +0 -58
  491. package/es/dom/AnimationEffectTiming.js +0 -68
  492. package/es/dom/AnimationEvent.d.ts +0 -11
  493. package/es/dom/AnimationEvent.js +0 -34
  494. package/es/dom/AnimationTimeline.d.ts +0 -40
  495. package/es/dom/AnimationTimeline.js +0 -217
  496. package/es/dom/CustomElementRegistry.d.ts +0 -15
  497. package/es/dom/CustomElementRegistry.js +0 -42
  498. package/es/dom/CustomEvent.d.ts +0 -16
  499. package/es/dom/CustomEvent.js +0 -35
  500. package/es/dom/Document.d.ts +0 -72
  501. package/es/dom/Document.js +0 -316
  502. package/es/dom/Element.d.ts +0 -187
  503. package/es/dom/Element.js +0 -604
  504. package/es/dom/EventTarget.d.ts +0 -40
  505. package/es/dom/EventTarget.js +0 -157
  506. package/es/dom/FederatedEvent.d.ts +0 -145
  507. package/es/dom/FederatedEvent.js +0 -222
  508. package/es/dom/FederatedMouseEvent.d.ts +0 -52
  509. package/es/dom/FederatedMouseEvent.js +0 -124
  510. package/es/dom/FederatedPointerEvent.d.ts +0 -75
  511. package/es/dom/FederatedPointerEvent.js +0 -61
  512. package/es/dom/FederatedTouchEvent.d.ts +0 -15
  513. package/es/dom/FederatedTouchEvent.js +0 -19
  514. package/es/dom/FederatedWheelEvent.d.ts +0 -20
  515. package/es/dom/FederatedWheelEvent.js +0 -27
  516. package/es/dom/KeyframeEffect.d.ts +0 -47
  517. package/es/dom/KeyframeEffect.js +0 -174
  518. package/es/dom/KeyframeList.d.ts +0 -2
  519. package/es/dom/KeyframeList.js +0 -176
  520. package/es/dom/MutationEvent.d.ts +0 -15
  521. package/es/dom/MutationEvent.js +0 -29
  522. package/es/dom/MutationObserver.d.ts +0 -36
  523. package/es/dom/MutationObserver.js +0 -416
  524. package/es/dom/MutationRecord.d.ts +0 -14
  525. package/es/dom/MutationRecord.js +0 -31
  526. package/es/dom/Node.d.ts +0 -138
  527. package/es/dom/Node.js +0 -387
  528. package/es/dom/index.d.ts +0 -20
  529. package/es/dom/index.js +0 -20
  530. package/es/dom/interfaces.d.ts +0 -372
  531. package/es/dom/interfaces.js +0 -56
  532. package/es/global-module.d.ts +0 -1
  533. package/es/global-module.js +0 -155
  534. package/es/index.d.ts +0 -18
  535. package/es/index.js +0 -21
  536. package/es/plugins/CullingPlugin.d.ts +0 -17
  537. package/es/plugins/CullingPlugin.js +0 -58
  538. package/es/plugins/DirtyCheckPlugin.d.ts +0 -10
  539. package/es/plugins/DirtyCheckPlugin.js +0 -55
  540. package/es/plugins/EventPlugin.d.ts +0 -30
  541. package/es/plugins/EventPlugin.js +0 -374
  542. package/es/plugins/FrustumCullingStrategy.d.ts +0 -21
  543. package/es/plugins/FrustumCullingStrategy.js +0 -108
  544. package/es/plugins/PrepareRendererPlugin.d.ts +0 -7
  545. package/es/plugins/PrepareRendererPlugin.js +0 -79
  546. package/es/services/ContextService.d.ts +0 -13
  547. package/es/services/ContextService.js +0 -5
  548. package/es/services/EventService.d.ts +0 -73
  549. package/es/services/EventService.js +0 -1238
  550. package/es/services/OffscreenCanvasCreator.d.ts +0 -13
  551. package/es/services/OffscreenCanvasCreator.js +0 -58
  552. package/es/services/RenderingContext.d.ts +0 -26
  553. package/es/services/RenderingContext.js +0 -14
  554. package/es/services/RenderingService.d.ts +0 -102
  555. package/es/services/RenderingService.js +0 -231
  556. package/es/services/SceneGraphSelector.d.ts +0 -23
  557. package/es/services/SceneGraphSelector.js +0 -100
  558. package/es/services/SceneGraphService.d.ts +0 -153
  559. package/es/services/SceneGraphService.js +0 -819
  560. package/es/services/TextService.d.ts +0 -36
  561. package/es/services/TextService.js +0 -350
  562. package/es/services/aabb/CircleUpdater.d.ts +0 -8
  563. package/es/services/aabb/CircleUpdater.js +0 -30
  564. package/es/services/aabb/EllipseUpdater.d.ts +0 -8
  565. package/es/services/aabb/EllipseUpdater.js +0 -31
  566. package/es/services/aabb/LineUpdater.d.ts +0 -8
  567. package/es/services/aabb/LineUpdater.js +0 -37
  568. package/es/services/aabb/PathUpdater.d.ts +0 -8
  569. package/es/services/aabb/PathUpdater.js +0 -168
  570. package/es/services/aabb/PolylineUpdater.d.ts +0 -8
  571. package/es/services/aabb/PolylineUpdater.js +0 -46
  572. package/es/services/aabb/RectUpdater.d.ts +0 -8
  573. package/es/services/aabb/RectUpdater.js +0 -72
  574. package/es/services/aabb/TextUpdater.d.ts +0 -21
  575. package/es/services/aabb/TextUpdater.js +0 -136
  576. package/es/services/aabb/index.d.ts +0 -8
  577. package/es/services/aabb/index.js +0 -8
  578. package/es/services/aabb/interfaces.d.ts +0 -15
  579. package/es/services/aabb/interfaces.js +0 -3
  580. package/es/services/index.d.ts +0 -10
  581. package/es/services/index.js +0 -10
  582. package/es/shapes/AABB.d.ts +0 -35
  583. package/es/shapes/AABB.js +0 -230
  584. package/es/shapes/BoundingSphere.d.ts +0 -8
  585. package/es/shapes/BoundingSphere.js +0 -31
  586. package/es/shapes/Frustum.d.ts +0 -16
  587. package/es/shapes/Frustum.js +0 -79
  588. package/es/shapes/Plane.d.ts +0 -14
  589. package/es/shapes/Plane.js +0 -42
  590. package/es/shapes/Point.d.ts +0 -11
  591. package/es/shapes/Point.js +0 -31
  592. package/es/shapes/Ray.d.ts +0 -24
  593. package/es/shapes/Ray.js +0 -138
  594. package/es/shapes/Rectangle.d.ts +0 -12
  595. package/es/shapes/Rectangle.js +0 -20
  596. package/es/shapes/index.d.ts +0 -7
  597. package/es/shapes/index.js +0 -7
  598. package/es/types.d.ts +0 -289
  599. package/es/types.js +0 -54
  600. package/es/utils/animation.d.ts +0 -15
  601. package/es/utils/animation.js +0 -251
  602. package/es/utils/assert.d.ts +0 -9
  603. package/es/utils/assert.js +0 -33
  604. package/es/utils/bezier-easing.d.ts +0 -20
  605. package/es/utils/bezier-easing.js +0 -90
  606. package/es/utils/canvas.d.ts +0 -6
  607. package/es/utils/canvas.js +0 -18
  608. package/es/utils/custom-easing.d.ts +0 -64
  609. package/es/utils/custom-easing.js +0 -317
  610. package/es/utils/deferred.d.ts +0 -43
  611. package/es/utils/deferred.js +0 -117
  612. package/es/utils/dom.d.ts +0 -2
  613. package/es/utils/dom.js +0 -8
  614. package/es/utils/event.d.ts +0 -45
  615. package/es/utils/event.js +0 -9
  616. package/es/utils/index.d.ts +0 -10
  617. package/es/utils/index.js +0 -10
  618. package/es/utils/interpolation.d.ts +0 -4
  619. package/es/utils/interpolation.js +0 -211
  620. package/es/utils/math.d.ts +0 -29
  621. package/es/utils/math.js +0 -236
  622. package/es/utils/path.d.ts +0 -15
  623. package/es/utils/path.js +0 -374
  624. package/es/utils/string.d.ts +0 -2
  625. package/es/utils/string.js +0 -17
  626. package/es/utils/text.d.ts +0 -2
  627. package/es/utils/text.js +0 -29
  628. package/lib/AbstractRenderer.d.ts +0 -37
  629. package/lib/AbstractRenderer.js +0 -69
  630. package/lib/Canvas.d.ts +0 -149
  631. package/lib/Canvas.js +0 -540
  632. package/lib/DisplayObjectPool.d.ts +0 -7
  633. package/lib/DisplayObjectPool.js +0 -35
  634. package/lib/camera/Camera.d.ts +0 -327
  635. package/lib/camera/Camera.js +0 -1232
  636. package/lib/camera/Landmark.d.ts +0 -23
  637. package/lib/camera/Landmark.js +0 -5
  638. package/lib/camera/index.d.ts +0 -2
  639. package/lib/camera/index.js +0 -31
  640. package/lib/canvas-module.d.ts +0 -1
  641. package/lib/canvas-module.js +0 -41
  642. package/lib/components/Cullable.d.ts +0 -14
  643. package/lib/components/Cullable.js +0 -36
  644. package/lib/components/Geometry.d.ts +0 -12
  645. package/lib/components/Geometry.js +0 -17
  646. package/lib/components/Renderable.d.ts +0 -24
  647. package/lib/components/Renderable.js +0 -25
  648. package/lib/components/Sortable.d.ts +0 -20
  649. package/lib/components/Sortable.js +0 -27
  650. package/lib/components/Transform.d.ts +0 -28
  651. package/lib/components/Transform.js +0 -71
  652. package/lib/components/index.d.ts +0 -5
  653. package/lib/components/index.js +0 -70
  654. package/lib/css/CSS.d.ts +0 -85
  655. package/lib/css/CSS.js +0 -131
  656. package/lib/css/CSSProperty.d.ts +0 -41
  657. package/lib/css/CSSProperty.js +0 -5
  658. package/lib/css/StyleValueRegistry.d.ts +0 -124
  659. package/lib/css/StyleValueRegistry.js +0 -922
  660. package/lib/css/cssom/CSSColorValue.d.ts +0 -23
  661. package/lib/css/cssom/CSSColorValue.js +0 -51
  662. package/lib/css/cssom/CSSGradientValue.d.ts +0 -39
  663. package/lib/css/cssom/CSSGradientValue.js +0 -64
  664. package/lib/css/cssom/CSSImageValue.d.ts +0 -1
  665. package/lib/css/cssom/CSSImageValue.js +0 -1
  666. package/lib/css/cssom/CSSKeywordValue.d.ts +0 -15
  667. package/lib/css/cssom/CSSKeywordValue.js +0 -45
  668. package/lib/css/cssom/CSSMathOperator.d.ts +0 -11
  669. package/lib/css/cssom/CSSMathOperator.js +0 -40
  670. package/lib/css/cssom/CSSNumericSumValue.d.ts +0 -7
  671. package/lib/css/cssom/CSSNumericSumValue.js +0 -5
  672. package/lib/css/cssom/CSSNumericValue.d.ts +0 -212
  673. package/lib/css/cssom/CSSNumericValue.js +0 -1685
  674. package/lib/css/cssom/CSSRGB.d.ts +0 -25
  675. package/lib/css/cssom/CSSRGB.js +0 -56
  676. package/lib/css/cssom/CSSStyleValue.d.ts +0 -53
  677. package/lib/css/cssom/CSSStyleValue.js +0 -634
  678. package/lib/css/cssom/CSSTransformComponent.d.ts +0 -22
  679. package/lib/css/cssom/CSSTransformComponent.js +0 -39
  680. package/lib/css/cssom/CSSTransformValue.d.ts +0 -30
  681. package/lib/css/cssom/CSSTransformValue.js +0 -56
  682. package/lib/css/cssom/CSSTranslate.d.ts +0 -15
  683. package/lib/css/cssom/CSSTranslate.js +0 -53
  684. package/lib/css/cssom/index.d.ts +0 -19
  685. package/lib/css/cssom/index.js +0 -148
  686. package/lib/css/cssom/types.d.ts +0 -86
  687. package/lib/css/cssom/types.js +0 -130
  688. package/lib/css/index.d.ts +0 -11
  689. package/lib/css/index.js +0 -109
  690. package/lib/css/interfaces.d.ts +0 -6
  691. package/lib/css/interfaces.js +0 -12
  692. package/lib/css/layout/FragmentResult.d.ts +0 -32
  693. package/lib/css/layout/FragmentResult.js +0 -51
  694. package/lib/css/layout/LayoutChildren.d.ts +0 -23
  695. package/lib/css/layout/LayoutChildren.js +0 -72
  696. package/lib/css/layout/LayoutContext.d.ts +0 -35
  697. package/lib/css/layout/LayoutContext.js +0 -49
  698. package/lib/css/layout/LayoutDefinition.d.ts +0 -20
  699. package/lib/css/layout/LayoutDefinition.js +0 -16
  700. package/lib/css/layout/LayoutEdges.d.ts +0 -24
  701. package/lib/css/layout/LayoutEdges.js +0 -56
  702. package/lib/css/layout/LayoutEngine.d.ts +0 -41
  703. package/lib/css/layout/LayoutEngine.js +0 -345
  704. package/lib/css/layout/LayoutFragment.d.ts +0 -26
  705. package/lib/css/layout/LayoutFragment.js +0 -44
  706. package/lib/css/layout/LayoutObject.d.ts +0 -46
  707. package/lib/css/layout/LayoutObject.js +0 -182
  708. package/lib/css/layout/LayoutRegistry.d.ts +0 -16
  709. package/lib/css/layout/LayoutRegistry.js +0 -87
  710. package/lib/css/layout/LayoutWorkTask.d.ts +0 -14
  711. package/lib/css/layout/LayoutWorkTask.js +0 -5
  712. package/lib/css/layout/index.d.ts +0 -11
  713. package/lib/css/layout/index.js +0 -148
  714. package/lib/css/layout/types.d.ts +0 -104
  715. package/lib/css/layout/types.js +0 -74
  716. package/lib/css/parser/color.d.ts +0 -6
  717. package/lib/css/parser/color.js +0 -260
  718. package/lib/css/parser/dimension.d.ts +0 -37
  719. package/lib/css/parser/dimension.js +0 -175
  720. package/lib/css/parser/filter.d.ts +0 -7
  721. package/lib/css/parser/filter.js +0 -56
  722. package/lib/css/parser/index.d.ts +0 -15
  723. package/lib/css/parser/index.js +0 -122
  724. package/lib/css/parser/numeric.d.ts +0 -19
  725. package/lib/css/parser/numeric.js +0 -81
  726. package/lib/css/parser/path.d.ts +0 -5
  727. package/lib/css/parser/path.js +0 -221
  728. package/lib/css/parser/points.d.ts +0 -12
  729. package/lib/css/parser/points.js +0 -69
  730. package/lib/css/parser/transform-origin.d.ts +0 -6
  731. package/lib/css/parser/transform-origin.js +0 -54
  732. package/lib/css/parser/transform.d.ts +0 -13
  733. package/lib/css/parser/transform.js +0 -303
  734. package/lib/css/parser/types.d.ts +0 -2
  735. package/lib/css/parser/types.js +0 -5
  736. package/lib/css/properties/CSSPropertyAnchor.d.ts +0 -8
  737. package/lib/css/properties/CSSPropertyAnchor.js +0 -35
  738. package/lib/css/properties/CSSPropertyClipPath.d.ts +0 -22
  739. package/lib/css/properties/CSSPropertyClipPath.js +0 -66
  740. package/lib/css/properties/CSSPropertyColor.d.ts +0 -14
  741. package/lib/css/properties/CSSPropertyColor.js +0 -40
  742. package/lib/css/properties/CSSPropertyFilter.d.ts +0 -6
  743. package/lib/css/properties/CSSPropertyFilter.js +0 -25
  744. package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -21
  745. package/lib/css/properties/CSSPropertyLengthOrPercentage.js +0 -85
  746. package/lib/css/properties/CSSPropertyLineDash.d.ts +0 -9
  747. package/lib/css/properties/CSSPropertyLineDash.js +0 -34
  748. package/lib/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
  749. package/lib/css/properties/CSSPropertyLocalPosition.js +0 -101
  750. package/lib/css/properties/CSSPropertyOffsetDistance.d.ts +0 -9
  751. package/lib/css/properties/CSSPropertyOffsetDistance.js +0 -44
  752. package/lib/css/properties/CSSPropertyOffsetPath.d.ts +0 -5
  753. package/lib/css/properties/CSSPropertyOffsetPath.js +0 -39
  754. package/lib/css/properties/CSSPropertyOpacity.d.ts +0 -10
  755. package/lib/css/properties/CSSPropertyOpacity.js +0 -29
  756. package/lib/css/properties/CSSPropertyPath.d.ts +0 -27
  757. package/lib/css/properties/CSSPropertyPath.js +0 -66
  758. package/lib/css/properties/CSSPropertyPoints.d.ts +0 -18
  759. package/lib/css/properties/CSSPropertyPoints.js +0 -36
  760. package/lib/css/properties/CSSPropertyShadowBlur.d.ts +0 -4
  761. package/lib/css/properties/CSSPropertyShadowBlur.js +0 -32
  762. package/lib/css/properties/CSSPropertyText.d.ts +0 -7
  763. package/lib/css/properties/CSSPropertyText.js +0 -39
  764. package/lib/css/properties/CSSPropertyTextTransform.d.ts +0 -5
  765. package/lib/css/properties/CSSPropertyTextTransform.js +0 -38
  766. package/lib/css/properties/CSSPropertyTransform.d.ts +0 -38
  767. package/lib/css/properties/CSSPropertyTransform.js +0 -138
  768. package/lib/css/properties/CSSPropertyTransformOrigin.d.ts +0 -11
  769. package/lib/css/properties/CSSPropertyTransformOrigin.js +0 -30
  770. package/lib/css/properties/CSSPropertyVisibility.d.ts +0 -13
  771. package/lib/css/properties/CSSPropertyVisibility.js +0 -32
  772. package/lib/css/properties/CSSPropertyZIndex.d.ts +0 -8
  773. package/lib/css/properties/CSSPropertyZIndex.js +0 -42
  774. package/lib/css/properties/index.d.ts +0 -18
  775. package/lib/css/properties/index.js +0 -239
  776. package/lib/display-objects/Circle.d.ts +0 -17
  777. package/lib/display-objects/Circle.js +0 -42
  778. package/lib/display-objects/CustomElement.d.ts +0 -22
  779. package/lib/display-objects/CustomElement.js +0 -100
  780. package/lib/display-objects/DisplayObject.d.ts +0 -274
  781. package/lib/display-objects/DisplayObject.js +0 -910
  782. package/lib/display-objects/Ellipse.d.ts +0 -19
  783. package/lib/display-objects/Ellipse.js +0 -43
  784. package/lib/display-objects/Group.d.ts +0 -29
  785. package/lib/display-objects/Group.js +0 -50
  786. package/lib/display-objects/HTML.d.ts +0 -41
  787. package/lib/display-objects/HTML.js +0 -111
  788. package/lib/display-objects/Image.d.ts +0 -23
  789. package/lib/display-objects/Image.js +0 -42
  790. package/lib/display-objects/Line.d.ts +0 -30
  791. package/lib/display-objects/Line.js +0 -75
  792. package/lib/display-objects/Path.d.ts +0 -48
  793. package/lib/display-objects/Path.js +0 -142
  794. package/lib/display-objects/Polygon.d.ts +0 -16
  795. package/lib/display-objects/Polygon.js +0 -39
  796. package/lib/display-objects/Polyline.d.ts +0 -21
  797. package/lib/display-objects/Polyline.js +0 -84
  798. package/lib/display-objects/Rect.d.ts +0 -21
  799. package/lib/display-objects/Rect.js +0 -42
  800. package/lib/display-objects/Text.d.ts +0 -91
  801. package/lib/display-objects/Text.js +0 -126
  802. package/lib/display-objects/index.d.ts +0 -13
  803. package/lib/display-objects/index.js +0 -174
  804. package/lib/dom/Animation.d.ts +0 -132
  805. package/lib/dom/Animation.js +0 -511
  806. package/lib/dom/AnimationEffectTiming.d.ts +0 -58
  807. package/lib/dom/AnimationEffectTiming.js +0 -75
  808. package/lib/dom/AnimationEvent.d.ts +0 -11
  809. package/lib/dom/AnimationEvent.js +0 -42
  810. package/lib/dom/AnimationTimeline.d.ts +0 -40
  811. package/lib/dom/AnimationTimeline.js +0 -228
  812. package/lib/dom/CustomElementRegistry.d.ts +0 -15
  813. package/lib/dom/CustomElementRegistry.js +0 -50
  814. package/lib/dom/CustomEvent.d.ts +0 -16
  815. package/lib/dom/CustomEvent.js +0 -42
  816. package/lib/dom/Document.d.ts +0 -72
  817. package/lib/dom/Document.js +0 -329
  818. package/lib/dom/Element.d.ts +0 -187
  819. package/lib/dom/Element.js +0 -619
  820. package/lib/dom/EventTarget.d.ts +0 -40
  821. package/lib/dom/EventTarget.js +0 -171
  822. package/lib/dom/FederatedEvent.d.ts +0 -145
  823. package/lib/dom/FederatedEvent.js +0 -229
  824. package/lib/dom/FederatedMouseEvent.d.ts +0 -52
  825. package/lib/dom/FederatedMouseEvent.js +0 -133
  826. package/lib/dom/FederatedPointerEvent.d.ts +0 -75
  827. package/lib/dom/FederatedPointerEvent.js +0 -69
  828. package/lib/dom/FederatedTouchEvent.d.ts +0 -15
  829. package/lib/dom/FederatedTouchEvent.js +0 -27
  830. package/lib/dom/FederatedWheelEvent.d.ts +0 -20
  831. package/lib/dom/FederatedWheelEvent.js +0 -35
  832. package/lib/dom/KeyframeEffect.d.ts +0 -47
  833. package/lib/dom/KeyframeEffect.js +0 -192
  834. package/lib/dom/KeyframeList.d.ts +0 -2
  835. package/lib/dom/KeyframeList.js +0 -183
  836. package/lib/dom/MutationEvent.d.ts +0 -15
  837. package/lib/dom/MutationEvent.js +0 -37
  838. package/lib/dom/MutationObserver.d.ts +0 -36
  839. package/lib/dom/MutationObserver.js +0 -426
  840. package/lib/dom/MutationRecord.d.ts +0 -14
  841. package/lib/dom/MutationRecord.js +0 -38
  842. package/lib/dom/Node.d.ts +0 -138
  843. package/lib/dom/Node.js +0 -397
  844. package/lib/dom/index.d.ts +0 -20
  845. package/lib/dom/index.js +0 -265
  846. package/lib/dom/interfaces.d.ts +0 -372
  847. package/lib/dom/interfaces.js +0 -64
  848. package/lib/global-module.d.ts +0 -1
  849. package/lib/global-module.js +0 -170
  850. package/lib/index.d.ts +0 -18
  851. package/lib/index.js +0 -198
  852. package/lib/plugins/CullingPlugin.d.ts +0 -17
  853. package/lib/plugins/CullingPlugin.js +0 -69
  854. package/lib/plugins/DirtyCheckPlugin.d.ts +0 -10
  855. package/lib/plugins/DirtyCheckPlugin.js +0 -63
  856. package/lib/plugins/EventPlugin.d.ts +0 -30
  857. package/lib/plugins/EventPlugin.js +0 -382
  858. package/lib/plugins/FrustumCullingStrategy.d.ts +0 -21
  859. package/lib/plugins/FrustumCullingStrategy.js +0 -121
  860. package/lib/plugins/PrepareRendererPlugin.d.ts +0 -7
  861. package/lib/plugins/PrepareRendererPlugin.js +0 -87
  862. package/lib/services/ContextService.d.ts +0 -13
  863. package/lib/services/ContextService.js +0 -15
  864. package/lib/services/EventService.d.ts +0 -73
  865. package/lib/services/EventService.js +0 -1263
  866. package/lib/services/OffscreenCanvasCreator.d.ts +0 -13
  867. package/lib/services/OffscreenCanvasCreator.js +0 -66
  868. package/lib/services/RenderingContext.d.ts +0 -26
  869. package/lib/services/RenderingContext.js +0 -24
  870. package/lib/services/RenderingService.d.ts +0 -102
  871. package/lib/services/RenderingService.js +0 -244
  872. package/lib/services/SceneGraphSelector.d.ts +0 -23
  873. package/lib/services/SceneGraphSelector.js +0 -114
  874. package/lib/services/SceneGraphService.d.ts +0 -153
  875. package/lib/services/SceneGraphService.js +0 -875
  876. package/lib/services/TextService.d.ts +0 -36
  877. package/lib/services/TextService.js +0 -359
  878. package/lib/services/aabb/CircleUpdater.d.ts +0 -8
  879. package/lib/services/aabb/CircleUpdater.js +0 -40
  880. package/lib/services/aabb/EllipseUpdater.d.ts +0 -8
  881. package/lib/services/aabb/EllipseUpdater.js +0 -41
  882. package/lib/services/aabb/LineUpdater.d.ts +0 -8
  883. package/lib/services/aabb/LineUpdater.js +0 -47
  884. package/lib/services/aabb/PathUpdater.d.ts +0 -8
  885. package/lib/services/aabb/PathUpdater.js +0 -179
  886. package/lib/services/aabb/PolylineUpdater.d.ts +0 -8
  887. package/lib/services/aabb/PolylineUpdater.js +0 -56
  888. package/lib/services/aabb/RectUpdater.d.ts +0 -8
  889. package/lib/services/aabb/RectUpdater.js +0 -84
  890. package/lib/services/aabb/TextUpdater.d.ts +0 -21
  891. package/lib/services/aabb/TextUpdater.js +0 -149
  892. package/lib/services/aabb/index.d.ts +0 -8
  893. package/lib/services/aabb/index.js +0 -84
  894. package/lib/services/aabb/interfaces.d.ts +0 -15
  895. package/lib/services/aabb/interfaces.js +0 -16
  896. package/lib/services/index.d.ts +0 -10
  897. package/lib/services/index.js +0 -122
  898. package/lib/shapes/AABB.d.ts +0 -35
  899. package/lib/shapes/AABB.js +0 -248
  900. package/lib/shapes/BoundingSphere.d.ts +0 -8
  901. package/lib/shapes/BoundingSphere.js +0 -41
  902. package/lib/shapes/Frustum.d.ts +0 -16
  903. package/lib/shapes/Frustum.js +0 -96
  904. package/lib/shapes/Plane.d.ts +0 -14
  905. package/lib/shapes/Plane.js +0 -51
  906. package/lib/shapes/Point.d.ts +0 -11
  907. package/lib/shapes/Point.js +0 -38
  908. package/lib/shapes/Ray.d.ts +0 -24
  909. package/lib/shapes/Ray.js +0 -169
  910. package/lib/shapes/Rectangle.d.ts +0 -12
  911. package/lib/shapes/Rectangle.js +0 -27
  912. package/lib/shapes/index.d.ts +0 -7
  913. package/lib/shapes/index.js +0 -96
  914. package/lib/types.d.ts +0 -289
  915. package/lib/types.js +0 -69
  916. package/lib/utils/animation.d.ts +0 -15
  917. package/lib/utils/animation.js +0 -275
  918. package/lib/utils/assert.d.ts +0 -9
  919. package/lib/utils/assert.js +0 -56
  920. package/lib/utils/bezier-easing.d.ts +0 -20
  921. package/lib/utils/bezier-easing.js +0 -128
  922. package/lib/utils/canvas.d.ts +0 -6
  923. package/lib/utils/canvas.js +0 -27
  924. package/lib/utils/custom-easing.d.ts +0 -64
  925. package/lib/utils/custom-easing.js +0 -392
  926. package/lib/utils/deferred.d.ts +0 -43
  927. package/lib/utils/deferred.js +0 -131
  928. package/lib/utils/dom.d.ts +0 -2
  929. package/lib/utils/dom.js +0 -17
  930. package/lib/utils/event.d.ts +0 -45
  931. package/lib/utils/event.js +0 -17
  932. package/lib/utils/index.d.ts +0 -10
  933. package/lib/utils/index.js +0 -135
  934. package/lib/utils/interpolation.d.ts +0 -4
  935. package/lib/utils/interpolation.js +0 -227
  936. package/lib/utils/math.d.ts +0 -29
  937. package/lib/utils/math.js +0 -273
  938. package/lib/utils/path.d.ts +0 -15
  939. package/lib/utils/path.js +0 -396
  940. package/lib/utils/string.d.ts +0 -2
  941. package/lib/utils/string.js +0 -27
  942. package/lib/utils/text.d.ts +0 -2
  943. package/lib/utils/text.js +0 -39
@@ -1,1232 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DefaultCamera = exports.CameraType = exports.CameraTrackingMode = exports.CameraProjectionMode = exports.CameraEvent = exports.Camera = void 0;
7
-
8
- var _tslib = require("tslib");
9
-
10
- var _manaSyringe = require("mana-syringe");
11
-
12
- var _eventemitter = require("eventemitter3");
13
-
14
- var _glMatrix = require("gl-matrix");
15
-
16
- var _shapes = require("../shapes");
17
-
18
- var _math = require("../utils/math");
19
-
20
- var _animation = require("../utils/animation");
21
-
22
- var _utils = require("../utils");
23
-
24
- // import { DisplayObject } from '../display-objects';
25
- var DefaultCamera = _manaSyringe.Syringe.defineToken('DefaultCamera');
26
-
27
- exports.DefaultCamera = DefaultCamera;
28
- var CameraType;
29
- exports.CameraType = CameraType;
30
-
31
- (function (CameraType) {
32
- /**
33
- * Performs all the rotational operations with the focal point instead of the camera position.
34
- * This type of camera is useful in applications(like CAD) where 3D objects are being designed or explored.
35
- * Camera cannot orbits over the north & south poles.
36
- * @see http://voxelent.com/tutorial-cameras/
37
- *
38
- * In Three.js it's used in OrbitControls.
39
- * @see https://threejs.org/docs/#examples/zh/controls/OrbitControls
40
- */
41
- CameraType[CameraType["ORBITING"] = 0] = "ORBITING";
42
- /**
43
- * It's similar to the ORBITING camera, but it allows the camera to orbit over the north or south poles.
44
- *
45
- * In Three.js it's used in OrbitControls.
46
- * @see https://threejs.org/docs/#examples/en/controls/TrackballControls
47
- */
48
-
49
- CameraType[CameraType["EXPLORING"] = 1] = "EXPLORING";
50
- /**
51
- * Performs all the rotational operations with the camera position.
52
- * It's useful in first person shooting games.
53
- * Camera cannot orbits over the north & south poles.
54
- *
55
- * In Three.js it's used in FirstPersonControls.
56
- * @see https://threejs.org/docs/#examples/en/controls/FirstPersonControls
57
- */
58
-
59
- CameraType[CameraType["TRACKING"] = 2] = "TRACKING";
60
- })(CameraType || (exports.CameraType = CameraType = {}));
61
- /**
62
- * CameraType must be TRACKING
63
- */
64
-
65
-
66
- var CameraTrackingMode;
67
- exports.CameraTrackingMode = CameraTrackingMode;
68
-
69
- (function (CameraTrackingMode) {
70
- CameraTrackingMode[CameraTrackingMode["DEFAULT"] = 0] = "DEFAULT";
71
- CameraTrackingMode[CameraTrackingMode["ROTATIONAL"] = 1] = "ROTATIONAL";
72
- CameraTrackingMode[CameraTrackingMode["TRANSLATIONAL"] = 2] = "TRANSLATIONAL";
73
- CameraTrackingMode[CameraTrackingMode["CINEMATIC"] = 3] = "CINEMATIC";
74
- })(CameraTrackingMode || (exports.CameraTrackingMode = CameraTrackingMode = {}));
75
-
76
- var CameraProjectionMode;
77
- exports.CameraProjectionMode = CameraProjectionMode;
78
-
79
- (function (CameraProjectionMode) {
80
- CameraProjectionMode[CameraProjectionMode["ORTHOGRAPHIC"] = 0] = "ORTHOGRAPHIC";
81
- CameraProjectionMode[CameraProjectionMode["PERSPECTIVE"] = 1] = "PERSPECTIVE";
82
- })(CameraProjectionMode || (exports.CameraProjectionMode = CameraProjectionMode = {}));
83
-
84
- var CameraEvent = {
85
- UPDATED: 'updated'
86
- };
87
- exports.CameraEvent = CameraEvent;
88
- var DEG_2_RAD = Math.PI / 180;
89
- var RAD_2_DEG = 180 / Math.PI;
90
- var MIN_DISTANCE = 0.0002;
91
- /**
92
- * 参考「WebGL Insights - 23.Designing Cameras for WebGL Applications」,基于 Responsible Camera 思路设计
93
- * @see https://github.com/d13g0/nucleo.js/blob/master/source/camera/Camera.js
94
- *
95
- * 保存相机参数,定义相机动作:
96
- * 1. dolly 沿 n 轴移动
97
- * 2. pan 沿 u v 轴移动
98
- * 3. rotate 以方位角旋转
99
- * 4. 移动到 Landmark,具有平滑的动画效果,其间禁止其他用户交互
100
- */
101
-
102
- var Camera =
103
- /** @class */
104
- function (_super) {
105
- (0, _tslib.__extends)(Camera, _super);
106
-
107
- function Camera(type, trackingMode) {
108
- if (type === void 0) {
109
- type = CameraType.EXPLORING;
110
- }
111
-
112
- if (trackingMode === void 0) {
113
- trackingMode = CameraTrackingMode.DEFAULT;
114
- }
115
-
116
- var _this = _super.call(this) || this;
117
- /**
118
- * 相机矩阵
119
- */
120
-
121
-
122
- _this.matrix = _glMatrix.mat4.create();
123
- /**
124
- * u 轴
125
- * @see http://learnwebgl.brown37.net/07_cameras/camera_introduction.html#a-camera-definition
126
- */
127
-
128
- _this.right = _glMatrix.vec3.fromValues(1, 0, 0);
129
- /**
130
- * v 轴 +Y is down
131
- */
132
-
133
- _this.up = _glMatrix.vec3.fromValues(0, 1, 0);
134
- /**
135
- * n 轴 +Z is inside
136
- */
137
-
138
- _this.forward = _glMatrix.vec3.fromValues(0, 0, 1);
139
- /**
140
- * 相机位置
141
- */
142
-
143
- _this.position = _glMatrix.vec3.fromValues(0, 0, 1);
144
- /**
145
- * 视点位置
146
- */
147
-
148
- _this.focalPoint = _glMatrix.vec3.fromValues(0, 0, 0);
149
- /**
150
- * 视点到相机位置的向量
151
- * focalPoint - position
152
- */
153
-
154
- _this.distanceVector = _glMatrix.vec3.fromValues(0, 0, -1);
155
- /**
156
- * 相机位置到视点距离
157
- * length(focalPoint - position)
158
- */
159
-
160
- _this.distance = 1;
161
- /**
162
- * @see https://en.wikipedia.org/wiki/Azimuth
163
- */
164
-
165
- _this.azimuth = 0;
166
- _this.elevation = 0;
167
- _this.roll = 0;
168
- _this.relAzimuth = 0;
169
- _this.relElevation = 0;
170
- _this.relRoll = 0;
171
- /**
172
- * 沿 n 轴移动时,保证移动速度从快到慢
173
- */
174
-
175
- _this.dollyingStep = 0;
176
- _this.maxDistance = Infinity;
177
- _this.minDistance = -Infinity;
178
- /**
179
- * zoom factor of the camera, default is 1
180
- * eg. https://threejs.org/docs/#api/en/cameras/OrthographicCamera.zoom
181
- */
182
-
183
- _this.zoom = 1;
184
- /**
185
- * invert the horizontal coordinate system HCS
186
- */
187
-
188
- _this.rotateWorld = false;
189
- /**
190
- * 投影矩阵参数
191
- */
192
-
193
- /**
194
- * field of view [0-360]
195
- * @see http://en.wikipedia.org/wiki/Angle_of_view
196
- */
197
-
198
- _this.fov = 30;
199
- _this.near = 0.1;
200
- _this.far = 1000;
201
- _this.aspect = 1;
202
- _this.projectionMatrix = _glMatrix.mat4.create();
203
- _this.projectionMatrixInverse = _glMatrix.mat4.create();
204
- _this.jitteredProjectionMatrix = undefined;
205
- _this.enableUpdate = true; // private following = undefined;
206
-
207
- _this.type = CameraType.EXPLORING;
208
- _this.trackingMode = CameraTrackingMode.DEFAULT;
209
- _this.projectionMode = CameraProjectionMode.PERSPECTIVE;
210
- /**
211
- * for culling use
212
- */
213
-
214
- _this.frustum = new _shapes.Frustum();
215
- /**
216
- * switch between multiple landmarks
217
- */
218
-
219
- _this.landmarks = [];
220
- /**
221
- * ortho matrix for Canvas2D & SVG
222
- */
223
-
224
- _this.orthoMatrix = _glMatrix.mat4.create();
225
-
226
- _this.setType(type, trackingMode);
227
-
228
- return _this;
229
- }
230
-
231
- Camera.prototype.isOrtho = function () {
232
- return this.projectionMode === CameraProjectionMode.ORTHOGRAPHIC;
233
- };
234
-
235
- Camera.prototype.getProjectionMode = function () {
236
- return this.projectionMode;
237
- };
238
-
239
- Camera.prototype.getPerspective = function () {
240
- // account for TAA
241
- return this.jitteredProjectionMatrix || this.projectionMatrix;
242
- };
243
-
244
- Camera.prototype.getPerspectiveInverse = function () {
245
- return this.projectionMatrixInverse;
246
- };
247
-
248
- Camera.prototype.getFrustum = function () {
249
- return this.frustum;
250
- };
251
-
252
- Camera.prototype.getPosition = function () {
253
- return this.position;
254
- };
255
-
256
- Camera.prototype.getFocalPoint = function () {
257
- return this.focalPoint;
258
- };
259
-
260
- Camera.prototype.getDollyingStep = function () {
261
- return this.dollyingStep;
262
- };
263
-
264
- Camera.prototype.getNear = function () {
265
- return this.near;
266
- };
267
-
268
- Camera.prototype.getFar = function () {
269
- return this.far;
270
- };
271
-
272
- Camera.prototype.getZoom = function () {
273
- return this.zoom;
274
- };
275
-
276
- Camera.prototype.getOrthoMatrix = function () {
277
- return this.orthoMatrix;
278
- };
279
-
280
- Camera.prototype.getView = function () {
281
- return this.view;
282
- };
283
-
284
- Camera.prototype.setEnableUpdate = function (enabled) {
285
- this.enableUpdate = enabled;
286
- };
287
-
288
- Camera.prototype.setType = function (type, trackingMode) {
289
- this.type = type;
290
-
291
- if (this.type === CameraType.EXPLORING) {
292
- this.setWorldRotation(true);
293
- } else {
294
- this.setWorldRotation(false);
295
- }
296
-
297
- this._getAngles();
298
-
299
- if (this.type === CameraType.TRACKING && trackingMode !== undefined) {
300
- this.setTrackingMode(trackingMode);
301
- }
302
-
303
- return this;
304
- };
305
-
306
- Camera.prototype.setProjectionMode = function (projectionMode) {
307
- this.projectionMode = projectionMode;
308
- return this;
309
- };
310
-
311
- Camera.prototype.setTrackingMode = function (trackingMode) {
312
- if (this.type !== CameraType.TRACKING) {
313
- throw new Error('Impossible to set a tracking mode if the camera is not of tracking type');
314
- }
315
-
316
- this.trackingMode = trackingMode;
317
- return this;
318
- };
319
- /**
320
- * If flag is true, it reverses the azimuth and elevation angles.
321
- * Subsequent calls to rotate, setAzimuth, setElevation,
322
- * changeAzimuth or changeElevation will cause the inverted effect.
323
- * setRoll or changeRoll is not affected by this method.
324
- *
325
- * This inversion is useful when one wants to simulate that the world
326
- * is moving, instead of the camera.
327
- *
328
- * By default the camera angles are not reversed.
329
- * @param {Boolean} flag the boolean flag to reverse the angles.
330
- */
331
-
332
-
333
- Camera.prototype.setWorldRotation = function (flag) {
334
- this.rotateWorld = flag;
335
-
336
- this._getAngles();
337
-
338
- return this;
339
- };
340
- /**
341
- * 计算 MV 矩阵,为相机矩阵的逆矩阵
342
- */
343
-
344
-
345
- Camera.prototype.getViewTransform = function () {
346
- return _glMatrix.mat4.invert(_glMatrix.mat4.create(), this.matrix);
347
- };
348
-
349
- Camera.prototype.getWorldTransform = function () {
350
- return this.matrix;
351
- };
352
-
353
- Camera.prototype.jitterProjectionMatrix = function (x, y) {
354
- var translation = _glMatrix.mat4.fromTranslation(_glMatrix.mat4.create(), [x, y, 0]);
355
-
356
- this.jitteredProjectionMatrix = _glMatrix.mat4.multiply(_glMatrix.mat4.create(), translation, this.projectionMatrix);
357
- };
358
-
359
- Camera.prototype.clearJitterProjectionMatrix = function () {
360
- this.jitteredProjectionMatrix = undefined;
361
- };
362
- /**
363
- * 设置相机矩阵
364
- */
365
-
366
-
367
- Camera.prototype.setMatrix = function (matrix) {
368
- this.matrix = matrix;
369
-
370
- this._update();
371
-
372
- return this;
373
- };
374
-
375
- Camera.prototype.setFov = function (fov) {
376
- this.setPerspective(this.near, this.far, fov, this.aspect);
377
- return this;
378
- };
379
-
380
- Camera.prototype.setAspect = function (aspect) {
381
- this.setPerspective(this.near, this.far, this.fov, aspect);
382
- return this;
383
- };
384
-
385
- Camera.prototype.setNear = function (near) {
386
- if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
387
- this.setPerspective(near, this.far, this.fov, this.aspect);
388
- } else {
389
- this.setOrthographic(this.left, this.rright, this.top, this.bottom, near, this.far);
390
- }
391
-
392
- return this;
393
- };
394
-
395
- Camera.prototype.setFar = function (far) {
396
- if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
397
- this.setPerspective(this.near, far, this.fov, this.aspect);
398
- } else {
399
- this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, far);
400
- }
401
-
402
- return this;
403
- };
404
- /**
405
- * Sets an offset in a larger frustum, used in PixelPicking
406
- */
407
-
408
-
409
- Camera.prototype.setViewOffset = function (fullWidth, fullHeight, x, y, width, height) {
410
- this.aspect = fullWidth / fullHeight;
411
-
412
- if (this.view === undefined) {
413
- this.view = {
414
- enabled: true,
415
- fullWidth: 1,
416
- fullHeight: 1,
417
- offsetX: 0,
418
- offsetY: 0,
419
- width: 1,
420
- height: 1
421
- };
422
- }
423
-
424
- this.view.enabled = true;
425
- this.view.fullWidth = fullWidth;
426
- this.view.fullHeight = fullHeight;
427
- this.view.offsetX = x;
428
- this.view.offsetY = y;
429
- this.view.width = width;
430
- this.view.height = height;
431
-
432
- if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
433
- this.setPerspective(this.near, this.far, this.fov, this.aspect);
434
- } else {
435
- this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);
436
- }
437
-
438
- return this;
439
- };
440
-
441
- Camera.prototype.clearViewOffset = function () {
442
- if (this.view !== undefined) {
443
- this.view.enabled = false;
444
- }
445
-
446
- if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
447
- this.setPerspective(this.near, this.far, this.fov, this.aspect);
448
- } else {
449
- this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);
450
- }
451
-
452
- return this;
453
- };
454
-
455
- Camera.prototype.setZoom = function (zoom) {
456
- this.zoom = zoom;
457
-
458
- if (this.projectionMode === CameraProjectionMode.ORTHOGRAPHIC) {
459
- this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);
460
- } else if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
461
- this.setPerspective(this.near, this.far, this.fov, this.aspect);
462
- }
463
-
464
- return this;
465
- };
466
-
467
- Camera.prototype.setPerspective = function (near, far, fov, aspect) {
468
- var _a;
469
-
470
- this.projectionMode = CameraProjectionMode.PERSPECTIVE;
471
- this.fov = fov;
472
- this.near = near;
473
- this.far = far;
474
- this.aspect = aspect;
475
- var top = this.near * Math.tan(DEG_2_RAD * 0.5 * this.fov) / this.zoom;
476
- var height = 2 * top;
477
- var width = this.aspect * height;
478
- var left = -0.5 * width;
479
-
480
- if ((_a = this.view) === null || _a === void 0 ? void 0 : _a.enabled) {
481
- var fullWidth = this.view.fullWidth;
482
- var fullHeight = this.view.fullHeight;
483
- left += this.view.offsetX * width / fullWidth;
484
- top -= this.view.offsetY * height / fullHeight;
485
- width *= this.view.width / fullWidth;
486
- height *= this.view.height / fullHeight;
487
- }
488
-
489
- (0, _math.makePerspective)(this.projectionMatrix, left, left + width, top, top - height, near, this.far); // flipY since the origin of OpenGL/WebGL is bottom-left compared with top-left in Canvas2D
490
-
491
- _glMatrix.mat4.scale(this.projectionMatrix, this.projectionMatrix, _glMatrix.vec3.fromValues(1, -1, 1));
492
-
493
- _glMatrix.mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);
494
-
495
- this.triggerUpdate();
496
- return this;
497
- };
498
-
499
- Camera.prototype.setOrthographic = function (l, r, t, b, near, far) {
500
- var _a;
501
-
502
- this.projectionMode = CameraProjectionMode.ORTHOGRAPHIC;
503
- this.rright = r;
504
- this.left = l;
505
- this.top = t;
506
- this.bottom = b;
507
- this.near = near;
508
- this.far = far;
509
- var dx = (this.rright - this.left) / (2 * this.zoom);
510
- var dy = (this.top - this.bottom) / (2 * this.zoom);
511
- var cx = (this.rright + this.left) / 2;
512
- var cy = (this.top + this.bottom) / 2;
513
- var left = cx - dx;
514
- var right = cx + dx;
515
- var top = cy + dy;
516
- var bottom = cy - dy;
517
-
518
- if ((_a = this.view) === null || _a === void 0 ? void 0 : _a.enabled) {
519
- var scaleW = (this.rright - this.left) / this.view.fullWidth / this.zoom;
520
- var scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom;
521
- left += scaleW * this.view.offsetX;
522
- right = left + scaleW * this.view.width;
523
- top -= scaleH * this.view.offsetY;
524
- bottom = top - scaleH * this.view.height;
525
- }
526
-
527
- _glMatrix.mat4.ortho(this.projectionMatrix, left, right, bottom, top, near, far); // flipY since the origin of OpenGL/WebGL is bottom-left compared with top-left in Canvas2D
528
-
529
-
530
- _glMatrix.mat4.scale(this.projectionMatrix, this.projectionMatrix, _glMatrix.vec3.fromValues(1, -1, 1));
531
-
532
- _glMatrix.mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);
533
-
534
- this._getOrthoMatrix();
535
-
536
- this.triggerUpdate();
537
- return this;
538
- };
539
- /**
540
- * Move the camera in world coordinates.
541
- * It will keep looking at the current focal point.
542
- *
543
- * support scalars or vectors.
544
- * @example
545
- * setPosition(1, 2, 3);
546
- * setPosition([1, 2, 3]);
547
- */
548
-
549
-
550
- Camera.prototype.setPosition = function (x, y, z) {
551
- if (y === void 0) {
552
- y = this.position[1];
553
- }
554
-
555
- if (z === void 0) {
556
- z = this.position[2];
557
- }
558
-
559
- var position = (0, _math.createVec3)(x, y, z);
560
-
561
- this._setPosition(position);
562
-
563
- this.setFocalPoint(this.focalPoint);
564
- this.triggerUpdate();
565
- return this;
566
- };
567
- /**
568
- * Sets the focal point of this camera in world coordinates.
569
- *
570
- * support scalars or vectors.
571
- * @example
572
- * setFocalPoint(1, 2, 3);
573
- * setFocalPoint([1, 2, 3]);
574
- */
575
-
576
-
577
- Camera.prototype.setFocalPoint = function (x, y, z) {
578
- if (y === void 0) {
579
- y = this.focalPoint[1];
580
- }
581
-
582
- if (z === void 0) {
583
- z = this.focalPoint[2];
584
- }
585
-
586
- var up = _glMatrix.vec3.fromValues(0, 1, 0);
587
-
588
- this.focalPoint = (0, _math.createVec3)(x, y, z);
589
-
590
- if (this.trackingMode === CameraTrackingMode.CINEMATIC) {
591
- var d = _glMatrix.vec3.subtract(_glMatrix.vec3.create(), this.focalPoint, this.position);
592
-
593
- x = d[0];
594
- y = d[1];
595
- z = d[2];
596
-
597
- var r = _glMatrix.vec3.length(d);
598
-
599
- var el = Math.asin(y / r) * RAD_2_DEG;
600
- var az = 90 + Math.atan2(z, x) * RAD_2_DEG;
601
-
602
- var m = _glMatrix.mat4.create();
603
-
604
- _glMatrix.mat4.rotateY(m, m, az * DEG_2_RAD);
605
-
606
- _glMatrix.mat4.rotateX(m, m, el * DEG_2_RAD);
607
-
608
- up = _glMatrix.vec3.transformMat4(_glMatrix.vec3.create(), [0, 1, 0], m);
609
- }
610
-
611
- _glMatrix.mat4.invert(this.matrix, _glMatrix.mat4.lookAt(_glMatrix.mat4.create(), this.position, this.focalPoint, up));
612
-
613
- this._getAxes();
614
-
615
- this._getDistance();
616
-
617
- this._getAngles();
618
-
619
- this.triggerUpdate();
620
- return this;
621
- };
622
-
623
- Camera.prototype.getDistance = function () {
624
- return this.distance;
625
- };
626
- /**
627
- * Moves the camera towards/from the focal point.
628
- */
629
-
630
-
631
- Camera.prototype.setDistance = function (d) {
632
- if (this.distance === d || d < 0) {
633
- return this;
634
- }
635
-
636
- this.distance = d;
637
-
638
- if (this.distance < MIN_DISTANCE) {
639
- this.distance = MIN_DISTANCE;
640
- }
641
-
642
- this.dollyingStep = this.distance / 100;
643
-
644
- var pos = _glMatrix.vec3.create();
645
-
646
- d = this.distance;
647
- var n = this.forward;
648
- var f = this.focalPoint;
649
- pos[0] = d * n[0] + f[0];
650
- pos[1] = d * n[1] + f[1];
651
- pos[2] = d * n[2] + f[2];
652
-
653
- this._setPosition(pos);
654
-
655
- this.triggerUpdate();
656
- return this;
657
- };
658
-
659
- Camera.prototype.setMaxDistance = function (d) {
660
- this.maxDistance = d;
661
- return this;
662
- };
663
-
664
- Camera.prototype.setMinDistance = function (d) {
665
- this.minDistance = d;
666
- return this;
667
- }; // /**
668
- // * Changes the initial azimuth of the camera
669
- // */
670
- // changeAzimuth(az: number) {
671
- // this.setAzimuth(this.azimuth + az);
672
- // this.triggerUpdate();
673
- // return this;
674
- // }
675
- // /**
676
- // * Changes the initial elevation of the camera
677
- // */
678
- // changeElevation(el: number) {
679
- // this.setElevation(this.elevation + el);
680
- // this.triggerUpdate();
681
- // return this;
682
- // }
683
- // /**
684
- // * Changes the initial roll of the camera
685
- // */
686
- // changeRoll(rl: number) {
687
- // this.setRoll(this.roll + rl);
688
- // this.triggerUpdate();
689
- // return this;
690
- // }
691
-
692
- /**
693
- * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
694
- * the azimuth in degrees
695
- */
696
-
697
-
698
- Camera.prototype.setAzimuth = function (az) {
699
- this.azimuth = (0, _math.getAngle)(az);
700
- this.computeMatrix();
701
-
702
- this._getAxes();
703
-
704
- if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
705
- this._getPosition();
706
- } else if (this.type === CameraType.TRACKING) {
707
- this._getFocalPoint();
708
- }
709
-
710
- this.triggerUpdate();
711
- return this;
712
- };
713
-
714
- Camera.prototype.getAzimuth = function () {
715
- return this.azimuth;
716
- };
717
- /**
718
- * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
719
- */
720
-
721
-
722
- Camera.prototype.setElevation = function (el) {
723
- this.elevation = (0, _math.getAngle)(el);
724
- this.computeMatrix();
725
-
726
- this._getAxes();
727
-
728
- if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
729
- this._getPosition();
730
- } else if (this.type === CameraType.TRACKING) {
731
- this._getFocalPoint();
732
- }
733
-
734
- this.triggerUpdate();
735
- return this;
736
- };
737
-
738
- Camera.prototype.getElevation = function () {
739
- return this.elevation;
740
- };
741
- /**
742
- * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
743
- */
744
-
745
-
746
- Camera.prototype.setRoll = function (angle) {
747
- this.roll = (0, _math.getAngle)(angle);
748
- this.computeMatrix();
749
-
750
- this._getAxes();
751
-
752
- if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
753
- this._getPosition();
754
- } else if (this.type === CameraType.TRACKING) {
755
- this._getFocalPoint();
756
- }
757
-
758
- this.triggerUpdate();
759
- return this;
760
- };
761
-
762
- Camera.prototype.getRoll = function () {
763
- return this.roll;
764
- };
765
- /**
766
- * Changes the azimuth and elevation with respect to the current camera axes
767
- * @param {Number} azimuth the relative azimuth
768
- * @param {Number} elevation the relative elevation
769
- * @param {Number} roll the relative roll
770
- */
771
-
772
-
773
- Camera.prototype.rotate = function (azimuth, elevation, roll) {
774
- this.relElevation = (0, _math.getAngle)(elevation);
775
- this.relAzimuth = (0, _math.getAngle)(azimuth);
776
- this.relRoll = (0, _math.getAngle)(roll);
777
- this.elevation += this.relElevation;
778
- this.azimuth += this.relAzimuth;
779
- this.roll += this.relRoll;
780
-
781
- if (this.type === CameraType.EXPLORING) {
782
- var rotX = _glMatrix.quat.setAxisAngle(_glMatrix.quat.create(), [1, 0, 0], (this.rotateWorld ? 1 : -1) * this.relElevation * DEG_2_RAD);
783
-
784
- var rotY = _glMatrix.quat.setAxisAngle(_glMatrix.quat.create(), [0, 1, 0], (this.rotateWorld ? 1 : -1) * this.relAzimuth * DEG_2_RAD);
785
-
786
- var rotZ = _glMatrix.quat.setAxisAngle(_glMatrix.quat.create(), [0, 0, 1], this.relRoll * DEG_2_RAD);
787
-
788
- var rotQ = _glMatrix.quat.multiply(_glMatrix.quat.create(), rotY, rotX);
789
-
790
- rotQ = _glMatrix.quat.multiply(_glMatrix.quat.create(), rotQ, rotZ);
791
-
792
- var rotMatrix = _glMatrix.mat4.fromQuat(_glMatrix.mat4.create(), rotQ);
793
-
794
- _glMatrix.mat4.translate(this.matrix, this.matrix, [0, 0, -this.distance]);
795
-
796
- _glMatrix.mat4.multiply(this.matrix, this.matrix, rotMatrix);
797
-
798
- _glMatrix.mat4.translate(this.matrix, this.matrix, [0, 0, this.distance]);
799
- } else {
800
- if (Math.abs(this.elevation) > 90) {
801
- return this;
802
- }
803
-
804
- this.computeMatrix();
805
- }
806
-
807
- this._getAxes();
808
-
809
- if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
810
- this._getPosition();
811
- } else if (this.type === CameraType.TRACKING) {
812
- this._getFocalPoint();
813
- }
814
-
815
- this._update();
816
-
817
- return this;
818
- };
819
- /**
820
- * 沿水平(right) & 垂直(up)平移相机
821
- */
822
-
823
-
824
- Camera.prototype.pan = function (tx, ty) {
825
- var coords = (0, _math.createVec3)(tx, ty, 0);
826
-
827
- var pos = _glMatrix.vec3.clone(this.position);
828
-
829
- _glMatrix.vec3.add(pos, pos, _glMatrix.vec3.scale(_glMatrix.vec3.create(), this.right, coords[0]));
830
-
831
- _glMatrix.vec3.add(pos, pos, _glMatrix.vec3.scale(_glMatrix.vec3.create(), this.up, coords[1]));
832
-
833
- this._setPosition(pos);
834
-
835
- this.triggerUpdate();
836
- return this;
837
- };
838
- /**
839
- * 沿 n 轴移动,当距离视点远时移动速度较快,离视点越近速度越慢
840
- */
841
-
842
-
843
- Camera.prototype.dolly = function (value) {
844
- var n = this.forward;
845
-
846
- var pos = _glMatrix.vec3.clone(this.position);
847
-
848
- var step = value * this.dollyingStep;
849
- var updatedDistance = this.distance + value * this.dollyingStep; // 限制视点距离范围
850
-
851
- step = Math.max(Math.min(updatedDistance, this.maxDistance), this.minDistance) - this.distance;
852
- pos[0] += step * n[0];
853
- pos[1] += step * n[1];
854
- pos[2] += step * n[2];
855
-
856
- this._setPosition(pos);
857
-
858
- if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
859
- // 重新计算视点距离
860
- this._getDistance();
861
- } else if (this.type === CameraType.TRACKING) {
862
- // 保持视距,移动视点位置
863
- _glMatrix.vec3.add(this.focalPoint, pos, this.distanceVector);
864
- }
865
-
866
- this.triggerUpdate();
867
- return this;
868
- };
869
-
870
- Camera.prototype.createLandmark = function (name, params) {
871
- if (params === void 0) {
872
- params = {};
873
- }
874
-
875
- var _a = params.position,
876
- position = _a === void 0 ? this.position : _a,
877
- _b = params.focalPoint,
878
- focalPoint = _b === void 0 ? this.focalPoint : _b,
879
- roll = params.roll,
880
- zoom = params.zoom;
881
- var camera = new Camera();
882
- camera.setType(this.type, undefined);
883
- camera.setPosition(position[0], position[1] || this.position[1], position[2] || this.position[2]);
884
- camera.setFocalPoint(focalPoint[0], focalPoint[1] || this.focalPoint[1], focalPoint[2] || this.focalPoint[2]);
885
- camera.setRoll(roll || this.roll);
886
- camera.setZoom(zoom || this.zoom);
887
- var landmark = {
888
- name: name,
889
- matrix: _glMatrix.mat4.clone(camera.matrix),
890
- right: _glMatrix.vec3.clone(camera.right),
891
- up: _glMatrix.vec3.clone(camera.up),
892
- forward: _glMatrix.vec3.clone(camera.forward),
893
- position: _glMatrix.vec3.clone(camera.position),
894
- focalPoint: _glMatrix.vec3.clone(camera.focalPoint),
895
- distanceVector: _glMatrix.vec3.clone(camera.distanceVector),
896
- distance: camera.distance,
897
- dollyingStep: camera.dollyingStep,
898
- azimuth: camera.azimuth,
899
- elevation: camera.elevation,
900
- roll: camera.roll,
901
- relAzimuth: camera.relAzimuth,
902
- relElevation: camera.relElevation,
903
- relRoll: camera.relRoll,
904
- zoom: camera.zoom
905
- };
906
- this.landmarks.push(landmark);
907
- return landmark;
908
- };
909
-
910
- Camera.prototype.gotoLandmark = function (name, options) {
911
- var _this = this;
912
-
913
- if (options === void 0) {
914
- options = {};
915
- }
916
-
917
- var landmark = (0, _utils.isString)(name) ? this.landmarks.find(function (l) {
918
- return l.name === name;
919
- }) : name;
920
-
921
- if (landmark) {
922
- var _a = (0, _utils.isNumber)(options) ? {
923
- duration: options
924
- } : options,
925
- _b = _a.easing,
926
- easing = _b === void 0 ? 'linear' : _b,
927
- _c = _a.duration,
928
- duration_1 = _c === void 0 ? 100 : _c,
929
- _d = _a.easingFunction,
930
- easingFunction = _d === void 0 ? undefined : _d,
931
- _e = _a.onfinish,
932
- onfinish_1 = _e === void 0 ? undefined : _e;
933
-
934
- var epsilon_1 = 0.01;
935
-
936
- if (duration_1 === 0) {
937
- this.syncFromLandmark(landmark);
938
-
939
- if (onfinish_1) {
940
- onfinish_1();
941
- }
942
-
943
- return;
944
- } // cancel ongoing animation
945
-
946
-
947
- if (this.landmarkAnimationID !== undefined) {
948
- this.canvas.cancelAnimationFrame(this.landmarkAnimationID);
949
- }
950
-
951
- var destPosition_1 = landmark.position;
952
- var destFocalPoint_1 = landmark.focalPoint;
953
- var destZoom_1 = landmark.zoom;
954
- var destRoll_1 = landmark.roll;
955
- var easingFunc_1 = easingFunction || (0, _animation.parseEasingFunction)(easing);
956
- var timeStart_1;
957
-
958
- var endAnimation_1 = function endAnimation_1() {
959
- _this.setFocalPoint(destFocalPoint_1);
960
-
961
- _this.setPosition(destPosition_1);
962
-
963
- _this.setRoll(destRoll_1);
964
-
965
- _this.setZoom(destZoom_1);
966
-
967
- _this.computeMatrix();
968
-
969
- _this.triggerUpdate();
970
-
971
- if (onfinish_1) {
972
- onfinish_1();
973
- }
974
- };
975
-
976
- var animate_1 = function animate_1(timestamp) {
977
- if (timeStart_1 === undefined) {
978
- timeStart_1 = timestamp;
979
- }
980
-
981
- var elapsed = timestamp - timeStart_1;
982
-
983
- if (elapsed > duration_1) {
984
- endAnimation_1();
985
- return;
986
- } // use the same ease function in animation system
987
-
988
-
989
- var t = easingFunc_1(elapsed / duration_1);
990
-
991
- var interFocalPoint = _glMatrix.vec3.create();
992
-
993
- var interPosition = _glMatrix.vec3.create();
994
-
995
- var interZoom = 1;
996
- var interRoll = 0;
997
-
998
- _glMatrix.vec3.lerp(interFocalPoint, _this.focalPoint, destFocalPoint_1, t);
999
-
1000
- _glMatrix.vec3.lerp(interPosition, _this.position, destPosition_1, t);
1001
-
1002
- interRoll = _this.roll * (1 - t) + destRoll_1 * t;
1003
- interZoom = _this.zoom * (1 - t) + destZoom_1 * t;
1004
-
1005
- _this.setFocalPoint(interFocalPoint);
1006
-
1007
- _this.setPosition(interPosition);
1008
-
1009
- _this.setRoll(interRoll);
1010
-
1011
- _this.setZoom(interZoom);
1012
-
1013
- var dist = _glMatrix.vec3.dist(interFocalPoint, destFocalPoint_1) + _glMatrix.vec3.dist(interPosition, destPosition_1);
1014
-
1015
- if (dist <= epsilon_1) {
1016
- endAnimation_1();
1017
- return;
1018
- }
1019
-
1020
- _this.computeMatrix();
1021
-
1022
- _this.triggerUpdate();
1023
-
1024
- if (elapsed < duration_1) {
1025
- _this.landmarkAnimationID = _this.canvas.requestAnimationFrame(animate_1);
1026
- }
1027
- };
1028
-
1029
- this.canvas.requestAnimationFrame(animate_1);
1030
- }
1031
- };
1032
- /**
1033
- * 根据相机矩阵重新计算各种相机参数
1034
- */
1035
-
1036
-
1037
- Camera.prototype._update = function () {
1038
- this._getAxes();
1039
-
1040
- this._getPosition();
1041
-
1042
- this._getDistance();
1043
-
1044
- this._getAngles();
1045
-
1046
- this._getOrthoMatrix();
1047
-
1048
- this.triggerUpdate();
1049
- };
1050
- /**
1051
- * 计算相机矩阵
1052
- */
1053
-
1054
-
1055
- Camera.prototype.computeMatrix = function () {
1056
- // 使用四元数描述 3D 旋转
1057
- // @see https://xiaoiver.github.io/coding/2018/12/28/Camera-%E8%AE%BE%E8%AE%A1-%E4%B8%80.html
1058
- var rotZ = _glMatrix.quat.setAxisAngle(_glMatrix.quat.create(), [0, 0, 1], this.roll * DEG_2_RAD);
1059
-
1060
- _glMatrix.mat4.identity(this.matrix); // only consider HCS for EXPLORING and ORBITING cameras
1061
-
1062
-
1063
- var rotX = _glMatrix.quat.setAxisAngle(_glMatrix.quat.create(), [1, 0, 0], (this.rotateWorld && this.type !== CameraType.TRACKING || this.type === CameraType.TRACKING ? 1 : -1) * this.elevation * DEG_2_RAD);
1064
-
1065
- var rotY = _glMatrix.quat.setAxisAngle(_glMatrix.quat.create(), [0, 1, 0], (this.rotateWorld && this.type !== CameraType.TRACKING || this.type === CameraType.TRACKING ? 1 : -1) * this.azimuth * DEG_2_RAD);
1066
-
1067
- var rotQ = _glMatrix.quat.multiply(_glMatrix.quat.create(), rotY, rotX);
1068
-
1069
- rotQ = _glMatrix.quat.multiply(_glMatrix.quat.create(), rotQ, rotZ);
1070
-
1071
- var rotMatrix = _glMatrix.mat4.fromQuat(_glMatrix.mat4.create(), rotQ);
1072
-
1073
- if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
1074
- _glMatrix.mat4.translate(this.matrix, this.matrix, this.focalPoint);
1075
-
1076
- _glMatrix.mat4.multiply(this.matrix, this.matrix, rotMatrix);
1077
-
1078
- _glMatrix.mat4.translate(this.matrix, this.matrix, [0, 0, this.distance]);
1079
- } else if (this.type === CameraType.TRACKING) {
1080
- _glMatrix.mat4.translate(this.matrix, this.matrix, this.position);
1081
-
1082
- _glMatrix.mat4.multiply(this.matrix, this.matrix, rotMatrix);
1083
- }
1084
- };
1085
- /**
1086
- * Sets the camera position in the camera matrix
1087
- */
1088
-
1089
-
1090
- Camera.prototype._setPosition = function (x, y, z) {
1091
- this.position = (0, _math.createVec3)(x, y, z);
1092
- var m = this.matrix;
1093
- m[12] = this.position[0];
1094
- m[13] = this.position[1];
1095
- m[14] = this.position[2];
1096
- m[15] = 1;
1097
-
1098
- this._getOrthoMatrix();
1099
- };
1100
- /**
1101
- * Recalculates axes based on the current matrix
1102
- */
1103
-
1104
-
1105
- Camera.prototype._getAxes = function () {
1106
- _glMatrix.vec3.copy(this.right, (0, _math.createVec3)(_glMatrix.vec4.transformMat4(_glMatrix.vec4.create(), [1, 0, 0, 0], this.matrix)));
1107
-
1108
- _glMatrix.vec3.copy(this.up, (0, _math.createVec3)(_glMatrix.vec4.transformMat4(_glMatrix.vec4.create(), [0, 1, 0, 0], this.matrix)));
1109
-
1110
- _glMatrix.vec3.copy(this.forward, (0, _math.createVec3)(_glMatrix.vec4.transformMat4(_glMatrix.vec4.create(), [0, 0, 1, 0], this.matrix)));
1111
-
1112
- _glMatrix.vec3.normalize(this.right, this.right);
1113
-
1114
- _glMatrix.vec3.normalize(this.up, this.up);
1115
-
1116
- _glMatrix.vec3.normalize(this.forward, this.forward);
1117
- };
1118
- /**
1119
- * Recalculates euler angles based on the current state
1120
- */
1121
-
1122
-
1123
- Camera.prototype._getAngles = function () {
1124
- // Recalculates angles
1125
- var x = this.distanceVector[0];
1126
- var y = this.distanceVector[1];
1127
- var z = this.distanceVector[2];
1128
-
1129
- var r = _glMatrix.vec3.length(this.distanceVector); // FAST FAIL: If there is no distance we cannot compute angles
1130
-
1131
-
1132
- if (r === 0) {
1133
- this.elevation = 0;
1134
- this.azimuth = 0;
1135
- return;
1136
- }
1137
-
1138
- if (this.type === CameraType.TRACKING) {
1139
- this.elevation = Math.asin(y / r) * RAD_2_DEG;
1140
- this.azimuth = Math.atan2(-x, -z) * RAD_2_DEG;
1141
- } else {
1142
- if (this.rotateWorld) {
1143
- this.elevation = Math.asin(y / r) * RAD_2_DEG;
1144
- this.azimuth = Math.atan2(-x, -z) * RAD_2_DEG;
1145
- } else {
1146
- this.elevation = -Math.asin(y / r) * RAD_2_DEG;
1147
- this.azimuth = -Math.atan2(-x, -z) * RAD_2_DEG;
1148
- }
1149
- }
1150
- };
1151
- /**
1152
- * 重新计算相机位置,只有 ORBITING 模式相机位置才会发生变化
1153
- */
1154
-
1155
-
1156
- Camera.prototype._getPosition = function () {
1157
- _glMatrix.vec3.copy(this.position, (0, _math.createVec3)(_glMatrix.vec4.transformMat4(_glMatrix.vec4.create(), [0, 0, 0, 1], this.matrix))); // 相机位置变化,需要重新计算视距
1158
-
1159
-
1160
- this._getDistance();
1161
- };
1162
- /**
1163
- * 重新计算视点,只有 TRACKING 模式视点才会发生变化
1164
- */
1165
-
1166
-
1167
- Camera.prototype._getFocalPoint = function () {
1168
- _glMatrix.vec3.transformMat3(this.distanceVector, [0, 0, -this.distance], _glMatrix.mat3.fromMat4(_glMatrix.mat3.create(), this.matrix));
1169
-
1170
- _glMatrix.vec3.add(this.focalPoint, this.position, this.distanceVector); // 视点变化,需要重新计算视距
1171
-
1172
-
1173
- this._getDistance();
1174
- };
1175
- /**
1176
- * 重新计算视距
1177
- */
1178
-
1179
-
1180
- Camera.prototype._getDistance = function () {
1181
- this.distanceVector = _glMatrix.vec3.subtract(_glMatrix.vec3.create(), this.focalPoint, this.position);
1182
- this.distance = _glMatrix.vec3.length(this.distanceVector);
1183
- this.dollyingStep = this.distance / 100;
1184
- };
1185
-
1186
- Camera.prototype._getOrthoMatrix = function () {
1187
- if (this.projectionMode !== CameraProjectionMode.ORTHOGRAPHIC) {
1188
- return;
1189
- }
1190
-
1191
- var position = this.position;
1192
-
1193
- var rotZ = _glMatrix.quat.setAxisAngle(_glMatrix.quat.create(), [0, 0, 1], -this.roll * Math.PI / 180);
1194
-
1195
- _glMatrix.mat4.fromRotationTranslationScaleOrigin(this.orthoMatrix, rotZ, _glMatrix.vec3.fromValues((this.rright - this.left) / 2 - position[0], (this.top - this.bottom) / 2 - position[1], 0), _glMatrix.vec3.fromValues(this.zoom, this.zoom, 1), position);
1196
- };
1197
-
1198
- Camera.prototype.triggerUpdate = function () {
1199
- if (this.enableUpdate) {
1200
- // update frustum
1201
- var viewMatrix = this.getViewTransform();
1202
-
1203
- var vpMatrix = _glMatrix.mat4.multiply(_glMatrix.mat4.create(), this.getPerspective(), viewMatrix);
1204
-
1205
- this.getFrustum().extractFromVPMatrix(vpMatrix);
1206
- this.emit(CameraEvent.UPDATED);
1207
- }
1208
- };
1209
-
1210
- Camera.prototype.syncFromLandmark = function (landmark) {
1211
- this.matrix = _glMatrix.mat4.copy(this.matrix, landmark.matrix);
1212
- this.right = _glMatrix.vec3.copy(this.right, landmark.right);
1213
- this.up = _glMatrix.vec3.copy(this.up, landmark.up);
1214
- this.forward = _glMatrix.vec3.copy(this.forward, landmark.forward);
1215
- this.position = _glMatrix.vec3.copy(this.position, landmark.position);
1216
- this.focalPoint = _glMatrix.vec3.copy(this.focalPoint, landmark.focalPoint);
1217
- this.distanceVector = _glMatrix.vec3.copy(this.distanceVector, landmark.distanceVector);
1218
- this.azimuth = landmark.azimuth;
1219
- this.elevation = landmark.elevation;
1220
- this.roll = landmark.roll;
1221
- this.relAzimuth = landmark.relAzimuth;
1222
- this.relElevation = landmark.relElevation;
1223
- this.relRoll = landmark.relRoll;
1224
- this.dollyingStep = landmark.dollyingStep;
1225
- this.distance = landmark.distance;
1226
- this.zoom = landmark.zoom;
1227
- };
1228
-
1229
- return Camera;
1230
- }(_eventemitter.EventEmitter);
1231
-
1232
- exports.Camera = Camera;