Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-20 20:50:41 +00:00
parent 99ddbe793a
commit 36aa0c802e
+19 -2
View File
@@ -596,8 +596,25 @@ function PositionDragHandler() {
rotX: ft.rotX + dy * sens, rotX: ft.rotX + dy * sens,
}); });
} }
} else if (button === 1 || (button === 0 && shiftKey)) { } else if (button === 1) {
// Middle or Shift+left: depth (Z in camera space) // Middle button (wheel): roll around the piece's own longitudinal axis
const sens = 0.5;
let dominant: 'x' | 'y' | 'z' = 'x';
scene.traverse((o) => {
if (o.userData?.modelId === active.id && o.userData?.dominantAxis) {
dominant = o.userData.dominantAxis;
}
});
const delta = dx * sens;
if (dominant === 'x') {
useModelStore.getState().setFineTuning({ rotX: ft.rotX + delta });
} else if (dominant === 'y') {
useModelStore.getState().setFineTuning({ rotY: ft.rotY + delta });
} else {
useModelStore.getState().setFineTuning({ rotZ: ft.rotZ + delta });
}
} else if (button === 0 && shiftKey) {
// Shift+left: depth (Z in camera space)
const worldDelta = dy * pixelsPerWorldUnit; const worldDelta = dy * pixelsPerWorldUnit;
const camDir = new THREE.Vector3(); const camDir = new THREE.Vector3();
camera.getWorldDirection(camDir); camera.getWorldDirection(camDir);