@openglobus/og 0.23.0 → 0.24.1

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 (342) hide show
  1. package/lib/@openglobus/js/Clock.d.ts +2 -2
  2. package/lib/@openglobus/js/Globe.d.ts +10 -6
  3. package/lib/@openglobus/js/LonLat.d.ts +2 -2
  4. package/lib/@openglobus/js/Object3d.d.ts +3 -2
  5. package/lib/@openglobus/js/Popup.d.ts +7 -4
  6. package/lib/@openglobus/js/astro/astro.d.ts +1 -1
  7. package/lib/@openglobus/js/astro/earth.d.ts +1 -1
  8. package/lib/@openglobus/js/bv/Box.d.ts +1 -1
  9. package/lib/@openglobus/js/camera/Camera.d.ts +55 -19
  10. package/lib/@openglobus/js/camera/Frustum.d.ts +2 -2
  11. package/lib/@openglobus/js/camera/PlanetCamera.d.ts +14 -1
  12. package/lib/@openglobus/js/control/Atmosphere.d.ts +3 -3
  13. package/lib/@openglobus/js/control/AtmosphereConfig.d.ts +2 -2
  14. package/lib/@openglobus/js/control/CameraLock.d.ts +3 -3
  15. package/lib/@openglobus/js/control/CompassButton.d.ts +1 -1
  16. package/lib/@openglobus/js/control/DebugInfo.d.ts +1 -1
  17. package/lib/@openglobus/js/control/EarthCoordinates.d.ts +2 -2
  18. package/lib/@openglobus/js/control/GeoImageDragControl.d.ts +2 -2
  19. package/lib/@openglobus/js/control/KeyboardNavigation.d.ts +1 -1
  20. package/lib/@openglobus/js/control/LayerAnimation.d.ts +2 -2
  21. package/lib/@openglobus/js/control/LayerSwitcher.d.ts +4 -2
  22. package/lib/@openglobus/js/control/Lighting.d.ts +2 -1
  23. package/lib/@openglobus/js/control/MouseNavigation.d.ts +64 -52
  24. package/lib/@openglobus/js/control/OldMouseNavigation.d.ts +65 -0
  25. package/lib/@openglobus/js/control/RulerSwitcher.d.ts +2 -1
  26. package/lib/@openglobus/js/control/ScaleControl.d.ts +2 -1
  27. package/lib/@openglobus/js/control/SegmentBoundVisualization.d.ts +2 -1
  28. package/lib/@openglobus/js/control/ShowFps.d.ts +2 -1
  29. package/lib/@openglobus/js/control/SimpleNavigation.d.ts +3 -2
  30. package/lib/@openglobus/js/control/SimpleSkyBackground.d.ts +2 -1
  31. package/lib/@openglobus/js/control/Sun.d.ts +2 -1
  32. package/lib/@openglobus/js/control/ToggleWireframe.d.ts +2 -1
  33. package/lib/@openglobus/js/control/TouchNavigation.d.ts +3 -2
  34. package/lib/@openglobus/js/control/ZoomControl.d.ts +2 -1
  35. package/lib/@openglobus/js/control/drawing/DrawingControl.d.ts +1 -1
  36. package/lib/@openglobus/js/control/drawing/LineStringDrawingScene.d.ts +1 -1
  37. package/lib/@openglobus/js/control/drawing/PolygonDrawingScene.d.ts +3 -3
  38. package/lib/@openglobus/js/control/elevationProfile/ElevationProfile.d.ts +1 -1
  39. package/lib/@openglobus/js/control/elevationProfile/ElevationProfileButtonsView.d.ts +3 -2
  40. package/lib/@openglobus/js/control/elevationProfile/ElevationProfileControl.d.ts +2 -2
  41. package/lib/@openglobus/js/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
  42. package/lib/@openglobus/js/control/elevationProfile/ElevationProfileScene.d.ts +2 -2
  43. package/lib/@openglobus/js/control/elevationProfile/ElevationProfileView.d.ts +6 -4
  44. package/lib/@openglobus/js/control/elevationProfile/PointListDialog.d.ts +1 -1
  45. package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +1 -1
  46. package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +1 -1
  47. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +1 -1
  48. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +1 -1
  49. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +2 -2
  50. package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +1 -1
  51. package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +1 -1
  52. package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +1 -1
  53. package/lib/@openglobus/js/control/heightRuler/HeightRuler.d.ts +1 -1
  54. package/lib/@openglobus/js/control/heightRuler/HeightRulerScene.d.ts +1 -1
  55. package/lib/@openglobus/js/control/index.d.ts +1 -2
  56. package/lib/@openglobus/js/control/ruler/Ruler.d.ts +2 -1
  57. package/lib/@openglobus/js/control/ruler/RulerScene.d.ts +2 -2
  58. package/lib/@openglobus/js/control/selection/Selection.d.ts +2 -1
  59. package/lib/@openglobus/js/control/timeline/TimelineControl.d.ts +1 -1
  60. package/lib/@openglobus/js/control/timeline/TimelineModel.d.ts +1 -1
  61. package/lib/@openglobus/js/control/timeline/TimelineView.d.ts +4 -3
  62. package/lib/@openglobus/js/ellipsoid/Ellipsoid.d.ts +1 -1
  63. package/lib/@openglobus/js/entity/BaseBillboard.d.ts +6 -3
  64. package/lib/@openglobus/js/entity/BaseBillboardHandler.d.ts +2 -2
  65. package/lib/@openglobus/js/entity/Billboard.d.ts +3 -2
  66. package/lib/@openglobus/js/entity/Entity.d.ts +47 -32
  67. package/lib/@openglobus/js/entity/EntityCollection.d.ts +4 -3
  68. package/lib/@openglobus/js/entity/GeoObject.d.ts +2 -11
  69. package/lib/@openglobus/js/entity/Geometry.d.ts +4 -3
  70. package/lib/@openglobus/js/entity/GeometryHandler.d.ts +3 -2
  71. package/lib/@openglobus/js/entity/InstanceData.d.ts +2 -2
  72. package/lib/@openglobus/js/entity/Label.d.ts +4 -2
  73. package/lib/@openglobus/js/entity/LabelHandler.d.ts +1 -1
  74. package/lib/@openglobus/js/entity/PointCloud.d.ts +1 -1
  75. package/lib/@openglobus/js/entity/Polyline.d.ts +9 -7
  76. package/lib/@openglobus/js/entity/Ray.d.ts +4 -2
  77. package/lib/@openglobus/js/entity/RayHandler.d.ts +2 -2
  78. package/lib/@openglobus/js/entity/Strip.d.ts +5 -3
  79. package/lib/@openglobus/js/input/KeyboardHandler.d.ts +1 -1
  80. package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
  81. package/lib/@openglobus/js/layer/BaseGeoImage.d.ts +6 -5
  82. package/lib/@openglobus/js/layer/Bing.d.ts +2 -1
  83. package/lib/@openglobus/js/layer/CanvasTiles.d.ts +4 -3
  84. package/lib/@openglobus/js/layer/GeoImage.d.ts +2 -1
  85. package/lib/@openglobus/js/layer/GeoTexture2d.d.ts +3 -2
  86. package/lib/@openglobus/js/layer/GeoVideo.d.ts +2 -1
  87. package/lib/@openglobus/js/layer/KML.d.ts +5 -3
  88. package/lib/@openglobus/js/layer/Layer.d.ts +5 -4
  89. package/lib/@openglobus/js/layer/Material.d.ts +2 -2
  90. package/lib/@openglobus/js/layer/OpenStreetMap.d.ts +2 -1
  91. package/lib/@openglobus/js/layer/Vector.d.ts +9 -7
  92. package/lib/@openglobus/js/layer/WMS.d.ts +2 -1
  93. package/lib/@openglobus/js/layer/XYZ.d.ts +4 -3
  94. package/lib/@openglobus/js/math/Mat3.d.ts +1 -1
  95. package/lib/@openglobus/js/math/Mat4.d.ts +10 -1
  96. package/lib/@openglobus/js/math/Plane.d.ts +3 -1
  97. package/lib/@openglobus/js/math/Quat.d.ts +7 -1
  98. package/lib/@openglobus/js/math/Ray.d.ts +6 -16
  99. package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
  100. package/lib/@openglobus/js/math/Vec3.d.ts +3 -2
  101. package/lib/@openglobus/js/math/coder.d.ts +5 -3
  102. package/lib/@openglobus/js/math/index.d.ts +6 -3
  103. package/lib/@openglobus/js/math.d.ts +2 -2
  104. package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +2 -1
  105. package/lib/@openglobus/js/quadTree/earth/EarthQuadTreeStrategy.d.ts +0 -2
  106. package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +2 -1
  107. package/lib/@openglobus/js/renderer/Renderer.d.ts +5 -3
  108. package/lib/@openglobus/js/renderer/RendererEvents.d.ts +7 -3
  109. package/lib/@openglobus/js/scene/Axes.d.ts +1 -1
  110. package/lib/@openglobus/js/scene/Planet.d.ts +12 -6
  111. package/lib/@openglobus/js/scene/SkyBox.d.ts +1 -1
  112. package/lib/@openglobus/js/segment/Segment.d.ts +7 -5
  113. package/lib/@openglobus/js/segment/SegmentLonLat.d.ts +1 -1
  114. package/lib/@openglobus/js/segment/SegmentLonLatEqui.d.ts +1 -1
  115. package/lib/@openglobus/js/shaders/atmos.d.ts +1 -1
  116. package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -1
  117. package/lib/@openglobus/js/terrain/BilTerrain.d.ts +3 -2
  118. package/lib/@openglobus/js/terrain/EmptyTerrain.d.ts +1 -1
  119. package/lib/@openglobus/js/terrain/GlobusRgbTerrain.d.ts +2 -1
  120. package/lib/@openglobus/js/terrain/GlobusTerrain.d.ts +5 -4
  121. package/lib/@openglobus/js/terrain/RgbTerrain.d.ts +3 -2
  122. package/lib/@openglobus/js/ui/Button.d.ts +3 -2
  123. package/lib/@openglobus/js/ui/ButtonGroup.d.ts +1 -1
  124. package/lib/@openglobus/js/ui/Checkbox.d.ts +3 -2
  125. package/lib/@openglobus/js/ui/Color.d.ts +3 -2
  126. package/lib/@openglobus/js/ui/Dialog.d.ts +3 -2
  127. package/lib/@openglobus/js/ui/Input.d.ts +3 -2
  128. package/lib/@openglobus/js/ui/Slider.d.ts +3 -2
  129. package/lib/@openglobus/js/ui/ToggleButton.d.ts +4 -3
  130. package/lib/@openglobus/js/ui/View.d.ts +1 -1
  131. package/lib/@openglobus/js/utils/FontAtlas.d.ts +1 -1
  132. package/lib/@openglobus/js/utils/GeoImageCreator.d.ts +1 -1
  133. package/lib/@openglobus/js/utils/Loader.d.ts +1 -1
  134. package/lib/@openglobus/js/utils/NormalMapCreator.d.ts +2 -1
  135. package/lib/@openglobus/js/utils/TerrainWorker.d.ts +1 -1
  136. package/lib/@openglobus/js/utils/TextureAtlas.d.ts +4 -2
  137. package/lib/@openglobus/js/utils/objParser.d.ts +1 -1
  138. package/lib/@openglobus/js/utils/shared.d.ts +5 -3
  139. package/lib/@openglobus/js/webgl/Framebuffer.d.ts +3 -2
  140. package/lib/@openglobus/js/webgl/Handler.d.ts +32 -19
  141. package/lib/@openglobus/js/webgl/Multisample.d.ts +2 -1
  142. package/lib/@openglobus/js/webgl/Program.d.ts +2 -2
  143. package/lib/@openglobus/js/webgl/ProgramController.d.ts +2 -1
  144. package/lib/@openglobus/js/webgl/variableHandlers.d.ts +1 -1
  145. package/lib/@openglobus/og.esm.js +1 -1
  146. package/lib/@openglobus/og.esm.js.map +1 -1
  147. package/lib/@openglobus/og.umd.js +1 -1
  148. package/lib/@openglobus/og.umd.js.map +1 -1
  149. package/lib/js/Clock.d.ts +2 -2
  150. package/lib/js/Globe.d.ts +10 -6
  151. package/lib/js/Globe.js +10 -4
  152. package/lib/js/LonLat.d.ts +2 -2
  153. package/lib/js/Object3d.d.ts +3 -2
  154. package/lib/js/Popup.d.ts +7 -4
  155. package/lib/js/Popup.js +1 -1
  156. package/lib/js/astro/astro.d.ts +1 -1
  157. package/lib/js/astro/earth.d.ts +1 -1
  158. package/lib/js/bv/Box.d.ts +1 -1
  159. package/lib/js/camera/Camera.d.ts +55 -19
  160. package/lib/js/camera/Camera.js +82 -28
  161. package/lib/js/camera/Frustum.d.ts +2 -2
  162. package/lib/js/camera/PlanetCamera.d.ts +14 -1
  163. package/lib/js/camera/PlanetCamera.js +52 -5
  164. package/lib/js/control/Atmosphere.d.ts +3 -3
  165. package/lib/js/control/AtmosphereConfig.d.ts +2 -2
  166. package/lib/js/control/CameraLock.d.ts +3 -3
  167. package/lib/js/control/CameraLock.js +1 -1
  168. package/lib/js/control/CompassButton.d.ts +1 -1
  169. package/lib/js/control/DebugInfo.d.ts +1 -1
  170. package/lib/js/control/DebugInfo.js +30 -10
  171. package/lib/js/control/EarthCoordinates.d.ts +2 -2
  172. package/lib/js/control/GeoImageDragControl.d.ts +2 -2
  173. package/lib/js/control/KeyboardNavigation.d.ts +1 -1
  174. package/lib/js/control/KeyboardNavigation.js +8 -8
  175. package/lib/js/control/LayerAnimation.d.ts +2 -2
  176. package/lib/js/control/LayerSwitcher.d.ts +4 -2
  177. package/lib/js/control/Lighting.d.ts +2 -1
  178. package/lib/js/control/MouseNavigation.d.ts +64 -52
  179. package/lib/js/control/MouseNavigation.js +361 -305
  180. package/lib/js/control/MouseWheelZoomControl.d.ts +0 -44
  181. package/lib/js/control/MouseWheelZoomControl.js +270 -181
  182. package/lib/js/control/OldMouseNavigation.d.ts +65 -0
  183. package/lib/js/control/OldMouseNavigation.js +368 -0
  184. package/lib/js/control/RulerSwitcher.d.ts +2 -1
  185. package/lib/js/control/ScaleControl.d.ts +2 -1
  186. package/lib/js/control/ScaleControl.js +2 -2
  187. package/lib/js/control/SegmentBoundVisualization.d.ts +2 -1
  188. package/lib/js/control/ShowFps.d.ts +2 -1
  189. package/lib/js/control/SimpleNavigation.d.ts +3 -2
  190. package/lib/js/control/SimpleNavigation.js +8 -7
  191. package/lib/js/control/SimpleSkyBackground.d.ts +2 -1
  192. package/lib/js/control/Sun.d.ts +2 -1
  193. package/lib/js/control/Sun.js +5 -5
  194. package/lib/js/control/ToggleWireframe.d.ts +2 -1
  195. package/lib/js/control/TouchNavigation.d.ts +3 -2
  196. package/lib/js/control/TouchNavigation.js +11 -8
  197. package/lib/js/control/ZoomControl.d.ts +2 -1
  198. package/lib/js/control/drawing/DrawingControl.d.ts +1 -1
  199. package/lib/js/control/drawing/LineStringDrawingScene.d.ts +1 -1
  200. package/lib/js/control/drawing/PolygonDrawingScene.d.ts +3 -3
  201. package/lib/js/control/elevationProfile/ElevationProfile.d.ts +1 -1
  202. package/lib/js/control/elevationProfile/ElevationProfileButtonsView.d.ts +3 -2
  203. package/lib/js/control/elevationProfile/ElevationProfileControl.d.ts +2 -2
  204. package/lib/js/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
  205. package/lib/js/control/elevationProfile/ElevationProfileScene.d.ts +2 -2
  206. package/lib/js/control/elevationProfile/ElevationProfileScene.js +2 -1
  207. package/lib/js/control/elevationProfile/ElevationProfileView.d.ts +6 -4
  208. package/lib/js/control/elevationProfile/ElevationProfileView.js +1 -1
  209. package/lib/js/control/elevationProfile/PointListDialog.d.ts +1 -1
  210. package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +1 -1
  211. package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +1 -1
  212. package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +1 -1
  213. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +1 -1
  214. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +19 -33
  215. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +2 -2
  216. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +18 -18
  217. package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +1 -1
  218. package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +3 -2
  219. package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +1 -1
  220. package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +1 -4
  221. package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +1 -1
  222. package/lib/js/control/geoObjectEditor/RotateEntity.js +1 -1
  223. package/lib/js/control/heightRuler/HeightRuler.d.ts +1 -1
  224. package/lib/js/control/heightRuler/HeightRulerScene.d.ts +1 -1
  225. package/lib/js/control/index.d.ts +1 -2
  226. package/lib/js/control/index.js +1 -2
  227. package/lib/js/control/ruler/Ruler.d.ts +2 -1
  228. package/lib/js/control/ruler/RulerScene.d.ts +2 -2
  229. package/lib/js/control/selection/Selection.d.ts +2 -1
  230. package/lib/js/control/timeline/TimelineControl.d.ts +1 -1
  231. package/lib/js/control/timeline/TimelineModel.d.ts +1 -1
  232. package/lib/js/control/timeline/TimelineView.d.ts +4 -3
  233. package/lib/js/control/visibleExtent/Segment.js +4 -4
  234. package/lib/js/ellipsoid/Ellipsoid.d.ts +1 -1
  235. package/lib/js/ellipsoid/Ellipsoid.js +1 -1
  236. package/lib/js/entity/BaseBillboard.d.ts +6 -3
  237. package/lib/js/entity/BaseBillboardHandler.d.ts +2 -2
  238. package/lib/js/entity/Billboard.d.ts +3 -2
  239. package/lib/js/entity/Entity.d.ts +47 -32
  240. package/lib/js/entity/Entity.js +62 -47
  241. package/lib/js/entity/EntityCollection.d.ts +4 -3
  242. package/lib/js/entity/GeoObject.d.ts +2 -11
  243. package/lib/js/entity/GeoObject.js +0 -3
  244. package/lib/js/entity/Geometry.d.ts +4 -3
  245. package/lib/js/entity/GeometryHandler.d.ts +3 -2
  246. package/lib/js/entity/InstanceData.d.ts +2 -2
  247. package/lib/js/entity/InstanceData.js +6 -3
  248. package/lib/js/entity/Label.d.ts +4 -2
  249. package/lib/js/entity/LabelHandler.d.ts +1 -1
  250. package/lib/js/entity/PointCloud.d.ts +1 -1
  251. package/lib/js/entity/Polyline.d.ts +9 -7
  252. package/lib/js/entity/Polyline.js +2 -1
  253. package/lib/js/entity/Ray.d.ts +4 -2
  254. package/lib/js/entity/RayHandler.d.ts +2 -2
  255. package/lib/js/entity/Strip.d.ts +5 -3
  256. package/lib/js/input/KeyboardHandler.d.ts +1 -1
  257. package/lib/js/input/MouseHandler.d.ts +1 -0
  258. package/lib/js/input/MouseHandler.js +12 -1
  259. package/lib/js/layer/BaseGeoImage.d.ts +6 -5
  260. package/lib/js/layer/Bing.d.ts +2 -1
  261. package/lib/js/layer/CanvasTiles.d.ts +4 -3
  262. package/lib/js/layer/GeoImage.d.ts +2 -1
  263. package/lib/js/layer/GeoTexture2d.d.ts +3 -2
  264. package/lib/js/layer/GeoVideo.d.ts +2 -1
  265. package/lib/js/layer/KML.d.ts +5 -3
  266. package/lib/js/layer/KML.js +1 -1
  267. package/lib/js/layer/Layer.d.ts +5 -4
  268. package/lib/js/layer/Material.d.ts +2 -2
  269. package/lib/js/layer/OpenStreetMap.d.ts +2 -1
  270. package/lib/js/layer/Vector.d.ts +9 -7
  271. package/lib/js/layer/Vector.js +1 -1
  272. package/lib/js/layer/WMS.d.ts +2 -1
  273. package/lib/js/layer/XYZ.d.ts +4 -3
  274. package/lib/js/math/Mat3.d.ts +1 -1
  275. package/lib/js/math/Mat3.js +1 -1
  276. package/lib/js/math/Mat4.d.ts +10 -1
  277. package/lib/js/math/Mat4.js +17 -1
  278. package/lib/js/math/Plane.d.ts +3 -1
  279. package/lib/js/math/Plane.js +11 -1
  280. package/lib/js/math/Quat.d.ts +7 -1
  281. package/lib/js/math/Quat.js +7 -1
  282. package/lib/js/math/Ray.d.ts +6 -16
  283. package/lib/js/math/Ray.js +53 -46
  284. package/lib/js/math/Vec2.d.ts +22 -0
  285. package/lib/js/math/Vec2.js +32 -0
  286. package/lib/js/math/Vec3.d.ts +3 -2
  287. package/lib/js/math/coder.d.ts +5 -3
  288. package/lib/js/math/index.d.ts +6 -3
  289. package/lib/js/math.d.ts +2 -2
  290. package/lib/js/math.js +2 -2
  291. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +2 -1
  292. package/lib/js/quadTree/earth/EarthQuadTreeStrategy.d.ts +0 -2
  293. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +2 -1
  294. package/lib/js/renderer/Renderer.d.ts +5 -3
  295. package/lib/js/renderer/Renderer.js +10 -6
  296. package/lib/js/renderer/RendererEvents.d.ts +7 -3
  297. package/lib/js/renderer/RendererEvents.js +5 -3
  298. package/lib/js/scene/Axes.d.ts +1 -1
  299. package/lib/js/scene/Planet.d.ts +12 -6
  300. package/lib/js/scene/Planet.js +24 -3
  301. package/lib/js/scene/SkyBox.d.ts +1 -1
  302. package/lib/js/segment/Segment.d.ts +7 -5
  303. package/lib/js/segment/Segment.js +4 -4
  304. package/lib/js/segment/SegmentLonLat.d.ts +1 -1
  305. package/lib/js/segment/SegmentLonLatEqui.d.ts +1 -1
  306. package/lib/js/shaders/atmos.d.ts +1 -1
  307. package/lib/js/shaders/drawnode.d.ts +1 -1
  308. package/lib/js/terrain/BilTerrain.d.ts +3 -2
  309. package/lib/js/terrain/EmptyTerrain.d.ts +1 -1
  310. package/lib/js/terrain/GlobusRgbTerrain.d.ts +2 -1
  311. package/lib/js/terrain/GlobusTerrain.d.ts +5 -4
  312. package/lib/js/terrain/GlobusTerrain.js +2 -2
  313. package/lib/js/terrain/RgbTerrain.d.ts +3 -2
  314. package/lib/js/ui/Button.d.ts +3 -2
  315. package/lib/js/ui/ButtonGroup.d.ts +1 -1
  316. package/lib/js/ui/Checkbox.d.ts +3 -2
  317. package/lib/js/ui/Color.d.ts +3 -2
  318. package/lib/js/ui/Dialog.d.ts +3 -2
  319. package/lib/js/ui/Input.d.ts +3 -2
  320. package/lib/js/ui/Slider.d.ts +3 -2
  321. package/lib/js/ui/ToggleButton.d.ts +4 -3
  322. package/lib/js/ui/View.d.ts +1 -1
  323. package/lib/js/utils/FontAtlas.d.ts +1 -1
  324. package/lib/js/utils/GeoImageCreator.d.ts +1 -1
  325. package/lib/js/utils/Loader.d.ts +1 -1
  326. package/lib/js/utils/NormalMapCreator.d.ts +2 -1
  327. package/lib/js/utils/TerrainWorker.d.ts +1 -1
  328. package/lib/js/utils/TextureAtlas.d.ts +4 -2
  329. package/lib/js/utils/objParser.d.ts +1 -1
  330. package/lib/js/utils/shared.d.ts +5 -3
  331. package/lib/js/webgl/Framebuffer.d.ts +3 -2
  332. package/lib/js/webgl/Handler.d.ts +32 -19
  333. package/lib/js/webgl/Handler.js +48 -36
  334. package/lib/js/webgl/Multisample.d.ts +2 -1
  335. package/lib/js/webgl/Program.d.ts +2 -2
  336. package/lib/js/webgl/ProgramController.d.ts +2 -1
  337. package/lib/js/webgl/variableHandlers.d.ts +1 -1
  338. package/package.json +2 -2
  339. package/lib/@openglobus/js/control/EarthNavigation.d.ts +0 -50
  340. package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +0 -44
  341. package/lib/js/control/EarthNavigation.d.ts +0 -50
  342. package/lib/js/control/EarthNavigation.js +0 -202
package/lib/js/Clock.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { EventsHandler } from "./Events";
2
- import { JulianDate } from "./astro/jd";
1
+ import { type EventsHandler } from "./Events";
2
+ import type { JulianDate } from "./astro/jd";
3
3
  import { Handler } from "./webgl/Handler";
4
4
  type ClockEventsList = ["tick", "end", "start", "stop"];
5
5
  export interface IClockParams {
package/lib/js/Globe.d.ts CHANGED
@@ -2,14 +2,15 @@ import { Control } from "./control/Control";
2
2
  import { Ellipsoid } from "./ellipsoid/Ellipsoid";
3
3
  import { EmptyTerrain } from "./terrain/EmptyTerrain";
4
4
  import { Layer } from "./layer/Layer";
5
- import { NumberArray2 } from "./math/Vec2";
6
- import { NumberArray4 } from "./math/Vec4";
5
+ import type { NumberArray2 } from "./math/Vec2";
6
+ import type { NumberArray4 } from "./math/Vec4";
7
7
  import { Planet } from "./scene/Planet";
8
8
  import { Sun } from "./control/Sun";
9
- import { HTMLDivElementExt, Renderer } from "./renderer/Renderer";
9
+ import { Renderer } from "./renderer/Renderer";
10
+ import type { HTMLDivElementExt } from "./renderer/Renderer";
10
11
  import { RenderNode } from "./scene/RenderNode";
11
12
  import { Extent } from "./Extent";
12
- import { IAtmosphereParams } from "./control/Atmosphere";
13
+ import type { IAtmosphereParams } from "./control/Atmosphere";
13
14
  export interface IGlobeParams {
14
15
  attributionContainer?: HTMLElement;
15
16
  target?: string | HTMLElement;
@@ -33,7 +34,6 @@ export interface IGlobeParams {
33
34
  transitionOpacityEnabled?: boolean;
34
35
  terrain?: EmptyTerrain;
35
36
  controls?: Control[];
36
- useEarthNavigation?: boolean;
37
37
  minSlope?: number;
38
38
  sun?: {
39
39
  active?: boolean;
@@ -48,6 +48,10 @@ export interface IGlobeParams {
48
48
  gamma?: number;
49
49
  exposure?: number;
50
50
  }
51
+ /**
52
+ * @typedef {Array<number>} LonLatCoordinate
53
+ * @typedef {Array<LonLatCoordinate>} ExtentBoundingBox
54
+ */
51
55
  /**
52
56
  * Creates a WebGL context with globe.
53
57
  * @class
@@ -79,7 +83,7 @@ export interface IGlobeParams {
79
83
  * @param {EmptyTerrain} [options.terrain] - Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
80
84
  * @param {Array.<Control>} [options.controls] - Renderer controls array.
81
85
  * @param {Array.<Layer>} [options.layers] - Planet layers.
82
- * @param {Extent| [[number, number],[number, number]]} [options.viewExtent] - Viewable starting extent.
86
+ * @param {Extent | ExtentBoundingBox} [options.viewExtent] [options.viewExtent] - Viewable starting extent.
83
87
  * @param {boolean} [options.autoActivate=true] - Globe rendering auto activation flag. True is default.
84
88
  * @param {HTMLElement} [options.attributionContainer] - Container for attribution list.
85
89
  * @param {number} [options.maxGridSize=128] = Maximal segment grid size. 128 is default
package/lib/js/Globe.js CHANGED
@@ -1,7 +1,6 @@
1
- // #StandWithUkraine
1
+ // #StandWith
2
2
  import { CompassButton } from "./control/CompassButton";
3
3
  import { EarthCoordinates } from "./control/EarthCoordinates";
4
- import { EarthNavigation } from "./control/EarthNavigation";
5
4
  import { EmptyTerrain } from "./terrain/EmptyTerrain";
6
5
  import { Handler } from "./webgl/Handler";
7
6
  import { isEmpty } from "./utils/shared";
@@ -17,6 +16,10 @@ const DEFAULT_SPEC_SRC = `/spec.png`;
17
16
  const DEFAULT_RESOURCES_SRC = '/res';
18
17
  /** @const {string} */
19
18
  const PLANET_NAME_PREFIX = "globus_planet_";
19
+ /**
20
+ * @typedef {Array<number>} LonLatCoordinate
21
+ * @typedef {Array<LonLatCoordinate>} ExtentBoundingBox
22
+ */
20
23
  /**
21
24
  * Creates a WebGL context with globe.
22
25
  * @class
@@ -48,7 +51,7 @@ const PLANET_NAME_PREFIX = "globus_planet_";
48
51
  * @param {EmptyTerrain} [options.terrain] - Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
49
52
  * @param {Array.<Control>} [options.controls] - Renderer controls array.
50
53
  * @param {Array.<Layer>} [options.layers] - Planet layers.
51
- * @param {Extent| [[number, number],[number, number]]} [options.viewExtent] - Viewable starting extent.
54
+ * @param {Extent | ExtentBoundingBox} [options.viewExtent] [options.viewExtent] - Viewable starting extent.
52
55
  * @param {boolean} [options.autoActivate=true] - Globe rendering auto activation flag. True is default.
53
56
  * @param {HTMLElement} [options.attributionContainer] - Container for attribution list.
54
57
  * @param {number} [options.maxGridSize=128] = Maximal segment grid size. 128 is default
@@ -178,7 +181,7 @@ class Globe {
178
181
  else {
179
182
  this.planet.addControls([
180
183
  new ZoomControl(),
181
- options.useEarthNavigation ? new EarthNavigation() : new MouseNavigation({ minSlope: options.minSlope }),
184
+ new MouseNavigation(),
182
185
  new TouchNavigation(),
183
186
  new EarthCoordinates(),
184
187
  new ScaleControl(),
@@ -262,6 +265,9 @@ class Globe {
262
265
  t.appendChild(this.$inner);
263
266
  }
264
267
  }
268
+ else {
269
+ console.warn(`Target container not found. Provided target: ${target}`);
270
+ }
265
271
  }
266
272
  detach() {
267
273
  if (this.$target) {
@@ -1,5 +1,5 @@
1
- import { NumberArray2 } from "./math/Vec2";
2
- import { NumberArray3 } from "./math/Vec3";
1
+ import type { NumberArray2 } from "./math/Vec2";
2
+ import type { NumberArray3 } from "./math/Vec3";
3
3
  /**
4
4
  * Represents a geographical point with a certain latitude, longitude and height.
5
5
  * @class
@@ -1,5 +1,6 @@
1
- import { TypedArray } from './utils/shared';
2
- import { NumberArray3, Vec3 } from './math/Vec3';
1
+ import type { TypedArray } from './utils/shared';
2
+ import { Vec3 } from './math/Vec3';
3
+ import type { NumberArray3 } from './math/Vec3';
3
4
  import { Mat4 } from "./math/Mat4";
4
5
  interface IObject3dParams {
5
6
  name?: string;
package/lib/js/Popup.d.ts CHANGED
@@ -1,9 +1,12 @@
1
- import { EventsHandler } from "./Events";
1
+ import type { EventsHandler } from "./Events";
2
2
  import { LonLat } from "./LonLat";
3
3
  import { Planet } from "./scene/Planet";
4
- import { NumberArray2, Vec2 } from "./math/Vec2";
5
- import { NumberArray3, Vec3 } from "./math/Vec3";
6
- import { View, IViewParams, ViewEventsList } from './ui/View';
4
+ import { Vec2 } from "./math/Vec2";
5
+ import { Vec3 } from "./math/Vec3";
6
+ import type { NumberArray2 } from "./math/Vec2";
7
+ import type { NumberArray3 } from "./math/Vec3";
8
+ import { View } from './ui/View';
9
+ import type { IViewParams, ViewEventsList } from './ui/View';
7
10
  interface IPopupParams extends IViewParams {
8
11
  planet: Planet;
9
12
  title?: string;
package/lib/js/Popup.js CHANGED
@@ -117,7 +117,7 @@ class Popup extends View {
117
117
  let look = cart.sub(cam.eye), v = Math.sqrt((f + g) * (f + g) - f * f);
118
118
  if (v > look.length() && cam.getForward().dot(look.normalize()) > 0.0) {
119
119
  this.el.style.display = "block";
120
- this.setScreen(cam.project(cart));
120
+ this.setScreen(cam.project3v(cart));
121
121
  }
122
122
  else {
123
123
  this.el.style.display = "none";
@@ -1,4 +1,4 @@
1
- import { JulianDate } from "./jd";
1
+ import { type JulianDate } from "./jd";
2
2
  /**
3
3
  * Angle between J2000 mean equator and the ecliptic plane.
4
4
  * 23 deg 26' 21".448 (Seidelmann, _Explanatory Supplement to the
@@ -1,5 +1,5 @@
1
1
  import { Vec3 } from "../math/Vec3";
2
- import { JulianDate } from "./jd";
2
+ import type { JulianDate } from "./jd";
3
3
  /**
4
4
  * Returns Sun position in the geocentric coordinate system by the time.
5
5
  * @param {JulianDate} jDate - Julian date time.
@@ -1,5 +1,5 @@
1
1
  import { Vec3 } from "../math/Vec3";
2
- import { NumberArray6 } from "./Sphere";
2
+ import type { NumberArray6 } from "./Sphere";
3
3
  import { Ellipsoid } from "../ellipsoid/Ellipsoid";
4
4
  import { Extent } from "../Extent";
5
5
  type Vec3Array8 = [Vec3, Vec3, Vec3, Vec3, Vec3, Vec3, Vec3, Vec3];
@@ -1,11 +1,15 @@
1
- import { EventsHandler } from "../Events";
1
+ import { type EventsHandler } from "../Events";
2
2
  import { Frustum } from "./Frustum";
3
- import { Mat3, NumberArray9 } from "../math/Mat3";
4
- import { Mat4, NumberArray16 } from "../math/Mat4";
3
+ import { Mat3 } from "../math/Mat3";
4
+ import type { NumberArray9 } from "../math/Mat3";
5
+ import { Mat4 } from "../math/Mat4";
6
+ import type { NumberArray16 } from "../math/Mat4";
5
7
  import { Renderer } from "../renderer/Renderer";
6
- import { Vec2, NumberArray2 } from "../math/Vec2";
8
+ import { Vec2 } from "../math/Vec2";
9
+ import type { NumberArray2 } from "../math/Vec2";
7
10
  import { Vec3 } from "../math/Vec3";
8
11
  import { Sphere } from "../bv/Sphere";
12
+ import { Quat } from "../math/Quat";
9
13
  type CameraEvents = ["viewchange", "moveend"];
10
14
  export interface ICameraParams {
11
15
  eye?: Vec3;
@@ -89,22 +93,28 @@ declare class Camera {
89
93
  protected _normalMatrix: Mat3;
90
94
  /**
91
95
  * Camera right vector.
92
- * @public
96
+ * @protected
93
97
  * @type {Vec3}
94
98
  */
95
99
  _r: Vec3;
96
100
  /**
97
101
  * Camera up vector.
98
- * @public
102
+ * @protected
99
103
  * @type {Vec3}
100
104
  */
101
105
  _u: Vec3;
102
106
  /**
103
107
  * Camera backward vector.
104
- * @public
108
+ * @protected
105
109
  * @type {Vec3}
106
110
  */
107
111
  _b: Vec3;
112
+ /**
113
+ * Camera forward vector.
114
+ * @protected
115
+ * @type {Vec3}
116
+ */
117
+ _f: Vec3;
108
118
  protected _pr: Vec3;
109
119
  protected _pu: Vec3;
110
120
  protected _pb: Vec3;
@@ -208,23 +218,40 @@ declare class Camera {
208
218
  */
209
219
  slide(du: number, dv: number, dn: number): void;
210
220
  /**
211
- * Roll the camera to the angle in degrees
221
+ * Roll the camera to the angle in radians
222
+ * @public
223
+ * @param {number} angle - Delta roll angle in radians
224
+ */
225
+ setRoll(angle: number): void;
226
+ /**
227
+ * Pitch the camera to the angle in radians
212
228
  * @public
213
- * @param {number} angle - Delta roll angle in degrees
229
+ * @param {number} angle - Delta pitch angle in radians
214
230
  */
215
- roll(angle: number): void;
231
+ setPitch(angle: number): void;
216
232
  /**
217
- * Pitch the camera to the angle in degrees
233
+ * Yaw the camera to the angle in radians
218
234
  * @public
219
- * @param {number} angle - Delta pitch angle in degrees
235
+ * @param {number} angle - Delta yaw angle in radians
236
+ */
237
+ setYaw(angle: number): void;
238
+ setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
239
+ getPitch(): number;
240
+ getYaw(): number;
241
+ getRoll(): number;
242
+ /**
243
+ * Returns camera quaternion
220
244
  */
221
- pitch(angle: number): void;
245
+ getRotation(): Quat;
246
+ setRotation(rot: Quat, up?: Vec3, right?: Vec3, back?: Vec3): void;
247
+ rotate(rot: Quat): void;
222
248
  /**
223
- * Yaw the camera to the angle in degrees
249
+ * Returns normal vector direction to the unprojected screen point from camera eye
224
250
  * @public
225
- * @param {number} angle - Delta yaw angle in degrees
251
+ * @param {Vec2} pos - Screen X coordinate
252
+ * @returns {Vec3} - Direction vector
226
253
  */
227
- yaw(angle: number): void;
254
+ unproject2v(pos: Vec2): Vec3;
228
255
  /**
229
256
  * Returns normal vector direction to the unprojected screen point from camera eye
230
257
  * @public
@@ -239,7 +266,16 @@ declare class Camera {
239
266
  * @param {Vec3} v - Cartesian 3d coordinates
240
267
  * @returns {Vec2} - Screen point coordinates
241
268
  */
242
- project(v: Vec3): Vec2;
269
+ project3v(v: Vec3): Vec2;
270
+ /**
271
+ * Gets projected 3d point to the 2d screen coordinates
272
+ * @public
273
+ * @param {number} x - X coordinate
274
+ * @param {number} y - Y coordinate
275
+ * @param {number} z - Z coordinate
276
+ * @returns {Vec2} - Screen point coordinates
277
+ */
278
+ project(x: number, y: number, z: number): Vec2;
243
279
  /**
244
280
  * Rotates camera around center point
245
281
  * @public
@@ -249,7 +285,7 @@ declare class Camera {
249
285
  * @param {Vec3} [center] - Point that the camera rotates around
250
286
  * @param {Vec3} [up] - Camera up vector
251
287
  */
252
- rotateAround(angle: number, isArc?: boolean, center?: Vec3 | null, up?: Vec3 | null): void;
288
+ rotateAround(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
253
289
  /**
254
290
  * Rotates camera around center point by horizontal.
255
291
  * @public
@@ -259,7 +295,7 @@ declare class Camera {
259
295
  * @param {Vec3} [center] - Point that the camera rotates around.
260
296
  * @param {Vec3} [up] - Camera up vector.
261
297
  */
262
- rotateHorizontal(angle: number, isArc?: boolean, center?: Vec3 | null, up?: Vec3 | null): void;
298
+ rotateHorizontal(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
263
299
  /**
264
300
  * Rotates camera around center point by vertical.
265
301
  * @param {number} angle - Rotation angle in radians.
@@ -7,6 +7,7 @@ import { Vec2 } from "../math/Vec2";
7
7
  import { Vec3 } from "../math/Vec3";
8
8
  import { Vec4 } from "../math/Vec4";
9
9
  import { Quat } from "../math/Quat";
10
+ import { RADIANS } from "../math";
10
11
  const EVENT_NAMES = [
11
12
  /**
12
13
  * When camera has been updated.
@@ -50,6 +51,7 @@ class Camera {
50
51
  this._r = new Vec3(1.0, 0.0, 0.0);
51
52
  this._u = new Vec3(0.0, 1.0, 0.0);
52
53
  this._b = new Vec3(0.0, 0.0, 1.0);
54
+ this._f = this._b.negateTo();
53
55
  // Previous frame values
54
56
  this._pr = this._r.clone();
55
57
  this._pu = this._u.clone();
@@ -147,7 +149,7 @@ class Camera {
147
149
  return this._r.negateTo();
148
150
  }
149
151
  getForward() {
150
- return this._b.negateTo();
152
+ return this._f.clone();
151
153
  }
152
154
  getBackward() {
153
155
  return this._b.clone();
@@ -218,7 +220,7 @@ class Camera {
218
220
  this._tanViewAngle_hradOneByHeight =
219
221
  this._tanViewAngle_hrad * this.renderer.handler._oneByHeight;
220
222
  let c = this.renderer.handler.canvas;
221
- this._projSizeConst = Math.min(c.clientWidth < 512 ? 512 : c.clientWidth, c.clientHeight < 512 ? 512 : c.clientHeight) / (angle * math.RADIANS);
223
+ this._projSizeConst = Math.min(c.clientWidth < 512 ? 512 : c.clientWidth, c.clientHeight < 512 ? 512 : c.clientHeight) / (angle * RADIANS);
222
224
  for (let i = 0, len = this.frustums.length; i < len; i++) {
223
225
  this.frustums[i].setProjectionMatrix(angle, aspect, this.frustums[i].near, this.frustums[i].far);
224
226
  }
@@ -264,6 +266,7 @@ class Camera {
264
266
  this._b.normalize();
265
267
  this._r.normalize();
266
268
  this._u.copy(this._b.cross(this._r));
269
+ this._f.set(-this._b.x, -this._b.y, -this._b.z);
267
270
  return this;
268
271
  }
269
272
  /**
@@ -276,6 +279,7 @@ class Camera {
276
279
  this._b.set(this.eye.x - look.x, this.eye.y - look.y, this.eye.z - look.z);
277
280
  this._r.copy((up || this._u).cross(this._b));
278
281
  this._b.normalize();
282
+ this._f.set(-this._b.x, -this._b.y, -this._b.z);
279
283
  this._r.normalize();
280
284
  this._u.copy(this._b.cross(this._r));
281
285
  }
@@ -292,41 +296,82 @@ class Camera {
292
296
  this.eye.z += du * this._r.z + dv * this._u.z + dn * this._b.z;
293
297
  }
294
298
  /**
295
- * Roll the camera to the angle in degrees
299
+ * Roll the camera to the angle in radians
296
300
  * @public
297
- * @param {number} angle - Delta roll angle in degrees
301
+ * @param {number} angle - Delta roll angle in radians
298
302
  */
299
- roll(angle) {
300
- let cs = Math.cos(math.RADIANS * angle);
301
- let sn = Math.sin(math.RADIANS * angle);
303
+ setRoll(angle) {
304
+ let cs = Math.cos(angle);
305
+ let sn = Math.sin(angle);
302
306
  let t = this._r.clone();
303
307
  this._r.set(cs * t.x - sn * this._u.x, cs * t.y - sn * this._u.y, cs * t.z - sn * this._u.z);
304
308
  this._u.set(sn * t.x + cs * this._u.x, sn * t.y + cs * this._u.y, sn * t.z + cs * this._u.z);
305
309
  }
306
310
  /**
307
- * Pitch the camera to the angle in degrees
311
+ * Pitch the camera to the angle in radians
308
312
  * @public
309
- * @param {number} angle - Delta pitch angle in degrees
313
+ * @param {number} angle - Delta pitch angle in radians
310
314
  */
311
- pitch(angle) {
312
- let cs = Math.cos(math.RADIANS * angle);
313
- let sn = Math.sin(math.RADIANS * angle);
314
- let t = this._b.clone();
315
+ setPitch(angle) {
316
+ let cs = Math.cos(angle);
317
+ let sn = Math.sin(angle);
318
+ let t = this._b;
315
319
  this._b.set(cs * t.x - sn * this._u.x, cs * t.y - sn * this._u.y, cs * t.z - sn * this._u.z);
316
320
  this._u.set(sn * t.x + cs * this._u.x, sn * t.y + cs * this._u.y, sn * t.z + cs * this._u.z);
317
321
  }
318
322
  /**
319
- * Yaw the camera to the angle in degrees
323
+ * Yaw the camera to the angle in radians
320
324
  * @public
321
- * @param {number} angle - Delta yaw angle in degrees
325
+ * @param {number} angle - Delta yaw angle in radians
322
326
  */
323
- yaw(angle) {
324
- let cs = Math.cos(math.RADIANS * angle);
325
- let sn = Math.sin(math.RADIANS * angle);
326
- let t = this._r.clone();
327
+ setYaw(angle) {
328
+ let cs = Math.cos(angle);
329
+ let sn = Math.sin(angle);
330
+ let t = this._r;
327
331
  this._r.set(cs * t.x - sn * this._b.x, cs * t.y - sn * this._b.y, cs * t.z - sn * this._b.z);
328
332
  this._b.set(sn * t.x + cs * this._b.x, sn * t.y + cs * this._b.y, sn * t.z + cs * this._b.z);
329
333
  }
334
+ setPitchYawRoll(pitch, yaw, roll) {
335
+ let qRot = new Quat();
336
+ qRot.setPitchYawRoll(pitch, yaw, roll);
337
+ this.setRotation(qRot);
338
+ }
339
+ getPitch() {
340
+ return this.getRotation().getPitch();
341
+ }
342
+ getYaw() {
343
+ return this.getRotation().getYaw();
344
+ }
345
+ getRoll() {
346
+ return this.getRotation().getRoll();
347
+ }
348
+ /**
349
+ * Returns camera quaternion
350
+ */
351
+ getRotation() {
352
+ return Quat.getLookRotation(this._f, this._u).conjugate();
353
+ }
354
+ setRotation(rot, up, right, back) {
355
+ rot.mulVec3Res(up || new Vec3(0, 1, 0), this._u);
356
+ rot.mulVec3Res(right || new Vec3(1, 0, 0), this._r);
357
+ rot.mulVec3Res(back || new Vec3(0, 0, 1), this._b);
358
+ this._f.set(-this._b.x, -this._b.y, -this._b.z);
359
+ }
360
+ rotate(rot) {
361
+ rot.mulVec3Res(this._u, this._u);
362
+ rot.mulVec3Res(this._r, this._r);
363
+ rot.mulVec3Res(this._b, this._b);
364
+ this._f.set(-this._b.x, -this._b.y, -this._b.z);
365
+ }
366
+ /**
367
+ * Returns normal vector direction to the unprojected screen point from camera eye
368
+ * @public
369
+ * @param {Vec2} pos - Screen X coordinate
370
+ * @returns {Vec3} - Direction vector
371
+ */
372
+ unproject2v(pos) {
373
+ return this.unproject(pos.x, pos.y);
374
+ }
330
375
  /**
331
376
  * Returns normal vector direction to the unprojected screen point from camera eye
332
377
  * @public
@@ -346,8 +391,19 @@ class Camera {
346
391
  * @param {Vec3} v - Cartesian 3d coordinates
347
392
  * @returns {Vec2} - Screen point coordinates
348
393
  */
349
- project(v) {
350
- let r = this.frustums[0].projectionViewMatrix.mulVec4(v.toVec4()), c = this.renderer.handler.canvas;
394
+ project3v(v) {
395
+ return this.project(v.x, v.y, v.z);
396
+ }
397
+ /**
398
+ * Gets projected 3d point to the 2d screen coordinates
399
+ * @public
400
+ * @param {number} x - X coordinate
401
+ * @param {number} y - Y coordinate
402
+ * @param {number} z - Z coordinate
403
+ * @returns {Vec2} - Screen point coordinates
404
+ */
405
+ project(x, y, z) {
406
+ let r = this.frustums[0].projectionViewMatrix.mulVec4(new Vec4(x, y, z, 1.0)), c = this.renderer.handler.canvas;
351
407
  return new Vec2((1 + r.x / r.w) * c.width * 0.5, (1 - r.y / r.w) * c.height * 0.5);
352
408
  }
353
409
  /**
@@ -359,17 +415,15 @@ class Camera {
359
415
  * @param {Vec3} [center] - Point that the camera rotates around
360
416
  * @param {Vec3} [up] - Camera up vector
361
417
  */
362
- rotateAround(angle, isArc, center, up) {
363
- center = center || Vec3.ZERO;
364
- up = up || Vec3.UP;
365
- let rot = new Mat4().setRotation(isArc ? this._u : up, angle);
366
- let tr = new Mat4().setIdentity().translate(center);
367
- let ntr = new Mat4().setIdentity().translate(center.negateTo());
368
- let trm = tr.mul(rot).mul(ntr);
418
+ rotateAround(angle, isArc = false, center = Vec3.ZERO, up = Vec3.UP) {
419
+ up = isArc ? this._u : up;
420
+ let rot = Mat4.getRotation(angle, up);
421
+ let trm = Mat4.getRotationAroundPoint(angle, center, up);
369
422
  this.eye = trm.mulVec3(this.eye);
370
423
  this._u = rot.mulVec3(this._u).normalize();
371
424
  this._r = rot.mulVec3(this._r).normalize();
372
425
  this._b = rot.mulVec3(this._b).normalize();
426
+ this._f.set(-this._b.x, -this._b.y, -this._b.z);
373
427
  }
374
428
  /**
375
429
  * Rotates camera around center point by horizontal.
@@ -1,6 +1,6 @@
1
1
  import { Box } from "../bv/Box";
2
- import { Mat4, NumberArray16 } from "../math/Mat4";
3
- import { NumberArray4 } from "../math/Vec4";
2
+ import { Mat4, type NumberArray16 } from "../math/Mat4";
3
+ import type { NumberArray4 } from "../math/Vec4";
4
4
  import { Sphere } from "../bv/Sphere";
5
5
  import { Vec3 } from "../math/Vec3";
6
6
  interface IFrustumParams {
@@ -1,4 +1,4 @@
1
- import { Camera, ICameraParams } from "./Camera";
1
+ import { Camera, type ICameraParams } from "./Camera";
2
2
  import { Key } from "../Lock";
3
3
  import { LonLat } from "../LonLat";
4
4
  import { Planet } from "../scene/Planet";
@@ -228,7 +228,20 @@ declare class PlanetCamera extends Camera {
228
228
  checkFly(): void;
229
229
  checkTerrainCollision(): Vec3 | undefined;
230
230
  getSurfaceVisibleDistance(d: number): number;
231
+ /**
232
+ * should be yje same as getYaw
233
+ */
231
234
  getHeading(): number;
232
235
  isVisible(poi: Vec3): boolean;
236
+ getPitch(): number;
237
+ /**
238
+ * should be the same as getHeading
239
+ */
240
+ getYaw(): number;
241
+ getRoll(): number;
242
+ setPitch(a: number): void;
243
+ setYaw(a: number): void;
244
+ setRoll(a: number): void;
245
+ setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
233
246
  }
234
247
  export { PlanetCamera };