@openglobus/og 0.11.2 → 0.11.7

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 (273) hide show
  1. package/package.json +13 -13
  2. package/src/og/Clock.js +10 -10
  3. package/src/og/Events.js +8 -6
  4. package/src/og/Extent.js +82 -41
  5. package/src/og/Globe.js +25 -13
  6. package/src/og/ImageCanvas.js +22 -16
  7. package/src/og/LonLat.js +16 -13
  8. package/src/og/Popup.js +21 -14
  9. package/src/og/QueueArray.js +6 -2
  10. package/src/og/Rectangle.js +11 -6
  11. package/src/og/Stack.js +5 -2
  12. package/src/og/ajax.js +21 -33
  13. package/src/og/astro/astro.js +5 -5
  14. package/src/og/astro/earth.js +22 -16
  15. package/src/og/astro/jd.js +23 -18
  16. package/src/og/astro/orbit.js +13 -11
  17. package/src/og/astro/rotation.js +17 -8
  18. package/src/og/bv/Box.js +7 -3
  19. package/src/og/bv/Sphere.js +14 -11
  20. package/src/og/camera/Camera.js +51 -54
  21. package/src/og/camera/Frustum.js +29 -18
  22. package/src/og/camera/PlanetCamera.js +32 -23
  23. package/src/og/control/CompassButton.js +5 -1
  24. package/src/og/control/Control.js +12 -10
  25. package/src/og/control/DebugInfo.js +4 -1
  26. package/src/og/control/EarthCoordinates.js +54 -33
  27. package/src/og/control/KeyboardNavigation.js +10 -10
  28. package/src/og/control/LayerSwitcher.js +22 -21
  29. package/src/og/control/Lighting.js +34 -3
  30. package/src/og/control/MouseNavigation.js +1 -1
  31. package/src/og/control/ScaleControl.js +1 -1
  32. package/src/og/control/SegmentBoundVisualization.js +6 -7
  33. package/src/og/control/ShowFps.js +13 -8
  34. package/src/og/control/SimpleNavigation.js +6 -8
  35. package/src/og/control/Sun.js +25 -15
  36. package/src/og/control/ToggleWireframe.js +4 -4
  37. package/src/og/control/TouchNavigation.js +44 -33
  38. package/src/og/control/ZoomControl.js +41 -25
  39. package/src/og/ellipsoid/Ellipsoid.js +162 -66
  40. package/src/og/ellipsoid/wgs84.js +4 -4
  41. package/src/og/entity/BaseBillboard.js +100 -56
  42. package/src/og/entity/Billboard.js +14 -10
  43. package/src/og/entity/BillboardHandler.js +317 -60
  44. package/src/og/entity/Entity.js +100 -68
  45. package/src/og/entity/EntityCollection.js +70 -47
  46. package/src/og/entity/GeoObject.js +228 -0
  47. package/src/og/entity/GeoObjectHandler.js +910 -0
  48. package/src/og/entity/Geometry.js +27 -24
  49. package/src/og/entity/GeometryHandler.js +596 -124
  50. package/src/og/entity/Label.js +80 -49
  51. package/src/og/entity/LabelHandler.js +45 -244
  52. package/src/og/entity/LabelWorker.js +218 -0
  53. package/src/og/entity/Object3d.js +504 -0
  54. package/src/og/entity/PointCloud.js +80 -32
  55. package/src/og/entity/PointCloudHandler.js +8 -8
  56. package/src/og/entity/Polyline.js +16 -16
  57. package/src/og/entity/Ray.js +60 -27
  58. package/src/og/entity/Strip.js +77 -48
  59. package/src/og/entity/StripHandler.js +26 -26
  60. package/src/og/entity/index.js +8 -16
  61. package/src/og/layer/BaseGeoImage.js +54 -23
  62. package/src/og/layer/CanvasTiles.js +24 -24
  63. package/src/og/layer/GeoImage.js +9 -9
  64. package/src/og/layer/GeoVideo.js +3 -3
  65. package/src/og/layer/KML.js +63 -37
  66. package/src/og/layer/Layer.js +44 -21
  67. package/src/og/layer/Material.js +23 -20
  68. package/src/og/layer/Vector.js +114 -68
  69. package/src/og/layer/WMS.js +34 -17
  70. package/src/og/layer/XYZ.js +48 -46
  71. package/src/og/light/LightSource.js +46 -39
  72. package/src/og/math/Mat3.js +34 -22
  73. package/src/og/math/Mat4.js +603 -459
  74. package/src/og/math/Plane.js +21 -20
  75. package/src/og/math/Quat.js +182 -139
  76. package/src/og/math/Ray.js +38 -33
  77. package/src/og/math/Vec2.js +85 -75
  78. package/src/og/math/Vec3.js +142 -112
  79. package/src/og/math/Vec4.js +27 -31
  80. package/src/og/math/coder.js +10 -10
  81. package/src/og/math.js +12 -12
  82. package/src/og/proj/EPSG3857.js +4 -4
  83. package/src/og/proj/EPSG4326.js +4 -4
  84. package/src/og/proj/Proj.js +4 -6
  85. package/src/og/quadTree/Node.js +8 -8
  86. package/src/og/renderer/Renderer.js +59 -52
  87. package/src/og/renderer/RendererEvents.js +50 -27
  88. package/src/og/scene/BaseNode.js +7 -8
  89. package/src/og/scene/Planet.js +102 -103
  90. package/src/og/scene/RenderNode.js +28 -21
  91. package/src/og/segment/Segment.js +26 -21
  92. package/src/og/segment/SegmentLonLat.js +5 -5
  93. package/src/og/shaders/drawnode.js +135 -142
  94. package/src/og/shaders/geoObject.js +211 -0
  95. package/src/og/shaders/pointCloud.js +41 -41
  96. package/src/og/shaders/shape.js +12 -18
  97. package/src/og/shaders/skybox.js +36 -36
  98. package/src/og/shaders/toneMapping.js +1 -0
  99. package/src/og/shapes/BaseShape.js +126 -54
  100. package/src/og/shapes/Icosphere.js +29 -14
  101. package/src/og/shapes/Sphere.js +12 -15
  102. package/src/og/terrain/BilTerrain.js +1 -0
  103. package/src/og/terrain/EmptyTerrain.js +2 -2
  104. package/src/og/terrain/GlobusTerrain.js +9 -9
  105. package/src/og/utils/FontAtlas.js +6 -2
  106. package/src/og/utils/TextureAtlas.js +22 -24
  107. package/src/og/utils/VectorTileCreator.js +1 -3
  108. package/src/og/utils/shared.js +16 -16
  109. package/src/og/webgl/Framebuffer.js +88 -40
  110. package/src/og/webgl/Handler.js +243 -169
  111. package/src/og/webgl/Multisample.js +47 -19
  112. package/src/og/webgl/Program.js +79 -34
  113. package/src/og/webgl/ProgramController.js +17 -13
  114. package/src/og/webgl/callbacks.js +8 -8
  115. package/src/og/inherits.js +0 -8
  116. package/src/og/utils/polylabel.js +0 -176
  117. package/types/Clock.d.ts +0 -90
  118. package/types/Deferred.d.ts +0 -6
  119. package/types/Events.d.ts +0 -73
  120. package/types/Extent.d.ts +0 -166
  121. package/types/Globe.d.ts +0 -75
  122. package/types/ImageCanvas.d.ts +0 -121
  123. package/types/Lock.d.ts +0 -12
  124. package/types/LonLat.d.ts +0 -108
  125. package/types/Popup.d.ts +0 -38
  126. package/types/QueueArray.d.ts +0 -15
  127. package/types/Rectangle.d.ts +0 -74
  128. package/types/Stack.d.ts +0 -15
  129. package/types/ajax.d.ts +0 -24
  130. package/types/arial.d.ts +0 -48
  131. package/types/astro/astro.d.ts +0 -38
  132. package/types/astro/earth.d.ts +0 -6
  133. package/types/astro/jd.d.ts +0 -254
  134. package/types/bv/Box.d.ts +0 -25
  135. package/types/bv/Sphere.d.ts +0 -38
  136. package/types/bv/index.d.ts +0 -3
  137. package/types/camera/Camera.d.ts +0 -303
  138. package/types/camera/Frustum.d.ts +0 -129
  139. package/types/camera/PlanetCamera.d.ts +0 -223
  140. package/types/camera/index.d.ts +0 -3
  141. package/types/cons.d.ts +0 -40
  142. package/types/control/CompassButton.d.ts +0 -18
  143. package/types/control/Control.d.ts +0 -101
  144. package/types/control/DebugInfo.d.ts +0 -16
  145. package/types/control/EarthCoordinates.d.ts +0 -47
  146. package/types/control/EarthNavigation.d.ts +0 -42
  147. package/types/control/GeoImageDragControl.d.ts +0 -6
  148. package/types/control/KeyboardNavigation.d.ts +0 -22
  149. package/types/control/LayerSwitcher.d.ts +0 -23
  150. package/types/control/Lighting.d.ts +0 -16
  151. package/types/control/MouseNavigation.d.ts +0 -51
  152. package/types/control/ScaleControl.d.ts +0 -22
  153. package/types/control/ShowFps.d.ts +0 -12
  154. package/types/control/SimpleNavigation.d.ts +0 -28
  155. package/types/control/Sun.d.ts +0 -52
  156. package/types/control/ToggleWireframe.d.ts +0 -12
  157. package/types/control/TouchNavigation.d.ts +0 -50
  158. package/types/control/ZoomControl.d.ts +0 -28
  159. package/types/control/index.d.ts +0 -17
  160. package/types/ellipsoid/Ellipsoid.d.ts +0 -142
  161. package/types/ellipsoid/index.d.ts +0 -3
  162. package/types/ellipsoid/wgs84.d.ts +0 -5
  163. package/types/entity/BaseBillboard.d.ts +0 -208
  164. package/types/entity/Billboard.d.ts +0 -94
  165. package/types/entity/BillboardHandler.d.ts +0 -74
  166. package/types/entity/Entity.d.ts +0 -331
  167. package/types/entity/EntityCollection.d.ts +0 -303
  168. package/types/entity/Geometry.d.ts +0 -73
  169. package/types/entity/GeometryHandler.d.ts +0 -76
  170. package/types/entity/Label.d.ts +0 -194
  171. package/types/entity/LabelHandler.d.ts +0 -24
  172. package/types/entity/PointCloud.d.ts +0 -174
  173. package/types/entity/PointCloudHandler.d.ts +0 -38
  174. package/types/entity/Polyline.d.ts +0 -304
  175. package/types/entity/PolylineHandler.d.ts +0 -18
  176. package/types/entity/Ray.d.ts +0 -123
  177. package/types/entity/RayHandler.d.ts +0 -67
  178. package/types/entity/ShapeHandler.d.ts +0 -22
  179. package/types/entity/Strip.d.ts +0 -118
  180. package/types/entity/StripHandler.d.ts +0 -38
  181. package/types/entity/index.d.ts +0 -8
  182. package/types/index.core.d.ts +0 -65
  183. package/types/index.d.ts +0 -45
  184. package/types/index.webgl.d.ts +0 -7
  185. package/types/inherits.d.ts +0 -4
  186. package/types/input/KeyboardHandler.d.ts +0 -10
  187. package/types/input/MouseHandler.d.ts +0 -5
  188. package/types/input/TouchHandler.d.ts +0 -5
  189. package/types/input/input.d.ts +0 -34
  190. package/types/layer/BaseGeoImage.d.ts +0 -107
  191. package/types/layer/CanvasTiles.d.ts +0 -75
  192. package/types/layer/GeoImage.d.ts +0 -65
  193. package/types/layer/GeoTexture2d.d.ts +0 -8
  194. package/types/layer/GeoVideo.d.ts +0 -80
  195. package/types/layer/KML.d.ts +0 -58
  196. package/types/layer/Layer.d.ts +0 -321
  197. package/types/layer/Material.d.ts +0 -48
  198. package/types/layer/Vector.d.ts +0 -228
  199. package/types/layer/WMS.d.ts +0 -66
  200. package/types/layer/XYZ.d.ts +0 -130
  201. package/types/layer/index.d.ts +0 -10
  202. package/types/light/LightSource.d.ts +0 -177
  203. package/types/math/Line2.d.ts +0 -11
  204. package/types/math/Line3.d.ts +0 -10
  205. package/types/math/Mat3.d.ts +0 -63
  206. package/types/math/Mat4.d.ts +0 -173
  207. package/types/math/Plane.d.ts +0 -17
  208. package/types/math/Quat.d.ts +0 -376
  209. package/types/math/Ray.d.ts +0 -81
  210. package/types/math/Vec2.d.ts +0 -308
  211. package/types/math/Vec3.d.ts +0 -459
  212. package/types/math/Vec4.d.ts +0 -161
  213. package/types/math/coder.d.ts +0 -42
  214. package/types/math/index.d.ts +0 -11
  215. package/types/math.d.ts +0 -261
  216. package/types/mercator.d.ts +0 -92
  217. package/types/proj/EPSG3857.d.ts +0 -5
  218. package/types/proj/EPSG4326.d.ts +0 -5
  219. package/types/proj/Proj.d.ts +0 -42
  220. package/types/quadTree/EntityCollectionNode.d.ts +0 -34
  221. package/types/quadTree/Node.d.ts +0 -61
  222. package/types/quadTree/quadTree.d.ts +0 -40
  223. package/types/renderer/Renderer.d.ts +0 -296
  224. package/types/renderer/RendererEvents.d.ts +0 -230
  225. package/types/res/images.d.ts +0 -3
  226. package/types/scene/Axes.d.ts +0 -11
  227. package/types/scene/BaseNode.d.ts +0 -60
  228. package/types/scene/Planet.d.ts +0 -574
  229. package/types/scene/RenderNode.d.ts +0 -143
  230. package/types/scene/SkyBox.d.ts +0 -10
  231. package/types/scene/index.d.ts +0 -4
  232. package/types/segment/Segment.d.ts +0 -271
  233. package/types/segment/SegmentLonLat.d.ts +0 -62
  234. package/types/segment/segmentHelper.d.ts +0 -13
  235. package/types/shaders/billboard.d.ts +0 -3
  236. package/types/shaders/depth.d.ts +0 -2
  237. package/types/shaders/drawnode.d.ts +0 -7
  238. package/types/shaders/label.d.ts +0 -4
  239. package/types/shaders/pointCloud.d.ts +0 -2
  240. package/types/shaders/polyline.d.ts +0 -3
  241. package/types/shaders/ray.d.ts +0 -2
  242. package/types/shaders/screenFrame.d.ts +0 -2
  243. package/types/shaders/shape.d.ts +0 -4
  244. package/types/shaders/skybox.d.ts +0 -2
  245. package/types/shaders/toneMapping.d.ts +0 -2
  246. package/types/shapes/BaseShape.d.ts +0 -247
  247. package/types/shapes/Sphere.d.ts +0 -41
  248. package/types/terrain/BilTerrain.d.ts +0 -8
  249. package/types/terrain/EmptyTerrain.d.ts +0 -72
  250. package/types/terrain/Geoid.d.ts +0 -26
  251. package/types/terrain/GlobusTerrain.d.ts +0 -153
  252. package/types/terrain/MapboxTerrain.d.ts +0 -8
  253. package/types/terrain/index.d.ts +0 -5
  254. package/types/utils/FontAtlas.d.ts +0 -14
  255. package/types/utils/GeoImageCreator.d.ts +0 -30
  256. package/types/utils/ImagesCacheManager.d.ts +0 -10
  257. package/types/utils/Loader.d.ts +0 -25
  258. package/types/utils/NormalMapCreator.d.ts +0 -39
  259. package/types/utils/PlainSegmentWorker.d.ts +0 -10
  260. package/types/utils/TerrainWorker.d.ts +0 -9
  261. package/types/utils/TextureAtlas.d.ts +0 -111
  262. package/types/utils/VectorTileCreator.d.ts +0 -16
  263. package/types/utils/colorTable.d.ts +0 -143
  264. package/types/utils/earcut.d.ts +0 -6
  265. package/types/utils/shared.d.ts +0 -230
  266. package/types/webgl/Framebuffer.d.ts +0 -135
  267. package/types/webgl/Handler.d.ts +0 -372
  268. package/types/webgl/Multisample.d.ts +0 -89
  269. package/types/webgl/Program.d.ts +0 -155
  270. package/types/webgl/ProgramController.d.ts +0 -84
  271. package/types/webgl/callbacks.d.ts +0 -1
  272. package/types/webgl/index.d.ts +0 -6
  273. package/types/webgl/types.d.ts +0 -2
@@ -2,10 +2,10 @@
2
2
  * @module og/entity/PointCloud
3
3
  */
4
4
 
5
- 'use strict';
5
+ "use strict";
6
6
 
7
- import { Vec3 } from '../math/Vec3.js';
8
- import { Vec4 } from '../math/Vec4.js';
7
+ import { Vec3 } from "../math/Vec3.js";
8
+ import { Vec4 } from "../math/Vec4.js";
9
9
 
10
10
  const COORDINATES_BUFFER = 0;
11
11
  const COLOR_BUFFER = 1;
@@ -15,7 +15,7 @@ const PICKING_COLOR_BUFFER = 2;
15
15
  * PointCloud object.
16
16
  * @class
17
17
  * @param {*} [options] - Point cloud options:
18
- * @param {Array.<Array.<number>>} [options.points] - Points cartesian coordinates array,
18
+ * @param {Array.<Array.<number>>} [options.points] - Points cartesian coordinates array,
19
19
  * where first three is cartesian coordinates, next fourth is a RGBA color, and last is an point properties.
20
20
  * @param {number} [options.pointSize] - Point screen size in pixels.
21
21
  * @param {number} [options.pickingDistance] - Point border picking size in screen pixels.
@@ -33,7 +33,6 @@ const PICKING_COLOR_BUFFER = 2;
33
33
  */
34
34
  class PointCloud {
35
35
  constructor(options) {
36
-
37
36
  options = options || {};
38
37
 
39
38
  /**
@@ -49,7 +48,7 @@ class PointCloud {
49
48
  * @public
50
49
  * @type {boolean}
51
50
  */
52
- this.visibility = (options.visibility != undefined ? options.visibility : true);
51
+ this.visibility = options.visibility != undefined ? options.visibility : true;
53
52
 
54
53
  /**
55
54
  * Point screen size in pixels.
@@ -68,14 +67,14 @@ class PointCloud {
68
67
  /**
69
68
  * Parent collection render node.
70
69
  * @private
71
- * @type {og.scene.RenderNode}
70
+ * @type {RenderNode}
72
71
  */
73
72
  this._renderNode = null;
74
73
 
75
74
  /**
76
75
  * Entity instance that holds this point cloud.
77
76
  * @private
78
- * @type {og.Entity}
77
+ * @type {Entity}
79
78
  */
80
79
  this._entity = null;
81
80
 
@@ -114,7 +113,7 @@ class PointCloud {
114
113
  /**
115
114
  * Handler that stores and renders this object.
116
115
  * @private
117
- * @type {og.PointCloudHandler}
116
+ * @type {PointCloudHandler}
118
117
  */
119
118
  this._handler = null;
120
119
  this._handlerIndex = -1;
@@ -145,7 +144,6 @@ class PointCloud {
145
144
  * @public
146
145
  */
147
146
  clear() {
148
-
149
147
  this._points.length = 0;
150
148
  this._points = [];
151
149
 
@@ -189,7 +187,7 @@ class PointCloud {
189
187
  /**
190
188
  * Assign rendering scene node.
191
189
  * @public
192
- * @param {og.scene.RenderNode} renderNode - Assigned render node.
190
+ * @param {RenderNode} renderNode - Assigned render node.
193
191
  */
194
192
  setRenderNode(renderNode) {
195
193
  this._renderNode = renderNode;
@@ -217,7 +215,7 @@ class PointCloud {
217
215
  for (var i = 0; i < points.length; i++) {
218
216
  var pi = points[i];
219
217
  var pos = new Vec3(pi[0], pi[1], pi[2]),
220
- col = new Vec4(pi[3], pi[4], pi[5], (pi[6] == undefined ? 255.0 : pi[6]));
218
+ col = new Vec4(pi[3], pi[4], pi[5], pi[6] == undefined ? 255.0 : pi[6]);
221
219
  this._coordinatesData.push(pos.x, pos.y, pos.z);
222
220
  this._colorData.push(col.x / 255.0, col.y / 255.0, col.z / 255.0, col.w / 255.0);
223
221
  var p = {
@@ -233,7 +231,12 @@ class PointCloud {
233
231
 
234
232
  if (this._renderNode) {
235
233
  this._renderNode.renderer.assignPickingColor(p);
236
- this._pickingColorData.push(p._pickingColor.x / 255.0, p._pickingColor.y / 255.0, p._pickingColor.z / 255.0, 1.0);
234
+ this._pickingColorData.push(
235
+ p._pickingColor.x / 255.0,
236
+ p._pickingColor.y / 255.0,
237
+ p._pickingColor.z / 255.0,
238
+ 1.0
239
+ );
237
240
  }
238
241
  }
239
242
 
@@ -243,21 +246,18 @@ class PointCloud {
243
246
  }
244
247
 
245
248
  setPointPosition(index, x, y, z) {
246
-
247
249
  // TODO: ...
248
250
 
249
251
  this._changedBuffers[COORDINATES_BUFFER] = true;
250
252
  }
251
253
 
252
254
  setPointColor(index, r, g, b, a) {
253
-
254
255
  // TODO: ...
255
256
 
256
257
  this._changedBuffers[COLOR_BUFFER] = true;
257
258
  }
258
259
 
259
260
  addPoints(points) {
260
-
261
261
  // TODO: ...
262
262
 
263
263
  this._changedBuffers[COORDINATES_BUFFER] = true;
@@ -266,7 +266,6 @@ class PointCloud {
266
266
  }
267
267
 
268
268
  addPoint(index, point) {
269
-
270
269
  // TODO: ...
271
270
 
272
271
  this._changedBuffers[COORDINATES_BUFFER] = true;
@@ -285,7 +284,6 @@ class PointCloud {
285
284
  }
286
285
 
287
286
  removePoint(index) {
288
-
289
287
  // TODO: ...
290
288
 
291
289
  this._changedBuffers[COORDINATES_BUFFER] = true;
@@ -294,7 +292,6 @@ class PointCloud {
294
292
  }
295
293
 
296
294
  insertPoint(index, point) {
297
-
298
295
  // TODO: ...
299
296
 
300
297
  this._changedBuffers[COORDINATES_BUFFER] = true;
@@ -316,7 +313,6 @@ class PointCloud {
316
313
 
317
314
  draw() {
318
315
  if (this.visibility && this._coordinatesData.length) {
319
-
320
316
  this._update();
321
317
 
322
318
  var rn = this._renderNode;
@@ -327,18 +323,32 @@ class PointCloud {
327
323
  sha = p.attributes,
328
324
  shu = p.uniforms;
329
325
 
330
- gl.polygonOffset(this._handler._entityCollection.polygonOffsetFactor, this._handler._entityCollection.polygonOffsetUnits);
326
+ gl.polygonOffset(
327
+ this._handler._entityCollection.polygonOffsetFactor,
328
+ this._handler._entityCollection.polygonOffsetUnits
329
+ );
331
330
 
332
331
  sh.activate();
333
332
 
334
- gl.uniformMatrix4fv(shu.projectionViewMatrix, false, r.activeCamera._projectionViewMatrix._m);
333
+ gl.uniformMatrix4fv(
334
+ shu.projectionViewMatrix,
335
+ false,
336
+ r.activeCamera._projectionViewMatrix._m
337
+ );
335
338
 
336
339
  gl.uniform1f(shu.opacity, this._handler._entityCollection._fadingOpacity);
337
340
 
338
341
  gl.uniform1f(shu.pointSize, this.pointSize);
339
342
 
340
343
  gl.bindBuffer(gl.ARRAY_BUFFER, this._coordinatesBuffer);
341
- gl.vertexAttribPointer(sha.coordinates, this._coordinatesBuffer.itemSize, gl.FLOAT, false, 0, 0);
344
+ gl.vertexAttribPointer(
345
+ sha.coordinates,
346
+ this._coordinatesBuffer.itemSize,
347
+ gl.FLOAT,
348
+ false,
349
+ 0,
350
+ 0
351
+ );
342
352
 
343
353
  gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer);
344
354
  gl.vertexAttribPointer(sha.colors, this._colorBuffer.itemSize, gl.FLOAT, false, 0, 0);
@@ -359,19 +369,40 @@ class PointCloud {
359
369
 
360
370
  sh.activate();
361
371
 
362
- gl.polygonOffset(this._handler._entityCollection.polygonOffsetFactor, this._handler._entityCollection.polygonOffsetUnits);
372
+ gl.polygonOffset(
373
+ this._handler._entityCollection.polygonOffsetFactor,
374
+ this._handler._entityCollection.polygonOffsetUnits
375
+ );
363
376
 
364
- gl.uniformMatrix4fv(shu.projectionViewMatrix, false, r.activeCamera._projectionViewMatrix._m);
377
+ gl.uniformMatrix4fv(
378
+ shu.projectionViewMatrix,
379
+ false,
380
+ r.activeCamera._projectionViewMatrix._m
381
+ );
365
382
 
366
383
  gl.uniform1f(shu.opacity, this._handler._entityCollection._fadingOpacity);
367
384
 
368
385
  gl.uniform1f(shu.pointSize, this.pointSize + this.pickingDistance);
369
386
 
370
387
  gl.bindBuffer(gl.ARRAY_BUFFER, this._coordinatesBuffer);
371
- gl.vertexAttribPointer(sha.coordinates, this._coordinatesBuffer.itemSize, gl.FLOAT, false, 0, 0);
388
+ gl.vertexAttribPointer(
389
+ sha.coordinates,
390
+ this._coordinatesBuffer.itemSize,
391
+ gl.FLOAT,
392
+ false,
393
+ 0,
394
+ 0
395
+ );
372
396
 
373
397
  gl.bindBuffer(gl.ARRAY_BUFFER, this._pickingColorBuffer);
374
- gl.vertexAttribPointer(sha.colors, this._pickingColorBuffer.itemSize, gl.FLOAT, false, 0, 0);
398
+ gl.vertexAttribPointer(
399
+ sha.colors,
400
+ this._pickingColorBuffer.itemSize,
401
+ gl.FLOAT,
402
+ false,
403
+ 0,
404
+ 0
405
+ );
375
406
 
376
407
  gl.drawArrays(gl.POINTS, 0, this._coordinatesBuffer.numItems);
377
408
  }
@@ -415,19 +446,31 @@ class PointCloud {
415
446
  _createCoordinatesBuffer() {
416
447
  var h = this._renderNode.renderer.handler;
417
448
  h.gl.deleteBuffer(this._coordinatesBuffer);
418
- this._coordinatesBuffer = h.createArrayBuffer(new Float32Array(this._coordinatesData), 3, (this._coordinatesData.length) / 3);
449
+ this._coordinatesBuffer = h.createArrayBuffer(
450
+ new Float32Array(this._coordinatesData),
451
+ 3,
452
+ this._coordinatesData.length / 3
453
+ );
419
454
  }
420
455
 
421
456
  _createColorBuffer() {
422
457
  var h = this._renderNode.renderer.handler;
423
458
  h.gl.deleteBuffer(this._colorBuffer);
424
- this._colorBuffer = h.createArrayBuffer(new Float32Array(this._colorData), 4, (this._colorData.length) / 4);
459
+ this._colorBuffer = h.createArrayBuffer(
460
+ new Float32Array(this._colorData),
461
+ 4,
462
+ this._colorData.length / 4
463
+ );
425
464
  }
426
465
 
427
466
  _createPickingColorBuffer() {
428
467
  var h = this._renderNode.renderer.handler;
429
468
  h.gl.deleteBuffer(this._pickingColorBuffer);
430
- this._pickingColorBuffer = h.createArrayBuffer(new Float32Array(this._pickingColorData), 4, (this._pickingColorData.length) / 4);
469
+ this._pickingColorBuffer = h.createArrayBuffer(
470
+ new Float32Array(this._pickingColorData),
471
+ 4,
472
+ this._pickingColorData.length / 4
473
+ );
431
474
  }
432
475
 
433
476
  _setPickingColors() {
@@ -437,11 +480,16 @@ class PointCloud {
437
480
  p._entity = this._entity;
438
481
  p._entityCollection = this._entity._entityCollection;
439
482
  this._renderNode.renderer.assignPickingColor(p);
440
- this._pickingColorData.push(p._pickingColor.x / 255.0, p._pickingColor.y / 255.0, p._pickingColor.z / 255.0, 1.0);
483
+ this._pickingColorData.push(
484
+ p._pickingColor.x / 255.0,
485
+ p._pickingColor.y / 255.0,
486
+ p._pickingColor.z / 255.0,
487
+ 1.0
488
+ );
441
489
  }
442
490
  this._changedBuffers[PICKING_COLOR_BUFFER] = true;
443
491
  }
444
492
  }
445
493
  }
446
494
 
447
- export { PointCloud };
495
+ export { PointCloud };
@@ -2,13 +2,12 @@
2
2
  * @module og/entity/PointCloudHandler
3
3
  */
4
4
 
5
- 'use strict';
5
+ "use strict";
6
6
 
7
- import * as shaders from '../shaders/pointCloud.js';
7
+ import * as shaders from "../shaders/pointCloud.js";
8
8
 
9
9
  class PointCloudHandler {
10
10
  constructor(entityCollection) {
11
-
12
11
  /**
13
12
  * Picking rendering option.
14
13
  * @public
@@ -19,21 +18,21 @@ class PointCloudHandler {
19
18
  /**
20
19
  * Parent collection
21
20
  * @private
22
- * @type {og.EntityCollection}
21
+ * @type {EntityCollection}
23
22
  */
24
23
  this._entityCollection = entityCollection;
25
24
 
26
25
  /**
27
26
  * Renderer
28
27
  * @private
29
- * @type {og.Renderer}
28
+ * @type {Renderer}
30
29
  */
31
30
  this._renderer = null;
32
31
 
33
32
  /**
34
33
  * Point cloud array
35
34
  * @private
36
- * @type {Array.<og.PointCloud>}
35
+ * @type {Array.<PointCloud>}
37
36
  */
38
37
  this._pointClouds = [];
39
38
 
@@ -72,7 +71,8 @@ class PointCloudHandler {
72
71
  pointCloud._handler = this;
73
72
  pointCloud._handlerIndex = this._pointClouds.length;
74
73
  this._pointClouds.push(pointCloud);
75
- this._entityCollection && this._entityCollection.renderNode &&
74
+ this._entityCollection &&
75
+ this._entityCollection.renderNode &&
76
76
  pointCloud.setRenderNode(this._entityCollection.renderNode);
77
77
  }
78
78
  }
@@ -123,4 +123,4 @@ class PointCloudHandler {
123
123
  }
124
124
  }
125
125
 
126
- export { PointCloudHandler };
126
+ export { PointCloudHandler };
@@ -32,7 +32,7 @@ const A = 3;
32
32
  * @param {Object} [options] - Polyline options:
33
33
  * @param {number} [options.thickness] - Thickness in screen pixels 1.5 is default.
34
34
  * @param {Number} [options.altitude] - Relative to ground layers altitude value.
35
- * @param {og.Vec4} [options.color] - RGBA color.
35
+ * @param {Vec4} [options.color] - RGBA color.
36
36
  * @param {Boolean} [options.opacity] - Line opacity.
37
37
  * @param {Boolean} [options.visibility] - Polyline visibility. True default.
38
38
  * @param {Boolean} [options.isClosed] - Closed geometry type identificator.
@@ -88,7 +88,7 @@ class Polyline {
88
88
  /**
89
89
  * Polyline cartesian coordinates.
90
90
  * @private
91
- * @type {Array.<og.Vec3>}
91
+ * @type {Array.<Vec3>}
92
92
  */
93
93
  this._path3v = [];
94
94
 
@@ -113,7 +113,7 @@ class Polyline {
113
113
  /**
114
114
  * Polyline geodetic extent.
115
115
  * @protected
116
- * @type {og.Extent}
116
+ * @type {Extent}
117
117
  */
118
118
  this._extent = new Extent();
119
119
 
@@ -136,14 +136,14 @@ class Polyline {
136
136
  /**
137
137
  * Entity instance that holds this Polyline.
138
138
  * @private
139
- * @type {og.Entity}
139
+ * @type {Entity}
140
140
  */
141
141
  this._entity = null;
142
142
 
143
143
  /**
144
144
  * Handler that stores and renders this Polyline object.
145
145
  * @private
146
- * @type {og.PolylineHandler}
146
+ * @type {PolylineHandler}
147
147
  */
148
148
  this._handler = null;
149
149
  this._handlerIndex = -1;
@@ -183,11 +183,11 @@ class Polyline {
183
183
  * @param {Number[]} outVertices - Out vertices data array.
184
184
  * @param {Number[]} outOrders - Out vertices orders data array.
185
185
  * @param {Number[]} outIndexes - Out vertices indexes data array.
186
- * @param {og.Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
186
+ * @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
187
187
  * @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
188
188
  * @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
189
189
  * @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
190
- * @param {og.Extent} [outExtent] - Geodetic line extent.
190
+ * @param {Extent} [outExtent] - Geodetic line extent.
191
191
  * @param {Array} [outColors]
192
192
  * @static
193
193
  */
@@ -454,11 +454,11 @@ class Polyline {
454
454
  * @param {Number[]} outVertices - Out vertices data array.
455
455
  * @param {Number[]} outOrders - Out vertices orders data array.
456
456
  * @param {Number[]} outIndexes - Out vertices indexes data array.
457
- * @param {og.Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
457
+ * @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
458
458
  * @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
459
459
  * @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
460
460
  * @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
461
- * @param {og.Extent} [outExtent] - Geodetic line extent.
461
+ * @param {Extent} [outExtent] - Geodetic line extent.
462
462
  * @static
463
463
  */
464
464
  static appendPoint3v(
@@ -706,11 +706,11 @@ class Polyline {
706
706
  * @param {Number[]} outVertices - Out vertices data array.
707
707
  * @param {Number[]} outOrders - Out vertices orders data array.
708
708
  * @param {Number[]} outIndexes - Out indexes data array.
709
- * @param {og.Ellipsoid} ellipsoid - Ellipsoid to coordinates transformation.
709
+ * @param {Ellipsoid} ellipsoid - Ellipsoid to coordinates transformation.
710
710
  * @param {Array.<Array.<number>>} outTransformedPathCartesian - Cartesian coordinates out array. [[0,0,0], [1,1,1],...]
711
711
  * @param {Array.<Array.<LonLat>>} outPathLonLat - Geographic coordinates out array.
712
712
  * @param {Array.<Array.<LonLat>>} outTransformedPathMerc - Mercator coordinates out array.
713
- * @param {og.Extent} outExtent - Geodetic line extent.
713
+ * @param {Extent} outExtent - Geodetic line extent.
714
714
  * @static
715
715
  */
716
716
  static appendLineDataLonLat(
@@ -1579,7 +1579,7 @@ class Polyline {
1579
1579
  /**
1580
1580
  * Adds a new cartesian point in the end of the path in a last line segment.
1581
1581
  * @public
1582
- * @param {og.Vec3} point3v - New coordinate.
1582
+ * @param {Vec3} point3v - New coordinate.
1583
1583
  */
1584
1584
  appendPoint3v(point3v, color, skipEllipsoid) {
1585
1585
  if (this._path3v.length === 0) {
@@ -1623,7 +1623,7 @@ class Polyline {
1623
1623
  /**
1624
1624
  * Adds a new cartesian point in the end of the path.
1625
1625
  * @public
1626
- * @param {og.Vec3} point3v - New coordinate.
1626
+ * @param {Vec3} point3v - New coordinate.
1627
1627
  * @param {number} [multiLineIndex=0] - Path part index, first by default.
1628
1628
  */
1629
1629
  addPoint3v(point3v, multiLineIndex = 0) {
@@ -1752,7 +1752,7 @@ class Polyline {
1752
1752
  /**
1753
1753
  * Assign with render node.
1754
1754
  * @public
1755
- * @param {og.scene.RenderNode} renderNode -
1755
+ * @param {RenderNode} renderNode -
1756
1756
  */
1757
1757
  setRenderNode(renderNode) {
1758
1758
  if (renderNode) {
@@ -1870,7 +1870,7 @@ class Polyline {
1870
1870
  /**
1871
1871
  * Returns polyline geodetic extent.
1872
1872
  * @public
1873
- * @returns {og.Extent} - Geodetic extent
1873
+ * @returns {Extent} - Geodetic extent
1874
1874
  */
1875
1875
  getExtent() {
1876
1876
  return this._extent.clone();
@@ -1878,7 +1878,7 @@ class Polyline {
1878
1878
 
1879
1879
  /**
1880
1880
  * Returns path cartesian coordinates.
1881
- * @return {Array.<og.Vec3>} Polyline path.
1881
+ * @return {Array.<Vec3>} Polyline path.
1882
1882
  */
1883
1883
  getPath3v() {
1884
1884
  return this._path3v;
@@ -2,21 +2,21 @@
2
2
  * @module og/entity/BaseBillboard
3
3
  */
4
4
 
5
- 'use strict';
5
+ "use strict";
6
6
 
7
- import * as utils from '../utils/shared.js';
8
- import { Vec3 } from '../math/Vec3.js';
9
- import { Entity } from './Entity.js';
10
- import { doubleToTwoFloats2 } from '../math/coder.js';
7
+ import * as utils from "../utils/shared.js";
8
+ import { Vec3 } from "../math/Vec3.js";
9
+ import { Entity } from "./Entity.js";
10
+ import { doubleToTwoFloats2 } from "../math/coder.js";
11
11
 
12
12
  /**
13
13
  * Ray class.
14
14
  * @class
15
15
  * @param {Object} [options] - Options:
16
- * @param {og.Vec3|Array.<number>} [options.startPosition] - Ray start point position.
17
- * @param {og.Vec3|Array.<number>} [options.endPosition] - Ray end point position.
18
- * @param {og.Vec3|Array.<number>} [options.startColor] - Ray start point color.
19
- * @param {og.Vec3|Array.<number>} [options.endColor] - Ray end point color.
16
+ * @param {Vec3|Array.<number>} [options.startPosition] - Ray start point position.
17
+ * @param {Vec3|Array.<number>} [options.endPosition] - Ray end point position.
18
+ * @param {Vec3|Array.<number>} [options.startColor] - Ray start point color.
19
+ * @param {Vec3|Array.<number>} [options.endColor] - Ray end point color.
20
20
  * @param {boolean} [options.visibility] - Visibility.
21
21
  */
22
22
  class Ray {
@@ -43,7 +43,11 @@ class Ray {
43
43
  this._startPosition = utils.createVector3(options.startPosition);
44
44
  this._startPositionHigh = new Vec3();
45
45
  this._startPositionLow = new Vec3();
46
- Vec3.doubleToTwoFloats(this._startPosition, this._startPositionHigh, this._startPositionLow);
46
+ Vec3.doubleToTwoFloats(
47
+ this._startPosition,
48
+ this._startPositionHigh,
49
+ this._startPositionLow
50
+ );
47
51
 
48
52
  // RTE end position
49
53
  this._endPosition = utils.createVector3(options.endPosition);
@@ -65,14 +69,14 @@ class Ray {
65
69
  /**
66
70
  * Entity instance that holds this billboard.
67
71
  * @protected
68
- * @type {og.Entity}
72
+ * @type {Entity}
69
73
  */
70
74
  this._entity = null;
71
75
 
72
76
  /**
73
77
  * Handler that stores and renders this billboard object.
74
78
  * @protected
75
- * @type {og.BillboardHandler}
79
+ * @type {BillboardHandler}
76
80
  */
77
81
  this._handler = null;
78
82
 
@@ -95,21 +99,39 @@ class Ray {
95
99
  this._startPosition.x = x;
96
100
  this._startPosition.y = y;
97
101
  this._startPosition.z = z;
98
- Vec3.doubleToTwoFloats(this._startPosition, this._startPositionHigh, this._startPositionLow);
99
- this._handler && this._handler.setStartPositionArr(this._handlerIndex, this._startPositionHigh, this._startPositionLow);
102
+ Vec3.doubleToTwoFloats(
103
+ this._startPosition,
104
+ this._startPositionHigh,
105
+ this._startPositionLow
106
+ );
107
+ this._handler &&
108
+ this._handler.setStartPositionArr(
109
+ this._handlerIndex,
110
+ this._startPositionHigh,
111
+ this._startPositionLow
112
+ );
100
113
  }
101
114
 
102
115
  /**
103
116
  * Sets ray start position.
104
117
  * @public
105
- * @param {og.Vec3} position - Cartesian coordinates.
118
+ * @param {Vec3} position - Cartesian coordinates.
106
119
  */
107
120
  setStartPosition3v(position) {
108
121
  this._startPosition.x = position.x;
109
122
  this._startPosition.y = position.y;
110
123
  this._startPosition.z = position.z;
111
- Vec3.doubleToTwoFloats(this._startPosition, this._startPositionHigh, this._startPositionLow);
112
- this._handler && this._handler.setStartPositionArr(this._handlerIndex, this._startPositionHigh, this._startPositionLow);
124
+ Vec3.doubleToTwoFloats(
125
+ this._startPosition,
126
+ this._startPositionHigh,
127
+ this._startPositionLow
128
+ );
129
+ this._handler &&
130
+ this._handler.setStartPositionArr(
131
+ this._handlerIndex,
132
+ this._startPositionHigh,
133
+ this._startPositionLow
134
+ );
113
135
  }
114
136
 
115
137
  /**
@@ -124,20 +146,30 @@ class Ray {
124
146
  this._endPosition.y = y;
125
147
  this._endPosition.z = z;
126
148
  Vec3.doubleToTwoFloats(this._endPosition, this._endPositionHigh, this._endPositionLow);
127
- this._handler && this._handler.setEndPositionArr(this._handlerIndex, this._endPositionHigh, this._endPositionLow);
149
+ this._handler &&
150
+ this._handler.setEndPositionArr(
151
+ this._handlerIndex,
152
+ this._endPositionHigh,
153
+ this._endPositionLow
154
+ );
128
155
  }
129
156
 
130
157
  /**
131
158
  * Sets ray end position.
132
159
  * @public
133
- * @param {og.Vec3} position - Cartesian coordinates.
160
+ * @param {Vec3} position - Cartesian coordinates.
134
161
  */
135
162
  setEndPosition3v(position) {
136
163
  this._endPosition.x = position.x;
137
164
  this._endPosition.y = position.y;
138
165
  this._endPosition.z = position.z;
139
166
  Vec3.doubleToTwoFloats(this._endPosition, this._endPositionHigh, this._endPositionLow);
140
- this._handler && this._handler.setEndPositionArr(this._handlerIndex, this._endPositionHigh, this._endPositionLow);
167
+ this._handler &&
168
+ this._handler.setEndPositionArr(
169
+ this._handlerIndex,
170
+ this._endPositionHigh,
171
+ this._endPositionLow
172
+ );
141
173
  }
142
174
 
143
175
  setLength(length) {
@@ -165,11 +197,11 @@ class Ray {
165
197
  this._endColor.w = endColor.w;
166
198
  }
167
199
 
168
- this._handler && this._handler.setRgbaArr(this._handlerIndex, this._startColor, this._endColor);
200
+ this._handler &&
201
+ this._handler.setRgbaArr(this._handlerIndex, this._startColor, this._endColor);
169
202
  }
170
203
 
171
204
  setColorsHTML(startColor, endColor) {
172
-
173
205
  if (startColor) {
174
206
  this._startColor = utils.htmlColorToRgba(startColor);
175
207
  }
@@ -178,13 +210,14 @@ class Ray {
178
210
  this._endColor = utils.htmlColorToRgba(endColor);
179
211
  }
180
212
 
181
- this._handler && this._handler.setRgbaArr(this._handlerIndex, this._startColor, this._endColor);
213
+ this._handler &&
214
+ this._handler.setRgbaArr(this._handlerIndex, this._startColor, this._endColor);
182
215
  }
183
216
 
184
217
  /**
185
218
  * Returns ray start position.
186
219
  * @public
187
- * @returns {og.Vec3}
220
+ * @returns {Vec3}
188
221
  */
189
222
  getStartPosition() {
190
223
  return this._startPosition;
@@ -193,7 +226,7 @@ class Ray {
193
226
  /**
194
227
  * Returns ray end position.
195
228
  * @public
196
- * @returns {og.Vec3}
229
+ * @returns {Vec3}
197
230
  */
198
231
  getEndPosition() {
199
232
  return this._endPosition;
@@ -230,11 +263,11 @@ class Ray {
230
263
  /**
231
264
  * Sets billboard picking color.
232
265
  * @public
233
- * @param {og.Vec3} color - Picking color.
266
+ * @param {Vec3} color - Picking color.
234
267
  */
235
268
  setPickingColor3v(color) {
236
269
  this._handler && this._handler.setPickingColorArr(this._handlerIndex, color);
237
270
  }
238
271
  }
239
272
 
240
- export { Ray };
273
+ export { Ray };