-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Gizmo fixes and updates #7946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gizmo fixes and updates #7946
Conversation
…or better alignment with camera view
…izmo to use setEulerAngles
…ctor visibility logic
… in ScaleGizmo and TranslateGizmo
…sitions during transform events
…o position updates
…perties in SphereShape and TranslateGizmo
…r improved performance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes gizmo functionality issues and enhances the gizmo system with ball rotation capability. The changes address bugs in local rotation handling for child nodes and improve visual feedback when looking perpendicular to arc shapes.
- Fixed local rotation calculation for child nodes in the gizmo system
- Enhanced arc shape visibility to show full ring when viewed perpendicularly
- Added ball rotation interaction for the rotate gizmo with a new sphere shape
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/extras/gizmo/translate-gizmo.js | Updates epsilon value and property name changes for consistency |
| src/extras/gizmo/transform-gizmo.js | Code reorganization and algorithm improvements for guide line drawing |
| src/extras/gizmo/shape/sphere-shape.js | Refactors property naming from 'size' to 'radius' and updates geometry creation |
| src/extras/gizmo/shape/shape.js | Removes centralized geometry creation helper function |
| src/extras/gizmo/shape/plane-shape.js | Updates to use direct mesh creation instead of helper function |
| src/extras/gizmo/shape/boxline-shape.js | Updates to use direct mesh creation instead of helper function |
| src/extras/gizmo/shape/box-shape.js | Updates to use direct mesh creation instead of helper function |
| src/extras/gizmo/shape/arrow-shape.js | Updates to use direct mesh creation instead of helper function |
| src/extras/gizmo/shape/arc-shape.js | Enhances arc visibility logic with new show() method and tri-data caching |
| src/extras/gizmo/shaders.js | Adds depth buffer modifications for gizmo rendering |
| src/extras/gizmo/scale-gizmo.js | Updates epsilon value and variable naming for consistency |
| src/extras/gizmo/rotate-gizmo.js | Major enhancements including ball rotation support and improved arc visibility |
| src/extras/gizmo/gizmo.js | Fixes local rotation calculation to use world rotation instead |
| examples/src/examples/gizmos/transform-rotate.example.mjs | Adds center radius property to example |
| examples/src/examples/gizmos/transform-rotate.controls.mjs | Adds UI control for center radius setting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
* fix: reverted regression using local angles instead of world angles for node rotation * fix: update shape orientation calculation to use local euler angles for better alignment with camera view * refactor: simplify visibility handling in ArcShape and update RotateGizmo to use setEulerAngles * fix: update facing threshold constants for RotateGizmo and improve sector visibility logic * fix: update GLANCE_EPSILON constant and adjust shape visibility logic in ScaleGizmo and TranslateGizmo * fix: improve shape visibility logic in RotateGizmo for better state handling * fix: trigger render update event in RotateGizmo after shape visibility changes * fix: enhance triangle data caching in ArcShape for improved geometry updates * fix: update TranslateGizmo to calculate point delta and reset node positions during transform events * fix: rename pointDelta to translateDelta for clarity in TranslateGizmo position updates * fix: rename pointDelta to scaleDelta for clarity in ScaleGizmo scaling logic * feat: implemented basic ball roll rotation * fix: refine rotation logic in RotateGizmo to handle axis-specific conditions * fix: mark potential scale warping issue in RotateGizmo with a FIXME comment * fix: reset depth to always render gizmos on top of each other * fix: enhance type annotations and parameters for drawing span lines in TransformGizmo * feat: add center radius control to RotateGizmo and update related properties in SphereShape and TranslateGizmo * feat: override theme for xyz in rotate gizmo * feat: refactor rendering in shape classes to use Mesh.fromGeometry for improved performance * feat: add Mesh import to shape.js for future rendering enhancements * feat: enhance SphereGeometry rendering with latitude and longitude bands * Update src/extras/gizmo/translate-gizmo.js Co-authored-by: Copilot <[email protected]> * feat: add disabled color to gizmo shapes for better visual feedback * refactor: remove unused rotation calculation and associated method from RotateGizmo * refactor: remove unused Mat4 import and temporary variable from RotateGizmo --------- Co-authored-by: Copilot <[email protected]>
* Gizmo fixes and updates (#7946) * fix: reverted regression using local angles instead of world angles for node rotation * fix: update shape orientation calculation to use local euler angles for better alignment with camera view * refactor: simplify visibility handling in ArcShape and update RotateGizmo to use setEulerAngles * fix: update facing threshold constants for RotateGizmo and improve sector visibility logic * fix: update GLANCE_EPSILON constant and adjust shape visibility logic in ScaleGizmo and TranslateGizmo * fix: improve shape visibility logic in RotateGizmo for better state handling * fix: trigger render update event in RotateGizmo after shape visibility changes * fix: enhance triangle data caching in ArcShape for improved geometry updates * fix: update TranslateGizmo to calculate point delta and reset node positions during transform events * fix: rename pointDelta to translateDelta for clarity in TranslateGizmo position updates * fix: rename pointDelta to scaleDelta for clarity in ScaleGizmo scaling logic * feat: implemented basic ball roll rotation * fix: refine rotation logic in RotateGizmo to handle axis-specific conditions * fix: mark potential scale warping issue in RotateGizmo with a FIXME comment * fix: reset depth to always render gizmos on top of each other * fix: enhance type annotations and parameters for drawing span lines in TransformGizmo * feat: add center radius control to RotateGizmo and update related properties in SphereShape and TranslateGizmo * feat: override theme for xyz in rotate gizmo * feat: refactor rendering in shape classes to use Mesh.fromGeometry for improved performance * feat: add Mesh import to shape.js for future rendering enhancements * feat: enhance SphereGeometry rendering with latitude and longitude bands * Update src/extras/gizmo/translate-gizmo.js Co-authored-by: Copilot <[email protected]> * feat: add disabled color to gizmo shapes for better visual feedback * refactor: remove unused rotation calculation and associated method from RotateGizmo * refactor: remove unused Mat4 import and temporary variable from RotateGizmo --------- Co-authored-by: Copilot <[email protected]> * revert: removed gizmo ball feature --------- Co-authored-by: Copilot <[email protected]>
Fixes #7085
Features
Fixes
Preview
Full ring looking along axis

Gizmo ball rotation hover

Checklist