@eturnity/eturnity_3d 8.46.1 → 8.46.2-EPDM-13987.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 +2 -2
- package/src/helper/cameraMixin.js +34 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eturnity/eturnity_3d",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "8.46.1",
|
|
4
|
+
"version": "8.46.2-EPDM-13987.1",
|
|
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": "8.46.
|
|
19
|
+
"@eturnity/eturnity_maths": "8.46.2-EPDM-13987.2",
|
|
20
20
|
"@originjs/vite-plugin-commonjs": "1.0.3",
|
|
21
21
|
"core-js": "3.30.2",
|
|
22
22
|
"cors": "2.8.5",
|
|
@@ -469,7 +469,37 @@ export default {
|
|
|
469
469
|
this.setTweenTo({ position, target, fov: newFov })
|
|
470
470
|
}
|
|
471
471
|
},
|
|
472
|
-
|
|
472
|
+
setCameraGlobalAlmostVerticalPosition() {
|
|
473
|
+
let position, target
|
|
474
|
+
if (this.roofs.length != 0) {
|
|
475
|
+
let bounds = this.roofsBounds
|
|
476
|
+
let targetVector = {
|
|
477
|
+
x: (bounds.xMax + bounds.xMin) / 2000,
|
|
478
|
+
y: (bounds.yMax + bounds.yMin) / 2000,
|
|
479
|
+
z: 0,
|
|
480
|
+
}
|
|
481
|
+
let objectRadius_m = Math.max(
|
|
482
|
+
(bounds.xMax - bounds.xMin) / 2000,
|
|
483
|
+
(bounds.yMax - bounds.yMin) / 2000
|
|
484
|
+
)
|
|
485
|
+
|
|
486
|
+
let distance =
|
|
487
|
+
2 *
|
|
488
|
+
(objectRadius_m / Math.sin(((this.camera.fov / 2) * Math.PI) / 180))
|
|
489
|
+
let cameraMoveVector = { x: 0, y: 0, z: distance }
|
|
490
|
+
const positionVector = addVector(targetVector, cameraMoveVector)
|
|
491
|
+
position = [positionVector.x, positionVector.y - 1, positionVector.z]
|
|
492
|
+
target = [targetVector.x, targetVector.y, targetVector.z]
|
|
493
|
+
} else {
|
|
494
|
+
position = [0, -1, 300]
|
|
495
|
+
target = [0, 0, 0]
|
|
496
|
+
}
|
|
497
|
+
this.setTweenTo({
|
|
498
|
+
position,
|
|
499
|
+
target,
|
|
500
|
+
})
|
|
501
|
+
},
|
|
502
|
+
setCameraGlobalVerticalPosition(changeCameraTypeAsCallback = true) {
|
|
473
503
|
let position, target
|
|
474
504
|
let newFov = 10
|
|
475
505
|
if (this.roofs.length != 0) {
|
|
@@ -498,7 +528,9 @@ export default {
|
|
|
498
528
|
position,
|
|
499
529
|
target,
|
|
500
530
|
fov: newFov,
|
|
501
|
-
callback:
|
|
531
|
+
callback: changeCameraTypeAsCallback
|
|
532
|
+
? this.turnPerspectiveCameraToOrthogonal
|
|
533
|
+
: undefined,
|
|
502
534
|
})
|
|
503
535
|
},
|
|
504
536
|
setCameraOrthogonalTo(polygon) {
|