Skip to content

Commit be705da

Browse files
committed
Tidy up latest change a little and add a comment
1 parent 1d202bb commit be705da

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

BlueMapCommon/webapp/src/js/MapViewer.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,19 @@ export class MapViewer {
179179

180180
if (this.map && this.map.isLoaded){
181181
this.camera.updateMatrixWorld()
182+
this.raycaster.setFromCamera(normalizedScreenPos, this.camera);
183+
184+
// check Object3D interactions
182185

186+
// make sure the scene is at 0,0 (render() might have shifted it)
183187
let sPos = this.map.hiresTileManager.scene.position;
184188
sPos.x = 0; sPos.z = 0;
185189
this.map.hiresTileManager.scene.updateMatrixWorld();
186190

187-
this.raycaster.setFromCamera(normalizedScreenPos, this.camera);
188-
189-
// check Object3D interactions
190191
const intersectScenes = [this.map.hiresTileManager.scene, this.markers];
191192
for (let i = 0; i < this.map.lowresTileManager.length; i++) {
193+
194+
// make sure the scene is at 0,0 (render() might have shifted it)
192195
let sPos = this.map.lowresTileManager[i].scene.position;
193196
sPos.x = 0; sPos.z = 0;
194197
this.map.lowresTileManager[i].scene.updateMatrixWorld();

0 commit comments

Comments
 (0)