From cf25a80737db2914f0b36e7c77af23a9981d03c1 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Wed, 13 Jul 2022 11:40:52 +0200 Subject: [PATCH] Update TransformControls.js Fix typos. --- examples/jsm/controls/TransformControls.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/jsm/controls/TransformControls.js b/examples/jsm/controls/TransformControls.js index a34066cb9dad4..2049a451cf346 100644 --- a/examples/jsm/controls/TransformControls.js +++ b/examples/jsm/controls/TransformControls.js @@ -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; @@ -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; @@ -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; @@ -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; @@ -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; @@ -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;