@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.
- package/package.json +18 -20
- package/src/og/Clock.js +11 -11
- package/src/og/Deferred.js +1 -1
- package/src/og/Events.js +9 -7
- package/src/og/Extent.js +117 -72
- package/src/og/Globe.js +35 -22
- package/src/og/ImageCanvas.js +24 -18
- package/src/og/Lock.js +2 -2
- package/src/og/LonLat.js +40 -37
- package/src/og/Popup.js +21 -15
- package/src/og/QueueArray.js +7 -3
- package/src/og/Rectangle.js +11 -6
- package/src/og/Stack.js +8 -5
- package/src/og/ajax.js +21 -33
- package/src/og/astro/astro.js +5 -5
- package/src/og/astro/earth.js +23 -17
- package/src/og/astro/jd.js +44 -39
- package/src/og/astro/orbit.js +20 -18
- package/src/og/astro/rotation.js +17 -8
- package/src/og/bv/Box.js +7 -3
- package/src/og/bv/Sphere.js +17 -9
- package/src/og/camera/Camera.js +137 -86
- package/src/og/camera/Frustum.js +30 -19
- package/src/og/camera/PlanetCamera.js +30 -26
- package/src/og/control/CompassButton.js +8 -2
- package/src/og/control/Control.js +13 -11
- package/src/og/control/DebugInfo.js +4 -1
- package/src/og/control/EarthCoordinates.js +62 -41
- package/src/og/control/EarthNavigation.js +20 -22
- package/src/og/control/GeoImageDragControl.js +1 -1
- package/src/og/control/KeyboardNavigation.js +12 -12
- package/src/og/control/LayerSwitcher.js +24 -23
- package/src/og/control/Lighting.js +1 -1
- package/src/og/control/MouseNavigation.js +1 -1
- package/src/og/control/ScaleControl.js +1 -1
- package/src/og/control/SegmentBoundVisualization.js +8 -9
- package/src/og/control/ShowFps.js +15 -10
- package/src/og/control/SimpleNavigation.js +8 -10
- package/src/og/control/Sun.js +25 -15
- package/src/og/control/ToggleWireframe.js +5 -5
- package/src/og/control/TouchNavigation.js +58 -45
- package/src/og/control/ZoomControl.js +41 -25
- package/src/og/control/index.js +4 -0
- package/src/og/ellipsoid/Ellipsoid.js +181 -85
- package/src/og/ellipsoid/wgs84.js +4 -4
- package/src/og/entity/BaseBillboard.js +97 -44
- package/src/og/entity/Billboard.js +15 -11
- package/src/og/entity/BillboardHandler.js +314 -64
- package/src/og/entity/Entity.js +106 -74
- package/src/og/entity/EntityCollection.js +72 -49
- package/src/og/entity/GeoObject.js +228 -0
- package/src/og/entity/GeoObjectHandler.js +910 -0
- package/src/og/entity/Geometry.js +29 -26
- package/src/og/entity/GeometryHandler.js +598 -126
- package/src/og/entity/Label.js +74 -40
- package/src/og/entity/LabelHandler.js +47 -246
- package/src/og/entity/LabelWorker.js +213 -0
- package/src/og/entity/Object3d.js +504 -0
- package/src/og/entity/PointCloud.js +81 -33
- package/src/og/entity/PointCloudHandler.js +9 -9
- package/src/og/entity/Polyline.js +39 -39
- package/src/og/entity/Ray.js +61 -28
- package/src/og/entity/ShapeHandler.js +1 -1
- package/src/og/entity/Strip.js +77 -48
- package/src/og/entity/StripHandler.js +27 -27
- package/src/og/entity/index.js +8 -16
- package/src/og/input/KeyboardHandler.js +107 -104
- package/src/og/input/MouseHandler.js +81 -78
- package/src/og/input/TouchHandler.js +55 -51
- package/src/og/layer/BaseGeoImage.js +61 -30
- package/src/og/layer/CanvasTiles.js +26 -24
- package/src/og/layer/GeoImage.js +10 -10
- package/src/og/layer/GeoTexture2d.js +1 -1
- package/src/og/layer/GeoVideo.js +3 -3
- package/src/og/layer/KML.js +66 -40
- package/src/og/layer/Layer.js +27 -17
- package/src/og/layer/Material.js +93 -61
- package/src/og/layer/Vector.js +118 -72
- package/src/og/layer/WMS.js +36 -19
- package/src/og/layer/XYZ.js +55 -48
- package/src/og/light/LightSource.js +47 -40
- package/src/og/math/Line2.js +24 -24
- package/src/og/math/Line3.js +103 -102
- package/src/og/math/Mat3.js +134 -121
- package/src/og/math/Mat4.js +603 -459
- package/src/og/math/Plane.js +21 -20
- package/src/og/math/Quat.js +980 -927
- package/src/og/math/Ray.js +195 -187
- package/src/og/math/Vec2.js +127 -117
- package/src/og/math/Vec3.js +206 -176
- package/src/og/math/Vec4.js +49 -53
- package/src/og/math/coder.js +18 -18
- package/src/og/math.js +12 -12
- package/src/og/mercator.js +11 -11
- package/src/og/proj/EPSG3857.js +4 -4
- package/src/og/proj/EPSG4326.js +4 -4
- package/src/og/proj/Proj.js +31 -31
- package/src/og/quadTree/EntityCollectionNode.js +310 -300
- package/src/og/quadTree/Node.js +1008 -993
- package/src/og/renderer/Renderer.js +768 -747
- package/src/og/renderer/RendererEvents.js +9 -6
- package/src/og/scene/Axes.js +1 -1
- package/src/og/scene/BaseNode.js +8 -9
- package/src/og/scene/Planet.js +115 -87
- package/src/og/scene/RenderNode.js +29 -22
- package/src/og/scene/SkyBox.js +1 -1
- package/src/og/segment/Segment.js +1886 -1878
- package/src/og/segment/SegmentLonLat.js +298 -268
- package/src/og/segment/segmentHelper.js +11 -11
- package/src/og/shaders/bloom.js +1 -1
- package/src/og/shaders/blur.js +2 -2
- package/src/og/shaders/depth.js +1 -1
- package/src/og/shaders/geoObject.js +211 -0
- package/src/og/shaders/label.js +1 -1
- package/src/og/shaders/lumFilter.js +1 -1
- package/src/og/shaders/pointCloud.js +42 -42
- package/src/og/shaders/screenFrame.js +1 -1
- package/src/og/shaders/shape.js +15 -21
- package/src/og/shaders/skybox.js +37 -37
- package/src/og/shaders/toneMapping.js +1 -1
- package/src/og/shapes/BaseShape.js +129 -57
- package/src/og/shapes/Icosphere.js +30 -15
- package/src/og/shapes/Sphere.js +13 -16
- package/src/og/terrain/BilTerrain.js +2 -1
- package/src/og/terrain/EmptyTerrain.js +2 -2
- package/src/og/terrain/Geoid.js +2 -2
- package/src/og/terrain/GlobusTerrain.js +10 -10
- package/src/og/terrain/MapboxTerrain.js +1 -1
- package/src/og/utils/GeoImageCreator.js +9 -9
- package/src/og/utils/Loader.js +6 -6
- package/src/og/utils/NormalMapCreator.js +13 -13
- package/src/og/utils/TerrainWorker.js +1 -1
- package/src/og/utils/TextureAtlas.js +20 -22
- package/src/og/utils/VectorTileCreator.js +5 -5
- package/src/og/utils/earcut.js +1 -1
- package/src/og/utils/shared.js +15 -15
- package/src/og/webgl/Framebuffer.js +101 -53
- package/src/og/webgl/Handler.js +125 -85
- package/src/og/webgl/Multisample.js +55 -27
- package/src/og/webgl/Program.js +80 -35
- package/src/og/webgl/ProgramController.js +27 -23
- package/src/og/webgl/callbacks.js +8 -8
- package/types/Clock.d.ts +6 -2
- package/types/Deferred.d.ts +1 -1
- package/types/Events.d.ts +8 -4
- package/types/Extent.d.ts +37 -33
- package/types/Globe.d.ts +15 -13
- package/types/ImageCanvas.d.ts +5 -3
- package/types/LonLat.d.ts +24 -24
- package/types/Popup.d.ts +4 -0
- package/types/QueueArray.d.ts +6 -2
- package/types/Rectangle.d.ts +10 -4
- package/types/Stack.d.ts +4 -0
- package/types/ajax.d.ts +1 -1
- package/types/astro/earth.d.ts +3 -2
- package/types/bv/Box.d.ts +10 -5
- package/types/bv/Sphere.d.ts +13 -7
- package/types/camera/Camera.d.ts +90 -81
- package/types/camera/Frustum.d.ts +26 -22
- package/types/camera/PlanetCamera.d.ts +49 -53
- package/types/control/CompassButton.d.ts +4 -4
- package/types/control/Control.d.ts +7 -4
- package/types/control/DebugInfo.d.ts +3 -4
- package/types/control/EarthCoordinates.d.ts +6 -6
- package/types/control/EarthNavigation.d.ts +42 -0
- package/types/control/KeyboardNavigation.d.ts +3 -4
- package/types/control/LayerSwitcher.d.ts +3 -5
- package/types/control/Lighting.d.ts +3 -3
- package/types/control/MouseNavigation.d.ts +47 -0
- package/types/control/ScaleControl.d.ts +3 -3
- package/types/control/ShowFps.d.ts +3 -4
- package/types/control/SimpleNavigation.d.ts +3 -6
- package/types/control/Sun.d.ts +8 -10
- package/types/control/ToggleWireframe.d.ts +3 -3
- package/types/control/TouchNavigation.d.ts +48 -0
- package/types/control/ZoomControl.d.ts +3 -4
- package/types/control/index.d.ts +3 -1
- package/types/ellipsoid/Ellipsoid.d.ts +47 -43
- package/types/ellipsoid/wgs84.d.ts +3 -2
- package/types/entity/BaseBillboard.d.ts +41 -34
- package/types/entity/Billboard.d.ts +7 -7
- package/types/entity/BillboardHandler.d.ts +4 -0
- package/types/entity/Entity.d.ts +101 -83
- package/types/entity/EntityCollection.d.ts +57 -43
- package/types/entity/GeoObject.d.ts +111 -0
- package/types/entity/GeoObjectHandler.d.ts +77 -0
- package/types/entity/Geometry.d.ts +9 -7
- package/types/entity/GeometryHandler.d.ts +2 -2
- package/types/entity/Label.d.ts +24 -29
- package/types/entity/LabelHandler.d.ts +9 -2
- package/types/entity/LabelWorker.d.ts +9 -0
- package/types/entity/PointCloud.d.ts +8 -8
- package/types/entity/PointCloudHandler.d.ts +3 -3
- package/types/entity/Polyline.d.ts +58 -55
- package/types/entity/Ray.d.ts +19 -18
- package/types/entity/Strip.d.ts +8 -7
- package/types/entity/StripHandler.d.ts +3 -3
- package/types/entity/index.d.ts +7 -7
- package/types/input/KeyboardHandler.d.ts +10 -0
- package/types/input/MouseHandler.d.ts +5 -0
- package/types/input/TouchHandler.d.ts +5 -0
- package/types/layer/BaseGeoImage.d.ts +23 -35
- package/types/layer/CanvasTiles.d.ts +15 -22
- package/types/layer/GeoImage.d.ts +5 -18
- package/types/layer/GeoVideo.d.ts +5 -30
- package/types/layer/KML.d.ts +20 -15
- package/types/layer/Layer.d.ts +326 -0
- package/types/layer/Material.d.ts +45 -0
- package/types/layer/Vector.d.ts +208 -0
- package/types/layer/WMS.d.ts +4 -7
- package/types/layer/XYZ.d.ts +19 -25
- package/types/light/LightSource.d.ts +54 -53
- package/types/math/Line2.d.ts +11 -0
- package/types/math/Line3.d.ts +10 -0
- package/types/math/Mat3.d.ts +30 -18
- package/types/math/Mat4.d.ts +71 -52
- package/types/math/Plane.d.ts +5 -4
- package/types/math/Quat.d.ts +379 -0
- package/types/math/Ray.d.ts +82 -0
- package/types/math/Vec2.d.ts +102 -101
- package/types/math/Vec3.d.ts +143 -142
- package/types/math/Vec4.d.ts +40 -39
- package/types/math/coder.d.ts +12 -11
- package/types/math.d.ts +8 -8
- package/types/mercator.d.ts +3 -3
- package/types/proj/EPSG3857.d.ts +3 -2
- package/types/proj/EPSG4326.d.ts +3 -2
- package/types/proj/Proj.d.ts +42 -0
- package/types/quadTree/EntityCollectionNode.d.ts +34 -0
- package/types/quadTree/Node.d.ts +61 -0
- package/types/renderer/Renderer.d.ts +300 -0
- package/types/renderer/RendererEvents.d.ts +10 -7
- package/types/scene/BaseNode.d.ts +9 -9
- package/types/scene/Planet.d.ts +131 -126
- package/types/scene/RenderNode.d.ts +22 -23
- package/types/segment/Segment.d.ts +279 -0
- package/types/segment/SegmentLonLat.d.ts +16 -0
- package/types/shaders/geoObject.d.ts +3 -0
- package/types/shapes/BaseShape.d.ts +43 -40
- package/types/shapes/Sphere.d.ts +7 -7
- package/types/terrain/BilTerrain.d.ts +0 -1
- package/types/terrain/EmptyTerrain.d.ts +4 -4
- package/types/terrain/GlobusTerrain.d.ts +17 -54
- package/types/terrain/MapboxTerrain.d.ts +0 -1
- package/types/utils/GeoImageCreator.d.ts +3 -2
- package/types/utils/TextureAtlas.d.ts +8 -8
- package/types/utils/shared.d.ts +25 -24
- package/types/webgl/Framebuffer.d.ts +5 -5
- package/types/webgl/Handler.d.ts +68 -43
- package/types/webgl/Multisample.d.ts +5 -5
- package/types/webgl/Program.d.ts +8 -2
- package/types/webgl/ProgramController.d.ts +18 -13
- package/src/og/inherits.js +0 -8
- package/src/og/utils/polylabel.js +0 -176
- package/types/inherits.d.ts +0 -4
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
export const MAX_NORMAL_ZOOM: 7;
|
|
2
|
+
/**
|
|
3
|
+
* Planet segment Web Mercator tile class that stored and rendered with quad tree.
|
|
4
|
+
* @class
|
|
5
|
+
* @param {quadTree.Node} node - Segment node.
|
|
6
|
+
* @param {Planet} planet - Current planet scene.
|
|
7
|
+
* @param {Number} tileZoom - Zoom index.
|
|
8
|
+
* @param {Extent} extent - Segment extent.
|
|
9
|
+
*/
|
|
10
|
+
export class Segment {
|
|
11
|
+
/**
|
|
12
|
+
* @param {quadTree.Node} node - Segment node.
|
|
13
|
+
* @param {Planet} planet - Current planet scene.
|
|
14
|
+
* @param {number} tileZoom - Zoom index.
|
|
15
|
+
* @param {Extent} extent - Segment extent.
|
|
16
|
+
*/
|
|
17
|
+
constructor(node: quadTree.Node, planet: Planet, tileZoom: number, extent: Extent);
|
|
18
|
+
isPole: boolean;
|
|
19
|
+
_tileGroup: number;
|
|
20
|
+
_projection: import("../proj/Proj.js").Proj;
|
|
21
|
+
/**
|
|
22
|
+
* Quad tree node of the segment.
|
|
23
|
+
* @type {quadTree.Node}
|
|
24
|
+
*/
|
|
25
|
+
node: quadTree.Node;
|
|
26
|
+
/**
|
|
27
|
+
* Planet pointer.
|
|
28
|
+
* @type {Planet}
|
|
29
|
+
*/
|
|
30
|
+
planet: Planet;
|
|
31
|
+
/**
|
|
32
|
+
* WebGl handler pointer.
|
|
33
|
+
* @type {Handler}
|
|
34
|
+
*/
|
|
35
|
+
handler: Handler;
|
|
36
|
+
/**
|
|
37
|
+
* Segment bounding sphere
|
|
38
|
+
* @type {Sphere}
|
|
39
|
+
*/
|
|
40
|
+
bsphere: Sphere;
|
|
41
|
+
_plainRadius: number;
|
|
42
|
+
/**
|
|
43
|
+
* Segment bounding box.
|
|
44
|
+
* @type {Box}
|
|
45
|
+
*/
|
|
46
|
+
bbox: Box;
|
|
47
|
+
_swNorm: any;
|
|
48
|
+
_nwNorm: any;
|
|
49
|
+
_seNorm: any;
|
|
50
|
+
_neNorm: any;
|
|
51
|
+
/**
|
|
52
|
+
* Geographical extent.
|
|
53
|
+
* @type {Extent}
|
|
54
|
+
*/
|
|
55
|
+
_extent: Extent;
|
|
56
|
+
_extentLonLat: Extent;
|
|
57
|
+
/**
|
|
58
|
+
* Vertices grid size.
|
|
59
|
+
* @type {number}
|
|
60
|
+
*/
|
|
61
|
+
gridSize: number;
|
|
62
|
+
fileGridSize: number;
|
|
63
|
+
/**
|
|
64
|
+
* Tile zoom index.
|
|
65
|
+
* @type {number}
|
|
66
|
+
*/
|
|
67
|
+
tileZoom: number;
|
|
68
|
+
/**
|
|
69
|
+
* Horizontal tile index.
|
|
70
|
+
* @type {number}
|
|
71
|
+
*/
|
|
72
|
+
tileX: number;
|
|
73
|
+
tileXE: number;
|
|
74
|
+
tileXW: number;
|
|
75
|
+
tileYN: number;
|
|
76
|
+
tileYS: number;
|
|
77
|
+
/**
|
|
78
|
+
* Vertical tile index.
|
|
79
|
+
* @type {number}
|
|
80
|
+
*/
|
|
81
|
+
tileY: number;
|
|
82
|
+
tileIndex: string;
|
|
83
|
+
/**
|
|
84
|
+
* Texture materials array.
|
|
85
|
+
* @type {Array.<planetSegment.Material>}
|
|
86
|
+
*/
|
|
87
|
+
materials: Array<planetSegment.Material>;
|
|
88
|
+
/**
|
|
89
|
+
* Plain segment vertices was created.
|
|
90
|
+
* @type {boolean}
|
|
91
|
+
*/
|
|
92
|
+
plainReady: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Segment is ready to create plain vertices.
|
|
95
|
+
* @type {boolean}
|
|
96
|
+
*/
|
|
97
|
+
initialized: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Normal map is allready made.
|
|
100
|
+
* @type {boolean}
|
|
101
|
+
*/
|
|
102
|
+
normalMapReady: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Parent normal map is made allready(optimization parameter).
|
|
105
|
+
* @type {boolean}
|
|
106
|
+
*/
|
|
107
|
+
parentNormalMapReady: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Terrain is allready applied flag.
|
|
110
|
+
* @type {boolean}
|
|
111
|
+
*/
|
|
112
|
+
terrainReady: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Terrain is loading now flag.
|
|
115
|
+
* @type {boolean}
|
|
116
|
+
*/
|
|
117
|
+
terrainIsLoading: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Terrain existing flag.
|
|
120
|
+
* @type {boolean}
|
|
121
|
+
*/
|
|
122
|
+
terrainExists: boolean;
|
|
123
|
+
plainVertices: any;
|
|
124
|
+
plainVerticesHigh: any;
|
|
125
|
+
plainVerticesLow: any;
|
|
126
|
+
plainNormals: any;
|
|
127
|
+
terrainVertices: any;
|
|
128
|
+
terrainVerticesHigh: any;
|
|
129
|
+
terrainVerticesLow: any;
|
|
130
|
+
noDataVertices: any;
|
|
131
|
+
tempVertices: any;
|
|
132
|
+
tempVerticesHigh: any;
|
|
133
|
+
tempVerticesLow: any;
|
|
134
|
+
normalMapTexture: any;
|
|
135
|
+
normalMapTextureBias: Float32Array;
|
|
136
|
+
normalMapVertices: any;
|
|
137
|
+
normalMapVerticesHigh: any;
|
|
138
|
+
normalMapVerticesLow: any;
|
|
139
|
+
normalMapNormals: any;
|
|
140
|
+
vertexNormalBuffer: any;
|
|
141
|
+
vertexPositionBuffer: any;
|
|
142
|
+
vertexPositionBufferHigh: any;
|
|
143
|
+
vertexPositionBufferLow: any;
|
|
144
|
+
vertexTextureCoordBuffer: any;
|
|
145
|
+
_globalTextureCoordinates: Float32Array;
|
|
146
|
+
_inTheQueue: boolean;
|
|
147
|
+
_appliedNeighborsZoom: number[];
|
|
148
|
+
_renderingSlices: any[];
|
|
149
|
+
_indexBuffer: any;
|
|
150
|
+
readyToEngage: boolean;
|
|
151
|
+
plainProcessing: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Returns that segment good for rendering with camera by current lod ratio.
|
|
154
|
+
* @public
|
|
155
|
+
* @param {Camera} camera - Camera object.
|
|
156
|
+
* @returns {boolean} -
|
|
157
|
+
*/
|
|
158
|
+
public acceptForRendering(camera: Camera): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Returns entity terrain point.
|
|
161
|
+
* @public
|
|
162
|
+
* @param {Entity} entity - Entity.
|
|
163
|
+
* @param {Vec3} res - Point coordinates.
|
|
164
|
+
* @param {Vec3} [normal] - Terrain point normal.
|
|
165
|
+
* @returns {Vec3} -
|
|
166
|
+
*/
|
|
167
|
+
public getEntityTerrainPoint(entity: Entity, res: Vec3, normal?: Vec3): Vec3;
|
|
168
|
+
isEntityInside(e: any): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Returns distance from object to terrain coordinates and terrain point that calculates out in the res parameter.
|
|
171
|
+
* @public
|
|
172
|
+
* @param {Vec3} xyz - Cartesian object position.
|
|
173
|
+
* @param {LonLat} insideSegmentPosition - Geodetic object position.
|
|
174
|
+
* @param {Vec3} [res] - Result cartesian coordiantes on the terrain.
|
|
175
|
+
* @param {Vec3} [normal] - Terrain point normal.
|
|
176
|
+
* @returns {number} -
|
|
177
|
+
*/
|
|
178
|
+
public getTerrainPoint(xyz: Vec3, insideSegmentPosition: LonLat, res?: Vec3, normal?: Vec3): number;
|
|
179
|
+
/**
|
|
180
|
+
* Project wgs86 to segment native projection.
|
|
181
|
+
* @public
|
|
182
|
+
* @param {LonLat} lonlat - Coordinates to project.
|
|
183
|
+
* @returns {LonLat} -
|
|
184
|
+
*/
|
|
185
|
+
public projectNative(lonlat: LonLat): LonLat;
|
|
186
|
+
/**
|
|
187
|
+
*
|
|
188
|
+
* @param {boolean} forceLoading
|
|
189
|
+
*/
|
|
190
|
+
loadTerrain(forceLoading: boolean): void;
|
|
191
|
+
/**
|
|
192
|
+
* Terrain obtained from server.
|
|
193
|
+
* @param {Float32Array} elevations - Elevation data.
|
|
194
|
+
*/
|
|
195
|
+
elevationsExists(elevations: Float32Array): void;
|
|
196
|
+
_checkEqualization(neighborSide: any, neigborNode: any): boolean;
|
|
197
|
+
equalize(): void;
|
|
198
|
+
engage(): void;
|
|
199
|
+
_plainSegmentWorkerCallback(data: any): void;
|
|
200
|
+
_terrainWorkerCallback(data: any): void;
|
|
201
|
+
normalMapTexturePtr: any;
|
|
202
|
+
/**
|
|
203
|
+
* Terrain is not obtained or not exists on the server.
|
|
204
|
+
*/
|
|
205
|
+
elevationsNotExists(): void;
|
|
206
|
+
_normalMapEdgeEqualize(side: any): void;
|
|
207
|
+
applyTerrain(elevations: any): void;
|
|
208
|
+
/**
|
|
209
|
+
* Delete segment gl buffers.
|
|
210
|
+
*/
|
|
211
|
+
deleteBuffers(): void;
|
|
212
|
+
/**
|
|
213
|
+
* Delete materials.
|
|
214
|
+
*/
|
|
215
|
+
deleteMaterials(): void;
|
|
216
|
+
/**
|
|
217
|
+
* Delete elevation data.
|
|
218
|
+
*/
|
|
219
|
+
deleteElevations(): void;
|
|
220
|
+
/**
|
|
221
|
+
* Clear but not destroy segment data.
|
|
222
|
+
*/
|
|
223
|
+
clearSegment(): void;
|
|
224
|
+
/**
|
|
225
|
+
* Removes cache records.
|
|
226
|
+
*/
|
|
227
|
+
_freeCache(): void;
|
|
228
|
+
/**
|
|
229
|
+
* Clear and destroy all segment data.
|
|
230
|
+
*/
|
|
231
|
+
destroySegment(): void;
|
|
232
|
+
_tileOffsetArr: any;
|
|
233
|
+
_visibleExtentOffsetArr: any;
|
|
234
|
+
_setExtentLonLat(): void;
|
|
235
|
+
/**
|
|
236
|
+
* Creates bound volumes by segment geographical extent.
|
|
237
|
+
*/
|
|
238
|
+
createBoundsByExtent(): void;
|
|
239
|
+
createBoundsByParent(): void;
|
|
240
|
+
setBoundingSphere(x: any, y: any, z: any, v: any): void;
|
|
241
|
+
setBoundingVolume(xmin: any, ymin: any, zmin: any, xmax: any, ymax: any, zmax: any): void;
|
|
242
|
+
setBoundingVolume3v(vmin: any, vmax: any): void;
|
|
243
|
+
setBoundingVolumeArr(bounds: any): void;
|
|
244
|
+
createCoordsBuffers(verticesHigh: any, verticesLow: any, gridSize: any): void;
|
|
245
|
+
_addViewExtent(): void;
|
|
246
|
+
_assignTileIndexes(): void;
|
|
247
|
+
initialize(): void;
|
|
248
|
+
_assignGlobalTextureCoordinates(): void;
|
|
249
|
+
createPlainSegmentAsync(): void;
|
|
250
|
+
createPlainSegment(): void;
|
|
251
|
+
_createPlainVertices(): void;
|
|
252
|
+
/**
|
|
253
|
+
* Gets specific layer material.
|
|
254
|
+
* @public
|
|
255
|
+
* @param {Layer} layer - Layer object.
|
|
256
|
+
* @returns {planetSegment.Material} - Segment material.
|
|
257
|
+
*/
|
|
258
|
+
public getMaterialByLayer(layer: Layer): planetSegment.Material;
|
|
259
|
+
_getLayerExtentOffset(layer: any): number[];
|
|
260
|
+
screenRendering(sh: any, layerSlice: any, sliceIndex: any, defaultTexture: any, isOverlay: any): void;
|
|
261
|
+
heightPickingRendering(sh: any, layerSlice: any, sliceIndex: any, defaultTexture: any, isOverlay: any): void;
|
|
262
|
+
colorPickingRendering(sh: any, layerSlice: any, sliceIndex: any, defaultTexture: any, isOverlay: any): void;
|
|
263
|
+
depthRendering(sh: any, layerSlice: any, sliceIndex: any, defaultTexture: any, isOverlay: any): void;
|
|
264
|
+
_getIndexBuffer(): any;
|
|
265
|
+
_collectVisibleNodes(): void;
|
|
266
|
+
layerOverlap(layer: any): boolean;
|
|
267
|
+
getDefaultTexture(): any;
|
|
268
|
+
getExtentLonLat(): Extent;
|
|
269
|
+
getExtentMerc(): Extent;
|
|
270
|
+
getExtent(): Extent;
|
|
271
|
+
getNodeState(): any;
|
|
272
|
+
getNeighborSide(b: any): 0 | 1 | 2 | 3 | -1;
|
|
273
|
+
}
|
|
274
|
+
import { Sphere } from "../bv/Sphere.js";
|
|
275
|
+
import { Box } from "../bv/Box.js";
|
|
276
|
+
import { Extent } from "../Extent.js";
|
|
277
|
+
import { Vec3 } from "../math/Vec3.js";
|
|
278
|
+
import { LonLat } from "../LonLat.js";
|
|
279
|
+
import { Layer } from "../layer/Layer.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Planet segment Web Mercator tile class that stored and rendered with quad tree.
|
|
3
|
+
* @class
|
|
4
|
+
* @extends {Segment}
|
|
5
|
+
* @param {quadNode.Node} node - Quad tree segment node.
|
|
6
|
+
* @param {Planet} planet - Scene planet.
|
|
7
|
+
* @param {Number} tileZoom - Segment tile zoom index.
|
|
8
|
+
* @param {Extent} extent - Segment WGS84 extent.
|
|
9
|
+
*/
|
|
10
|
+
export class SegmentLonLat extends Segment {
|
|
11
|
+
_extentMerc: Extent;
|
|
12
|
+
_isNorth: boolean;
|
|
13
|
+
normalMapNormalsRaw: Float32Array;
|
|
14
|
+
}
|
|
15
|
+
import { Segment } from "./Segment.js";
|
|
16
|
+
import { Extent } from "../Extent.js";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Base geometry shape class.
|
|
3
3
|
* @class
|
|
4
4
|
* @param {Object} options - Shape parameters:
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {
|
|
7
|
-
* @param {
|
|
8
|
-
* @param {Array.<number
|
|
5
|
+
* @param {Vec3} [options.position] - Shape position.
|
|
6
|
+
* @param {Quat} [options.orientation] - Shape orientation(rotation).
|
|
7
|
+
* @param {Vec3} [options.scale] - Scale vector.
|
|
8
|
+
* @param {Array.<number>} [options.color] - Shape RGBA color. (exactly 4 entries)
|
|
9
9
|
* @param {string} [options.src] - Texture image url source.
|
|
10
10
|
* @param {boolean} [options.visibility] - Shape visibility.
|
|
11
11
|
*/
|
|
@@ -23,27 +23,27 @@ export class BaseShape {
|
|
|
23
23
|
/**
|
|
24
24
|
* Shape position.
|
|
25
25
|
* @public
|
|
26
|
-
* @type {
|
|
26
|
+
* @type {Vec3}
|
|
27
27
|
*/
|
|
28
|
-
public position:
|
|
28
|
+
public position: Vec3;
|
|
29
29
|
/**
|
|
30
30
|
* Shape orientation(rotation)
|
|
31
31
|
* @public
|
|
32
|
-
* @type {
|
|
32
|
+
* @type {Quat}
|
|
33
33
|
*/
|
|
34
|
-
public orientation:
|
|
34
|
+
public orientation: Quat;
|
|
35
35
|
/**
|
|
36
36
|
* Scale.
|
|
37
37
|
* @public
|
|
38
|
-
* @type {
|
|
38
|
+
* @type {Vec3}
|
|
39
39
|
*/
|
|
40
|
-
public scale:
|
|
40
|
+
public scale: Vec3;
|
|
41
41
|
/**
|
|
42
42
|
* Shape RGBA color.
|
|
43
43
|
* @public
|
|
44
|
-
* @type {Array.<number
|
|
44
|
+
* @type {Array.<number>} - (exactly 4 entries)
|
|
45
45
|
*/
|
|
46
|
-
public color: Array<number
|
|
46
|
+
public color: Array<number>;
|
|
47
47
|
/**
|
|
48
48
|
* Shape visibility.
|
|
49
49
|
* @public
|
|
@@ -103,21 +103,21 @@ export class BaseShape {
|
|
|
103
103
|
/**
|
|
104
104
|
* Scale matrix.
|
|
105
105
|
* @protected
|
|
106
|
-
* @type {
|
|
106
|
+
* @type {Mat4}
|
|
107
107
|
*/
|
|
108
|
-
protected _mxScale:
|
|
108
|
+
protected _mxScale: Mat4;
|
|
109
109
|
/**
|
|
110
110
|
* Translation matrix.
|
|
111
111
|
* @protected
|
|
112
|
-
* @type {
|
|
112
|
+
* @type {Mat4}
|
|
113
113
|
*/
|
|
114
|
-
protected _mxTranslation:
|
|
114
|
+
protected _mxTranslation: Mat4;
|
|
115
115
|
/**
|
|
116
116
|
* Model matrix.
|
|
117
117
|
* @protected
|
|
118
|
-
* @type {
|
|
118
|
+
* @type {Mat4}
|
|
119
119
|
*/
|
|
120
|
-
protected _mxModel:
|
|
120
|
+
protected _mxModel: Mat4;
|
|
121
121
|
/**
|
|
122
122
|
* Gl texture pointer.
|
|
123
123
|
* @protected
|
|
@@ -126,27 +126,27 @@ export class BaseShape {
|
|
|
126
126
|
/**
|
|
127
127
|
* Assigned render node.
|
|
128
128
|
* @protected
|
|
129
|
-
* @type {
|
|
129
|
+
* @type {RenderNode}
|
|
130
130
|
*/
|
|
131
|
-
protected _renderNode:
|
|
131
|
+
protected _renderNode: RenderNode;
|
|
132
132
|
/**
|
|
133
133
|
* Assigned picking color.
|
|
134
134
|
* @protected
|
|
135
|
-
* @type {Array.<number
|
|
135
|
+
* @type {Array.<number>} - (exactly 3 entries)
|
|
136
136
|
*/
|
|
137
|
-
protected _pickingColor: Array<number
|
|
137
|
+
protected _pickingColor: Array<number>;
|
|
138
138
|
/**
|
|
139
139
|
* Entity instance that holds this shape.
|
|
140
140
|
* @protected
|
|
141
|
-
* @type {
|
|
141
|
+
* @type {Entity}
|
|
142
142
|
*/
|
|
143
|
-
protected _entity:
|
|
143
|
+
protected _entity: Entity;
|
|
144
144
|
/**
|
|
145
145
|
* Handler that stores and renders this shape object.
|
|
146
146
|
* @protected
|
|
147
|
-
* @type {
|
|
147
|
+
* @type {ShapeHandler}
|
|
148
148
|
*/
|
|
149
|
-
protected _handler:
|
|
149
|
+
protected _handler: ShapeHandler;
|
|
150
150
|
/**
|
|
151
151
|
* Shape handler array index.
|
|
152
152
|
* @protected
|
|
@@ -161,15 +161,15 @@ export class BaseShape {
|
|
|
161
161
|
/**
|
|
162
162
|
* Sets shape color.
|
|
163
163
|
* @public
|
|
164
|
-
* @param {Array.<number
|
|
164
|
+
* @param {Array.<number>} color - RGBA color values array. (exactly 4 entries)
|
|
165
165
|
*/
|
|
166
|
-
public setColor(color: Array<number
|
|
166
|
+
public setColor(color: Array<number>): void;
|
|
167
167
|
/**
|
|
168
168
|
* Sets shape color.
|
|
169
169
|
* @public
|
|
170
|
-
* @param {
|
|
170
|
+
* @param {Vec4} color - RGBA color vector.
|
|
171
171
|
*/
|
|
172
|
-
public setColor4v(color:
|
|
172
|
+
public setColor4v(color: Vec4): void;
|
|
173
173
|
/**
|
|
174
174
|
* Sets shape opacity value.
|
|
175
175
|
* @public
|
|
@@ -196,26 +196,26 @@ export class BaseShape {
|
|
|
196
196
|
/**
|
|
197
197
|
* Assign render node.
|
|
198
198
|
* @public
|
|
199
|
-
* @param {
|
|
199
|
+
* @param {RenderNode} renderNode - Render node to assign.
|
|
200
200
|
*/
|
|
201
|
-
public setRenderNode(renderNode:
|
|
201
|
+
public setRenderNode(renderNode: RenderNode): void;
|
|
202
202
|
/**
|
|
203
203
|
* Sets shape position.
|
|
204
204
|
* @public
|
|
205
|
-
* @param {
|
|
205
|
+
* @param {Vec3} position - Shape position.
|
|
206
206
|
*/
|
|
207
|
-
public setPosition3v(position:
|
|
207
|
+
public setPosition3v(position: Vec3): void;
|
|
208
208
|
/**
|
|
209
209
|
* Translate shape position to vector.
|
|
210
210
|
* @public
|
|
211
|
-
* @param {
|
|
211
|
+
* @param {Vec3} vec - Translation vector.
|
|
212
212
|
*/
|
|
213
|
-
public translate3v(vec:
|
|
213
|
+
public translate3v(vec: Vec3): void;
|
|
214
214
|
/**
|
|
215
215
|
* Sets shape scale.
|
|
216
|
-
* @param {
|
|
216
|
+
* @param {Vec3} scale - Scale vector.
|
|
217
217
|
*/
|
|
218
|
-
setScale3v(scale:
|
|
218
|
+
setScale3v(scale: Vec3): void;
|
|
219
219
|
setScale(scale: any): void;
|
|
220
220
|
/**
|
|
221
221
|
* Removes shape from shape handler.
|
|
@@ -225,9 +225,9 @@ export class BaseShape {
|
|
|
225
225
|
/**
|
|
226
226
|
* Assign picking color.
|
|
227
227
|
* @protected
|
|
228
|
-
* @param {
|
|
228
|
+
* @param {Vec3} color - Picking RGB color.
|
|
229
229
|
*/
|
|
230
|
-
protected setPickingColor3v(color:
|
|
230
|
+
protected setPickingColor3v(color: Vec3): void;
|
|
231
231
|
/**
|
|
232
232
|
* Creates buffers.
|
|
233
233
|
* @protected
|
|
@@ -245,3 +245,6 @@ export class BaseShape {
|
|
|
245
245
|
public draw(): void;
|
|
246
246
|
drawPicking(): void;
|
|
247
247
|
}
|
|
248
|
+
import { Vec3 } from "../math/Vec3.js";
|
|
249
|
+
import { Quat } from "../math/Quat.js";
|
|
250
|
+
import { Mat4 } from "../math/Mat4.js";
|
package/types/shapes/Sphere.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @class
|
|
3
|
-
* @extends {
|
|
3
|
+
* @extends {BaseShape}
|
|
4
4
|
* @param {Object} options - Sphere parameters:
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {
|
|
7
|
-
* @param {
|
|
8
|
-
* @param {Array.<number
|
|
5
|
+
* @param {Vec3} [options.position] - Sphere position.
|
|
6
|
+
* @param {Quat} [options.orientation] - Sphere orientation(rotation).
|
|
7
|
+
* @param {Vec3} [options.scale] - Scale vector.
|
|
8
|
+
* @param {Array.<number>} [options.color] - Sphere RGBA color. (exactly 4 entries)
|
|
9
9
|
* @param {string} [options.src] - Texture image url source.
|
|
10
10
|
* @param {boolean} [options.visibility] - Sphere visibility.
|
|
11
11
|
* @param {number} [options.radius=100] - Sphere radius.
|
|
12
12
|
* @param {number} [options.latBands=16] - Number of latitude bands.
|
|
13
13
|
* @param {number} [options.lonBands=16] - Number of longitude bands.
|
|
14
14
|
*/
|
|
15
|
-
export class Sphere {
|
|
16
|
-
constructor(options: any);
|
|
15
|
+
export class Sphere extends BaseShape {
|
|
17
16
|
/**
|
|
18
17
|
* Sphere radius.
|
|
19
18
|
* @protected
|
|
@@ -39,3 +38,4 @@ export class Sphere {
|
|
|
39
38
|
*/
|
|
40
39
|
protected _createData(): void;
|
|
41
40
|
}
|
|
41
|
+
import { BaseShape } from "./BaseShape.js";
|
|
@@ -40,9 +40,9 @@ export class EmptyTerrain {
|
|
|
40
40
|
/**
|
|
41
41
|
* Planet node.
|
|
42
42
|
* @protected
|
|
43
|
-
* @type {
|
|
43
|
+
* @type {Planet}
|
|
44
44
|
*/
|
|
45
|
-
protected _planet:
|
|
45
|
+
protected _planet: Planet;
|
|
46
46
|
_geoid: any;
|
|
47
47
|
isBlur(): boolean;
|
|
48
48
|
set maxNodeZoom(arg: number);
|
|
@@ -53,9 +53,9 @@ export class EmptyTerrain {
|
|
|
53
53
|
* Loads or creates segment elevation data.
|
|
54
54
|
* @public
|
|
55
55
|
* @virtual
|
|
56
|
-
* @param {
|
|
56
|
+
* @param {Segment} segment - Segment to create elevation data.
|
|
57
57
|
*/
|
|
58
|
-
public handleSegmentTerrain(segment:
|
|
58
|
+
public handleSegmentTerrain(segment: Segment): void;
|
|
59
59
|
isReady(): any;
|
|
60
60
|
/**
|
|
61
61
|
* Abstract function
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Class that loads segment elevation data, converts it to the array and passes it to the planet segment.
|
|
3
3
|
* @class
|
|
4
|
-
* @extends {
|
|
4
|
+
* @extends {EmptyTerrain}
|
|
5
5
|
* @param {string} [name=""] - Terrain provider name.
|
|
6
6
|
* @param {Object} [options] - Provider options:
|
|
7
7
|
* @param {number} [options.minZoom=3] - Minimal visible zoom index when terrain handler works.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* @fires og.terrain.GlobusTerrain#load
|
|
16
16
|
* @fires og.terrain.GlobusTerrain#loadend
|
|
17
17
|
*/
|
|
18
|
-
export class GlobusTerrain {
|
|
18
|
+
export class GlobusTerrain extends EmptyTerrain {
|
|
19
19
|
/**
|
|
20
20
|
* @param {string} [name]
|
|
21
21
|
* @param {*} [options]
|
|
@@ -24,51 +24,18 @@ export class GlobusTerrain {
|
|
|
24
24
|
/**
|
|
25
25
|
* Events handler.
|
|
26
26
|
* @public
|
|
27
|
-
* @type {
|
|
27
|
+
* @type {Events}
|
|
28
28
|
*/
|
|
29
|
-
public events:
|
|
30
|
-
equalizeNormals: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Provider name.
|
|
33
|
-
* @public
|
|
34
|
-
* @type {string}
|
|
35
|
-
*/
|
|
36
|
-
public name: string;
|
|
37
|
-
/**
|
|
38
|
-
* Minimal visible zoom index when terrain handler works.
|
|
39
|
-
* @public
|
|
40
|
-
* @type {number}
|
|
41
|
-
*/
|
|
42
|
-
public minZoom: number;
|
|
43
|
-
/**
|
|
44
|
-
* Maximal visible zoom index when terrain handler works.
|
|
45
|
-
* @public
|
|
46
|
-
* @type {number}
|
|
47
|
-
*/
|
|
48
|
-
public maxZoom: number;
|
|
29
|
+
public events: Events;
|
|
49
30
|
/**
|
|
50
31
|
* Terrain source path url template.
|
|
51
32
|
* @public
|
|
52
33
|
* @type {string}
|
|
53
34
|
*/
|
|
54
35
|
public url: string;
|
|
55
|
-
/**
|
|
56
|
-
* Array of segment triangulation grid sizes where array index agreed to the segment zoom index.
|
|
57
|
-
* @public
|
|
58
|
-
* @type {Array.<number>}
|
|
59
|
-
*/
|
|
60
|
-
public gridSizeByZoom: Array<number>;
|
|
61
36
|
noDataValues: any;
|
|
62
|
-
/**
|
|
63
|
-
* Elevation tile grid size.
|
|
64
|
-
* @public
|
|
65
|
-
* @type {number}
|
|
66
|
-
*/
|
|
67
|
-
public plainGridSize: number;
|
|
68
|
-
_geoid: any;
|
|
69
37
|
_extent: any;
|
|
70
38
|
_dataType: string;
|
|
71
|
-
_maxNodeZoom: number;
|
|
72
39
|
_elevationCache: {};
|
|
73
40
|
_fetchCache: {};
|
|
74
41
|
_loader: Loader;
|
|
@@ -76,22 +43,15 @@ export class GlobusTerrain {
|
|
|
76
43
|
* Rewrites elevation storage url query.
|
|
77
44
|
* @private
|
|
78
45
|
* @callback og.terrain.GlobusTerrain~_urlRewriteCallback
|
|
79
|
-
* @param {
|
|
46
|
+
* @param {Segment} segment - Segment to load.
|
|
80
47
|
* @param {string} url - Created url.
|
|
81
48
|
* @returns {string} - Url query string.
|
|
82
49
|
*/
|
|
83
50
|
private _urlRewriteCallback;
|
|
84
|
-
clearCache(): void;
|
|
85
51
|
getGeoid(): any;
|
|
86
|
-
isBlur(segment: any): boolean;
|
|
87
52
|
getHeightAsync(lonLat: any, callback: any, zoom: any): boolean;
|
|
88
53
|
getTileCache(lonLat: any, z: any): any;
|
|
89
54
|
_getGroundHeightMerc(merc: any, tileData: any): number;
|
|
90
|
-
/**
|
|
91
|
-
* Stop loading.
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
public abortLoading(): void;
|
|
95
55
|
/**
|
|
96
56
|
* Sets terrain data url template.
|
|
97
57
|
* @public
|
|
@@ -111,28 +71,29 @@ export class GlobusTerrain {
|
|
|
111
71
|
* Starts to load segment data.
|
|
112
72
|
* @public
|
|
113
73
|
* @virtual
|
|
114
|
-
* @param {
|
|
74
|
+
* @param {Segment} segment - Segment that wants a terrain data.
|
|
75
|
+
* @param {boolean} forceLoading
|
|
115
76
|
*/
|
|
116
|
-
public loadTerrain(segment:
|
|
77
|
+
public loadTerrain(segment: Segment, forceLoading: boolean): void;
|
|
117
78
|
/**
|
|
118
79
|
* Creates query url.
|
|
119
80
|
* @protected
|
|
120
81
|
* @virtual
|
|
121
|
-
* @param {
|
|
82
|
+
* @param {Segment} segment -
|
|
122
83
|
* @returns {string} -
|
|
123
84
|
*/
|
|
124
|
-
protected _createUrl(segment:
|
|
85
|
+
protected _createUrl(segment: Segment): string;
|
|
125
86
|
/**
|
|
126
87
|
* Returns actual url query string.
|
|
127
88
|
* @protected
|
|
128
|
-
* @param {
|
|
89
|
+
* @param {Segment} segment - Segment that loads image data.
|
|
129
90
|
* @returns {string} - Url string.
|
|
130
91
|
*/
|
|
131
|
-
protected _getHTTPRequestString(segment:
|
|
92
|
+
protected _getHTTPRequestString(segment: Segment): string;
|
|
132
93
|
/**
|
|
133
94
|
* Sets url rewrite callback, used for custom url rewriting for every tile laoding.
|
|
134
95
|
* @public
|
|
135
|
-
* @param {
|
|
96
|
+
* @param {GlobusTerrain~_urlRewriteCallback} ur - The callback that returns tile custom created url.
|
|
136
97
|
*/
|
|
137
98
|
public setUrlRewriteCallback(ur: any): void;
|
|
138
99
|
/**
|
|
@@ -145,9 +106,11 @@ export class GlobusTerrain {
|
|
|
145
106
|
public _createHeights(data: any): Array<number>;
|
|
146
107
|
/**
|
|
147
108
|
* @protected
|
|
148
|
-
* @param {
|
|
109
|
+
* @param {Segment} segment -
|
|
149
110
|
* @param {*} data -
|
|
150
111
|
*/
|
|
151
|
-
protected _applyElevationsData(segment:
|
|
112
|
+
protected _applyElevationsData(segment: Segment, elevations: any): void;
|
|
152
113
|
}
|
|
114
|
+
import { EmptyTerrain } from "./EmptyTerrain.js";
|
|
115
|
+
import { Events } from "../Events.js";
|
|
153
116
|
import { Loader } from "../utils/Loader.js";
|