diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-22 13:52:04 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-22 13:52:04 +0900 |
| commit | 958ee87460019dc101418f1136ce49b7b593f3e3 (patch) | |
| tree | 4a6c75bb68721507268c9316073d0d7022f0b3c9 /public/bluebey-studio/src | |
| parent | 92b0483c65d2404a096d67a276395e9198499e95 (diff) | |
bluebey-studio: 通常ドラッグでカメラ中心点、Shiftでぶるべーを移動するよう入れ替え
Diffstat (limited to 'public/bluebey-studio/src')
| -rw-r--r-- | public/bluebey-studio/src/main.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/public/bluebey-studio/src/main.js b/public/bluebey-studio/src/main.js index 063a6fc..8d69154 100644 --- a/public/bluebey-studio/src/main.js +++ b/public/bluebey-studio/src/main.js @@ -2320,11 +2320,12 @@ async function init() { help?.addEventListener('click', (event) => { if (event.target === help) toggleHelp(false); }); // --- the mouse on the character ---------------------------------------- - // Dragging the model slides it across the view; holding Shift and dragging - // moves the camera's reference point instead (the phone's two-finger drag). - // Bone posing lives in the panel, so the mouse never grabs a bone (see `Rig` - // in src/rig.js). On a small screen the panel is a sheet over the view, so a - // tap on the view first just dismisses the sheet. + // Dragging the model moves the camera's reference point, so the scene slides + // under the cursor; holding Shift and dragging moves the character itself. + // On touch, dragging the model always moves the character (the phone + // gestures). Bone posing lives in the panel, so the mouse never grabs a bone + // (see `Rig` in src/rig.js). On a small screen the panel is a sheet over the + // view, so a tap on the view first just dismisses the sheet. const dragRay = new THREE.Raycaster(); const dragNdc = new THREE.Vector2(); const dragHitAt = (event) => { @@ -2358,7 +2359,7 @@ async function init() { const root = state.pose.root ?? [0, 0, 0]; modelDrag = { pointerId: event.pointerId, - pan: event.shiftKey, + pan: event.pointerType === 'mouse' ? !event.shiftKey : false, x: event.clientX, y: event.clientY, lastX: event.clientX, @@ -2376,7 +2377,7 @@ async function init() { const dy = event.clientY - modelDrag.y; const k = dragScale(); if (modelDrag.pan) { - // Shift+drag: move the camera's reference point (the same effect as the + // Plain drag: move the camera's reference point (the same effect as the // two-finger drag on a phone). The character stays where it is. // Use the step since the previous event, not the total from the press: // pointermove fires many times per drag, so adding the total every time @@ -2395,8 +2396,8 @@ async function init() { for (const cam of Object.values(view.cameras ?? {})) cam.position.add(move); view.captureInto(state.view); } else { - // Plain drag: slide the character, leaving the camera's reference point - // alone (the one-finger drag on a phone). + // Shift+drag (or any touch drag on the character): slide the character, + // leaving the camera's reference point alone. state.pose.root = [ round2(modelDrag.root[0] + dx * k), round2(modelDrag.root[1] - dy * k), |
