Skip to content

Commit

Permalink
Merge pull request #69 from tobias74/patch-1
Browse files Browse the repository at this point in the history
Only use first intersection with the terrain
  • Loading branch information
tentone authored Jul 15, 2024
2 parents 259e87f + 8331aaf commit 7eddf2e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/lod/LODRaycast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ export class LODRaycast implements LODControl

// Check intersection
this.raycaster.setFromCamera(this.mouse, camera);
this.raycaster.intersectObjects(view.children, true, intersects);

let myIntersects = [];
this.raycaster.intersectObjects(view.children, true, myIntersects);
if (myIntersects.length > 0) {

Check failure on line 69 in source/lod/LODRaycast.ts

View workflow job for this annotation

GitHub Actions / ESLint

Opening curly brace appears on the same line as controlling statement
// Only use first intersection with the terrain
intersects.push(myIntersects[0]);
}
}

for (let i = 0; i < intersects.length; i++)
Expand Down

0 comments on commit 7eddf2e

Please sign in to comment.