2025-09-10 16:01:01 +05:30
|
|
|
import * as THREE from "three";
|
2025-09-15 10:58:42 +05:30
|
|
|
import { Box, ScreenSizer } from "@react-three/drei";
|
2025-09-10 16:01:01 +05:30
|
|
|
import * as Constants from "../../../../types/world/worldConstants";
|
|
|
|
|
|
2025-09-11 15:30:11 +05:30
|
|
|
import BoxMaterial from "../../wrappers/materials/boxMaterial";
|
2025-06-10 15:28:23 +05:30
|
|
|
|
|
|
|
|
function ReferencePoint({ point }: { readonly point: Point }) {
|
2025-09-15 10:58:42 +05:30
|
|
|
const boxScale: [number, number, number] = Constants.pointConfig.screenSpaceBoxScale;
|
2025-06-10 15:28:23 +05:30
|
|
|
const colors = {
|
|
|
|
|
defaultInnerColor: Constants.pointConfig.defaultInnerColor,
|
|
|
|
|
defaultOuterColor: Constants.pointConfig.helperColor,
|
|
|
|
|
defaultDeleteColor: Constants.pointConfig.deleteColor,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (!point) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-10 16:01:01 +05:30
|
|
|
let pointName = "Point";
|
|
|
|
|
if (point.pointType === "Wall") {
|
|
|
|
|
pointName = "Wall-Point";
|
|
|
|
|
} else if (point.pointType === "Floor") {
|
|
|
|
|
pointName = "Floor-Point";
|
|
|
|
|
} else if (point.pointType === "Aisle") {
|
|
|
|
|
pointName = "Aisle-Point";
|
|
|
|
|
} else if (point.pointType === "Zone") {
|
|
|
|
|
pointName = "Zone-Point";
|
2025-09-02 15:21:13 +05:30
|
|
|
}
|
2025-06-26 17:47:32 +05:30
|
|
|
|
2025-09-11 15:30:11 +05:30
|
|
|
if (!point) return null;
|
2025-09-10 16:01:01 +05:30
|
|
|
|
2025-06-10 15:28:23 +05:30
|
|
|
return (
|
2025-09-15 10:58:42 +05:30
|
|
|
<ScreenSizer scale={1} position={new THREE.Vector3(...point.position)} name={pointName} uuid={point.pointUuid} userData={point}>
|
|
|
|
|
<Box args={boxScale}>
|
|
|
|
|
<BoxMaterial variant="box1" uOuterColor={colors.defaultOuterColor} uInnerColor={colors.defaultInnerColor} />
|
|
|
|
|
</Box>
|
|
|
|
|
</ScreenSizer>
|
2025-06-10 15:28:23 +05:30
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-10 16:01:01 +05:30
|
|
|
export default ReferencePoint;
|