From be705dad583613374ce2a66266f23bcd025af444 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Sun, 26 Mar 2023 12:13:47 +0200 Subject: [PATCH] Tidy up latest change a little and add a comment --- BlueMapCommon/webapp/src/js/MapViewer.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/BlueMapCommon/webapp/src/js/MapViewer.js b/BlueMapCommon/webapp/src/js/MapViewer.js index a81bd850..12a79ecd 100644 --- a/BlueMapCommon/webapp/src/js/MapViewer.js +++ b/BlueMapCommon/webapp/src/js/MapViewer.js @@ -179,16 +179,19 @@ export class MapViewer { if (this.map && this.map.isLoaded){ this.camera.updateMatrixWorld() + this.raycaster.setFromCamera(normalizedScreenPos, this.camera); + // check Object3D interactions + + // make sure the scene is at 0,0 (render() might have shifted it) 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++) { + + // make sure the scene is at 0,0 (render() might have shifted it) let sPos = this.map.lowresTileManager[i].scene.position; sPos.x = 0; sPos.z = 0; this.map.lowresTileManager[i].scene.updateMatrixWorld();