Fix click-raytracing in combination with scene-shifting
This commit is contained in:
parent
1f8d2464a0
commit
1d202bbd89
|
@ -178,11 +178,21 @@ export class MapViewer {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.map && this.map.isLoaded){
|
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);
|
this.raycaster.setFromCamera(normalizedScreenPos, this.camera);
|
||||||
|
|
||||||
// check Object3D interactions
|
// check Object3D interactions
|
||||||
const intersectScenes = [this.map.hiresTileManager.scene, this.markers];
|
const intersectScenes = [this.map.hiresTileManager.scene, this.markers];
|
||||||
for (let i = 0; i < this.map.lowresTileManager.length; i++) {
|
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);
|
intersectScenes.push(this.map.lowresTileManager[i].scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue