@openglobus/og 0.28.7 → 1.0.0-rc10

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 (242) hide show
  1. package/LICENSE.md +218 -4
  2. package/README.md +33 -18
  3. package/lib/Deferred.d.ts +2 -2
  4. package/lib/Events.d.ts +1 -1
  5. package/lib/Globe.d.ts +22 -11
  6. package/lib/Object3d.d.ts +18 -15
  7. package/lib/Popup.d.ts +2 -2
  8. package/lib/assets/LabelWorker.worker-C24YLEkW.js.map +1 -0
  9. package/lib/assets/PlainSegmentWorker.worker-DJHXd0bF.js.map +1 -0
  10. package/lib/assets/TerrainWorker.worker-B4Gp0jCy.js.map +1 -0
  11. package/lib/bv/index.d.ts +2 -2
  12. package/lib/camera/Camera.d.ts +320 -33
  13. package/lib/camera/Frustum.d.ts +136 -15
  14. package/lib/camera/PlanetCamera.d.ts +114 -11
  15. package/lib/camera/index.d.ts +2 -2
  16. package/lib/control/CompassButton.d.ts +2 -2
  17. package/lib/control/EarthCoordinates.d.ts +5 -2
  18. package/lib/control/FramebufferPreview.d.ts +20 -4
  19. package/lib/control/GeoImageDragControl.d.ts +1 -1
  20. package/lib/control/LayerAnimation.d.ts +2 -2
  21. package/lib/control/LayerSwitcher.d.ts +3 -0
  22. package/lib/control/Lighting.d.ts +7 -2
  23. package/lib/control/Navigation.d.ts +27 -12
  24. package/lib/control/OrthoSwitcher.d.ts +18 -0
  25. package/lib/control/SimpleTouchNavigation.d.ts +44 -0
  26. package/lib/control/Sun.d.ts +4 -2
  27. package/lib/control/TouchNavigation.d.ts +4 -8
  28. package/lib/control/atmosphere/Atmosphere.d.ts +2 -0
  29. package/lib/control/atmosphere/AtmosphereConfig.d.ts +2 -6
  30. package/lib/control/depthCamera/DepthCamera.d.ts +118 -0
  31. package/lib/control/depthCamera/DepthCameraHandler.d.ts +25 -0
  32. package/lib/control/depthCamera/depth_camera.d.ts +2 -0
  33. package/lib/control/drawing/LineStringDrawingScene.d.ts +1 -0
  34. package/lib/control/drawing/PolygonDrawingScene.d.ts +14 -14
  35. package/lib/control/elevationProfile/ElevationProfile.d.ts +1 -1
  36. package/lib/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
  37. package/lib/control/elevationProfile/ElevationProfileScene.d.ts +9 -12
  38. package/lib/control/elevationProfile/ElevationProfileView.d.ts +16 -5
  39. package/lib/control/entityEditor/CameraEditorView.d.ts +62 -0
  40. package/lib/control/entityEditor/EntityEditor.d.ts +20 -0
  41. package/lib/control/entityEditor/EntityEditorDialog.d.ts +38 -0
  42. package/lib/control/{geoObjectEditor/GeoObjectEditorScene.d.ts → entityEditor/EntityEditorScene.d.ts} +28 -12
  43. package/lib/control/{geoObjectEditor/GeoObjectEditorDialog.d.ts → entityEditor/EntityEditorView.d.ts} +22 -23
  44. package/lib/control/entityEditor/ProjectorEditorView.d.ts +31 -0
  45. package/lib/control/{geoObjectEditor → entityEditor}/RotateEntity.d.ts +5 -1
  46. package/lib/control/{geoObjectEditor → entityEditor}/colors.d.ts +2 -2
  47. package/lib/control/entityTree/EntityTree.d.ts +46 -0
  48. package/lib/control/entityTree/EntityTreeView.d.ts +24 -0
  49. package/lib/control/heightRuler/HeightRulerScene.d.ts +3 -2
  50. package/lib/control/index.d.ts +7 -6
  51. package/lib/control/ruler/RulerScene.d.ts +8 -8
  52. package/lib/control/selection/SelectionScene.d.ts +6 -6
  53. package/lib/control/timeline/TimelineControl.d.ts +19 -2
  54. package/lib/control/timeline/TimelineModel.d.ts +1 -1
  55. package/lib/control/timeline/TimelineView.d.ts +52 -13
  56. package/lib/control/visibleExtent/segment.d.ts +7 -0
  57. package/lib/ellipsoid/index.d.ts +4 -4
  58. package/lib/entity/Entity.d.ts +114 -100
  59. package/lib/entity/EntityCollection.d.ts +140 -72
  60. package/lib/entity/{BaseBillboard.d.ts → billboard/BaseBillboard.d.ts} +16 -17
  61. package/lib/entity/{BaseBillboardHandler.d.ts → billboard/BaseBillboardHandler.d.ts} +24 -9
  62. package/lib/entity/{Billboard.d.ts → billboard/Billboard.d.ts} +11 -7
  63. package/lib/entity/{BillboardHandler.d.ts → billboard/BillboardHandler.d.ts} +1 -1
  64. package/lib/entity/{GeoObject.d.ts → geoObject/GeoObject.d.ts} +7 -6
  65. package/lib/entity/{GeoObjectHandler.d.ts → geoObject/GeoObjectHandler.d.ts} +32 -11
  66. package/lib/entity/{InstanceData.d.ts → geoObject/InstanceData.d.ts} +18 -13
  67. package/lib/entity/{Geometry.d.ts → geometry/Geometry.d.ts} +10 -10
  68. package/lib/entity/{GeometryHandler.d.ts → geometry/GeometryHandler.d.ts} +7 -7
  69. package/lib/entity/index.d.ts +8 -8
  70. package/lib/entity/{Label.d.ts → label/Label.d.ts} +12 -13
  71. package/lib/entity/{LabelHandler.d.ts → label/LabelHandler.d.ts} +31 -7
  72. package/lib/entity/{LabelWorker.d.ts → label/LabelWorker.d.ts} +3 -3
  73. package/lib/entity/{PointCloud.d.ts → pointCloud/PointCloud.d.ts} +18 -12
  74. package/lib/entity/{PointCloudHandler.d.ts → pointCloud/PointCloudHandler.d.ts} +4 -4
  75. package/lib/entity/polyline/Polyline.d.ts +242 -0
  76. package/lib/entity/polyline/PolylineBatchRenderer.d.ts +443 -0
  77. package/lib/entity/{PolylineHandler.d.ts → polyline/PolylineHandler.d.ts} +19 -7
  78. package/lib/entity/{Ray.d.ts → ray/Ray.d.ts} +29 -9
  79. package/lib/entity/{RayHandler.d.ts → ray/RayHandler.d.ts} +18 -8
  80. package/lib/entity/{Strip.d.ts → strip/Strip.d.ts} +21 -17
  81. package/lib/entity/{StripHandler.d.ts → strip/StripHandler.d.ts} +11 -6
  82. package/lib/index.d.ts +59 -42
  83. package/lib/layer/BaseGeoImage.d.ts +20 -17
  84. package/lib/layer/BaseTileMaterialLayer.d.ts +36 -0
  85. package/lib/layer/CanvasTiles.d.ts +20 -22
  86. package/lib/layer/GeoImage.d.ts +1 -1
  87. package/lib/layer/GeoTexture2d.d.ts +2 -2
  88. package/lib/layer/KML.d.ts +19 -18
  89. package/lib/layer/Layer.d.ts +72 -53
  90. package/lib/layer/Vector.d.ts +106 -37
  91. package/lib/layer/WMS.d.ts +1 -1
  92. package/lib/layer/XYZ.d.ts +14 -31
  93. package/lib/layer/index.d.ts +12 -12
  94. package/lib/math/Line2.d.ts +10 -1
  95. package/lib/math/Line3.d.ts +1 -1
  96. package/lib/math/Mat3.d.ts +3 -13
  97. package/lib/math/Mat4.d.ts +16 -10
  98. package/lib/math/Plane.d.ts +1 -1
  99. package/lib/math/Quat.d.ts +14 -12
  100. package/lib/math/Ray.d.ts +4 -3
  101. package/lib/math/Vec2.d.ts +25 -17
  102. package/lib/math/Vec3.d.ts +33 -31
  103. package/lib/math/Vec4.d.ts +1 -1
  104. package/lib/math/coder.d.ts +1 -1
  105. package/lib/math/index.d.ts +13 -14
  106. package/lib/mercator.d.ts +4 -4
  107. package/lib/og.css +2 -1
  108. package/lib/og.es.js +1 -1
  109. package/lib/og.es.js.map +1 -1
  110. package/lib/quadTree/EntityCollectionNode.d.ts +10 -10
  111. package/lib/quadTree/EntityCollectionsTreeStrategy.d.ts +8 -5
  112. package/lib/quadTree/QuadTreeStrategy.d.ts +6 -5
  113. package/lib/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +4 -4
  114. package/lib/quadTree/earth/EarthEntityCollectionsTreeStrategy.d.ts +7 -4
  115. package/lib/quadTree/equi/EquiEntityCollectionsTreeStrategy.d.ts +3 -0
  116. package/lib/renderer/AtmosphereDeferredShading.d.ts +12 -0
  117. package/lib/renderer/IDeferredShadingPass.d.ts +8 -0
  118. package/lib/renderer/ITransparencyPass.d.ts +8 -0
  119. package/lib/renderer/PhongDeferredShading.d.ts +18 -0
  120. package/lib/renderer/Renderer.d.ts +195 -100
  121. package/lib/renderer/RendererEvents.d.ts +16 -5
  122. package/lib/renderer/WOITPass.d.ts +14 -0
  123. package/lib/renderer/cascadeShadows/CascadeShadowManager.d.ts +34 -0
  124. package/lib/renderer/cascadeShadows/CascadeShadowMap.d.ts +112 -0
  125. package/lib/renderer/cascadeShadows/cascade_shadow_depth.d.ts +2 -0
  126. package/lib/renderer/projectors/Projector.d.ts +66 -0
  127. package/lib/renderer/projectors/ProjectorManager.d.ts +85 -0
  128. package/lib/renderer/projectors/ProjectorsPass.d.ts +37 -0
  129. package/lib/renderer/shadows/ShadowManager.d.ts +40 -0
  130. package/lib/renderer/shadows/ShadowMap.d.ts +21 -0
  131. package/lib/renderer/textureUnits.d.ts +6 -0
  132. package/lib/res/fonts/Ephesis-Regular.json +1 -0
  133. package/lib/res/fonts/Ephesis-Regular.png +0 -0
  134. package/lib/res/fonts/Karla-Bold.json +1 -0
  135. package/lib/res/fonts/Karla-Bold.png +0 -0
  136. package/lib/res/fonts/Karla-Italic.json +1 -0
  137. package/lib/res/fonts/Karla-Italic.png +0 -0
  138. package/lib/res/fonts/Karla-Light.json +1 -0
  139. package/lib/res/fonts/Karla-Light.png +0 -0
  140. package/lib/res/fonts/Karla-Medium.json +1 -0
  141. package/lib/res/fonts/Karla-Medium.png +0 -0
  142. package/lib/res/fonts/Roboto-Regular.json +1 -37147
  143. package/lib/res/fonts/Roboto-Regular.png +0 -0
  144. package/lib/res/fonts/arial.json +1 -4321
  145. package/lib/res/fonts/arial.png +0 -0
  146. package/lib/res/night-4326.png +0 -0
  147. package/lib/res/night.png +0 -0
  148. package/lib/scene/AltitudeNearPlaneStrategy.d.ts +17 -0
  149. package/lib/scene/Axes.d.ts +4 -3
  150. package/lib/scene/Planet.d.ts +268 -72
  151. package/lib/scene/{RenderNode.d.ts → Scene.d.ts} +47 -51
  152. package/lib/scene/SkyBox.d.ts +7 -4
  153. package/lib/scene/index.d.ts +2 -2
  154. package/lib/segment/Segment.d.ts +38 -15
  155. package/lib/segment/SegmentLonLat.d.ts +0 -1
  156. package/lib/shadeModeConstants.d.ts +7 -0
  157. package/lib/shaders/applyDeferredDepth.d.ts +2 -0
  158. package/lib/shaders/atmos/atmos.d.ts +3 -3
  159. package/lib/shaders/billboard/billboard.d.ts +4 -3
  160. package/lib/shaders/common/uniforms.d.ts +27 -0
  161. package/lib/shaders/deferredShading/deferredShading.d.ts +2 -0
  162. package/lib/shaders/deferredShading/deferredShadingAtmos.d.ts +3 -0
  163. package/lib/shaders/depth.d.ts +2 -2
  164. package/lib/shaders/geo_object/geo_object.d.ts +9 -4
  165. package/lib/shaders/label/label.d.ts +4 -4
  166. package/lib/shaders/pointCloud.d.ts +2 -2
  167. package/lib/shaders/polyline/polyline.d.ts +7 -3
  168. package/lib/shaders/projectorsPass/projectorsPass.d.ts +2 -0
  169. package/lib/shaders/ray/ray.d.ts +3 -2
  170. package/lib/shaders/screenFrame.d.ts +2 -2
  171. package/lib/shaders/segment/segment.d.ts +7 -0
  172. package/lib/shaders/skybox.d.ts +2 -2
  173. package/lib/shaders/strip/strip.d.ts +3 -0
  174. package/lib/shaders/tone_mapping/toneMapping.d.ts +2 -2
  175. package/lib/shaders/varianceBlur.d.ts +2 -0
  176. package/lib/shaders/weightedOITResolve.d.ts +2 -0
  177. package/lib/terrain/BilTerrain.d.ts +1 -1
  178. package/lib/terrain/EmptyTerrain.d.ts +6 -7
  179. package/lib/terrain/GlobusTerrain.d.ts +18 -23
  180. package/lib/terrain/MapterhornTerrain.d.ts +10 -0
  181. package/lib/terrain/RgbTerrain.d.ts +19 -8
  182. package/lib/terrain/index.d.ts +10 -6
  183. package/lib/tsconfig.tsbuildinfo +1 -1
  184. package/lib/ui/Button.d.ts +7 -5
  185. package/lib/ui/ButtonGroup.d.ts +1 -1
  186. package/lib/ui/Checkbox.d.ts +2 -2
  187. package/lib/ui/Color.d.ts +7 -4
  188. package/lib/ui/Dialog.d.ts +30 -3
  189. package/lib/ui/Input.d.ts +19 -3
  190. package/lib/ui/Slider.d.ts +5 -2
  191. package/lib/ui/TitleBarView.d.ts +21 -0
  192. package/lib/ui/ToggleButton.d.ts +2 -2
  193. package/lib/ui/View.d.ts +1 -1
  194. package/lib/ui/icons.d.ts +1 -1
  195. package/lib/ui/index.d.ts +10 -9
  196. package/lib/utils/FontAtlas.d.ts +61 -10
  197. package/lib/utils/GeoImageCreator.d.ts +2 -2
  198. package/lib/utils/ImagesCacheManager.d.ts +3 -3
  199. package/lib/utils/Loader.d.ts +2 -2
  200. package/lib/utils/PlainSegmentWorker.d.ts +2 -2
  201. package/lib/utils/TerrainWorker.d.ts +2 -2
  202. package/lib/utils/TextureAtlas.d.ts +7 -2
  203. package/lib/utils/TextureResourceManager.d.ts +162 -0
  204. package/lib/utils/VectorTileCreator.d.ts +1 -1
  205. package/lib/utils/colorSpace.d.ts +9 -0
  206. package/lib/utils/gltf/gltfParser.d.ts +9 -2
  207. package/lib/utils/gltf/types.d.ts +24 -5
  208. package/lib/utils/shared.d.ts +12 -5
  209. package/lib/utils/textureResourceMeta.d.ts +9 -0
  210. package/lib/webgl/BaseFramebuffer.d.ts +35 -0
  211. package/lib/webgl/Framebuffer.d.ts +14 -13
  212. package/lib/webgl/Handler.d.ts +94 -99
  213. package/lib/webgl/ShaderProgram.d.ts +190 -0
  214. package/lib/webgl/index.d.ts +2 -2
  215. package/lib/webgl/variableHandlers.d.ts +2 -1
  216. package/package.json +79 -76
  217. package/lib/assets/LabelWorker.worker-BT1uJgYn.js.map +0 -1
  218. package/lib/assets/PlainSegmentWorker.worker-CT1cj8jj.js.map +0 -1
  219. package/lib/assets/TerrainWorker.worker-DmikdfB2.js.map +0 -1
  220. package/lib/control/CameraFrameComposer.d.ts +0 -19
  221. package/lib/control/CameraFrameHandler.d.ts +0 -26
  222. package/lib/control/OldMouseNavigation.d.ts +0 -65
  223. package/lib/control/ZoomControl.d.ts +0 -28
  224. package/lib/control/cameraDepthHandler/CameraDepthHandler.d.ts +0 -28
  225. package/lib/control/cameraDepthHandler/camera_depth.d.ts +0 -2
  226. package/lib/control/geoObjectEditor/GeoObjectEditor.d.ts +0 -13
  227. package/lib/control/visibleExtent/drawnode.d.ts +0 -7
  228. package/lib/entity/Polyline.d.ts +0 -417
  229. package/lib/light/LightSource.d.ts +0 -36
  230. package/lib/res/fonts/Roboto-Regular.ttf.cfg +0 -1340
  231. package/lib/res/fonts/Roboto-Regular.ttf.png +0 -0
  232. package/lib/res/fonts/arial.ttf.cfg +0 -1570
  233. package/lib/res/fonts/arial.ttf.png +0 -0
  234. package/lib/scene/BaseNode.d.ts +0 -61
  235. package/lib/shaders/drawnode/drawnode.d.ts +0 -8
  236. package/lib/webgl/Program.d.ts +0 -161
  237. package/lib/webgl/ProgramController.d.ts +0 -87
  238. /package/lib/control/{geoObjectEditor → entityEditor}/ArrowEntity.d.ts +0 -0
  239. /package/lib/control/{geoObjectEditor → entityEditor}/AxisTrackEntity.d.ts +0 -0
  240. /package/lib/control/{geoObjectEditor → entityEditor}/MoveAxisEntity.d.ts +0 -0
  241. /package/lib/control/{geoObjectEditor → entityEditor}/MovePlaneEntity.d.ts +0 -0
  242. /package/lib/entity/{LabelWorker.worker.d.ts → label/LabelWorker.worker.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TerrainWorker.worker-B4Gp0jCy.js","names":[],"sources":["../../src/utils/TerrainWorker.worker.js"],"sourcesContent":["\"use strict\";\n//\n//Terrain worker\n//\n\nfunction binarySearchFast(arr, x) {\n let start = 0,\n end = arr.length - 1;\n while (start <= end) {\n let k = Math.floor((start + end) * 0.5);\n if (Math.abs(arr[k] - x) < 1e-3) return k;\n else if (arr[k] < x) start = k + 1;\n else end = k - 1;\n }\n return -1;\n}\n\nfunction checkNoDataValue(noDataValues, value) {\n return binarySearchFast(noDataValues, value) !== -1;\n}\n\nvar Vec3 = function (x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n};\n\nvar doubleToTwoFloats = function (v, high, low) {\n let x = v.x,\n y = v.y,\n z = v.z;\n\n var doubleHigh;\n\n if (x >= 0.0) {\n doubleHigh = Math.floor(x / 65536.0) * 65536.0;\n high.x = Math.fround(doubleHigh);\n low.x = Math.fround(x - doubleHigh);\n } else {\n doubleHigh = Math.floor(-x / 65536.0) * 65536.0;\n high.x = Math.fround(-doubleHigh);\n low.x = Math.fround(x + doubleHigh);\n }\n\n if (y >= 0.0) {\n doubleHigh = Math.floor(y / 65536.0) * 65536.0;\n high.y = Math.fround(doubleHigh);\n low.y = Math.fround(y - doubleHigh);\n } else {\n doubleHigh = Math.floor(-y / 65536.0) * 65536.0;\n high.y = Math.fround(-doubleHigh);\n low.y = Math.fround(y + doubleHigh);\n }\n\n if (z >= 0.0) {\n doubleHigh = Math.floor(z / 65536.0) * 65536.0;\n high.z = Math.fround(doubleHigh);\n low.z = Math.fround(z - doubleHigh);\n } else {\n doubleHigh = Math.floor(-z / 65536.0) * 65536.0;\n high.z = Math.fround(-doubleHigh);\n low.z = Math.fround(z + doubleHigh);\n }\n};\n\nVec3.prototype.sub = function (v) {\n return new Vec3(this.x - v.x, this.y - v.y, this.z - v.z);\n};\n\nVec3.prototype.add = function (v) {\n return new Vec3(this.x + v.x, this.y + v.y, this.z + v.z);\n};\n\nVec3.prototype.cross = function (v) {\n return new Vec3(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x);\n};\n\nVec3.prototype.normalize = function () {\n var x = this.x,\n y = this.y,\n z = this.z;\n var length = 1.0 / Math.sqrt(x * x + y * y + z * z);\n this.x = x * length;\n this.y = y * length;\n this.z = z * length;\n return this;\n};\n\nVec3.prototype.distance = function (v) {\n return this.sub(v).length();\n};\n\nVec3.prototype.length = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n};\n\nvar blerp = function (x, y, fQ11, fQ21, fQ12, fQ22) {\n return fQ11 * (1.0 - x) * (1.0 - y) + fQ21 * x * (1.0 - y) + fQ12 * (1.0 - x) * y + fQ22 * x * y;\n};\n\nvar _tempVec = new Vec3(0.0, 0.0, 0.0);\nvar _rtcTempVec = new Vec3(0.0, 0.0, 0.0);\n\nvar _tempHigh = new Vec3(0.0, 0.0, 0.0),\n _tempLow = new Vec3(0.0, 0.0, 0.0);\n\nself.onmessage = function (e) {\n var elevations = e.data.elevations,\n this_plainVertices = e.data.this_plainVertices,\n this_plainNormals = e.data.this_plainNormals,\n this_normalMapVertices = e.data.this_normalMapVertices,\n this_normalMapNormals = e.data.this_normalMapNormals,\n heightFactor = e.data.heightFactor,\n gridSize = e.data.gridSize,\n noDataValues = e.data.noDataValues,\n id = e.data.id;\n\n let rtc_x = e.data.relativeCenter[0],\n rtc_y = e.data.relativeCenter[1],\n rtc_z = e.data.relativeCenter[2];\n\n var xmin = 549755748352.0,\n xmax = -549755748352.0,\n ymin = 549755748352.0,\n ymax = -549755748352.0,\n zmin = 549755748352.0,\n zmax = -549755748352.0;\n\n const fileGridSize = Math.sqrt(elevations.length) - 1;\n\n const fileGridSize_one = fileGridSize + 1;\n const fileGridSize_one_x2 = fileGridSize_one * fileGridSize_one;\n const tgs = gridSize;\n const dg = fileGridSize / tgs;\n const gs = tgs + 1;\n const hf = heightFactor;\n\n var vInd = 0,\n noDataInd = 0;\n\n var gsgs3 = gs * gs * 3;\n\n var terrainVertices = new Float64Array(gsgs3),\n terrainVerticesHigh = new Float32Array(gsgs3),\n terrainVerticesLow = new Float32Array(gsgs3),\n noDataVertices = new Uint8Array(gs * gs);\n\n var normalMapNormals, normalMapVertices;\n\n var nv = this_normalMapVertices,\n nn = this_normalMapNormals;\n\n if (fileGridSize >= tgs) {\n normalMapNormals = new Float32Array(fileGridSize_one_x2 * 3);\n normalMapVertices = new Float64Array(fileGridSize_one_x2 * 3);\n\n for (let k = 0; k < fileGridSize_one_x2; k++) {\n var j = k % fileGridSize_one,\n i = ~~(k / fileGridSize_one);\n\n //\n // V0\n //\n var hInd0 = k;\n var vInd0 = hInd0 * 3;\n var currElv = elevations[hInd0];\n if (checkNoDataValue(noDataValues, currElv)) {\n currElv = 0.0;\n }\n var h0 = hf * currElv;\n var v0 = new Vec3(\n rtc_x + nv[vInd0] + h0 * nn[vInd0],\n rtc_y + nv[vInd0 + 1] + h0 * nn[vInd0 + 1],\n rtc_z + nv[vInd0 + 2] + h0 * nn[vInd0 + 2]\n );\n\n normalMapVertices[vInd0] = v0.x - rtc_x;\n normalMapVertices[vInd0 + 1] = v0.y - rtc_y;\n normalMapVertices[vInd0 + 2] = v0.z - rtc_z;\n\n //\n // The vertex goes into screen buffer\n if (i % dg === 0 && j % dg === 0) {\n let currVert = new Vec3(rtc_x + nv[vInd0], rtc_y + nv[vInd0 + 1], rtc_z + nv[vInd0 + 2]);\n let nextVert = new Vec3(rtc_x + nv[vInd0 + 3], rtc_y + nv[vInd0 + 4], rtc_z + nv[vInd0 + 5]);\n\n let nextElv = elevations[hInd0 + 1];\n if (checkNoDataValue(noDataValues, nextElv)) {\n nextElv = 0.0;\n }\n\n let eps = false;\n if (noDataValues.length === 0) {\n let step = currVert.distance(nextVert);\n let deltaElv = Math.abs(currElv - nextElv);\n eps = deltaElv / step > 10.0 || currElv < -5000;\n }\n\n if (eps) {\n noDataVertices[noDataInd] = 1;\n } else {\n noDataVertices[noDataInd] = 0;\n if (v0.x < xmin) xmin = v0.x;\n if (v0.x > xmax) xmax = v0.x;\n if (v0.y < ymin) ymin = v0.y;\n if (v0.y > ymax) ymax = v0.y;\n if (v0.z < zmin) zmin = v0.z;\n if (v0.z > zmax) zmax = v0.z;\n }\n\n let rtc_v0 = new Vec3(v0.x - rtc_x, v0.y - rtc_y, v0.z - rtc_z);\n doubleToTwoFloats(rtc_v0, _tempHigh, _tempLow);\n\n terrainVerticesHigh[vInd] = _tempHigh.x;\n terrainVerticesLow[vInd] = _tempLow.x;\n terrainVertices[vInd++] = rtc_v0.x;\n\n terrainVerticesHigh[vInd] = _tempHigh.y;\n terrainVerticesLow[vInd] = _tempLow.y;\n terrainVertices[vInd++] = rtc_v0.y;\n\n terrainVerticesHigh[vInd] = _tempHigh.z;\n terrainVerticesLow[vInd] = _tempLow.z;\n terrainVertices[vInd++] = rtc_v0.z;\n\n noDataInd++;\n }\n\n if (i !== fileGridSize && j !== fileGridSize) {\n //\n // V1\n //\n var hInd1 = k + 1;\n var vInd1 = hInd1 * 3;\n var elv = elevations[hInd1];\n if (checkNoDataValue(noDataValues, elv)) {\n elv = 0.0;\n }\n var h1 = hf * elv;\n var v1 = new Vec3(\n rtc_x + nv[vInd1] + h1 * nn[vInd1],\n rtc_y + nv[vInd1 + 1] + h1 * nn[vInd1 + 1],\n rtc_z + nv[vInd1 + 2] + h1 * nn[vInd1 + 2]\n );\n\n normalMapVertices[vInd1] = v1.x - rtc_x;\n normalMapVertices[vInd1 + 1] = v1.y - rtc_y;\n normalMapVertices[vInd1 + 2] = v1.z - rtc_z;\n\n //\n // V2\n //\n var hInd2 = k + fileGridSize_one;\n var vInd2 = hInd2 * 3;\n elv = elevations[hInd2];\n if (checkNoDataValue(noDataValues, elv)) {\n elv = 0.0;\n }\n var h2 = hf * elv;\n var v2 = new Vec3(\n rtc_x + nv[vInd2] + h2 * nn[vInd2],\n rtc_y + nv[vInd2 + 1] + h2 * nn[vInd2 + 1],\n rtc_z + nv[vInd2 + 2] + h2 * nn[vInd2 + 2]\n );\n\n normalMapVertices[vInd2] = v2.x - rtc_x;\n normalMapVertices[vInd2 + 1] = v2.y - rtc_y;\n normalMapVertices[vInd2 + 2] = v2.z - rtc_z;\n\n //\n // V3\n //\n var hInd3 = k + fileGridSize_one + 1;\n var vInd3 = hInd3 * 3;\n elv = elevations[hInd3];\n if (checkNoDataValue(noDataValues, elv)) {\n elv = 0.0;\n }\n var h3 = hf * elv;\n var v3 = new Vec3(\n rtc_x + nv[vInd3] + h3 * nn[vInd3],\n rtc_y + nv[vInd3 + 1] + h3 * nn[vInd3 + 1],\n rtc_z + nv[vInd3 + 2] + h3 * nn[vInd3 + 2]\n );\n\n normalMapVertices[vInd3] = v3.x - rtc_x;\n normalMapVertices[vInd3 + 1] = v3.y - rtc_y;\n normalMapVertices[vInd3 + 2] = v3.z - rtc_z;\n\n //\n // Normal\n //\n var e10 = v1.sub(v0),\n e20 = v2.sub(v0),\n e30 = v3.sub(v0);\n\n var sw = e20.cross(e30).normalize();\n var ne = e30.cross(e10).normalize();\n var n0 = ne.add(sw).normalize();\n\n normalMapNormals[vInd0] += n0.x;\n normalMapNormals[vInd0 + 1] += n0.y;\n normalMapNormals[vInd0 + 2] += n0.z;\n\n normalMapNormals[vInd1] += ne.x;\n normalMapNormals[vInd1 + 1] += ne.y;\n normalMapNormals[vInd1 + 2] += ne.z;\n\n normalMapNormals[vInd2] += sw.x;\n normalMapNormals[vInd2 + 1] += sw.y;\n normalMapNormals[vInd2 + 2] += sw.z;\n\n normalMapNormals[vInd3] += n0.x;\n normalMapNormals[vInd3 + 1] += n0.y;\n normalMapNormals[vInd3 + 2] += n0.z;\n }\n }\n } else {\n normalMapNormals = new Float32Array(gsgs3);\n normalMapVertices = new Float64Array(gsgs3);\n\n var oneSize = tgs / fileGridSize;\n var gsgs = gsgs3 / 3;\n var fgsOne = fileGridSize + 1;\n\n for (let i = 0; i < gsgs; i++) {\n let ii = Math.floor(i / gs),\n ij = i % gs;\n\n let qii = ii % oneSize,\n qij = ij % oneSize;\n\n let hlt_ind = Math.floor(ii / oneSize) * fgsOne + Math.floor(ij / oneSize);\n\n if (ij === tgs) {\n hlt_ind -= 1;\n qij = oneSize;\n }\n\n if (ii === tgs) {\n hlt_ind -= fgsOne;\n qii = oneSize;\n }\n\n let hrt_ind = hlt_ind + 1,\n hlb_ind = hlt_ind + fgsOne,\n hrb_ind = hlb_ind + 1;\n\n let h_lt = elevations[hlt_ind],\n h_rt = elevations[hrt_ind],\n h_lb = elevations[hlb_ind],\n h_rb = elevations[hrb_ind];\n\n if (checkNoDataValue(noDataValues, h_lt)) {\n h_lt = 0.0;\n }\n\n if (checkNoDataValue(noDataValues, h_rt)) {\n h_rt = 0.0;\n }\n\n if (checkNoDataValue(noDataValues, h_lb)) {\n h_lb = 0.0;\n }\n\n if (checkNoDataValue(noDataValues, h_rb)) {\n h_rb = 0.0;\n }\n\n let hi = blerp(qij / oneSize, qii / oneSize, h_lt, h_rt, h_lb, h_rb);\n\n let i3 = i * 3;\n\n _rtcTempVec.x = this_plainVertices[i3] + hi * this_plainNormals[i3];\n _rtcTempVec.y = this_plainVertices[i3 + 1] + hi * this_plainNormals[i3 + 1];\n _rtcTempVec.z = this_plainVertices[i3 + 2] + hi * this_plainNormals[i3 + 2];\n\n doubleToTwoFloats(_rtcTempVec, _tempHigh, _tempLow);\n\n terrainVertices[i3] = _rtcTempVec.x;\n terrainVertices[i3 + 1] = _rtcTempVec.y;\n terrainVertices[i3 + 2] = _rtcTempVec.z;\n\n terrainVerticesHigh[i3] = _tempHigh.x;\n terrainVerticesHigh[i3 + 1] = _tempHigh.y;\n terrainVerticesHigh[i3 + 2] = _tempHigh.z;\n\n terrainVerticesLow[i3] = _tempLow.x;\n terrainVerticesLow[i3 + 1] = _tempLow.y;\n terrainVerticesLow[i3 + 2] = _tempLow.z;\n\n _tempVec.x = _rtcTempVec.x + rtc_x;\n _tempVec.y = _rtcTempVec.y + rtc_y;\n _tempVec.z = _rtcTempVec.z + rtc_z;\n\n if (_tempVec.x < xmin) xmin = _tempVec.x;\n if (_tempVec.x > xmax) xmax = _tempVec.x;\n if (_tempVec.y < ymin) ymin = _tempVec.y;\n if (_tempVec.y > ymax) ymax = _tempVec.y;\n if (_tempVec.z < zmin) zmin = _tempVec.z;\n if (_tempVec.z > zmax) zmax = _tempVec.z;\n }\n\n normalMapVertices.set(terrainVertices);\n\n for (let k = 0; k < gsgs; k++) {\n let j = k % gs,\n i = ~~(k / gs);\n\n if (i !== tgs && j !== tgs) {\n let v0ind = k * 3,\n v1ind = v0ind + 3,\n v2ind = v0ind + gs * 3,\n v3ind = v2ind + 3;\n\n let v0 = new Vec3(\n terrainVertices[v0ind] + rtc_x,\n terrainVertices[v0ind + 1] + rtc_y,\n terrainVertices[v0ind + 2] + rtc_z\n ),\n v1 = new Vec3(\n terrainVertices[v1ind] + rtc_x,\n terrainVertices[v1ind + 1] + rtc_y,\n terrainVertices[v1ind + 2] + rtc_z\n ),\n v2 = new Vec3(\n terrainVertices[v2ind] + rtc_x,\n terrainVertices[v2ind + 1] + rtc_y,\n terrainVertices[v2ind + 2] + rtc_z\n ),\n v3 = new Vec3(\n terrainVertices[v3ind] + rtc_x,\n terrainVertices[v3ind + 1] + rtc_y,\n terrainVertices[v3ind + 2] + rtc_z\n );\n\n let e10 = v1.sub(v0).normalize(),\n e20 = v2.sub(v0).normalize(),\n e30 = v3.sub(v0).normalize();\n\n let sw = e20.cross(e30).normalize();\n let ne = e30.cross(e10).normalize();\n let n0 = ne.add(sw).normalize();\n\n normalMapNormals[v0ind] += n0.x;\n normalMapNormals[v0ind + 1] += n0.y;\n normalMapNormals[v0ind + 2] += n0.z;\n\n normalMapNormals[v1ind] += ne.x;\n normalMapNormals[v1ind + 1] += ne.y;\n normalMapNormals[v1ind + 2] += ne.z;\n\n normalMapNormals[v2ind] += sw.x;\n normalMapNormals[v2ind + 1] += sw.y;\n normalMapNormals[v2ind + 2] += sw.z;\n\n normalMapNormals[v3ind] += n0.x;\n normalMapNormals[v3ind + 1] += n0.y;\n normalMapNormals[v3ind + 2] += n0.z;\n }\n }\n }\n\n self.postMessage(\n {\n id: id,\n normalMapNormals: normalMapNormals,\n normalMapVertices: normalMapVertices,\n terrainVertices: terrainVertices,\n terrainVerticesHigh: terrainVerticesHigh,\n terrainVerticesLow: terrainVerticesLow,\n noDataVertices: noDataVertices,\n bounds: [xmin, ymin, zmin, xmax, ymax, zmax],\n relativeCenter: e.data.relativeCenter\n },\n [\n normalMapNormals.buffer,\n normalMapVertices.buffer,\n terrainVertices.buffer,\n terrainVerticesHigh.buffer,\n terrainVerticesLow.buffer,\n noDataVertices.buffer\n ]\n );\n};\n"],"mappings":"yBAiBA,SAAS,EAAiB,EAAc,EAAA,CACpC,OAbJ,SAA0B,EAAK,EAAA,CAC3B,IAAI,EAAQ,EACR,EAAM,EAAI,OAAS,EACvB,KAAO,GAAS,GAAK,CACjB,IAAI,EAAI,KAAK,MAAsB,IAAf,EAAQ,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,EAAM,CAAA,EACvC,eAAgB,EAAE,KAAK,cAAA,EAE3B,CACI,EAAiB,OACjB,EAAkB,OAClB,EAAgB,OAChB,EAAoB,OACpB,EAAmB,OACnB,EAAe,MAAA,CAAA,CAG3B,CAAA,EAAA,CAAA"}
package/lib/bv/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { Box } from './Box';
2
- import { Sphere } from './Sphere';
1
+ import { Box } from "./Box";
2
+ import { Sphere } from "./Sphere";
3
3
  export { Box, Sphere };
@@ -9,10 +9,11 @@ import { Vec2 } from "../math/Vec2";
9
9
  import type { NumberArray2 } from "../math/Vec2";
10
10
  import { Vec3 } from "../math/Vec3";
11
11
  import { Sphere } from "../bv/Sphere";
12
+ import { Ray } from "../math/Ray";
12
13
  import { Quat } from "../math/Quat";
13
14
  import { EasingFunction } from "../utils/easing";
14
15
  import { LonLat } from "../LonLat";
15
- export type CameraEvents = ["viewchange", "moveend", "flystart", "flyend", "flystop"];
16
+ export type CameraEvents = ["viewchange", "moveend", "flystart", "flyend", "flystop", "frustumschanged"];
16
17
  export interface ICameraParams {
17
18
  eye?: Vec3;
18
19
  viewAngle?: number;
@@ -23,6 +24,7 @@ export interface ICameraParams {
23
24
  height?: number;
24
25
  isOrthographic?: boolean;
25
26
  focusDistance?: number;
27
+ reverseDepth?: boolean;
26
28
  }
27
29
  export interface IFlyCartesianParams extends IFlyBaseParams {
28
30
  look?: Vec3 | LonLat;
@@ -35,7 +37,7 @@ export interface IFlyBaseParams {
35
37
  startCallback?: Function;
36
38
  frameCallback?: Function;
37
39
  }
38
- export declare const DEFAULT_FLIGHT_DURATION = 800;
40
+ export declare const DEFAULT_FLIGHT_DURATION = 1000;
39
41
  export declare const DEFAULT_EASING: EasingFunction;
40
42
  type CameraFrame = {
41
43
  eye: Vec3;
@@ -61,8 +63,8 @@ type CameraFlight = {
61
63
  * @param {Vec3} [options.look=[0,0,0]] - Camera look position. Default (0,0,0)
62
64
  * @param {Vec3} [options.up=[0,1,0]] - Camera eye position. Default (0,1,0)
63
65
  *
64
- * @fires EventsHandler<CameraEvents>#viewchange
65
- * @fires EventsHandler<CameraEvents>#moveend
66
+ * @fires viewchange
67
+ * @fires moveend
66
68
  */
67
69
  declare class Camera {
68
70
  static __counter__: number;
@@ -74,7 +76,6 @@ declare class Camera {
74
76
  */
75
77
  events: EventsHandler<CameraEvents>;
76
78
  protected _isOrthographic: boolean;
77
- protected _focusDistance: number;
78
79
  /**
79
80
  * Camera position.
80
81
  * @public
@@ -142,6 +143,12 @@ declare class Camera {
142
143
  protected _pb: Vec3;
143
144
  protected _peye: Vec3;
144
145
  isMoving: boolean;
146
+ protected _pViewAngle: number;
147
+ protected _pAspect: number;
148
+ protected _pWidth: number;
149
+ protected _pHeight: number;
150
+ protected _pIsOrthographic: boolean;
151
+ protected _pFocusDistance: number;
145
152
  protected _tanViewAngle_hrad: number;
146
153
  _tanViewAngle_hradOneByHeight: number;
147
154
  protected _projSizeConst: number;
@@ -150,18 +157,74 @@ declare class Camera {
150
157
  FARTHEST_FRUSTUM_INDEX: number;
151
158
  currentFrustumIndex: number;
152
159
  frustumColorIndex: number;
153
- isFirstPass: boolean;
160
+ isFarthestFrustumActive: boolean;
161
+ /**
162
+ * Reverse-Z depth: GREATER test, clear 0, infinite projection; single frustum with large `far` for culling.
163
+ * @protected
164
+ */
165
+ protected _reverseDepth: boolean;
166
+ protected _depthZeroToOne: boolean;
154
167
  _width: number;
155
168
  _height: number;
156
169
  protected _flight: CameraFlight | null;
157
170
  protected _completeCallback: Function | null;
158
171
  protected _frameCallback: Function | null;
159
172
  protected _flying: boolean;
173
+ slope: number;
160
174
  constructor(options?: ICameraParams);
175
+ /**
176
+ * Returns current projection mode.
177
+ * @public
178
+ * @returns {boolean} `true` when orthographic projection is enabled.
179
+ */
161
180
  get isOrthographic(): boolean;
181
+ /**
182
+ * Returns reverse depth flag.
183
+ * @public
184
+ * @returns {boolean} `true` when reverse depth mode is enabled.
185
+ */
186
+ get reverseDepth(): boolean;
187
+ /**
188
+ * Returns active reverse depth state.
189
+ * @public
190
+ * @returns {boolean} `true` for perspective reverse-Z mode.
191
+ */
192
+ get reverseDepthActive(): boolean;
193
+ /**
194
+ * Returns active depth range mode.
195
+ * @public
196
+ * @returns {boolean} `true` when ZERO_TO_ONE depth range is active.
197
+ */
198
+ get depthZeroToOne(): boolean;
199
+ /**
200
+ * Enables or disables ZERO_TO_ONE depth range mode.
201
+ * @public
202
+ * @param {boolean} enabled - Depth range mode flag.
203
+ */
204
+ setDepthZeroToOne(enabled: boolean): void;
205
+ /**
206
+ * Enables or disables orthographic projection mode.
207
+ * @public
208
+ * @param {boolean} isOrthographic - Orthographic mode flag.
209
+ */
162
210
  set isOrthographic(isOrthographic: boolean);
211
+ /**
212
+ * Returns focus distance used for orthographic projection size.
213
+ * @public
214
+ * @returns {number} Focus distance.
215
+ */
163
216
  get focusDistance(): number;
217
+ /**
218
+ * Sets focus distance used for orthographic projection size.
219
+ * @public
220
+ * @param {number} dist - Focus distance.
221
+ */
164
222
  set focusDistance(dist: number);
223
+ /**
224
+ * Returns camera identifier.
225
+ * @public
226
+ * @returns {number} Camera id.
227
+ */
165
228
  get id(): number;
166
229
  /**
167
230
  * Flies to the cartesian coordinates.
@@ -186,7 +249,27 @@ declare class Camera {
186
249
  * @returns {boolean}
187
250
  */
188
251
  isFlying(): boolean;
189
- checkMoveEnd(): void;
252
+ /**
253
+ * Checks camera movement and projection changes.
254
+ * @public
255
+ */
256
+ checkViewChanges(): void;
257
+ /**
258
+ * Checks whether the camera stopped moving and dispatches `moveend`.
259
+ * @public
260
+ * @returns {boolean} `true` when the camera is moving after the check.
261
+ */
262
+ checkMoveEnd(): boolean;
263
+ /**
264
+ * Checks whether the camera view or projection changed and dispatches `viewchange`.
265
+ * @protected
266
+ */
267
+ protected _checkViewChange(): void;
268
+ /**
269
+ * Binds picking colors for all frustums.
270
+ * @public
271
+ * @param {Renderer} renderer - Renderer instance.
272
+ */
190
273
  bindFrustumsPickingColors(renderer: Renderer): void;
191
274
  /**
192
275
  * Camera initialization.
@@ -200,12 +283,47 @@ declare class Camera {
200
283
  * @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
201
284
  */
202
285
  protected _init(options: ICameraParams): void;
286
+ /**
287
+ * Returns up direction vector.
288
+ * @public
289
+ * @returns {Vec3} Up direction.
290
+ */
203
291
  getUp(): Vec3;
292
+ /**
293
+ * Returns down direction vector.
294
+ * @public
295
+ * @returns {Vec3} Down direction.
296
+ */
204
297
  getDown(): Vec3;
298
+ /**
299
+ * Returns right direction vector.
300
+ * @public
301
+ * @returns {Vec3} Right direction.
302
+ */
205
303
  getRight(): Vec3;
304
+ /**
305
+ * Returns left direction vector.
306
+ * @public
307
+ * @returns {Vec3} Left direction.
308
+ */
206
309
  getLeft(): Vec3;
310
+ /**
311
+ * Returns forward direction vector.
312
+ * @public
313
+ * @returns {Vec3} Forward direction.
314
+ */
207
315
  getForward(): Vec3;
316
+ /**
317
+ * Returns backward direction vector.
318
+ * @public
319
+ * @returns {Vec3} Backward direction.
320
+ */
208
321
  getBackward(): Vec3;
322
+ /**
323
+ * Updates camera slope against the horizontal XZ plane.
324
+ * @public
325
+ */
326
+ updateCameraSlope(): void;
209
327
  /**
210
328
  * Updates camera view space
211
329
  * @public
@@ -217,22 +335,52 @@ declare class Camera {
217
335
  * @public
218
336
  */
219
337
  refresh(): void;
338
+ /**
339
+ * Returns viewport width.
340
+ * @public
341
+ * @returns {number} Viewport width in pixels.
342
+ */
220
343
  get width(): number;
344
+ /**
345
+ * Returns viewport height.
346
+ * @public
347
+ * @returns {number} Viewport height in pixels.
348
+ */
221
349
  get height(): number;
350
+ /**
351
+ * Sets viewport size and updates projection.
352
+ * @public
353
+ * @param {number} width - Viewport width in pixels.
354
+ * @param {number} height - Viewport height in pixels.
355
+ */
222
356
  setViewportSize(width: number, height: number): void;
223
357
  /**
224
- * Returns aspect ratio
358
+ * Returns aspect ratio.
225
359
  * @public
226
- * @returns {number} - Aspect ratio
360
+ * @returns {number} Aspect ratio.
227
361
  */
228
362
  getAspectRatio(): number;
229
363
  /**
230
- * Sets up camera projection
364
+ * Sets camera projection.
231
365
  * @public
232
- * @param {number} viewAngle - Camera view angle
233
- * @param {number} aspect - Screen aspect ratio
366
+ * @param {number} viewAngle - Camera view angle.
367
+ * @param {number} aspect - Screen aspect ratio.
234
368
  */
235
369
  protected _setProj(viewAngle: number, aspect: number): void;
370
+ /**
371
+ * Updates near/far planes for one frustum.
372
+ * @public
373
+ * @param {number} near - Near clipping plane distance.
374
+ * @param {number} [far] - Far clipping plane distance.
375
+ * @param {number} [frustumIndex=0] - Frustum index.
376
+ */
377
+ setNearFar(near: number, far?: number, frustumIndex?: number): void;
378
+ /**
379
+ * Replaces camera frustum ranges.
380
+ * @public
381
+ * @param {Array.<NumberArray2>} frustums - Array of `[near, far]` ranges.
382
+ */
383
+ setFrustums(frustums: [number, number][], focusDistance?: number): void;
236
384
  protected _updateViewportParameters(): void;
237
385
  /**
238
386
  * Sets camera view angle in degrees
@@ -241,13 +389,34 @@ declare class Camera {
241
389
  */
242
390
  setViewAngle(angle: number): void;
243
391
  /**
244
- * Gets camera view angle in degrees
392
+ * Sets camera horizontal view angle in degrees.
393
+ * @public
394
+ * @param {number} angle - Horizontal view angle.
395
+ */
396
+ setHorizontalViewAngle(angle: number): void;
397
+ /**
398
+ * Returns camera vertical view angle in degrees.
245
399
  * @public
246
- * @returns {number} angle -
400
+ * @returns {number} View angle in degrees.
247
401
  */
248
402
  getViewAngle(): number;
403
+ /**
404
+ * Returns camera vertical view angle in degrees.
405
+ * @public
406
+ * @returns {number} Vertical view angle.
407
+ */
249
408
  get viewAngle(): number;
409
+ /**
410
+ * Returns camera vertical view angle in degrees.
411
+ * @public
412
+ * @returns {number} Vertical view angle.
413
+ */
250
414
  get verticalViewAngle(): number;
415
+ /**
416
+ * Returns camera horizontal view angle in degrees.
417
+ * @public
418
+ * @returns {number} Horizontal view angle.
419
+ */
251
420
  get horizontalViewAngle(): number;
252
421
  /**
253
422
  * Sets camera to eye position
@@ -291,34 +460,108 @@ declare class Camera {
291
460
  * @param {number} angle - Delta yaw angle in radians
292
461
  */
293
462
  setYaw(angle: number): void;
463
+ /**
464
+ * Sets camera orientation from Euler angles.
465
+ * @public
466
+ * @param {number} pitch - Pitch angle in radians.
467
+ * @param {number} yaw - Yaw angle in radians.
468
+ * @param {number} roll - Roll angle in radians.
469
+ */
294
470
  setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
471
+ /**
472
+ * Returns pitch angle.
473
+ * @public
474
+ * @returns {number} Pitch angle in radians.
475
+ */
295
476
  getPitch(): number;
477
+ /**
478
+ * Returns yaw angle.
479
+ * @public
480
+ * @returns {number} Yaw angle in radians.
481
+ */
296
482
  getYaw(): number;
483
+ /**
484
+ * Returns roll angle.
485
+ * @public
486
+ * @returns {number} Roll angle in radians.
487
+ */
297
488
  getRoll(): number;
489
+ /**
490
+ * Returns absolute pitch angle.
491
+ * @public
492
+ * @returns {number} Absolute pitch angle in radians.
493
+ */
298
494
  getAbsolutePitch(): number;
495
+ /**
496
+ * Returns absolute yaw angle.
497
+ * @public
498
+ * @returns {number} Absolute yaw angle in radians.
499
+ */
299
500
  getAbsoluteYaw(): number;
501
+ /**
502
+ * Returns absolute roll angle.
503
+ * @public
504
+ * @returns {number} Absolute roll angle in radians.
505
+ */
300
506
  getAbsoluteRoll(): number;
301
507
  /**
302
- * Returns camera quaternion
508
+ * Returns camera rotation quaternion.
509
+ * @public
510
+ * @returns {Quat} Camera rotation quaternion.
303
511
  */
304
512
  getRotation(): Quat;
513
+ /**
514
+ * Sets camera orientation from a quaternion.
515
+ * @public
516
+ * @param {Quat} rot - Rotation quaternion.
517
+ * @param {Vec3} [up] - Base up vector.
518
+ * @param {Vec3} [right] - Base right vector.
519
+ * @param {Vec3} [back] - Base backward vector.
520
+ */
305
521
  setRotation(rot: Quat, up?: Vec3, right?: Vec3, back?: Vec3): void;
522
+ /**
523
+ * Rotates current camera basis by quaternion.
524
+ * @public
525
+ * @param {Quat} rot - Rotation quaternion.
526
+ */
306
527
  rotate(rot: Quat): void;
307
528
  /**
308
529
  * Returns normal vector direction to the unprojected screen point from camera eye
309
530
  * @public
310
- * @param {Vec2} pos - Screen X coordinate
311
- * @returns {Vec3} - Direction vector
531
+ * @param {Vec2} pos - Screen coordinates in pixels.
532
+ * @param {number} [dist] - Optional projection distance for orthographic mode.
533
+ * @param {Vec3} [outPos] - Optional output world position for orthographic mode.
534
+ * @returns {Vec3} - Direction vector.
312
535
  */
313
536
  unproject2v(pos: Vec2, dist?: number, outPos?: Vec3): Vec3;
314
537
  /**
315
538
  * Returns normal vector direction to the unprojected screen point from camera eye
316
539
  * @public
317
- * @param {number} x - Screen X coordinate
318
- * @param {number} y - Screen Y coordinate
319
- * @returns {Vec3} - Direction vector
540
+ * @param {number} x - Screen X coordinate in pixels.
541
+ * @param {number} y - Screen Y coordinate in pixels.
542
+ * @param {number} [dist] - Optional projection distance for orthographic mode.
543
+ * @param {Vec3} [outPos] - Optional output world position for orthographic mode.
544
+ * @returns {Vec3} - Direction vector.
320
545
  */
321
546
  unproject(x: number, y: number, dist?: number, outPos?: Vec3): Vec3;
547
+ /**
548
+ * Returns a world-space ray corresponding to the given screen point.
549
+ * For perspective camera the ray shares camera eye as origin.
550
+ * For orthographic camera the origin is offset across the view plane,
551
+ * and the direction equals the camera forward vector.
552
+ * @public
553
+ * @param {number} x - Screen X coordinate in pixels.
554
+ * @param {number} y - Screen Y coordinate in pixels.
555
+ * @returns {Ray}
556
+ */
557
+ getRay(x: number, y: number, res?: Ray): Ray;
558
+ /**
559
+ * Returns a world-space ray corresponding to the given screen point.
560
+ * @public
561
+ * @param {Vec2} pos - Screen coordinates in pixels.
562
+ * @returns {Ray}
563
+ */
564
+ getRay2v(pos: Vec2): Ray;
322
565
  /**
323
566
  * Gets projected 3d point to the 2d screen coordinates
324
567
  * @public
@@ -346,7 +589,7 @@ declare class Camera {
346
589
  */
347
590
  rotateAround(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
348
591
  /**
349
- * Rotates camera around center point by horizontal.
592
+ * Rotates camera around the center point by horizontal.
350
593
  * @public
351
594
  * @param {number} angle - Rotation angle in radians.
352
595
  * @param {boolean} [isArc] - If true camera up vector gets from current up vector every frame,
@@ -356,14 +599,14 @@ declare class Camera {
356
599
  */
357
600
  rotateHorizontal(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
358
601
  /**
359
- * Rotates camera around center point by vertical.
602
+ * Rotates camera around the center point by vertical.
360
603
  * @param {number} angle - Rotation angle in radians.
361
604
  * @param {Vec3} [center] - Point that the camera rotates around.
362
605
  */
363
606
  rotateVertical(angle: number, center?: Vec3): void;
364
607
  /**
365
608
  * Gets 3d size factor. Uses in LOD distance calculation.
366
- * It is very important function used in Node.ts
609
+ * It is a very important function used in Node.ts
367
610
  * @public
368
611
  * @param {Vec3} p - Point in 3d.
369
612
  * @param {Vec3} r - size.
@@ -377,47 +620,91 @@ declare class Camera {
377
620
  */
378
621
  getViewMatrix(): NumberArray16;
379
622
  /**
380
- * Returns normal matrix.
623
+ * Returns camera normal matrix.
381
624
  * @public
382
- * @returns {NumberArray9} - Normal matrix.
625
+ * @returns {NumberArray9}
383
626
  */
384
627
  getNormalMatrix(): NumberArray9;
628
+ /**
629
+ * Sets current active frustum index.
630
+ * @public
631
+ * @param {number} k - Frustum index.
632
+ */
385
633
  setCurrentFrustum(k: number): void;
634
+ /**
635
+ * Returns current active frustum index.
636
+ * @public
637
+ * @returns {number} Current frustum index.
638
+ */
386
639
  getCurrentFrustum(): number;
640
+ /**
641
+ * Checks whether the sphere intersects any camera frustum.
642
+ * @public
643
+ * @param {Sphere} sphere - Bounding sphere.
644
+ * @returns {boolean} `true` when visible in at least one frustum.
645
+ */
387
646
  containsSphere(sphere: Sphere): boolean;
647
+ /**
648
+ * Checks whether a point is inside any camera frustum.
649
+ * @public
650
+ * @param {Vec3} point - Cartesian point.
651
+ * @returns {boolean} `true` when visible in at least one frustum.
652
+ */
653
+ containsPoint(point: Vec3): boolean;
654
+ /**
655
+ * Returns current active frustum.
656
+ * @public
657
+ * @returns {Frustum} Active frustum instance.
658
+ */
388
659
  get frustum(): Frustum;
389
660
  /**
390
661
  * Returns projection matrix.
391
662
  * @public
392
- * @returns {Mat4} - Projection matrix.
663
+ * @returns {NumberArray16} Projection matrix.
393
664
  */
394
665
  getProjectionMatrix(): NumberArray16;
395
666
  /**
396
- * Returns projection and model matrix product.
667
+ * Returns projection-view matrix.
397
668
  * @public
398
- * @return {Mat4} - Projection-view matrix.
669
+ * @returns {NumberArray16} Projection-view matrix.
399
670
  */
400
671
  getProjectionViewMatrix(): NumberArray16;
401
672
  /**
402
- * Returns projection and model RTE matrix product.
673
+ * Returns projection-view RTE matrix.
403
674
  * @public
404
- * @return {Mat4} - Projection-view matrix.
675
+ * @returns {NumberArray16} Projection-view RTE matrix.
405
676
  */
406
677
  getProjectionViewRTEMatrix(): NumberArray16;
407
678
  /**
408
- * Returns inverse projection and model matrix product.
679
+ * Returns inverse projection-view matrix.
409
680
  * @public
410
- * @returns {Mat4} - Inverse projection-view matrix.
681
+ * @returns {NumberArray16} Inverse projection-view matrix.
411
682
  */
412
683
  getInverseProjectionViewMatrix(): NumberArray16;
413
684
  /**
414
685
  * Returns inverse projection matrix.
415
686
  * @public
416
- * @returns {Mat4} - Inverse projection-view matrix.
687
+ * @returns {NumberArray16} Inverse projection matrix.
417
688
  */
418
689
  getInverseProjectionMatrix(): NumberArray16;
690
+ /**
691
+ * Places camera at a fixed distance from a point and looks at it.
692
+ * @public
693
+ * @param {Vec3} cartesian - Target cartesian point.
694
+ * @param {number} [distance=10000.0] - Distance from the target.
695
+ */
419
696
  viewDistance(cartesian: Vec3, distance?: number): void;
697
+ /**
698
+ * Copies camera pose and projection settings from another camera.
699
+ * @public
700
+ * @param {Camera} cam - Source camera.
701
+ */
420
702
  copy(cam: Camera): void;
703
+ /**
704
+ * Returns camera altitude value for base camera.
705
+ * @public
706
+ * @returns {number} Camera `y` coordinate.
707
+ */
421
708
  getAltitude(): number;
422
709
  }
423
710
  export { Camera };