Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -596,8 +596,25 @@ function PositionDragHandler() {
|
||||
rotX: ft.rotX + dy * sens,
|
||||
});
|
||||
}
|
||||
} else if (button === 1 || (button === 0 && shiftKey)) {
|
||||
// Middle or Shift+left: depth (Z in camera space)
|
||||
} else if (button === 1) {
|
||||
// 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 camDir = new THREE.Vector3();
|
||||
camera.getWorldDirection(camDir);
|
||||
|
||||
Reference in New Issue
Block a user