diff --git a/app/src/modules/builder/asset/functions/assetBoundingBox.tsx b/app/src/modules/builder/asset/functions/assetBoundingBox.tsx
index b26485d..5923321 100644
--- a/app/src/modules/builder/asset/functions/assetBoundingBox.tsx
+++ b/app/src/modules/builder/asset/functions/assetBoundingBox.tsx
@@ -2,13 +2,14 @@ import { Line } from "@react-three/drei";
import { Box3, Vector3 } from "three";
import { useMemo } from "react";
-export const AssetBoundingBox = ({ name, boundingBox, color, lineWidth, }: { name: string; boundingBox: Box3 | null; color: string; lineWidth: number; }) => {
- const { points } = useMemo(() => {
- if (!boundingBox) return { points: [], center: new Vector3() };
+export const AssetBoundingBox = ({ name, boundingBox, color, lineWidth }: { name: string; boundingBox: Box3 | null; color: string; lineWidth: number; }) => {
+ const { points, size, center } = useMemo(() => {
+ if (!boundingBox) { return { points: [], center: new Vector3(), size: new Vector3(), }; }
const min = boundingBox.min;
const max = boundingBox.max;
const center = boundingBox.getCenter(new Vector3());
+ const size = boundingBox.getSize(new Vector3());
const edges: Array<[number, number, number]> = [
[min.x, min.y, min.z], [max.x, min.y, min.z],
@@ -27,7 +28,7 @@ export const AssetBoundingBox = ({ name, boundingBox, color, lineWidth, }: { nam
[min.x, max.y, min.z], [min.x, max.y, max.z],
];
- return { points: edges, center };
+ return { points: edges, center, size };
}, [boundingBox]);
if (!boundingBox) return null;
@@ -41,6 +42,10 @@ export const AssetBoundingBox = ({ name, boundingBox, color, lineWidth, }: { nam
color={color}
lineWidth={lineWidth}
/>
+
+
+
+
);
};
diff --git a/app/src/modules/builder/wallAsset/Instances/Instances/wallAssetInstance.tsx b/app/src/modules/builder/wallAsset/Instances/Instances/wallAssetInstance.tsx
index 1a674c7..203223d 100644
--- a/app/src/modules/builder/wallAsset/Instances/Instances/wallAssetInstance.tsx
+++ b/app/src/modules/builder/wallAsset/Instances/Instances/wallAssetInstance.tsx
@@ -242,7 +242,7 @@ function WallAssetInstance({ wallAsset }: { wallAsset: WallAsset }) {
visible={wallAsset.isVisible}
userData={wallAsset}
>
-
+
@@ -265,7 +265,7 @@ function WallAssetInstance({ wallAsset }: { wallAsset: WallAsset }) {
e.stopPropagation();
let currentObject = e.object as THREE.Object3D;
while (currentObject) {
- if (currentObject.name === "Scene") {
+ if (currentObject.userData.wallUuid) {
break;
}
currentObject = currentObject.parent as THREE.Object3D;
@@ -286,7 +286,7 @@ function WallAssetInstance({ wallAsset }: { wallAsset: WallAsset }) {
e.stopPropagation();
let currentObject = e.object as THREE.Object3D;
while (currentObject) {
- if (currentObject.name === "Scene") {
+ if (currentObject.userData.wallUuid) {
break;
}
currentObject = currentObject.parent as THREE.Object3D;
diff --git a/app/src/modules/scene/controls/selectionControls/selection3D/moveControls3D.tsx b/app/src/modules/scene/controls/selectionControls/selection3D/moveControls3D.tsx
index e58cc44..88b8bf6 100644
--- a/app/src/modules/scene/controls/selectionControls/selection3D/moveControls3D.tsx
+++ b/app/src/modules/scene/controls/selectionControls/selection3D/moveControls3D.tsx
@@ -208,7 +208,7 @@ function MoveControls3D({
if (dragOffset) {
const rawBasePosition = new THREE.Vector3().addVectors(intersectionPoint, dragOffset);
- let moveSpeed = keyEvent.includes("Shift") ? 0.25 : 1;
+ let moveSpeed = keyEvent.includes("Shift") ? 0.05 : 1;
const initialBasePosition = initialPositions[movedObjects[0].uuid];
const positionDifference = new THREE.Vector3().subVectors(rawBasePosition, initialBasePosition);