Refactor HeatMap component to utilize useHeatMapStore and log bakedPoints; enable baked point addition in RealTimeHeatMap
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,18 @@
|
|||||||
import RealTimeHeatMap from "./realTime/realTimeHeatMap";
|
import RealTimeHeatMap from "./realTime/realTimeHeatMap";
|
||||||
import BakedHeatMap from "./baked/bakedHeatMap";
|
import BakedHeatMap from "./baked/bakedHeatMap";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import { useHeatMapStore } from "../../store/simulation/useHeatMapStore";
|
||||||
|
|
||||||
function HeatMap() {
|
function HeatMap() {
|
||||||
|
const { bakedPoints, setBakedPoints } = useHeatMapStore();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// console.log("bakedPoints: ", bakedPoints);
|
||||||
|
}, [bakedPoints]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<RealTimeHeatMap />
|
{/* <RealTimeHeatMap /> */}
|
||||||
|
|
||||||
<BakedHeatMap />
|
<BakedHeatMap />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const RealTimeHeatMap = () => {
|
|||||||
})()
|
})()
|
||||||
: model.position;
|
: 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 });
|
updatedPoints.push({ x: pos.x, y: pos.z, strength: 0.3, lastUpdated: now });
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user