@openglobus/og 0.12.1 → 0.12.3

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 (173) hide show
  1. package/dist/@openglobus/og.css +1 -0
  2. package/dist/@openglobus/og.esm.js +21 -0
  3. package/dist/@openglobus/og.esm.js.map +1 -0
  4. package/dist/@openglobus/og.umd.js +21 -0
  5. package/dist/@openglobus/og.umd.js.map +1 -0
  6. package/package.json +2 -2
  7. package/src/og/entity/GeoObjectHandler.js +35 -16
  8. package/src/og/layer/KML.js +19 -12
  9. package/src/og/layer/Layer.js +4 -1
  10. package/src/og/scene/Planet.js +14 -14
  11. package/src/og/shaders/geoObject.js +15 -6
  12. package/types/Clock.d.ts +94 -0
  13. package/types/Deferred.d.ts +6 -0
  14. package/types/Events.d.ts +77 -0
  15. package/types/Extent.d.ts +166 -0
  16. package/types/Globe.d.ts +85 -0
  17. package/types/ImageCanvas.d.ts +123 -0
  18. package/types/Lock.d.ts +12 -0
  19. package/types/LonLat.d.ts +108 -0
  20. package/types/Popup.d.ts +42 -0
  21. package/types/QueueArray.d.ts +19 -0
  22. package/types/Rectangle.d.ts +80 -0
  23. package/types/Stack.d.ts +19 -0
  24. package/types/ajax.d.ts +24 -0
  25. package/types/arial.d.ts +48 -0
  26. package/types/astro/astro.d.ts +38 -0
  27. package/types/astro/earth.d.ts +7 -0
  28. package/types/astro/jd.d.ts +254 -0
  29. package/types/bv/Box.d.ts +30 -0
  30. package/types/bv/Sphere.d.ts +38 -0
  31. package/types/bv/index.d.ts +3 -0
  32. package/types/camera/Camera.d.ts +312 -0
  33. package/types/camera/Frustum.d.ts +133 -0
  34. package/types/camera/PlanetCamera.d.ts +219 -0
  35. package/types/camera/index.d.ts +3 -0
  36. package/types/cons.d.ts +40 -0
  37. package/types/control/CompassButton.d.ts +17 -0
  38. package/types/control/Control.d.ts +104 -0
  39. package/types/control/DebugInfo.d.ts +15 -0
  40. package/types/control/EarthCoordinates.d.ts +47 -0
  41. package/types/control/EarthNavigation.d.ts +43 -0
  42. package/types/control/GeoImageDragControl.d.ts +6 -0
  43. package/types/control/KeyboardNavigation.d.ts +21 -0
  44. package/types/control/LayerSwitcher.d.ts +21 -0
  45. package/types/control/Lighting.d.ts +16 -0
  46. package/types/control/MouseNavigation.d.ts +48 -0
  47. package/types/control/MouseWheelZoomControl.d.ts +45 -0
  48. package/types/control/ScaleControl.d.ts +22 -0
  49. package/types/control/ShowFps.d.ts +11 -0
  50. package/types/control/SimpleNavigation.d.ts +25 -0
  51. package/types/control/Sun.d.ts +50 -0
  52. package/types/control/ToggleWireframe.d.ts +12 -0
  53. package/types/control/TouchNavigation.d.ts +48 -0
  54. package/types/control/ZoomControl.d.ts +27 -0
  55. package/types/control/index.d.ts +18 -0
  56. package/types/ellipsoid/Ellipsoid.d.ts +146 -0
  57. package/types/ellipsoid/index.d.ts +3 -0
  58. package/types/ellipsoid/wgs84.d.ts +6 -0
  59. package/types/entity/BaseBillboard.d.ts +215 -0
  60. package/types/entity/Billboard.d.ts +94 -0
  61. package/types/entity/BillboardHandler.d.ts +79 -0
  62. package/types/entity/Entity.d.ts +348 -0
  63. package/types/entity/EntityCollection.d.ts +317 -0
  64. package/types/entity/GeoObject.d.ts +111 -0
  65. package/types/entity/GeoObjectHandler.d.ts +81 -0
  66. package/types/entity/Geometry.d.ts +74 -0
  67. package/types/entity/GeometryHandler.d.ts +76 -0
  68. package/types/entity/Label.d.ts +189 -0
  69. package/types/entity/LabelHandler.d.ts +31 -0
  70. package/types/entity/LabelWorker.d.ts +11 -0
  71. package/types/entity/PointCloud.d.ts +174 -0
  72. package/types/entity/PointCloudHandler.d.ts +38 -0
  73. package/types/entity/Polyline.d.ts +306 -0
  74. package/types/entity/PolylineHandler.d.ts +18 -0
  75. package/types/entity/Ray.d.ts +124 -0
  76. package/types/entity/RayHandler.d.ts +67 -0
  77. package/types/entity/ShapeHandler.d.ts +22 -0
  78. package/types/entity/Strip.d.ts +119 -0
  79. package/types/entity/StripHandler.d.ts +38 -0
  80. package/types/entity/index.d.ts +8 -0
  81. package/types/index.core.d.ts +65 -0
  82. package/types/index.d.ts +45 -0
  83. package/types/index.webgl.d.ts +7 -0
  84. package/types/input/KeyboardHandler.d.ts +10 -0
  85. package/types/input/MouseHandler.d.ts +5 -0
  86. package/types/input/TouchHandler.d.ts +5 -0
  87. package/types/input/input.d.ts +34 -0
  88. package/types/layer/BaseGeoImage.d.ts +94 -0
  89. package/types/layer/CanvasTiles.d.ts +67 -0
  90. package/types/layer/GeoImage.d.ts +52 -0
  91. package/types/layer/GeoTexture2d.d.ts +8 -0
  92. package/types/layer/GeoVideo.d.ts +55 -0
  93. package/types/layer/KML.d.ts +68 -0
  94. package/types/layer/Layer.d.ts +310 -0
  95. package/types/layer/Material.d.ts +45 -0
  96. package/types/layer/Vector.d.ts +208 -0
  97. package/types/layer/WMS.d.ts +61 -0
  98. package/types/layer/XYZ.d.ts +119 -0
  99. package/types/layer/index.d.ts +10 -0
  100. package/types/light/LightSource.d.ts +178 -0
  101. package/types/math/Line2.d.ts +11 -0
  102. package/types/math/Line3.d.ts +10 -0
  103. package/types/math/Mat3.d.ts +65 -0
  104. package/types/math/Mat4.d.ts +176 -0
  105. package/types/math/Plane.d.ts +18 -0
  106. package/types/math/Quat.d.ts +379 -0
  107. package/types/math/Ray.d.ts +82 -0
  108. package/types/math/Vec2.d.ts +309 -0
  109. package/types/math/Vec3.d.ts +467 -0
  110. package/types/math/Vec4.d.ts +162 -0
  111. package/types/math/coder.d.ts +43 -0
  112. package/types/math/index.d.ts +11 -0
  113. package/types/math.d.ts +261 -0
  114. package/types/mercator.d.ts +92 -0
  115. package/types/proj/EPSG3857.d.ts +6 -0
  116. package/types/proj/EPSG4326.d.ts +6 -0
  117. package/types/proj/Proj.d.ts +42 -0
  118. package/types/quadTree/EntityCollectionNode.d.ts +34 -0
  119. package/types/quadTree/Node.d.ts +60 -0
  120. package/types/quadTree/quadTree.d.ts +40 -0
  121. package/types/renderer/Renderer.d.ts +290 -0
  122. package/types/renderer/RendererEvents.d.ts +237 -0
  123. package/types/res/images.d.ts +3 -0
  124. package/types/scene/Axes.d.ts +11 -0
  125. package/types/scene/BaseNode.d.ts +60 -0
  126. package/types/scene/Planet.d.ts +576 -0
  127. package/types/scene/RenderNode.d.ts +142 -0
  128. package/types/scene/SkyBox.d.ts +10 -0
  129. package/types/scene/index.d.ts +4 -0
  130. package/types/segment/Segment.d.ts +275 -0
  131. package/types/segment/SegmentLonLat.d.ts +17 -0
  132. package/types/segment/Slice.d.ts +10 -0
  133. package/types/segment/segmentHelper.d.ts +13 -0
  134. package/types/shaders/billboard.d.ts +3 -0
  135. package/types/shaders/depth.d.ts +2 -0
  136. package/types/shaders/drawnode.d.ts +7 -0
  137. package/types/shaders/geoObject.d.ts +3 -0
  138. package/types/shaders/label.d.ts +4 -0
  139. package/types/shaders/pointCloud.d.ts +2 -0
  140. package/types/shaders/polyline.d.ts +3 -0
  141. package/types/shaders/ray.d.ts +2 -0
  142. package/types/shaders/screenFrame.d.ts +2 -0
  143. package/types/shaders/shape.d.ts +4 -0
  144. package/types/shaders/skybox.d.ts +2 -0
  145. package/types/shaders/toneMapping.d.ts +2 -0
  146. package/types/shapes/BaseShape.d.ts +250 -0
  147. package/types/shapes/Sphere.d.ts +41 -0
  148. package/types/terrain/BilTerrain.d.ts +7 -0
  149. package/types/terrain/EmptyTerrain.d.ts +73 -0
  150. package/types/terrain/Geoid.d.ts +26 -0
  151. package/types/terrain/GlobusTerrain.d.ts +116 -0
  152. package/types/terrain/MapboxTerrain.d.ts +7 -0
  153. package/types/terrain/index.d.ts +5 -0
  154. package/types/utils/FontAtlas.d.ts +15 -0
  155. package/types/utils/GeoImageCreator.d.ts +30 -0
  156. package/types/utils/ImagesCacheManager.d.ts +10 -0
  157. package/types/utils/Loader.d.ts +25 -0
  158. package/types/utils/NormalMapCreator.d.ts +39 -0
  159. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  160. package/types/utils/TerrainWorker.d.ts +9 -0
  161. package/types/utils/TextureAtlas.d.ts +111 -0
  162. package/types/utils/VectorTileCreator.d.ts +16 -0
  163. package/types/utils/colorTable.d.ts +143 -0
  164. package/types/utils/earcut.d.ts +6 -0
  165. package/types/utils/shared.d.ts +231 -0
  166. package/types/webgl/Framebuffer.d.ts +135 -0
  167. package/types/webgl/Handler.d.ts +417 -0
  168. package/types/webgl/Multisample.d.ts +89 -0
  169. package/types/webgl/Program.d.ts +161 -0
  170. package/types/webgl/ProgramController.d.ts +89 -0
  171. package/types/webgl/callbacks.d.ts +1 -0
  172. package/types/webgl/index.d.ts +6 -0
  173. package/types/webgl/types.d.ts +2 -0
@@ -0,0 +1,312 @@
1
+ /**
2
+ * Camera class.
3
+ * @class
4
+ * @param {Renderer} [renderer] - Renderer uses the camera instance.
5
+ * @param {Object} [options] - Camera options:
6
+ * @param {Object} [options.name] - Camera name.
7
+ * @param {number} [options.viewAngle=38] - Camera angle of view. Default is 30.0
8
+ * @param {number} [options.near=1] - Camera near plane distance. Default is 1.0
9
+ * @param {number} [options.far=og.math.MAX] - Camera far plane distance. Deafult is og.math.MAX
10
+ * @param {Vec3} [options.eye=[0,0,0]] - Camera eye position. Default (0,0,0)
11
+ * @param {Vec3} [options.look=[0,0,0]] - Camera look position. Default (0,0,0)
12
+ * @param {Vec3} [options.up=[0,1,0]] - Camera eye position. Default (0,1,0)
13
+ *
14
+ * @fires og.Camera#viewchange
15
+ */
16
+ export class Camera {
17
+ /**
18
+ * @param {Renderer} [renderer] - Renderer uses the camera instance.
19
+ * @param {Object} [options] - Camera options:
20
+ */
21
+ constructor(renderer?: Renderer, options?: any);
22
+ /**
23
+ * Assigned renderer
24
+ * @public
25
+ * @type {Renderer}
26
+ */
27
+ public renderer: Renderer;
28
+ /**
29
+ * Camera events handler
30
+ * @public
31
+ * @type {Events}
32
+ */
33
+ public events: Events;
34
+ /**
35
+ * Camera position.
36
+ * @public
37
+ * @type {Vec3}
38
+ */
39
+ public eye: Vec3;
40
+ /**
41
+ * Camera RTE high position
42
+ * @public
43
+ * @type {Vec3}
44
+ */
45
+ public eyeHigh: Vec3;
46
+ /**
47
+ * Camera RTE low position
48
+ * @public
49
+ * @type {Vec3}
50
+ */
51
+ public eyeLow: Vec3;
52
+ /**
53
+ * Aspect ratio.
54
+ * @protected
55
+ * @type {Number}
56
+ */
57
+ protected _aspect: number;
58
+ /**
59
+ * Camera view angle in degrees
60
+ * @protected
61
+ * @type {Number}
62
+ */
63
+ protected _viewAngle: number;
64
+ /**
65
+ * Camera normal matrix.
66
+ * @protected
67
+ * @type {Mat3}
68
+ */
69
+ protected _normalMatrix: Mat3;
70
+ /**
71
+ * Camera view matrix.
72
+ * @protected
73
+ * @type {Mat4}
74
+ */
75
+ protected _viewMatrix: Mat4;
76
+ /**
77
+ * Camera right vector.
78
+ * @protected
79
+ * @type {Vec3}
80
+ */
81
+ protected _r: Vec3;
82
+ /**
83
+ * Camera up vector.
84
+ * @protected
85
+ * @type {Vec3}
86
+ */
87
+ protected _u: Vec3;
88
+ /**
89
+ * Camera forward vector.
90
+ * @protected
91
+ * @type {Vec3}
92
+ */
93
+ protected _b: Vec3;
94
+ _pu: Vec3;
95
+ _pv: Vec3;
96
+ _pn: Vec3;
97
+ _peye: Vec3;
98
+ isMoved: boolean;
99
+ _tanViewAngle_hrad: number;
100
+ _tanViewAngle_hradOneByHeight: number;
101
+ frustums: Frustum[];
102
+ nearFarArr: any[];
103
+ frustumColors: any[];
104
+ FARTHEST_FRUSTUM_INDEX: number;
105
+ _currentFrustum: number;
106
+ checkMoveEnd(): void;
107
+ /**
108
+ * Camera initialization.
109
+ * @public
110
+ * @param {Renderer} renderer - OpenGlobus renderer object.
111
+ * @param {Object} [options] - Camera options:
112
+ * @param {number} [options.viewAngle] - Camera angle of view. Default is 30.0
113
+ * @param {number} [options.near] - Camera near plane distance. Default is 1.0
114
+ * @param {number} [options.far] - Camera far plane distance. Deafult is og.math.MAX
115
+ * @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
116
+ * @param {Vec3} [options.look] - Camera look position. Default (0,0,0)
117
+ * @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
118
+ */
119
+ public _init(options?: {
120
+ viewAngle?: number;
121
+ near?: number;
122
+ far?: number;
123
+ eye?: Vec3;
124
+ look?: Vec3;
125
+ up?: Vec3;
126
+ }): void;
127
+ getUp(): Vec3;
128
+ getDown(): Vec3;
129
+ getRight(): Vec3;
130
+ getLeft(): Vec3;
131
+ getForward(): Vec3;
132
+ getBackward(): Vec3;
133
+ /**
134
+ * Updates camera view space
135
+ * @public
136
+ * @virtual
137
+ */
138
+ public update(): void;
139
+ /**
140
+ * Refresh camera matrices
141
+ * @public
142
+ */
143
+ public refresh(): void;
144
+ /**
145
+ * Sets aspect ratio
146
+ * @public
147
+ * @param {Number} aspect - Camera aspect ratio
148
+ */
149
+ public setAspectRatio(aspect: number): void;
150
+ /**
151
+ * Returns aspect ratio
152
+ * @public
153
+ * @returns {number} - Aspect ratio
154
+ */
155
+ public getAspectRatio(): number;
156
+ /**
157
+ * Sets up camera projection
158
+ * @public
159
+ * @param {nnumber} angle - Camera's view angle
160
+ * @param {number} aspect - Screen aspect ration
161
+ */
162
+ public _setProj(angle: nnumber, aspect: number): void;
163
+ _projSizeConst: number;
164
+ /**
165
+ * Sets camera view angle in degrees
166
+ * @public
167
+ * @param {number} angle - View angle
168
+ */
169
+ public setViewAngle(angle: number): void;
170
+ /**
171
+ * Gets camera view angle in degrees
172
+ * @public
173
+ * @returns {number} angle -
174
+ */
175
+ public getViewAngle(): number;
176
+ /**
177
+ * Sets camera to eye position
178
+ * @public
179
+ * @param {Vec3} eye - Camera position
180
+ * @param {Vec3} look - Look point
181
+ * @param {Vec3} up - Camera up vector
182
+ * @returns {Camera} - This camera
183
+ */
184
+ public set(eye: Vec3, look: Vec3, up: Vec3): Camera;
185
+ /**
186
+ * Sets camera look point
187
+ * @public
188
+ * @param {Vec3} look - Look point
189
+ * @param {Vec3} [up] - Camera up vector otherwise camera current up vector(this._u)
190
+ */
191
+ public look(look: Vec3, up?: Vec3): void;
192
+ /**
193
+ * Slides camera to vector d - (du, dv, dn)
194
+ * @public
195
+ * @param {number} du - delta X
196
+ * @param {number} dv - delta Y
197
+ * @param {number} dn - delta Z
198
+ */
199
+ public slide(du: number, dv: number, dn: number): void;
200
+ /**
201
+ * Roll the camera to the angle in degrees
202
+ * @public
203
+ * @param {number} angle - Delta roll angle in degrees
204
+ */
205
+ public roll(angle: number): void;
206
+ /**
207
+ * Pitch the camera to the angle in degrees
208
+ * @public
209
+ * @param {number} angle - Delta pitch angle in degrees
210
+ */
211
+ public pitch(angle: number): void;
212
+ /**
213
+ * Yaw the camera to the angle in degrees
214
+ * @public
215
+ * @param {number} angle - Delta yaw angle in degrees
216
+ */
217
+ public yaw(angle: number): void;
218
+ /**
219
+ * Returns normal vector direction to to the unprojected screen point from camera eye
220
+ * @public
221
+ * @param {number} x - Scren X coordinate
222
+ * @param {number} y - Scren Y coordinate
223
+ * @returns {Vec3} - Direction vector
224
+ */
225
+ public unproject(x: number, y: number): Vec3;
226
+ /**
227
+ * Gets projected 3d point to the 2d screen coordiantes
228
+ * @public
229
+ * @param {Vec3} v - Cartesian 3d coordiantes
230
+ * @returns {Vec2} - Screen point coordinates
231
+ */
232
+ public project(v: Vec3): Vec2;
233
+ /**
234
+ * Rotates camera around center point
235
+ * @public
236
+ * @param {number} angle - Rotation angle in radians
237
+ * @param {boolean} isArc - If true camera up vector gets from current up vector every frame,
238
+ * otherwise up is always input parameter.
239
+ * @param {Vec3} center - Point that the camera rotates around
240
+ * @param {Vecto3} [up] - Camera up vector
241
+ */
242
+ public rotateAround(angle: number, isArc: boolean, center: Vec3, up?: Vecto3): void;
243
+ /**
244
+ * Rotates camera around center point by horizontal.
245
+ * @public
246
+ * @param {number} angle - Rotation angle in radians.
247
+ * @param {boolaen} isArc - If true camera up vector gets from current up vector every frame,
248
+ * otherwise up is always input parameter.
249
+ * @param {Vec3} center - Point that the camera rotates around.
250
+ * @param {Vec3} [up] - Camera up vector.
251
+ */
252
+ public rotateHorizontal(angle: number, isArc: boolaen, center: Vec3, up?: Vec3): void;
253
+ /**
254
+ * Rotates camera around center point by vecrtical.
255
+ * @param {number} angle - Rotation angle in radians.
256
+ * @param {Vec3} center - Point that the camera rotates around.
257
+ */
258
+ rotateVertical(angle: number, center: Vec3): void;
259
+ /**
260
+ * Gets 3d size factor. Uses in LOD distance calculation.
261
+ * @public
262
+ * @param {Vec3} p - Far point.
263
+ * @param {Vec3} r - Far point.
264
+ * @returns {number} - Size factor.
265
+ */
266
+ public projectedSize(p: Vec3, r: Vec3): number;
267
+ /**
268
+ * Returns normal matrix.
269
+ * @public
270
+ * @returns {Mat3} - Normal matrix.
271
+ */
272
+ public getNormalMatrix(): Mat3;
273
+ /**
274
+ * Returns model matrix.
275
+ * @public
276
+ * @returns {Mat4} - View matrix.
277
+ */
278
+ public getViewMatrix(): Mat4;
279
+ setCurrentFrustum(k: any): void;
280
+ getCurrentFrustum(): number;
281
+ get frustum(): Frustum;
282
+ /**
283
+ * Returns projection matrix.
284
+ * @public
285
+ * @returns {Mat4} - Projection matrix.
286
+ */
287
+ public getProjectionMatrix(): Mat4;
288
+ /**
289
+ * Returns projection and model matrix product.
290
+ * @public
291
+ * @return {Mat4} - Projection-view matrix.
292
+ */
293
+ public getProjectionViewMatrix(): Mat4;
294
+ /**
295
+ * Returns inverse projection and model matrix product.
296
+ * @public
297
+ * @returns {Mat4} - Inversed projection-view matrix.
298
+ */
299
+ public getInverseProjectionViewMatrix(): Mat4;
300
+ /**
301
+ * Returns inverse projection matrix.
302
+ * @public
303
+ * @returns {Mat4} - Inversed projection-view matrix.
304
+ */
305
+ public getInverseProjectionMatrix(): Mat4;
306
+ }
307
+ import { Events } from "../Events.js";
308
+ import { Vec3 } from "../math/Vec3.js";
309
+ import { Mat3 } from "../math/Mat3.js";
310
+ import { Mat4 } from "../math/Mat4.js";
311
+ import { Frustum } from "./Frustum.js";
312
+ import { Vec2 } from "../math/Vec2.js";
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Frustum object, part of the camera object.
3
+ * @class
4
+ */
5
+ export class Frustum {
6
+ /**
7
+ * @param {*} options
8
+ */
9
+ constructor(options?: any);
10
+ /**
11
+ * Frustum planes.
12
+ * @private
13
+ * @type {Array.<Array.<number>>}
14
+ */
15
+ private _f;
16
+ /**
17
+ * Camera projection matrix.
18
+ * @protected
19
+ * @type {Mat4}
20
+ */
21
+ protected _projectionMatrix: Mat4;
22
+ /**
23
+ * Camera inverse projection matrix.
24
+ * @protected
25
+ * @type {Mat4}
26
+ */
27
+ protected _inverseProjectionMatrix: Mat4;
28
+ /**
29
+ * Product of projection and view matrices.
30
+ * @protected
31
+ * @type {Mat4}
32
+ */
33
+ protected _projectionViewMatrix: Mat4;
34
+ /**
35
+ * Inverse projectionView Matrix.
36
+ * @protected
37
+ * @type {Mat4}
38
+ */
39
+ protected _inverseProjectionViewMatrix: Mat4;
40
+ /**
41
+ * Projection frustum left value.
42
+ * @public
43
+ */
44
+ public left: number;
45
+ /**
46
+ * Projection frustum right value.
47
+ * @public
48
+ */
49
+ public right: number;
50
+ /**
51
+ * Projection frustum bottom value.
52
+ * @public
53
+ */
54
+ public bottom: number;
55
+ /**
56
+ * Projection frustum top value.
57
+ * @public
58
+ */
59
+ public top: number;
60
+ /**
61
+ * Projection frustum near value.
62
+ * @public
63
+ */
64
+ public near: number;
65
+ /**
66
+ * Projection frustum far value.
67
+ * @public
68
+ */
69
+ public far: number;
70
+ _cameraFrustumIndex: any;
71
+ getRightPlane(): number[];
72
+ getLeftPlane(): number[];
73
+ getBottomPlane(): number[];
74
+ getTopPlane(): number[];
75
+ getBackwardPlane(): number[];
76
+ getForwardPlane(): number[];
77
+ getProjectionViewMatrix(): number[];
78
+ getProjectionMatrix(): number[];
79
+ getInverseProjectionMatrix(): number[];
80
+ /**
81
+ * Sets up camera projection matrix.
82
+ * @public
83
+ * @param {nnumber} angle - Camera's view angle.
84
+ * @param {number} aspect - Screen aspect ration.
85
+ * @param {number} near - Near camera distance.
86
+ * @param {number} far - Far camera distance.
87
+ */
88
+ public setProjectionMatrix(angle: nnumber, aspect: number, near: number, far: number): void;
89
+ /**
90
+ * Camera's projection matrix values.
91
+ * @public
92
+ * @param {Mat4} projectionView - projectionView matrix.
93
+ */
94
+ public setViewMatrix(viewMatrix: any): void;
95
+ /**
96
+ * Returns true if a point in the frustum.
97
+ * @public
98
+ * @param {Vec3} point - Cartesian point.
99
+ * @returns {boolean} -
100
+ */
101
+ public containsPoint(point: Vec3): boolean;
102
+ /**
103
+ * Returns true if the frustum contains a bonding sphere, but bottom plane exclude.
104
+ * @public
105
+ * @param {Sphere} sphere - Bounding sphere.
106
+ * @returns {boolean} -
107
+ */
108
+ public containsSphereBottomExc(sphere: Sphere): boolean;
109
+ containsSphereButtom(sphere: any): boolean;
110
+ /**
111
+ * Returns true if the frustum contains a bonding sphere.
112
+ * @public
113
+ * @param {Sphere} sphere - Bounding sphere.
114
+ * @returns {boolean} -
115
+ */
116
+ public containsSphere(sphere: Sphere): boolean;
117
+ /**
118
+ * Returns true if the frustum contains a bonding sphere.
119
+ * @public
120
+ * @param {Vec3} center - Sphere center.
121
+ * @param {number} radius - Sphere radius.
122
+ * @returns {boolean} -
123
+ */
124
+ public containsSphere2(center: Vec3, radius: number): boolean;
125
+ /**
126
+ * Returns true if the frustum contains a bounding box.
127
+ * @public
128
+ * @param {Box} box - Bounding box.
129
+ * @returns {boolean} -
130
+ */
131
+ public containsBox(box: Box): boolean;
132
+ }
133
+ import { Mat4 } from "../math/Mat4.js";
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Planet camera.
3
+ * @class
4
+ * @extends {Camera}
5
+ * @param {RenderNode} planet - Planet render node.
6
+ * @param {Object} [options] - Planet camera options:
7
+ * @param {Object} [options.name] - Camera name.
8
+ * @param {number} [options.viewAngle=37] - Camera angle of view. Default is 35.0
9
+ * @param {number} [options.near] - Camera near plane distance. Default is 1.0
10
+ * @param {number} [options.far] - Camera far plane distance. Deafult is og.math.MAX
11
+ * @param {number} [options.minAltitude] - Minimal altitude for the camera. Deafult is 1
12
+ * @param {number} [options.maxAltitude] - Maximal altitude for the camera. Deafult is 20000000
13
+ * @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
14
+ * @param {Vec3} [options.look] - Camera look position. Default (0,0,0)
15
+ * @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
16
+ */
17
+ export class PlanetCamera extends Camera {
18
+ /**
19
+ * @param {RenderNode} planet - Planet render node.
20
+ * @param {Object} [options] - Planet camera options:
21
+ */
22
+ constructor(planet: RenderNode, options?: any);
23
+ /**
24
+ * Assigned camera's planet.
25
+ * @public
26
+ * @type {Planet}
27
+ */
28
+ public planet: Planet;
29
+ /**
30
+ * Minimal alltitude that camera can reach over the terrain.
31
+ * @public
32
+ * @type {number}
33
+ */
34
+ public minAltitude: number;
35
+ /**
36
+ * Maximal alltitude that camera can reach over the globe.
37
+ * @public
38
+ * @type {number}
39
+ */
40
+ public maxAltitude: number;
41
+ /**
42
+ * Current geographical degree position.
43
+ * @protected
44
+ * @type {LonLat}
45
+ */
46
+ protected _lonLat: LonLat;
47
+ /**
48
+ * Current geographical mercator position.
49
+ * @protected
50
+ * @type {LonLat}
51
+ */
52
+ protected _lonLatMerc: LonLat;
53
+ /**
54
+ * Current altitude.
55
+ * @protected
56
+ * @type {number}
57
+ */
58
+ protected _terrainAltitude: number;
59
+ /**
60
+ * Cartesian coordinates on the terrain.
61
+ * @protected
62
+ * @type {Vec3}
63
+ */
64
+ protected _terrainPoint: Vec3;
65
+ /**
66
+ * Quad node that camera flies over.
67
+ * @protected
68
+ * @type {quadTree.Node}
69
+ */
70
+ protected _insideSegment: quadTree.Node;
71
+ /**
72
+ * Coordinates that depends on what segment class we are fling over.
73
+ * It can be WGS84 or Mercator coordinates. Gets in og.quadTree.Node
74
+ * @protected
75
+ * @type {LonLat}
76
+ */
77
+ protected _insideSegmentPosition: LonLat;
78
+ slope: number;
79
+ _keyLock: Key;
80
+ _framesArr: any[];
81
+ _framesCounter: number;
82
+ _numFrames: number;
83
+ _completeCallback: any;
84
+ _flying: boolean;
85
+ eyeNorm: Vec3;
86
+ updateGeodeticPosition(): void;
87
+ /**
88
+ * Sets altitude over the terrain.
89
+ * @public
90
+ * @param {number} alt - Altitude over the terrain.
91
+ */
92
+ public setAltitude(alt: number): void;
93
+ /**
94
+ * Gets altitude over the terrain.
95
+ * @public
96
+ */
97
+ public getAltitude(): number;
98
+ /**
99
+ * Places camera to view to the geographical point.
100
+ * @public
101
+ * @param {LonLat} lonlat - New camera and camera view position.
102
+ * @param {LonLat} [lookLonLat] - Look up coordinates.
103
+ * @param {Vec3} [up] - Camera UP vector. Default (0,1,0)
104
+ */
105
+ public setLonLat(lonlat: LonLat, lookLonLat?: LonLat, up?: Vec3): void;
106
+ /**
107
+ * Returns camera geographical position.
108
+ * @public
109
+ * @returns {LonLat}
110
+ */
111
+ public getLonLat(): LonLat;
112
+ /**
113
+ * Returns camera height.
114
+ * @public
115
+ * @returns {number}
116
+ */
117
+ public getHeight(): number;
118
+ /**
119
+ * Gets position by viewable extent.
120
+ * @public
121
+ * @param {Extent} extent - Viewable extent.
122
+ * @param {Number} height - Camera height
123
+ * @returns {Vec3}
124
+ */
125
+ public getExtentPosition(extent: Extent, height: number): Vec3;
126
+ /**
127
+ * View current extent.
128
+ * @public
129
+ * @param {Extent} extent - Current extent.
130
+ */
131
+ public viewExtent(extent: Extent, height: any): void;
132
+ /**
133
+ * Flies to the current extent.
134
+ * @public
135
+ * @param {Extent} extent - Current extent.
136
+ * @param {Vec3} [up] - Camera UP in the end of flying. Default - (0,1,0)
137
+ * @param {Number} [ampl] - Altitude amplitude factor.
138
+ * @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
139
+ * @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
140
+ * @param [frameCallback]
141
+ */
142
+ public flyExtent(extent: Extent, height: any, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback, frameCallback?: any): void;
143
+ viewDistance(cartesian: any, distance?: number): void;
144
+ flyDistance(cartesian: any, distance: number, ampl: number, completeCallback: any, startCallback: any, frameCallback: any): void;
145
+ /**
146
+ * Flies to the cartesian coordinates.
147
+ * @public
148
+ * @param {Vec3} cartesian - Finish cartesian coordinates.
149
+ * @param {Vec3} [look] - Camera LOOK in the end of flying. Default - (0,0,0)
150
+ * @param {Vec3} [up] - Camera UP vector in the end of flying. Default - (0,1,0)
151
+ * @param {Number} [ampl=1.0] - Altitude amplitude factor.
152
+ * @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
153
+ * @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
154
+ * @param [frameCallback]
155
+ */
156
+ public flyCartesian(cartesian: Vec3, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback, frameCallback?: any): void;
157
+ _frameCallback: any;
158
+ /**
159
+ * Flies to the geo coordiantes.
160
+ * @public
161
+ * @param {LonLat} lonlat - Finish coordinates.
162
+ * @param {Vec3} [look] - Camera LOOK in the end of flying. Default - (0,0,0)
163
+ * @param {Vec3} [up] - Camera UP vector in the end of flying. Default - (0,1,0)
164
+ * @param {Number} [ampl] - Altitude amplitude factor.
165
+ * @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
166
+ * @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
167
+ */
168
+ public flyLonLat(lonlat: LonLat, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback): void;
169
+ /**
170
+ * Breaks the flight.
171
+ * @public
172
+ */
173
+ public stopFlying(): void;
174
+ /**
175
+ * Returns camera is flying.
176
+ * @public
177
+ * @returns {boolean}
178
+ */
179
+ public isFlying(): boolean;
180
+ /**
181
+ * Rotates around planet to the left.
182
+ * @public
183
+ * @param {number} angle - Rotation angle.
184
+ * @param {boolean} [spin] - If its true rotates around globe spin.
185
+ */
186
+ public rotateLeft(angle: number, spin?: boolean): void;
187
+ /**
188
+ * Rotates around planet to the right.
189
+ * @public
190
+ * @param {number} angle - Rotation angle.
191
+ * @param {boolean} [spin] - If its true rotates around globe spin.
192
+ */
193
+ public rotateRight(angle: number, spin?: boolean): void;
194
+ /**
195
+ * Rotates around planet to the north pole.
196
+ * @public
197
+ * @param {number} angle - Rotation angle.
198
+ */
199
+ public rotateUp(angle: number): void;
200
+ /**
201
+ * Rotates around planet to the south pole.
202
+ * @public
203
+ * @param {number} angle - Rotation angle.
204
+ */
205
+ public rotateDown(angle: number): void;
206
+ /**
207
+ * Prepare camera to the frame. Used in render node frame function.
208
+ * @public
209
+ */
210
+ public checkFly(): void;
211
+ checkTerrainCollision(): void;
212
+ getSurfaceVisibleDistance(d: any): number;
213
+ getHeading(): number;
214
+ isVisible(poi: any): boolean;
215
+ }
216
+ import { Camera } from "./Camera.js";
217
+ import { LonLat } from "../LonLat.js";
218
+ import { Vec3 } from "../math/Vec3.js";
219
+ import { Key } from "../Lock.js";
@@ -0,0 +1,3 @@
1
+ import { Camera } from "./Camera.js";
2
+ import { PlanetCamera } from "./PlanetCamera.js";
3
+ export { Camera, PlanetCamera };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Console logging singleton object.
3
+ * @class
4
+ */
5
+ export class Cons {
6
+ _container: HTMLDivElement;
7
+ _visibility: boolean;
8
+ getVisibility(): boolean;
9
+ setVisibility(visibility: any): void;
10
+ /**
11
+ * Show console panel.
12
+ * @public
13
+ */
14
+ public show(): void;
15
+ /**
16
+ * Hide console panel.
17
+ * @public
18
+ */
19
+ public hide(): void;
20
+ /**
21
+ * Adds error text in the console.
22
+ * @public
23
+ * @param {string} str - Error text.
24
+ */
25
+ public logErr(str: string): void;
26
+ /**
27
+ * Adds warning text in the console.
28
+ * @public
29
+ * @param {string} str - Warning text.
30
+ */
31
+ public logWrn(str: string): void;
32
+ /**
33
+ * Adds log text in the console.
34
+ * @public
35
+ * @param {string} str - Log text.
36
+ * @param {Object} [style] - HTML style.
37
+ */
38
+ public log(str: string, style?: any): void;
39
+ }
40
+ export const cons: Cons;