From 1d202bbd891a5df31e2807e0a99a162ada76e5f7 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Sun, 26 Mar 2023 12:05:04 +0200 Subject: [PATCH] Fix click-raytracing in combination with scene-shifting --- BlueMapCommon/webapp/src/js/MapViewer.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BlueMapCommon/webapp/src/js/MapViewer.js b/BlueMapCommon/webapp/src/js/MapViewer.js index bab735fc..a81bd850 100644 --- a/BlueMapCommon/webapp/src/js/MapViewer.js +++ b/BlueMapCommon/webapp/src/js/MapViewer.js @@ -178,11 +178,21 @@ export class MapViewer { ); if (this.map && this.map.isLoaded){ + this.camera.updateMatrixWorld() + + let sPos = this.map.hiresTileManager.scene.position; + sPos.x = 0; sPos.z = 0; + this.map.hiresTileManager.scene.updateMatrixWorld(); + this.raycaster.setFromCamera(normalizedScreenPos, this.camera); // check Object3D interactions const intersectScenes = [this.map.hiresTileManager.scene, this.markers]; for (let i = 0; i < this.map.lowresTileManager.length; i++) { + let sPos = this.map.lowresTileManager[i].scene.position; + sPos.x = 0; sPos.z = 0; + this.map.lowresTileManager[i].scene.updateMatrixWorld(); + intersectScenes.push(this.map.lowresTileManager[i].scene); }