@openglobus/og 0.10.6 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/package.json +10 -7
  2. package/src/og/Extent.js +1 -1
  3. package/src/og/LonLat.js +7 -2
  4. package/src/og/Popup.js +2 -1
  5. package/src/og/camera/PlanetCamera.js +4 -2
  6. package/src/og/entity/EntityCollection.js +1 -1
  7. package/src/og/entity/LabelHandler.js +366 -74
  8. package/src/og/entity/Polyline.js +3 -2
  9. package/src/og/layer/KML.js +7 -5
  10. package/src/og/layer/Vector.js +5 -0
  11. package/src/og/layer/index.js +2 -1
  12. package/src/og/math/Vec2.js +448 -448
  13. package/src/og/math/Vec3.js +759 -757
  14. package/src/og/math/Vec4.js +216 -215
  15. package/src/og/scene/Planet.js +14 -4
  16. package/src/og/segment/SegmentLonLat.js +7 -0
  17. package/src/og/terrain/GlobusTerrain.js +4 -0
  18. package/src/og/utils/GeoImageCreator.js +123 -121
  19. package/src/og/utils/Loader.js +81 -80
  20. package/src/og/utils/NormalMapCreator.js +320 -318
  21. package/src/og/utils/VectorTileCreator.js +251 -250
  22. package/src/og/webgl/Framebuffer.js +265 -264
  23. package/src/og/webgl/Handler.js +1022 -1022
  24. package/src/og/webgl/Multisample.js +169 -168
  25. package/src/og/webgl/ProgramController.js +113 -112
  26. package/types/Clock.d.ts +90 -0
  27. package/types/Deferred.d.ts +6 -0
  28. package/types/Events.d.ts +73 -0
  29. package/types/Extent.d.ts +162 -0
  30. package/types/Globe.d.ts +80 -0
  31. package/types/ImageCanvas.d.ts +121 -0
  32. package/types/Lock.d.ts +12 -0
  33. package/types/LonLat.d.ts +108 -0
  34. package/types/Popup.d.ts +38 -0
  35. package/types/QueueArray.d.ts +15 -0
  36. package/types/Rectangle.d.ts +74 -0
  37. package/types/Stack.d.ts +15 -0
  38. package/types/ajax.d.ts +24 -0
  39. package/types/arial.d.ts +48 -0
  40. package/types/astro/astro.d.ts +38 -0
  41. package/types/astro/earth.d.ts +6 -0
  42. package/types/astro/jd.d.ts +254 -0
  43. package/types/bv/Box.d.ts +25 -0
  44. package/types/bv/Sphere.d.ts +32 -0
  45. package/types/bv/index.d.ts +3 -0
  46. package/types/camera/Camera.d.ts +303 -0
  47. package/types/camera/Frustum.d.ts +129 -0
  48. package/types/camera/PlanetCamera.d.ts +222 -0
  49. package/types/camera/index.d.ts +3 -0
  50. package/types/cons.d.ts +40 -0
  51. package/types/control/CompassButton.d.ts +17 -0
  52. package/types/control/Control.d.ts +101 -0
  53. package/types/control/DebugInfo.d.ts +16 -0
  54. package/types/control/EarthCoordinates.d.ts +47 -0
  55. package/types/control/GeoImageDragControl.d.ts +6 -0
  56. package/types/control/KeyboardNavigation.d.ts +22 -0
  57. package/types/control/LayerSwitcher.d.ts +23 -0
  58. package/types/control/Lighting.d.ts +16 -0
  59. package/types/control/ScaleControl.d.ts +22 -0
  60. package/types/control/ShowFps.d.ts +12 -0
  61. package/types/control/SimpleNavigation.d.ts +28 -0
  62. package/types/control/Sun.d.ts +52 -0
  63. package/types/control/ToggleWireframe.d.ts +12 -0
  64. package/types/control/ZoomControl.d.ts +28 -0
  65. package/types/control/index.d.ts +15 -0
  66. package/types/ellipsoid/Ellipsoid.d.ts +142 -0
  67. package/types/ellipsoid/index.d.ts +3 -0
  68. package/types/ellipsoid/wgs84.d.ts +5 -0
  69. package/types/entity/BaseBillboard.d.ts +208 -0
  70. package/types/entity/Billboard.d.ts +94 -0
  71. package/types/entity/BillboardHandler.d.ts +74 -0
  72. package/types/entity/Entity.d.ts +330 -0
  73. package/types/entity/EntityCollection.d.ts +303 -0
  74. package/types/entity/Geometry.d.ts +72 -0
  75. package/types/entity/GeometryHandler.d.ts +76 -0
  76. package/types/entity/Label.d.ts +194 -0
  77. package/types/entity/LabelHandler.d.ts +24 -0
  78. package/types/entity/PointCloud.d.ts +174 -0
  79. package/types/entity/PointCloudHandler.d.ts +38 -0
  80. package/types/entity/Polyline.d.ts +303 -0
  81. package/types/entity/PolylineHandler.d.ts +18 -0
  82. package/types/entity/Ray.d.ts +123 -0
  83. package/types/entity/RayHandler.d.ts +67 -0
  84. package/types/entity/ShapeHandler.d.ts +22 -0
  85. package/types/entity/Strip.d.ts +118 -0
  86. package/types/entity/StripHandler.d.ts +38 -0
  87. package/types/entity/index.d.ts +8 -0
  88. package/types/index.core.d.ts +65 -0
  89. package/types/index.d.ts +45 -0
  90. package/types/index.webgl.d.ts +7 -0
  91. package/types/inherits.d.ts +4 -0
  92. package/types/input/input.d.ts +34 -0
  93. package/types/layer/BaseGeoImage.d.ts +106 -0
  94. package/types/layer/CanvasTiles.d.ts +75 -0
  95. package/types/layer/GeoImage.d.ts +65 -0
  96. package/types/layer/GeoTexture2d.d.ts +8 -0
  97. package/types/layer/GeoVideo.d.ts +80 -0
  98. package/types/layer/KML.d.ts +58 -0
  99. package/types/layer/WMS.d.ts +66 -0
  100. package/types/layer/XYZ.d.ts +126 -0
  101. package/types/layer/index.d.ts +10 -0
  102. package/types/light/LightSource.d.ts +177 -0
  103. package/types/math/Mat3.d.ts +53 -0
  104. package/types/math/Mat4.d.ts +157 -0
  105. package/types/math/Plane.d.ts +17 -0
  106. package/types/math/Vec2.d.ts +308 -0
  107. package/types/math/Vec3.d.ts +459 -0
  108. package/types/math/Vec4.d.ts +161 -0
  109. package/types/math/coder.d.ts +42 -0
  110. package/types/math/index.d.ts +11 -0
  111. package/types/math.d.ts +261 -0
  112. package/types/mercator.d.ts +92 -0
  113. package/types/proj/EPSG3857.d.ts +5 -0
  114. package/types/proj/EPSG4326.d.ts +5 -0
  115. package/types/quadTree/quadTree.d.ts +40 -0
  116. package/types/renderer/RendererEvents.d.ts +230 -0
  117. package/types/res/images.d.ts +3 -0
  118. package/types/scene/Axes.d.ts +11 -0
  119. package/types/scene/BaseNode.d.ts +60 -0
  120. package/types/scene/Planet.d.ts +572 -0
  121. package/types/scene/RenderNode.d.ts +143 -0
  122. package/types/scene/SkyBox.d.ts +10 -0
  123. package/types/scene/index.d.ts +4 -0
  124. package/types/segment/segmentHelper.d.ts +13 -0
  125. package/types/shaders/billboard.d.ts +3 -0
  126. package/types/shaders/depth.d.ts +2 -0
  127. package/types/shaders/drawnode.d.ts +7 -0
  128. package/types/shaders/label.d.ts +4 -0
  129. package/types/shaders/pointCloud.d.ts +2 -0
  130. package/types/shaders/polyline.d.ts +3 -0
  131. package/types/shaders/ray.d.ts +2 -0
  132. package/types/shaders/screenFrame.d.ts +2 -0
  133. package/types/shaders/shape.d.ts +4 -0
  134. package/types/shaders/skybox.d.ts +2 -0
  135. package/types/shaders/toneMapping.d.ts +2 -0
  136. package/types/shapes/BaseShape.d.ts +247 -0
  137. package/types/shapes/Sphere.d.ts +41 -0
  138. package/types/terrain/BilTerrain.d.ts +8 -0
  139. package/types/terrain/EmptyTerrain.d.ts +72 -0
  140. package/types/terrain/Geoid.d.ts +26 -0
  141. package/types/terrain/GlobusTerrain.d.ts +153 -0
  142. package/types/terrain/MapboxTerrain.d.ts +8 -0
  143. package/types/terrain/index.d.ts +5 -0
  144. package/types/utils/FontAtlas.d.ts +14 -0
  145. package/types/utils/GeoImageCreator.d.ts +29 -0
  146. package/types/utils/ImagesCacheManager.d.ts +10 -0
  147. package/types/utils/Loader.d.ts +25 -0
  148. package/types/utils/NormalMapCreator.d.ts +39 -0
  149. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  150. package/types/utils/TerrainWorker.d.ts +9 -0
  151. package/types/utils/TextureAtlas.d.ts +111 -0
  152. package/types/utils/VectorTileCreator.d.ts +16 -0
  153. package/types/utils/colorTable.d.ts +143 -0
  154. package/types/utils/earcut.d.ts +6 -0
  155. package/types/utils/shared.d.ts +230 -0
  156. package/types/webgl/Framebuffer.d.ts +135 -0
  157. package/types/webgl/Handler.d.ts +372 -0
  158. package/types/webgl/Multisample.d.ts +89 -0
  159. package/types/webgl/Program.d.ts +155 -0
  160. package/types/webgl/ProgramController.d.ts +84 -0
  161. package/types/webgl/callbacks.d.ts +1 -0
  162. package/types/webgl/index.d.ts +6 -0
  163. package/types/webgl/types.d.ts +2 -0
@@ -14,251 +14,252 @@ import { Vec3 } from './Vec3.js';
14
14
  * @param {number} [z] - Third value.
15
15
  * @param {number} [w] - Fourth value.
16
16
  */
17
- const Vec4 = function (x, y, z, w) {
17
+ export class Vec4 {
18
+
19
+ constructor(x, y, z, w) {
20
+
21
+ /**
22
+ * @public
23
+ * @type {number}
24
+ */
25
+ this.x = x || 0.0;
26
+
27
+ /**
28
+ * @public
29
+ * @type {number}
30
+ */
31
+ this.y = y || 0.0;
32
+
33
+ /**
34
+ * @public
35
+ * @type {number}
36
+ */
37
+ this.z = z || 0.0;
38
+
39
+ /**
40
+ * @public
41
+ * @type {number}
42
+ */
43
+ this.w = w || 0.0;
44
+ };
18
45
 
19
46
  /**
20
- * @public
21
- * @type {number}
47
+ * Identity vector [0,0,0,1].
48
+ * @const
49
+ * @type {og.math.Vec4}
22
50
  */
23
- this.x = x || 0.0;
51
+ static get identity() { return new Vec4(0, 0, 0, 1) };
24
52
 
25
53
  /**
26
- * @public
27
- * @type {number}
54
+ * Creates 4d vector from array.
55
+ * @function
56
+ * @param {Array.<number,number,number,number>}
57
+ * @returns {og.math.Vec4}
28
58
  */
29
- this.y = y || 0.0;
59
+ static fromVec(arr) {
60
+ return new Vec4(arr[0], arr[1], arr[2], arr[3]);
61
+ };
30
62
 
31
63
  /**
64
+ * Converts to 3d vector, without fourth value.
32
65
  * @public
33
- * @type {number}
66
+ * @returns {og.Vec3}
34
67
  */
35
- this.z = z || 0.0;
68
+ toVec3() {
69
+ return new Vec3(this.x, this.y, this.z);
70
+ };
36
71
 
37
72
  /**
73
+ * Returns clone vector.
38
74
  * @public
39
- * @type {number}
75
+ * @returns {og.math.Vec4}
40
76
  */
41
- this.w = w || 0.0;
42
- };
43
-
44
- /**
45
- * Identity vector [0,0,0,1].
46
- * @const
47
- * @type {og.math.Vec4}
48
- */
49
- Vec4.identity = new Vec4(0, 0, 0, 1);
50
-
51
- /**
52
- * Vector 4d object creator.
53
- * @function
54
- * @param {number} [x] - First cvalue.
55
- * @param {number} [y] - Second value.
56
- * @param {number} [z] - Third value.
57
- * @param {number} [w] - Fourth value.
58
- * @returns {og.math.Vec4}
59
- */
60
- export function vec4(x, y, z, w) {
61
- return new og.math.Vec4(x, y, z, w);
62
- };
77
+ clone(v) {
78
+ return new Vec4(this.x, this.y, this.z, this.w);
79
+ };
63
80
 
64
- /**
65
- * Creates 4d vector from array.
66
- * @function
67
- * @param {Array.<number,number,number,number>}
68
- * @returns {og.math.Vec4}
69
- */
70
- Vec4.fromVec = function (arr) {
71
- return new Vec4(arr[0], arr[1], arr[2], arr[3]);
72
- };
81
+ /**
82
+ * Compares with vector. Returns true if it equals another.
83
+ * @public
84
+ * @param {og.math.Vec4} p - Vector to compare.
85
+ * @returns {boolean}
86
+ */
87
+ equal(v) {
88
+ return this.x === v.x && this.y === v.y && this.z === v.z && this.w === v.w;
89
+ };
73
90
 
74
- /**
75
- * Converts to 3d vector, without fourth value.
76
- * @public
77
- * @returns {og.Vec3}
78
- */
79
- Vec4.prototype.toVec3 = function () {
80
- return new Vec3(this.x, this.y, this.z);
81
- };
91
+ /**
92
+ * Copy input vector's values.
93
+ * @param {og.math.Vec4} v - Vector to copy.
94
+ * @returns {og.math.Vec4}
95
+ */
96
+ copy(v) {
97
+ this.x = v.x;
98
+ this.y = v.y;
99
+ this.z = v.z;
100
+ this.w = v.w;
101
+ return this;
102
+ };
82
103
 
83
- /**
84
- * Returns clone vector.
85
- * @public
86
- * @returns {og.math.Vec4}
87
- */
88
- Vec4.prototype.clone = function (v) {
89
- return new Vec4(this.x, this.y, this.z, this.w);
90
- };
104
+ /**
105
+ * Converts vector to a number array.
106
+ * @public
107
+ * @returns {Array.<number,number,number,number>}
108
+ * @deprecated
109
+ */
110
+ toVec() {
111
+ return [this.x, this.y, this.z, this.w];
112
+ };
91
113
 
92
- /**
93
- * Compares with vector. Returns true if it equals another.
94
- * @public
95
- * @param {og.math.Vec4} p - Vector to compare.
96
- * @returns {boolean}
97
- */
98
- Vec4.prototype.equal = function (v) {
99
- return this.x === v.x && this.y === v.y && this.z === v.z && this.w === v.w;
100
- };
114
+ /**
115
+ * Converts vector to a number array.
116
+ * @public
117
+ * @returns {Array.<number,number,number,number>}
118
+ */
119
+ toArray() {
120
+ return [this.x, this.y, this.z, this.w];
121
+ };
101
122
 
102
- /**
103
- * Copy input vector's values.
104
- * @param {og.math.Vec4} v - Vector to copy.
105
- * @returns {og.math.Vec4}
106
- */
107
- Vec4.prototype.copy = function (v) {
108
- this.x = v.x;
109
- this.y = v.y;
110
- this.z = v.z;
111
- this.w = v.w;
112
- return this;
113
- };
123
+ /**
124
+ * Sets vector's values.
125
+ * @public
126
+ * @param {number} x - Value X.
127
+ * @param {number} y - Value Y.
128
+ * @param {number} z - Value Z.
129
+ * @param {number} w - Value W.
130
+ * @returns {og.math.Vec4}
131
+ */
132
+ set(x, y, z, w) {
133
+ this.x = x;
134
+ this.y = y;
135
+ this.z = z;
136
+ this.w = w;
137
+ return this;
138
+ };
114
139
 
115
- /**
116
- * Converts vector to a number array.
117
- * @public
118
- * @returns {Array.<number,number,number,number>}
119
- * @deprecated
120
- */
121
- Vec4.prototype.toVec = function () {
122
- return [this.x, this.y, this.z, this.w];
123
- };
140
+ /**
141
+ * Adds vector to the current.
142
+ * @public
143
+ * @param {og.math.Vec4}
144
+ * @returns {og.math.Vec4}
145
+ */
146
+ addA(v) {
147
+ this.x += v.x;
148
+ this.y += v.y;
149
+ this.z += v.z;
150
+ this.w += v.w;
151
+ return this;
152
+ };
124
153
 
125
- /**
126
- * Converts vector to a number array.
127
- * @public
128
- * @returns {Array.<number,number,number,number>}
129
- */
130
- Vec4.prototype.toArray = function () {
131
- return [this.x, this.y, this.z, this.w];
132
- };
154
+ /**
155
+ * Subtract vector from the current.
156
+ * @public
157
+ * @param {og.math.Vec4} v - Subtract vector.
158
+ * @returns {og.math.Vec4}
159
+ */
160
+ subA(v) {
161
+ this.x -= v.x;
162
+ this.y -= v.y;
163
+ this.z -= v.z;
164
+ this.w -= v.w;
165
+ return this;
166
+ };
133
167
 
134
- /**
135
- * Sets vector's values.
136
- * @public
137
- * @param {number} x - Value X.
138
- * @param {number} y - Value Y.
139
- * @param {number} z - Value Z.
140
- * @param {number} w - Value W.
141
- * @returns {og.math.Vec4}
142
- */
143
- Vec4.prototype.set = function (x, y, z, w) {
144
- this.x = x;
145
- this.y = y;
146
- this.z = z;
147
- this.w = w;
148
- return this;
149
- };
168
+ /**
169
+ * Scale current vector.
170
+ * @public
171
+ * @param {number} scale - Scale value.
172
+ * @returns {og.math.Vec4}
173
+ */
174
+ scale(scale) {
175
+ this.x *= scale;
176
+ this.y *= scale;
177
+ this.z *= scale;
178
+ this.w *= scale;
179
+ return this;
180
+ };
150
181
 
151
- /**
152
- * Adds vector to the current.
153
- * @public
154
- * @param {og.math.Vec4}
155
- * @returns {og.math.Vec4}
156
- */
157
- Vec4.prototype.addA = function (v) {
158
- this.x += v.x;
159
- this.y += v.y;
160
- this.z += v.z;
161
- this.w += v.w;
162
- return this;
163
- };
182
+ /**
183
+ * Makes vector affinity. Thereby fourh component becomes to 1.0.
184
+ * @public
185
+ * @returns {og.math.Vec4}
186
+ */
187
+ affinity() {
188
+ var iw = 1 / this.w;
189
+ this.x *= iw;
190
+ this.y *= iw;
191
+ this.z *= iw;
192
+ this.w = 1.0;
193
+ return this;
194
+ };
164
195
 
165
- /**
166
- * Subtract vector from the current.
167
- * @public
168
- * @param {og.math.Vec4} v - Subtract vector.
169
- * @returns {og.math.Vec4}
170
- */
171
- Vec4.prototype.subA = function (v) {
172
- this.x -= v.x;
173
- this.y -= v.y;
174
- this.z -= v.z;
175
- this.w -= v.w;
176
- return this;
177
- };
196
+ /**
197
+ * Scale current vector to another instance.
198
+ * @public
199
+ * @param {number} scale - Scale value.
200
+ * @returns {og.Vec3}
201
+ */
202
+ scaleTo(scale) {
203
+ return new Vec4(this.x * scale, this.y * scale, this.z * scale, this.w * scale);
204
+ };
178
205
 
179
- /**
180
- * Scale current vector.
181
- * @public
182
- * @param {number} scale - Scale value.
183
- * @returns {og.math.Vec4}
184
- */
185
- Vec4.prototype.scale = function (scale) {
186
- this.x *= scale;
187
- this.y *= scale;
188
- this.z *= scale;
189
- this.w *= scale;
190
- return this;
191
- };
206
+ /**
207
+ * Vector's edge function that returns vector where each component is 0.0 if it's smaller then edge and otherwise 1.0.
208
+ * @public
209
+ * @returns {og.math.Vec4}
210
+ */
211
+ getStep(edge) {
212
+ return new Vec4(
213
+ this.x < edge ? 0.0 : 1.0,
214
+ this.y < edge ? 0.0 : 1.0,
215
+ this.z < edge ? 0.0 : 1.0,
216
+ this.w < edge ? 0.0 : 1.0
217
+ );
218
+ };
192
219
 
193
- /**
194
- * Makes vector affinity. Thereby fourh component becomes to 1.0.
195
- * @public
196
- * @returns {og.math.Vec4}
197
- */
198
- Vec4.prototype.affinity = function () {
199
- var iw = 1 / this.w;
200
- this.x *= iw;
201
- this.y *= iw;
202
- this.z *= iw;
203
- this.w = 1.0;
204
- return this;
205
- };
220
+ /**
221
+ * The vector fract function returns the vector of fractional parts of each value, i.e. x minus floor(x).
222
+ * @public
223
+ * @returns {og.math.Vec4}
224
+ */
225
+ getFrac(v) {
226
+ return new Vec4(
227
+ og.math.frac(v.x),
228
+ og.math.frac(v.y),
229
+ og.math.frac(v.z),
230
+ og.math.frac(v.w)
231
+ );
232
+ };
206
233
 
207
- /**
208
- * Scale current vector to another instance.
209
- * @public
210
- * @param {number} scale - Scale value.
211
- * @returns {og.Vec3}
212
- */
213
- Vec4.prototype.scaleTo = function (scale) {
214
- return new Vec4(this.x * scale, this.y * scale, this.z * scale, this.w * scale);
215
- };
234
+ /**
235
+ * Gets vectors dot production.
236
+ * @public
237
+ * @param {og.math.Vec4} v - Another vector.
238
+ * @returns {number} - Dot product.
239
+ */
240
+ dot(v) {
241
+ return v.x * this.x + v.y * this.y + v.z * this.z + v.w * this.w;
242
+ };
216
243
 
217
- /**
218
- * Vector's edge function that returns vector where each component is 0.0 if it's smaller then edge and otherwise 1.0.
219
- * @public
220
- * @returns {og.math.Vec4}
221
- */
222
- Vec4.prototype.getStep = function (edge) {
223
- return new Vec4(
224
- this.x < edge ? 0.0 : 1.0,
225
- this.y < edge ? 0.0 : 1.0,
226
- this.z < edge ? 0.0 : 1.0,
227
- this.w < edge ? 0.0 : 1.0
228
- );
229
- };
244
+ /**
245
+ * Returns true if vector's values are zero.
246
+ * @public
247
+ * @returns {boolean} -
248
+ */
249
+ isZero() {
250
+ return !(this.x || this.y || this.z || this.w);
251
+ };
252
+ }
230
253
 
231
254
  /**
232
- * The vector fract function returns the vector of fractional parts of each value, i.e. x minus floor(x).
233
- * @public
255
+ * Vector 4d object creator.
256
+ * @function
257
+ * @param {number} [x] - First cvalue.
258
+ * @param {number} [y] - Second value.
259
+ * @param {number} [z] - Third value.
260
+ * @param {number} [w] - Fourth value.
234
261
  * @returns {og.math.Vec4}
235
262
  */
236
- Vec4.prototype.getFrac = function (v) {
237
- return new Vec4(
238
- og.math.frac(v.x),
239
- og.math.frac(v.y),
240
- og.math.frac(v.z),
241
- og.math.frac(v.w)
242
- );
243
- };
244
-
245
- /**
246
- * Gets vectors dot production.
247
- * @public
248
- * @param {og.math.Vec4} v - Another vector.
249
- * @returns {number} - Dot product.
250
- */
251
- Vec4.prototype.dot = function (v) {
252
- return v.x * this.x + v.y * this.y + v.z * this.z + v.w * this.w;
253
- };
254
-
255
- /**
256
- * Returns true if vector's values are zero.
257
- * @public
258
- * @returns {boolean} -
259
- */
260
- Vec4.prototype.isZero = function () {
261
- return !(this.x || this.y || this.z || this.w);
263
+ export function vec4(x, y, z, w) {
264
+ return new og.math.Vec4(x, y, z, w);
262
265
  };
263
-
264
- export { Vec4 };
@@ -100,7 +100,7 @@ const EVENT_NAMES = [
100
100
  * @fires og.scene.Planet#layervisibilitychange
101
101
  * @fires og.scene.Planet#geoimageadd
102
102
  */
103
- class Planet extends RenderNode {
103
+ export class Planet extends RenderNode {
104
104
  constructor(options = {}) {
105
105
  super(options.name);
106
106
 
@@ -675,6 +675,10 @@ class Planet extends RenderNode {
675
675
  }
676
676
  }
677
677
 
678
+ this.renderer.events.on("resize", () => {
679
+ this._renderCompletedActivated = false;
680
+ });
681
+
678
682
  // Initialize texture coordinates buffer pool
679
683
  this._textureCoordsBufferCache = [];
680
684
 
@@ -1092,7 +1096,9 @@ class Planet extends RenderNode {
1092
1096
  gl.disable(gl.POLYGON_OFFSET_FILL);
1093
1097
 
1094
1098
  if (frustumIndex === cam.FARTHEST_FRUSTUM_INDEX) {
1095
- this._collectRenderNodes();
1099
+ if (!this._renderCompletedActivated || this.camera._moved) {
1100
+ this._collectRenderNodes();
1101
+ }
1096
1102
 
1097
1103
  // Here is the planet node dispatches a draw event before
1098
1104
  // rendering begins and we have got render nodes.
@@ -1696,6 +1702,9 @@ class Planet extends RenderNode {
1696
1702
  * @param {og.Vec3} [look] - Camera "look at" point.
1697
1703
  * @param {og.Vec3} [up] - Camera UP vector on the end of a flying.
1698
1704
  * @param {Number} [ampl] - Altitude amplitude factor.
1705
+ * @param [completeCallback]
1706
+ * @param [startCallback]
1707
+ * @param [frameCallback]
1699
1708
  */
1700
1709
  flyCartesian(cartesian, look, up, ampl, completeCallback, startCallback, frameCallback) {
1701
1710
  this.renderer.activeCamera.flyCartesian(
@@ -1716,6 +1725,9 @@ class Planet extends RenderNode {
1716
1725
  * @param {og.Vec3} [look] - Camera "look at" point on the end of a flying.
1717
1726
  * @param {og.Vec3} [up] - Camera UP vector on the end of a flying.
1718
1727
  * @param {Number} [ampl] - Altitude amplitude factor.
1728
+ * @param [completeCallback]
1729
+ * @param [startCallback]
1730
+ * @param [frameCallback]
1719
1731
  */
1720
1732
  flyLonLat(lonlat, look, up, ampl, completeCallback, startCallback, frameCallback) {
1721
1733
  this.renderer.activeCamera.flyLonLat(
@@ -1766,5 +1778,3 @@ class Planet extends RenderNode {
1766
1778
  }
1767
1779
  }
1768
1780
  }
1769
-
1770
- export { Planet };
@@ -93,6 +93,13 @@ SegmentLonLat.prototype._assignTileIndexes = function () {
93
93
  );
94
94
  }
95
95
 
96
+ var p2 = Math.pow(2, tileZoom);
97
+ this.tileXE = (this.tileX + 1) % p2;
98
+ this.tileXW = (p2 + this.tileX - 1) % p2;
99
+
100
+ this.tileYN = this.tileY - 1;
101
+ this.tileYS = this.tileY + 1;
102
+
96
103
  this.tileIndex = Layer.getTileIndex(this.tileX, this.tileY, tileZoom);
97
104
  };
98
105
 
@@ -51,6 +51,10 @@ const EVENT_NAMES = [
51
51
  * @fires og.terrain.GlobusTerrain#loadend
52
52
  */
53
53
  class GlobusTerrain extends EmptyTerrain {
54
+ /**
55
+ * @param {string} [name]
56
+ * @param {*} [options]
57
+ */
54
58
  constructor(name, options) {
55
59
  super();
56
60