@openglobus/og 0.22.2 → 0.23.0

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 (167) hide show
  1. package/css/og.css +137 -1
  2. package/lib/@openglobus/js/Object3d.d.ts +20 -10
  3. package/lib/@openglobus/js/camera/Camera.d.ts +9 -0
  4. package/lib/@openglobus/js/camera/Frustum.d.ts +3 -0
  5. package/lib/@openglobus/js/control/CameraLock.d.ts +38 -0
  6. package/lib/@openglobus/js/control/SimpleNavigation.d.ts +27 -10
  7. package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
  8. package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
  9. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
  10. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
  11. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
  12. package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
  13. package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
  14. package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
  15. package/lib/@openglobus/js/control/geoObjectEditor/colors.d.ts +8 -0
  16. package/lib/@openglobus/js/control/index.d.ts +2 -0
  17. package/lib/@openglobus/js/entity/Entity.d.ts +278 -19
  18. package/lib/@openglobus/js/entity/EntityCollection.d.ts +8 -9
  19. package/lib/@openglobus/js/entity/GeoObject.d.ts +141 -36
  20. package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +39 -63
  21. package/lib/@openglobus/js/entity/InstanceData.d.ts +76 -0
  22. package/lib/@openglobus/js/entity/Polyline.d.ts +19 -6
  23. package/lib/@openglobus/js/entity/PolylineHandler.d.ts +7 -0
  24. package/lib/@openglobus/js/index.d.ts +2 -1
  25. package/lib/@openglobus/js/layer/Vector.d.ts +4 -0
  26. package/lib/@openglobus/js/light/LightSource.d.ts +1 -139
  27. package/lib/@openglobus/js/math/Quat.d.ts +46 -33
  28. package/lib/@openglobus/js/math/Ray.d.ts +10 -4
  29. package/lib/@openglobus/js/math/Vec3.d.ts +15 -0
  30. package/lib/@openglobus/js/math.d.ts +2 -2
  31. package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +2 -2
  32. package/lib/@openglobus/js/quadTree/Node.d.ts +1 -1
  33. package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
  34. package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
  35. package/lib/@openglobus/js/renderer/Renderer.d.ts +63 -44
  36. package/lib/@openglobus/js/renderer/RendererEvents.d.ts +1 -0
  37. package/lib/@openglobus/js/scene/Planet.d.ts +11 -7
  38. package/lib/@openglobus/js/scene/RenderNode.d.ts +10 -25
  39. package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -0
  40. package/lib/@openglobus/js/shaders/geoObject.d.ts +1 -0
  41. package/lib/@openglobus/js/shaders/utils.d.ts +1 -1
  42. package/lib/@openglobus/js/ui/Checkbox.d.ts +31 -0
  43. package/lib/@openglobus/js/ui/Dialog.d.ts +3 -0
  44. package/lib/@openglobus/js/ui/Input.d.ts +32 -0
  45. package/lib/@openglobus/js/ui/View.d.ts +3 -1
  46. package/lib/@openglobus/js/utils/objParser.d.ts +44 -12
  47. package/lib/@openglobus/js/utils/shared.d.ts +22 -0
  48. package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +0 -1
  49. package/lib/@openglobus/js/webgl/Framebuffer.d.ts +35 -8
  50. package/lib/@openglobus/js/webgl/Handler.d.ts +1 -0
  51. package/lib/@openglobus/og.css +1 -1
  52. package/lib/@openglobus/og.esm.js +1 -1
  53. package/lib/@openglobus/og.esm.js.map +1 -1
  54. package/lib/@openglobus/og.umd.js +1 -1
  55. package/lib/@openglobus/og.umd.js.map +1 -1
  56. package/lib/js/Object3d.d.ts +20 -10
  57. package/lib/js/Object3d.js +124 -48
  58. package/lib/js/camera/Camera.d.ts +9 -0
  59. package/lib/js/camera/Camera.js +27 -1
  60. package/lib/js/camera/Frustum.d.ts +3 -0
  61. package/lib/js/camera/Frustum.js +7 -0
  62. package/lib/js/control/Atmosphere.js +10 -6
  63. package/lib/js/control/CameraLock.d.ts +38 -0
  64. package/lib/js/control/CameraLock.js +216 -0
  65. package/lib/js/control/Control.js +1 -1
  66. package/lib/js/control/DebugInfo.js +13 -3
  67. package/lib/js/control/KeyboardNavigation.js +1 -1
  68. package/lib/js/control/ScaleControl.js +9 -3
  69. package/lib/js/control/SimpleNavigation.d.ts +27 -10
  70. package/lib/js/control/SimpleNavigation.js +148 -49
  71. package/lib/js/control/Sun.js +1 -1
  72. package/lib/js/control/elevationProfile/ElevationProfileScene.js +4 -4
  73. package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
  74. package/lib/js/control/geoObjectEditor/ArrowEntity.js +59 -0
  75. package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
  76. package/lib/js/control/geoObjectEditor/AxisTrackEntity.js +93 -0
  77. package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
  78. package/lib/js/control/geoObjectEditor/GeoObjectEditor.js +30 -0
  79. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
  80. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +502 -0
  81. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
  82. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +487 -43
  83. package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
  84. package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +106 -0
  85. package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
  86. package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +34 -0
  87. package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
  88. package/lib/js/control/geoObjectEditor/RotateEntity.js +105 -0
  89. package/lib/js/control/geoObjectEditor/colors.d.ts +8 -0
  90. package/lib/js/control/geoObjectEditor/colors.js +8 -0
  91. package/lib/js/control/index.d.ts +2 -0
  92. package/lib/js/control/index.js +2 -0
  93. package/lib/js/control/timeline/TimelineControl.js +2 -0
  94. package/lib/js/entity/Entity.d.ts +278 -19
  95. package/lib/js/entity/Entity.js +483 -63
  96. package/lib/js/entity/EntityCollection.d.ts +8 -9
  97. package/lib/js/entity/EntityCollection.js +48 -45
  98. package/lib/js/entity/GeoObject.d.ts +141 -36
  99. package/lib/js/entity/GeoObject.js +153 -90
  100. package/lib/js/entity/GeoObjectHandler.d.ts +39 -63
  101. package/lib/js/entity/GeoObjectHandler.js +198 -295
  102. package/lib/js/entity/InstanceData.d.ts +76 -0
  103. package/lib/js/entity/InstanceData.js +344 -0
  104. package/lib/js/entity/Polyline.d.ts +19 -6
  105. package/lib/js/entity/Polyline.js +76 -36
  106. package/lib/js/entity/PolylineHandler.d.ts +7 -0
  107. package/lib/js/entity/PolylineHandler.js +26 -1
  108. package/lib/js/index.d.ts +2 -1
  109. package/lib/js/index.js +2 -1
  110. package/lib/js/layer/Bing.js +2 -2
  111. package/lib/js/layer/Vector.d.ts +4 -0
  112. package/lib/js/layer/Vector.js +16 -0
  113. package/lib/js/light/LightSource.d.ts +1 -139
  114. package/lib/js/light/LightSource.js +21 -227
  115. package/lib/js/math/Quat.d.ts +46 -33
  116. package/lib/js/math/Quat.js +91 -90
  117. package/lib/js/math/Ray.d.ts +10 -4
  118. package/lib/js/math/Ray.js +20 -4
  119. package/lib/js/math/Vec3.d.ts +15 -0
  120. package/lib/js/math/Vec3.js +30 -1
  121. package/lib/js/math.d.ts +2 -2
  122. package/lib/js/math.js +3 -3
  123. package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
  124. package/lib/js/quadTree/EntityCollectionNode.js +8 -8
  125. package/lib/js/quadTree/Node.d.ts +1 -1
  126. package/lib/js/quadTree/Node.js +2 -2
  127. package/lib/js/quadTree/QuadTreeStrategy.js +1 -1
  128. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
  129. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.js +2 -2
  130. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
  131. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.js +2 -2
  132. package/lib/js/renderer/Renderer.d.ts +63 -44
  133. package/lib/js/renderer/Renderer.js +260 -263
  134. package/lib/js/renderer/RendererEvents.d.ts +1 -0
  135. package/lib/js/renderer/RendererEvents.js +2 -1
  136. package/lib/js/scene/Planet.d.ts +11 -7
  137. package/lib/js/scene/Planet.js +109 -87
  138. package/lib/js/scene/RenderNode.d.ts +10 -25
  139. package/lib/js/scene/RenderNode.js +70 -58
  140. package/lib/js/shaders/depth.js +2 -5
  141. package/lib/js/shaders/drawnode.d.ts +1 -0
  142. package/lib/js/shaders/drawnode.js +51 -52
  143. package/lib/js/shaders/geoObject.d.ts +1 -0
  144. package/lib/js/shaders/geoObject.js +154 -91
  145. package/lib/js/shaders/polyline.js +68 -51
  146. package/lib/js/shaders/utils.d.ts +1 -1
  147. package/lib/js/shaders/utils.js +11 -0
  148. package/lib/js/ui/Checkbox.d.ts +31 -0
  149. package/lib/js/ui/Checkbox.js +110 -0
  150. package/lib/js/ui/Color.js +2 -1
  151. package/lib/js/ui/Dialog.d.ts +3 -0
  152. package/lib/js/ui/Dialog.js +20 -0
  153. package/lib/js/ui/Input.d.ts +32 -0
  154. package/lib/js/ui/Input.js +107 -0
  155. package/lib/js/ui/View.d.ts +3 -1
  156. package/lib/js/ui/View.js +6 -0
  157. package/lib/js/utils/objParser.d.ts +44 -12
  158. package/lib/js/utils/objParser.js +241 -149
  159. package/lib/js/utils/shared.d.ts +22 -0
  160. package/lib/js/utils/shared.js +34 -0
  161. package/lib/js/webgl/BaseFramebuffer.d.ts +0 -1
  162. package/lib/js/webgl/Framebuffer.d.ts +35 -8
  163. package/lib/js/webgl/Framebuffer.js +136 -29
  164. package/lib/js/webgl/Handler.d.ts +1 -0
  165. package/lib/js/webgl/Handler.js +11 -1
  166. package/lib/js/webgl/Program.js +0 -8
  167. package/package.json +4 -2
@@ -2,173 +2,35 @@ import { Vec3 } from "../math/Vec3";
2
2
  import { RenderNode } from "../scene/RenderNode";
3
3
  export interface ILightSourceParams {
4
4
  position?: Vec3;
5
- directional?: boolean;
6
5
  ambient?: Vec3;
7
6
  diffuse?: Vec3;
8
7
  specular?: Vec3;
9
8
  shininess?: number;
10
9
  }
11
- /**
12
- * Represents basic light source.
13
- * @class
14
- * @param {string} [name] - Light source name.
15
- * @param {ILightSourceParams} [params] - Light parameters:
16
- * @param {Vec3} [params.position] - Light source position if it is a point light, otherwise it is a light direction vector.
17
- * @param {Vec3} [params.ambient] - Ambient RGB color.
18
- * @param {Vec3} [params.diffuse] - Diffuse RGB color.
19
- * @param {Vec3} [params.specular] - Specular RGB color.
20
- * @param {number} [params.shininess] - Specular shininess.
21
- */
22
10
  declare class LightSource {
23
- static __counter__: number;
24
- /**
25
- * Light name.
26
- * @protected
27
- * @type {string}
28
- */
29
- protected _name: string;
30
- /**
31
- * Render node where light is shines.
32
- * @protected
33
- * @type {RenderNode}
34
- */
35
11
  protected _renderNode: RenderNode | null;
36
- /**
37
- * Light position.
38
- * @public
39
- * @type {Vec3}
40
- */
41
12
  _position: Vec3;
42
- /**
43
- * True if the light is directional.
44
- * @public
45
- * @type {boolean}
46
- */
47
- directional: boolean;
48
- /**
49
- * Ambient color.
50
- * @protected
51
- * @type {Vec3}
52
- */
53
13
  protected _ambient: Vec3;
54
- /**
55
- * Diffuse color.
56
- * @protected
57
- * @type {Vec3}
58
- */
59
14
  protected _diffuse: Vec3;
60
- /**
61
- * Specular color.
62
- * @protected
63
- * @type {Vec3}
64
- */
65
15
  protected _specular: Vec3;
66
- /**
67
- * Shininess.
68
- * @protected
69
- * @type {number}
70
- */
71
16
  protected _shininess: number;
72
- /**
73
- * Light activity.
74
- * @protected
75
- * @type {boolean}
76
- */
77
17
  protected _active: boolean;
78
18
  protected _tempAmbient: Vec3;
79
19
  protected _tempDiffuse: Vec3;
80
20
  protected _tempSpecular: Vec3;
81
21
  protected _tempShininess: number;
82
- constructor(name: string, params: ILightSourceParams);
83
- /**
84
- * Creates clone of the current light object.
85
- * @todo: TODO
86
- * @public
87
- * @returns {LightSource}
88
- */
89
- clone(): void;
90
- /**
91
- * Set light activity. If activity is false the light doesn't shine.
92
- * @public
93
- * @param {boolean} active - Light activity.
94
- */
95
- setActive(active: boolean): void;
96
- /**
97
- * Gets light activity.
98
- * @public
99
- * @returns {boolean}
100
- */
22
+ constructor(params: ILightSourceParams);
101
23
  isActive(): boolean;
102
- /**
103
- * Set light source position, or if it is a directional type sets light direction vector.
104
- * @public
105
- * @param {Vec3} position - Light position or direction vector.
106
- */
107
24
  setPosition3v(position: Vec3): void;
108
- /**
109
- * Set light source position, or if it is a directional type sets light direction vector.
110
- * @public
111
- */
112
25
  setPosition(x: number, y: number, z: number): void;
113
- /**
114
- * Returns light source position, or if it is a directional type sets light direction vector.
115
- * @public
116
- * @returns {Vec3} - Light source position/direction.
117
- */
118
26
  getPosition(): Vec3;
119
- /**
120
- * Set ambient color.
121
- * @public
122
- * @param {Vec3} rgb - Ambient color.
123
- */
124
27
  setAmbient3v(rgb: Vec3): void;
125
- /**
126
- * Set diffuse color.
127
- * @public
128
- * @param {Vec3} rgb - Diffuse color.
129
- */
130
28
  setDiffuse3v(rgb: Vec3): void;
131
- /**
132
- * Set specular color.
133
- * @public
134
- * @param {Vec3} rgb - Specular color.
135
- */
136
29
  setSpecular3v(rgb: Vec3): void;
137
- /**
138
- * Set ambient color.
139
- * @public
140
- */
141
30
  setAmbient(r: number, g: number, b: number): void;
142
- /**
143
- * Set diffuse color.
144
- * @public
145
- */
146
31
  setDiffuse(r: number, g: number, b: number): void;
147
- /**
148
- * Set specular color.
149
- * @public
150
- */
151
32
  setSpecular(r: number, g: number, b: number): void;
152
- /**
153
- * Set material shininess.
154
- * @public
155
- */
156
33
  setShininess(shininess: number): void;
157
- /**
158
- * Sets light to black.
159
- * @public
160
- */
161
- setBlack(): void;
162
- /**
163
- * Adds current light to the render node scene.
164
- * @public
165
- * @param {RenderNode} renderNode - Render node scene.
166
- */
167
34
  addTo(renderNode: RenderNode): void;
168
- /**
169
- * Removes from render node scene.
170
- * @public
171
- */
172
- remove(): void;
173
35
  }
174
36
  export { LightSource };
@@ -118,13 +118,18 @@ export declare class Quat {
118
118
  * @returns {Quat} -
119
119
  */
120
120
  static getRotationBetweenVectorsUp(source: Vec3, dest: Vec3, up: Vec3): Quat;
121
- static setFromEulerAngles(pitch: number, yaw: number, roll: number): Quat;
122
121
  /**
123
122
  * Returns true if the components are zero.
124
123
  * @public
125
124
  * @returns {boolean} -
126
125
  */
127
126
  isZero(): boolean;
127
+ /**
128
+ * Returns true if a component is NaN.
129
+ * @public
130
+ * @returns {boolean} -
131
+ */
132
+ isNaN(): boolean;
128
133
  /**
129
134
  * Clear Quat. Sets zeroes.
130
135
  * @public
@@ -167,6 +172,13 @@ export declare class Quat {
167
172
  * @returns {Quat} -
168
173
  */
169
174
  add(q: Quat): Quat;
175
+ /**
176
+ * Computes the componentwise sum of two Quats.
177
+ * @public
178
+ * @param {Quat} q - Quat to add.
179
+ * @returns {Quat} -
180
+ */
181
+ addRes(q: Quat, res: Quat): Quat;
170
182
  /**
171
183
  * Computes the componentwise difference of two Quats.
172
184
  * @public
@@ -194,6 +206,15 @@ export declare class Quat {
194
206
  * @returns {Array.<number>} - (exactly 4 entries)
195
207
  */
196
208
  toVec(): [number, number, number, number];
209
+ get xyz(): Vec3;
210
+ /**
211
+ * Sets rotation with the given heading and up vectors.
212
+ * @static
213
+ * @param {Vec3} forward - Heading target coordinates.
214
+ * @param {Vec3} up - Up vector.
215
+ * @returns {Quat} -
216
+ */
217
+ setLookRotation(forward: Vec3, up: Vec3): Quat;
197
218
  /**
198
219
  * Sets current quaternion by spherical coordinates.
199
220
  * @public
@@ -203,20 +224,12 @@ export declare class Quat {
203
224
  * @returns {Quat} -
204
225
  */
205
226
  setFromSphericalCoords(lat: number, lon: number, angle: number): Quat;
206
- /**
207
- * Sets rotation with the given heading and up vectors.
208
- * @static
209
- * @param {Vec3} forward - Heading target coordinates.
210
- * @param {Vec3} up - Up vector.
211
- * @returns {Quat} -
212
- */
213
- setLookRotation(forward: Vec3, up: Vec3): Quat;
214
227
  /**
215
228
  * Gets spherical coordinates.
216
229
  * @public
217
230
  * @returns {Object} Returns object with latitude, longitude and alpha.
218
231
  */
219
- toSphericalCoords(): any;
232
+ getSphericalCoords(): any;
220
233
  /**
221
234
  * Sets current Quat representing a rotation around an axis.
222
235
  * @public
@@ -228,9 +241,16 @@ export declare class Quat {
228
241
  /**
229
242
  * Returns axis and angle of the current Quat.
230
243
  * @public
231
- * @returns {Object} -
244
+ * @returns { axis: Vec3, angle: number } -
232
245
  */
233
- getAxisAngle(): any;
246
+ getAxisAngle(): {
247
+ axis: Vec3;
248
+ angle: number;
249
+ };
250
+ getPitch(): number;
251
+ getYaw(): number;
252
+ getRoll(): number;
253
+ setPitchYawRoll(pitchRad: number, yawRad: number, rollRad: number, frame?: Quat): Quat;
234
254
  /**
235
255
  * Sets current Quat by Euler's angles.
236
256
  * @public
@@ -274,6 +294,13 @@ export declare class Quat {
274
294
  * @returns {Vec3} -
275
295
  */
276
296
  mulVec3(v: Vec3): Vec3;
297
+ /**
298
+ * Returns quaternion and vector production.
299
+ * @public
300
+ * @param {Vec3} v - 3d Vector.
301
+ * @returns {Vec3} -
302
+ */
303
+ mulVec3Res(v: Vec3, res: Vec3): Vec3;
277
304
  /**
278
305
  * Computes the product of two Quats.
279
306
  * @public
@@ -281,6 +308,13 @@ export declare class Quat {
281
308
  * @returns {Quat} -
282
309
  */
283
310
  mul(q: Quat): Quat;
311
+ /**
312
+ * Computes the product of two Quats.
313
+ * @public
314
+ * @param {Quat} q - Quat to multiply.
315
+ * @returns {Quat} -
316
+ */
317
+ mulRes(q: Quat, res: Quat): Quat;
284
318
  /**
285
319
  * Computes the product of two Quats.
286
320
  * @public
@@ -340,27 +374,6 @@ export declare class Quat {
340
374
  * @returns {Quat} -
341
375
  */
342
376
  slerp(b: Quat, t: number): Quat;
343
- /**
344
- * Returns a roll angle in radians.
345
- * @public
346
- * @param {Boolean} [reprojectAxis] -
347
- * @returns {Number} -
348
- */
349
- getRoll(reprojectAxis?: boolean): number;
350
- /**
351
- * Returns a pitch angle in radians.
352
- * @public
353
- * @param {Boolean} [reprojectAxis] -
354
- * @returns {number} -
355
- */
356
- getPitch(reprojectAxis?: boolean): number;
357
- /**
358
- * Returns a yaw angle in radians.
359
- * @public
360
- * @param {Boolean} [reprojectAxis] -
361
- * @returns {number} -
362
- */
363
- getYaw(reprojectAxis?: boolean): number;
364
377
  }
365
378
  /**
366
379
  * Creates Quat instance.
@@ -1,6 +1,7 @@
1
1
  import { Box } from "../bv/Box";
2
2
  import { Sphere } from "../bv/Sphere";
3
3
  import { Vec3 } from "./Vec3";
4
+ import { Plane } from "./Plane";
4
5
  /**
5
6
  * Represents a ray that extends infinitely from the provided origin in the provided direction.
6
7
  * @class
@@ -38,10 +39,9 @@ export declare class Ray {
38
39
  */
39
40
  set(origin: Vec3, direction: Vec3): Ray;
40
41
  /**
41
- * Computes the point along the ray on the distance.
42
- * @public
43
- * @param {number} distance - Point distance.
44
- * @returns {Vec3}
42
+ * Get a point on the ray at a given distance `t`.
43
+ * @param {number} distance - Distance from the origin along the ray.
44
+ * @returns {Vec3} The point at distance `t`.
45
45
  */
46
46
  getPoint(distance: number): Vec3;
47
47
  /**
@@ -73,4 +73,10 @@ export declare class Ray {
73
73
  */
74
74
  hitSphere(sphere: Sphere): Vec3 | null;
75
75
  hitBox(box: Box): void;
76
+ /**
77
+ * Finds the intersection of the ray with a plane.
78
+ * @param {Plane} plane - The plane to intersect with.
79
+ * @returns {Vec3 | null} The intersection point or null if no intersection.
80
+ */
81
+ hitPlane2(plane: Plane, res: Vec3): number;
76
82
  }
@@ -241,6 +241,13 @@ export declare class Vec3 {
241
241
  * @returns {Vec3} Returns a sum vector.
242
242
  */
243
243
  add(p: Vec3): Vec3;
244
+ /**
245
+ * Gets two vectors summarization.
246
+ * @public
247
+ * @param {Vec3} p - Vector to add.
248
+ * @returns {Vec3} Returns a sum vector.
249
+ */
250
+ addRes(p: Vec3, res: Vec3): Vec3;
244
251
  /**
245
252
  * Subtract vector from the current.
246
253
  * @public
@@ -283,6 +290,13 @@ export declare class Vec3 {
283
290
  * @returns {Vec3} -
284
291
  */
285
292
  mul(vec: Vec3): Vec3;
293
+ /**
294
+ * Multiply current vector object to another and returns new vector instance.
295
+ * @public
296
+ * @param {Vec3} vec - Multiply vector.
297
+ * @returns {Vec3} -
298
+ */
299
+ mulRes(vec: Vec3, res: Vec3): Vec3;
286
300
  /**
287
301
  * Divide current vector's components to another. Results stores in the current vector object.
288
302
  * @public
@@ -452,6 +466,7 @@ export declare class Vec3 {
452
466
  * @returns {Vec3} -
453
467
  */
454
468
  slerp(v2: Vec3, t: number): Vec3;
469
+ mulVecA(a: Vec3): Vec3;
455
470
  /**
456
471
  * Gets the shortest arc quaternion to rotate this vector to the destination vector.
457
472
  * @param {Vec3} dest -
@@ -70,7 +70,7 @@ export declare function log(n: number, base: number): number;
70
70
  /**
71
71
  * Clamp the number.
72
72
  * @function
73
- * @param {number} number - Input number.
73
+ * @param {number} value - Input number.
74
74
  * @param {number} min - Minimal edge.
75
75
  * @param {number} max - Maximal edge.
76
76
  * @returns {number} -
@@ -78,7 +78,7 @@ export declare function log(n: number, base: number): number;
78
78
  * clamp(12, 1, 5)
79
79
  * //returns 5
80
80
  */
81
- export declare function clamp(number: number, min: number, max: number): number;
81
+ export declare function clamp(value: number, min: number, max: number): number;
82
82
  /**
83
83
  * Converts degrees value to radians.
84
84
  * @function
@@ -16,7 +16,7 @@ declare class EntityCollectionNode {
16
16
  layer: Vector;
17
17
  strategy: EntityCollectionsTreeStrategy;
18
18
  parentNode: EntityCollectionNode | null;
19
- childrenNodes: EntityCollectionNode[];
19
+ childNodes: EntityCollectionNode[];
20
20
  partId: number;
21
21
  nodeId: number;
22
22
  state: number | null;
@@ -34,7 +34,7 @@ declare class EntityCollectionNode {
34
34
  __setLonLat__(entity: Entity): LonLat;
35
35
  buildTree(entities: Entity[], rightNow?: boolean): void;
36
36
  isInside(entity: Entity): boolean;
37
- createChildrenNodes(): void;
37
+ createChildNodes(): void;
38
38
  collectRenderCollectionsPASS1(visibleNodes: NodesDict, outArr: EntityCollection[]): void;
39
39
  collectRenderCollectionsPASS2(visibleNodes: NodesDict, outArr: EntityCollection[], renderingNodeId: number): void;
40
40
  applyCollection(): void;
@@ -33,7 +33,7 @@ declare class Node {
33
33
  inFrustum: number;
34
34
  _fadingNodes: Node[];
35
35
  constructor(SegmentPrototype: typeof Segment, planet: Planet, partId: number, parent: Node | null, tileZoom: number, extent: Extent);
36
- createChildrenNodes(): void;
36
+ createChildNodes(): void;
37
37
  createBounds(): void;
38
38
  getState(): number | null;
39
39
  /**
@@ -9,7 +9,7 @@ export declare class EarthEntityCollectionNodeLonLat extends EntityCollectionNod
9
9
  isNorth: boolean;
10
10
  strategy: EarthEntityCollectionsTreeStrategy;
11
11
  constructor(strategy: EarthEntityCollectionsTreeStrategy, partId: number, parent: EarthEntityCollectionNodeLonLat | null, extent: Extent, planet: Planet, zoom: number);
12
- createChildrenNodes(): void;
12
+ createChildNodes(): void;
13
13
  protected _setExtentBounds(): void;
14
14
  __setLonLat__(entity: Entity): LonLat;
15
15
  isVisible(): boolean;
@@ -8,7 +8,7 @@ import { EquiEntityCollectionsTreeStrategy } from "./EquiEntityCollectionsTreeSt
8
8
  export declare class EquiEntityCollectionNodeLonLat extends EntityCollectionNode {
9
9
  strategy: EquiEntityCollectionsTreeStrategy;
10
10
  constructor(strategy: EquiEntityCollectionsTreeStrategy, partId: number, parent: EquiEntityCollectionNodeLonLat | null, extent: Extent, planet: Planet, zoom: number);
11
- createChildrenNodes(): void;
11
+ createChildNodes(): void;
12
12
  protected _setExtentBounds(): void;
13
13
  __setLonLat__(entity: Entity): LonLat;
14
14
  isVisible(): boolean;
@@ -1,6 +1,6 @@
1
1
  import { Camera } from "../camera/Camera";
2
2
  import { Control } from "../control/Control";
3
- import { RendererEventsHandler } from "./RendererEvents";
3
+ import { IBaseInputState, RendererEventsHandler } from "./RendererEvents";
4
4
  import { EntityCollection } from "../entity/EntityCollection";
5
5
  import { Framebuffer, Multisample } from "../webgl/index";
6
6
  import { FontAtlas } from "../utils/FontAtlas";
@@ -18,6 +18,7 @@ interface IRendererParams {
18
18
  fontsSrc?: string;
19
19
  gamma?: number;
20
20
  exposure?: number;
21
+ dpi?: number;
21
22
  }
22
23
  interface IPickingObject {
23
24
  _pickingColor?: Vec3;
@@ -28,6 +29,39 @@ interface IFrameCallbackHandler {
28
29
  callback: Function;
29
30
  sender: any;
30
31
  }
32
+ /**
33
+ * Represents high level WebGL context interface that starts WebGL handler working in real time.
34
+ * @class
35
+ * @param {Handler} handler - WebGL handler context.
36
+ * @param {Object} [params] - Renderer parameters:
37
+ * @fires EventsHandler<RendererEventsType>#draw
38
+ * @fires EventsHandler<RendererEventsType>#resize
39
+ * @fires EventsHandler<RendererEventsType>#mousemove
40
+ * @fires EventsHandler<RendererEventsType>#mousestop
41
+ * @fires EventsHandler<RendererEventsType>#lclick
42
+ * @fires EventsHandler<RendererEventsType>#rclick
43
+ * @fires EventsHandler<RendererEventsType>#mclick
44
+ * @fires EventsHandler<RendererEventsType>#ldblclick
45
+ * @fires EventsHandler<RendererEventsType>#rdblclick
46
+ * @fires EventsHandler<RendererEventsType>#mdblclick
47
+ * @fires EventsHandler<RendererEventsType>#lup
48
+ * @fires EventsHandler<RendererEventsType>#rup
49
+ * @fires EventsHandler<RendererEventsType>#mup
50
+ * @fires EventsHandler<RendererEventsType>#ldown
51
+ * @fires EventsHandler<RendererEventsType>#rdown
52
+ * @fires EventsHandler<RendererEventsType>#mdown
53
+ * @fires EventsHandler<RendererEventsType>#lhold
54
+ * @fires EventsHandler<RendererEventsType>#rhold
55
+ * @fires EventsHandler<RendererEventsType>#mhold
56
+ * @fires EventsHandler<RendererEventsType>#mousewheel
57
+ * @fires EventsHandler<RendererEventsType>#touchstart
58
+ * @fires EventsHandler<RendererEventsType>#touchend
59
+ * @fires EventsHandler<RendererEventsType>#touchcancel
60
+ * @fires EventsHandler<RendererEventsType>#touchmove
61
+ * @fires EventsHandler<RendererEventsType>#doubletouch
62
+ * @fires EventsHandler<RendererEventsType>#touchleave
63
+ * @fires EventsHandler<RendererEventsType>#touchenter
64
+ */
31
65
  export interface HTMLDivElementExt extends HTMLDivElement {
32
66
  attributions?: HTMLElement;
33
67
  }
@@ -65,7 +99,7 @@ declare class Renderer {
65
99
  * @public
66
100
  * @type {Camera}
67
101
  */
68
- activeCamera: Camera | null;
102
+ activeCamera: Camera;
69
103
  /**
70
104
  * Renderer events. Represents interface for setting events like mousemove, draw, keypress etc.
71
105
  * @public
@@ -101,17 +135,6 @@ declare class Renderer {
101
135
  * @type {Framebuffer}
102
136
  */
103
137
  pickingFramebuffer: Framebuffer | null;
104
- protected _tempPickingPix_: Uint8Array;
105
- /**
106
- * @public
107
- * @type {Framebuffer}
108
- */
109
- distanceFramebuffer: Framebuffer | null;
110
- /**
111
- * @type {Function[]}
112
- */
113
- protected _distanceCallbacks: IFrameCallbackHandler[];
114
- protected _tempDistancePix_: Uint8Array;
115
138
  /**
116
139
  * Depth objects rendering queue.
117
140
  * @type {Function[]}
@@ -144,24 +167,19 @@ declare class Renderer {
144
167
  * @type {FontAtlas}
145
168
  */
146
169
  fontAtlas: FontAtlas;
147
- protected _entityCollections: EntityCollection[];
170
+ protected _entityCollections: EntityCollection[][];
148
171
  protected _currentOutput: string;
149
172
  protected _fnScreenFrame: Function | null;
150
173
  labelWorker: LabelWorker;
151
- __useDistanceFramebuffer__: boolean;
152
174
  screenDepthFramebuffer: Framebuffer | null;
153
175
  screenFramePositionBuffer: WebGLBufferExt | null;
154
176
  screenTexture: Record<string, WebGLTexture>;
155
177
  outputTexture: WebGLTexture | null;
156
- protected _skipDistanceFrame: boolean;
157
- protected _distancePixelBuffer: WebGLBuffer | null;
158
- protected _skipPickingFrame: boolean;
159
- protected _pickingPixelBuffer: WebGLBuffer | null;
160
- protected _readDistanceBuffer: () => void;
161
178
  protected _readPickingBuffer: () => void;
162
- constructor(handler: Handler, params?: IRendererParams);
179
+ constructor(handler: Handler | string | HTMLCanvasElement, params?: IRendererParams);
163
180
  enableBlendOneSrcAlpha(): void;
164
181
  enableBlendDefault(): void;
182
+ setRelativeCenter(c?: Vec3): void;
165
183
  /**
166
184
  * Sets renderer events activity.
167
185
  * @param {Boolean} activity - Events activity.
@@ -169,8 +187,6 @@ declare class Renderer {
169
187
  setEventsActivity(activity: boolean): void;
170
188
  addDepthCallback(sender: any, callback: Function): number;
171
189
  removeDepthCallback(id: number): void;
172
- addDistanceCallback(sender: any, callback: Function): number;
173
- removeDistanceCallback(id: number): void;
174
190
  /**
175
191
  * Adds picking rendering callback function.
176
192
  * @param {object} sender - Callback context.
@@ -243,7 +259,6 @@ declare class Renderer {
243
259
  * @public
244
260
  */
245
261
  initialize(): void;
246
- _initReadPixelsBuffers(): void;
247
262
  _initializeControls(): void;
248
263
  resize(): void;
249
264
  setCurrentScreen(screenName: string): void;
@@ -275,18 +290,14 @@ declare class Renderer {
275
290
  /**
276
291
  * TODO: replace with cache friendly linked list by BillboardHandler, LabelHandler etc.
277
292
  */
278
- enqueueEntityCollectionsToDraw(ecArr: EntityCollection[]): void;
279
- /**
280
- * Draws opaque items entity collections.
281
- * @protected
282
- */
283
- protected _drawOpaqueEntityCollections(): void;
293
+ enqueueEntityCollectionsToDraw(ecArr: EntityCollection[], depthOrder?: number): void;
284
294
  /**
285
- * Draws transparent items entity collections.
286
295
  * @protected
287
296
  */
288
- protected _drawTransparentEntityCollections(): void;
289
- protected _clearEntityCollectionQueue(): void;
297
+ protected _drawEntityCollections(depthOrder: number): void;
298
+ protected _drawPickingEntityCollections(depthOrder: number): void;
299
+ protected _drawDepthEntityCollections(depthOrder: number): void;
300
+ protected _clearEntityCollectionQueue(depthOrder: number): void;
290
301
  /**
291
302
  * Draw nodes.
292
303
  * @public
@@ -299,19 +310,27 @@ declare class Renderer {
299
310
  * Draw picking objects framebuffer.
300
311
  * @private
301
312
  */
302
- protected _drawPickingBuffer(): void;
313
+ protected _drawPickingBuffer(depthOrder: number): void;
314
+ protected _drawDepthBuffer(depthOrder: number): void;
315
+ protected _readDepthBuffer(): void;
316
+ protected _readPickingBuffer_webgl1(): void;
317
+ protected _readPickingBuffer_webgl2(): void;
318
+ readPickingColor(x: number, y: number, outColor: NumberArray3 | Uint8Array): void;
319
+ readDepth(x: number, y: number, outDepth: NumberArray3 | Float32Array): void;
303
320
  /**
304
- * Draw picking objects framebuffer.
305
- * @protected
321
+ * Returns the distance from the active (screen) camera to the 3d-surface using the defined screen coordinates
322
+ * @public
323
+ * @param {Vec2 | IBaseInputState} px - Screen coordinates.
324
+ * @returns {number | undefined} -
306
325
  */
307
- protected _drawDistanceBuffer(): void;
308
- protected _drawDepthBuffer(): void;
309
- protected _readPickingBuffer_webgl1: () => void;
310
- protected _readPickingBuffer_webgl2: () => void;
311
- protected _readDistanceBuffer_webgl1: () => void;
312
- protected _readDistanceBuffer_webgl2: () => void;
313
- readPickingColor(x: number, y: number, outColor: NumberArray3 | Uint8Array): void;
314
- readDistanceColor(x: number, y: number, outColor: NumberArray3 | Uint8Array): void;
326
+ getDistanceFromPixel(px: Vec2 | IBaseInputState, camera?: Camera | null): number | undefined;
327
+ /**
328
+ * Returns 3d coordinates from screen coordinates
329
+ * @public
330
+ * @param {Vec2 | IBaseInputState} px - Screen coordinates.
331
+ * @returns {Vec3 | undefined} -
332
+ */
333
+ getCartesianFromPixel(px: Vec2 | IBaseInputState): Vec3 | undefined;
315
334
  /**
316
335
  * Function starts renderer
317
336
  * @public
@@ -8,6 +8,7 @@ import { Vec3 } from "../math/Vec3";
8
8
  export type RendererEventsHandler = RendererEvents & EventsHandler<RendererEventsType>;
9
9
  export declare function createRendererEvents(renderer: Renderer): RendererEvents;
10
10
  export type RendererEventsType = [
11
+ "changerelativecenter",
11
12
  "draw",
12
13
  "drawtransparent",
13
14
  "postdraw",