Skip to content

Commit 46f81c4

Browse files
kpal81xdCopilot
andauthored
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]>
1 parent 64441b9 commit 46f81c4

File tree

15 files changed

+314
-199
lines changed

15 files changed

+314
-199
lines changed

examples/src/examples/gizmos/transform-rotate.controls.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,14 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
280280
max: 2
281281
})
282282
),
283+
jsx(
284+
LabelGroup,
285+
{ text: 'Center Radius' },
286+
jsx(SliderInput, {
287+
binding: new BindingTwoWay(),
288+
link: { observer, path: 'gizmo.centerRadius' }
289+
})
290+
),
283291
jsx(
284292
LabelGroup,
285293
{ text: 'Angle Guide Thickness' },

examples/src/examples/gizmos/transform-rotate.example.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ data.set('gizmo', {
151151
xyzRingRadius: gizmo.xyzRingRadius,
152152
faceTubeRadius: gizmo.faceTubeRadius,
153153
faceRingRadius: gizmo.faceRingRadius,
154+
centerRadius: gizmo.centerRadius,
154155
angleGuideThickness: gizmo.angleGuideThickness
155156
});
156157

src/extras/gizmo/gizmo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ class Gizmo extends EventHandler {
506506
_updateRotation() {
507507
tmpV1.set(0, 0, 0);
508508
if (this._coordSpace === 'local' && this.nodes.length !== 0) {
509-
tmpV1.copy(this.nodes[this.nodes.length - 1].getLocalEulerAngles());
509+
tmpV1.copy(this.nodes[this.nodes.length - 1].getEulerAngles());
510510
}
511511

512512
if (tmpV1.distance(this.root.getLocalEulerAngles()) < UPDATE_EPSILON) {

0 commit comments

Comments
 (0)