feat: Refactor asset loading and model handling; remove unused loadInitialWallItems function and streamline GLTFLoader usage across components

This commit is contained in:
2025-08-01 14:20:04 +05:30
parent 9be044c941
commit 14d03bbdd2
10 changed files with 300 additions and 425 deletions

View File

@@ -55,7 +55,6 @@ const ArmBotUI = () => {
})
}
// Fetch and setup selected ArmBot data
useEffect(() => {
if (selectedEventSphere) {
const selectedArmBot = getEventByModelUuid(selectedProduct.productUuid, selectedEventSphere.userData.modelUuid);
@@ -86,13 +85,11 @@ const ArmBotUI = () => {
const modelData = getEventByModelUuid(selectedProduct.productUuid, modelUuid);
if (modelData?.type === "roboticArm") {
const baseX = modelData.point.position?.[0] || 0;
const baseY = modelData.point.position?.[1] || 0;;
const baseZ = modelData.point.position?.[2] || 0;
const baseY = modelData.point.position?.[1] || 0;
return {
pick: [baseX, baseY, baseZ + 0.5],
drop: [baseX, baseY, baseZ - 0.5],
default: [baseX, baseY, baseZ],
pick: [0, baseY, 0 + 0.5],
drop: [0, baseY, 0 - 0.5],
default: [0, baseY, 0],
};
}
@@ -225,7 +222,7 @@ const ArmBotUI = () => {
</React.Fragment>
);
} else {
return null; // important! must return something
return null;
}
})}
</>