@openglobus/og 0.11.1 → 0.11.6

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 (255) hide show
  1. package/package.json +18 -20
  2. package/src/og/Clock.js +11 -11
  3. package/src/og/Deferred.js +1 -1
  4. package/src/og/Events.js +9 -7
  5. package/src/og/Extent.js +117 -72
  6. package/src/og/Globe.js +35 -22
  7. package/src/og/ImageCanvas.js +24 -18
  8. package/src/og/Lock.js +2 -2
  9. package/src/og/LonLat.js +40 -37
  10. package/src/og/Popup.js +21 -15
  11. package/src/og/QueueArray.js +7 -3
  12. package/src/og/Rectangle.js +11 -6
  13. package/src/og/Stack.js +8 -5
  14. package/src/og/ajax.js +21 -33
  15. package/src/og/astro/astro.js +5 -5
  16. package/src/og/astro/earth.js +23 -17
  17. package/src/og/astro/jd.js +44 -39
  18. package/src/og/astro/orbit.js +20 -18
  19. package/src/og/astro/rotation.js +17 -8
  20. package/src/og/bv/Box.js +7 -3
  21. package/src/og/bv/Sphere.js +17 -9
  22. package/src/og/camera/Camera.js +137 -86
  23. package/src/og/camera/Frustum.js +30 -19
  24. package/src/og/camera/PlanetCamera.js +30 -26
  25. package/src/og/control/CompassButton.js +8 -2
  26. package/src/og/control/Control.js +13 -11
  27. package/src/og/control/DebugInfo.js +4 -1
  28. package/src/og/control/EarthCoordinates.js +62 -41
  29. package/src/og/control/EarthNavigation.js +20 -22
  30. package/src/og/control/GeoImageDragControl.js +1 -1
  31. package/src/og/control/KeyboardNavigation.js +12 -12
  32. package/src/og/control/LayerSwitcher.js +24 -23
  33. package/src/og/control/Lighting.js +1 -1
  34. package/src/og/control/MouseNavigation.js +1 -1
  35. package/src/og/control/ScaleControl.js +1 -1
  36. package/src/og/control/SegmentBoundVisualization.js +8 -9
  37. package/src/og/control/ShowFps.js +15 -10
  38. package/src/og/control/SimpleNavigation.js +8 -10
  39. package/src/og/control/Sun.js +25 -15
  40. package/src/og/control/ToggleWireframe.js +5 -5
  41. package/src/og/control/TouchNavigation.js +58 -45
  42. package/src/og/control/ZoomControl.js +41 -25
  43. package/src/og/control/index.js +4 -0
  44. package/src/og/ellipsoid/Ellipsoid.js +181 -85
  45. package/src/og/ellipsoid/wgs84.js +4 -4
  46. package/src/og/entity/BaseBillboard.js +97 -44
  47. package/src/og/entity/Billboard.js +15 -11
  48. package/src/og/entity/BillboardHandler.js +314 -64
  49. package/src/og/entity/Entity.js +106 -74
  50. package/src/og/entity/EntityCollection.js +72 -49
  51. package/src/og/entity/GeoObject.js +228 -0
  52. package/src/og/entity/GeoObjectHandler.js +910 -0
  53. package/src/og/entity/Geometry.js +29 -26
  54. package/src/og/entity/GeometryHandler.js +598 -126
  55. package/src/og/entity/Label.js +74 -40
  56. package/src/og/entity/LabelHandler.js +47 -246
  57. package/src/og/entity/LabelWorker.js +213 -0
  58. package/src/og/entity/Object3d.js +504 -0
  59. package/src/og/entity/PointCloud.js +81 -33
  60. package/src/og/entity/PointCloudHandler.js +9 -9
  61. package/src/og/entity/Polyline.js +39 -39
  62. package/src/og/entity/Ray.js +61 -28
  63. package/src/og/entity/ShapeHandler.js +1 -1
  64. package/src/og/entity/Strip.js +77 -48
  65. package/src/og/entity/StripHandler.js +27 -27
  66. package/src/og/entity/index.js +8 -16
  67. package/src/og/input/KeyboardHandler.js +107 -104
  68. package/src/og/input/MouseHandler.js +81 -78
  69. package/src/og/input/TouchHandler.js +55 -51
  70. package/src/og/layer/BaseGeoImage.js +61 -30
  71. package/src/og/layer/CanvasTiles.js +26 -24
  72. package/src/og/layer/GeoImage.js +10 -10
  73. package/src/og/layer/GeoTexture2d.js +1 -1
  74. package/src/og/layer/GeoVideo.js +3 -3
  75. package/src/og/layer/KML.js +66 -40
  76. package/src/og/layer/Layer.js +27 -17
  77. package/src/og/layer/Material.js +93 -61
  78. package/src/og/layer/Vector.js +118 -72
  79. package/src/og/layer/WMS.js +36 -19
  80. package/src/og/layer/XYZ.js +55 -48
  81. package/src/og/light/LightSource.js +47 -40
  82. package/src/og/math/Line2.js +24 -24
  83. package/src/og/math/Line3.js +103 -102
  84. package/src/og/math/Mat3.js +134 -121
  85. package/src/og/math/Mat4.js +603 -459
  86. package/src/og/math/Plane.js +21 -20
  87. package/src/og/math/Quat.js +980 -927
  88. package/src/og/math/Ray.js +195 -187
  89. package/src/og/math/Vec2.js +127 -117
  90. package/src/og/math/Vec3.js +206 -176
  91. package/src/og/math/Vec4.js +49 -53
  92. package/src/og/math/coder.js +18 -18
  93. package/src/og/math.js +12 -12
  94. package/src/og/mercator.js +11 -11
  95. package/src/og/proj/EPSG3857.js +4 -4
  96. package/src/og/proj/EPSG4326.js +4 -4
  97. package/src/og/proj/Proj.js +31 -31
  98. package/src/og/quadTree/EntityCollectionNode.js +310 -300
  99. package/src/og/quadTree/Node.js +1008 -993
  100. package/src/og/renderer/Renderer.js +768 -747
  101. package/src/og/renderer/RendererEvents.js +9 -6
  102. package/src/og/scene/Axes.js +1 -1
  103. package/src/og/scene/BaseNode.js +8 -9
  104. package/src/og/scene/Planet.js +115 -87
  105. package/src/og/scene/RenderNode.js +29 -22
  106. package/src/og/scene/SkyBox.js +1 -1
  107. package/src/og/segment/Segment.js +1886 -1878
  108. package/src/og/segment/SegmentLonLat.js +298 -268
  109. package/src/og/segment/segmentHelper.js +11 -11
  110. package/src/og/shaders/bloom.js +1 -1
  111. package/src/og/shaders/blur.js +2 -2
  112. package/src/og/shaders/depth.js +1 -1
  113. package/src/og/shaders/geoObject.js +211 -0
  114. package/src/og/shaders/label.js +1 -1
  115. package/src/og/shaders/lumFilter.js +1 -1
  116. package/src/og/shaders/pointCloud.js +42 -42
  117. package/src/og/shaders/screenFrame.js +1 -1
  118. package/src/og/shaders/shape.js +15 -21
  119. package/src/og/shaders/skybox.js +37 -37
  120. package/src/og/shaders/toneMapping.js +1 -1
  121. package/src/og/shapes/BaseShape.js +129 -57
  122. package/src/og/shapes/Icosphere.js +30 -15
  123. package/src/og/shapes/Sphere.js +13 -16
  124. package/src/og/terrain/BilTerrain.js +2 -1
  125. package/src/og/terrain/EmptyTerrain.js +2 -2
  126. package/src/og/terrain/Geoid.js +2 -2
  127. package/src/og/terrain/GlobusTerrain.js +10 -10
  128. package/src/og/terrain/MapboxTerrain.js +1 -1
  129. package/src/og/utils/GeoImageCreator.js +9 -9
  130. package/src/og/utils/Loader.js +6 -6
  131. package/src/og/utils/NormalMapCreator.js +13 -13
  132. package/src/og/utils/TerrainWorker.js +1 -1
  133. package/src/og/utils/TextureAtlas.js +20 -22
  134. package/src/og/utils/VectorTileCreator.js +5 -5
  135. package/src/og/utils/earcut.js +1 -1
  136. package/src/og/utils/shared.js +15 -15
  137. package/src/og/webgl/Framebuffer.js +101 -53
  138. package/src/og/webgl/Handler.js +125 -85
  139. package/src/og/webgl/Multisample.js +55 -27
  140. package/src/og/webgl/Program.js +80 -35
  141. package/src/og/webgl/ProgramController.js +27 -23
  142. package/src/og/webgl/callbacks.js +8 -8
  143. package/types/Clock.d.ts +6 -2
  144. package/types/Deferred.d.ts +1 -1
  145. package/types/Events.d.ts +8 -4
  146. package/types/Extent.d.ts +37 -33
  147. package/types/Globe.d.ts +15 -13
  148. package/types/ImageCanvas.d.ts +5 -3
  149. package/types/LonLat.d.ts +24 -24
  150. package/types/Popup.d.ts +4 -0
  151. package/types/QueueArray.d.ts +6 -2
  152. package/types/Rectangle.d.ts +10 -4
  153. package/types/Stack.d.ts +4 -0
  154. package/types/ajax.d.ts +1 -1
  155. package/types/astro/earth.d.ts +3 -2
  156. package/types/bv/Box.d.ts +10 -5
  157. package/types/bv/Sphere.d.ts +13 -7
  158. package/types/camera/Camera.d.ts +90 -81
  159. package/types/camera/Frustum.d.ts +26 -22
  160. package/types/camera/PlanetCamera.d.ts +49 -53
  161. package/types/control/CompassButton.d.ts +4 -4
  162. package/types/control/Control.d.ts +7 -4
  163. package/types/control/DebugInfo.d.ts +3 -4
  164. package/types/control/EarthCoordinates.d.ts +6 -6
  165. package/types/control/EarthNavigation.d.ts +42 -0
  166. package/types/control/KeyboardNavigation.d.ts +3 -4
  167. package/types/control/LayerSwitcher.d.ts +3 -5
  168. package/types/control/Lighting.d.ts +3 -3
  169. package/types/control/MouseNavigation.d.ts +47 -0
  170. package/types/control/ScaleControl.d.ts +3 -3
  171. package/types/control/ShowFps.d.ts +3 -4
  172. package/types/control/SimpleNavigation.d.ts +3 -6
  173. package/types/control/Sun.d.ts +8 -10
  174. package/types/control/ToggleWireframe.d.ts +3 -3
  175. package/types/control/TouchNavigation.d.ts +48 -0
  176. package/types/control/ZoomControl.d.ts +3 -4
  177. package/types/control/index.d.ts +3 -1
  178. package/types/ellipsoid/Ellipsoid.d.ts +47 -43
  179. package/types/ellipsoid/wgs84.d.ts +3 -2
  180. package/types/entity/BaseBillboard.d.ts +41 -34
  181. package/types/entity/Billboard.d.ts +7 -7
  182. package/types/entity/BillboardHandler.d.ts +4 -0
  183. package/types/entity/Entity.d.ts +101 -83
  184. package/types/entity/EntityCollection.d.ts +57 -43
  185. package/types/entity/GeoObject.d.ts +111 -0
  186. package/types/entity/GeoObjectHandler.d.ts +77 -0
  187. package/types/entity/Geometry.d.ts +9 -7
  188. package/types/entity/GeometryHandler.d.ts +2 -2
  189. package/types/entity/Label.d.ts +24 -29
  190. package/types/entity/LabelHandler.d.ts +9 -2
  191. package/types/entity/LabelWorker.d.ts +9 -0
  192. package/types/entity/PointCloud.d.ts +8 -8
  193. package/types/entity/PointCloudHandler.d.ts +3 -3
  194. package/types/entity/Polyline.d.ts +58 -55
  195. package/types/entity/Ray.d.ts +19 -18
  196. package/types/entity/Strip.d.ts +8 -7
  197. package/types/entity/StripHandler.d.ts +3 -3
  198. package/types/entity/index.d.ts +7 -7
  199. package/types/input/KeyboardHandler.d.ts +10 -0
  200. package/types/input/MouseHandler.d.ts +5 -0
  201. package/types/input/TouchHandler.d.ts +5 -0
  202. package/types/layer/BaseGeoImage.d.ts +23 -35
  203. package/types/layer/CanvasTiles.d.ts +15 -22
  204. package/types/layer/GeoImage.d.ts +5 -18
  205. package/types/layer/GeoVideo.d.ts +5 -30
  206. package/types/layer/KML.d.ts +20 -15
  207. package/types/layer/Layer.d.ts +326 -0
  208. package/types/layer/Material.d.ts +45 -0
  209. package/types/layer/Vector.d.ts +208 -0
  210. package/types/layer/WMS.d.ts +4 -7
  211. package/types/layer/XYZ.d.ts +19 -25
  212. package/types/light/LightSource.d.ts +54 -53
  213. package/types/math/Line2.d.ts +11 -0
  214. package/types/math/Line3.d.ts +10 -0
  215. package/types/math/Mat3.d.ts +30 -18
  216. package/types/math/Mat4.d.ts +71 -52
  217. package/types/math/Plane.d.ts +5 -4
  218. package/types/math/Quat.d.ts +379 -0
  219. package/types/math/Ray.d.ts +82 -0
  220. package/types/math/Vec2.d.ts +102 -101
  221. package/types/math/Vec3.d.ts +143 -142
  222. package/types/math/Vec4.d.ts +40 -39
  223. package/types/math/coder.d.ts +12 -11
  224. package/types/math.d.ts +8 -8
  225. package/types/mercator.d.ts +3 -3
  226. package/types/proj/EPSG3857.d.ts +3 -2
  227. package/types/proj/EPSG4326.d.ts +3 -2
  228. package/types/proj/Proj.d.ts +42 -0
  229. package/types/quadTree/EntityCollectionNode.d.ts +34 -0
  230. package/types/quadTree/Node.d.ts +61 -0
  231. package/types/renderer/Renderer.d.ts +300 -0
  232. package/types/renderer/RendererEvents.d.ts +10 -7
  233. package/types/scene/BaseNode.d.ts +9 -9
  234. package/types/scene/Planet.d.ts +131 -126
  235. package/types/scene/RenderNode.d.ts +22 -23
  236. package/types/segment/Segment.d.ts +279 -0
  237. package/types/segment/SegmentLonLat.d.ts +16 -0
  238. package/types/shaders/geoObject.d.ts +3 -0
  239. package/types/shapes/BaseShape.d.ts +43 -40
  240. package/types/shapes/Sphere.d.ts +7 -7
  241. package/types/terrain/BilTerrain.d.ts +0 -1
  242. package/types/terrain/EmptyTerrain.d.ts +4 -4
  243. package/types/terrain/GlobusTerrain.d.ts +17 -54
  244. package/types/terrain/MapboxTerrain.d.ts +0 -1
  245. package/types/utils/GeoImageCreator.d.ts +3 -2
  246. package/types/utils/TextureAtlas.d.ts +8 -8
  247. package/types/utils/shared.d.ts +25 -24
  248. package/types/webgl/Framebuffer.d.ts +5 -5
  249. package/types/webgl/Handler.d.ts +68 -43
  250. package/types/webgl/Multisample.d.ts +5 -5
  251. package/types/webgl/Program.d.ts +8 -2
  252. package/types/webgl/ProgramController.d.ts +18 -13
  253. package/src/og/inherits.js +0 -8
  254. package/src/og/utils/polylabel.js +0 -176
  255. package/types/inherits.d.ts +0 -4
@@ -2,10 +2,10 @@
2
2
  * @module og/entity/BillboardHandler
3
3
  */
4
4
 
5
- 'use strict';
5
+ "use strict";
6
6
 
7
- import * as shaders from '../shaders/billboard.js';
8
- import { concatTypedArrays, spliceTypedArray } from '../utils/shared.js';
7
+ import * as shaders from "../shaders/billboard.js";
8
+ import { concatTypedArrays, spliceTypedArray } from "../utils/shared.js";
9
9
 
10
10
  const PICKINGCOLOR_BUFFER = 0;
11
11
  const POSITION_BUFFER = 1;
@@ -23,8 +23,11 @@ const ALIGNEDAXIS_BUFFER = 8;
23
23
  *
24
24
  */
25
25
  class BillboardHandler {
26
+ /**
27
+ *
28
+ * @param {*} entityCollection
29
+ */
26
30
  constructor(entityCollection) {
27
-
28
31
  /**
29
32
  * Picking rendering option.
30
33
  * @public
@@ -96,7 +99,6 @@ class BillboardHandler {
96
99
 
97
100
  initProgram() {
98
101
  if (this._renderer.handler) {
99
-
100
102
  if (!this._renderer.handler.programs.billboard) {
101
103
  this._renderer.handler.addProgram(shaders.billboard_screen());
102
104
  }
@@ -124,14 +126,15 @@ class BillboardHandler {
124
126
  while (i--) {
125
127
  var bi = this._billboards[i];
126
128
  bi._handlerIndex = -1;
127
- bi._handler = null;
129
+ bi._handler = null;
130
+ bi._isReady = false;
131
+ bi._lockId = -1;
128
132
  }
129
133
  this._billboards.length = 0;
130
134
  this._billboards = [];
131
135
  }
132
136
 
133
137
  clear() {
134
-
135
138
  this._texCoordArr = null;
136
139
  this._vertexArr = null;
137
140
  this._positionHighArr = null;
@@ -199,7 +202,8 @@ class BillboardHandler {
199
202
  }
200
203
 
201
204
  add(billboard) {
202
- if (billboard._handlerIndex == -1) {
205
+ if (billboard._handlerIndex == -1) {
206
+ billboard._isReady = true;
203
207
  billboard._handler = this;
204
208
  billboard._handlerIndex = this._billboards.length;
205
209
  this._billboards.push(billboard);
@@ -211,36 +215,180 @@ class BillboardHandler {
211
215
 
212
216
  _addBillboardToArrays(billboard) {
213
217
  if (billboard._visibility) {
214
- this._vertexArr = concatTypedArrays(this._vertexArr, [-0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, 0.5]);
218
+ this._vertexArr = concatTypedArrays(
219
+ this._vertexArr,
220
+ [-0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, 0.5]
221
+ );
215
222
  } else {
216
- this._vertexArr = concatTypedArrays(this._vertexArr, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
223
+ this._vertexArr = concatTypedArrays(
224
+ this._vertexArr,
225
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
226
+ );
217
227
  }
218
228
 
219
- this._texCoordArr = concatTypedArrays(this._texCoordArr, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
220
-
221
- var x = billboard._positionHigh.x, y = billboard._positionHigh.y, z = billboard._positionHigh.z, w;
222
- this._positionHighArr = concatTypedArrays(this._positionHighArr, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);
223
-
224
- x = billboard._positionLow.x; y = billboard._positionLow.y; z = billboard._positionLow.z;
225
- this._positionLowArr = concatTypedArrays(this._positionLowArr, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);
226
-
227
- x = billboard._width; y = billboard._height;
229
+ this._texCoordArr = concatTypedArrays(
230
+ this._texCoordArr,
231
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
232
+ );
233
+
234
+ var x = billboard._positionHigh.x,
235
+ y = billboard._positionHigh.y,
236
+ z = billboard._positionHigh.z,
237
+ w;
238
+ this._positionHighArr = concatTypedArrays(this._positionHighArr, [
239
+ x,
240
+ y,
241
+ z,
242
+ x,
243
+ y,
244
+ z,
245
+ x,
246
+ y,
247
+ z,
248
+ x,
249
+ y,
250
+ z,
251
+ x,
252
+ y,
253
+ z,
254
+ x,
255
+ y,
256
+ z
257
+ ]);
258
+
259
+ x = billboard._positionLow.x;
260
+ y = billboard._positionLow.y;
261
+ z = billboard._positionLow.z;
262
+ this._positionLowArr = concatTypedArrays(this._positionLowArr, [
263
+ x,
264
+ y,
265
+ z,
266
+ x,
267
+ y,
268
+ z,
269
+ x,
270
+ y,
271
+ z,
272
+ x,
273
+ y,
274
+ z,
275
+ x,
276
+ y,
277
+ z,
278
+ x,
279
+ y,
280
+ z
281
+ ]);
282
+
283
+ x = billboard._width;
284
+ y = billboard._height;
228
285
  this._sizeArr = concatTypedArrays(this._sizeArr, [x, y, x, y, x, y, x, y, x, y, x, y]);
229
286
 
230
- x = billboard._offset.x; y = billboard._offset.y; z = billboard._offset.z;
231
- this._offsetArr = concatTypedArrays(this._offsetArr, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);
232
-
233
- x = billboard._color.x; y = billboard._color.y; z = billboard._color.z; w = billboard._color.w;
234
- this._rgbaArr = concatTypedArrays(this._rgbaArr, [x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w]);
287
+ x = billboard._offset.x;
288
+ y = billboard._offset.y;
289
+ z = billboard._offset.z;
290
+ this._offsetArr = concatTypedArrays(this._offsetArr, [
291
+ x,
292
+ y,
293
+ z,
294
+ x,
295
+ y,
296
+ z,
297
+ x,
298
+ y,
299
+ z,
300
+ x,
301
+ y,
302
+ z,
303
+ x,
304
+ y,
305
+ z,
306
+ x,
307
+ y,
308
+ z
309
+ ]);
310
+
311
+ x = billboard._color.x;
312
+ y = billboard._color.y;
313
+ z = billboard._color.z;
314
+ w = billboard._color.w;
315
+ this._rgbaArr = concatTypedArrays(this._rgbaArr, [
316
+ x,
317
+ y,
318
+ z,
319
+ w,
320
+ x,
321
+ y,
322
+ z,
323
+ w,
324
+ x,
325
+ y,
326
+ z,
327
+ w,
328
+ x,
329
+ y,
330
+ z,
331
+ w,
332
+ x,
333
+ y,
334
+ z,
335
+ w,
336
+ x,
337
+ y,
338
+ z,
339
+ w
340
+ ]);
235
341
 
236
342
  x = billboard._rotation;
237
343
  this._rotationArr = concatTypedArrays(this._rotationArr, [x, x, x, x, x, x]);
238
344
 
239
- x = billboard._alignedAxis.x; y = billboard._alignedAxis.y; z = billboard._alignedAxis.z;
240
- this._alignedAxisArr = concatTypedArrays(this._alignedAxisArr, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);
241
-
242
- x = billboard._entity._pickingColor.x / 255; y = billboard._entity._pickingColor.y / 255; z = billboard._entity._pickingColor.z / 255;
243
- this._pickingColorArr = concatTypedArrays(this._pickingColorArr, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);
345
+ x = billboard._alignedAxis.x;
346
+ y = billboard._alignedAxis.y;
347
+ z = billboard._alignedAxis.z;
348
+ this._alignedAxisArr = concatTypedArrays(this._alignedAxisArr, [
349
+ x,
350
+ y,
351
+ z,
352
+ x,
353
+ y,
354
+ z,
355
+ x,
356
+ y,
357
+ z,
358
+ x,
359
+ y,
360
+ z,
361
+ x,
362
+ y,
363
+ z,
364
+ x,
365
+ y,
366
+ z
367
+ ]);
368
+
369
+ x = billboard._entity._pickingColor.x / 255;
370
+ y = billboard._entity._pickingColor.y / 255;
371
+ z = billboard._entity._pickingColor.z / 255;
372
+ this._pickingColorArr = concatTypedArrays(this._pickingColorArr, [
373
+ x,
374
+ y,
375
+ z,
376
+ x,
377
+ y,
378
+ z,
379
+ x,
380
+ y,
381
+ z,
382
+ x,
383
+ y,
384
+ z,
385
+ x,
386
+ y,
387
+ z,
388
+ x,
389
+ y,
390
+ z
391
+ ]);
244
392
  }
245
393
 
246
394
  _displayPASS() {
@@ -268,19 +416,43 @@ class BillboardHandler {
268
416
 
269
417
  gl.uniform1f(shu.uOpacity, ec._fadingOpacity);
270
418
 
271
- gl.uniform2fv(shu.uFloatParams, [ec.renderNode._planetRadius2 || 0, r.activeCamera._tanViewAngle_hradOneByHeight]);
419
+ gl.uniform2fv(shu.uFloatParams, [
420
+ ec.renderNode._planetRadius2 || 0,
421
+ r.activeCamera._tanViewAngle_hradOneByHeight
422
+ ]);
272
423
 
273
424
  gl.bindBuffer(gl.ARRAY_BUFFER, this._texCoordBuffer);
274
- gl.vertexAttribPointer(sha.a_texCoord, this._texCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);
425
+ gl.vertexAttribPointer(
426
+ sha.a_texCoord,
427
+ this._texCoordBuffer.itemSize,
428
+ gl.FLOAT,
429
+ false,
430
+ 0,
431
+ 0
432
+ );
275
433
 
276
434
  gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
277
435
  gl.vertexAttribPointer(sha.a_vertices, this._vertexBuffer.itemSize, gl.FLOAT, false, 0, 0);
278
436
 
279
437
  gl.bindBuffer(gl.ARRAY_BUFFER, this._positionHighBuffer);
280
- gl.vertexAttribPointer(sha.a_positionsHigh, this._positionHighBuffer.itemSize, gl.FLOAT, false, 0, 0);
438
+ gl.vertexAttribPointer(
439
+ sha.a_positionsHigh,
440
+ this._positionHighBuffer.itemSize,
441
+ gl.FLOAT,
442
+ false,
443
+ 0,
444
+ 0
445
+ );
281
446
 
282
447
  gl.bindBuffer(gl.ARRAY_BUFFER, this._positionLowBuffer);
283
- gl.vertexAttribPointer(sha.a_positionsLow, this._positionLowBuffer.itemSize, gl.FLOAT, false, 0, 0);
448
+ gl.vertexAttribPointer(
449
+ sha.a_positionsLow,
450
+ this._positionLowBuffer.itemSize,
451
+ gl.FLOAT,
452
+ false,
453
+ 0,
454
+ 0
455
+ );
284
456
 
285
457
  gl.bindBuffer(gl.ARRAY_BUFFER, this._rgbaBuffer);
286
458
  gl.vertexAttribPointer(sha.a_rgba, this._rgbaBuffer.itemSize, gl.FLOAT, false, 0, 0);
@@ -292,10 +464,24 @@ class BillboardHandler {
292
464
  gl.vertexAttribPointer(sha.a_offset, this._offsetBuffer.itemSize, gl.FLOAT, false, 0, 0);
293
465
 
294
466
  gl.bindBuffer(gl.ARRAY_BUFFER, this._rotationBuffer);
295
- gl.vertexAttribPointer(sha.a_rotation, this._rotationBuffer.itemSize, gl.FLOAT, false, 0, 0);
467
+ gl.vertexAttribPointer(
468
+ sha.a_rotation,
469
+ this._rotationBuffer.itemSize,
470
+ gl.FLOAT,
471
+ false,
472
+ 0,
473
+ 0
474
+ );
296
475
 
297
476
  gl.bindBuffer(gl.ARRAY_BUFFER, this._alignedAxisBuffer);
298
- gl.vertexAttribPointer(sha.a_alignedAxis, this._alignedAxisBuffer.itemSize, gl.FLOAT, false, 0, 0);
477
+ gl.vertexAttribPointer(
478
+ sha.a_alignedAxis,
479
+ this._alignedAxisBuffer.itemSize,
480
+ gl.FLOAT,
481
+ false,
482
+ 0,
483
+ 0
484
+ );
299
485
 
300
486
  gl.drawArrays(gl.TRIANGLES, 0, this._vertexBuffer.numItems);
301
487
  }
@@ -325,19 +511,43 @@ class BillboardHandler {
325
511
 
326
512
  gl.uniform1f(shu.pickingScale, ec.pickingScale);
327
513
 
328
- gl.uniform2fv(shu.uFloatParams, [ec.renderNode._planetRadius2 || 0, r.activeCamera._tanViewAngle_hradOneByHeight]);
514
+ gl.uniform2fv(shu.uFloatParams, [
515
+ ec.renderNode._planetRadius2 || 0,
516
+ r.activeCamera._tanViewAngle_hradOneByHeight
517
+ ]);
329
518
 
330
519
  gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
331
520
  gl.vertexAttribPointer(sha.a_vertices, this._vertexBuffer.itemSize, gl.FLOAT, false, 0, 0);
332
521
 
333
522
  gl.bindBuffer(gl.ARRAY_BUFFER, this._positionHighBuffer);
334
- gl.vertexAttribPointer(sha.a_positionsHigh, this._positionHighBuffer.itemSize, gl.FLOAT, false, 0, 0);
523
+ gl.vertexAttribPointer(
524
+ sha.a_positionsHigh,
525
+ this._positionHighBuffer.itemSize,
526
+ gl.FLOAT,
527
+ false,
528
+ 0,
529
+ 0
530
+ );
335
531
 
336
532
  gl.bindBuffer(gl.ARRAY_BUFFER, this._positionLowBuffer);
337
- gl.vertexAttribPointer(sha.a_positionsLow, this._positionLowBuffer.itemSize, gl.FLOAT, false, 0, 0);
533
+ gl.vertexAttribPointer(
534
+ sha.a_positionsLow,
535
+ this._positionLowBuffer.itemSize,
536
+ gl.FLOAT,
537
+ false,
538
+ 0,
539
+ 0
540
+ );
338
541
 
339
542
  gl.bindBuffer(gl.ARRAY_BUFFER, this._pickingColorBuffer);
340
- gl.vertexAttribPointer(sha.a_pickingColor, this._pickingColorBuffer.itemSize, gl.FLOAT, false, 0, 0);
543
+ gl.vertexAttribPointer(
544
+ sha.a_pickingColor,
545
+ this._pickingColorBuffer.itemSize,
546
+ gl.FLOAT,
547
+ false,
548
+ 0,
549
+ 0
550
+ );
341
551
 
342
552
  gl.bindBuffer(gl.ARRAY_BUFFER, this._sizeBuffer);
343
553
  gl.vertexAttribPointer(sha.a_size, this._sizeBuffer.itemSize, gl.FLOAT, false, 0, 0);
@@ -346,13 +556,27 @@ class BillboardHandler {
346
556
  gl.vertexAttribPointer(sha.a_offset, this._offsetBuffer.itemSize, gl.FLOAT, false, 0, 0);
347
557
 
348
558
  gl.bindBuffer(gl.ARRAY_BUFFER, this._rotationBuffer);
349
- gl.vertexAttribPointer(sha.a_rotation, this._rotationBuffer.itemSize, gl.FLOAT, false, 0, 0);
559
+ gl.vertexAttribPointer(
560
+ sha.a_rotation,
561
+ this._rotationBuffer.itemSize,
562
+ gl.FLOAT,
563
+ false,
564
+ 0,
565
+ 0
566
+ );
350
567
 
351
568
  gl.bindBuffer(gl.ARRAY_BUFFER, this._alignedAxisBuffer);
352
- gl.vertexAttribPointer(sha.a_alignedAxis, this._alignedAxisBuffer.itemSize, gl.FLOAT, false, 0, 0);
569
+ gl.vertexAttribPointer(
570
+ sha.a_alignedAxis,
571
+ this._alignedAxisBuffer.itemSize,
572
+ gl.FLOAT,
573
+ false,
574
+ 0,
575
+ 0
576
+ );
353
577
 
354
578
  gl.drawArrays(gl.TRIANGLES, 0, this._vertexBuffer.numItems);
355
- };
579
+ }
356
580
 
357
581
  draw() {
358
582
  if (this._billboards.length) {
@@ -401,21 +625,25 @@ class BillboardHandler {
401
625
  this.refresh();
402
626
 
403
627
  billboard._handlerIndex = -1;
404
- billboard._handler = null;
628
+ billboard._handler = null;
629
+ billboard._isReady = false;
630
+ billboard._lockId = -1;
405
631
  }
406
632
 
407
633
  remove(billboard) {
408
- if (billboard._handler && this.__staticId == billboard._handler.__staticId) {
634
+ if (billboard._isReady && this.__staticId == billboard._handler.__staticId) {
409
635
  this._removeBillboard(billboard);
410
636
  }
411
637
  }
412
638
 
413
639
  setPositionArr(index, positionHigh, positionLow) {
414
-
415
640
  var i = index * 18;
416
641
 
417
642
  // High
418
- var a = this._positionHighArr, x = positionHigh.x, y = positionHigh.y, z = positionHigh.z;
643
+ var a = this._positionHighArr,
644
+ x = positionHigh.x,
645
+ y = positionHigh.y,
646
+ z = positionHigh.z;
419
647
 
420
648
  a[i] = x;
421
649
  a[i + 1] = y;
@@ -442,7 +670,10 @@ class BillboardHandler {
442
670
  a[i + 17] = z;
443
671
 
444
672
  // Low
445
- a = this._positionLowArr; x = positionLow.x; y = positionLow.y; z = positionLow.z;
673
+ a = this._positionLowArr;
674
+ x = positionLow.x;
675
+ y = positionLow.y;
676
+ z = positionLow.z;
446
677
 
447
678
  a[i] = x;
448
679
  a[i + 1] = y;
@@ -472,9 +703,11 @@ class BillboardHandler {
472
703
  }
473
704
 
474
705
  setPickingColorArr(index, color) {
475
-
476
706
  var i = index * 18;
477
- var a = this._pickingColorArr, x = color.x / 255, y = color.y / 255, z = color.z / 255;
707
+ var a = this._pickingColorArr,
708
+ x = color.x / 255,
709
+ y = color.y / 255,
710
+ z = color.z / 255;
478
711
 
479
712
  a[i] = x;
480
713
  a[i + 1] = y;
@@ -504,9 +737,10 @@ class BillboardHandler {
504
737
  }
505
738
 
506
739
  setSizeArr(index, width, height) {
507
-
508
740
  var i = index * 12;
509
- var a = this._sizeArr, x = width, y = height;
741
+ var a = this._sizeArr,
742
+ x = width,
743
+ y = height;
510
744
 
511
745
  a[i] = x;
512
746
  a[i + 1] = y;
@@ -530,9 +764,11 @@ class BillboardHandler {
530
764
  }
531
765
 
532
766
  setOffsetArr(index, offset) {
533
-
534
767
  var i = index * 18;
535
- var a = this._offsetArr, x = offset.x, y = offset.y, z = offset.z;
768
+ var a = this._offsetArr,
769
+ x = offset.x,
770
+ y = offset.y,
771
+ z = offset.z;
536
772
 
537
773
  a[i] = x;
538
774
  a[i + 1] = y;
@@ -562,9 +798,12 @@ class BillboardHandler {
562
798
  }
563
799
 
564
800
  setRgbaArr(index, rgba) {
565
-
566
801
  var i = index * 24;
567
- var a = this._rgbaArr, x = rgba.x, y = rgba.y, z = rgba.z, w = rgba.w;
802
+ var a = this._rgbaArr,
803
+ x = rgba.x,
804
+ y = rgba.y,
805
+ z = rgba.z,
806
+ w = rgba.w;
568
807
 
569
808
  a[i] = x;
570
809
  a[i + 1] = y;
@@ -600,7 +839,6 @@ class BillboardHandler {
600
839
  }
601
840
 
602
841
  setRotationArr(index, rotation) {
603
-
604
842
  var i = index * 6;
605
843
  var a = this._rotationArr;
606
844
 
@@ -615,7 +853,6 @@ class BillboardHandler {
615
853
  }
616
854
 
617
855
  setTexCoordArr(index, tcoordArr) {
618
-
619
856
  var i = index * 12;
620
857
  var a = this._texCoordArr;
621
858
 
@@ -651,7 +888,6 @@ class BillboardHandler {
651
888
  }
652
889
 
653
890
  setVertexArr(index, vertexArr) {
654
-
655
891
  var i = index * 12;
656
892
  var a = this._vertexArr;
657
893
 
@@ -675,9 +911,11 @@ class BillboardHandler {
675
911
  }
676
912
 
677
913
  setAlignedAxisArr(index, alignedAxis) {
678
-
679
914
  var i = index * 18;
680
- var a = this._alignedAxisArr, x = alignedAxis.x, y = alignedAxis.y, z = alignedAxis.z;
915
+ var a = this._alignedAxisArr,
916
+ x = alignedAxis.x,
917
+ y = alignedAxis.y,
918
+ z = alignedAxis.z;
681
919
 
682
920
  a[i] = x;
683
921
  a[i + 1] = y;
@@ -759,19 +997,31 @@ class BillboardHandler {
759
997
  createTexCoordBuffer() {
760
998
  var h = this._renderer.handler;
761
999
  h.gl.deleteBuffer(this._texCoordBuffer);
762
- this._texCoordBuffer = h.createArrayBuffer(this._texCoordArr, 2, this._texCoordArr.length / 2);
1000
+ this._texCoordBuffer = h.createArrayBuffer(
1001
+ this._texCoordArr,
1002
+ 2,
1003
+ this._texCoordArr.length / 2
1004
+ );
763
1005
  }
764
1006
 
765
1007
  createAlignedAxisBuffer() {
766
1008
  var h = this._renderer.handler;
767
1009
  h.gl.deleteBuffer(this._alignedAxisBuffer);
768
- this._alignedAxisBuffer = h.createArrayBuffer(this._alignedAxisArr, 3, this._alignedAxisArr.length / 3);
1010
+ this._alignedAxisBuffer = h.createArrayBuffer(
1011
+ this._alignedAxisArr,
1012
+ 3,
1013
+ this._alignedAxisArr.length / 3
1014
+ );
769
1015
  }
770
1016
 
771
1017
  createPickingColorBuffer() {
772
1018
  var h = this._renderer.handler;
773
1019
  h.gl.deleteBuffer(this._pickingColorBuffer);
774
- this._pickingColorBuffer = h.createArrayBuffer(this._pickingColorArr, 3, this._pickingColorArr.length / 3);
1020
+ this._pickingColorBuffer = h.createArrayBuffer(
1021
+ this._pickingColorArr,
1022
+ 3,
1023
+ this._pickingColorArr.length / 3
1024
+ );
775
1025
  }
776
1026
 
777
1027
  refreshTexCoordsArr() {
@@ -790,6 +1040,6 @@ class BillboardHandler {
790
1040
  }
791
1041
  }
792
1042
  }
793
- };
1043
+ }
794
1044
 
795
1045
  export { BillboardHandler };