2025-07-02 15:07:31 +05:30
|
|
|
import HumanInstances from './instances/humanInstances'
|
2025-07-03 12:09:31 +05:30
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
|
import { useSelectedEventSphere } from "../../../store/simulation/useSimulationStore";
|
|
|
|
|
import { usePlayButtonStore } from "../../../store/usePlayButtonStore";
|
|
|
|
|
import { useSceneContext } from "../../scene/sceneContext";
|
2025-07-02 15:07:31 +05:30
|
|
|
|
|
|
|
|
function Human() {
|
2025-07-03 12:09:31 +05:30
|
|
|
const { humanStore } = useSceneContext();
|
|
|
|
|
const { getHumanById } = humanStore();
|
|
|
|
|
const { selectedEventSphere } = useSelectedEventSphere();
|
|
|
|
|
const { isPlaying } = usePlayButtonStore();
|
|
|
|
|
const [isHumanSelected, setIsHumanSelected] = useState(false);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (selectedEventSphere) {
|
|
|
|
|
const selectedVehicle = getHumanById(selectedEventSphere.userData.modelUuid);
|
|
|
|
|
if (selectedVehicle) {
|
|
|
|
|
setIsHumanSelected(true);
|
|
|
|
|
} else {
|
|
|
|
|
setIsHumanSelected(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, [getHumanById, selectedEventSphere])
|
|
|
|
|
|
2025-07-02 15:07:31 +05:30
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
|
|
<HumanInstances />
|
|
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Human
|