From 8d581ce7822e74276567f0984113165d48c88680 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Fri, 21 Oct 2022 19:05:42 +0200 Subject: [PATCH] Fix raytracing --- src/MapViewer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MapViewer.js b/src/MapViewer.js index 3f0bc5c..812a5c0 100644 --- a/src/MapViewer.js +++ b/src/MapViewer.js @@ -188,6 +188,7 @@ export class MapViewer { let lowresHits = []; let hiresHit = null; let covered = false; + for (let i = 0; i < intersects.length; i++) { if (intersects[i].object){ let object = intersects[i].object; @@ -208,12 +209,12 @@ export class MapViewer { while(parentRoot.parent) parentRoot = parentRoot.parent; for (let l = 0; l < this.map.lowresTileManager.length; l++) { - if (parentRoot === this.map.lowresTileManager[l].scene) { + if (parentRoot === this.map.lowresTileManager[l].sceneParent) { if (!lowresHits[l]) lowresHits[l] = intersects[i]; } } - if (parentRoot === this.map.hiresTileManager.scene) { + if (parentRoot === this.map.hiresTileManager.sceneParent) { if (!hiresHit) hiresHit = intersects[i]; } @@ -224,7 +225,7 @@ export class MapViewer { })) return; } - if (parentRoot !== this.map.lowresTileManager[0].scene) { + if (parentRoot !== this.map.lowresTileManager[0].sceneParent) { covered = true; } }