From 31edae543b7c4957d71f4de05b79ec7e4c319ab3 Mon Sep 17 00:00:00 2001 From: Konrad Heidler Date: Mon, 19 Aug 2024 17:25:35 +0200 Subject: [PATCH] Terrain toggle now only hides terrain tiles instead of destroying them --- src/components/ThreeViewer/Scene.js | 2 +- src/components/ThreeViewer/Terrain.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/ThreeViewer/Scene.js b/src/components/ThreeViewer/Scene.js index c7e0b86d..40948d81 100644 --- a/src/components/ThreeViewer/Scene.js +++ b/src/components/ThreeViewer/Scene.js @@ -79,7 +79,7 @@ const Scene = ({ setPVPoints={setPVPoints} /> - {simulationMesh != undefined && showTerrain && } + {simulationMesh != undefined && } ) } diff --git a/src/components/ThreeViewer/Terrain.js b/src/components/ThreeViewer/Terrain.js index 8f51ab28..78ae3d21 100644 --- a/src/components/ThreeViewer/Terrain.js +++ b/src/components/ThreeViewer/Terrain.js @@ -108,7 +108,7 @@ const TerrainTile = (props) => { return mesh } -const Terrain = () => { +const Terrain = ({visible}) => { const [x, y] = coordinatesXY15 let tiles = [] const tx = Math.floor(x * 16) @@ -127,7 +127,11 @@ const Terrain = () => { tiles.push() } - return <>{tiles} + console.log(`Terrain visible:`) + console.log(visible); + return + {tiles} + } export default Terrain