@openglobus/og 0.11.5 → 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.
- package/package.json +5 -7
- package/src/og/Clock.js +6 -10
- package/src/og/Events.js +5 -7
- package/src/og/Extent.js +73 -32
- package/src/og/ImageCanvas.js +18 -15
- package/src/og/LonLat.js +13 -10
- package/src/og/Popup.js +18 -17
- package/src/og/QueueArray.js +3 -4
- package/src/og/Rectangle.js +4 -6
- package/src/og/Stack.js +2 -4
- package/src/og/ajax.js +20 -14
- package/src/og/astro/earth.js +21 -15
- package/src/og/bv/Box.js +2 -3
- package/src/og/bv/Sphere.js +10 -7
- package/src/og/camera/Frustum.js +19 -12
- package/src/og/camera/PlanetCamera.js +0 -1
- package/src/og/control/CompassButton.js +1 -2
- package/src/og/control/Control.js +7 -9
- package/src/og/control/DebugInfo.js +0 -1
- package/src/og/control/KeyboardNavigation.js +9 -9
- package/src/og/control/LayerSwitcher.js +21 -20
- package/src/og/control/SegmentBoundVisualization.js +5 -6
- package/src/og/control/ShowFps.js +12 -7
- package/src/og/control/SimpleNavigation.js +5 -7
- package/src/og/control/Sun.js +22 -12
- package/src/og/control/ToggleWireframe.js +3 -3
- package/src/og/control/TouchNavigation.js +43 -32
- package/src/og/control/ZoomControl.js +40 -24
- package/src/og/ellipsoid/Ellipsoid.js +148 -56
- package/src/og/ellipsoid/wgs84.js +3 -3
- package/src/og/entity/BaseBillboard.js +65 -14
- package/src/og/entity/Billboard.js +9 -5
- package/src/og/entity/BillboardHandler.js +310 -64
- package/src/og/entity/Entity.js +39 -1
- package/src/og/entity/EntityCollection.js +47 -24
- package/src/og/entity/GeoObject.js +228 -0
- package/src/og/entity/GeoObjectHandler.js +910 -0
- package/src/og/entity/GeometryHandler.js +595 -123
- package/src/og/entity/Label.js +53 -18
- package/src/og/entity/LabelHandler.js +42 -244
- package/src/og/entity/LabelWorker.js +213 -0
- package/src/og/entity/Object3d.js +504 -0
- package/src/og/entity/PointCloud.js +76 -28
- package/src/og/entity/PointCloudHandler.js +5 -5
- package/src/og/entity/Ray.js +49 -16
- package/src/og/entity/Strip.js +72 -43
- package/src/og/entity/StripHandler.js +23 -23
- package/src/og/layer/BaseGeoImage.js +50 -19
- package/src/og/layer/CanvasTiles.js +16 -16
- package/src/og/layer/GeoImage.js +6 -6
- package/src/og/layer/KML.js +55 -33
- package/src/og/layer/Layer.js +3 -3
- package/src/og/layer/Vector.js +94 -48
- package/src/og/layer/WMS.js +33 -16
- package/src/og/light/LightSource.js +19 -12
- package/src/og/math/Mat3.js +24 -12
- package/src/og/math/Mat4.js +603 -603
- package/src/og/math/Plane.js +19 -18
- package/src/og/math/Ray.js +17 -12
- package/src/og/math/Vec2.js +24 -14
- package/src/og/math/Vec3.js +60 -30
- package/src/og/math/coder.js +7 -7
- package/src/og/proj/EPSG3857.js +3 -3
- package/src/og/proj/EPSG4326.js +3 -3
- package/src/og/proj/Proj.js +2 -4
- package/src/og/quadTree/Node.js +31 -17
- package/src/og/renderer/Renderer.js +23 -6
- package/src/og/renderer/RendererEvents.js +1 -1
- package/src/og/scene/BaseNode.js +2 -3
- package/src/og/scene/Planet.js +2 -2
- package/src/og/scene/RenderNode.js +15 -8
- package/src/og/shaders/geoObject.js +211 -0
- package/src/og/shaders/pointCloud.js +41 -41
- package/src/og/shaders/shape.js +12 -18
- package/src/og/shaders/skybox.js +36 -36
- package/src/og/shapes/BaseShape.js +107 -35
- package/src/og/shapes/Icosphere.js +25 -10
- package/src/og/shapes/Sphere.js +8 -11
- package/src/og/utils/TextureAtlas.js +16 -18
- package/src/og/utils/shared.js +1 -1
- package/src/og/webgl/Handler.js +68 -49
- package/src/og/webgl/Multisample.js +44 -16
- package/src/og/webgl/Program.js +78 -33
- package/src/og/webgl/callbacks.js +3 -3
- package/types/Deferred.d.ts +1 -1
- package/types/Events.d.ts +2 -2
- package/types/Extent.d.ts +1 -1
- package/types/Rectangle.d.ts +1 -1
- package/types/ajax.d.ts +1 -1
- package/types/bv/Box.d.ts +1 -1
- package/types/bv/Sphere.d.ts +1 -1
- package/types/camera/Camera.d.ts +5 -5
- package/types/camera/Frustum.d.ts +6 -6
- package/types/camera/PlanetCamera.d.ts +8 -8
- package/types/control/Control.d.ts +1 -1
- package/types/control/EarthCoordinates.d.ts +1 -1
- package/types/control/Sun.d.ts +1 -1
- package/types/entity/BaseBillboard.d.ts +15 -8
- package/types/entity/Entity.d.ts +24 -9
- package/types/entity/EntityCollection.d.ts +15 -9
- package/types/entity/GeoObject.d.ts +111 -0
- package/types/entity/GeoObjectHandler.d.ts +77 -0
- package/types/entity/Geometry.d.ts +1 -1
- package/types/entity/GeometryHandler.d.ts +1 -1
- package/types/entity/Label.d.ts +3 -3
- package/types/entity/LabelHandler.d.ts +2 -0
- package/types/entity/LabelWorker.d.ts +9 -0
- package/types/entity/PointCloud.d.ts +1 -1
- package/types/entity/Polyline.d.ts +5 -5
- package/types/entity/Ray.d.ts +1 -1
- package/types/entity/Strip.d.ts +1 -1
- package/types/layer/BaseGeoImage.d.ts +3 -3
- package/types/layer/CanvasTiles.d.ts +5 -5
- package/types/layer/GeoImage.d.ts +1 -1
- package/types/layer/GeoVideo.d.ts +1 -1
- package/types/layer/Layer.d.ts +5 -5
- package/types/layer/Vector.d.ts +9 -9
- package/types/layer/XYZ.d.ts +3 -3
- package/types/light/LightSource.d.ts +7 -7
- package/types/math/Plane.d.ts +1 -1
- package/types/math/Ray.d.ts +1 -1
- package/types/math/Vec2.d.ts +34 -34
- package/types/math/Vec3.d.ts +1 -1
- package/types/math/Vec4.d.ts +1 -1
- package/types/math/coder.d.ts +1 -1
- package/types/math.d.ts +1 -1
- package/types/proj/Proj.d.ts +2 -2
- package/types/quadTree/Node.d.ts +1 -1
- package/types/renderer/Renderer.d.ts +12 -10
- package/types/renderer/RendererEvents.d.ts +1 -1
- package/types/scene/BaseNode.d.ts +4 -4
- package/types/scene/Planet.d.ts +40 -40
- package/types/scene/RenderNode.d.ts +9 -9
- package/types/segment/Segment.d.ts +9 -9
- package/types/shaders/geoObject.d.ts +3 -0
- package/types/shapes/BaseShape.d.ts +5 -5
- package/types/terrain/EmptyTerrain.d.ts +2 -2
- package/types/terrain/GlobusTerrain.d.ts +4 -4
- package/types/utils/TextureAtlas.d.ts +4 -4
- package/types/utils/shared.d.ts +9 -9
- package/types/webgl/Framebuffer.d.ts +1 -1
- package/types/webgl/Handler.d.ts +16 -7
- package/types/webgl/Multisample.d.ts +2 -2
- package/types/webgl/Program.d.ts +6 -0
- package/types/webgl/ProgramController.d.ts +1 -1
package/src/og/webgl/Program.js
CHANGED
|
@@ -2,20 +2,13 @@
|
|
|
2
2
|
* @module og/webgl/Program
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
"use strict";
|
|
6
6
|
|
|
7
|
-
import { callbacks } from
|
|
8
|
-
import { cons } from
|
|
9
|
-
import { typeStr } from
|
|
7
|
+
import { callbacks } from "./callbacks.js";
|
|
8
|
+
import { cons } from "../cons.js";
|
|
9
|
+
import { typeStr, types } from "./types.js";
|
|
10
10
|
|
|
11
|
-
const itemTypes = [
|
|
12
|
-
"BYTE",
|
|
13
|
-
"SHORT",
|
|
14
|
-
"UNSIGNED_BYTE",
|
|
15
|
-
"UNSIGNED_SHORT",
|
|
16
|
-
"FLOAT",
|
|
17
|
-
"HALF_FLOAT"
|
|
18
|
-
];
|
|
11
|
+
const itemTypes = ["BYTE", "SHORT", "UNSIGNED_BYTE", "UNSIGNED_SHORT", "FLOAT", "HALF_FLOAT"];
|
|
19
12
|
|
|
20
13
|
/**
|
|
21
14
|
* Represents more comfortable using WebGL shader program.
|
|
@@ -46,9 +39,11 @@ class Program {
|
|
|
46
39
|
*/
|
|
47
40
|
this._attributes = {};
|
|
48
41
|
for (let t in material.attributes) {
|
|
49
|
-
if (
|
|
50
|
-
typeof
|
|
51
|
-
|
|
42
|
+
if (
|
|
43
|
+
typeof material.attributes[t] === "string" ||
|
|
44
|
+
typeof material.attributes[t] === "number"
|
|
45
|
+
) {
|
|
46
|
+
this._attributes[t] = { type: material.attributes[t] };
|
|
52
47
|
} else {
|
|
53
48
|
this._attributes[t] = material.attributes[t];
|
|
54
49
|
}
|
|
@@ -61,9 +56,11 @@ class Program {
|
|
|
61
56
|
*/
|
|
62
57
|
this._uniforms = {};
|
|
63
58
|
for (let t in material.uniforms) {
|
|
64
|
-
if (
|
|
65
|
-
typeof
|
|
66
|
-
|
|
59
|
+
if (
|
|
60
|
+
typeof material.uniforms[t] === "string" ||
|
|
61
|
+
typeof material.uniforms[t] === "number"
|
|
62
|
+
) {
|
|
63
|
+
this._uniforms[t] = { type: material.uniforms[t] };
|
|
67
64
|
} else {
|
|
68
65
|
this._uniforms[t] = material.uniforms[t];
|
|
69
66
|
}
|
|
@@ -117,6 +114,13 @@ class Program {
|
|
|
117
114
|
* @type {Array.<Object>}
|
|
118
115
|
*/
|
|
119
116
|
this._attribArrays = [];
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Program attributes divisor.
|
|
120
|
+
* @private
|
|
121
|
+
* @type {Array.<Object>}
|
|
122
|
+
*/
|
|
123
|
+
this._attribDivisor = [];
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
/**
|
|
@@ -128,7 +132,14 @@ class Program {
|
|
|
128
132
|
static bindBuffer(program, variable) {
|
|
129
133
|
var gl = program.gl;
|
|
130
134
|
gl.bindBuffer(gl.ARRAY_BUFFER, variable.value);
|
|
131
|
-
gl.vertexAttribPointer(
|
|
135
|
+
gl.vertexAttribPointer(
|
|
136
|
+
variable._pName,
|
|
137
|
+
variable.value.itemSize,
|
|
138
|
+
variable.itemType,
|
|
139
|
+
variable.normalized,
|
|
140
|
+
0,
|
|
141
|
+
0
|
|
142
|
+
);
|
|
132
143
|
}
|
|
133
144
|
|
|
134
145
|
/**
|
|
@@ -196,7 +207,9 @@ class Program {
|
|
|
196
207
|
this.gl.shaderSource(shader, src);
|
|
197
208
|
this.gl.compileShader(shader);
|
|
198
209
|
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
|
|
199
|
-
cons.logErr(
|
|
210
|
+
cons.logErr(
|
|
211
|
+
"og/Program/Program:" + this.name + " - " + this.gl.getShaderInfoLog(shader) + "."
|
|
212
|
+
);
|
|
200
213
|
return false;
|
|
201
214
|
}
|
|
202
215
|
return true;
|
|
@@ -237,9 +250,9 @@ class Program {
|
|
|
237
250
|
disableAttribArrays() {
|
|
238
251
|
var gl = this.gl;
|
|
239
252
|
var a = this._attribArrays;
|
|
240
|
-
|
|
241
|
-
while (i--) {
|
|
253
|
+
for (let i = 0, len = a.length; i < len; i++) {
|
|
242
254
|
gl.disableVertexAttribArray(a[i]);
|
|
255
|
+
gl.vertexAttribDivisor(a[i], 0);
|
|
243
256
|
}
|
|
244
257
|
}
|
|
245
258
|
|
|
@@ -250,9 +263,10 @@ class Program {
|
|
|
250
263
|
enableAttribArrays() {
|
|
251
264
|
var gl = this.gl;
|
|
252
265
|
var a = this._attribArrays;
|
|
253
|
-
var
|
|
254
|
-
|
|
266
|
+
var d = this._attribDivisor;
|
|
267
|
+
for (let i = 0, len = a.length; i < len; i++) {
|
|
255
268
|
gl.enableVertexAttribArray(a[i]);
|
|
269
|
+
gl.vertexAttribDivisor(a[i], d[i]);
|
|
256
270
|
}
|
|
257
271
|
}
|
|
258
272
|
|
|
@@ -280,7 +294,13 @@ class Program {
|
|
|
280
294
|
gl.linkProgram(this._p);
|
|
281
295
|
|
|
282
296
|
if (!gl.getProgramParameter(this._p, gl.LINK_STATUS)) {
|
|
283
|
-
cons.logErr(
|
|
297
|
+
cons.logErr(
|
|
298
|
+
"og/Program/Program:" +
|
|
299
|
+
this.name +
|
|
300
|
+
" - couldn't initialise shaders. " +
|
|
301
|
+
gl.getProgramInfoLog(this._p) +
|
|
302
|
+
"."
|
|
303
|
+
);
|
|
284
304
|
gl.deleteProgram(this._p);
|
|
285
305
|
return;
|
|
286
306
|
}
|
|
@@ -293,25 +313,47 @@ class Program {
|
|
|
293
313
|
|
|
294
314
|
this._attributes[a]._callback = Program.bindBuffer;
|
|
295
315
|
|
|
296
|
-
let itemTypeStr = this._attributes[a].itemType
|
|
316
|
+
let itemTypeStr = this._attributes[a].itemType
|
|
317
|
+
? this._attributes[a].itemType.trim().toUpperCase()
|
|
318
|
+
: "FLOAT";
|
|
319
|
+
|
|
297
320
|
if (itemTypes.indexOf(itemTypeStr) == -1) {
|
|
298
|
-
cons.logErr(
|
|
321
|
+
cons.logErr(
|
|
322
|
+
`og/Program/Program: ${this.name}- attribute '${a}', item type ${this._attributes[a].itemType} not exists.`
|
|
323
|
+
);
|
|
299
324
|
this._attributes[a].itemType = gl.FLOAT;
|
|
300
325
|
} else {
|
|
301
326
|
this._attributes[a].itemType = gl[itemTypeStr];
|
|
302
327
|
}
|
|
303
328
|
|
|
304
329
|
this._attributes[a].normalized = this._attributes[a].normalized || false;
|
|
330
|
+
this._attributes[a].divisor = this._attributes[a].divisor || 0;
|
|
305
331
|
|
|
306
332
|
this._p[a] = gl.getAttribLocation(this._p, a);
|
|
307
333
|
|
|
308
334
|
if (this._p[a] == undefined) {
|
|
309
|
-
cons.logErr(
|
|
335
|
+
cons.logErr(
|
|
336
|
+
"og/Program/Program:" + this.name + " - attribute '" + a + "' is not exists."
|
|
337
|
+
);
|
|
310
338
|
gl.deleteProgram(this._p);
|
|
311
339
|
return;
|
|
312
340
|
}
|
|
313
341
|
|
|
314
|
-
this.
|
|
342
|
+
let type = this._attributes[a].type;
|
|
343
|
+
if (typeof type === "string") {
|
|
344
|
+
type = typeStr[type.trim().toLowerCase()];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
let d = this._attributes[a].divisor;
|
|
348
|
+
if (type === types.MAT4) {
|
|
349
|
+
let loc = this._p[a];
|
|
350
|
+
this._attribArrays.push(loc, loc + 1, loc + 2, loc + 3);
|
|
351
|
+
this._attribDivisor.push(d, d, d, d);
|
|
352
|
+
} else {
|
|
353
|
+
this._attribArrays.push(this._p[a]);
|
|
354
|
+
this._attribDivisor.push(d);
|
|
355
|
+
}
|
|
356
|
+
|
|
315
357
|
gl.enableVertexAttribArray(this._p[a]);
|
|
316
358
|
|
|
317
359
|
this._attributes[a]._pName = this._p[a];
|
|
@@ -321,8 +363,9 @@ class Program {
|
|
|
321
363
|
for (var u in this._uniforms) {
|
|
322
364
|
//this.uniforms[u]._name = u;
|
|
323
365
|
|
|
324
|
-
if (typeof
|
|
325
|
-
this._uniforms[u]._callback =
|
|
366
|
+
if (typeof this._uniforms[u].type === "string") {
|
|
367
|
+
this._uniforms[u]._callback =
|
|
368
|
+
callbacks.u[typeStr[this._uniforms[u].type.trim().toLowerCase()]];
|
|
326
369
|
} else {
|
|
327
370
|
this._uniforms[u]._callback = callbacks.u[this._uniforms[u].type];
|
|
328
371
|
}
|
|
@@ -331,7 +374,9 @@ class Program {
|
|
|
331
374
|
this._p[u] = gl.getUniformLocation(this._p, u);
|
|
332
375
|
|
|
333
376
|
if (this._p[u] == undefined) {
|
|
334
|
-
cons.logErr(
|
|
377
|
+
cons.logErr(
|
|
378
|
+
"og/Program/Program:" + this.name + " - uniform '" + u + "' is not exists."
|
|
379
|
+
);
|
|
335
380
|
gl.deleteProgram(this._p);
|
|
336
381
|
return;
|
|
337
382
|
}
|
|
@@ -348,4 +393,4 @@ class Program {
|
|
|
348
393
|
}
|
|
349
394
|
}
|
|
350
395
|
|
|
351
|
-
export { Program };
|
|
396
|
+
export { Program };
|
|
@@ -93,6 +93,6 @@ callbacks.a[types.VEC3] = function (program, variable) {
|
|
|
93
93
|
program.gl.vertexAttrib3fv(variable._pName, variable.value);
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
callbacks.a[types.VEC4] = function (program, variable) {
|
|
97
|
-
program.gl.vertexAttrib4fv(variable._pName, variable.value);
|
|
98
|
-
};
|
|
96
|
+
//callbacks.a[types.VEC4] = function (program, variable) {
|
|
97
|
+
// program.gl.vertexAttrib4fv(variable._pName, variable.value);
|
|
98
|
+
//};
|
package/types/Deferred.d.ts
CHANGED
package/types/Events.d.ts
CHANGED
|
@@ -49,14 +49,14 @@ export class Events {
|
|
|
49
49
|
* @param {eventCallback} callback - Event callback function.
|
|
50
50
|
* @param {Object} sender - Event callback function owner.
|
|
51
51
|
*/
|
|
52
|
-
public on(name: string, callback:
|
|
52
|
+
public on(name: string, callback: eventCallback, sender: any, priority?: number): void;
|
|
53
53
|
/**
|
|
54
54
|
* Stop listening event name with specified callback function.
|
|
55
55
|
* @public
|
|
56
56
|
* @param {string} name - Event name.
|
|
57
57
|
* @param {eventCallback} callback - Attached event callback.
|
|
58
58
|
*/
|
|
59
|
-
public off(name: string, callback:
|
|
59
|
+
public off(name: string, callback: eventCallback): void;
|
|
60
60
|
/**
|
|
61
61
|
* Dispatch event.
|
|
62
62
|
* @public
|
package/types/Extent.d.ts
CHANGED
|
@@ -160,7 +160,7 @@ export class Extent {
|
|
|
160
160
|
* @param {Ellipsoid} ellipsoid - Ellipsoid.
|
|
161
161
|
* @return {Array.<number>} Cartesian 3d coordinate array. (exactly 6 entries)
|
|
162
162
|
*/
|
|
163
|
-
public getCartesianBounds(ellipsoid:
|
|
163
|
+
public getCartesianBounds(ellipsoid: Ellipsoid): Array<number>;
|
|
164
164
|
toString(): string;
|
|
165
165
|
}
|
|
166
166
|
import { LonLat } from "./LonLat.js";
|
package/types/Rectangle.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param {number} [top] - Top coordinate. 0 - default.
|
|
6
6
|
* @param {number} [right] - Right coordinate. 0 - default.
|
|
7
7
|
* @param {number} [bottom] - Bottom coordinate. 0 - default.
|
|
8
|
-
*/
|
|
8
|
+
*/
|
|
9
9
|
export class Rectangle {
|
|
10
10
|
/**
|
|
11
11
|
* @param {number} [left] - Left coordinate. 0 - default.
|
package/types/ajax.d.ts
CHANGED
package/types/bv/Box.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export class Box {
|
|
|
25
25
|
* @param {Ellipsoid} ellipsoid - Ellipsoid.
|
|
26
26
|
* @param {Extent} extent - Geodetic extent.
|
|
27
27
|
*/
|
|
28
|
-
setFromExtent(ellipsoid:
|
|
28
|
+
setFromExtent(ellipsoid: Ellipsoid, extent: Extent): void;
|
|
29
29
|
}
|
|
30
30
|
import { Vec3 } from "../math/Vec3.js";
|
package/types/bv/Sphere.d.ts
CHANGED
|
@@ -33,6 +33,6 @@ export class Sphere {
|
|
|
33
33
|
* @param {Ellipsoid} ellipsoid - Ellipsoid.
|
|
34
34
|
* @param {Extent} extent - Geodetic extent.
|
|
35
35
|
*/
|
|
36
|
-
setFromExtent(ellipsoid:
|
|
36
|
+
setFromExtent(ellipsoid: Ellipsoid, extent: Extent): void;
|
|
37
37
|
}
|
|
38
38
|
import { Vec3 } from "../math/Vec3.js";
|
package/types/camera/Camera.d.ts
CHANGED
|
@@ -18,13 +18,13 @@ export class Camera {
|
|
|
18
18
|
* @param {Renderer} [renderer] - Renderer uses the camera instance.
|
|
19
19
|
* @param {Object} [options] - Camera options:
|
|
20
20
|
*/
|
|
21
|
-
constructor(renderer?:
|
|
21
|
+
constructor(renderer?: Renderer, options?: any);
|
|
22
22
|
/**
|
|
23
23
|
* Assigned renderer
|
|
24
24
|
* @public
|
|
25
25
|
* @type {Renderer}
|
|
26
26
|
*/
|
|
27
|
-
public renderer:
|
|
27
|
+
public renderer: Renderer;
|
|
28
28
|
/**
|
|
29
29
|
* Camera events handler
|
|
30
30
|
* @public
|
|
@@ -159,7 +159,7 @@ export class Camera {
|
|
|
159
159
|
* @param {nnumber} angle - Camera's view angle
|
|
160
160
|
* @param {number} aspect - Screen aspect ration
|
|
161
161
|
*/
|
|
162
|
-
public _setProj(angle:
|
|
162
|
+
public _setProj(angle: nnumber, aspect: number): void;
|
|
163
163
|
_projSizeConst: number;
|
|
164
164
|
/**
|
|
165
165
|
* Sets camera view angle in degrees
|
|
@@ -239,7 +239,7 @@ export class Camera {
|
|
|
239
239
|
* @param {Vec3} center - Point that the camera rotates around
|
|
240
240
|
* @param {Vecto3} [up] - Camera up vector
|
|
241
241
|
*/
|
|
242
|
-
public rotateAround(angle: number, isArc: boolean, center: Vec3, up?:
|
|
242
|
+
public rotateAround(angle: number, isArc: boolean, center: Vec3, up?: Vecto3): void;
|
|
243
243
|
/**
|
|
244
244
|
* Rotates camera around center point by horizontal.
|
|
245
245
|
* @public
|
|
@@ -249,7 +249,7 @@ export class Camera {
|
|
|
249
249
|
* @param {Vec3} center - Point that the camera rotates around.
|
|
250
250
|
* @param {Vec3} [up] - Camera up vector.
|
|
251
251
|
*/
|
|
252
|
-
public rotateHorizontal(angle: number, isArc:
|
|
252
|
+
public rotateHorizontal(angle: number, isArc: boolaen, center: Vec3, up?: Vec3): void;
|
|
253
253
|
/**
|
|
254
254
|
* Rotates camera around center point by vecrtical.
|
|
255
255
|
* @param {number} angle - Rotation angle in radians.
|
|
@@ -85,7 +85,7 @@ export class Frustum {
|
|
|
85
85
|
* @param {number} near - Near camera distance.
|
|
86
86
|
* @param {number} far - Far camera distance.
|
|
87
87
|
*/
|
|
88
|
-
public setProjectionMatrix(angle:
|
|
88
|
+
public setProjectionMatrix(angle: nnumber, aspect: number, near: number, far: number): void;
|
|
89
89
|
/**
|
|
90
90
|
* Camera's projection matrix values.
|
|
91
91
|
* @public
|
|
@@ -98,14 +98,14 @@ export class Frustum {
|
|
|
98
98
|
* @param {Vec3} point - Cartesian point.
|
|
99
99
|
* @returns {boolean} -
|
|
100
100
|
*/
|
|
101
|
-
public containsPoint(point:
|
|
101
|
+
public containsPoint(point: Vec3): boolean;
|
|
102
102
|
/**
|
|
103
103
|
* Returns true if the frustum contains a bonding sphere, but bottom plane exclude.
|
|
104
104
|
* @public
|
|
105
105
|
* @param {Sphere} sphere - Bounding sphere.
|
|
106
106
|
* @returns {boolean} -
|
|
107
107
|
*/
|
|
108
|
-
public containsSphereBottomExc(sphere:
|
|
108
|
+
public containsSphereBottomExc(sphere: Sphere): boolean;
|
|
109
109
|
containsSphereButtom(sphere: any): boolean;
|
|
110
110
|
/**
|
|
111
111
|
* Returns true if the frustum contains a bonding sphere.
|
|
@@ -113,7 +113,7 @@ export class Frustum {
|
|
|
113
113
|
* @param {Sphere} sphere - Bounding sphere.
|
|
114
114
|
* @returns {boolean} -
|
|
115
115
|
*/
|
|
116
|
-
public containsSphere(sphere:
|
|
116
|
+
public containsSphere(sphere: Sphere): boolean;
|
|
117
117
|
/**
|
|
118
118
|
* Returns true if the frustum contains a bonding sphere.
|
|
119
119
|
* @public
|
|
@@ -121,13 +121,13 @@ export class Frustum {
|
|
|
121
121
|
* @param {number} radius - Sphere radius.
|
|
122
122
|
* @returns {boolean} -
|
|
123
123
|
*/
|
|
124
|
-
public containsSphere2(center:
|
|
124
|
+
public containsSphere2(center: Vec3, radius: number): boolean;
|
|
125
125
|
/**
|
|
126
126
|
* Returns true if the frustum contains a bounding box.
|
|
127
127
|
* @public
|
|
128
128
|
* @param {Box} box - Bounding box.
|
|
129
129
|
* @returns {boolean} -
|
|
130
130
|
*/
|
|
131
|
-
public containsBox(box:
|
|
131
|
+
public containsBox(box: Box): boolean;
|
|
132
132
|
}
|
|
133
133
|
import { Mat4 } from "../math/Mat4.js";
|
|
@@ -19,13 +19,13 @@ export class PlanetCamera extends Camera {
|
|
|
19
19
|
* @param {RenderNode} planet - Planet render node.
|
|
20
20
|
* @param {Object} [options] - Planet camera options:
|
|
21
21
|
*/
|
|
22
|
-
constructor(planet:
|
|
22
|
+
constructor(planet: RenderNode, options?: any);
|
|
23
23
|
/**
|
|
24
24
|
* Assigned camera's planet.
|
|
25
25
|
* @public
|
|
26
26
|
* @type {Planet}
|
|
27
27
|
*/
|
|
28
|
-
public planet:
|
|
28
|
+
public planet: Planet;
|
|
29
29
|
/**
|
|
30
30
|
* Minimal alltitude that camera can reach over the terrain.
|
|
31
31
|
* @public
|
|
@@ -67,7 +67,7 @@ export class PlanetCamera extends Camera {
|
|
|
67
67
|
* @protected
|
|
68
68
|
* @type {quadTree.Node}
|
|
69
69
|
*/
|
|
70
|
-
protected _insideSegment:
|
|
70
|
+
protected _insideSegment: quadTree.Node;
|
|
71
71
|
/**
|
|
72
72
|
* Coordinates that depends on what segment class we are fling over.
|
|
73
73
|
* It can be WGS84 or Mercator coordinates. Gets in og.quadTree.Node
|
|
@@ -122,13 +122,13 @@ export class PlanetCamera extends Camera {
|
|
|
122
122
|
* @param {Number} height - Camera height
|
|
123
123
|
* @returns {Vec3}
|
|
124
124
|
*/
|
|
125
|
-
public getExtentPosition(extent:
|
|
125
|
+
public getExtentPosition(extent: Extent, height: number): Vec3;
|
|
126
126
|
/**
|
|
127
127
|
* View current extent.
|
|
128
128
|
* @public
|
|
129
129
|
* @param {Extent} extent - Current extent.
|
|
130
130
|
*/
|
|
131
|
-
public viewExtent(extent:
|
|
131
|
+
public viewExtent(extent: Extent, height: any): void;
|
|
132
132
|
/**
|
|
133
133
|
* Flies to the current extent.
|
|
134
134
|
* @public
|
|
@@ -139,7 +139,7 @@ export class PlanetCamera extends Camera {
|
|
|
139
139
|
* @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
|
|
140
140
|
* @param [frameCallback]
|
|
141
141
|
*/
|
|
142
|
-
public flyExtent(extent:
|
|
142
|
+
public flyExtent(extent: Extent, height: any, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback, frameCallback?: any): void;
|
|
143
143
|
viewDistance(cartesian: any, distance?: number): void;
|
|
144
144
|
flyDistance(cartesian: any, distance: number, ampl: number, completeCallback: any, startCallback: any, frameCallback: any): void;
|
|
145
145
|
/**
|
|
@@ -153,7 +153,7 @@ export class PlanetCamera extends Camera {
|
|
|
153
153
|
* @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
|
|
154
154
|
* @param [frameCallback]
|
|
155
155
|
*/
|
|
156
|
-
public flyCartesian(cartesian: Vec3, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?:
|
|
156
|
+
public flyCartesian(cartesian: Vec3, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback, frameCallback?: any): void;
|
|
157
157
|
_frameCallback: any;
|
|
158
158
|
/**
|
|
159
159
|
* Flies to the geo coordiantes.
|
|
@@ -165,7 +165,7 @@ export class PlanetCamera extends Camera {
|
|
|
165
165
|
* @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
|
|
166
166
|
* @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
|
|
167
167
|
*/
|
|
168
|
-
public flyLonLat(lonlat: LonLat, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?:
|
|
168
|
+
public flyLonLat(lonlat: LonLat, look?: Vec3, up?: Vec3, ampl?: number, completeCallback?: cameraCallback, startCallback?: cameraCallback): void;
|
|
169
169
|
/**
|
|
170
170
|
* Breaks the flight.
|
|
171
171
|
* @public
|
package/types/control/Sun.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export class BaseBillboard {
|
|
|
39
39
|
* @protected
|
|
40
40
|
* @type {Vec4}
|
|
41
41
|
*/
|
|
42
|
-
protected _color:
|
|
42
|
+
protected _color: Vec4;
|
|
43
43
|
/**
|
|
44
44
|
* Cartesian aligned axis vector.
|
|
45
45
|
* @protected
|
|
@@ -51,7 +51,7 @@ export class BaseBillboard {
|
|
|
51
51
|
* @protected
|
|
52
52
|
* @type {math.Vecto3}
|
|
53
53
|
*/
|
|
54
|
-
protected _offset:
|
|
54
|
+
protected _offset: math.Vecto3;
|
|
55
55
|
/**
|
|
56
56
|
* Billboard visibility.
|
|
57
57
|
* @protected
|
|
@@ -63,19 +63,26 @@ export class BaseBillboard {
|
|
|
63
63
|
* @protected
|
|
64
64
|
* @type {Entity}
|
|
65
65
|
*/
|
|
66
|
-
protected _entity:
|
|
66
|
+
protected _entity: Entity;
|
|
67
67
|
/**
|
|
68
68
|
* Handler that stores and renders this billboard object.
|
|
69
69
|
* @protected
|
|
70
70
|
* @type {BillboardHandler}
|
|
71
71
|
*/
|
|
72
|
-
protected _handler:
|
|
72
|
+
protected _handler: BillboardHandler;
|
|
73
73
|
/**
|
|
74
74
|
* Billboard handler array index.
|
|
75
75
|
* @protected
|
|
76
76
|
* @type {number}
|
|
77
77
|
*/
|
|
78
78
|
protected _handlerIndex: number;
|
|
79
|
+
/**
|
|
80
|
+
* An indication that the object is ready to draw
|
|
81
|
+
* @protected
|
|
82
|
+
* @type {number}
|
|
83
|
+
*/
|
|
84
|
+
protected _isReady: number;
|
|
85
|
+
_lockId: number;
|
|
79
86
|
/**
|
|
80
87
|
* Sets billboard position.
|
|
81
88
|
* @public
|
|
@@ -109,7 +116,7 @@ export class BaseBillboard {
|
|
|
109
116
|
* @public
|
|
110
117
|
* @param {Vec2} offset - Offset size.
|
|
111
118
|
*/
|
|
112
|
-
public setOffset3v(offset:
|
|
119
|
+
public setOffset3v(offset: Vec2): void;
|
|
113
120
|
/**
|
|
114
121
|
* Returns billboard screen space offset size.
|
|
115
122
|
* @public
|
|
@@ -148,7 +155,7 @@ export class BaseBillboard {
|
|
|
148
155
|
* @public
|
|
149
156
|
* @param {Vec4} color - RGBA vector.
|
|
150
157
|
*/
|
|
151
|
-
public setColor4v(color:
|
|
158
|
+
public setColor4v(color: Vec4): void;
|
|
152
159
|
/**
|
|
153
160
|
* Sets billboard color.
|
|
154
161
|
* @public
|
|
@@ -160,7 +167,7 @@ export class BaseBillboard {
|
|
|
160
167
|
* @public
|
|
161
168
|
* @returns {Vec4}
|
|
162
169
|
*/
|
|
163
|
-
public getColor():
|
|
170
|
+
public getColor(): Vec4;
|
|
164
171
|
/**
|
|
165
172
|
* Sets billboard visibility.
|
|
166
173
|
* @public
|
|
@@ -186,7 +193,7 @@ export class BaseBillboard {
|
|
|
186
193
|
* @public
|
|
187
194
|
* @param {math.Vecto3} alignedAxis - Vector to align.
|
|
188
195
|
*/
|
|
189
|
-
public setAlignedAxis3v(alignedAxis:
|
|
196
|
+
public setAlignedAxis3v(alignedAxis: math.Vecto3): void;
|
|
190
197
|
/**
|
|
191
198
|
* Returns aligned vector.
|
|
192
199
|
* @public
|