@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
package/src/og/layer/Layer.js
CHANGED
|
@@ -11,6 +11,7 @@ import { Extent } from "../Extent.js";
|
|
|
11
11
|
import { LonLat } from "../LonLat.js";
|
|
12
12
|
import { Material } from "./Material.js";
|
|
13
13
|
import { Vec3 } from "../math/Vec3.js";
|
|
14
|
+
import { createTexture } from "../webgl/Handler.js";
|
|
14
15
|
|
|
15
16
|
export const FADING_FACTOR = 0.29;
|
|
16
17
|
|
|
@@ -22,16 +23,17 @@ export const FADING_FACTOR = 0.29;
|
|
|
22
23
|
* @param {String} [name="noname"] - Layer name.
|
|
23
24
|
* @param {Object} [options] - Layer options:
|
|
24
25
|
* @param {number} [options.opacity=1.0] - Layer opacity.
|
|
25
|
-
* @param {Array.<number
|
|
26
|
+
* @param {Array.<number>} [options.transparentColor=[-1,-1,-1]] - RGB color that defines transparent color. (exactly 3 entries)
|
|
26
27
|
* @param {number} [options.minZoom=0] - Minimal visibility zoom level.
|
|
27
28
|
* @param {number} [options.maxZoom=0] - Maximal visibility zoom level.
|
|
28
29
|
* @param {string} [options.attribution] - Layer attribution that displayed in the attribution area on the screen.
|
|
29
30
|
* @param {boolean} [options.isBaseLayer=false] - This is a base layer.
|
|
30
31
|
* @param {boolean} [options.visibility=true] - Layer visibility.
|
|
31
|
-
* @param {
|
|
32
|
-
* @param {
|
|
33
|
-
* @param {
|
|
34
|
-
* @param {
|
|
32
|
+
* @param {Extent} [options.extent=[[-180.0, -90.0], [180.0, 90.0]]] - Visible extent.
|
|
33
|
+
* @param {Vec3} [options.ambient=[0.1, 0.1, 0.21]] - Ambient RGB color.
|
|
34
|
+
* @param {Vec3} [options.diffuse=[1.0, 1.0, 1.0]] - Diffuse RGB color.
|
|
35
|
+
* @param {Vec3} [options.specular=[0.00025, 0.00015, 0.0001]] - Specular RGB color.
|
|
36
|
+
* @param {string} [options.textureFilter="anisotropic"] - Image texture filter. Available values: "nearest", "linear", "mipmap" and "anisotropic".
|
|
35
37
|
* @param {Number} [options.shininess=100] - Shininess.
|
|
36
38
|
*
|
|
37
39
|
* @fires og.Layer#visibilitychange
|
|
@@ -87,7 +89,7 @@ class Layer {
|
|
|
87
89
|
/**
|
|
88
90
|
* Transparent RGB color mask.
|
|
89
91
|
* @public
|
|
90
|
-
* @type {Array.<number
|
|
92
|
+
* @type {Array.<number>} - (exactly 3 entries)
|
|
91
93
|
*/
|
|
92
94
|
this.transparentColor = options.transparentColor || [-1, -1, -1];
|
|
93
95
|
|
|
@@ -118,7 +120,7 @@ class Layer {
|
|
|
118
120
|
/**
|
|
119
121
|
* Planet node.
|
|
120
122
|
* @protected
|
|
121
|
-
* @type {
|
|
123
|
+
* @type {Planet}
|
|
122
124
|
*/
|
|
123
125
|
this._planet = null;
|
|
124
126
|
|
|
@@ -179,14 +181,22 @@ class Layer {
|
|
|
179
181
|
/**
|
|
180
182
|
* Visible degrees extent.
|
|
181
183
|
* @protected
|
|
182
|
-
* @type {
|
|
184
|
+
* @type {Extent}
|
|
183
185
|
*/
|
|
184
186
|
this._extent = null;
|
|
185
187
|
|
|
188
|
+
if (options.textureFilter) {
|
|
189
|
+
this.createTexture =
|
|
190
|
+
createTexture[options.textureFilter.trim().toUpperCase()] ||
|
|
191
|
+
createTexture.ANISOTROPIC;
|
|
192
|
+
} else {
|
|
193
|
+
this.createTexture = createTexture.ANISOTROPIC;
|
|
194
|
+
}
|
|
195
|
+
|
|
186
196
|
/**
|
|
187
197
|
* Visible mercator extent.
|
|
188
198
|
* @protected
|
|
189
|
-
* @type {
|
|
199
|
+
* @type {Extent}
|
|
190
200
|
*/
|
|
191
201
|
this._extentMerc = null;
|
|
192
202
|
|
|
@@ -201,7 +211,7 @@ class Layer {
|
|
|
201
211
|
/**
|
|
202
212
|
* Layer picking color. Assign when added to the planet.
|
|
203
213
|
* @protected
|
|
204
|
-
* @type {
|
|
214
|
+
* @type {Vec3}
|
|
205
215
|
*/
|
|
206
216
|
this._pickingColor = new Vec3();
|
|
207
217
|
|
|
@@ -210,7 +220,7 @@ class Layer {
|
|
|
210
220
|
/**
|
|
211
221
|
* Events handler.
|
|
212
222
|
* @public
|
|
213
|
-
* @type {
|
|
223
|
+
* @type {Events}
|
|
214
224
|
*/
|
|
215
225
|
this.events = new Events(EVENT_NAMES, this);
|
|
216
226
|
}
|
|
@@ -310,7 +320,7 @@ class Layer {
|
|
|
310
320
|
/**
|
|
311
321
|
* Compares layers instances.
|
|
312
322
|
* @public
|
|
313
|
-
* @param {
|
|
323
|
+
* @param {Layer} layer - Layer instance to compare.
|
|
314
324
|
* @returns {boolean} - Returns true if the layers is the same instance of the input.
|
|
315
325
|
*/
|
|
316
326
|
isEqual(layer) {
|
|
@@ -321,7 +331,7 @@ class Layer {
|
|
|
321
331
|
* Assign the planet.
|
|
322
332
|
* @protected
|
|
323
333
|
* @virtual
|
|
324
|
-
* @param {
|
|
334
|
+
* @param {Planet} planet - Planet render node.
|
|
325
335
|
*/
|
|
326
336
|
_assignPlanet(planet) {
|
|
327
337
|
planet.layers.push(this);
|
|
@@ -348,7 +358,7 @@ class Layer {
|
|
|
348
358
|
/**
|
|
349
359
|
* Adds layer to the planet.
|
|
350
360
|
* @public
|
|
351
|
-
* @param {
|
|
361
|
+
* @param {Planet} planet - Adds layer to the planet.
|
|
352
362
|
*/
|
|
353
363
|
addTo(planet) {
|
|
354
364
|
if (!this._planet) {
|
|
@@ -360,7 +370,7 @@ class Layer {
|
|
|
360
370
|
/**
|
|
361
371
|
* Removes from planet.
|
|
362
372
|
* @public
|
|
363
|
-
* @returns {
|
|
373
|
+
* @returns {Layer} -This layer.
|
|
364
374
|
*/
|
|
365
375
|
remove() {
|
|
366
376
|
var p = this._planet;
|
|
@@ -514,7 +524,7 @@ class Layer {
|
|
|
514
524
|
/**
|
|
515
525
|
* Sets visible geographical extent.
|
|
516
526
|
* @public
|
|
517
|
-
* @param {
|
|
527
|
+
* @param {Extent} extent - Layer visible geographical extent.
|
|
518
528
|
*/
|
|
519
529
|
setExtent(extent) {
|
|
520
530
|
var sw = extent.southWest.clone(),
|
|
@@ -533,7 +543,7 @@ class Layer {
|
|
|
533
543
|
/**
|
|
534
544
|
* Gets layer extent.
|
|
535
545
|
* @public
|
|
536
|
-
* @return {
|
|
546
|
+
* @return {Extent} - Layer geodetic extent.
|
|
537
547
|
*/
|
|
538
548
|
getExtent() {
|
|
539
549
|
return this._extent;
|
package/src/og/layer/Material.js
CHANGED
|
@@ -2,76 +2,108 @@
|
|
|
2
2
|
* @module og/layer/Material
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
"use strict";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
class Material {
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {*} segment
|
|
11
|
+
* @param {*} layer
|
|
12
|
+
*/
|
|
13
|
+
constructor(segment, layer) {
|
|
14
|
+
this.segment = segment;
|
|
15
|
+
this.layer = layer;
|
|
16
|
+
this.isReady = false;
|
|
17
|
+
this.isLoading = false;
|
|
18
|
+
this.texture = null;
|
|
19
|
+
this.pickingMask = null;
|
|
20
|
+
//this.image = null;
|
|
21
|
+
this.textureExists = false;
|
|
22
|
+
this.appliedNodeId = 0;
|
|
23
|
+
this.texOffset = [0.0, 0.0, 1.0, 1.0];
|
|
24
|
+
this.loadingAttempts = 0;
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
26
|
+
// vector data
|
|
27
|
+
this._updateTexture = null;
|
|
28
|
+
this._updatePickingMask = null;
|
|
29
|
+
this.pickingReady = false;
|
|
30
|
+
}
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
///**
|
|
33
|
+
// * @param {*} layer
|
|
34
|
+
// */
|
|
35
|
+
//assignLayer(layer) {
|
|
36
|
+
// this.layer = layer;
|
|
37
|
+
//}
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
abortLoading() {
|
|
43
|
+
this.layer.abortMaterialLoading(this);
|
|
44
|
+
}
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this._updateTexture = null;
|
|
37
|
-
//this.image = img;
|
|
38
|
-
this.texture = this.segment.handler.createTexture(img);
|
|
39
|
-
this.appliedNodeId = this.segment.node.nodeId;
|
|
40
|
-
this.isReady = true;
|
|
41
|
-
this.pickingReady = true;
|
|
42
|
-
this.textureExists = true;
|
|
43
|
-
this.isLoading = false;
|
|
44
|
-
this.texOffset = [0.0, 0.0, 1.0, 1.0];
|
|
46
|
+
_createTexture(img) {
|
|
47
|
+
return this.layer.createTexture(this.segment.handler, img);
|
|
45
48
|
}
|
|
46
|
-
};
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param {*} img
|
|
53
|
+
*/
|
|
54
|
+
applyImage(img) {
|
|
55
|
+
if (this.segment.initialized) {
|
|
56
|
+
this._updateTexture = null;
|
|
57
|
+
//this.image = img;
|
|
58
|
+
this.texture = this._createTexture(img);
|
|
59
|
+
this.appliedNodeId = this.segment.node.nodeId;
|
|
60
|
+
this.isReady = true;
|
|
61
|
+
this.pickingReady = true;
|
|
62
|
+
this.textureExists = true;
|
|
63
|
+
this.isLoading = false;
|
|
64
|
+
this.texOffset = [0.0, 0.0, 1.0, 1.0];
|
|
65
|
+
}
|
|
60
66
|
}
|
|
61
|
-
};
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @param {*} texture
|
|
71
|
+
* @param {*} pickingMask
|
|
72
|
+
*/
|
|
73
|
+
applyTexture(texture, pickingMask) {
|
|
74
|
+
if (this.segment.initialized) {
|
|
75
|
+
this.texture = texture;
|
|
76
|
+
this._updateTexture = null;
|
|
77
|
+
this.pickingMask = pickingMask || null;
|
|
78
|
+
this._updatePickingMask = null;
|
|
79
|
+
this.isReady = true;
|
|
80
|
+
this.pickingReady = true;
|
|
81
|
+
this.textureExists = true;
|
|
82
|
+
this.isLoading = false;
|
|
83
|
+
this.appliedNodeId = this.segment.node.nodeId;
|
|
84
|
+
this.texOffset = [0.0, 0.0, 1.0, 1.0];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
*/
|
|
91
|
+
textureNotExists() {
|
|
92
|
+
if (this.segment.initialized) {
|
|
93
|
+
this.pickingReady = true;
|
|
94
|
+
this.isLoading = false;
|
|
95
|
+
this.isReady = true;
|
|
96
|
+
this.textureExists = false;
|
|
97
|
+
}
|
|
69
98
|
}
|
|
70
|
-
};
|
|
71
99
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
*/
|
|
103
|
+
clear() {
|
|
104
|
+
this.loadingAttempts = 0;
|
|
105
|
+
this.layer.clearMaterial(this);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
76
108
|
|
|
77
|
-
export { Material };
|
|
109
|
+
export { Material };
|