@eturnity/eturnity_3d 7.30.0 → 7.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -5
- package/src/App.vue +12 -12
- package/src/Overlay/AirTeamOverlay.js +15 -15
- package/src/Overlay/ImageOverlay.js +10 -10
- package/src/Overlay/Overlay.js +8 -8
- package/src/Overlay/OverlayFactory.js +1 -1
- package/src/assets/theme.js +3 -3
- package/src/components/ThreeCanvasViewer.vue +289 -280
- package/src/config.js +48 -48
- package/src/helper/UpdateRoofModuleFieldRelations.js +5 -5
- package/src/helper/UpdateRoofObstacleRelations.js +1 -1
- package/src/helper/cameraMixin.js +34 -34
- package/src/helper/customProvider.js +0 -1
- package/src/helper/initializeThree.js +2 -2
- package/src/helper/materialMixin.js +17 -17
- package/src/helper/projectedMaterial.js +27 -25
- package/src/helper/render/base.js +4 -4
- package/src/helper/render/clear.js +9 -8
- package/src/helper/render/edge.js +2 -2
- package/src/helper/render/geometryHandler.js +15 -15
- package/src/helper/render/imageOverlay.js +4 -4
- package/src/helper/render/index.js +2 -2
- package/src/helper/render/loader.js +4 -4
- package/src/helper/render/margin.js +5 -5
- package/src/helper/render/mergedGeometry.js +2 -2
- package/src/helper/render/moduleField.js +2 -2
- package/src/helper/render/node.js +2 -2
- package/src/helper/render/obstacle.js +3 -3
- package/src/helper/render/overlay.js +3 -3
- package/src/helper/render/panel.js +4 -4
- package/src/helper/render/projectionMaterial.js +2 -2
- package/src/helper/render/roof.js +6 -6
- package/src/helper/render/texture.js +3 -3
- package/src/helper/render/tile.js +80 -72
- package/src/helper/render/tileProjection.js +7 -7
- package/src/helper/renderMixin.js +61 -57
- package/src/helper/threeMixin.js +10 -8
- package/src/main.js +4 -4
- package/src/store/hydrateData.js +30 -30
- package/src/store/nodesEdgesCreation.js +9 -9
- package/src/store/store.js +2 -2
- package/src/store/three-d-module.js +8 -8
- package/src/utils/constants.js +1 -1
- package/src/utils/layers.js +31 -31
- package/src/utils/leaflet-config.service.js +13 -13
|
@@ -2,11 +2,11 @@ import * as THREE from 'three'
|
|
|
2
2
|
import { maximumGapLimit } from '../../config'
|
|
3
3
|
import {
|
|
4
4
|
getBufferRoofGeometry,
|
|
5
|
-
updateBufferRoofGeometry
|
|
5
|
+
updateBufferRoofGeometry,
|
|
6
6
|
} from './geometryHandler'
|
|
7
7
|
import {
|
|
8
8
|
intersectOutlines,
|
|
9
|
-
verticalProjectionOnPlane
|
|
9
|
+
verticalProjectionOnPlane,
|
|
10
10
|
} from '@eturnity/eturnity_maths'
|
|
11
11
|
import { debounce } from 'lodash'
|
|
12
12
|
export default {
|
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
p,
|
|
29
29
|
roofPolygon.normalVector,
|
|
30
30
|
roofPolygon.flatOutline[0]
|
|
31
|
-
).z
|
|
31
|
+
).z,
|
|
32
32
|
}
|
|
33
33
|
})
|
|
34
34
|
return outline
|
|
@@ -57,7 +57,7 @@ export default {
|
|
|
57
57
|
p,
|
|
58
58
|
roofPolygon.normalVector,
|
|
59
59
|
roofPolygon.flatOutline[0]
|
|
60
|
-
).z
|
|
60
|
+
).z,
|
|
61
61
|
}
|
|
62
62
|
})
|
|
63
63
|
return outline
|
|
@@ -156,6 +156,6 @@ export default {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
})
|
|
159
|
-
}
|
|
160
|
-
}
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
161
|
}
|
|
@@ -37,11 +37,11 @@ export default {
|
|
|
37
37
|
return {
|
|
38
38
|
uuid: m.uuid,
|
|
39
39
|
materialVersion: m.userData.version,
|
|
40
|
-
geometryVersion: mesh.geometry.userData.version
|
|
40
|
+
geometryVersion: mesh.geometry.userData.version,
|
|
41
41
|
}
|
|
42
42
|
})
|
|
43
43
|
mesh.needsUpdate = true
|
|
44
44
|
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
47
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as THREE from 'three'
|
|
2
2
|
import {
|
|
3
3
|
getBufferRoofGeometry,
|
|
4
|
-
updateBufferRoofGeometry
|
|
4
|
+
updateBufferRoofGeometry,
|
|
5
5
|
} from './geometryHandler'
|
|
6
6
|
import {
|
|
7
7
|
distanceToDeltaLatLng,
|
|
8
8
|
latLngToTileXY,
|
|
9
|
-
tileToCorners
|
|
9
|
+
tileToCorners,
|
|
10
10
|
} from '@eturnity/eturnity_maths'
|
|
11
11
|
import { earthRadius } from '../../config'
|
|
12
12
|
import { debounce } from 'lodash'
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
pendingTiles: [],
|
|
20
20
|
numberOfTilesRendered: 0,
|
|
21
21
|
numberOfTilesToRender: 0,
|
|
22
|
-
tileToRender: []
|
|
22
|
+
tileToRender: [],
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
methods: {
|
|
@@ -128,7 +128,7 @@ export default {
|
|
|
128
128
|
xTile,
|
|
129
129
|
yTile,
|
|
130
130
|
zoomLvl,
|
|
131
|
-
isTileOnRoofBound: true
|
|
131
|
+
isTileOnRoofBound: true,
|
|
132
132
|
})
|
|
133
133
|
}
|
|
134
134
|
}
|
|
@@ -169,7 +169,7 @@ export default {
|
|
|
169
169
|
xTile,
|
|
170
170
|
yTile,
|
|
171
171
|
zoomLvl,
|
|
172
|
-
isTileOnRoofBound: false
|
|
172
|
+
isTileOnRoofBound: false,
|
|
173
173
|
})
|
|
174
174
|
}
|
|
175
175
|
}
|
|
@@ -228,69 +228,77 @@ export default {
|
|
|
228
228
|
return
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
resolve()
|
|
234
|
-
return
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
const latitude = this.layoutSettings.layout_latitude
|
|
238
|
-
const longitude = this.layoutSettings.layout_longitude
|
|
239
|
-
let geometry, material
|
|
240
|
-
const imagePromise = cancellablePromise(
|
|
241
|
-
this.provider.fetchTile(zoomLvl, x, y)
|
|
242
|
-
)
|
|
243
|
-
this.pendingTiles.push({ x, y, zoomLvl, mapLayer, meshId, imagePromise })
|
|
244
|
-
this.isReady.texturesToLoad++
|
|
245
|
-
imagePromise.then((image) => {
|
|
246
|
-
this.isReady.texturesLoaded++
|
|
247
|
-
if (!image) {
|
|
248
|
-
this.removeTileFromPending(meshId, mapLayer)
|
|
231
|
+
let mesh = this.meshes.tileMeshes[meshId]
|
|
232
|
+
if (mesh && this.provider.mapLayer == mesh.userData.mapLayer) {
|
|
249
233
|
resolve()
|
|
250
234
|
return
|
|
251
235
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
236
|
+
|
|
237
|
+
const latitude = this.layoutSettings.layout_latitude
|
|
238
|
+
const longitude = this.layoutSettings.layout_longitude
|
|
239
|
+
let geometry, material
|
|
240
|
+
const imagePromise = cancellablePromise(
|
|
241
|
+
this.provider.fetchTile(zoomLvl, x, y)
|
|
242
|
+
)
|
|
243
|
+
this.pendingTiles.push({
|
|
244
|
+
x,
|
|
245
|
+
y,
|
|
246
|
+
zoomLvl,
|
|
247
|
+
mapLayer,
|
|
248
|
+
meshId,
|
|
249
|
+
imagePromise,
|
|
262
250
|
})
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
251
|
+
this.isReady.texturesToLoad++
|
|
252
|
+
imagePromise
|
|
253
|
+
.then((image) => {
|
|
254
|
+
this.isReady.texturesLoaded++
|
|
255
|
+
if (!image) {
|
|
256
|
+
this.removeTileFromPending(meshId, mapLayer)
|
|
257
|
+
resolve()
|
|
258
|
+
return
|
|
259
|
+
}
|
|
260
|
+
const texture = new THREE.Texture(image)
|
|
261
|
+
if (isTileOnRoofBound) {
|
|
262
|
+
this.newTileMaterial(texture, x, y, zoomLvl, mapLayer)
|
|
263
|
+
}
|
|
264
|
+
texture.generateMipmaps = false
|
|
265
|
+
texture.format = THREE.RGBAFormat
|
|
266
|
+
texture.needsUpdate = true
|
|
267
|
+
let corners = tileToCorners(x, y, zoomLvl, latitude, longitude)
|
|
268
|
+
corners = corners.map((c) => {
|
|
269
|
+
return { ...c, z: -100 }
|
|
270
|
+
})
|
|
271
|
+
if (mesh) {
|
|
272
|
+
geometry = mesh.geometry
|
|
273
|
+
material = mesh.material
|
|
274
|
+
geometry = updateBufferRoofGeometry(corners, [], geometry)
|
|
275
|
+
mesh.geometry = geometry
|
|
276
|
+
material.map = texture
|
|
277
|
+
material.needsUpdate = true
|
|
278
|
+
mesh.userData.mapLayer = this.provider.mapLayer
|
|
279
|
+
mesh.userData.type = 'tileMeshes'
|
|
280
|
+
mesh.userData.meshId = meshId
|
|
281
|
+
mesh.frustumCulled = false
|
|
282
|
+
mesh.needsUpdate = true
|
|
283
|
+
mesh.updateMatrix()
|
|
284
|
+
} else {
|
|
285
|
+
material = new THREE.MeshBasicMaterial({
|
|
286
|
+
map: texture,
|
|
287
|
+
color: 0xffffff,
|
|
288
|
+
side: THREE.FrontSide,
|
|
289
|
+
transparent: false,
|
|
290
|
+
// opacity:isTileOnRoofBound?0.8:1,
|
|
291
|
+
// color:isTileOnRoofBound?'red':'white'
|
|
292
|
+
})
|
|
293
|
+
material.map = texture
|
|
294
|
+
material.needsUpdate = true
|
|
295
|
+
geometry = getBufferRoofGeometry(corners)
|
|
296
|
+
if (geometry) {
|
|
297
|
+
mesh = new THREE.Mesh(geometry, material)
|
|
298
|
+
mesh.userData.type = 'tileMeshes'
|
|
299
|
+
mesh.userData.meshId = meshId
|
|
300
|
+
mesh.userData.mapLayer = this.provider.mapLayer
|
|
301
|
+
mesh.name = meshId
|
|
294
302
|
|
|
295
303
|
if (!this.scene.getObjectByName(meshId)) {
|
|
296
304
|
this.meshes.tileMeshes[meshId] = mesh
|
|
@@ -358,7 +366,7 @@ export default {
|
|
|
358
366
|
}
|
|
359
367
|
let roofsBoundCenterMeter = {
|
|
360
368
|
x: (xMax + xMin) / 2000,
|
|
361
|
-
y: (yMax + yMin) / 2000
|
|
369
|
+
y: (yMax + yMin) / 2000,
|
|
362
370
|
}
|
|
363
371
|
let deltaLatLng = distanceToDeltaLatLng(
|
|
364
372
|
roofsBoundCenterMeter.x * 1000,
|
|
@@ -367,7 +375,7 @@ export default {
|
|
|
367
375
|
)
|
|
368
376
|
let roofsBoundCenterLatLng = {
|
|
369
377
|
lat: this.layoutSettings.layout_latitude + deltaLatLng.lat,
|
|
370
|
-
lng: this.layoutSettings.layout_longitude + deltaLatLng.lng
|
|
378
|
+
lng: this.layoutSettings.layout_longitude + deltaLatLng.lng,
|
|
371
379
|
}
|
|
372
380
|
|
|
373
381
|
let apiKey = process.env.VUE_APP_GOOGLE_MAP_API_KEY
|
|
@@ -378,7 +386,7 @@ export default {
|
|
|
378
386
|
let zoomLevels = [
|
|
379
387
|
roofsBoundZoomLvl,
|
|
380
388
|
roofsBoundZoomLvl - 2,
|
|
381
|
-
roofsBoundZoomLvl - 4
|
|
389
|
+
roofsBoundZoomLvl - 4,
|
|
382
390
|
]
|
|
383
391
|
this.numberOfTilesToRender = zoomLevels.length
|
|
384
392
|
for (
|
|
@@ -401,7 +409,7 @@ export default {
|
|
|
401
409
|
|
|
402
410
|
//to remove attribution in bottom of the image
|
|
403
411
|
var uvs = new Float32Array([
|
|
404
|
-
0, 0.95, 1, 0.95, 0, 0.05, 1, 0.05, 0, 0.05, 1, 0.95
|
|
412
|
+
0, 0.95, 1, 0.95, 0, 0.05, 1, 0.05, 0, 0.05, 1, 0.95,
|
|
405
413
|
])
|
|
406
414
|
planeGeometry[indexGoogleBackground].setAttribute(
|
|
407
415
|
'uv',
|
|
@@ -426,7 +434,7 @@ export default {
|
|
|
426
434
|
}
|
|
427
435
|
planeMaterial[indexGoogleBackground] = new THREE.MeshBasicMaterial({
|
|
428
436
|
map: texture[indexGoogleBackground],
|
|
429
|
-
side: THREE.DoubleSide
|
|
437
|
+
side: THREE.DoubleSide,
|
|
430
438
|
})
|
|
431
439
|
backgroundPlane[indexGoogleBackground] = new THREE.Mesh(
|
|
432
440
|
planeGeometry[indexGoogleBackground],
|
|
@@ -460,7 +468,7 @@ export default {
|
|
|
460
468
|
}
|
|
461
469
|
|
|
462
470
|
this.render()
|
|
463
|
-
}
|
|
471
|
+
},
|
|
464
472
|
},
|
|
465
473
|
watch: {
|
|
466
474
|
selectedMapLayer(newMapLayer) {
|
|
@@ -470,6 +478,6 @@ export default {
|
|
|
470
478
|
return false
|
|
471
479
|
}
|
|
472
480
|
})
|
|
473
|
-
}
|
|
474
|
-
}
|
|
481
|
+
},
|
|
482
|
+
},
|
|
475
483
|
}
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
data() {
|
|
7
7
|
return {
|
|
8
8
|
tileProjectionTextures: [],
|
|
9
|
-
tileProjectionMaterials: []
|
|
9
|
+
tileProjectionMaterials: [],
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
methods: {
|
|
@@ -26,7 +26,7 @@ export default {
|
|
|
26
26
|
camera: cameraProjection,
|
|
27
27
|
texture: texture,
|
|
28
28
|
transparent: true,
|
|
29
|
-
side: THREE.DoubleSide
|
|
29
|
+
side: THREE.DoubleSide,
|
|
30
30
|
})
|
|
31
31
|
tileProjectionMaterial.camera = cameraProjection
|
|
32
32
|
tileProjectionMaterial.userData = {}
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
camera: cameraProjection,
|
|
71
71
|
texture: texture,
|
|
72
72
|
transparent: true,
|
|
73
|
-
side: THREE.DoubleSide
|
|
73
|
+
side: THREE.DoubleSide,
|
|
74
74
|
})
|
|
75
75
|
tileProjectionMaterial.camera = cameraProjection
|
|
76
76
|
tileProjectionMaterial.userData = {}
|
|
@@ -114,7 +114,7 @@ export default {
|
|
|
114
114
|
width = height
|
|
115
115
|
tileCenter = {
|
|
116
116
|
x: (corners[0].x + corners[2].x) / 2,
|
|
117
|
-
y: (corners[0].y + corners[2].y) / 2
|
|
117
|
+
y: (corners[0].y + corners[2].y) / 2,
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
camera.left = corners[0].x / 1000
|
|
@@ -123,12 +123,12 @@ export default {
|
|
|
123
123
|
camera.top = corners[2].y / 1000
|
|
124
124
|
|
|
125
125
|
camera.updateProjectionMatrix()
|
|
126
|
-
}
|
|
126
|
+
},
|
|
127
127
|
},
|
|
128
128
|
watch: {
|
|
129
129
|
selectedMapLayer(newMapLayer) {
|
|
130
130
|
if (!newMapLayer) return
|
|
131
131
|
this.disposeTileMaterialDifferentMapLayer(newMapLayer.key)
|
|
132
|
-
}
|
|
133
|
-
}
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
134
|
}
|