diff --git a/src/app/App.tsx b/src/app/App.tsx index 205377a5..931b9dd6 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -2062,7 +2062,7 @@ export function App({ store, initialStatusMessage }: AppProps) { setStatusMessage( `${getTransformOperationLabel(operation)} ${getTransformTargetLabel(transformTarget).toLowerCase()} in ${getViewportPanelLabel( transformSourcePanelId - )}. Move the pointer, press X/Y/Z to constrain, click or press Enter to commit, Escape cancels.` + )}. Move the pointer, press X/Y/Z to constrain, press the same axis again for local when supported, click or press Enter to commit, Escape cancels.` ); }; @@ -3211,7 +3211,7 @@ export function App({ store, initialStatusMessage }: AppProps) { setStatusMessage( `Move ${getTransformTargetLabel(transformTarget).toLowerCase()} in ${getViewportPanelLabel( transformSourcePanelId - )}. Move the pointer, press X/Y/Z to constrain, click or press Enter to commit, Escape cancels.` + )}. Move the pointer, press X/Y/Z to constrain, press the same axis again for local when supported, click or press Enter to commit, Escape cancels.` ); } else { setStatusMessage("Duplicated selection."); diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 02535fbc..e369e164 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -1498,6 +1498,7 @@ export class ViewportHost { sourcePanelId: this.panelId, operation: "translate", axisConstraint: null, + axisConstraintSpace: "world", target: transformTarget, preview: createTransformPreviewFromTarget(transformTarget) }; @@ -1835,10 +1836,7 @@ export class ViewportHost { if (axisConstraint !== null) { const initialOrientation = this.createRotationQuaternion(session.target.initialRotationDegrees); - const deltaRotation = new Quaternion().setFromAxisAngle( - this.getConstraintAxisWorldVector(session, effectiveAxis, axisConstraintSpace), - pointerDeltaRadians - ); + const deltaRotation = new Quaternion().setFromAxisAngle(this.axisVector(effectiveAxis), pointerDeltaRadians); nextRotationDegrees = this.getQuaternionEulerDegrees( axisConstraintSpace === "local" && supportsLocalTransformAxisConstraint(session, effectiveAxis) @@ -1869,10 +1867,7 @@ export class ViewportHost { if (axisConstraint !== null) { const initialOrientation = this.createRotationQuaternion(session.target.initialRotationDegrees); - const deltaRotation = new Quaternion().setFromAxisAngle( - this.getConstraintAxisWorldVector(session, effectiveAxis, axisConstraintSpace), - pointerDeltaRadians - ); + const deltaRotation = new Quaternion().setFromAxisAngle(this.axisVector(effectiveAxis), pointerDeltaRadians); nextRotationDegrees = this.getQuaternionEulerDegrees( axisConstraintSpace === "local" && supportsLocalTransformAxisConstraint(session, effectiveAxis) @@ -1942,10 +1937,7 @@ export class ViewportHost { session.target.initialRotation.direction.z ).normalize() ); - const deltaRotation = new Quaternion().setFromAxisAngle( - this.getConstraintAxisWorldVector(session, effectiveAxis, axisConstraintSpace), - pointerDeltaRadians - ); + const deltaRotation = new Quaternion().setFromAxisAngle(this.axisVector(effectiveAxis), pointerDeltaRadians); const nextOrientation = axisConstraint !== null && axisConstraintSpace === "local" && supportsLocalTransformAxisConstraint(session, effectiveAxis) ? initialOrientation.multiply(deltaRotation)