未验证 提交 ca849a99 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #14771 from arodic/transform_controls_enabled_property

Cosmetic improvement to TransformControls axis dimming/highlight.
......@@ -189,16 +189,8 @@ THREE.TransformControls = function ( camera, domElement ) {
// updateMatrixWorld updates key transformation variables
this.updateMatrixWorld = function () {
if ( !scope.enabled ) {
this.visible = false;
return;
}
if ( this.object !== undefined ) {
this.visible = true;
this.object.updateMatrixWorld();
this.object.parent.matrixWorld.decompose( parentPosition, parentQuaternion, parentScale );
this.object.matrixWorld.decompose( worldPosition, worldQuaternion, worldScale );
......@@ -1339,7 +1331,12 @@ THREE.TransformControlsGizmo = function () {
handle.material.color.copy( handle.material._color );
handle.material.opacity = handle.material._opacity;
if ( this.axis ) {
if ( !this.enabled ) {
handle.material.opacity *= 0.5;
handle.material.color.lerp( new THREE.Color( 1, 1, 1 ), 0.5 );
} else if ( this.axis ) {
if ( handle.name === this.axis ) {
......@@ -1353,7 +1350,8 @@ THREE.TransformControlsGizmo = function () {
} else {
handle.material.opacity *= 0.05;
handle.material.opacity *= 0.25;
handle.material.color.lerp( new THREE.Color( 1, 1, 1 ), 0.5 );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册