Skip to content

Commit 1d202bb

Browse files
committed
Fix click-raytracing in combination with scene-shifting
1 parent 1f8d246 commit 1d202bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

BlueMapCommon/webapp/src/js/MapViewer.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,21 @@ export class MapViewer {
178178
);
179179

180180
if (this.map && this.map.isLoaded){
181+
this.camera.updateMatrixWorld()
182+
183+
let sPos = this.map.hiresTileManager.scene.position;
184+
sPos.x = 0; sPos.z = 0;
185+
this.map.hiresTileManager.scene.updateMatrixWorld();
186+
181187
this.raycaster.setFromCamera(normalizedScreenPos, this.camera);
182188

183189
// check Object3D interactions
184190
const intersectScenes = [this.map.hiresTileManager.scene, this.markers];
185191
for (let i = 0; i < this.map.lowresTileManager.length; i++) {
192+
let sPos = this.map.lowresTileManager[i].scene.position;
193+
sPos.x = 0; sPos.z = 0;
194+
this.map.lowresTileManager[i].scene.updateMatrixWorld();
195+
186196
intersectScenes.push(this.map.lowresTileManager[i].scene);
187197
}
188198

0 commit comments

Comments
 (0)