Fix raytracing

This commit is contained in:
Lukas Rieger (Blue) 2022-10-21 19:05:42 +02:00
parent 5be6dc8089
commit 8d581ce782
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
1 changed files with 4 additions and 3 deletions

View File

@ -188,6 +188,7 @@ export class MapViewer {
let lowresHits = []; let lowresHits = [];
let hiresHit = null; let hiresHit = null;
let covered = false; let covered = false;
for (let i = 0; i < intersects.length; i++) { for (let i = 0; i < intersects.length; i++) {
if (intersects[i].object){ if (intersects[i].object){
let object = intersects[i].object; let object = intersects[i].object;
@ -208,12 +209,12 @@ export class MapViewer {
while(parentRoot.parent) parentRoot = parentRoot.parent; while(parentRoot.parent) parentRoot = parentRoot.parent;
for (let l = 0; l < this.map.lowresTileManager.length; l++) { 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 (!lowresHits[l]) lowresHits[l] = intersects[i];
} }
} }
if (parentRoot === this.map.hiresTileManager.scene) { if (parentRoot === this.map.hiresTileManager.sceneParent) {
if (!hiresHit) hiresHit = intersects[i]; if (!hiresHit) hiresHit = intersects[i];
} }
@ -224,7 +225,7 @@ export class MapViewer {
})) return; })) return;
} }
if (parentRoot !== this.map.lowresTileManager[0].scene) { if (parentRoot !== this.map.lowresTileManager[0].sceneParent) {
covered = true; covered = true;
} }
} }