Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions examples/jsm/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,33 @@ class TransformControls extends Controls {
*/
defineProperty( 'showZ', true );

/**
* Whether the xy-plane helper should be visible or not.
*
* @name TransformControls#showXY
* @type {boolean}
* @default true
*/
defineProperty( 'showXY', true );

/**
* Whether the yz-plane helper should be visible or not.
*
* @name TransformControls#showYZ
* @type {boolean}
* @default true
*/
defineProperty( 'showYZ', true );

/**
* Whether the xz-axis helper should be visible or not.
*
* @name TransformControls#showXZ
* @type {boolean}
* @default true
*/
defineProperty( 'showXZ', true );

/**
* The minimum allowed X position during translation.
*
Expand Down Expand Up @@ -1784,6 +1811,11 @@ class TransformControlsGizmo extends Object3D {
handle.visible = handle.visible && ( handle.name.indexOf( 'Z' ) === - 1 || this.showZ );
handle.visible = handle.visible && ( handle.name.indexOf( 'E' ) === - 1 || ( this.showX && this.showY && this.showZ ) );

// Hide disabled plane helpers
handle.visible = handle.visible && ( handle.name.indexOf( 'XY' ) === - 1 || this.showXY );
handle.visible = handle.visible && ( handle.name.indexOf( 'YZ' ) === - 1 || this.showYZ );
handle.visible = handle.visible && ( handle.name.indexOf( 'XZ' ) === - 1 || this.showXZ );

// highlight selected axis

handle.material._color = handle.material._color || handle.material.color.clone();
Expand Down