added screenspace to point helper
This commit is contained in:
@@ -72,24 +72,27 @@ function Point({ point }: { readonly point: Point }) {
|
|||||||
</ScreenSizer>
|
</ScreenSizer>
|
||||||
</DragControls>
|
</DragControls>
|
||||||
) : (
|
) : (
|
||||||
<group
|
<ScreenSizer
|
||||||
key={point.pointUuid}
|
key={point.pointUuid}
|
||||||
uuid={point.pointUuid}
|
uuid={point.pointUuid}
|
||||||
name={`${point.pointType}-Point`}
|
name={`${point.pointType}-Point`}
|
||||||
|
scale={1}
|
||||||
position={[point.position[0], 0.3, point.position[2]]}
|
position={[point.position[0], 0.3, point.position[2]]}
|
||||||
userData={point}
|
userData={point}
|
||||||
rotation={[Math.PI / 2, 0, 0]}
|
rotation={[Math.PI / 2, 0, 0]}
|
||||||
>
|
>
|
||||||
<mesh>
|
<mesh uuid={point.pointUuid} name={`${point.pointType}-Point`} userData={point}>
|
||||||
<torusGeometry args={[0.4, 0.1, 2, 16]} />
|
<mesh>
|
||||||
<meshBasicMaterial color="#6F42C1" />
|
<torusGeometry args={Constants.pointConfig.screenSpaceTorus} />
|
||||||
</mesh>
|
<meshBasicMaterial color={Constants.pointConfig.helperColor} />
|
||||||
|
</mesh>
|
||||||
|
|
||||||
<mesh position={[0, 0, 0]}>
|
<mesh>
|
||||||
<sphereGeometry args={[0.3, 8, 16]} />
|
<sphereGeometry args={Constants.pointConfig.screenSpaceSphere} />
|
||||||
<meshBasicMaterial color="white" />
|
<meshBasicMaterial color="white" />
|
||||||
|
</mesh>
|
||||||
</mesh>
|
</mesh>
|
||||||
</group>
|
</ScreenSizer>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import { getUserData } from "../../../../../functions/getUserData";
|
|||||||
import { useSceneContext } from "../../../sceneContext";
|
import { useSceneContext } from "../../../sceneContext";
|
||||||
import { useSelectedPoints } from "../../../../../store/simulation/useSimulationStore";
|
import { useSelectedPoints } from "../../../../../store/simulation/useSimulationStore";
|
||||||
import useModuleStore from "../../../../../store/ui/useModuleStore";
|
import useModuleStore from "../../../../../store/ui/useModuleStore";
|
||||||
import useWallAssetResponseHandler from "../../../../collaboration/responseHandler/useWallAssetResponseHandler";
|
|
||||||
import useWallResponseHandler from "../../../../collaboration/responseHandler/useWallResponseHandler";
|
|
||||||
import { calculateAssetTransformationOnWall } from "../../../../builder/wallAsset/Instances/Instance/functions/calculateAssetTransformationOnWall";
|
import { calculateAssetTransformationOnWall } from "../../../../builder/wallAsset/Instances/Instance/functions/calculateAssetTransformationOnWall";
|
||||||
|
|
||||||
import { upsertAisleApi } from "../../../../../services/factoryBuilder/aisle/upsertAisleApi";
|
import { upsertAisleApi } from "../../../../../services/factoryBuilder/aisle/upsertAisleApi";
|
||||||
@@ -18,6 +16,9 @@ import { upsertWallApi } from "../../../../../services/factoryBuilder/wall/upser
|
|||||||
import { upsertFloorApi } from "../../../../../services/factoryBuilder/floor/upsertFloorApi";
|
import { upsertFloorApi } from "../../../../../services/factoryBuilder/floor/upsertFloorApi";
|
||||||
import { upsertZoneApi } from "../../../../../services/factoryBuilder/zone/upsertZoneApi";
|
import { upsertZoneApi } from "../../../../../services/factoryBuilder/zone/upsertZoneApi";
|
||||||
import { upsertWallAssetApi } from "../../../../../services/factoryBuilder/asset/wallAsset/upsertWallAssetApi";
|
import { upsertWallAssetApi } from "../../../../../services/factoryBuilder/asset/wallAsset/upsertWallAssetApi";
|
||||||
|
|
||||||
|
import useWallAssetResponseHandler from "../../../../collaboration/responseHandler/useWallAssetResponseHandler";
|
||||||
|
import useWallResponseHandler from "../../../../collaboration/responseHandler/useWallResponseHandler";
|
||||||
import useAisleResponseHandler from "../../../../collaboration/responseHandler/useAisleResponseHandler";
|
import useAisleResponseHandler from "../../../../collaboration/responseHandler/useAisleResponseHandler";
|
||||||
|
|
||||||
function MoveControls2D({ movedObjects, setMovedObjects, pastedObjects, setPastedObjects, duplicatedObjects, setDuplicatedObjects, rotatedObjects, setRotatedObjects }: any) {
|
function MoveControls2D({ movedObjects, setMovedObjects, pastedObjects, setPastedObjects, duplicatedObjects, setDuplicatedObjects, rotatedObjects, setRotatedObjects }: any) {
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ export type PointConfig = {
|
|||||||
defaultOuterColor: string;
|
defaultOuterColor: string;
|
||||||
deleteColor: string;
|
deleteColor: string;
|
||||||
screenSpaceBoxScale: [number, number, number];
|
screenSpaceBoxScale: [number, number, number];
|
||||||
|
screenSpaceSphere: [number, number, number];
|
||||||
|
screenSpaceTorus: [number, number, number, number];
|
||||||
boxScale: [number, number, number];
|
boxScale: [number, number, number];
|
||||||
wallOuterColor: string;
|
wallOuterColor: string;
|
||||||
floorOuterColor: string;
|
floorOuterColor: string;
|
||||||
@@ -319,13 +321,15 @@ export const pointConfig: PointConfig = {
|
|||||||
defaultOuterColor: "#ffffff", // Default outer color of the points
|
defaultOuterColor: "#ffffff", // Default outer color of the points
|
||||||
deleteColor: "#ff0000", // Color of the points when deleting
|
deleteColor: "#ff0000", // Color of the points when deleting
|
||||||
screenSpaceBoxScale: [20, 20, 20], // Scale of the points
|
screenSpaceBoxScale: [20, 20, 20], // Scale of the points
|
||||||
|
screenSpaceSphere: [7.5, 8, 16], // [Radius, WidthSegment, HeightSegment]
|
||||||
|
screenSpaceTorus: [7.5, 5, 2, 16], // [Radius, Tube, RadicalSegment, TublarSegment]
|
||||||
boxScale: [0.5, 0.5, 0.5], // Scale of the points
|
boxScale: [0.5, 0.5, 0.5], // Scale of the points
|
||||||
wallOuterColor: "#C7C7C7", // Outer color of the wall points
|
wallOuterColor: "#C7C7C7", // Outer color of the wall points
|
||||||
floorOuterColor: "#808080", // Outer color of the floor points
|
floorOuterColor: "#808080", // Outer color of the floor points
|
||||||
aisleOuterColor: "#FBBC05", // Outer color of the aisle points
|
aisleOuterColor: "#FBBC05", // Outer color of the aisle points
|
||||||
zoneOuterColor: "#007BFF", // Outer color of the zone points
|
zoneOuterColor: "#007BFF", // Outer color of the zone points
|
||||||
snappingThreshold: 1, // Threshold for snapping
|
|
||||||
helperColor: "#C164FF", // Color of the helper lines
|
helperColor: "#C164FF", // Color of the helper lines
|
||||||
|
snappingThreshold: 1, // Threshold for snapping
|
||||||
};
|
};
|
||||||
|
|
||||||
export const lineConfig: LineConfig = {
|
export const lineConfig: LineConfig = {
|
||||||
|
|||||||
Reference in New Issue
Block a user