@openglobus/og 1.0.0-rc2 → 1.0.0-rc20

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 (119) hide show
  1. package/README.md +2 -0
  2. package/lib/Globe.d.ts +21 -8
  3. package/lib/Object3d.d.ts +1 -1
  4. package/lib/assets/LabelWorker.worker-C24YLEkW.js.map +1 -0
  5. package/lib/assets/PlainSegmentWorker.worker-DJHXd0bF.js.map +1 -0
  6. package/lib/assets/TerrainWorker.worker-BwueoQpg.js.map +1 -0
  7. package/lib/camera/Camera.d.ts +57 -8
  8. package/lib/camera/Frustum.d.ts +37 -1
  9. package/lib/camera/PlanetCamera.d.ts +29 -4
  10. package/lib/control/DebugInfo.d.ts +1 -0
  11. package/lib/control/FramebufferPreview.d.ts +18 -2
  12. package/lib/control/FreeNavigation.d.ts +253 -0
  13. package/lib/control/LayerSwitcher.d.ts +18 -0
  14. package/lib/control/Lighting.d.ts +3 -0
  15. package/lib/control/Navigation.d.ts +18 -1
  16. package/lib/control/ShowFps.d.ts +15 -3
  17. package/lib/control/Sun.d.ts +59 -0
  18. package/lib/control/depthCamera/DepthCamera.d.ts +132 -0
  19. package/lib/control/depthCamera/DepthCameraHandler.d.ts +25 -0
  20. package/lib/control/depthCamera/depth_camera.d.ts +2 -0
  21. package/lib/control/entityEditor/CameraEditorView.d.ts +60 -0
  22. package/lib/control/entityEditor/EntityEditor.d.ts +2 -1
  23. package/lib/control/entityEditor/EntityEditorDialog.d.ts +15 -47
  24. package/lib/control/entityEditor/EntityEditorScene.d.ts +16 -0
  25. package/lib/control/entityEditor/EntityEditorView.d.ts +68 -0
  26. package/lib/control/entityEditor/ProjectorEditorView.d.ts +31 -0
  27. package/lib/control/entityEditor/RotateEntity.d.ts +5 -1
  28. package/lib/control/index.d.ts +3 -3
  29. package/lib/control/timeline/TimelineControl.d.ts +86 -0
  30. package/lib/control/timeline/TimelineModel.d.ts +46 -1
  31. package/lib/control/timeline/TimelineView.d.ts +55 -2
  32. package/lib/entity/Entity.d.ts +18 -0
  33. package/lib/entity/EntityCollection.d.ts +71 -13
  34. package/lib/entity/billboard/BaseBillboardHandler.d.ts +16 -0
  35. package/lib/entity/geoObject/GeoObjectHandler.d.ts +3 -0
  36. package/lib/entity/geoObject/InstanceData.d.ts +6 -0
  37. package/lib/entity/geometry/Geometry.d.ts +18 -0
  38. package/lib/entity/geometry/GeometryHandler.d.ts +1 -0
  39. package/lib/entity/label/Label.d.ts +8 -6
  40. package/lib/entity/pointCloud/PointCloud.d.ts +1 -0
  41. package/lib/entity/pointCloud/PointCloudHandler.d.ts +5 -0
  42. package/lib/entity/polyline/Polyline.d.ts +15 -0
  43. package/lib/entity/polyline/PolylineBatchRenderer.d.ts +1 -0
  44. package/lib/entity/polyline/PolylineHandler.d.ts +5 -0
  45. package/lib/entity/ray/Ray.d.ts +2 -0
  46. package/lib/entity/ray/RayHandler.d.ts +1 -0
  47. package/lib/index.d.ts +20 -3
  48. package/lib/input/KeyboardHandler.d.ts +4 -0
  49. package/lib/layer/BaseTileMaterialLayer.d.ts +36 -0
  50. package/lib/layer/CanvasTiles.d.ts +8 -12
  51. package/lib/layer/Layer.d.ts +8 -1
  52. package/lib/layer/Vector.d.ts +74 -18
  53. package/lib/layer/XYZ.d.ts +5 -21
  54. package/lib/math/Line2.d.ts +9 -0
  55. package/lib/math.d.ts +8 -0
  56. package/lib/og.css +2 -1
  57. package/lib/og.es.js +1 -1
  58. package/lib/og.es.js.map +1 -1
  59. package/lib/quadTree/EntityCollectionsTreeStrategy.d.ts +3 -0
  60. package/lib/quadTree/QuadTreeStrategy.d.ts +18 -1
  61. package/lib/quadTree/earth/EarthEntityCollectionsTreeStrategy.d.ts +3 -0
  62. package/lib/quadTree/equi/EquiEntityCollectionsTreeStrategy.d.ts +3 -0
  63. package/lib/renderer/PhongDeferredShading.d.ts +2 -0
  64. package/lib/renderer/Renderer.d.ts +89 -6
  65. package/lib/renderer/RendererEvents.d.ts +2 -0
  66. package/lib/renderer/cascadeShadows/CascadeShadowManager.d.ts +34 -0
  67. package/lib/renderer/cascadeShadows/CascadeShadowMap.d.ts +110 -0
  68. package/lib/renderer/cascadeShadows/cascade_shadow_depth.d.ts +2 -0
  69. package/lib/renderer/projectors/Projector.d.ts +67 -0
  70. package/lib/renderer/projectors/ProjectorManager.d.ts +86 -0
  71. package/lib/renderer/projectors/ProjectorsPass.d.ts +37 -0
  72. package/lib/renderer/shadows/ShadowManager.d.ts +41 -0
  73. package/lib/renderer/shadows/ShadowMap.d.ts +21 -0
  74. package/lib/renderer/textureUnits.d.ts +6 -0
  75. package/lib/scene/Planet.d.ts +80 -8
  76. package/lib/scene/Scene.d.ts +1 -8
  77. package/lib/scene/SkyBox.d.ts +2 -1
  78. package/lib/segment/Segment.d.ts +18 -1
  79. package/lib/shaders/common/uniforms.d.ts +29 -0
  80. package/lib/shaders/geo_object/geo_object.d.ts +1 -0
  81. package/lib/shaders/projectorsPass/projectorsPass.d.ts +2 -0
  82. package/lib/shaders/tone_mapping/toneMapping.d.ts +1 -1
  83. package/lib/shaders/varianceBlur.d.ts +2 -0
  84. package/lib/terrain/EmptyTerrain.d.ts +43 -2
  85. package/lib/terrain/GlobusRgbTerrain.d.ts +1 -0
  86. package/lib/terrain/MapterhornTerrain.d.ts +11 -0
  87. package/lib/terrain/RgbTerrain.d.ts +11 -0
  88. package/lib/terrain/index.d.ts +6 -2
  89. package/lib/ui/Button.d.ts +1 -0
  90. package/lib/ui/Checkbox.d.ts +1 -0
  91. package/lib/ui/Color.d.ts +6 -2
  92. package/lib/ui/Dialog.d.ts +46 -1
  93. package/lib/ui/Dock.d.ts +151 -0
  94. package/lib/ui/Input.d.ts +14 -1
  95. package/lib/ui/Slider.d.ts +1 -0
  96. package/lib/ui/TitleBarView.d.ts +21 -0
  97. package/lib/ui/index.d.ts +2 -0
  98. package/lib/utils/FontAtlas.d.ts +5 -3
  99. package/lib/utils/GeoImageCreator.d.ts +7 -0
  100. package/lib/utils/Loader.d.ts +6 -0
  101. package/lib/utils/NormalMapCreator.d.ts +6 -0
  102. package/lib/utils/TerrainWorker.d.ts +1 -0
  103. package/lib/utils/VectorTileCreator.d.ts +6 -0
  104. package/lib/utils/cameraFootprint.d.ts +72 -0
  105. package/lib/utils/gltf/types.d.ts +5 -4
  106. package/lib/utils/shadowCameraFit.d.ts +175 -0
  107. package/lib/utils/shared.d.ts +11 -0
  108. package/lib/webgl/BaseFramebuffer.d.ts +28 -0
  109. package/lib/webgl/Framebuffer.d.ts +5 -7
  110. package/lib/webgl/Handler.d.ts +28 -0
  111. package/package.json +11 -9
  112. package/lib/assets/LabelWorker.worker-DYd7xn3M.js.map +0 -1
  113. package/lib/assets/PlainSegmentWorker.worker-JsKldq-e.js.map +0 -1
  114. package/lib/assets/TerrainWorker.worker-CqUJvMOv.js.map +0 -1
  115. package/lib/control/CameraFrameComposer.d.ts +0 -19
  116. package/lib/control/CameraFrameHandler.d.ts +0 -26
  117. package/lib/control/cameraDepthHandler/CameraDepthHandler.d.ts +0 -42
  118. package/lib/control/cameraDepthHandler/camera_depth.d.ts +0 -2
  119. package/lib/tsconfig.tsbuildinfo +0 -1
package/README.md CHANGED
@@ -139,3 +139,5 @@ There are many ways to contribute back to the project:
139
139
  ## License
140
140
 
141
141
  ### Apache-2.0
142
+ ---
143
+ OpenGlobus. Precision at all scales.
package/lib/Globe.d.ts CHANGED
@@ -16,10 +16,12 @@ import { QuadTreeStrategy } from "./quadTree";
16
16
  import type { ShadeModeInput } from "./shadeModeConstants";
17
17
  export interface IGlobeParams {
18
18
  attributionContainer?: HTMLElement;
19
+ uiContainer?: HTMLElement;
19
20
  target?: string | HTMLElement;
20
21
  skybox?: Scene;
21
- dpi?: number;
22
+ pixelRatio?: number;
22
23
  msaa?: number;
24
+ deferredDisabled?: boolean;
23
25
  name?: string;
24
26
  frustums?: NumberArray2[];
25
27
  ellipsoid?: Ellipsoid;
@@ -35,16 +37,20 @@ export interface IGlobeParams {
35
37
  maxLoadingRequests?: number;
36
38
  atmosphereEnabled?: boolean;
37
39
  transitionOpacityEnabled?: boolean;
38
- terrain?: EmptyTerrain;
40
+ terrain?: EmptyTerrain | EmptyTerrain[];
39
41
  controls?: Control[];
40
42
  minSlope?: number;
41
43
  sun?: {
42
44
  active?: boolean;
43
45
  stopped?: boolean;
46
+ localDateTime?: Date | null;
44
47
  };
45
48
  navigation?: {
46
49
  active?: boolean;
47
50
  inertia?: number;
51
+ minInertia?: number;
52
+ maxInertia?: number;
53
+ minInertiaAltitude?: number;
48
54
  dragInertia?: number;
49
55
  minSlope?: number;
50
56
  mass?: number;
@@ -66,8 +72,10 @@ export interface IGlobeParams {
66
72
  exposure?: number;
67
73
  maxNodesCount?: number;
68
74
  transparentBackground?: boolean;
75
+ frameOpacity?: number;
69
76
  shadeMode?: ShadeModeInput;
70
77
  reverseDepth?: boolean;
78
+ idleMode?: boolean;
71
79
  }
72
80
  /**
73
81
  * @typedef {Array<number>} LonLatCoordinate
@@ -98,31 +106,36 @@ export interface IGlobeParams {
98
106
  * @param {IGlobeParams} options - Options:
99
107
  * @param {string|HTMLElement} options.target - HTML element id where planet canvas have to be created.
100
108
  * @param {string} [options.name] - Planet name. Default is uniq identifier.
101
- * @param {EmptyTerrain} [options.terrain] - Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
109
+ * @param {EmptyTerrain | Array.<EmptyTerrain>} [options.terrain] - Terrain provider or providers array, where the first one becomes active. Default no terrain - og.terrain.EmptyTerrain.
102
110
  * @param {Array.<Control>} [options.controls] - Controls.
103
111
  * @param {Array.<Layer>} [options.layers] - Planet layers.
104
112
  * @param {Extent | ExtentBoundingBox} [options.viewExtent] [options.viewExtent] - Viewable starting extent.
105
113
  * @param {boolean} [options.autoActivate=true] - Globe rendering auto activation flag. True is default.
114
+ * @param {boolean} [options.idleMode=false] - Skips a frame rendering when nothing has been changed. False is default.
106
115
  * @param {HTMLElement} [options.attributionContainer] - Container for attribution list.
116
+ * @param {HTMLElement} [options.uiContainer] - Container for dialogs, the render container by default.
107
117
  * @param {number} [options.maxGridSize=128] = Maximal segment grid size. 128 is default
108
- * @param {string} [options.fontsSrc] - Fonts collection url.
118
+ * @param {string} [options.fontsSrc] - Fonts collection url.
109
119
  * @param {string} [options.resourcesSrc] - Resources root src.
110
- * @param {string} [options.nightTextureSrc] - Night glowing image sources
120
+ * @param {string} [options.nightTextureSrc] - Night-glowing image sources
111
121
  * @param {string} [options.specularTextureSrc] - Specular water mask image sourcr
112
- * @param {number} [options.maxAltitude=15000000.0] - Maximal camera altitude above terrain
122
+ * @param {number} [options.maxAltitude] - Maximal camera altitude above terrain
113
123
  * @param {number} [options.minAltitude=1.0] - Minimal camera altitude above terrain
114
- * @param {number} [options.maxEqualZoomAltitude=15000000.0] - Maximal altitude since segments on the screen became the same zoom level
124
+ * @param {number} [options.maxEqualZoomAltitude] - Maximal altitude since segments on the screen became the same zoom level
115
125
  * @param {number} [options.minEqualZoomAltitude=10000.0] - Minimal altitude since segments on the screen became the same zoom level
116
126
  * @param {number} [options.minEqualZoomCameraSlope=0.8] - Minimal camera slope above the globe where segments on the screen became the same zoom level
117
127
  * @param {number} [options.loadingBatchSize=12] -
118
128
  * @param {number} [options.quadTreeStrategyPrototype] - Prototype of quadTree. QuadTreeStrategy for Earth is default.
119
129
  * @param {number} [options.msaa=0] - MSAA antialiasing parameter: 2,4,8,16. Default is 0.
120
- * @param {number} [options.dpi] - Device pixel ratio. Default is current screen DPI.
130
+ * @param {boolean} [options.deferredDisabled=false] - Disables deferred and WOIT pipelines and renders objects with forward shaders.
131
+ * @param {number} [options.pixelRatio] - Device pixel ratio. Default is current screen DPI.
121
132
  * @param {boolean} [options.atmosphereEnabled] - Enables atmosphere effect.
122
133
  * @param {boolean} [options.transtitionOpacityEnabled] - Enables terrain smooth opacity transition effect.
123
134
  * @param {IAtmosphereParams} [options.atmosphereParameters] - Atmosphere model parameters.
124
135
  * @param {number} [options.gamma] - Gamma
125
136
  * @param {number} [options.exposure] - Exposure
137
+ * @param {boolean} [options.transparentBackground=false] - Enables a transparent WebGL canvas background so HTML behind the globe container remains visible.
138
+ * @param {number} [options.frameOpacity=1.0] - Frame opacity applied by renderer transparency flags.
126
139
  * @param {boolean} [options.reverseDepth=true] - Enables reverse-Z depth for the planet camera perspective mode.
127
140
  */
128
141
  declare class Globe {
package/lib/Object3d.d.ts CHANGED
@@ -71,7 +71,7 @@ declare class Object3d {
71
71
  static scale(vertices: number[], s: Vec3): void;
72
72
  static centroid(vertices: number[]): number[];
73
73
  static translate(vertices: number[], v: NumberArray3): void;
74
- static getNormals(vertices: number[]): number[];
74
+ static getNormals(vertices: number[], indices?: number[]): number[];
75
75
  static createSphere(lonBands?: number, latBands?: number, radius?: number, offsetX?: number, offsetY?: number, offsetZ?: number): Object3d;
76
76
  static createDisc(radius?: number, height?: number, radialSegments?: number, isTop?: boolean, startIndex?: number, offsetX?: number, offsetY?: number, offsetZ?: number): Object3d;
77
77
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LabelWorker.worker-C24YLEkW.js","names":[],"sources":["../../src/entity/label/LabelWorker.worker.js"],"sourcesContent":["\"use strict\";\n\nfunction concatTypedArrays(dest, index, source) {\n let len = source.length,\n offset = index * len;\n for (let i = 0; i < len; i++) {\n dest[offset + i] = source[i];\n }\n}\n\nfunction srgbToLinear(v) {\n return Math.pow(v, 2.2);\n}\n\nself.onmessage = function (e) {\n var labelData = e.data.labelData,\n id = labelData[0],\n maxLetters = labelData[1],\n isVisible = labelData[2],\n /*3, 4, 5*/ _positionHigh_x = labelData[3],\n _positionHigh_y = labelData[4],\n _positionHigh_z = labelData[5],\n /*6, 7, 8*/ _positionLow_x = labelData[6],\n _positionLow_y = labelData[7],\n _positionLow_z = labelData[8],\n /*9*/ _size = labelData[9],\n /*10, 11*/ _offset_x = labelData[10],\n _offset_y = labelData[11],\n /*12, 13, 14, 15*/ _color_x = labelData[12],\n _color_y = labelData[13],\n _color_z = labelData[14],\n _color_w = labelData[15],\n /*16*/ _rotation = labelData[16],\n /*17, 18, 19*/ _alignedAxis_x = labelData[17],\n _alignedAxis_y = labelData[18],\n _alignedAxis_z = labelData[19],\n /*20*/ _fontIndex = labelData[20],\n /*21*/ _outline = labelData[21],\n /*22, 23, 24, 25*/ _outlineColor_x = labelData[22],\n _outlineColor_y = labelData[23],\n _outlineColor_z = labelData[24],\n _outlineColor_w = labelData[25],\n /*26, 27, 28*/ _pickingColor_x = labelData[26],\n _pickingColor_y = labelData[27],\n _pickingColor_z = labelData[28];\n\n let _vertexArr = new Float32Array(maxLetters * 12),\n _texCoordArr = new Float32Array(maxLetters * 24),\n _gliphParamArr = new Float32Array(maxLetters * 24),\n _positionHighArr = new Float32Array(maxLetters * 18),\n _positionLowArr = new Float32Array(maxLetters * 18),\n _sizeArr = new Float32Array(maxLetters * 6),\n _offsetArr = new Float32Array(maxLetters * 12),\n _rgbaArr = new Float32Array(maxLetters * 24),\n _rotationArr = new Float32Array(maxLetters * 6),\n _alignedAxisArr = new Float32Array(maxLetters * 18),\n _fontIndexArr = new Float32Array(maxLetters * 6),\n _outlineArr = new Float32Array(maxLetters * 6),\n _outlineColorArr = new Float32Array(maxLetters * 24),\n _pickingColorArr = new Float32Array(maxLetters * 18);\n\n for (let i = 0; i < maxLetters; i++) {\n if (isVisible !== 0) {\n concatTypedArrays(_vertexArr, i, [0, 0, 0, -1, 1, -1, 1, -1, 1, 0, 0, 0]);\n } else {\n concatTypedArrays(_vertexArr, i, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n }\n\n concatTypedArrays(\n _texCoordArr,\n i,\n [0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0]\n );\n concatTypedArrays(_gliphParamArr, i, [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0]);\n\n var x = _positionHigh_x,\n y = _positionHigh_y,\n z = _positionHigh_z,\n w;\n concatTypedArrays(_positionHighArr, i, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);\n\n x = _positionLow_x;\n y = _positionLow_y;\n z = _positionLow_z;\n concatTypedArrays(_positionLowArr, i, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);\n\n x = _size;\n concatTypedArrays(_sizeArr, i, [x, x, x, x, x, x]);\n\n x = _offset_x;\n y = _offset_y;\n concatTypedArrays(_offsetArr, i, [x, y, x, y, x, y, x, y, x, y, x, y]);\n\n x = srgbToLinear(_color_x);\n y = srgbToLinear(_color_y);\n z = srgbToLinear(_color_z);\n w = _color_w;\n concatTypedArrays(_rgbaArr, i, [x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w]);\n\n x = _rotation;\n concatTypedArrays(_rotationArr, i, [x, x, x, x, x, x]);\n\n x = _alignedAxis_x;\n y = _alignedAxis_y;\n z = _alignedAxis_z;\n concatTypedArrays(_alignedAxisArr, i, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);\n\n x = _fontIndex;\n concatTypedArrays(_fontIndexArr, i, [x, x, x, x, x, x]);\n\n x = _outline;\n concatTypedArrays(_outlineArr, i, [x, x, x, x, x, x]);\n\n x = srgbToLinear(_outlineColor_x);\n y = srgbToLinear(_outlineColor_y);\n z = srgbToLinear(_outlineColor_z);\n w = _outlineColor_w;\n concatTypedArrays(_outlineColorArr, i, [\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w\n ]);\n\n x = _pickingColor_x / 255;\n y = _pickingColor_y / 255;\n z = _pickingColor_z / 255;\n concatTypedArrays(_pickingColorArr, i, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);\n }\n\n self.postMessage(\n {\n id: id,\n vertexArr: _vertexArr,\n texCoordArr: _texCoordArr,\n gliphParamArr: _gliphParamArr,\n positionHighArr: _positionHighArr,\n positionLowArr: _positionLowArr,\n sizeArr: _sizeArr,\n offsetArr: _offsetArr,\n rgbaArr: _rgbaArr,\n rotationArr: _rotationArr,\n alignedAxisArr: _alignedAxisArr,\n fontIndexArr: _fontIndexArr,\n outlineArr: _outlineArr,\n outlineColorArr: _outlineColorArr,\n pickingColorArr: _pickingColorArr\n },\n [\n _vertexArr.buffer,\n _texCoordArr.buffer,\n _gliphParamArr.buffer,\n _positionHighArr.buffer,\n _positionLowArr.buffer,\n _sizeArr.buffer,\n _offsetArr.buffer,\n _rgbaArr.buffer,\n _rotationArr.buffer,\n _alignedAxisArr.buffer,\n _fontIndexArr.buffer,\n _outlineArr.buffer,\n _outlineColorArr.buffer,\n _pickingColorArr.buffer\n ]\n );\n};\n"],"mappings":"yBAEA,SAAS,EAAkB,EAAM,EAAO,EAAA,CACpC,IAAI,EAAM,EAAO,OACb,EAAS,EAAQ,EACrB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,IACrB,EAAK,EAAS,GAAK,EAAO,EAElC,CAEA,SAAS,EAAa,EAAA,CAClB,OAAgB,GAAG,GACvB,CAEA,KAAK,UAAY,SAAU,EAAA,CACvB,IAAI,EAAY,EAAE,KAAK,UACnB,EAAK,EAAU,GACf,EAAa,EAAU,GACvB,EAAY,EAAU,GACV,EAAkB,EAAU,GACxC,EAAkB,EAAU,GAC5B,EAAkB,EAAU,GAChB,EAAiB,EAAU,GACvC,EAAiB,EAAU,GAC3B,EAAiB,EAAU,GACrB,EAAQ,EAAU,GACb,EAAY,EAAU,IACjC,EAAY,EAAU,IACH,EAAW,EAAU,IACxC,EAAW,EAAU,IACrB,EAAW,EAAU,IACrB,EAAW,EAAU,IACd,EAAY,EAAU,IACd,EAAiB,EAAU,IAC1C,EAAiB,EAAU,IAC3B,EAAiB,EAAU,IACpB,EAAa,EAAU,IACvB,EAAW,EAAU,IACT,EAAkB,EAAU,IAC/C,EAAkB,EAAU,IAC5B,E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EAAG,CAAA,CAAA,EAMlD,EAAkB,EAAkB,EAAG,CAJvC,EAAI,EAAa,CAAA,EACjB,EAAI,EAAa,CAAA,EACjB,EAAI,EAAa,CAAA,EACjB,EAAI,EAMA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CAAA,CAAA,EAMJ,EAAkB,EAAkB,EAAG,CAHvC,EAAI,EAAkB,IACtB,EAAI,EAAkB,IACtB,EAAI,EAAkB,IAC2B,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAA,CAAA,CAC/F,CAEA,KAAK,YACD,CACQ,GAAA,EACJ,UAAW,EACX,YAAa,EACb,cAAe,EACf,gBAAiB,EACjB,eAAgB,EAChB,QAAS,EACT,UAAW,EACX,QAAS,EACT,YAAa,EACb,eAAgB,EAChB,aAAc,EACd,WAAY,EACZ,gBAAiB,EACjB,gBAAiB,CAAA,EAErB,CACI,EAAW,OACX,EAAa,OACb,EAAe,OACf,EAAiB,OACjB,EAAgB,OAChB,EAAS,OACT,EAAW,OACX,EAAS,OACT,EAAa,OACb,EAAgB,OAChB,EAAc,OACd,EAAY,OACZ,EAAiB,OACjB,EAAiB,MAAA,CAAA,CAG7B,CAAA,EAAA,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlainSegmentWorker.worker-DJHXd0bF.js","names":[],"sources":["../../src/utils/PlainSegmentWorker.worker.js"],"sourcesContent":["\"use strict\";\n\nlet model = null;\n\nlet cached_ix = null;\nlet cached_iy = null;\nlet v00 = null;\nlet v01 = null;\nlet v10 = null;\nlet v11 = null;\n//let t = null;\n\nfunction rawval(ix, iy) {\n if (iy < 0) {\n iy = -iy;\n ix += model.width / 2;\n } else if (iy >= model.height) {\n iy = 2 * (model.height - 1) - iy;\n ix += model.width / 2;\n }\n\n if (ix < 0) {\n ix += model.width;\n } else if (ix >= model.width) {\n ix -= model.width;\n }\n\n var k = (iy * model.width + ix) * 2 + model.i;\n\n return (model.rawfile[k] << 8) | model.rawfile[k + 1];\n}\n\nfunction getHeightMSL(lon, lat) {\n if (!model) return 0;\n\n if (lon < 0) lon += 360.0;\n\n var fy = (90 - lat) * model.rlatres;\n var fx = lon * model.rlonres;\n var iy = Math.floor(fy);\n var ix = Math.floor(fx);\n\n fx -= ix;\n fy -= iy;\n\n if (iy === model.height - 1) {\n iy--;\n }\n\n if (cached_ix !== ix || cached_iy !== iy) {\n cached_ix = ix;\n cached_iy = iy;\n\n v00 = rawval(ix, iy);\n v01 = rawval(ix + 1, iy);\n v10 = rawval(ix, iy + 1);\n v11 = rawval(ix + 1, iy + 1);\n }\n\n let h = null;\n\n var a = (1 - fx) * v00 + fx * v01;\n var b = (1 - fx) * v10 + fx * v11;\n\n h = (1 - fy) * a + fy * b;\n\n return model.offset + model.scale * h;\n}\n\nconst HALF_PI = Math.PI * 0.5;\nconst POLE = 20037508.34;\nconst PI_BY_POLE = Math.PI / POLE;\nconst INV_POLE_BY_180 = 180.0 / POLE;\nconst INV_PI_BY_180 = 180.0 / Math.PI;\nconst INV_PI_BY_180_HALF_PI = INV_PI_BY_180 * HALF_PI;\nconst RADIANS = Math.PI / 180.0;\nconst INV_PI_BY_360 = INV_PI_BY_180 * 2.0;\n\nlet E2 = 0.0,\n A = 0.0;\n\nlet _projFunc = null;\n\nconst Vec3 = function (x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n};\n\nvar geodeticToCartesian = function (lon, lat, heightFactor, res) {\n let h = getHeightMSL(lon, lat) * heightFactor;\n\n let latrad = RADIANS * lat,\n lonrad = RADIANS * lon;\n\n let slt = Math.sin(latrad);\n\n let N = A / Math.sqrt(1.0 - E2 * slt * slt);\n let nc = (N + h) * Math.cos(latrad);\n\n res.x = nc * Math.cos(lonrad);\n res.y = nc * Math.sin(lonrad);\n res.z = (N * (1 - E2) + h) * slt;\n};\n\nvar geodeticToCartesianInverse = function (lon, lat, heightFactor, res) {\n geodeticToCartesian(\n lon * INV_POLE_BY_180,\n INV_PI_BY_360 * Math.atan(Math.exp(lat * PI_BY_POLE)) - INV_PI_BY_180_HALF_PI,\n heightFactor,\n res\n );\n};\n\nvar worldPos = new Vec3(0.0, 0.0, 0.0);\nvar rtcPos = new Vec3(0.0, 0.0, 0.0);\nvar _tempHigh = new Vec3(0.0, 0.0, 0.0);\nvar _tempLow = new Vec3(0.0, 0.0, 0.0);\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\nself.onmessage = function (msg) {\n if (msg.data.model) {\n model = msg.data.model;\n model.rawfile = msg.data.rawfile;\n } else if (msg.data.params) {\n let rtc_x = msg.data.params[14];\n let rtc_y = msg.data.params[15];\n let rtc_z = msg.data.params[16];\n\n let 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 E2 = msg.data.params[8];\n A = msg.data.params[9];\n\n let gridSize = msg.data.params[2],\n fgs = msg.data.params[3],\n r2_x = msg.data.params[10],\n r2_y = msg.data.params[11],\n r2_z = msg.data.params[12];\n\n let heightFactor = msg.data.params[13];\n\n if (msg.data.params[1] === 0.0) {\n _projFunc = geodeticToCartesianInverse;\n } else {\n _projFunc = geodeticToCartesian;\n }\n\n let maxFgs = Math.max(fgs, gridSize);\n let llStep = (msg.data.params[6] - msg.data.params[4]) / maxFgs;\n let ltStep = (msg.data.params[7] - msg.data.params[5]) / maxFgs;\n\n let esw_lon = msg.data.params[4],\n ene_lat = msg.data.params[7];\n\n let dg = Math.max(fgs / gridSize, 1.0),\n gs = maxFgs + 1;\n\n const gsgs = gs * gs;\n\n const gridSize3 = (gridSize + 1) * (gridSize + 1) * 3;\n\n let plainNormals = new Float32Array(gridSize3);\n\n let plainVertices = new Float64Array(gridSize3);\n let plainVerticesHigh = new Float32Array(gridSize3);\n let plainVerticesLow = new Float32Array(gridSize3);\n let normalMapNormals = new Float32Array(gsgs * 3);\n let normalMapVertices = new Float64Array(gsgs * 3);\n\n let ind = 0,\n nmInd = 0;\n\n for (let k = 0; k < gsgs; k++) {\n let j = k % gs,\n i = ~~(k / gs);\n\n _projFunc(esw_lon + j * llStep, ene_lat - i * ltStep, heightFactor, worldPos);\n\n let nx = worldPos.x * r2_x,\n ny = worldPos.y * r2_y,\n nz = worldPos.z * r2_z;\n let l = 1.0 / Math.sqrt(nx * nx + ny * ny + nz * nz);\n let nxl = nx * l,\n nyl = ny * l,\n nzl = nz * l;\n\n rtcPos.x = worldPos.x - rtc_x;\n rtcPos.y = worldPos.y - rtc_y;\n rtcPos.z = worldPos.z - rtc_z;\n\n normalMapVertices[nmInd] = rtcPos.x;\n normalMapNormals[nmInd++] = nxl;\n\n normalMapVertices[nmInd] = rtcPos.y;\n normalMapNormals[nmInd++] = nyl;\n\n normalMapVertices[nmInd] = rtcPos.z;\n normalMapNormals[nmInd++] = nzl;\n\n if (i % dg === 0 && j % dg === 0) {\n doubleToTwoFloats(rtcPos, _tempHigh, _tempLow);\n\n plainVertices[ind] = rtcPos.x;\n plainVerticesHigh[ind] = _tempHigh.x;\n plainVerticesLow[ind] = _tempLow.x;\n plainNormals[ind++] = nxl;\n\n plainVertices[ind] = rtcPos.y;\n plainVerticesHigh[ind] = _tempHigh.y;\n plainVerticesLow[ind] = _tempLow.y;\n plainNormals[ind++] = nyl;\n\n plainVertices[ind] = rtcPos.z;\n plainVerticesHigh[ind] = _tempHigh.z;\n plainVerticesLow[ind] = _tempLow.z;\n plainNormals[ind++] = nzl;\n\n if (worldPos.x < xmin) xmin = worldPos.x;\n if (worldPos.x > xmax) xmax = worldPos.x;\n if (worldPos.y < ymin) ymin = worldPos.y;\n if (worldPos.y > ymax) ymax = worldPos.y;\n if (worldPos.z < zmin) zmin = worldPos.z;\n if (worldPos.z > zmax) zmax = worldPos.z;\n }\n }\n\n let x = (xmax - xmin) * 0.5,\n y = (ymax - ymin) * 0.5,\n z = (zmax - zmin) * 0.5;\n\n let plainRadius = Math.sqrt(x * x + y * y + z * z);\n\n self.postMessage(\n {\n id: msg.data.params[0],\n plainVertices: plainVertices,\n plainVerticesHigh: plainVerticesHigh,\n plainVerticesLow: plainVerticesLow,\n plainNormals: plainNormals,\n normalMapNormals: normalMapNormals,\n normalMapVertices: normalMapVertices,\n plainRadius: plainRadius,\n relativeCenter: [rtc_x, rtc_y, rtc_z]\n },\n [\n plainVertices.buffer,\n plainVerticesHigh.buffer,\n plainVerticesLow.buffer,\n plainNormals.buffer,\n normalMapNormals.buffer,\n normalMapVertices.buffer\n ]\n );\n }\n};\n"],"mappings":"yBAEA,IAAI,EAAQ,KAER,EAAY,KACZ,EAAY,KACZ,EAAM,KACN,EAAM,KACN,EAAM,KACN,EAAM,KAGV,SAAS,EAAO,EAAI,EAAA,CACZ,EAAK,GACL,EAAA,CAAM,EACN,GAAM,EAAM,MAAQ,GACb,GAAM,EAAM,SACnB,EA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,IAAM,EAAO,EAAS,GACnC,EAAS,EAAI,IAAM,EAAO,EAAS,GACnC,EAAS,EAAI,IAAM,EAAO,EAAS,GACnC,EAAS,EAAI,IAAM,EAAO,EAAS,GACnC,EAAS,EAAI,IAAM,EAAO,EAAS,GAE/C,CAEA,IAAI,EAAoB,IAAf,EAAO,GACZ,EAAoB,IAAf,EAAO,GACZ,EAAoB,IAAf,EAAO,GAEZ,EAAc,KAAK,KAAK,EAAI,EAAI,EAAI,EAAI,EAAI,CAAA,EAEhD,KAAK,YACD,CACI,GAAI,EAAI,KAAK,OAAO,GACL,cAAA,EACI,kBAAA,EACD,iBAAA,EACJ,aAAA,EACI,iBAAA,EACC,kBAAA,EACN,YAAA,EACb,eAAgB,CAAC,EAAO,EAAO,CAAA,CAAA,EAEnC,CACI,EAAc,OACd,EAAkB,OAClB,EAAiB,OACjB,EAAa,OACb,EAAiB,OACjB,EAAkB,MAAA,CAAA,CAG9B,CACJ,CAAA,EAAA,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TerrainWorker.worker-BwueoQpg.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 // Squared geocentric distance of the same vertices. The axis aligned bounds above cannot tell\n // relief from segment size, because the box of a tilted patch is far larger than the patch, so\n // the radius range is accumulated here instead. Kept squared to avoid a root per vertex.\n var r2min = Infinity,\n r2max = -Infinity;\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 let r2_v0 = v0.x * v0.x + v0.y * v0.y + v0.z * v0.z;\n if (r2_v0 < r2min) r2min = r2_v0;\n if (r2_v0 > r2max) r2max = r2_v0;\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 let r2_tmp = _tempVec.x * _tempVec.x + _tempVec.y * _tempVec.y + _tempVec.z * _tempVec.z;\n if (r2_tmp < r2min) r2min = r2_tmp;\n if (r2_tmp > r2max) r2max = r2_tmp;\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 radiusRange: r2max >= r2min ? [Math.sqrt(r2min), Math.sqrt(r2max)] : null,\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,EAAA,EAC5B,GAAI,KAAK,IAAI,EAAI,GAAK,CAAA,EAAK,KAAM,OAAO,EAC/B,EAAI,GAAK,EAAG,EAAQ,EAAI,EAC5B,EAAM,EAAI,CACnB,CACA,MAAA,EACJ,EAG4B,EAAc,CAAA,IAAtC,EACJ,CAEA,IAAI,EAAO,SAAU,EAAG,EAAG,EAAA,CACvB,KAAK,EAAI,EACT,KAAK,EAAI,EACT,KAAK,EAAI,CACb,EAEI,EAAoB,SAAU,EAAG,EAAM,EAAA,CACvC,IAAI,EAAI,EAAE,EACN,EAAI,EAAE,EACN,EAAI,EAAE,EAEV,IAAI,EAEA,GAAK,GACL,EAAuC,MAA1B,KAAK,MAAM,EAAI,KAAA,EAC5B,EAAK,EAAI,KAAK,OAAO,CAAA,EACrB,EAAI,EAAI,KAAK,OAAO,EAAI,CAAA,IAExB,EAAwC,MAA3B,KAAK,MAAA,CAAO,EAAI,KAAA,EAC7B,EAAK,EAAI,KAAK,OAAA,CAAQ,CAAA,EACtB,EAAI,EAAI,KAAK,OAAO,EAAI,CAAA,GAGxB,GAAK,GACL,EAAuC,MAA1B,KAAK,MAAM,EAAI,KAAA,EAC5B,EAAK,EAAI,KAAK,OAAO,CAAA,EACrB,EAAI,EAAI,KAAK,OAAO,EA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EACjB,EAAM,EAAG,IAAI,CAAA,CAAA,CAAI,UAAA,EACjB,EAAM,EAAG,IAAI,CAAA,CAAA,CAAI,UAAA,EAEjB,EAAK,EAAI,MAAM,CAAA,CAAA,CAAK,UAAA,EACpB,EAAK,EAAI,MAAM,CAAA,CAAA,CAAK,UAAA,EACpB,EAAK,EAAG,IAAI,CAAA,CAAA,CAAI,UAAA,EAEpB,EAAiB,IAAU,EAAG,EAC9B,EAAiB,EAAQ,IAAM,EAAG,EAClC,EAAiB,EAAQ,IAAM,EAAG,EAElC,EAAiB,IAAU,EAAG,EAC9B,EAAiB,EAAQ,IAAM,EAAG,EAClC,EAAiB,EAAQ,IAAM,EAAG,EAElC,EAAiB,IAAU,EAAG,EAC9B,EAAiB,EAAQ,IAAM,EAAG,EAClC,EAAiB,EAAQ,IAAM,EAAG,EAElC,EAAiB,IAAU,EAAG,EAC9B,EAAiB,EAAQ,IAAM,EAAG,EAClC,EAAiB,EAAQ,IAAM,EAAG,CACtC,CAER,CAEA,KAAK,YACD,CACQ,GAAA,GACc,iBAAA,EACC,kBAAA,EACF,gBAAA,EACI,oBAAA,EACD,mBAAA,EACJ,eAAA,GAChB,OAAQ,CAAC,EAAM,EAAM,EAAM,EAAM,EAAM,CAAA,EACvC,YAAa,GAAS,EAAQ,CAAC,KAAK,KAAK,CAAA,EAAQ,KAAK,KAAK,CAAA,CAAA,EAAU,KACrE,eAAgB,EAAE,KAAK,cAAA,EAE3B,CACI,EAAiB,OACjB,EAAkB,OAClB,EAAgB,OAChB,EAAoB,OACpB,EAAmB,OACnB,GAAe,MAAA,CAAA,CAG3B,CAAA,EAAA,CAAA"}
@@ -37,13 +37,14 @@ export interface IFlyBaseParams {
37
37
  startCallback?: Function;
38
38
  frameCallback?: Function;
39
39
  }
40
- export declare const DEFAULT_FLIGHT_DURATION = 800;
40
+ export declare const DEFAULT_FLIGHT_DURATION = 1000;
41
41
  export declare const DEFAULT_EASING: EasingFunction;
42
42
  type CameraFrame = {
43
43
  eye: Vec3;
44
44
  n: Vec3;
45
45
  u: Vec3;
46
46
  v: Vec3;
47
+ focusDistance?: number;
47
48
  };
48
49
  type CameraFlight = {
49
50
  fly: (progress: number) => CameraFrame;
@@ -76,7 +77,6 @@ declare class Camera {
76
77
  */
77
78
  events: EventsHandler<CameraEvents>;
78
79
  protected _isOrthographic: boolean;
79
- protected _focusDistance: number;
80
80
  /**
81
81
  * Camera position.
82
82
  * @public
@@ -144,6 +144,19 @@ declare class Camera {
144
144
  protected _pb: Vec3;
145
145
  protected _peye: Vec3;
146
146
  isMoving: boolean;
147
+ /**
148
+ * Fires when the camera view or projection has been changed. It is assigned by the renderer
149
+ * to wake it up from the idle mode.
150
+ * @public
151
+ * @type {?function(): void}
152
+ */
153
+ onViewChange: (() => void) | null;
154
+ protected _pViewAngle: number;
155
+ protected _pAspect: number;
156
+ protected _pWidth: number;
157
+ protected _pHeight: number;
158
+ protected _pIsOrthographic: boolean;
159
+ protected _pFocusDistance: number;
147
160
  protected _tanViewAngle_hrad: number;
148
161
  _tanViewAngle_hradOneByHeight: number;
149
162
  protected _projSizeConst: number;
@@ -215,6 +228,12 @@ declare class Camera {
215
228
  * @param {number} dist - Focus distance.
216
229
  */
217
230
  set focusDistance(dist: number);
231
+ /**
232
+ * Keeps the orthographic scale on whatever the camera has just been aimed at.
233
+ * @protected
234
+ * @param {number} [distance] - Distance from the eye to the point in view.
235
+ */
236
+ protected _setOrthoFocus(distance?: number): void;
218
237
  /**
219
238
  * Returns camera identifier.
220
239
  * @public
@@ -228,6 +247,7 @@ declare class Camera {
228
247
  * @param {IFlyCartesianParams} [params] - Flight parameters
229
248
  */
230
249
  flyCartesian(cartesian: Vec3, params?: IFlyCartesianParams): void;
250
+ protected _startFlying(): void;
231
251
  /**
232
252
  * Breaks the flight.
233
253
  * @public
@@ -244,11 +264,22 @@ declare class Camera {
244
264
  * @returns {boolean}
245
265
  */
246
266
  isFlying(): boolean;
267
+ /**
268
+ * Checks camera movement and projection changes.
269
+ * @public
270
+ */
271
+ checkViewChanges(): void;
247
272
  /**
248
273
  * Checks whether the camera stopped moving and dispatches `moveend`.
249
274
  * @public
275
+ * @returns {boolean} `true` when the camera is moving after the check.
250
276
  */
251
- checkMoveEnd(): void;
277
+ checkMoveEnd(): boolean;
278
+ /**
279
+ * Checks whether the camera view or projection changed and dispatches `viewchange`.
280
+ * @protected
281
+ */
282
+ protected _checkViewChange(): void;
252
283
  /**
253
284
  * Binds picking colors for all frustums.
254
285
  * @public
@@ -303,6 +334,11 @@ declare class Camera {
303
334
  * @returns {Vec3} Backward direction.
304
335
  */
305
336
  getBackward(): Vec3;
337
+ /**
338
+ * Updates camera slope against the horizontal XZ plane.
339
+ * @public
340
+ */
341
+ updateCameraSlope(): void;
306
342
  /**
307
343
  * Updates camera view space
308
344
  * @public
@@ -359,7 +395,7 @@ declare class Camera {
359
395
  * @public
360
396
  * @param {Array.<NumberArray2>} frustums - Array of `[near, far]` ranges.
361
397
  */
362
- setFrustums(frustums: [number, number][]): void;
398
+ setFrustums(frustums: [number, number][], focusDistance?: number): void;
363
399
  protected _updateViewportParameters(): void;
364
400
  /**
365
401
  * Sets camera view angle in degrees
@@ -367,6 +403,12 @@ declare class Camera {
367
403
  * @param {number} angle - View angle
368
404
  */
369
405
  setViewAngle(angle: number): void;
406
+ /**
407
+ * Sets camera horizontal view angle in degrees.
408
+ * @public
409
+ * @param {number} angle - Horizontal view angle.
410
+ */
411
+ setHorizontalViewAngle(angle: number): void;
370
412
  /**
371
413
  * Returns camera vertical view angle in degrees.
372
414
  * @public
@@ -562,7 +604,7 @@ declare class Camera {
562
604
  */
563
605
  rotateAround(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
564
606
  /**
565
- * Rotates camera around center point by horizontal.
607
+ * Rotates camera around the center point by horizontal.
566
608
  * @public
567
609
  * @param {number} angle - Rotation angle in radians.
568
610
  * @param {boolean} [isArc] - If true camera up vector gets from current up vector every frame,
@@ -572,14 +614,14 @@ declare class Camera {
572
614
  */
573
615
  rotateHorizontal(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
574
616
  /**
575
- * Rotates camera around center point by vertical.
617
+ * Rotates camera around the center point by vertical.
576
618
  * @param {number} angle - Rotation angle in radians.
577
619
  * @param {Vec3} [center] - Point that the camera rotates around.
578
620
  */
579
621
  rotateVertical(angle: number, center?: Vec3): void;
580
622
  /**
581
623
  * Gets 3d size factor. Uses in LOD distance calculation.
582
- * It is very important function used in Node.ts
624
+ * It is a very important function used in Node.ts
583
625
  * @public
584
626
  * @param {Vec3} p - Point in 3d.
585
627
  * @param {Vec3} r - size.
@@ -611,12 +653,19 @@ declare class Camera {
611
653
  */
612
654
  getCurrentFrustum(): number;
613
655
  /**
614
- * Checks whether sphere intersects any camera frustum.
656
+ * Checks whether the sphere intersects any camera frustum.
615
657
  * @public
616
658
  * @param {Sphere} sphere - Bounding sphere.
617
659
  * @returns {boolean} `true` when visible in at least one frustum.
618
660
  */
619
661
  containsSphere(sphere: Sphere): boolean;
662
+ /**
663
+ * Checks whether a point is inside any camera frustum.
664
+ * @public
665
+ * @param {Vec3} point - Cartesian point.
666
+ * @returns {boolean} `true` when visible in at least one frustum.
667
+ */
668
+ containsPoint(point: Vec3): boolean;
620
669
  /**
621
670
  * Returns current active frustum.
622
671
  * @public
@@ -9,6 +9,8 @@ interface IFrustumParams {
9
9
  aspect?: number;
10
10
  near?: number;
11
11
  far?: number;
12
+ isOrthographic?: boolean;
13
+ focusDistance?: number;
12
14
  reverseDepth?: boolean;
13
15
  depthZeroToOne?: boolean;
14
16
  }
@@ -24,6 +26,12 @@ declare class Frustum {
24
26
  protected _tanViewAngle_hrad: number;
25
27
  protected _reverseDepth: boolean;
26
28
  protected _depthZeroToOne: boolean;
29
+ /**
30
+ * Reference distance used to compute orthographic frustum size.
31
+ * For orthographic frustums this value is synchronized with vertical bounds.
32
+ * @public
33
+ */
34
+ focusDistance: number;
27
35
  /**
28
36
  * Camera projection matrix.
29
37
  * @protected
@@ -156,11 +164,39 @@ declare class Frustum {
156
164
  * @param {number} near - Near clipping plane distance.
157
165
  * @param {number} far - Far clipping plane distance.
158
166
  * @param {boolean} [isOrthographic=false] - Enables orthographic projection mode.
159
- * @param {number} [focusDistance=10] - Reference distance used to compute orthographic frustum size.
167
+ * @param {number} [focusDistance=this.focusDistance] - Reference distance used to compute orthographic frustum size.
160
168
  * @param {boolean} [reverseDepth=false] - Enables reverse-Z infinite perspective projection.
161
169
  * @param {boolean} [depthZeroToOne=false] - Uses `[0, 1]` NDC depth range for reverse-Z projection.
162
170
  */
163
171
  setProjectionMatrix(viewAngle: number, aspect: number, near: number, far: number, isOrthographic?: boolean, focusDistance?: number, reverseDepth?: boolean, depthZeroToOne?: boolean): void;
172
+ /**
173
+ * Sets reference distance used to compute orthographic bounds and rebuilds projection matrices.
174
+ * Keeps current near and far clipping planes unchanged.
175
+ * @public
176
+ * @param {number} focusDistance - Reference distance.
177
+ */
178
+ setFocusDistance(focusDistance: number): void;
179
+ /**
180
+ * Updates orthographic projection bounds and rebuilds projection matrices.
181
+ * Keeps the current near and far clipping planes unchanged.
182
+ * @public
183
+ * @param {number} left - Left orthographic bound.
184
+ * @param {number} right - Right orthographic bound.
185
+ * @param {number} bottom - Bottom orthographic bound.
186
+ * @param {number} top - Top orthographic bound.
187
+ */
188
+ setOrthoBounds(left: number, right: number, bottom: number, top: number): void;
189
+ /**
190
+ * Updates orthographic projection bounds and clipping planes in one projection rebuild.
191
+ * @public
192
+ * @param {number} left - Left orthographic bound.
193
+ * @param {number} right - Right orthographic bound.
194
+ * @param {number} bottom - Bottom orthographic bound.
195
+ * @param {number} top - Top orthographic bound.
196
+ * @param {number} near - Near clipping plane distance.
197
+ * @param {number} far - Far clipping plane distance.
198
+ */
199
+ setOrthoProjection(left: number, right: number, bottom: number, top: number, near: number, far: number): void;
164
200
  /**
165
201
  * Updates near and far clipping planes.
166
202
  * @public
@@ -14,9 +14,6 @@ export interface IPlanetFlyCartesianParams extends IFlyCartesianParams {
14
14
  preventLock?: boolean;
15
15
  linearPath?: boolean;
16
16
  }
17
- export interface IPlanetFlyDistanceParams extends IPlanetFlyCartesianParams {
18
- distance?: number;
19
- }
20
17
  /**
21
18
  * Planet camera.
22
19
  * @class
@@ -91,6 +88,7 @@ declare class PlanetCamera extends Camera {
91
88
  protected _keyLock: Key;
92
89
  protected _checkTerrainCollision: boolean;
93
90
  eyeNorm: Vec3;
91
+ protected _extentFitRequestId: number;
94
92
  constructor(planet: Planet, options?: IPlanetCameraParams);
95
93
  /**
96
94
  * Enables or disables terrain collision checks.
@@ -104,6 +102,11 @@ declare class PlanetCamera extends Camera {
104
102
  * @virtual
105
103
  */
106
104
  update(): void;
105
+ /**
106
+ * Updates camera slope against the planet surface normal.
107
+ * @public
108
+ */
109
+ updateCameraSlope(): void;
107
110
  /**
108
111
  * Updates camera geographic coordinates from current cartesian position.
109
112
  * @public
@@ -125,7 +128,7 @@ declare class PlanetCamera extends Camera {
125
128
  * @public
126
129
  * @param {LonLat} lonlat - New camera and camera view position.
127
130
  * @param {LonLat} [lookLonLat] - Look up coordinates.
128
- * @param {Vec3} [up] - Camera UP vector. Default (0,1,0)
131
+ * @param {Vec3} [up] - Camera UP vector. Defaults to the local surface normal for an explicit look point.
129
132
  */
130
133
  setLonLat(lonlat: LonLat, lookLonLat?: LonLat, up?: Vec3): void;
131
134
  /**
@@ -148,6 +151,11 @@ declare class PlanetCamera extends Camera {
148
151
  * @returns {Vec3}
149
152
  */
150
153
  getExtentPosition(extent: Extent, height?: number | null): Vec3;
154
+ protected _getExtentCenterHeightInfo(extent: Extent): {
155
+ height: number;
156
+ segmentZoom: number;
157
+ };
158
+ protected _isSegmentHeightAccurate(extentHeight: number, segmentZoom: number): boolean;
151
159
  /**
152
160
  * View current extent.
153
161
  * @public
@@ -155,6 +163,13 @@ declare class PlanetCamera extends Camera {
155
163
  * @param {number} [height]
156
164
  */
157
165
  viewExtent(extent: Extent, height?: number): void;
166
+ /**
167
+ * Places the camera over the extent center at the given ground height.
168
+ * @protected
169
+ * @param {Extent} extent - Extent to fit.
170
+ * @param {number} height - Ground height under the extent center.
171
+ */
172
+ protected _viewExtentHeight(extent: Extent, height: number): void;
158
173
  /**
159
174
  * Flies to the current extent.
160
175
  * @public
@@ -227,6 +242,7 @@ declare class PlanetCamera extends Camera {
227
242
  * @returns {Vec3 | undefined} Terrain point under camera when available.
228
243
  */
229
244
  checkTerrainCollision(): Vec3 | undefined;
245
+ protected _getInsideCollisionSegment(): Segment | null;
230
246
  /**
231
247
  * Returns visible surface arc distance from current altitude.
232
248
  * @public
@@ -234,6 +250,15 @@ declare class PlanetCamera extends Camera {
234
250
  * @returns {number} Visible surface distance.
235
251
  */
236
252
  getSurfaceVisibleDistance(d: number): number;
253
+ /**
254
+ * Returns the ellipsoid intersection point for a screen-space ray.
255
+ * If the ray doesn't hit ellipsoid, it returns 'undefined'.
256
+ * @public
257
+ * @param {number} x - Screen X coordinate in pixels.
258
+ * @param {number} y - Screen Y coordinate in pixels.
259
+ * @returns {Vec3 | undefined} Cartesian intersection point.
260
+ */
261
+ getRayIntersectionEllipsoid(x: number, y: number): Vec3 | undefined;
237
262
  /**
238
263
  * Returns heading angle in degrees.
239
264
  * Should match `getYaw()` in most cases.
@@ -16,6 +16,7 @@ export declare class DebugInfo extends Control {
16
16
  protected _toggleBtn: ToggleButton;
17
17
  protected _dialog: Dialog<null>;
18
18
  protected _canvasTiles: CanvasTiles;
19
+ protected _drawnFrames: number;
19
20
  constructor(options?: IDebugInfoParams);
20
21
  addWatches(watches: IDebugInfoWatch[]): void;
21
22
  addWatch(watch: IDebugInfoWatch): void;
@@ -4,6 +4,12 @@ import { Control, IControlParams } from "./Control";
4
4
  import { ShaderProgram } from "../webgl/ShaderProgram";
5
5
  export interface IFramebufferDialogParams extends IControlParams {
6
6
  framebuffer?: Framebuffer;
7
+ arrayTexture?: WebGLTexture;
8
+ arrayLayer?: number;
9
+ width?: number;
10
+ height?: number;
11
+ left?: number;
12
+ top?: number;
7
13
  title?: string;
8
14
  common?: string;
9
15
  image?: string;
@@ -11,15 +17,25 @@ export interface IFramebufferDialogParams extends IControlParams {
11
17
  }
12
18
  export declare class FramebufferPreview extends Control {
13
19
  protected _dialog: Dialog<null>;
14
- $canvas: HTMLCanvasElement;
15
20
  protected _framebuffer: Framebuffer | null;
21
+ protected _arrayTexture: WebGLTexture | null;
22
+ protected _arrayLayer: number;
23
+ protected _width: number;
24
+ protected _height: number;
25
+ protected _isArrayMode: boolean;
16
26
  protected _screenFramebuffer: Framebuffer | null;
17
- framebufferCurrentTexture: number;
18
27
  protected _program: ShaderProgram;
28
+ $canvas: HTMLCanvasElement;
29
+ framebufferCurrentTexture: number;
19
30
  constructor(params: IFramebufferDialogParams);
20
31
  bindFramebuffer(framebuffer: Framebuffer): void;
32
+ bindArrayTexture(texture: WebGLTexture, layer: number): void;
21
33
  oninit(): void;
22
34
  activate(): void;
23
35
  deactivate(): void;
36
+ protected _isDrawSubscribed: boolean;
37
+ protected _subscribeDraw(): void;
38
+ protected _unsubscribeDraw(): void;
39
+ protected _onDialogVisibilityChange: (isVisible: boolean) => void;
24
40
  protected _onDraw: () => void;
25
41
  }