@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
package/src/config.js
CHANGED
|
@@ -12,52 +12,52 @@ export const layerColors = {
|
|
|
12
12
|
construction: {
|
|
13
13
|
fillColor: 'transparent',
|
|
14
14
|
strokeColor: theme.colors.blueElectric,
|
|
15
|
-
strokeWidth: 2
|
|
15
|
+
strokeWidth: 2,
|
|
16
16
|
},
|
|
17
17
|
obstacleConstruction: {
|
|
18
18
|
fillColor: 'transparent',
|
|
19
19
|
strokeColor: theme.colors.red,
|
|
20
|
-
strokeWidth: 2
|
|
20
|
+
strokeWidth: 2,
|
|
21
21
|
},
|
|
22
22
|
roof: {
|
|
23
23
|
fillColor: 'rgba(255, 255, 255, 0.1)',
|
|
24
24
|
strokeColor: 'white',
|
|
25
|
-
strokeWidth: 0
|
|
25
|
+
strokeWidth: 0,
|
|
26
26
|
},
|
|
27
27
|
hoveredRoof: {
|
|
28
28
|
fillColor: '#0068DE30',
|
|
29
29
|
strokeColor: 'white',
|
|
30
|
-
strokeWidth: 0
|
|
30
|
+
strokeWidth: 0,
|
|
31
31
|
},
|
|
32
32
|
hoveredObstacle: {
|
|
33
33
|
fillColor: theme.colors.transparentRed20,
|
|
34
34
|
strokeColor: theme.colors.red,
|
|
35
|
-
strokeWidth: 0
|
|
35
|
+
strokeWidth: 0,
|
|
36
36
|
},
|
|
37
37
|
roofInside: {
|
|
38
38
|
fillColor: 'rgba(255, 255, 255, 0.1)',
|
|
39
39
|
strokeColor: 'white',
|
|
40
|
-
strokeWidth: 1
|
|
40
|
+
strokeWidth: 1,
|
|
41
41
|
},
|
|
42
42
|
obstacle: {
|
|
43
43
|
fillColor: theme.colors.transparentRed10,
|
|
44
44
|
strokeColor: theme.colors.red,
|
|
45
|
-
strokeWidth: 2
|
|
45
|
+
strokeWidth: 2,
|
|
46
46
|
},
|
|
47
47
|
panel: {
|
|
48
48
|
fillColor: 'rgba(115, 115, 229, 0.1)',
|
|
49
49
|
strokeColor: '#ffffff',
|
|
50
|
-
strokeWidth: 1
|
|
50
|
+
strokeWidth: 1,
|
|
51
51
|
},
|
|
52
52
|
user_deactivated_panel: {
|
|
53
53
|
fillColor: 'rgba(115, 115, 229, 0.1)',
|
|
54
54
|
strokeColor: 'white',
|
|
55
|
-
strokeWidth: 2
|
|
55
|
+
strokeWidth: 2,
|
|
56
56
|
},
|
|
57
57
|
selectedPanel: {
|
|
58
58
|
fillColor: '#0068DE80',
|
|
59
59
|
strokeColor: theme.colors.blue,
|
|
60
|
-
strokeWidth: 1
|
|
60
|
+
strokeWidth: 1,
|
|
61
61
|
},
|
|
62
62
|
snap: { fillColor: 'transparent', strokeColor: 'white' },
|
|
63
63
|
snapTargetObstacle: { fillColor: theme.colors.red },
|
|
@@ -65,149 +65,149 @@ export const layerColors = {
|
|
|
65
65
|
moduleField: {
|
|
66
66
|
fillColor: 'rgba(255, 255, 255, 0.2)',
|
|
67
67
|
strokeColor: 'transparent',
|
|
68
|
-
strokeWidth: 1
|
|
68
|
+
strokeWidth: 1,
|
|
69
69
|
},
|
|
70
70
|
hoveredModuleFieldEdge: {
|
|
71
71
|
strokeColor: theme.colors.blue,
|
|
72
|
-
strokeWidth: 6
|
|
72
|
+
strokeWidth: 6,
|
|
73
73
|
},
|
|
74
74
|
moduleFieldBaseLineEdge: {
|
|
75
75
|
strokeColor: theme.colors.purple2,
|
|
76
|
-
strokeWidth: 6
|
|
76
|
+
strokeWidth: 6,
|
|
77
77
|
},
|
|
78
78
|
node: {
|
|
79
79
|
strokeColor: 'white',
|
|
80
80
|
fillColor: 'rgba(255, 255, 255, 0.1)',
|
|
81
|
-
strokeWidth: 2
|
|
81
|
+
strokeWidth: 2,
|
|
82
82
|
},
|
|
83
83
|
obstacleNode: {
|
|
84
84
|
strokeColor: theme.colors.red,
|
|
85
85
|
fillColor: 'rgba(255, 255, 255, 0.1)',
|
|
86
|
-
strokeWidth: 2
|
|
86
|
+
strokeWidth: 2,
|
|
87
87
|
},
|
|
88
88
|
hoveredEdge: { strokeColor: theme.colors.blueElectric, strokeWidth: 3 },
|
|
89
89
|
hoveredNode: {
|
|
90
90
|
strokeColor: theme.colors.blueElectric,
|
|
91
91
|
strokeWidth: 6,
|
|
92
|
-
fillColor: '#48a2d080'
|
|
92
|
+
fillColor: '#48a2d080',
|
|
93
93
|
},
|
|
94
94
|
hoveredObstacleNode: {
|
|
95
95
|
strokeColor: theme.colors.red,
|
|
96
96
|
strokeWidth: 2,
|
|
97
|
-
fillColor: theme.colors.transparentRed50
|
|
97
|
+
fillColor: theme.colors.transparentRed50,
|
|
98
98
|
},
|
|
99
99
|
hoveredMasterHandle: {
|
|
100
100
|
strokeColor: theme.colors.blueElectric,
|
|
101
101
|
strokeWidth: 3,
|
|
102
|
-
fillColor: 'black'
|
|
102
|
+
fillColor: 'black',
|
|
103
103
|
},
|
|
104
104
|
subHandleLink: { strokeColor: '#ffffffa0', strokeWidth: 2 },
|
|
105
105
|
selectedEdge: { strokeColor: theme.colors.blue, strokeWidth: 3 },
|
|
106
106
|
selectedEdgeObstacle: {
|
|
107
107
|
strokeColor: theme.colors.darkRed,
|
|
108
|
-
strokeWidth: 4
|
|
108
|
+
strokeWidth: 4,
|
|
109
109
|
},
|
|
110
110
|
hoveredEdgeObstacle: {
|
|
111
111
|
strokeColor: theme.colors.pureRed,
|
|
112
|
-
strokeWidth: 2
|
|
112
|
+
strokeWidth: 2,
|
|
113
113
|
},
|
|
114
114
|
selectedNode: {
|
|
115
115
|
strokeColor: theme.colors.blue,
|
|
116
116
|
strokeWidth: 2,
|
|
117
|
-
fillColor: theme.colors.blue
|
|
117
|
+
fillColor: theme.colors.blue,
|
|
118
118
|
},
|
|
119
119
|
selectedObstacleNode: {
|
|
120
120
|
strokeColor: theme.colors.darkRed,
|
|
121
121
|
strokeWidth: 2,
|
|
122
|
-
fillColor: theme.colors.pureRed
|
|
122
|
+
fillColor: theme.colors.pureRed,
|
|
123
123
|
},
|
|
124
124
|
hoveredModuleField: {
|
|
125
125
|
fillColor: '#0068DE30',
|
|
126
126
|
strokeColor: theme.colors.blueElectric,
|
|
127
|
-
strokeWidth: 5
|
|
127
|
+
strokeWidth: 5,
|
|
128
128
|
},
|
|
129
129
|
tmpModuleField: {
|
|
130
130
|
fillColor: 'rgba(115, 115, 229, 0.2)',
|
|
131
131
|
strokeColor: theme.colors.blue,
|
|
132
|
-
strokeWidth: 1
|
|
132
|
+
strokeWidth: 1,
|
|
133
133
|
},
|
|
134
134
|
selectedModuleField: {
|
|
135
135
|
fillColor: '#0068DEA0',
|
|
136
136
|
strokeColor: theme.colors.blue,
|
|
137
|
-
strokeWidth: 2
|
|
137
|
+
strokeWidth: 2,
|
|
138
138
|
},
|
|
139
139
|
selectableModuleField: {
|
|
140
140
|
fillColor: 'rgba(255, 255, 255, 0.2)',
|
|
141
141
|
strokeColor: 'transparent',
|
|
142
|
-
strokeWidth: 2
|
|
142
|
+
strokeWidth: 2,
|
|
143
143
|
},
|
|
144
144
|
overrideNumberOfPanelsModuleField: {
|
|
145
145
|
fillColor: '#fc8b0080',
|
|
146
146
|
strokeColor: 'transparent',
|
|
147
|
-
strokeWidth: 1
|
|
147
|
+
strokeWidth: 1,
|
|
148
148
|
},
|
|
149
149
|
highlight: {
|
|
150
150
|
fillColor: 'rgba(255, 255, 255, 0.2)',
|
|
151
151
|
strokeColor: 'white',
|
|
152
|
-
strokeWidth: 1
|
|
152
|
+
strokeWidth: 1,
|
|
153
153
|
},
|
|
154
154
|
selectedRoof: {
|
|
155
155
|
fillColor: '#0068DE80',
|
|
156
156
|
strokeColor: 'white',
|
|
157
|
-
strokeWidth: 2
|
|
157
|
+
strokeWidth: 2,
|
|
158
158
|
},
|
|
159
159
|
selectedObstacle: {
|
|
160
160
|
fillColor: theme.colors.transparentRed50,
|
|
161
161
|
strokeColor: theme.colors.red,
|
|
162
|
-
strokeWidth: 1
|
|
162
|
+
strokeWidth: 1,
|
|
163
163
|
},
|
|
164
164
|
selectedAndHighlighted: {
|
|
165
165
|
fillColor: '#0068DEA0',
|
|
166
166
|
strokeColor: theme.colors.blue,
|
|
167
|
-
strokeWidth: 2
|
|
167
|
+
strokeWidth: 2,
|
|
168
168
|
},
|
|
169
169
|
flatWarning: {
|
|
170
170
|
fillColor: '#ffff0090',
|
|
171
171
|
strokeColor: 'yellow',
|
|
172
|
-
strokeWidth: 1
|
|
172
|
+
strokeWidth: 1,
|
|
173
173
|
},
|
|
174
174
|
flatSelectedWarning: {
|
|
175
175
|
fillColor: '#a0a00090',
|
|
176
176
|
strokeColor: 'yellow',
|
|
177
|
-
strokeWidth: 1
|
|
177
|
+
strokeWidth: 1,
|
|
178
178
|
},
|
|
179
179
|
customLength: {
|
|
180
180
|
fillColor: 'transparent',
|
|
181
181
|
strokeColor: theme.colors.blueElectric,
|
|
182
|
-
strokeWidth: 1
|
|
182
|
+
strokeWidth: 1,
|
|
183
183
|
},
|
|
184
184
|
snapDirectionIncline: {
|
|
185
185
|
fillColor: 'transparent',
|
|
186
186
|
strokeColor: theme.colors.blue,
|
|
187
|
-
strokeWidth: 1
|
|
187
|
+
strokeWidth: 1,
|
|
188
188
|
},
|
|
189
189
|
inclineDirectionArrow: {
|
|
190
190
|
fillColor: 'transparent',
|
|
191
191
|
strokeColor: theme.colors.orange,
|
|
192
|
-
strokeWidth: 4
|
|
192
|
+
strokeWidth: 4,
|
|
193
193
|
},
|
|
194
194
|
inclineLabel: {
|
|
195
195
|
fillColor: theme.colors.transparentBlack1,
|
|
196
|
-
textColor: 'white'
|
|
196
|
+
textColor: 'white',
|
|
197
197
|
},
|
|
198
198
|
directionLabel: {
|
|
199
199
|
fillColor: theme.colors.transparentBlack1,
|
|
200
|
-
textColor: 'white'
|
|
200
|
+
textColor: 'white',
|
|
201
201
|
},
|
|
202
202
|
imageOverlayHandle: {
|
|
203
203
|
fillColor: 'transparent',
|
|
204
204
|
strokeColor: theme.colors.blueElectric,
|
|
205
|
-
strokeWidth: 3
|
|
205
|
+
strokeWidth: 3,
|
|
206
206
|
},
|
|
207
207
|
angleLabelColor: {
|
|
208
208
|
strokeColor: theme.colors.orange,
|
|
209
|
-
fillColor: theme.colors.orange
|
|
210
|
-
}
|
|
209
|
+
fillColor: theme.colors.orange,
|
|
210
|
+
},
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
export const snapInclineTolerance = 5
|
|
@@ -227,7 +227,7 @@ export const colorArrayBase = [
|
|
|
227
227
|
'#C84E4E',
|
|
228
228
|
'#90A650',
|
|
229
229
|
'#D27CCA',
|
|
230
|
-
'#6276DF'
|
|
230
|
+
'#6276DF',
|
|
231
231
|
]
|
|
232
232
|
export const colorArray = colorArrayBase.map((c) => c + 'c0')
|
|
233
233
|
export const layerTools = {
|
|
@@ -235,7 +235,7 @@ export const layerTools = {
|
|
|
235
235
|
roof: ['drawRoof', 'selectRoof'],
|
|
236
236
|
obstacle: ['drawObstacle'],
|
|
237
237
|
margin: ['selectMargin'],
|
|
238
|
-
panel: ['selectModuleField']
|
|
238
|
+
panel: ['selectModuleField'],
|
|
239
239
|
}
|
|
240
240
|
//3D visualisation:
|
|
241
241
|
export const beamRadius = 0.05
|
|
@@ -251,33 +251,33 @@ const textureImageDomain = 'https://public-data.eturnity.io/'
|
|
|
251
251
|
export const defaultTextureUrls = [
|
|
252
252
|
textureImageDomain + 'textures/reneSola_Virtus_2_JC320S_24_Bbw.png',
|
|
253
253
|
textureImageDomain + 'textures/longiSolarLR4_60HPH_370M.png',
|
|
254
|
-
textureImageDomain + 'textures/longiSolarLR4_60HPH_350M.png'
|
|
254
|
+
textureImageDomain + 'textures/longiSolarLR4_60HPH_350M.png',
|
|
255
255
|
]
|
|
256
256
|
|
|
257
257
|
export const hitOption = {
|
|
258
258
|
segments: true,
|
|
259
259
|
stroke: true,
|
|
260
260
|
fill: true,
|
|
261
|
-
tolerance: 10
|
|
261
|
+
tolerance: 10,
|
|
262
262
|
}
|
|
263
263
|
export const zoomFactor = Math.exp(Math.log(2) / 10)
|
|
264
264
|
export const hitOptionPolygonStrict = {
|
|
265
265
|
segments: false,
|
|
266
266
|
stroke: false,
|
|
267
267
|
fill: true,
|
|
268
|
-
tolerance: 0
|
|
268
|
+
tolerance: 0,
|
|
269
269
|
}
|
|
270
270
|
export const hitOptionStrokeStrict = {
|
|
271
271
|
segments: false,
|
|
272
272
|
stroke: true,
|
|
273
273
|
fill: false,
|
|
274
|
-
tolerance: 0
|
|
274
|
+
tolerance: 0,
|
|
275
275
|
}
|
|
276
276
|
export const hitOptionStroke = {
|
|
277
277
|
segments: false,
|
|
278
278
|
stroke: true,
|
|
279
279
|
fill: false,
|
|
280
|
-
tolerance: 2
|
|
280
|
+
tolerance: 2,
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
export const dragHeightSensitivity = 20
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
isInsidePolygon,
|
|
3
3
|
verticalProjectionOnPlane,
|
|
4
4
|
intersectOutlines,
|
|
5
|
-
calculateArea
|
|
5
|
+
calculateArea,
|
|
6
6
|
} from '@eturnity/eturnity_maths'
|
|
7
7
|
//this function just update the "roof" and "moduleField(s)" properties of panels,moduleFields and roofs
|
|
8
8
|
export function UpdateRoofModuleFieldRelations(state) {
|
|
@@ -51,7 +51,7 @@ export function UpdateRoofModuleFieldRelations(state) {
|
|
|
51
51
|
intersectionArea: 0,
|
|
52
52
|
intersectionRatio: 0,
|
|
53
53
|
areaRatio: 0,
|
|
54
|
-
roofBiggerThanModuleField: 1
|
|
54
|
+
roofBiggerThanModuleField: 1,
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
const intersectionArea_m2 = calculateArea(intersection[0]) / 1e6
|
|
@@ -60,7 +60,7 @@ export function UpdateRoofModuleFieldRelations(state) {
|
|
|
60
60
|
intersectionArea: intersectionArea_m2,
|
|
61
61
|
intersectionRatio: (intersectionArea_m2 / roof.area).toFixed(3),
|
|
62
62
|
areaRatio: (moduleField.area / roof.area).toFixed(3),
|
|
63
|
-
roofBiggerThanModuleField: roof.area >= moduleField.area ? 1 : -1
|
|
63
|
+
roofBiggerThanModuleField: roof.area >= moduleField.area ? 1 : -1,
|
|
64
64
|
}
|
|
65
65
|
})
|
|
66
66
|
//roofs on roof can lead to multiple roof under a point. moduleField is on the smallest
|
|
@@ -85,7 +85,7 @@ export function UpdateRoofModuleFieldRelations(state) {
|
|
|
85
85
|
roofPolygon = roofPolygons.find((r) => r.id == roofPolygon.id)
|
|
86
86
|
roofPolygon.moduleFields = [
|
|
87
87
|
...roofPolygon.moduleFields.filter((mf) => mf.id != moduleField.id),
|
|
88
|
-
moduleField
|
|
88
|
+
moduleField,
|
|
89
89
|
]
|
|
90
90
|
moduleField.roof = roofPolygon
|
|
91
91
|
moduleField.panels.forEach((panel) => (panel.roof = roofPolygon))
|
|
@@ -134,7 +134,7 @@ export function removeModuleFieldAndPanelsOnNoOrMultipleRoofs(state) {
|
|
|
134
134
|
...remainingPolygons,
|
|
135
135
|
...remainingModuleFields,
|
|
136
136
|
...remainingPanels,
|
|
137
|
-
...remainingUserDeactivatedPanels
|
|
137
|
+
...remainingUserDeactivatedPanels,
|
|
138
138
|
]
|
|
139
139
|
return state
|
|
140
140
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
verticalProjectionOnPlane,
|
|
3
3
|
calculateArea,
|
|
4
|
-
isInsidePolygon
|
|
4
|
+
isInsidePolygon,
|
|
5
5
|
} from '@eturnity/eturnity_maths'
|
|
6
6
|
import { intersectOutlines } from '@eturnity/eturnity_maths'
|
|
7
7
|
//this function just update the "roof" and "holes" properties of roofs and obstacles
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
addVector,
|
|
6
6
|
getDistanceBetweenPoints,
|
|
7
7
|
multiplyVector,
|
|
8
|
-
substractVector
|
|
8
|
+
substractVector,
|
|
9
9
|
} from '@eturnity/eturnity_maths'
|
|
10
10
|
import { marginAroundBuildingForCameraViewInMeter } from '../config'
|
|
11
11
|
import OverlayLayer from '../Overlay/OverlayLayer'
|
|
12
12
|
export default {
|
|
13
13
|
data() {
|
|
14
14
|
return {
|
|
15
|
-
animationFrameId: null
|
|
15
|
+
animationFrameId: null,
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
created() {
|
|
@@ -117,7 +117,7 @@ export default {
|
|
|
117
117
|
this.orbitControl.mouseButtons = {
|
|
118
118
|
LEFT: THREE.MOUSE.PAN,
|
|
119
119
|
MIDDLE: THREE.MOUSE.DOLLY,
|
|
120
|
-
RIGHT: THREE.MOUSE.ROTATE
|
|
120
|
+
RIGHT: THREE.MOUSE.ROTATE,
|
|
121
121
|
}
|
|
122
122
|
this.orbitControl.enableRotate = false
|
|
123
123
|
this.orbitControl.update()
|
|
@@ -171,7 +171,7 @@ export default {
|
|
|
171
171
|
this.orbitControl.mouseButtons = {
|
|
172
172
|
LEFT: THREE.MOUSE.ROTATE,
|
|
173
173
|
MIDDLE: THREE.MOUSE.DOLLY,
|
|
174
|
-
RIGHT: THREE.MOUSE.PAN
|
|
174
|
+
RIGHT: THREE.MOUSE.PAN,
|
|
175
175
|
}
|
|
176
176
|
this.orbitControl.update()
|
|
177
177
|
|
|
@@ -192,7 +192,7 @@ export default {
|
|
|
192
192
|
newCameraPosition = [
|
|
193
193
|
newCameraPosition.x,
|
|
194
194
|
newCameraPosition.y,
|
|
195
|
-
newCameraPosition.z
|
|
195
|
+
newCameraPosition.z,
|
|
196
196
|
]
|
|
197
197
|
target = [target.x, target.y, target.z]
|
|
198
198
|
this.setTweenTo({ position: newCameraPosition, target, duration: 500 })
|
|
@@ -213,7 +213,7 @@ export default {
|
|
|
213
213
|
newCameraPosition = [
|
|
214
214
|
newCameraPosition.x,
|
|
215
215
|
newCameraPosition.y,
|
|
216
|
-
newCameraPosition.z
|
|
216
|
+
newCameraPosition.z,
|
|
217
217
|
]
|
|
218
218
|
target = [target.x, target.y, target.z]
|
|
219
219
|
this.setTweenTo({ position: newCameraPosition, target, duration: 500 })
|
|
@@ -244,7 +244,7 @@ export default {
|
|
|
244
244
|
bottom,
|
|
245
245
|
zoom,
|
|
246
246
|
x,
|
|
247
|
-
y
|
|
247
|
+
y,
|
|
248
248
|
}) {
|
|
249
249
|
if (left > right) {
|
|
250
250
|
;[left, right] = [right, left]
|
|
@@ -259,7 +259,7 @@ export default {
|
|
|
259
259
|
bottom,
|
|
260
260
|
zoom,
|
|
261
261
|
x,
|
|
262
|
-
y
|
|
262
|
+
y,
|
|
263
263
|
}
|
|
264
264
|
},
|
|
265
265
|
setOrthographicCameraPositionFromCameraParameters(cameraParams) {
|
|
@@ -292,7 +292,7 @@ export default {
|
|
|
292
292
|
this.orbitControl.mouseButtons = {
|
|
293
293
|
LEFT: THREE.MOUSE.PAN,
|
|
294
294
|
MIDDLE: THREE.MOUSE.DOLLY,
|
|
295
|
-
RIGHT: THREE.MOUSE.ROTATE
|
|
295
|
+
RIGHT: THREE.MOUSE.ROTATE,
|
|
296
296
|
}
|
|
297
297
|
this.orbitControl.enableRotate = false
|
|
298
298
|
this.orbitControl.update()
|
|
@@ -318,7 +318,7 @@ export default {
|
|
|
318
318
|
bottom,
|
|
319
319
|
zoom,
|
|
320
320
|
x,
|
|
321
|
-
y
|
|
321
|
+
y,
|
|
322
322
|
})
|
|
323
323
|
},
|
|
324
324
|
setCameraInitialPosition() {
|
|
@@ -328,7 +328,7 @@ export default {
|
|
|
328
328
|
let targetVector = {
|
|
329
329
|
x: (bounds.xMax + bounds.xMin) / 2000,
|
|
330
330
|
y: (bounds.yMax + bounds.yMin) / 2000,
|
|
331
|
-
z: 0
|
|
331
|
+
z: 0,
|
|
332
332
|
}
|
|
333
333
|
let objectRadius_m = Math.max(
|
|
334
334
|
(bounds.xMax - bounds.xMin) / 2000,
|
|
@@ -341,7 +341,7 @@ export default {
|
|
|
341
341
|
const position = [
|
|
342
342
|
positionVector.x,
|
|
343
343
|
positionVector.y - distance,
|
|
344
|
-
positionVector.z
|
|
344
|
+
positionVector.z,
|
|
345
345
|
]
|
|
346
346
|
let target = [targetVector.x, targetVector.y, targetVector.z]
|
|
347
347
|
|
|
@@ -360,7 +360,7 @@ export default {
|
|
|
360
360
|
const target = [
|
|
361
361
|
targetVector.x / 1000,
|
|
362
362
|
targetVector.y / 1000,
|
|
363
|
-
targetVector.z / 1000
|
|
363
|
+
targetVector.z / 1000,
|
|
364
364
|
]
|
|
365
365
|
const position = [target[0], target[1] - 20, target[2] + 50]
|
|
366
366
|
this.setTweenTo({ position, target })
|
|
@@ -376,7 +376,7 @@ export default {
|
|
|
376
376
|
let targetVector = {
|
|
377
377
|
x: (bounds.xMax + bounds.xMin) / 2000,
|
|
378
378
|
y: (bounds.yMax + bounds.yMin) / 2000,
|
|
379
|
-
z: 0
|
|
379
|
+
z: 0,
|
|
380
380
|
}
|
|
381
381
|
let objectRadius_m =
|
|
382
382
|
marginAroundBuildingForCameraViewInMeter +
|
|
@@ -390,7 +390,7 @@ export default {
|
|
|
390
390
|
const position = [
|
|
391
391
|
positionVector.x,
|
|
392
392
|
positionVector.y - distance,
|
|
393
|
-
positionVector.z
|
|
393
|
+
positionVector.z,
|
|
394
394
|
]
|
|
395
395
|
let target = [targetVector.x, targetVector.y, targetVector.z]
|
|
396
396
|
this.setTweenTo({ position, target, fov: newFov })
|
|
@@ -404,7 +404,7 @@ export default {
|
|
|
404
404
|
let targetVector = {
|
|
405
405
|
x: (bounds.xMax + bounds.xMin) / 2000,
|
|
406
406
|
y: (bounds.yMax + bounds.yMin) / 2000,
|
|
407
|
-
z: 0
|
|
407
|
+
z: 0,
|
|
408
408
|
}
|
|
409
409
|
let objectRadius_m = Math.max(
|
|
410
410
|
(bounds.xMax - bounds.xMin) / 2000,
|
|
@@ -425,7 +425,7 @@ export default {
|
|
|
425
425
|
position,
|
|
426
426
|
target,
|
|
427
427
|
fov: newFov,
|
|
428
|
-
callback: this.turnPerspectiveCameraToOrthogonal
|
|
428
|
+
callback: this.turnPerspectiveCameraToOrthogonal,
|
|
429
429
|
})
|
|
430
430
|
},
|
|
431
431
|
setCameraOrthogonalTo(polygon) {
|
|
@@ -435,7 +435,7 @@ export default {
|
|
|
435
435
|
const target = [
|
|
436
436
|
targetVector.x / 1000,
|
|
437
437
|
targetVector.y / 1000,
|
|
438
|
-
targetVector.z / 1000
|
|
438
|
+
targetVector.z / 1000,
|
|
439
439
|
]
|
|
440
440
|
const positionVector = addVector(
|
|
441
441
|
polygonRef.meanPoint,
|
|
@@ -444,7 +444,7 @@ export default {
|
|
|
444
444
|
const position = [
|
|
445
445
|
positionVector.x / 1000,
|
|
446
446
|
positionVector.y / 1000 - 1,
|
|
447
|
-
positionVector.z / 1000
|
|
447
|
+
positionVector.z / 1000,
|
|
448
448
|
]
|
|
449
449
|
this.setTweenTo({ position, target })
|
|
450
450
|
}
|
|
@@ -456,12 +456,12 @@ export default {
|
|
|
456
456
|
const target = [
|
|
457
457
|
targetVector.x / 1000,
|
|
458
458
|
targetVector.y / 1000,
|
|
459
|
-
targetVector.z / 1000
|
|
459
|
+
targetVector.z / 1000,
|
|
460
460
|
]
|
|
461
461
|
let sideVector = {
|
|
462
462
|
x: -Math.cos(((polygonRef.direction + 45) * Math.PI) / 180),
|
|
463
463
|
y: Math.sin(((polygonRef.direction + 45) * Math.PI) / 180),
|
|
464
|
-
z: 0
|
|
464
|
+
z: 0,
|
|
465
465
|
}
|
|
466
466
|
const positionVector = addVector(
|
|
467
467
|
polygonRef.meanPoint,
|
|
@@ -470,7 +470,7 @@ export default {
|
|
|
470
470
|
const position = [
|
|
471
471
|
positionVector.x / 1000,
|
|
472
472
|
positionVector.y / 1000,
|
|
473
|
-
positionVector.z / 1000 + 5
|
|
473
|
+
positionVector.z / 1000 + 5,
|
|
474
474
|
]
|
|
475
475
|
this.setTweenTo({ position, target })
|
|
476
476
|
}
|
|
@@ -481,28 +481,28 @@ export default {
|
|
|
481
481
|
target,
|
|
482
482
|
fov = 50,
|
|
483
483
|
duration = 2000,
|
|
484
|
-
callback = () => {}
|
|
484
|
+
callback = () => {},
|
|
485
485
|
} = payload
|
|
486
486
|
TWEEN.removeAll()
|
|
487
487
|
if (this.camera) {
|
|
488
488
|
const currentTweenVar = {
|
|
489
|
-
t: 0
|
|
489
|
+
t: 0,
|
|
490
490
|
}
|
|
491
491
|
const initialTarget = {
|
|
492
492
|
x: this.orbitControl.target.x,
|
|
493
493
|
y: this.orbitControl.target.y,
|
|
494
|
-
z: this.orbitControl.target.z
|
|
494
|
+
z: this.orbitControl.target.z,
|
|
495
495
|
}
|
|
496
496
|
const initialFov = this.camera.fov
|
|
497
497
|
const initialCameraPosition = {
|
|
498
498
|
x: this.camera.position.x,
|
|
499
499
|
y: this.camera.position.y,
|
|
500
|
-
z: this.camera.position.z
|
|
500
|
+
z: this.camera.position.z,
|
|
501
501
|
}
|
|
502
502
|
const finalCameraPosition = {
|
|
503
503
|
x: position[0],
|
|
504
504
|
y: position[1],
|
|
505
|
-
z: position[2]
|
|
505
|
+
z: position[2],
|
|
506
506
|
}
|
|
507
507
|
if (position[0] == target[0] && position[1] == target[1]) {
|
|
508
508
|
const distance2D = getDistanceBetweenPoints(
|
|
@@ -529,7 +529,7 @@ export default {
|
|
|
529
529
|
const nextPosition = {
|
|
530
530
|
x: finalCameraPosition.x + newDistance * Math.cos(newAngle),
|
|
531
531
|
y: finalCameraPosition.y + newDistance * Math.sin(newAngle),
|
|
532
|
-
z: newAltitude
|
|
532
|
+
z: newAltitude,
|
|
533
533
|
}
|
|
534
534
|
this.camera.position.set(
|
|
535
535
|
nextPosition.x,
|
|
@@ -546,7 +546,7 @@ export default {
|
|
|
546
546
|
const nextTarget = {
|
|
547
547
|
x: initialTarget.x + t * (target[0] - initialTarget.x),
|
|
548
548
|
y: initialTarget.y + t * (target[1] - initialTarget.y),
|
|
549
|
-
z: initialTarget.z + t * (target[2] - initialTarget.z)
|
|
549
|
+
z: initialTarget.z + t * (target[2] - initialTarget.z),
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
this.orbitControl.target.set(
|
|
@@ -579,7 +579,7 @@ export default {
|
|
|
579
579
|
(1 - t) * (initialCameraPosition.y - finalCameraPosition.y),
|
|
580
580
|
z:
|
|
581
581
|
finalCameraPosition.z +
|
|
582
|
-
(1 - t) * (initialCameraPosition.z - finalCameraPosition.z)
|
|
582
|
+
(1 - t) * (initialCameraPosition.z - finalCameraPosition.z),
|
|
583
583
|
}
|
|
584
584
|
this.camera.position.set(
|
|
585
585
|
nextPosition.x,
|
|
@@ -589,7 +589,7 @@ export default {
|
|
|
589
589
|
const nextTarget = {
|
|
590
590
|
x: initialTarget.x + t * (target[0] - initialTarget.x),
|
|
591
591
|
y: initialTarget.y + t * (target[1] - initialTarget.y),
|
|
592
|
-
z: initialTarget.z + t * (target[2] - initialTarget.z)
|
|
592
|
+
z: initialTarget.z + t * (target[2] - initialTarget.z),
|
|
593
593
|
}
|
|
594
594
|
this.orbitControl.target.set(
|
|
595
595
|
nextTarget.x,
|
|
@@ -608,7 +608,7 @@ export default {
|
|
|
608
608
|
}
|
|
609
609
|
},
|
|
610
610
|
animate(e) {
|
|
611
|
-
if (
|
|
611
|
+
if (TWEEN) {
|
|
612
612
|
TWEEN.update()
|
|
613
613
|
}
|
|
614
614
|
let waitingBall = this.scene.getObjectByName('waitingBall')
|
|
@@ -623,11 +623,11 @@ export default {
|
|
|
623
623
|
this.render()
|
|
624
624
|
}
|
|
625
625
|
this.animationFrameId = requestAnimationFrame(this.animate)
|
|
626
|
-
}
|
|
626
|
+
},
|
|
627
627
|
},
|
|
628
628
|
|
|
629
629
|
beforeDestroy() {
|
|
630
630
|
TWEEN.removeAll()
|
|
631
631
|
cancelAnimationFrame(this.animationFrameId)
|
|
632
|
-
}
|
|
632
|
+
},
|
|
633
633
|
}
|
|
@@ -6,9 +6,9 @@ export default {
|
|
|
6
6
|
this.renderer = new THREE.WebGLRenderer({
|
|
7
7
|
antialias: true,
|
|
8
8
|
preserveDrawingBuffer: true,
|
|
9
|
-
powerPreference: 'high-performance'
|
|
9
|
+
powerPreference: 'high-performance',
|
|
10
10
|
})
|
|
11
11
|
this.raycaster = new THREE.Raycaster()
|
|
12
12
|
this.loader = new THREE.TextureLoader()
|
|
13
|
-
}
|
|
13
|
+
},
|
|
14
14
|
}
|