Skip to content

Commit 2f77a90

Browse files
authored
Gizmo overhaul for translate/rotate/scale (#1428)
* Updated gizmos for translate/rotate/scale (#1367) * Update PlayCanvas dependency to version 2.10.3 and refine type declarations for 'pc' and 'pcx' in types.d.ts * feat: replaced translate gizmo with engine one * refactor: simplify layer creation and entity attachment in translate gizmo * feat: added history management to gizmo * fix: preserve history state in setTRS function * fix: update history management in gizmo-translate to use cache instead of store * fix: rename state variable to action for clarity in history management * fix: update action structure for history management in gizmo-translate * feat: replaced old gizmos with new scale and rotate gizmos * feat: combined all transform gizmos into one class * fix: allow for switching cameras for gizmos * fix: add write permission check to gizmo update logic * feat: add snapping functionality to gizmos with configurable increment * feat: add custom theme to gizmos to match the look of existing ones * feat: set gizmo opacity to 0.7 * feat: update gizmo theme structure and add guideOccluded color settings * feat: add xyz color settings for guideOccluded in gizmo initialization * feat: update guideOccluded settings to guideOcclusion for improved clarity * feat: simplify color settings in initGizmo by removing opacity and enabling orbit rotation for RotateGizmo * feat: override picker to reset node and picked if gizmo is being hovered * feat: update initGizmo to disable axis shapes for improved scaling intuitiveness * feat: set dragMode to 'hide' for RotateGizmo in initGizmo for improved user experience * feat: toggle camera and viewport pick state during gizmo initialization * fix: update drag mode for RotateGizmo to 'selected' * feat: add angle guide thickness to gizmo initialization * fix: rename parameter in gizmo:coordSystem event for clarity * fix: update gizmo initialization to hide center sphere and rotation ball * fix: update playcanvas version to 2.11.1 and adjust Node.js engine requirement * fix: update playcanvas version to 2.11.2 * fix: unify gizmo visibility handling by replacing individual calls with a single event emission * fix: improve visibility handling in update function by separating write permission check * fix: refactor gizmo update handling to use reflow for visibility and selection changes * fix: update gizmo enable logic to depend on write state and visibility * fix: update gizmo visibility handling by emitting events on handle changes * fix: update gizmo event handling to track hover state and trigger viewport render on updates * fix: integrate FORCE_PICK_TAG into gizmo entity creation and viewport picking logic * chore: update playcanvas dependency to version 2.11.3 * fix: properly destroy gizmos on scene unload * feat: add customizable gizmo settings for size, preset, and rotation mode * feat: add gizmo size and preset settings to the editor * fix: update gizmo preset description for clarity * fix: restore classic option in gizmo settings * chore: update playcanvas dependency to version 2.11.4 * feat: enable uniform scaling for scale gizmo * feat: matched existing style for transform and scale gizmos * fix: update playcanvas dependency to version 2.11.6 * fix: update playcanvas dependency to version 2.11.6 * feat: updated gizmo settings from projectUser to user * feat: added gizmo carrying while moving * refactor: update gizmo event handling for improved hover state tracking * feat: emit hover state event when detaching gizmo transforms * feat: handle hover state when detaching gizmo nodes * feat: allow rotation while holding gizmo
1 parent 18b794e commit 2f77a90

File tree

18 files changed

+613
-2914
lines changed

18 files changed

+613
-2914
lines changed

src/code-editor/files-panel/files-panel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ editor.once('load', () => {
215215
const path: number[] = asset.get('path');
216216
const type: string = asset.get('type');
217217

218+
if (id === '524644') {
219+
console.log('adding', path.join(','), name);
220+
}
221+
218222
const item = new TreeViewItem({
219223
allowDrop: type === 'folder',
220224
icon: icons.get(type),

src/core/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export const ENGINE_VERSION = typeof pc !== 'undefined' ? `${pc.version}` : '0.0
44
// Gizmo mask
55
export const GIZMO_MASK = 8;
66

7+
// Picker force pick tag
8+
export const FORCE_PICK_TAG = 'force-pick';
9+
710
// Layer ids
811
export const LAYERID_WORLD = 0;
912
export const LAYERID_DEPTH = 1;

src/editor/attributes/reference/settings.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ editor.once('load', () => {
4242
}, {
4343
name: 'settings:cameraGammaCorrection',
4444
description: 'Set the editor camera gamma correction. This setting does not affect the game.'
45+
}, {
46+
name: 'settings:gizmoSize',
47+
description: 'Set the gizmo size in the editor viewport.'
48+
}, {
49+
name: 'settings:gizmoPreset',
50+
description: 'Set the gizmo preset in the editor viewport. This affects the transform gizmos\'s style and interaction behavior.'
4551
}, {
4652
name: 'settings:showFog',
4753
description: 'Enable fog rendering in the viewport.'

0 commit comments

Comments
 (0)