@eturnity/eturnity_3d 9.16.0 → 9.19.0-EPDM-19633.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/helper/cameraMixin.js +30 -0
- package/src/helper/render/loader.js +15 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eturnity/eturnity_3d",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.19.0-EPDM-19633.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"merge-remote-master": "node scripts/merge-remote-master.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@eturnity/eturnity_maths": "9.
|
|
19
|
+
"@eturnity/eturnity_maths": "9.19.0",
|
|
20
20
|
"@originjs/vite-plugin-commonjs": "1.0.3",
|
|
21
21
|
"core-js": "3.30.2",
|
|
22
22
|
"cors": "2.8.5",
|
|
@@ -174,6 +174,7 @@ export default {
|
|
|
174
174
|
},
|
|
175
175
|
turnOrthogonalCameraToPerspective() {
|
|
176
176
|
if (this.perspectiveCamera.id == this.camera.id) {
|
|
177
|
+
this.setCameraGlobalPosition({ duration: 1000 })
|
|
177
178
|
return
|
|
178
179
|
}
|
|
179
180
|
this.camera = this.perspectiveCamera
|
|
@@ -398,7 +399,21 @@ export default {
|
|
|
398
399
|
setCameraInitialPosition() {
|
|
399
400
|
if (this.roofs.length == 0) return
|
|
400
401
|
let newFov = 50
|
|
402
|
+
if (
|
|
403
|
+
this.roofsBounds.xMax === Infinity ||
|
|
404
|
+
this.roofsBounds.xMin === -Infinity ||
|
|
405
|
+
this.roofsBounds.yMax === Infinity ||
|
|
406
|
+
this.roofsBounds.yMin === -Infinity
|
|
407
|
+
) {
|
|
408
|
+
this.roofsBounds = {
|
|
409
|
+
xMin: -10000,
|
|
410
|
+
xMax: 10000,
|
|
411
|
+
yMin: -10000,
|
|
412
|
+
yMax: 10000,
|
|
413
|
+
}
|
|
414
|
+
}
|
|
401
415
|
let bounds = this.roofsBounds
|
|
416
|
+
|
|
402
417
|
let targetVector = {
|
|
403
418
|
x: (bounds.xMax + bounds.xMin) / 2000,
|
|
404
419
|
y: (bounds.yMax + bounds.yMin) / 2000,
|
|
@@ -449,6 +464,21 @@ export default {
|
|
|
449
464
|
} else {
|
|
450
465
|
let newFov = 50
|
|
451
466
|
let bounds = this.roofsBounds
|
|
467
|
+
if (
|
|
468
|
+
bounds.xMax === Infinity ||
|
|
469
|
+
bounds.xMin === -Infinity ||
|
|
470
|
+
bounds.yMax === Infinity ||
|
|
471
|
+
bounds.yMin === -Infinity
|
|
472
|
+
) {
|
|
473
|
+
bounds = {
|
|
474
|
+
xMin: -10000,
|
|
475
|
+
xMax: 10000,
|
|
476
|
+
yMin: -10000,
|
|
477
|
+
yMax: 10000,
|
|
478
|
+
zMin: 0,
|
|
479
|
+
zMax: 0,
|
|
480
|
+
}
|
|
481
|
+
}
|
|
452
482
|
let targetVector = {
|
|
453
483
|
x: (bounds.xMax + bounds.xMin) / 2000,
|
|
454
484
|
y: (bounds.yMax + bounds.yMin) / 2000,
|
|
@@ -4,9 +4,12 @@ export default {
|
|
|
4
4
|
methods: {
|
|
5
5
|
loadTextureAsync(url) {
|
|
6
6
|
return new Promise((resolve) => {
|
|
7
|
-
this.loader.load(
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
this.loader.load(
|
|
8
|
+
url,
|
|
9
|
+
(texture) => resolve(texture),
|
|
10
|
+
() => {},
|
|
11
|
+
() => resolve(null)
|
|
12
|
+
)
|
|
10
13
|
})
|
|
11
14
|
},
|
|
12
15
|
async loadNewPanelTextures() {
|
|
@@ -42,13 +45,20 @@ export default {
|
|
|
42
45
|
const promiseArray = this.moduleFields.map(async (mf) => {
|
|
43
46
|
const pvId = mf.data.component_id_pv_module
|
|
44
47
|
if (!this.material.panel[pvId]) {
|
|
48
|
+
const defaultPanelMaterial =
|
|
49
|
+
this.material.panel[
|
|
50
|
+
`default_${mf.pvData.module_texture_version_id || 0}`
|
|
51
|
+
]
|
|
45
52
|
if (!mf.pvData.texture_img_url) {
|
|
46
|
-
this.material.panel[pvId] =
|
|
47
|
-
this.material.panel[`default_${this.moduleTextureVersionId}`]
|
|
53
|
+
this.material.panel[pvId] = defaultPanelMaterial
|
|
48
54
|
} else {
|
|
49
55
|
const texture = await this.loadTextureAsync(
|
|
50
56
|
mf.pvData.texture_img_url
|
|
51
57
|
)
|
|
58
|
+
if (!texture) {
|
|
59
|
+
this.material.panel[pvId] = defaultPanelMaterial
|
|
60
|
+
return
|
|
61
|
+
}
|
|
52
62
|
texture.encoding = THREE.sRGBEncoding
|
|
53
63
|
texture.colorSpace = THREE.SRGBColorSpace
|
|
54
64
|
this.material.panel[pvId] = new THREE.MeshPhongMaterial({
|