@openglobus/og 0.22.2 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/og.css +137 -1
- package/lib/@openglobus/js/Globe.d.ts +0 -1
- package/lib/@openglobus/js/Object3d.d.ts +20 -10
- package/lib/@openglobus/js/camera/Camera.d.ts +57 -15
- package/lib/@openglobus/js/camera/Frustum.d.ts +3 -0
- package/lib/@openglobus/js/camera/PlanetCamera.d.ts +13 -0
- package/lib/@openglobus/js/control/CameraLock.d.ts +38 -0
- package/lib/@openglobus/js/control/MouseNavigation.d.ts +62 -51
- package/lib/@openglobus/js/control/OldMouseNavigation.d.ts +64 -0
- package/lib/@openglobus/js/control/SimpleNavigation.d.ts +27 -10
- package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
- package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
- package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
- package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
- package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
- package/lib/@openglobus/js/control/geoObjectEditor/colors.d.ts +8 -0
- package/lib/@openglobus/js/control/index.d.ts +3 -2
- package/lib/@openglobus/js/entity/Entity.d.ts +282 -19
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +8 -9
- package/lib/@openglobus/js/entity/GeoObject.d.ts +135 -39
- package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +39 -63
- package/lib/@openglobus/js/entity/InstanceData.d.ts +76 -0
- package/lib/@openglobus/js/entity/Polyline.d.ts +19 -6
- package/lib/@openglobus/js/entity/PolylineHandler.d.ts +7 -0
- package/lib/@openglobus/js/index.d.ts +2 -1
- package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
- package/lib/@openglobus/js/layer/Vector.d.ts +4 -0
- package/lib/@openglobus/js/light/LightSource.d.ts +1 -139
- package/lib/@openglobus/js/math/Mat3.d.ts +1 -1
- package/lib/@openglobus/js/math/Mat4.d.ts +10 -1
- package/lib/@openglobus/js/math/Plane.d.ts +3 -1
- package/lib/@openglobus/js/math/Quat.d.ts +47 -33
- package/lib/@openglobus/js/math/Ray.d.ts +10 -14
- package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
- package/lib/@openglobus/js/math/Vec3.d.ts +15 -0
- package/lib/@openglobus/js/math.d.ts +2 -2
- package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/@openglobus/js/quadTree/Node.d.ts +1 -1
- package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/@openglobus/js/renderer/Renderer.d.ts +63 -44
- package/lib/@openglobus/js/renderer/RendererEvents.d.ts +2 -0
- package/lib/@openglobus/js/scene/Planet.d.ts +15 -7
- package/lib/@openglobus/js/scene/RenderNode.d.ts +10 -25
- package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -0
- package/lib/@openglobus/js/shaders/geoObject.d.ts +1 -0
- package/lib/@openglobus/js/shaders/utils.d.ts +1 -1
- package/lib/@openglobus/js/ui/Checkbox.d.ts +31 -0
- package/lib/@openglobus/js/ui/Dialog.d.ts +3 -0
- package/lib/@openglobus/js/ui/Input.d.ts +32 -0
- package/lib/@openglobus/js/ui/View.d.ts +3 -1
- package/lib/@openglobus/js/utils/objParser.d.ts +44 -12
- package/lib/@openglobus/js/utils/shared.d.ts +22 -0
- package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +0 -1
- package/lib/@openglobus/js/webgl/Framebuffer.d.ts +35 -8
- package/lib/@openglobus/js/webgl/Handler.d.ts +22 -12
- package/lib/@openglobus/og.css +1 -1
- package/lib/@openglobus/og.esm.js +1 -1
- package/lib/@openglobus/og.esm.js.map +1 -1
- package/lib/@openglobus/og.umd.js +1 -1
- package/lib/@openglobus/og.umd.js.map +1 -1
- package/lib/js/Globe.d.ts +0 -1
- package/lib/js/Globe.js +4 -2
- package/lib/js/Object3d.d.ts +20 -10
- package/lib/js/Object3d.js +124 -48
- package/lib/js/Popup.js +1 -1
- package/lib/js/camera/Camera.d.ts +57 -15
- package/lib/js/camera/Camera.js +109 -29
- package/lib/js/camera/Frustum.d.ts +3 -0
- package/lib/js/camera/Frustum.js +7 -0
- package/lib/js/camera/PlanetCamera.d.ts +13 -0
- package/lib/js/camera/PlanetCamera.js +52 -5
- package/lib/js/control/Atmosphere.js +10 -6
- package/lib/js/control/CameraLock.d.ts +38 -0
- package/lib/js/control/CameraLock.js +216 -0
- package/lib/js/control/Control.js +1 -1
- package/lib/js/control/DebugInfo.js +38 -8
- package/lib/js/control/KeyboardNavigation.js +9 -9
- package/lib/js/control/MouseNavigation.d.ts +62 -51
- package/lib/js/control/MouseNavigation.js +361 -305
- package/lib/js/control/MouseWheelZoomControl.d.ts +0 -44
- package/lib/js/control/MouseWheelZoomControl.js +270 -181
- package/lib/js/control/OldMouseNavigation.d.ts +64 -0
- package/lib/js/control/OldMouseNavigation.js +368 -0
- package/lib/js/control/ScaleControl.js +11 -5
- package/lib/js/control/SimpleNavigation.d.ts +27 -10
- package/lib/js/control/SimpleNavigation.js +149 -49
- package/lib/js/control/Sun.js +6 -6
- package/lib/js/control/TouchNavigation.js +11 -8
- package/lib/js/control/elevationProfile/ElevationProfileScene.js +6 -5
- package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
- package/lib/js/control/geoObjectEditor/ArrowEntity.js +59 -0
- package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
- package/lib/js/control/geoObjectEditor/AxisTrackEntity.js +93 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditor.js +30 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +488 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +487 -43
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +107 -0
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +31 -0
- package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
- package/lib/js/control/geoObjectEditor/RotateEntity.js +105 -0
- package/lib/js/control/geoObjectEditor/colors.d.ts +8 -0
- package/lib/js/control/geoObjectEditor/colors.js +8 -0
- package/lib/js/control/index.d.ts +3 -2
- package/lib/js/control/index.js +3 -2
- package/lib/js/control/timeline/TimelineControl.js +2 -0
- package/lib/js/control/visibleExtent/Segment.js +4 -4
- package/lib/js/entity/Entity.d.ts +282 -19
- package/lib/js/entity/Entity.js +497 -62
- package/lib/js/entity/EntityCollection.d.ts +8 -9
- package/lib/js/entity/EntityCollection.js +48 -45
- package/lib/js/entity/GeoObject.d.ts +135 -39
- package/lib/js/entity/GeoObject.js +150 -90
- package/lib/js/entity/GeoObjectHandler.d.ts +39 -63
- package/lib/js/entity/GeoObjectHandler.js +198 -295
- package/lib/js/entity/InstanceData.d.ts +76 -0
- package/lib/js/entity/InstanceData.js +347 -0
- package/lib/js/entity/Polyline.d.ts +19 -6
- package/lib/js/entity/Polyline.js +76 -36
- package/lib/js/entity/PolylineHandler.d.ts +7 -0
- package/lib/js/entity/PolylineHandler.js +26 -1
- package/lib/js/index.d.ts +2 -1
- package/lib/js/index.js +2 -1
- package/lib/js/input/MouseHandler.d.ts +1 -0
- package/lib/js/input/MouseHandler.js +12 -1
- package/lib/js/layer/Bing.js +2 -2
- package/lib/js/layer/Vector.d.ts +4 -0
- package/lib/js/layer/Vector.js +16 -0
- package/lib/js/light/LightSource.d.ts +1 -139
- package/lib/js/light/LightSource.js +21 -227
- package/lib/js/math/Mat3.d.ts +1 -1
- package/lib/js/math/Mat3.js +1 -1
- package/lib/js/math/Mat4.d.ts +10 -1
- package/lib/js/math/Mat4.js +17 -1
- package/lib/js/math/Plane.d.ts +3 -1
- package/lib/js/math/Plane.js +11 -1
- package/lib/js/math/Quat.d.ts +47 -33
- package/lib/js/math/Quat.js +92 -90
- package/lib/js/math/Ray.d.ts +10 -14
- package/lib/js/math/Ray.js +56 -33
- package/lib/js/math/Vec2.d.ts +22 -0
- package/lib/js/math/Vec2.js +32 -0
- package/lib/js/math/Vec3.d.ts +15 -0
- package/lib/js/math/Vec3.js +30 -1
- package/lib/js/math.d.ts +2 -2
- package/lib/js/math.js +3 -3
- package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/js/quadTree/EntityCollectionNode.js +8 -8
- package/lib/js/quadTree/Node.d.ts +1 -1
- package/lib/js/quadTree/Node.js +2 -2
- package/lib/js/quadTree/QuadTreeStrategy.js +1 -1
- package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.js +2 -2
- package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.js +2 -2
- package/lib/js/renderer/Renderer.d.ts +63 -44
- package/lib/js/renderer/Renderer.js +267 -266
- package/lib/js/renderer/RendererEvents.d.ts +2 -0
- package/lib/js/renderer/RendererEvents.js +5 -2
- package/lib/js/scene/Planet.d.ts +15 -7
- package/lib/js/scene/Planet.js +133 -90
- package/lib/js/scene/RenderNode.d.ts +10 -25
- package/lib/js/scene/RenderNode.js +70 -58
- package/lib/js/segment/Segment.js +4 -4
- package/lib/js/shaders/depth.js +2 -5
- package/lib/js/shaders/drawnode.d.ts +1 -0
- package/lib/js/shaders/drawnode.js +51 -52
- package/lib/js/shaders/geoObject.d.ts +1 -0
- package/lib/js/shaders/geoObject.js +154 -91
- package/lib/js/shaders/polyline.js +68 -51
- package/lib/js/shaders/utils.d.ts +1 -1
- package/lib/js/shaders/utils.js +11 -0
- package/lib/js/terrain/GlobusTerrain.js +2 -2
- package/lib/js/ui/Checkbox.d.ts +31 -0
- package/lib/js/ui/Checkbox.js +110 -0
- package/lib/js/ui/Color.js +2 -1
- package/lib/js/ui/Dialog.d.ts +3 -0
- package/lib/js/ui/Dialog.js +20 -0
- package/lib/js/ui/Input.d.ts +32 -0
- package/lib/js/ui/Input.js +107 -0
- package/lib/js/ui/View.d.ts +3 -1
- package/lib/js/ui/View.js +6 -0
- package/lib/js/utils/objParser.d.ts +44 -12
- package/lib/js/utils/objParser.js +241 -149
- package/lib/js/utils/shared.d.ts +22 -0
- package/lib/js/utils/shared.js +34 -0
- package/lib/js/webgl/BaseFramebuffer.d.ts +0 -1
- package/lib/js/webgl/Framebuffer.d.ts +35 -8
- package/lib/js/webgl/Framebuffer.js +136 -29
- package/lib/js/webgl/Handler.d.ts +22 -12
- package/lib/js/webgl/Handler.js +53 -34
- package/lib/js/webgl/Program.js +0 -8
- package/package.json +5 -3
- package/lib/@openglobus/js/control/EarthNavigation.d.ts +0 -50
- package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +0 -44
- package/lib/js/control/EarthNavigation.d.ts +0 -50
- package/lib/js/control/EarthNavigation.js +0 -202
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Extent } from "../Extent";
|
|
2
2
|
import { LonLat } from "../LonLat";
|
|
3
3
|
import { Vec3 } from "../math/Vec3";
|
|
4
|
-
import { cloneArray, htmlColorToFloat32Array, htmlColorToRgba, makeArray, makeArrayTyped } from "../utils/shared";
|
|
4
|
+
import { cloneArray, createVector3, htmlColorToFloat32Array, htmlColorToRgba, makeArray, makeArrayTyped } from "../utils/shared";
|
|
5
5
|
const VERTICES_BUFFER = 0;
|
|
6
6
|
const INDEX_BUFFER = 1;
|
|
7
7
|
const COLORS_BUFFER = 2;
|
|
@@ -27,6 +27,7 @@ const A = 3;
|
|
|
27
27
|
class Polyline {
|
|
28
28
|
constructor(options = {}) {
|
|
29
29
|
this.__id = Polyline.__counter__++;
|
|
30
|
+
this.__doubleToTwoFloats = Vec3.doubleToTwoFloats;
|
|
30
31
|
this.altitude = options.altitude || 0.0;
|
|
31
32
|
this.thickness = options.thickness || 1.5;
|
|
32
33
|
this._opacity = options.opacity != undefined ? options.opacity : 1.0;
|
|
@@ -59,6 +60,9 @@ class Polyline {
|
|
|
59
60
|
this._buffersUpdateCallbacks[INDEX_BUFFER] = this._createIndexBuffer;
|
|
60
61
|
this._buffersUpdateCallbacks[COLORS_BUFFER] = this._createColorsBuffer;
|
|
61
62
|
this._changedBuffers = new Array(this._buffersUpdateCallbacks.length);
|
|
63
|
+
let c = createVector3(options.visibleSpherePosition).toArray();
|
|
64
|
+
let r = options.visibleSphereRadius || 0;
|
|
65
|
+
this._visibleSphere = new Float32Array([...c, r]);
|
|
62
66
|
// create path
|
|
63
67
|
if (options.pathLonLat) {
|
|
64
68
|
this.setPathLonLat(options.pathLonLat);
|
|
@@ -70,9 +74,8 @@ class Polyline {
|
|
|
70
74
|
}
|
|
71
75
|
/**
|
|
72
76
|
* Appends to the line array new cartesian coordinates line data.
|
|
73
|
-
* @static
|
|
74
77
|
*/
|
|
75
|
-
|
|
78
|
+
__appendLineData3v(path3v, pathColors, defaultColor, isClosed, outVerticesHigh, outVerticesLow, outOrders, outIndexes, ellipsoid, outTransformedPathLonLat, outPath3v, outTransformedPathMerc, outExtent, outColors) {
|
|
76
79
|
var index = 0;
|
|
77
80
|
var v_high = new Vec3(), v_low = new Vec3();
|
|
78
81
|
if (outExtent) {
|
|
@@ -118,7 +121,7 @@ class Polyline {
|
|
|
118
121
|
if (pathColors_j && pathColors_j[0]) {
|
|
119
122
|
color = pathColors_j[0];
|
|
120
123
|
}
|
|
121
|
-
|
|
124
|
+
this.__doubleToTwoFloats(last, v_high, v_low);
|
|
122
125
|
outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
|
|
123
126
|
outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
|
|
124
127
|
let r = color[R], g = color[G], b = color[B], a = color[A] != undefined ? color[A] : 1.0;
|
|
@@ -156,7 +159,7 @@ class Polyline {
|
|
|
156
159
|
g = color[G];
|
|
157
160
|
b = color[B];
|
|
158
161
|
a = color[A] != undefined ? color[A] : 1.0;
|
|
159
|
-
|
|
162
|
+
this.__doubleToTwoFloats(cur, v_high, v_low);
|
|
160
163
|
outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
|
|
161
164
|
outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
|
|
162
165
|
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
@@ -195,7 +198,7 @@ class Polyline {
|
|
|
195
198
|
g = color[G];
|
|
196
199
|
b = color[B];
|
|
197
200
|
a = color[A] != undefined ? color[A] : 1.0;
|
|
198
|
-
|
|
201
|
+
this.__doubleToTwoFloats(first, v_high, v_low);
|
|
199
202
|
outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
|
|
200
203
|
outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
|
|
201
204
|
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
@@ -208,9 +211,8 @@ class Polyline {
|
|
|
208
211
|
}
|
|
209
212
|
/**
|
|
210
213
|
* Appends to the line new cartesian coordinates point data.
|
|
211
|
-
* @static
|
|
212
214
|
*/
|
|
213
|
-
|
|
215
|
+
__appendPoint3v(path3v, point3v, pathColors, color, isClosed, outVerticesHigh, outVerticesLow, outColors, outOrders, outIndexes, ellipsoid, outTransformedPathLonLat, outTransformedPathMerc, outExtent) {
|
|
214
216
|
var v_high = new Vec3(), v_low = new Vec3();
|
|
215
217
|
var ii = outIndexes.length - 4, index = outIndexes[ii - 1] + 1;
|
|
216
218
|
if (path3v.length === 0) {
|
|
@@ -258,7 +260,7 @@ class Polyline {
|
|
|
258
260
|
}
|
|
259
261
|
last = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
|
|
260
262
|
}
|
|
261
|
-
|
|
263
|
+
this.__doubleToTwoFloats(last, v_high, v_low);
|
|
262
264
|
let vi = outVerticesHigh.length - 3 * 12;
|
|
263
265
|
outVerticesHigh[vi] = v_high.x;
|
|
264
266
|
outVerticesHigh[vi + 1] = v_high.y;
|
|
@@ -310,7 +312,7 @@ class Polyline {
|
|
|
310
312
|
outExtent.northEast.lat = lonLat.lat;
|
|
311
313
|
}
|
|
312
314
|
}
|
|
313
|
-
|
|
315
|
+
this.__doubleToTwoFloats(point3v, v_high, v_low);
|
|
314
316
|
let vi = outVerticesHigh.length - 12;
|
|
315
317
|
outVerticesHigh[vi] = v_high.x;
|
|
316
318
|
outVerticesHigh[vi + 1] = v_high.y;
|
|
@@ -370,7 +372,7 @@ class Polyline {
|
|
|
370
372
|
first = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
|
|
371
373
|
outIndexes.push(index - 1, index - 1, index - 1, index - 1);
|
|
372
374
|
}
|
|
373
|
-
|
|
375
|
+
this.__doubleToTwoFloats(first, v_high, v_low);
|
|
374
376
|
outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
|
|
375
377
|
outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
|
|
376
378
|
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
@@ -418,7 +420,7 @@ class Polyline {
|
|
|
418
420
|
* Appends to the line array new geodetic coordinates line data.
|
|
419
421
|
* @static
|
|
420
422
|
*/
|
|
421
|
-
|
|
423
|
+
__appendLineDataLonLat(pathLonLat, pathColors, defaultColor, isClosed, outVerticesHigh, outVerticesLow, outOrders, outIndexes, ellipsoid, outTransformedPathCartesian, outPathLonLat, outTransformedPathMerc, outExtent, outColors) {
|
|
422
424
|
var index = 0;
|
|
423
425
|
var v_high = new Vec3(), v_low = new Vec3();
|
|
424
426
|
if (outExtent) {
|
|
@@ -476,7 +478,7 @@ class Polyline {
|
|
|
476
478
|
if (pathColors_j && pathColors_j[0]) {
|
|
477
479
|
color = pathColors_j[0];
|
|
478
480
|
}
|
|
479
|
-
|
|
481
|
+
this.__doubleToTwoFloats(last, v_high, v_low);
|
|
480
482
|
outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
|
|
481
483
|
outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
|
|
482
484
|
let r = color[R], g = color[G], b = color[B], a = color[A] != undefined ? color[A] : 1.0;
|
|
@@ -500,7 +502,7 @@ class Polyline {
|
|
|
500
502
|
outTransformedPathCartesian[j].push(cartesian);
|
|
501
503
|
outPathLonLat[j].push(cur);
|
|
502
504
|
outTransformedPathMerc[j].push(cur.forwardMercator());
|
|
503
|
-
|
|
505
|
+
this.__doubleToTwoFloats(cartesian, v_high, v_low);
|
|
504
506
|
outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
|
|
505
507
|
outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
|
|
506
508
|
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
@@ -559,7 +561,7 @@ class Polyline {
|
|
|
559
561
|
g = color[G];
|
|
560
562
|
b = color[B];
|
|
561
563
|
a = color[A] != undefined ? color[A] : 1.0;
|
|
562
|
-
|
|
564
|
+
this.__doubleToTwoFloats(first, v_high, v_low);
|
|
563
565
|
outVerticesHigh.push(v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z, v_high.x, v_high.y, v_high.z);
|
|
564
566
|
outVerticesLow.push(v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z, v_low.x, v_low.y, v_low.z);
|
|
565
567
|
outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
|
|
@@ -591,7 +593,7 @@ class Polyline {
|
|
|
591
593
|
else {
|
|
592
594
|
last = new Vec3(path[0].x + path[0].x - path[1].x, path[0].y + path[0].y - path[1].y, path[0].z + path[0].z - path[1].z);
|
|
593
595
|
}
|
|
594
|
-
|
|
596
|
+
this.__doubleToTwoFloats(last, v_high, v_low);
|
|
595
597
|
vh[k] = v_high.x;
|
|
596
598
|
vl[k++] = v_low.x;
|
|
597
599
|
vh[k] = v_high.y;
|
|
@@ -639,7 +641,7 @@ class Polyline {
|
|
|
639
641
|
extent.northEast.lat = lonLat.lat;
|
|
640
642
|
}
|
|
641
643
|
}
|
|
642
|
-
|
|
644
|
+
this.__doubleToTwoFloats(cur, v_high, v_low);
|
|
643
645
|
vh[k] = v_high.x;
|
|
644
646
|
vl[k++] = v_low.x;
|
|
645
647
|
vh[k] = v_high.y;
|
|
@@ -673,7 +675,7 @@ class Polyline {
|
|
|
673
675
|
var l1 = path.length - 1;
|
|
674
676
|
first = new Vec3(path[l1].x + path[l1].x - path[l1 - 1].x, path[l1].y + path[l1].y - path[l1 - 1].y, path[l1].z + path[l1].z - path[l1 - 1].z);
|
|
675
677
|
}
|
|
676
|
-
|
|
678
|
+
this.__doubleToTwoFloats(first, v_high, v_low);
|
|
677
679
|
vh[k] = v_high.x;
|
|
678
680
|
vl[k++] = v_low.x;
|
|
679
681
|
vh[k] = v_high.y;
|
|
@@ -722,7 +724,7 @@ class Polyline {
|
|
|
722
724
|
let p0 = ellipsoid.lonLatToCartesian(path[0]), p1 = ellipsoid.lonLatToCartesian(path[1]);
|
|
723
725
|
last = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
|
|
724
726
|
}
|
|
725
|
-
|
|
727
|
+
this.__doubleToTwoFloats(last, v_high, v_low);
|
|
726
728
|
vh[k] = v_high.x;
|
|
727
729
|
vl[k++] = v_low.x;
|
|
728
730
|
vh[k] = v_high.y;
|
|
@@ -753,7 +755,7 @@ class Polyline {
|
|
|
753
755
|
c[j][i] = cartesian;
|
|
754
756
|
m[j][i] = cur.forwardMercator();
|
|
755
757
|
l[j][i] = cur;
|
|
756
|
-
|
|
758
|
+
this.__doubleToTwoFloats(cartesian, v_high, v_low);
|
|
757
759
|
vh[k] = v_high.x;
|
|
758
760
|
vl[k++] = v_low.x;
|
|
759
761
|
vh[k] = v_high.y;
|
|
@@ -799,7 +801,7 @@ class Polyline {
|
|
|
799
801
|
let p0 = ellipsoid.lonLatToCartesian(path[path.length - 1]), p1 = ellipsoid.lonLatToCartesian(path[path.length - 2]);
|
|
800
802
|
first = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
|
|
801
803
|
}
|
|
802
|
-
|
|
804
|
+
this.__doubleToTwoFloats(first, v_high, v_low);
|
|
803
805
|
vh[k] = v_high.x;
|
|
804
806
|
vl[k++] = v_low.x;
|
|
805
807
|
vh[k] = v_high.y;
|
|
@@ -893,7 +895,7 @@ class Polyline {
|
|
|
893
895
|
last = new Vec3(path[0].x + path[0].x - path[1].x, path[0].y + path[0].y - path[1].y, path[0].z + path[0].z - path[1].z);
|
|
894
896
|
}
|
|
895
897
|
k = kk;
|
|
896
|
-
|
|
898
|
+
this.__doubleToTwoFloats(last, v_high, v_low);
|
|
897
899
|
vh[k] = v_high.x;
|
|
898
900
|
vh[k + 1] = v_high.y;
|
|
899
901
|
vh[k + 2] = v_high.z;
|
|
@@ -949,7 +951,7 @@ class Polyline {
|
|
|
949
951
|
}
|
|
950
952
|
}
|
|
951
953
|
k = kk + index * 12 + 12;
|
|
952
|
-
|
|
954
|
+
this.__doubleToTwoFloats(coordinates, v_high, v_low);
|
|
953
955
|
vh[k] = v_high.x;
|
|
954
956
|
vh[k + 1] = v_high.y;
|
|
955
957
|
vh[k + 2] = v_high.z;
|
|
@@ -984,7 +986,7 @@ class Polyline {
|
|
|
984
986
|
first = new Vec3(path[l1].x + path[l1].x - path[l1 - 1].x, path[l1].y + path[l1].y - path[l1 - 1].y, path[l1].z + path[l1].z - path[l1 - 1].z);
|
|
985
987
|
}
|
|
986
988
|
k = kk + path.length * 12 + 12;
|
|
987
|
-
|
|
989
|
+
this.__doubleToTwoFloats(first, v_high, v_low);
|
|
988
990
|
vh[k] = v_high.x;
|
|
989
991
|
vh[k + 1] = v_high.y;
|
|
990
992
|
vh[k + 2] = v_high.z;
|
|
@@ -1091,7 +1093,7 @@ class Polyline {
|
|
|
1091
1093
|
this._colors = makeArray(this._colors);
|
|
1092
1094
|
this._orders = makeArray(this._orders);
|
|
1093
1095
|
this._indexes = makeArray(this._indexes);
|
|
1094
|
-
|
|
1096
|
+
this.__appendPoint3v(this._path3v, point3v, this._pathColors, color || this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._colors, this._orders, this._indexes, !skipEllipsoid ? this._renderNode.ellipsoid : null, this._pathLonLat, this._pathLonLatMerc, this._extent);
|
|
1095
1097
|
this._pathLengths[this._path3v.length] += 1;
|
|
1096
1098
|
this._changedBuffers[VERTICES_BUFFER] = true;
|
|
1097
1099
|
this._changedBuffers[COLORS_BUFFER] = true;
|
|
@@ -1188,6 +1190,14 @@ class Polyline {
|
|
|
1188
1190
|
setOpacity(opacity) {
|
|
1189
1191
|
this._opacity = opacity;
|
|
1190
1192
|
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Gets polyline opacity.
|
|
1195
|
+
* @public
|
|
1196
|
+
* @param {number} opacity - Opacity.
|
|
1197
|
+
*/
|
|
1198
|
+
getOpacity() {
|
|
1199
|
+
return this._opacity;
|
|
1200
|
+
}
|
|
1191
1201
|
/**
|
|
1192
1202
|
* Sets Polyline thickness in screen pixels.
|
|
1193
1203
|
* @public
|
|
@@ -1273,12 +1283,12 @@ class Polyline {
|
|
|
1273
1283
|
}
|
|
1274
1284
|
_createData3v(path3v) {
|
|
1275
1285
|
this._clearData();
|
|
1276
|
-
|
|
1286
|
+
this.__appendLineData3v(path3v, this._pathColors, this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._orders, this._indexes, this._renderNode.ellipsoid, this._pathLonLat, this._path3v, this._pathLonLatMerc, this._extent, this._colors);
|
|
1277
1287
|
this._resizePathLengths(0);
|
|
1278
1288
|
}
|
|
1279
1289
|
_createDataLonLat(pathLonlat) {
|
|
1280
1290
|
this._clearData();
|
|
1281
|
-
|
|
1291
|
+
this.__appendLineDataLonLat(pathLonlat, this._pathColors, this._defaultColor, this._closedLine, this._verticesHigh, this._verticesLow, this._orders, this._indexes, this._renderNode.ellipsoid, this._path3v, this._pathLonLat, this._pathLonLatMerc, this._extent, this._colors);
|
|
1282
1292
|
this._resizePathLengths(0);
|
|
1283
1293
|
}
|
|
1284
1294
|
/**
|
|
@@ -1375,13 +1385,22 @@ class Polyline {
|
|
|
1375
1385
|
}
|
|
1376
1386
|
this._changedBuffers[COLORS_BUFFER] = true;
|
|
1377
1387
|
}
|
|
1388
|
+
setPathLonLatFast(pathLonLat, pathColors) {
|
|
1389
|
+
this.setPathLonLat(pathLonLat, pathColors, true);
|
|
1390
|
+
}
|
|
1391
|
+
setPath3vFast(path3v, pathColors) {
|
|
1392
|
+
this.setPath3v(path3v, pathColors, true);
|
|
1393
|
+
}
|
|
1378
1394
|
/**
|
|
1379
1395
|
* Sets polyline geodetic coordinates.
|
|
1380
1396
|
* @public
|
|
1381
1397
|
* @param {SegmentPathLonLat[]} pathLonLat - Polyline path cartesian coordinates.
|
|
1382
1398
|
* @param {Boolean} [forceEqual=false] - OPTIMIZATION FLAG: Makes assigning faster for size equal coordinates array.
|
|
1383
1399
|
*/
|
|
1384
|
-
setPathLonLat(pathLonLat, forceEqual = false) {
|
|
1400
|
+
setPathLonLat(pathLonLat, pathColors, forceEqual = false) {
|
|
1401
|
+
if (pathColors) {
|
|
1402
|
+
this._pathColors = [].concat(pathColors);
|
|
1403
|
+
}
|
|
1385
1404
|
if (this._renderNode && this._renderNode.ellipsoid) {
|
|
1386
1405
|
if (forceEqual) {
|
|
1387
1406
|
this._setEqualPathLonLat(pathLonLat);
|
|
@@ -1399,6 +1418,9 @@ class Polyline {
|
|
|
1399
1418
|
this._pathLonLat = [].concat(pathLonLat);
|
|
1400
1419
|
}
|
|
1401
1420
|
}
|
|
1421
|
+
getSize(index = 0) {
|
|
1422
|
+
return this._path3v[index].length;
|
|
1423
|
+
}
|
|
1402
1424
|
/**
|
|
1403
1425
|
* Sets Polyline cartesian coordinates.
|
|
1404
1426
|
* @public
|
|
@@ -1442,8 +1464,9 @@ class Polyline {
|
|
|
1442
1464
|
gl.uniformMatrix4fv(shu.proj, false, r.activeCamera.getProjectionMatrix());
|
|
1443
1465
|
gl.uniformMatrix4fv(shu.view, false, r.activeCamera.getViewMatrix());
|
|
1444
1466
|
// gl.uniform4fv(shu.color, [this.color.x, this.color.y, this.color.z, this.color.w * this._handler._entityCollection._fadingOpacity]);
|
|
1445
|
-
gl.uniform3fv(shu.
|
|
1446
|
-
gl.uniform3fv(shu.
|
|
1467
|
+
gl.uniform3fv(shu.rtcEyePositionHigh, this._handler._rtcEyePositionHigh);
|
|
1468
|
+
gl.uniform3fv(shu.rtcEyePositionLow, this._handler._rtcEyePositionLow);
|
|
1469
|
+
gl.uniform4fv(shu.visibleSphere, this._visibleSphere);
|
|
1447
1470
|
//gl.uniform2fv(shu.uFloatParams, [(rn as Planet)._planetRadius2 || 0.0, r.activeCamera!._tanViewAngle_hradOneByHeight]);
|
|
1448
1471
|
gl.uniform2fv(shu.viewport, [r.handler.canvas.width, r.handler.canvas.height]);
|
|
1449
1472
|
gl.uniform1f(shu.thickness, this.thickness * 0.5);
|
|
@@ -1474,9 +1497,10 @@ class Polyline {
|
|
|
1474
1497
|
let sh = r.handler.programs.polyline_picking;
|
|
1475
1498
|
let p = sh._program;
|
|
1476
1499
|
let gl = r.handler.gl, sha = p.attributes, shu = p.uniforms;
|
|
1500
|
+
let ec = this._handler._entityCollection;
|
|
1477
1501
|
sh.activate();
|
|
1478
1502
|
gl.disable(gl.CULL_FACE);
|
|
1479
|
-
gl.uniform1f(shu.depthOffset,
|
|
1503
|
+
gl.uniform1f(shu.depthOffset, ec.polygonOffsetUnits);
|
|
1480
1504
|
gl.uniformMatrix4fv(shu.proj, false, r.activeCamera.getProjectionMatrix());
|
|
1481
1505
|
gl.uniformMatrix4fv(shu.view, false, r.activeCamera.getViewMatrix());
|
|
1482
1506
|
gl.uniform4fv(shu.color, [
|
|
@@ -1485,12 +1509,11 @@ class Polyline {
|
|
|
1485
1509
|
this._pickingColor[2],
|
|
1486
1510
|
1.0
|
|
1487
1511
|
]);
|
|
1488
|
-
gl.uniform3fv(shu.
|
|
1489
|
-
gl.uniform3fv(shu.
|
|
1490
|
-
gl.
|
|
1491
|
-
//@todo: replace to the handler property
|
|
1512
|
+
gl.uniform3fv(shu.rtcEyePositionHigh, this._handler._rtcEyePositionHigh);
|
|
1513
|
+
gl.uniform3fv(shu.rtcEyePositionLow, this._handler._rtcEyePositionLow);
|
|
1514
|
+
gl.uniform4fv(shu.visibleSphere, this._visibleSphere);
|
|
1492
1515
|
gl.uniform2fv(shu.viewport, [r.handler.canvas.width, r.handler.canvas.height]);
|
|
1493
|
-
gl.uniform1f(shu.thickness, this.thickness * 0.5);
|
|
1516
|
+
gl.uniform1f(shu.thickness, this.thickness * 0.5 * ec.pickingScale[0]);
|
|
1494
1517
|
let v = this._verticesHighBuffer;
|
|
1495
1518
|
gl.bindBuffer(gl.ARRAY_BUFFER, v);
|
|
1496
1519
|
gl.vertexAttribPointer(sha.prevHigh, v.itemSize, gl.FLOAT, false, 12, 0);
|
|
@@ -1589,6 +1612,23 @@ class Polyline {
|
|
|
1589
1612
|
this._colors = makeArrayTyped(this._colors);
|
|
1590
1613
|
this._colorsBuffer = h.createArrayBuffer(new Float32Array(this._colors), 4, this._colors.length / 4);
|
|
1591
1614
|
}
|
|
1615
|
+
setVisibleSphere(p, r) {
|
|
1616
|
+
if (this._handler) {
|
|
1617
|
+
this._visibleSphere[0] = p.x - this._handler._relativeCenter.x;
|
|
1618
|
+
this._visibleSphere[1] = p.y - this._handler._relativeCenter.y;
|
|
1619
|
+
this._visibleSphere[2] = p.z - this._handler._relativeCenter.z;
|
|
1620
|
+
}
|
|
1621
|
+
this._visibleSphere[3] = r;
|
|
1622
|
+
}
|
|
1623
|
+
updateRTCPosition() {
|
|
1624
|
+
if (this._handler && this._renderNode) {
|
|
1625
|
+
this._visibleSphere[0] = this._visibleSphere[0] - this._handler._relativeCenter.x;
|
|
1626
|
+
this._visibleSphere[1] = this._visibleSphere[1] - this._handler._relativeCenter.y;
|
|
1627
|
+
this._visibleSphere[2] = this._visibleSphere[2] - this._handler._relativeCenter.z;
|
|
1628
|
+
this._setEqualPath3v(this._path3v);
|
|
1629
|
+
}
|
|
1630
|
+
this._changedBuffers[VERTICES_BUFFER] = true;
|
|
1631
|
+
}
|
|
1592
1632
|
}
|
|
1593
1633
|
Polyline.__counter__ = 0;
|
|
1594
1634
|
export { Polyline };
|
|
@@ -2,6 +2,7 @@ import { EntityCollection } from "./EntityCollection";
|
|
|
2
2
|
import { Polyline } from "./Polyline";
|
|
3
3
|
import { Renderer } from "../renderer/Renderer";
|
|
4
4
|
import { RenderNode } from "../scene/RenderNode";
|
|
5
|
+
import { Vec3 } from "../math/Vec3";
|
|
5
6
|
declare class PolylineHandler {
|
|
6
7
|
static __counter__: number;
|
|
7
8
|
protected __id: number;
|
|
@@ -9,6 +10,9 @@ declare class PolylineHandler {
|
|
|
9
10
|
pickingEnabled: boolean;
|
|
10
11
|
protected _renderer: Renderer | null;
|
|
11
12
|
protected _polylines: Polyline[];
|
|
13
|
+
_relativeCenter: Vec3;
|
|
14
|
+
_rtcEyePositionHigh: Float32Array;
|
|
15
|
+
_rtcEyePositionLow: Float32Array;
|
|
12
16
|
constructor(entityCollection: EntityCollection);
|
|
13
17
|
protected _initProgram(): void;
|
|
14
18
|
setRenderNode(renderNode: RenderNode): void;
|
|
@@ -18,5 +22,8 @@ declare class PolylineHandler {
|
|
|
18
22
|
draw(): void;
|
|
19
23
|
drawPicking(): void;
|
|
20
24
|
clear(): void;
|
|
25
|
+
getRTCPosition(pos: Vec3, rtcPositionHigh: Vec3, rtcPositionLow: Vec3): void;
|
|
26
|
+
setRelativeCenter(c: Vec3): void;
|
|
27
|
+
protected _updateRTCEyePosition(): void;
|
|
21
28
|
}
|
|
22
29
|
export { PolylineHandler };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as shaders from '../shaders/polyline';
|
|
2
|
+
import { Vec3 } from "../math/Vec3";
|
|
2
3
|
class PolylineHandler {
|
|
3
4
|
constructor(entityCollection) {
|
|
4
5
|
this.__id = PolylineHandler.__counter__++;
|
|
@@ -6,6 +7,9 @@ class PolylineHandler {
|
|
|
6
7
|
this._renderer = null;
|
|
7
8
|
this._polylines = [];
|
|
8
9
|
this.pickingEnabled = true;
|
|
10
|
+
this._relativeCenter = new Vec3();
|
|
11
|
+
this._rtcEyePositionHigh = new Float32Array([0, 0, 0]);
|
|
12
|
+
this._rtcEyePositionLow = new Float32Array([0, 0, 0]);
|
|
9
13
|
}
|
|
10
14
|
_initProgram() {
|
|
11
15
|
if (this._renderer && this._renderer.handler) {
|
|
@@ -28,9 +32,12 @@ class PolylineHandler {
|
|
|
28
32
|
if (polyline._handlerIndex === -1) {
|
|
29
33
|
polyline._handler = this;
|
|
30
34
|
polyline._handlerIndex = this._polylines.length;
|
|
35
|
+
polyline.__doubleToTwoFloats = this.getRTCPosition.bind(this);
|
|
31
36
|
this._polylines.push(polyline);
|
|
32
|
-
this._entityCollection && this._entityCollection.renderNode
|
|
37
|
+
if (this._entityCollection && this._entityCollection.renderNode) {
|
|
33
38
|
polyline.setRenderNode(this._entityCollection.renderNode);
|
|
39
|
+
polyline.updateRTCPosition();
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
42
|
}
|
|
36
43
|
remove(polyline) {
|
|
@@ -50,6 +57,7 @@ class PolylineHandler {
|
|
|
50
57
|
}
|
|
51
58
|
}
|
|
52
59
|
draw() {
|
|
60
|
+
this._updateRTCEyePosition();
|
|
53
61
|
let i = this._polylines.length;
|
|
54
62
|
while (i--) {
|
|
55
63
|
this._polylines[i].draw();
|
|
@@ -73,6 +81,23 @@ class PolylineHandler {
|
|
|
73
81
|
this._polylines.length = 0;
|
|
74
82
|
this._polylines = [];
|
|
75
83
|
}
|
|
84
|
+
getRTCPosition(pos, rtcPositionHigh, rtcPositionLow) {
|
|
85
|
+
let rtcPosition = pos.sub(this._relativeCenter);
|
|
86
|
+
Vec3.doubleToTwoFloats(rtcPosition, rtcPositionHigh, rtcPositionLow);
|
|
87
|
+
}
|
|
88
|
+
setRelativeCenter(c) {
|
|
89
|
+
this._relativeCenter.copy(c);
|
|
90
|
+
for (let i = 0; i < this._polylines.length; i++) {
|
|
91
|
+
this._polylines[i].updateRTCPosition();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
_updateRTCEyePosition() {
|
|
95
|
+
let r = this._renderer;
|
|
96
|
+
if (r.activeCamera.isFirstPass) {
|
|
97
|
+
let rtcEyePosition = r.activeCamera.eye.sub(this._relativeCenter);
|
|
98
|
+
Vec3.doubleToTwoFloat32Array(rtcEyePosition, this._rtcEyePositionHigh, this._rtcEyePositionLow);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
76
101
|
}
|
|
77
102
|
PolylineHandler.__counter__ = 0;
|
|
78
103
|
export { PolylineHandler };
|
package/lib/js/index.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ import { Control } from './control/Control';
|
|
|
30
30
|
export * from './entity/index';
|
|
31
31
|
export * from './layer/index';
|
|
32
32
|
import { EmptyTerrain, GlobusTerrain, RgbTerrain, BilTerrain, GlobusRgbTerrain } from './terrain/index';
|
|
33
|
-
|
|
33
|
+
import { MoveAxisEntity } from "./control/geoObjectEditor/MoveAxisEntity";
|
|
34
|
+
export { bv, jd, math, mercator, utils, input, control, scene, quadTreeStrategyType, wgs84, moon, mars, terrain, layer, webgl, Framebuffer, EmptyTerrain, GlobusTerrain, RgbTerrain, GlobusRgbTerrain, BilTerrain, Control, Camera, Ellipsoid, Planet, PlanetCamera, LightSource, Program, Handler, Multisample, Renderer, Clock, Events, Extent, LonLat, RenderNode, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, Geoid, Popup, QuadTreeStrategy, EquiQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, Object3d, MoveAxisEntity, };
|
package/lib/js/index.js
CHANGED
|
@@ -30,4 +30,5 @@ import { Control } from './control/Control';
|
|
|
30
30
|
export * from './entity/index';
|
|
31
31
|
export * from './layer/index';
|
|
32
32
|
import { EmptyTerrain, GlobusTerrain, RgbTerrain, BilTerrain, GlobusRgbTerrain } from './terrain/index';
|
|
33
|
-
|
|
33
|
+
import { MoveAxisEntity } from "./control/geoObjectEditor/MoveAxisEntity";
|
|
34
|
+
export { bv, jd, math, mercator, utils, input, control, scene, quadTreeStrategyType, wgs84, moon, mars, terrain, layer, webgl, Framebuffer, EmptyTerrain, GlobusTerrain, RgbTerrain, GlobusRgbTerrain, BilTerrain, Control, Camera, Ellipsoid, Planet, PlanetCamera, LightSource, Program, Handler, Multisample, Renderer, Clock, Events, Extent, LonLat, RenderNode, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, Geoid, Popup, QuadTreeStrategy, EquiQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, Object3d, MoveAxisEntity, };
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
function _checkTouchPad(e) {
|
|
2
|
+
//@ts-ignore
|
|
3
|
+
if (e.deltaMode !== 0) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
//@ts-ignore
|
|
7
|
+
return Math.abs(e.deltaY) < 50;
|
|
8
|
+
//@ts-ignore
|
|
9
|
+
//return e.wheelDeltaY ? e.wheelDeltaY === -3 * e.deltaY : e.deltaMode === 0
|
|
10
|
+
}
|
|
1
11
|
class MouseHandler {
|
|
2
12
|
constructor(htmlObject) {
|
|
3
13
|
this._htmlObject = htmlObject;
|
|
@@ -13,11 +23,12 @@ class MouseHandler {
|
|
|
13
23
|
// callback.call(sender, event);
|
|
14
24
|
// event.preventDefault();
|
|
15
25
|
// }, false);
|
|
16
|
-
this._htmlObject.addEventListener('wheel',
|
|
26
|
+
this._htmlObject.addEventListener('wheel', (event) => {
|
|
17
27
|
let delta = event.deltaY || event.detail || event.wheelDelta || 0;
|
|
18
28
|
if (event.wheelDelta == undefined) {
|
|
19
29
|
event.wheelDelta = delta * (-120);
|
|
20
30
|
}
|
|
31
|
+
event.isTouchPad = _checkTouchPad(event);
|
|
21
32
|
callback.call(sender, event);
|
|
22
33
|
event.preventDefault();
|
|
23
34
|
}, false);
|
package/lib/js/layer/Bing.js
CHANGED
|
@@ -31,8 +31,8 @@ export class Bing extends XYZ {
|
|
|
31
31
|
});
|
|
32
32
|
},
|
|
33
33
|
specular: [0.00063, 0.00055, 0.00032],
|
|
34
|
-
ambient:
|
|
35
|
-
diffuse:
|
|
34
|
+
ambient: [0.35, 0.35, 0.35],
|
|
35
|
+
diffuse: [1.5, 1.5, 1.5],
|
|
36
36
|
shininess: 20,
|
|
37
37
|
nightTextureCoefficient: 2.7,
|
|
38
38
|
...options
|
package/lib/js/layer/Vector.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface IVectorParams extends ILayerParams {
|
|
|
19
19
|
scaleByDistance?: NumberArray3;
|
|
20
20
|
labelMaxLetters?: number;
|
|
21
21
|
useLighting?: boolean;
|
|
22
|
+
depthOrder?: number;
|
|
22
23
|
}
|
|
23
24
|
type VectorEventsList = [
|
|
24
25
|
"draw",
|
|
@@ -61,6 +62,7 @@ export type VectorEventsType = EventsHandler<VectorEventsList> & EventsHandler<L
|
|
|
61
62
|
*/
|
|
62
63
|
declare class Vector extends Layer {
|
|
63
64
|
events: VectorEventsType;
|
|
65
|
+
protected _depthOrder: number;
|
|
64
66
|
/**
|
|
65
67
|
* Entities collection.
|
|
66
68
|
* @protected
|
|
@@ -113,6 +115,8 @@ declare class Vector extends Layer {
|
|
|
113
115
|
protected _labelMaxLetters: number;
|
|
114
116
|
protected _useLighting: boolean;
|
|
115
117
|
constructor(name?: string | null, options?: IVectorParams);
|
|
118
|
+
get depthOrder(): number;
|
|
119
|
+
set depthOrder(d: number);
|
|
116
120
|
get useLighting(): boolean;
|
|
117
121
|
set useLighting(f: boolean);
|
|
118
122
|
get labelMaxLetters(): number;
|
package/lib/js/layer/Vector.js
CHANGED
|
@@ -103,6 +103,16 @@ class Vector extends Layer {
|
|
|
103
103
|
this.setEntities(this._entities);
|
|
104
104
|
this.polygonOffsetUnits = options.polygonOffsetUnits != undefined ? options.polygonOffsetUnits : 0.0;
|
|
105
105
|
this.pickingEnabled = this._pickingEnabled;
|
|
106
|
+
this._depthOrder = options.depthOrder || 0;
|
|
107
|
+
}
|
|
108
|
+
get depthOrder() {
|
|
109
|
+
return this._depthOrder;
|
|
110
|
+
}
|
|
111
|
+
set depthOrder(d) {
|
|
112
|
+
if (d !== this._depthOrder) {
|
|
113
|
+
this._depthOrder = d;
|
|
114
|
+
this._planet && this._planet.updateVisibleLayers();
|
|
115
|
+
}
|
|
106
116
|
}
|
|
107
117
|
get useLighting() {
|
|
108
118
|
return this._useLighting;
|
|
@@ -135,6 +145,9 @@ class Vector extends Layer {
|
|
|
135
145
|
this._polylineEntityCollection.addTo(planet, true);
|
|
136
146
|
this._stripEntityCollection.addTo(planet, true);
|
|
137
147
|
this._geoObjectEntityCollection.addTo(planet, true);
|
|
148
|
+
this._polylineEntityCollection._layer = this;
|
|
149
|
+
this._stripEntityCollection._layer = this;
|
|
150
|
+
this._geoObjectEntityCollection._layer = this;
|
|
138
151
|
this.setEntities(this._entities);
|
|
139
152
|
}
|
|
140
153
|
}
|
|
@@ -143,6 +156,9 @@ class Vector extends Layer {
|
|
|
143
156
|
this._polylineEntityCollection.remove();
|
|
144
157
|
this._stripEntityCollection.remove();
|
|
145
158
|
this._geoObjectEntityCollection.remove();
|
|
159
|
+
this._polylineEntityCollection._layer = undefined;
|
|
160
|
+
this._stripEntityCollection._layer = undefined;
|
|
161
|
+
this._geoObjectEntityCollection._layer = undefined;
|
|
146
162
|
return this;
|
|
147
163
|
}
|
|
148
164
|
/**
|