@openglobus/og 0.28.7 → 1.0.0-rc2

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 (220) hide show
  1. package/LICENSE.md +218 -4
  2. package/README.md +31 -18
  3. package/lib/Deferred.d.ts +2 -2
  4. package/lib/Events.d.ts +1 -1
  5. package/lib/Globe.d.ts +8 -5
  6. package/lib/Object3d.d.ts +17 -14
  7. package/lib/Popup.d.ts +2 -2
  8. package/lib/assets/LabelWorker.worker-DYd7xn3M.js.map +1 -0
  9. package/lib/assets/PlainSegmentWorker.worker-JsKldq-e.js.map +1 -0
  10. package/lib/assets/TerrainWorker.worker-CqUJvMOv.js.map +1 -0
  11. package/lib/bv/index.d.ts +2 -2
  12. package/lib/camera/Camera.d.ts +280 -27
  13. package/lib/camera/Frustum.d.ts +100 -15
  14. package/lib/camera/PlanetCamera.d.ts +93 -8
  15. package/lib/camera/index.d.ts +2 -2
  16. package/lib/control/CameraFrameComposer.d.ts +2 -2
  17. package/lib/control/CameraFrameHandler.d.ts +1 -1
  18. package/lib/control/CompassButton.d.ts +2 -2
  19. package/lib/control/EarthCoordinates.d.ts +5 -2
  20. package/lib/control/FramebufferPreview.d.ts +3 -3
  21. package/lib/control/GeoImageDragControl.d.ts +1 -1
  22. package/lib/control/LayerAnimation.d.ts +2 -2
  23. package/lib/control/LayerSwitcher.d.ts +3 -0
  24. package/lib/control/Lighting.d.ts +4 -2
  25. package/lib/control/Navigation.d.ts +15 -11
  26. package/lib/control/OrthoSwitcher.d.ts +18 -0
  27. package/lib/control/SimpleTouchNavigation.d.ts +44 -0
  28. package/lib/control/Sun.d.ts +4 -2
  29. package/lib/control/TouchNavigation.d.ts +4 -8
  30. package/lib/control/atmosphere/Atmosphere.d.ts +2 -0
  31. package/lib/control/atmosphere/AtmosphereConfig.d.ts +2 -6
  32. package/lib/control/cameraDepthHandler/CameraDepthHandler.d.ts +17 -3
  33. package/lib/control/cameraDepthHandler/camera_depth.d.ts +2 -2
  34. package/lib/control/drawing/LineStringDrawingScene.d.ts +1 -0
  35. package/lib/control/drawing/PolygonDrawingScene.d.ts +14 -14
  36. package/lib/control/elevationProfile/ElevationProfile.d.ts +1 -1
  37. package/lib/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
  38. package/lib/control/elevationProfile/ElevationProfileScene.d.ts +9 -12
  39. package/lib/control/elevationProfile/ElevationProfileView.d.ts +16 -5
  40. package/lib/control/entityEditor/EntityEditor.d.ts +19 -0
  41. package/lib/control/{geoObjectEditor/GeoObjectEditorDialog.d.ts → entityEditor/EntityEditorDialog.d.ts} +9 -8
  42. package/lib/control/{geoObjectEditor/GeoObjectEditorScene.d.ts → entityEditor/EntityEditorScene.d.ts} +12 -12
  43. package/lib/control/{geoObjectEditor → entityEditor}/colors.d.ts +2 -2
  44. package/lib/control/entityTree/EntityTree.d.ts +46 -0
  45. package/lib/control/entityTree/EntityTreeView.d.ts +24 -0
  46. package/lib/control/heightRuler/HeightRulerScene.d.ts +3 -2
  47. package/lib/control/index.d.ts +5 -3
  48. package/lib/control/ruler/RulerScene.d.ts +8 -8
  49. package/lib/control/selection/SelectionScene.d.ts +6 -6
  50. package/lib/control/timeline/TimelineControl.d.ts +2 -2
  51. package/lib/control/timeline/TimelineModel.d.ts +1 -1
  52. package/lib/control/timeline/TimelineView.d.ts +52 -13
  53. package/lib/control/visibleExtent/segment.d.ts +7 -0
  54. package/lib/ellipsoid/index.d.ts +4 -4
  55. package/lib/entity/Entity.d.ts +114 -100
  56. package/lib/entity/EntityCollection.d.ts +95 -70
  57. package/lib/entity/{BaseBillboard.d.ts → billboard/BaseBillboard.d.ts} +16 -17
  58. package/lib/entity/{BaseBillboardHandler.d.ts → billboard/BaseBillboardHandler.d.ts} +24 -9
  59. package/lib/entity/{Billboard.d.ts → billboard/Billboard.d.ts} +11 -7
  60. package/lib/entity/{BillboardHandler.d.ts → billboard/BillboardHandler.d.ts} +1 -1
  61. package/lib/entity/{GeoObject.d.ts → geoObject/GeoObject.d.ts} +7 -6
  62. package/lib/entity/{GeoObjectHandler.d.ts → geoObject/GeoObjectHandler.d.ts} +29 -11
  63. package/lib/entity/{InstanceData.d.ts → geoObject/InstanceData.d.ts} +18 -13
  64. package/lib/entity/{Geometry.d.ts → geometry/Geometry.d.ts} +10 -10
  65. package/lib/entity/{GeometryHandler.d.ts → geometry/GeometryHandler.d.ts} +7 -7
  66. package/lib/entity/index.d.ts +8 -8
  67. package/lib/entity/{Label.d.ts → label/Label.d.ts} +12 -13
  68. package/lib/entity/{LabelHandler.d.ts → label/LabelHandler.d.ts} +31 -7
  69. package/lib/entity/{LabelWorker.d.ts → label/LabelWorker.d.ts} +3 -3
  70. package/lib/entity/{PointCloud.d.ts → pointCloud/PointCloud.d.ts} +18 -12
  71. package/lib/entity/{PointCloudHandler.d.ts → pointCloud/PointCloudHandler.d.ts} +4 -4
  72. package/lib/entity/polyline/Polyline.d.ts +242 -0
  73. package/lib/entity/polyline/PolylineBatchRenderer.d.ts +443 -0
  74. package/lib/entity/{PolylineHandler.d.ts → polyline/PolylineHandler.d.ts} +19 -7
  75. package/lib/entity/{Ray.d.ts → ray/Ray.d.ts} +27 -9
  76. package/lib/entity/{RayHandler.d.ts → ray/RayHandler.d.ts} +18 -8
  77. package/lib/entity/{Strip.d.ts → strip/Strip.d.ts} +21 -17
  78. package/lib/entity/{StripHandler.d.ts → strip/StripHandler.d.ts} +11 -6
  79. package/lib/index.d.ts +47 -42
  80. package/lib/layer/BaseGeoImage.d.ts +20 -17
  81. package/lib/layer/CanvasTiles.d.ts +14 -12
  82. package/lib/layer/GeoImage.d.ts +1 -1
  83. package/lib/layer/GeoTexture2d.d.ts +2 -2
  84. package/lib/layer/KML.d.ts +19 -18
  85. package/lib/layer/Layer.d.ts +72 -53
  86. package/lib/layer/Vector.d.ts +47 -30
  87. package/lib/layer/WMS.d.ts +1 -1
  88. package/lib/layer/XYZ.d.ts +11 -12
  89. package/lib/layer/index.d.ts +12 -12
  90. package/lib/math/Line2.d.ts +1 -1
  91. package/lib/math/Line3.d.ts +1 -1
  92. package/lib/math/Mat3.d.ts +3 -13
  93. package/lib/math/Mat4.d.ts +16 -10
  94. package/lib/math/Plane.d.ts +1 -1
  95. package/lib/math/Quat.d.ts +14 -12
  96. package/lib/math/Ray.d.ts +4 -3
  97. package/lib/math/Vec2.d.ts +25 -17
  98. package/lib/math/Vec3.d.ts +33 -31
  99. package/lib/math/Vec4.d.ts +1 -1
  100. package/lib/math/coder.d.ts +1 -1
  101. package/lib/math/index.d.ts +13 -14
  102. package/lib/mercator.d.ts +4 -4
  103. package/lib/og.css +1 -1
  104. package/lib/og.es.js +1 -1
  105. package/lib/og.es.js.map +1 -1
  106. package/lib/quadTree/EntityCollectionNode.d.ts +10 -10
  107. package/lib/quadTree/EntityCollectionsTreeStrategy.d.ts +5 -5
  108. package/lib/quadTree/QuadTreeStrategy.d.ts +3 -4
  109. package/lib/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +4 -4
  110. package/lib/quadTree/earth/EarthEntityCollectionsTreeStrategy.d.ts +4 -4
  111. package/lib/renderer/AtmosphereDeferredShading.d.ts +12 -0
  112. package/lib/renderer/IDeferredShadingPass.d.ts +8 -0
  113. package/lib/renderer/ITransparencyPass.d.ts +8 -0
  114. package/lib/renderer/PhongDeferredShading.d.ts +16 -0
  115. package/lib/renderer/Renderer.d.ts +166 -99
  116. package/lib/renderer/RendererEvents.d.ts +15 -5
  117. package/lib/renderer/WOITPass.d.ts +14 -0
  118. package/lib/res/fonts/Ephesis-Regular.json +1 -0
  119. package/lib/res/fonts/Ephesis-Regular.png +0 -0
  120. package/lib/res/fonts/Karla-Bold.json +1 -0
  121. package/lib/res/fonts/Karla-Bold.png +0 -0
  122. package/lib/res/fonts/Karla-Italic.json +1 -0
  123. package/lib/res/fonts/Karla-Italic.png +0 -0
  124. package/lib/res/fonts/Karla-Light.json +1 -0
  125. package/lib/res/fonts/Karla-Light.png +0 -0
  126. package/lib/res/fonts/Karla-Medium.json +1 -0
  127. package/lib/res/fonts/Karla-Medium.png +0 -0
  128. package/lib/res/fonts/Roboto-Regular.json +1 -37147
  129. package/lib/res/fonts/Roboto-Regular.png +0 -0
  130. package/lib/res/fonts/arial.json +1 -4321
  131. package/lib/res/fonts/arial.png +0 -0
  132. package/lib/res/night-4326.png +0 -0
  133. package/lib/res/night.png +0 -0
  134. package/lib/scene/AltitudeNearPlaneStrategy.d.ts +17 -0
  135. package/lib/scene/Axes.d.ts +4 -3
  136. package/lib/scene/Planet.d.ts +244 -69
  137. package/lib/scene/{RenderNode.d.ts → Scene.d.ts} +49 -46
  138. package/lib/scene/SkyBox.d.ts +5 -3
  139. package/lib/scene/index.d.ts +2 -2
  140. package/lib/segment/Segment.d.ts +29 -15
  141. package/lib/segment/SegmentLonLat.d.ts +0 -1
  142. package/lib/shadeModeConstants.d.ts +7 -0
  143. package/lib/shaders/applyDeferredDepth.d.ts +2 -0
  144. package/lib/shaders/atmos/atmos.d.ts +3 -3
  145. package/lib/shaders/billboard/billboard.d.ts +4 -3
  146. package/lib/shaders/deferredShading/deferredShading.d.ts +2 -0
  147. package/lib/shaders/deferredShading/deferredShadingAtmos.d.ts +3 -0
  148. package/lib/shaders/depth.d.ts +2 -2
  149. package/lib/shaders/geo_object/geo_object.d.ts +8 -4
  150. package/lib/shaders/label/label.d.ts +4 -4
  151. package/lib/shaders/pointCloud.d.ts +2 -2
  152. package/lib/shaders/polyline/polyline.d.ts +7 -3
  153. package/lib/shaders/ray/ray.d.ts +3 -2
  154. package/lib/shaders/screenFrame.d.ts +2 -2
  155. package/lib/shaders/segment/segment.d.ts +7 -0
  156. package/lib/shaders/skybox.d.ts +2 -2
  157. package/lib/shaders/strip/strip.d.ts +3 -0
  158. package/lib/shaders/tone_mapping/toneMapping.d.ts +2 -2
  159. package/lib/shaders/weightedOITResolve.d.ts +2 -0
  160. package/lib/terrain/BilTerrain.d.ts +1 -1
  161. package/lib/terrain/EmptyTerrain.d.ts +5 -6
  162. package/lib/terrain/GlobusTerrain.d.ts +18 -23
  163. package/lib/terrain/RgbTerrain.d.ts +8 -8
  164. package/lib/terrain/index.d.ts +5 -5
  165. package/lib/tsconfig.tsbuildinfo +1 -1
  166. package/lib/ui/Button.d.ts +7 -5
  167. package/lib/ui/ButtonGroup.d.ts +1 -1
  168. package/lib/ui/Checkbox.d.ts +2 -2
  169. package/lib/ui/Color.d.ts +2 -2
  170. package/lib/ui/Dialog.d.ts +30 -3
  171. package/lib/ui/Input.d.ts +7 -2
  172. package/lib/ui/Slider.d.ts +5 -2
  173. package/lib/ui/ToggleButton.d.ts +2 -2
  174. package/lib/ui/View.d.ts +1 -1
  175. package/lib/ui/icons.d.ts +1 -1
  176. package/lib/ui/index.d.ts +9 -9
  177. package/lib/utils/FontAtlas.d.ts +57 -8
  178. package/lib/utils/GeoImageCreator.d.ts +2 -2
  179. package/lib/utils/ImagesCacheManager.d.ts +3 -3
  180. package/lib/utils/Loader.d.ts +2 -2
  181. package/lib/utils/PlainSegmentWorker.d.ts +2 -2
  182. package/lib/utils/TerrainWorker.d.ts +2 -2
  183. package/lib/utils/TextureAtlas.d.ts +7 -2
  184. package/lib/utils/TextureResourceManager.d.ts +162 -0
  185. package/lib/utils/VectorTileCreator.d.ts +1 -1
  186. package/lib/utils/colorSpace.d.ts +9 -0
  187. package/lib/utils/gltf/gltfParser.d.ts +9 -2
  188. package/lib/utils/gltf/types.d.ts +20 -2
  189. package/lib/utils/shared.d.ts +11 -5
  190. package/lib/utils/textureResourceMeta.d.ts +9 -0
  191. package/lib/webgl/BaseFramebuffer.d.ts +7 -0
  192. package/lib/webgl/Framebuffer.d.ts +9 -6
  193. package/lib/webgl/Handler.d.ts +81 -99
  194. package/lib/webgl/ShaderProgram.d.ts +190 -0
  195. package/lib/webgl/index.d.ts +2 -2
  196. package/lib/webgl/variableHandlers.d.ts +2 -1
  197. package/package.json +77 -76
  198. package/lib/assets/LabelWorker.worker-BT1uJgYn.js.map +0 -1
  199. package/lib/assets/PlainSegmentWorker.worker-CT1cj8jj.js.map +0 -1
  200. package/lib/assets/TerrainWorker.worker-DmikdfB2.js.map +0 -1
  201. package/lib/control/OldMouseNavigation.d.ts +0 -65
  202. package/lib/control/ZoomControl.d.ts +0 -28
  203. package/lib/control/geoObjectEditor/GeoObjectEditor.d.ts +0 -13
  204. package/lib/control/visibleExtent/drawnode.d.ts +0 -7
  205. package/lib/entity/Polyline.d.ts +0 -417
  206. package/lib/light/LightSource.d.ts +0 -36
  207. package/lib/res/fonts/Roboto-Regular.ttf.cfg +0 -1340
  208. package/lib/res/fonts/Roboto-Regular.ttf.png +0 -0
  209. package/lib/res/fonts/arial.ttf.cfg +0 -1570
  210. package/lib/res/fonts/arial.ttf.png +0 -0
  211. package/lib/scene/BaseNode.d.ts +0 -61
  212. package/lib/shaders/drawnode/drawnode.d.ts +0 -8
  213. package/lib/webgl/Program.d.ts +0 -161
  214. package/lib/webgl/ProgramController.d.ts +0 -87
  215. /package/lib/control/{geoObjectEditor → entityEditor}/ArrowEntity.d.ts +0 -0
  216. /package/lib/control/{geoObjectEditor → entityEditor}/AxisTrackEntity.d.ts +0 -0
  217. /package/lib/control/{geoObjectEditor → entityEditor}/MoveAxisEntity.d.ts +0 -0
  218. /package/lib/control/{geoObjectEditor → entityEditor}/MovePlaneEntity.d.ts +0 -0
  219. /package/lib/control/{geoObjectEditor → entityEditor}/RotateEntity.d.ts +0 -0
  220. /package/lib/entity/{LabelWorker.worker.d.ts → label/LabelWorker.worker.d.ts} +0 -0
@@ -9,6 +9,8 @@ interface IFrustumParams {
9
9
  aspect?: number;
10
10
  near?: number;
11
11
  far?: number;
12
+ reverseDepth?: boolean;
13
+ depthZeroToOne?: boolean;
12
14
  }
13
15
  /**
14
16
  * Frustum object, part of the camera object.
@@ -17,6 +19,11 @@ interface IFrustumParams {
17
19
  */
18
20
  declare class Frustum {
19
21
  protected _f: [NumberArray4, NumberArray4, NumberArray4, NumberArray4, NumberArray4, NumberArray4];
22
+ protected _isOrthographic: boolean;
23
+ protected _aspect: number;
24
+ protected _tanViewAngle_hrad: number;
25
+ protected _reverseDepth: boolean;
26
+ protected _depthZeroToOne: boolean;
20
27
  /**
21
28
  * Camera projection matrix.
22
29
  * @protected
@@ -67,6 +74,12 @@ declare class Frustum {
67
74
  * @public
68
75
  */
69
76
  near: number;
77
+ /**
78
+ * Near-plane safety value used by depth offset logic in shaders.
79
+ * Updated together with `near`.
80
+ * @public
81
+ */
82
+ depthOffsetNear: number;
70
83
  /**
71
84
  * Projection frustum far value.
72
85
  * @public
@@ -75,26 +88,92 @@ declare class Frustum {
75
88
  cameraFrustumIndex: number;
76
89
  _pickingColorU: Float32Array;
77
90
  constructor(options?: IFrustumParams);
91
+ /**
92
+ * Returns right clipping plane.
93
+ * @public
94
+ * @returns {NumberArray4} Right clipping plane coefficients.
95
+ */
78
96
  getRightPlane(): NumberArray4;
97
+ /**
98
+ * Returns left clipping plane.
99
+ * @public
100
+ * @returns {NumberArray4} Left clipping plane coefficients.
101
+ */
79
102
  getLeftPlane(): NumberArray4;
103
+ /**
104
+ * Returns bottom clipping plane.
105
+ * @public
106
+ * @returns {NumberArray4} Bottom clipping plane coefficients.
107
+ */
80
108
  getBottomPlane(): NumberArray4;
109
+ /**
110
+ * Returns top clipping plane.
111
+ * @public
112
+ * @returns {NumberArray4} Top clipping plane coefficients.
113
+ */
81
114
  getTopPlane(): NumberArray4;
115
+ /**
116
+ * Returns backward clipping plane.
117
+ * @public
118
+ * @returns {NumberArray4} Backward clipping plane coefficients.
119
+ */
82
120
  getBackwardPlane(): NumberArray4;
121
+ /**
122
+ * Returns forward clipping plane.
123
+ * @public
124
+ * @returns {NumberArray4} Forward clipping plane coefficients.
125
+ */
83
126
  getForwardPlane(): NumberArray4;
127
+ /**
128
+ * Returns projection-view matrix.
129
+ * @public
130
+ * @returns {NumberArray16} Projection-view matrix values.
131
+ */
84
132
  getProjectionViewMatrix(): NumberArray16;
133
+ /**
134
+ * Returns projection-view RTE matrix.
135
+ * @public
136
+ * @returns {NumberArray16} Projection-view RTE matrix values.
137
+ */
85
138
  getProjectionViewRTEMatrix(): NumberArray16;
139
+ /**
140
+ * Returns projection matrix.
141
+ * @public
142
+ * @returns {NumberArray16} Projection matrix values.
143
+ */
86
144
  getProjectionMatrix(): NumberArray16;
145
+ /**
146
+ * Returns inverse projection matrix.
147
+ * @public
148
+ * @returns {NumberArray16} Inverse projection matrix values.
149
+ */
87
150
  getInverseProjectionMatrix(): NumberArray16;
88
151
  /**
89
152
  * Sets up camera projection matrix.
90
153
  * @public
91
- * @param {number} viewAngle - Camera's vertical fov view angle.
92
- * @param {number} aspect - Screen aspect ratio.
93
- * @param {number} near - Near camera distance.
94
- * @param {number} far - Far camera distance.
154
+ * @param {number} viewAngle - Camera vertical field of view angle in degrees.
155
+ * @param {number} aspect - Viewport aspect ratio (`width / height`).
156
+ * @param {number} near - Near clipping plane distance.
157
+ * @param {number} far - Far clipping plane distance.
158
+ * @param {boolean} [isOrthographic=false] - Enables orthographic projection mode.
159
+ * @param {number} [focusDistance=10] - Reference distance used to compute orthographic frustum size.
160
+ * @param {boolean} [reverseDepth=false] - Enables reverse-Z infinite perspective projection.
161
+ * @param {boolean} [depthZeroToOne=false] - Uses `[0, 1]` NDC depth range for reverse-Z projection.
162
+ */
163
+ setProjectionMatrix(viewAngle: number, aspect: number, near: number, far: number, isOrthographic?: boolean, focusDistance?: number, reverseDepth?: boolean, depthZeroToOne?: boolean): void;
164
+ /**
165
+ * Updates near and far clipping planes.
166
+ * @public
167
+ * @param {number} near - Near clipping plane distance.
168
+ * @param {number} [far=this.far] - Far clipping plane distance.
95
169
  */
96
- setProjectionMatrix(viewAngle: number, aspect: number, near: number, far: number, isOrthographic?: boolean, focusDistance?: number): void;
170
+ setNearFar(near: number, far?: number): void;
97
171
  protected _setFrustumParams(top: number, right: number, near: number, far: number): void;
172
+ /**
173
+ * Updates projection-view RTE matrix.
174
+ * @public
175
+ * @param {Mat4} viewRTEMatrix - View matrix in RTE coordinates.
176
+ */
98
177
  setProjectionViewRTEMatrix(viewRTEMatrix: Mat4): void;
99
178
  /**
100
179
  * Camera's projection matrix values.
@@ -103,40 +182,46 @@ declare class Frustum {
103
182
  */
104
183
  setViewMatrix(viewMatrix: Mat4): void;
105
184
  /**
106
- * Returns true if a point in the frustum.
185
+ * Returns true if the point is inside the frustum.
107
186
  * @public
108
187
  * @param {Vec3} point - Cartesian point.
109
- * @returns {boolean} -
188
+ * @returns {boolean} `true` when the point is inside.
110
189
  */
111
190
  containsPoint(point: Vec3): boolean;
112
191
  /**
113
- * Returns true if the frustum contains a bonding sphere, but bottom plane exclude.
192
+ * Returns true if the sphere is inside the frustum, ignoring the bottom plane.
114
193
  * @public
115
194
  * @param {Sphere} sphere - Bounding sphere.
116
- * @returns {boolean} -
195
+ * @returns {boolean} `true` when the sphere passes all checked planes.
117
196
  */
118
197
  containsSphereBottomExc(sphere: Sphere): boolean;
198
+ /**
199
+ * Checks sphere intersection with the bottom frustum plane only.
200
+ * @public
201
+ * @param {Sphere} sphere - Bounding sphere.
202
+ * @returns {boolean} `true` when the sphere is not clipped by the bottom plane.
203
+ */
119
204
  containsSphereButtom(sphere: Sphere): boolean;
120
205
  /**
121
- * Returns true if the frustum contains a bonding sphere.
206
+ * Returns true if the sphere is inside the frustum.
122
207
  * @public
123
208
  * @param {Sphere} sphere - Bounding sphere.
124
- * @returns {boolean} -
209
+ * @returns {boolean} `true` when the sphere is inside.
125
210
  */
126
211
  containsSphere(sphere: Sphere): boolean;
127
212
  /**
128
- * Returns true if the frustum contains a bonding sphere.
213
+ * Returns true if the sphere is inside the frustum.
129
214
  * @public
130
215
  * @param {Vec3} center - Sphere center.
131
216
  * @param {number} radius - Sphere radius.
132
- * @returns {boolean} -
217
+ * @returns {boolean} `true` when the sphere is inside.
133
218
  */
134
219
  containsSphere2(center: Vec3, radius: number): boolean;
135
220
  /**
136
- * Returns true if the frustum contains a bounding box.
221
+ * Returns true if the box intersects or is inside the frustum.
137
222
  * @public
138
223
  * @param {Box} box - Bounding box.
139
- * @returns {boolean} -
224
+ * @returns {boolean} `true` when the box is not fully outside.
140
225
  */
141
226
  containsBox(box: Box): boolean;
142
227
  }
@@ -12,6 +12,7 @@ export interface IPlanetCameraParams extends ICameraParams {
12
12
  export interface IPlanetFlyCartesianParams extends IFlyCartesianParams {
13
13
  amplitude?: number;
14
14
  preventLock?: boolean;
15
+ linearPath?: boolean;
15
16
  }
16
17
  export interface IPlanetFlyDistanceParams extends IPlanetFlyCartesianParams {
17
18
  distance?: number;
@@ -28,14 +29,15 @@ export interface IPlanetFlyDistanceParams extends IPlanetFlyCartesianParams {
28
29
  * @param {number} [options.far] - Camera far plane distance. Default is og.math.MAX
29
30
  * @param {number} [options.minAltitude] - Minimal altitude for the camera. Default is 5
30
31
  * @param {number} [options.maxAltitude] - Maximal altitude for the camera. Default is 20000000
32
+ * @param {boolean} [options.reverseDepth=true] - Enables reverse-Z depth in perspective mode.
31
33
  * @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
32
34
  * @param {Vec3} [options.look] - Camera look position. Default (0,0,0)
33
35
  * @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
34
- * @fires og.Camera#viewchange
35
- * @fires og.Camera#moveend
36
- * @fires og.Camera#flystart
37
- * @fires og.Camera#flyend
38
- * @fires og.Camera#flystop
36
+ * @fires viewchange
37
+ * @fires moveend
38
+ * @fires flystart
39
+ * @fires flyend
40
+ * @fires flystop
39
41
  */
40
42
  declare class PlanetCamera extends Camera {
41
43
  /**
@@ -86,11 +88,15 @@ declare class PlanetCamera extends Camera {
86
88
  * @type {Segment}
87
89
  */
88
90
  _insideSegment: Segment | null;
89
- slope: number;
90
91
  protected _keyLock: Key;
91
92
  protected _checkTerrainCollision: boolean;
92
93
  eyeNorm: Vec3;
93
94
  constructor(planet: Planet, options?: IPlanetCameraParams);
95
+ /**
96
+ * Enables or disables terrain collision checks.
97
+ * @public
98
+ * @param {boolean} isActive - Terrain collision flag.
99
+ */
94
100
  setTerrainCollisionActivity(isActive: boolean): void;
95
101
  /**
96
102
  * Updates camera view space.
@@ -98,6 +104,10 @@ declare class PlanetCamera extends Camera {
98
104
  * @virtual
99
105
  */
100
106
  update(): void;
107
+ /**
108
+ * Updates camera geographic coordinates from current cartesian position.
109
+ * @public
110
+ */
101
111
  updateGeodeticPosition(): void;
102
112
  /**
103
113
  * Sets altitude over the terrain.
@@ -153,6 +163,12 @@ declare class PlanetCamera extends Camera {
153
163
  * @param {IPlanetFlyCartesianParams} [params] - Flight parameters
154
164
  */
155
165
  flyExtent(extent: Extent, height?: number | null, params?: IPlanetFlyCartesianParams): void;
166
+ /**
167
+ * Places camera at a fixed distance from a target point and looks at it.
168
+ * @public
169
+ * @param {Vec3} cartesian - Target cartesian point.
170
+ * @param {number} [distance=10000.0] - Distance from the target.
171
+ */
156
172
  viewDistance(cartesian: Vec3, distance?: number): void;
157
173
  /**
158
174
  * Flies to the geo coordinates.
@@ -161,6 +177,13 @@ declare class PlanetCamera extends Camera {
161
177
  * @param {IPlanetFlyCartesianParams} [params] - Flight parameters
162
178
  */
163
179
  flyLonLat(lonlat: LonLat, params?: IPlanetFlyCartesianParams): void;
180
+ /**
181
+ * Flies camera to a position at a fixed distance from the target point.
182
+ * @public
183
+ * @param {Vec3} cartesian - Target cartesian point.
184
+ * @param {number} [distance=10000.0] - Distance from the target.
185
+ * @param {IPlanetFlyCartesianParams} [params] - Flight parameters.
186
+ */
164
187
  flyDistance(cartesian: Vec3, distance?: number, params?: IPlanetFlyCartesianParams): void;
165
188
  flyCartesian(cartesian: Vec3, params?: IPlanetFlyCartesianParams): void;
166
189
  stopFlying(): void;
@@ -190,23 +213,85 @@ declare class PlanetCamera extends Camera {
190
213
  * @param {number} angle - Rotation angle.
191
214
  */
192
215
  rotateDown(angle: number): void;
216
+ /**
217
+ * Rotates camera vertically around the given center.
218
+ * @public
219
+ * @param {number} angle - Rotation angle in radians.
220
+ * @param {Vec3} center - Rotation center.
221
+ * @param {number} [minSlope=0] - Minimum allowed slope limit.
222
+ */
193
223
  rotateVertical(angle: number, center: Vec3, minSlope?: number): void;
224
+ /**
225
+ * Updates terrain altitude and keeps camera above minimum altitude.
226
+ * @public
227
+ * @returns {Vec3 | undefined} Terrain point under camera when available.
228
+ */
194
229
  checkTerrainCollision(): Vec3 | undefined;
230
+ /**
231
+ * Returns visible surface arc distance from current altitude.
232
+ * @public
233
+ * @param {number} d - Additional height offset.
234
+ * @returns {number} Visible surface distance.
235
+ */
195
236
  getSurfaceVisibleDistance(d: number): number;
196
237
  /**
197
- * should be yje same as getYaw
238
+ * Returns heading angle in degrees.
239
+ * Should match `getYaw()` in most cases.
240
+ * @public
241
+ * @returns {number} Heading in `[0, 360)` degrees.
198
242
  */
199
243
  getHeading(): number;
244
+ /**
245
+ * Checks whether a cartesian point is visible above the horizon.
246
+ * @public
247
+ * @param {Vec3} poi - Point in cartesian coordinates.
248
+ * @returns {boolean} `true` when the point is visible.
249
+ */
200
250
  isVisible(poi: Vec3): boolean;
251
+ /**
252
+ * Returns pitch angle in local planet frame.
253
+ * @public
254
+ * @returns {number} Pitch angle in radians.
255
+ */
201
256
  getPitch(): number;
202
257
  /**
203
- * should be the same as getHeading
258
+ * Returns yaw angle in local planet frame.
259
+ * Should match `getHeading()` in most cases.
260
+ * @public
261
+ * @returns {number} Yaw angle in radians.
204
262
  */
205
263
  getYaw(): number;
264
+ /**
265
+ * Returns roll angle in local planet frame.
266
+ * @public
267
+ * @returns {number} Roll angle in radians.
268
+ */
206
269
  getRoll(): number;
270
+ /**
271
+ * Sets pitch angle in local planet frame.
272
+ * @public
273
+ * @param {number} a - Pitch angle in radians.
274
+ */
207
275
  setPitch(a: number): void;
276
+ /**
277
+ * Sets yaw angle in local planet frame.
278
+ * @public
279
+ * @param {number} a - Yaw angle in radians.
280
+ */
208
281
  setYaw(a: number): void;
282
+ /**
283
+ * Sets roll angle in local planet frame.
284
+ * @public
285
+ * @param {number} a - Roll angle in radians.
286
+ */
209
287
  setRoll(a: number): void;
288
+ /**
289
+ * Sets orientation from pitch, yaw and roll in local planet frame.
290
+ * @public
291
+ * @param {number} pitch - Pitch angle in radians.
292
+ * @param {number} yaw - Yaw angle in radians.
293
+ * @param {number} roll - Roll angle in radians.
294
+ */
210
295
  setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
211
296
  }
212
297
  export { PlanetCamera };
@@ -1,3 +1,3 @@
1
- import { Camera } from './Camera';
2
- import { PlanetCamera } from './PlanetCamera';
1
+ import { Camera } from "./Camera";
2
+ import { PlanetCamera } from "./PlanetCamera";
3
3
  export { Camera, PlanetCamera };
@@ -1,14 +1,14 @@
1
1
  import { Control, IControlParams } from "./Control";
2
2
  import { CameraFrameHandler } from "./CameraFrameHandler";
3
3
  import { EntityCollection } from "../entity";
4
- import { RenderNode } from '../scene/RenderNode';
4
+ import { Scene } from "../scene/Scene";
5
5
  export interface ICameraFrameComposerParams extends IControlParams {
6
6
  frameHandlers?: CameraFrameHandler[];
7
7
  }
8
8
  export declare class CameraFrameComposer extends Control {
9
9
  readonly _frameHandlers: CameraFrameHandler[];
10
10
  protected _cameraLayer: EntityCollection;
11
- protected _cameraScene: RenderNode;
11
+ protected _cameraScene: Scene;
12
12
  constructor(params?: ICameraFrameComposerParams);
13
13
  get frameHandlers(): CameraFrameHandler[];
14
14
  add(handler: CameraFrameHandler): void;
@@ -16,7 +16,7 @@ export declare class CameraFrameHandler {
16
16
  frameHandler: FrameHandlerFunc | null;
17
17
  protected _composer: CameraFrameComposer | null;
18
18
  protected _composerIndex: number;
19
- readonly cameraEntity: Entity;
19
+ readonly cameraEntity: Entity | null;
20
20
  showFrustum: boolean;
21
21
  constructor(params: ICameraFrameHadler);
22
22
  get frustumScale(): Vec3;
@@ -6,11 +6,11 @@ interface ICompasButtonParams extends IControlParams {
6
6
  */
7
7
  export declare class CompassButton extends Control {
8
8
  protected _heading: number;
9
- protected _svg: HTMLElement | null;
9
+ protected _icon: HTMLElement | null;
10
10
  constructor(options?: ICompasButtonParams);
11
11
  oninit(): void;
12
12
  protected _onClick(): void;
13
- protected _draw(): void;
13
+ protected _draw: () => void;
14
14
  setHeading(heading: number): void;
15
15
  }
16
16
  export {};
@@ -1,5 +1,5 @@
1
- import { Control, type IControlParams } from './Control';
2
- import { LonLat } from '../LonLat';
1
+ import { Control, type IControlParams } from "./Control";
2
+ import { LonLat } from "../LonLat";
3
3
  import type { IMouseState } from "../renderer/RendererEvents";
4
4
  interface IEarthCoordinatesParams extends IControlParams {
5
5
  heightMode?: string;
@@ -34,6 +34,9 @@ export declare class EarthCoordinates extends Control {
34
34
  protected _createCenterEl(): HTMLElement;
35
35
  protected _updateUnits(): void;
36
36
  protected _refreshCoordinates(): void;
37
+ protected _getClipboardCoordinates(): string;
38
+ protected _copyCoordinates(): Promise<void>;
39
+ protected _onPanelClick: (event: MouseEvent) => void;
37
40
  oninit(): void;
38
41
  protected _grabCoordinates(e: IMouseState): void;
39
42
  protected _showHeight(): Promise<void>;
@@ -1,13 +1,13 @@
1
1
  import { Dialog } from "../ui/Dialog";
2
2
  import { Framebuffer } from "../webgl/Framebuffer";
3
3
  import { Control, IControlParams } from "./Control";
4
- import { Program } from "../webgl/Program";
4
+ import { ShaderProgram } from "../webgl/ShaderProgram";
5
5
  export interface IFramebufferDialogParams extends IControlParams {
6
6
  framebuffer?: Framebuffer;
7
7
  title?: string;
8
8
  common?: string;
9
9
  image?: string;
10
- flippedUV?: boolean;
10
+ flippedY?: boolean;
11
11
  }
12
12
  export declare class FramebufferPreview extends Control {
13
13
  protected _dialog: Dialog<null>;
@@ -15,7 +15,7 @@ export declare class FramebufferPreview extends Control {
15
15
  protected _framebuffer: Framebuffer | null;
16
16
  protected _screenFramebuffer: Framebuffer | null;
17
17
  framebufferCurrentTexture: number;
18
- protected _program: Program;
18
+ protected _program: ShaderProgram;
19
19
  constructor(params: IFramebufferDialogParams);
20
20
  bindFramebuffer(framebuffer: Framebuffer): void;
21
21
  oninit(): void;
@@ -1,4 +1,4 @@
1
- import { Control, type IControlParams } from './Control';
1
+ import { Control, type IControlParams } from "./Control";
2
2
  import { Layer } from "../layer/Layer";
3
3
  import { ToggleButton } from "../ui/ToggleButton";
4
4
  import type { IMouseState } from "../renderer/RendererEvents";
@@ -1,5 +1,5 @@
1
- import { type EventsHandler } from '../Events';
2
- import { Layer } from '../layer/Layer';
1
+ import { type EventsHandler } from "../Events";
2
+ import { Layer } from "../layer/Layer";
3
3
  import { Control, type IControlParams } from "./Control";
4
4
  type LayerAnimationEventsList = ["change", "idle", "play", "pause", "stop"];
5
5
  interface ILayerAnimationParams extends IControlParams {
@@ -30,6 +30,9 @@ export declare class LayerSwitcher extends Control {
30
30
  oninit(): void;
31
31
  protected _initLayers(): void;
32
32
  protected _createLayerButton(layer: Layer): LayerButtonView;
33
+ protected _findLayerView(layer: Layer): LayerButtonView | null;
34
+ protected _placeLayerView(layerView: LayerButtonView): void;
35
+ protected _onLayerBaseLayerChange: (layer: Layer) => void;
33
36
  addLayer: (layer: Layer) => void;
34
37
  removeLayer: (layer: Layer) => void;
35
38
  onactivate(): void;
@@ -1,10 +1,10 @@
1
1
  import { Control } from "./Control";
2
2
  import type { IControlParams } from "./Control";
3
- import { Dialog } from '../ui/Dialog';
3
+ import { Dialog } from "../ui/Dialog";
4
4
  import { Layer } from "../layer/Layer";
5
5
  import { Slider } from "../ui/Slider";
6
6
  import { ToggleButton } from "../ui/ToggleButton";
7
- import { View } from '../ui/View';
7
+ import { View } from "../ui/View";
8
8
  import { Color } from "../ui/Color";
9
9
  interface ILightingParams extends IControlParams {
10
10
  }
@@ -47,6 +47,8 @@ export declare class Lighting extends Control {
47
47
  bindLayer(layer: Layer): void;
48
48
  oninit(): void;
49
49
  protected _update(): void;
50
+ protected _setSliderValue(slider: Slider, value: number): void;
51
+ protected _syncSelectedBaseLayerLighting(): void;
50
52
  protected _fetchLayers(): void;
51
53
  protected _onLayerAdd(e: Layer): void;
52
54
  protected _onLayerRemove(e: Layer): void;
@@ -1,14 +1,15 @@
1
- import { Control } from "./Control";
2
1
  import type { IControlParams } from "./Control";
2
+ import { Control } from "./Control";
3
3
  import type { IMouseState } from "../renderer/RendererEvents";
4
4
  import { Quat } from "../math/Quat";
5
5
  import { Sphere } from "../bv/Sphere";
6
6
  import { Vec2 } from "../math/Vec2";
7
7
  import { Vec3 } from "../math/Vec3";
8
8
  import { type EventsHandler } from "../Events";
9
- export type NavigationMode = "lockNorth" | "adaptive" | "free";
9
+ export type NavigationMode = "north" | "adaptive" | "free";
10
10
  export interface INavigationParams extends IControlParams {
11
11
  inertia?: number;
12
+ velInertia?: number;
12
13
  dragInertia?: number;
13
14
  minSlope?: number;
14
15
  mass?: number;
@@ -18,27 +19,24 @@ export interface INavigationParams extends IControlParams {
18
19
  disableRotation?: boolean;
19
20
  disableTilt?: boolean;
20
21
  }
21
- export type NavigationEventsList = [
22
- "drag",
23
- "zoom",
24
- "rotate"
25
- ];
22
+ export type NavigationEventsList = ["drag", "zoom", "rotate"];
26
23
  /**
27
24
  * Navigation.
28
25
  * @class
29
26
  * @extends {Control}
30
27
  * @param {INavigationParams} [options] - Navigation options:
31
- * @param {NavigationMode} [options.mode] - Navigation mode: "lockNorth" (keeps north fixed), "adaptive" (default, auto-detects arc mode), "free" (arc rotation mode)
28
+ * @param {NavigationMode} [options.mode] - Navigation mode: "north" (keeps north fixed), "adaptive" (default, auto-detects arc mode), "free" (arc rotation mode)
32
29
  * @param {number} [options.inertia] - inertia factor
30
+ * @param {number} [options.velInertia] - base velocity inertia factor. Default is 0.89
33
31
  * @param {number} [options.dragInertia] - drag inertia
34
32
  * @param {number} [options.mass] - camera mass, affects velocity. Default is 1
35
33
  * @param {number} [options.minSlope] - minimal slope for vertical camera movement. Default is 0.35
36
34
  * @param {number} [options.poleThreshold] - Vertical rotation is reduced when camera is close to poles
37
35
  * @param {boolean} [options.disableRotation] - Disables horizontal rotation controls (right mouse button and touchpad). Default is false
38
36
  * @param {boolean} [options.disableTilt] - Disables vertical tilt controls (right mouse button and touchpad). Default is false
39
- * @fires og.Navigation#drag
40
- * @fires og.Navigation#zoom
41
- * @fires og.Navigation#rotate
37
+ * @fires drag
38
+ * @fires zoom
39
+ * @fires rotate
42
40
  */
43
41
  export declare class Navigation extends Control {
44
42
  force: Vec3;
@@ -80,6 +78,7 @@ export declare class Navigation extends Control {
80
78
  protected _grabbedCameraHeight: number;
81
79
  protected _newEye: Vec3;
82
80
  protected _isTouchPad: boolean;
81
+ protected _defaultVelInertia: number;
83
82
  protected _velInertia: number;
84
83
  protected _hold: boolean;
85
84
  protected _rotHDir: number;
@@ -107,6 +106,11 @@ export declare class Navigation extends Control {
107
106
  get freeMode(): boolean;
108
107
  setMode(mode: NavigationMode): void;
109
108
  protected _modeToNumber(mode: NavigationMode): number;
109
+ protected _getSurfaceDragAxes(eyeNorm: Vec3, fallbackAxis: Vec3): {
110
+ north: Vec3;
111
+ east: Vec3;
112
+ } | null;
113
+ protected _transportDragInertiaVelocity(velocity: Vec3, fromEyeNorm: Vec3, toEyeNorm: Vec3, fallbackAxis: Vec3): Vec3 | null;
110
114
  protected _handleDrag(): void;
111
115
  protected _corrRoll(): void;
112
116
  protected _handleZoom(): void;
@@ -0,0 +1,18 @@
1
+ import type { Camera } from "../camera/Camera";
2
+ import { ToggleButton } from "../ui/ToggleButton";
3
+ import { Control, type IControlParams } from "./Control";
4
+ interface IOrthoSwitcherParams extends IControlParams {
5
+ name?: string;
6
+ }
7
+ /**
8
+ * Orthographic projection switch button.
9
+ */
10
+ export declare class OrthoSwitcher extends Control {
11
+ protected _toggleBtn: ToggleButton;
12
+ constructor(options?: IOrthoSwitcherParams);
13
+ oninit(): void;
14
+ onremove(): void;
15
+ protected _onToggle: (isActive: boolean) => void;
16
+ protected _onProjectionChanged: (camera: Camera) => void;
17
+ }
18
+ export {};
@@ -0,0 +1,44 @@
1
+ import { Control, type IControlParams } from "../control/Control";
2
+ import type { ITouchState } from "../renderer/RendererEvents";
3
+ import { Vec2 } from "../math/Vec2";
4
+ import { Vec3 } from "../math/Vec3";
5
+ import { Plane } from "../math/Plane";
6
+ export declare class SimpleTouchNavigation extends Control {
7
+ protected _grabbedPoint: Vec3 | undefined;
8
+ protected _grabbedScreenPoint: Vec2;
9
+ protected _eye0: Vec3;
10
+ protected _prev_t0: Vec2;
11
+ protected _prev_t1: Vec2;
12
+ protected _dead: number;
13
+ protected _orthoMinFocusDistance: number;
14
+ protected _twoFingerTiltMinMove: number;
15
+ protected _twoFingerTiltAlignDot: number;
16
+ protected _twoFingerTiltVerticalRatio: number;
17
+ protected _twoFingerTiltHorizontalLineRatio: number;
18
+ protected _twoFingerTiltStrength: number;
19
+ protected _twoFingerTiltActive: boolean;
20
+ constructor(options?: IControlParams);
21
+ oninit(): void;
22
+ onactivate(): void;
23
+ ondeactivate(): void;
24
+ protected onTouchEnd: (e: ITouchState) => void;
25
+ protected _pointerToScreenPoint(pointer: PointerEvent, sys: NonNullable<ITouchState["sys"]>): Vec2;
26
+ protected _getGrabbedPoint(screenPoint: Vec2): Vec3;
27
+ protected _updateGrabbedScreenPoint(screenPoint: Vec2): void;
28
+ protected _startSingleFingerGesture(pointer: PointerEvent, sys: NonNullable<ITouchState["sys"]>): void;
29
+ protected _startTwoFingerGesture(pointer0: PointerEvent, pointer1: PointerEvent, sys: NonNullable<ITouchState["sys"]>, skipPointGrabbing: boolean): void;
30
+ protected _getPerspectiveDragPlane(anchor: Vec3): Plane;
31
+ protected _applyOrthographicDrag(screenPoint: Vec2): void;
32
+ protected _applyPerspectiveDrag(screenPoint: Vec2, anchor: Vec3): void;
33
+ protected _applyDragGesture(screenPoint: Vec2): void;
34
+ protected _moveSingleFingerGesture(pointer: PointerEvent, sys: NonNullable<ITouchState["sys"]>): void;
35
+ protected _applyTwoFingerZoom(vPrev: Vec2, vCurr: Vec2, middle: Vec2): void;
36
+ protected _applyTwoFingerRotation(vPrev: Vec2, vCurr: Vec2): void;
37
+ protected _isTwoFingerTiltGesture(d0: Vec2, d1: Vec2, touchLine: Vec2): boolean;
38
+ protected _applyTwoFingerTilt(d0: Vec2, d1: Vec2, touchLine: Vec2): boolean;
39
+ protected _isTwoFingerTiltHoldGesture(d0: Vec2, d1: Vec2, touchLine: Vec2): boolean;
40
+ protected _moveTwoFingerGesture(e: ITouchState, pointer0: PointerEvent, pointer1: PointerEvent, sys: NonNullable<ITouchState["sys"]>): void;
41
+ protected onTouchStart: (e: ITouchState, skipPointGrabbing?: boolean) => void;
42
+ protected onTouchMove: (e: ITouchState) => void;
43
+ protected onDraw(): void;
44
+ }
@@ -1,7 +1,7 @@
1
1
  import { Control } from "./Control";
2
2
  import type { IControlParams } from "./Control";
3
3
  import { Clock } from "../Clock";
4
- import { LightSource } from "../light/LightSource";
4
+ import { Vec3 } from "../math/Vec3";
5
5
  interface ISunParams extends IControlParams {
6
6
  activationHeight?: number;
7
7
  offsetVertical?: number;
@@ -15,7 +15,6 @@ export declare class Sun extends Control {
15
15
  activationHeight: number;
16
16
  offsetVertical: number;
17
17
  offsetHorizontal: number;
18
- sunlight: LightSource;
19
18
  protected _currDate: number;
20
19
  protected _prevDate: number;
21
20
  protected _clockPtr: Clock | null;
@@ -23,12 +22,15 @@ export declare class Sun extends Control {
23
22
  protected _stopped: boolean;
24
23
  protected _f: number;
25
24
  protected _k: number;
25
+ protected _sunlightPosition: Vec3;
26
26
  constructor(options?: ISunParams);
27
27
  oninit(): void;
28
28
  stop(): void;
29
29
  start(): void;
30
30
  onactivate(): void;
31
31
  bindClock(clock: Clock): void;
32
+ getPosition(): Vec3;
33
+ protected _setSunPosition3v(position: Vec3): void;
32
34
  protected _draw(): void;
33
35
  }
34
36
  export {};