Forráskód Böngészése

TransformControls: Allow visibility control of rotation gizmos. (#33562)

Michael Herzog 1 hónapja
szülő
commit
ff84afbb90
1 módosított fájl, 22 hozzáadás és 0 törlés
  1. 22 0
      examples/jsm/controls/TransformControls.js

+ 22 - 0
examples/jsm/controls/TransformControls.js

@@ -289,6 +289,24 @@ class TransformControls extends Controls {
 		 */
 		defineProperty( 'showXZ', true );
 
+		/**
+		 * Whether the xyze rotation helper should be visible or not.
+		 *
+		 * @name TransformControls#showXYZE
+		 * @type {boolean}
+		 * @default true
+		 */
+		defineProperty( 'showXYZE', true );
+
+		/**
+		 * Whether the e rotation helper should be visible or not.
+		 *
+		 * @name TransformControls#showE
+		 * @type {boolean}
+		 * @default true
+		 */
+		defineProperty( 'showE', true );
+
 		/**
 		 * The minimum allowed X position during translation.
 		 *
@@ -1847,6 +1865,10 @@ class TransformControlsGizmo extends Object3D {
 			handle.visible = handle.visible && ( handle.name.indexOf( 'YZ' ) === - 1 || this.showYZ );
 			handle.visible = handle.visible && ( handle.name.indexOf( 'XZ' ) === - 1 || this.showXZ );
 
+			// Hide disabled rotation helpers
+			handle.visible = handle.visible && ( handle.name !== 'E' || this.showE );
+			handle.visible = handle.visible && ( handle.name !== 'XYZE' || this.showXYZE );
+
 			// highlight selected axis
 
 			handle.material._color = handle.material._color || handle.material.color.clone();

粤ICP备19079148号