Refactor HeatMap component to utilize useHeatMapStore and log bakedPoints; enable baked point addition in RealTimeHeatMap

This commit is contained in:
2025-09-05 17:40:07 +05:30
parent 9ba98d0120
commit d3abfe939a
3 changed files with 2720 additions and 474 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,18 @@
import RealTimeHeatMap from "./realTime/realTimeHeatMap";
import BakedHeatMap from "./baked/bakedHeatMap";
import { useEffect } from "react";
import { useHeatMapStore } from "../../store/simulation/useHeatMapStore";
function HeatMap() {
const { bakedPoints, setBakedPoints } = useHeatMapStore();
useEffect(() => {
// console.log("bakedPoints: ", bakedPoints);
}, [bakedPoints]);
return (
<>
<RealTimeHeatMap />
{/* <RealTimeHeatMap /> */}
<BakedHeatMap />
</>

View File

@@ -126,7 +126,7 @@ const RealTimeHeatMap = () => {
})()
: model.position;
// addBakedPoint({ x: pos.x, y: pos.z });
addBakedPoint({ x: pos.x, y: pos.z });
updatedPoints.push({ x: pos.x, y: pos.z, strength: 0.3, lastUpdated: now });
});