Skip to content

Commit

Permalink
Update TransformControls.js
Browse files Browse the repository at this point in the history
Fix typos.
  • Loading branch information
Mugen87 committed Jul 13, 2022
1 parent 3a76bc7 commit cf25a80
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/jsm/controls/TransformControls.js
Expand Up @@ -1316,12 +1316,12 @@ class TransformControlsGizmo extends Object3D {

// Hide translate and scale axis facing the camera

const AXIS_HIDE_TRESHOLD = 0.99;
const PLANE_HIDE_TRESHOLD = 0.2;
const AXIS_HIDE_THRESHOLD = 0.99;
const PLANE_HIDE_THRESHOLD = 0.2;

if ( handle.name === 'X' ) {

if ( Math.abs( _alignVector.copy( _unitX ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_TRESHOLD ) {
if ( Math.abs( _alignVector.copy( _unitX ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_THRESHOLD ) {

handle.scale.set( 1e-10, 1e-10, 1e-10 );
handle.visible = false;
Expand All @@ -1332,7 +1332,7 @@ class TransformControlsGizmo extends Object3D {

if ( handle.name === 'Y' ) {

if ( Math.abs( _alignVector.copy( _unitY ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_TRESHOLD ) {
if ( Math.abs( _alignVector.copy( _unitY ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_THRESHOLD ) {

handle.scale.set( 1e-10, 1e-10, 1e-10 );
handle.visible = false;
Expand All @@ -1343,7 +1343,7 @@ class TransformControlsGizmo extends Object3D {

if ( handle.name === 'Z' ) {

if ( Math.abs( _alignVector.copy( _unitZ ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_TRESHOLD ) {
if ( Math.abs( _alignVector.copy( _unitZ ).applyQuaternion( quaternion ).dot( this.eye ) ) > AXIS_HIDE_THRESHOLD ) {

handle.scale.set( 1e-10, 1e-10, 1e-10 );
handle.visible = false;
Expand All @@ -1354,7 +1354,7 @@ class TransformControlsGizmo extends Object3D {

if ( handle.name === 'XY' ) {

if ( Math.abs( _alignVector.copy( _unitZ ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_TRESHOLD ) {
if ( Math.abs( _alignVector.copy( _unitZ ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_THRESHOLD ) {

handle.scale.set( 1e-10, 1e-10, 1e-10 );
handle.visible = false;
Expand All @@ -1365,7 +1365,7 @@ class TransformControlsGizmo extends Object3D {

if ( handle.name === 'YZ' ) {

if ( Math.abs( _alignVector.copy( _unitX ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_TRESHOLD ) {
if ( Math.abs( _alignVector.copy( _unitX ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_THRESHOLD ) {

handle.scale.set( 1e-10, 1e-10, 1e-10 );
handle.visible = false;
Expand All @@ -1376,7 +1376,7 @@ class TransformControlsGizmo extends Object3D {

if ( handle.name === 'XZ' ) {

if ( Math.abs( _alignVector.copy( _unitY ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_TRESHOLD ) {
if ( Math.abs( _alignVector.copy( _unitY ).applyQuaternion( quaternion ).dot( this.eye ) ) < PLANE_HIDE_THRESHOLD ) {

handle.scale.set( 1e-10, 1e-10, 1e-10 );
handle.visible = false;
Expand Down

0 comments on commit cf25a80

Please sign in to comment.