Skip to content

Feat(gizmo): sync component gizmos and align interaction logic with cocos-editor.#530

Merged
star-e merged 3 commits intococos:mainfrom
bofeng-song:gizmo
May 6, 2026
Merged

Feat(gizmo): sync component gizmos and align interaction logic with cocos-editor.#530
star-e merged 3 commits intococos:mainfrom
bofeng-song:gizmo

Conversation

@bofeng-song
Copy link
Copy Markdown
Contributor

Summary

  • Ported 14 component gizmos (lights, 3D/2D colliders, renderers) and 7 shared controllers from cocos-editor
  • Aligned gizmo interaction logic with cocos-editor to fix node selection, hover, and region-select behavior

Key Changes

New gizmos

  • Lights: sphere-light, spot-light
  • 3D colliders: sphere, capsule, cone, cylinder, plane, simplex, mesh
  • 2D colliders: box, circle, polygon
  • Renderers: mesh-renderer, skinned-mesh-renderer
  • Controllers: capsule, cone, disc, line, point, triangle, tetrahedron

Interaction fixes (aligned with cocos-editor)

  • Fix DPR handling: use cc.screen.devicePixelRatio instead of window.devicePixelRatio
  • GizmoMouseEvent extends CCEvent with full field parity
  • RaycastResults carries originating ray for correct hitPoint calculation
  • Combined 3D model + 2D Canvas raycast via raycastAll
  • LOD culling in raycast and region selection
  • SceneGizmo camera priority raycast
  • VertexSnap check in hover processing
  • 2D skew UI hitTest via screenPos parameter
  • DPR change triggers resize event
  • Prefab root check uses editing root node

@bofeng-song bofeng-song requested a review from star-e May 6, 2026 09:44
@star-e star-e merged commit bae4e52 into cocos:main May 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants