@openglobus/og 0.10.4 → 0.11.1

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