|
1 | 1 | import { |
2 | 2 | BoxGeometry, |
3 | 3 | BufferGeometry, |
4 | | - Color, |
5 | 4 | CylinderGeometry, |
6 | 5 | DoubleSide, |
7 | 6 | Euler, |
@@ -787,49 +786,49 @@ class TransformControlsGizmo extends Object3D { |
787 | 786 | matHelper.opacity = 0.33; |
788 | 787 |
|
789 | 788 | const matRed = gizmoMaterial.clone(); |
790 | | - matRed.color.set( 0xff0000 ); |
| 789 | + matRed.color.setHex( 0xff0000 ); |
791 | 790 |
|
792 | 791 | const matGreen = gizmoMaterial.clone(); |
793 | | - matGreen.color.set( 0x00ff00 ); |
| 792 | + matGreen.color.setHex( 0x00ff00 ); |
794 | 793 |
|
795 | 794 | const matBlue = gizmoMaterial.clone(); |
796 | | - matBlue.color.set( 0x0000ff ); |
| 795 | + matBlue.color.setHex( 0x0000ff ); |
797 | 796 |
|
798 | 797 | const matWhiteTransparent = gizmoMaterial.clone(); |
799 | 798 | matWhiteTransparent.opacity = 0.25; |
800 | 799 |
|
801 | 800 | const matYellowTransparent = matWhiteTransparent.clone(); |
802 | | - matYellowTransparent.color.set( 0xffff00 ); |
| 801 | + matYellowTransparent.color.setHex( 0xffff00 ); |
803 | 802 |
|
804 | 803 | const matCyanTransparent = matWhiteTransparent.clone(); |
805 | | - matCyanTransparent.color.set( 0x00ffff ); |
| 804 | + matCyanTransparent.color.setHex( 0x00ffff ); |
806 | 805 |
|
807 | 806 | const matMagentaTransparent = matWhiteTransparent.clone(); |
808 | | - matMagentaTransparent.color.set( 0xff00ff ); |
| 807 | + matMagentaTransparent.color.setHex( 0xff00ff ); |
809 | 808 |
|
810 | 809 | const matYellow = gizmoMaterial.clone(); |
811 | | - matYellow.color.set( 0xffff00 ); |
| 810 | + matYellow.color.setHex( 0xffff00 ); |
812 | 811 |
|
813 | 812 | const matLineRed = gizmoLineMaterial.clone(); |
814 | | - matLineRed.color.set( 0xff0000 ); |
| 813 | + matLineRed.color.setHex( 0xff0000 ); |
815 | 814 |
|
816 | 815 | const matLineGreen = gizmoLineMaterial.clone(); |
817 | | - matLineGreen.color.set( 0x00ff00 ); |
| 816 | + matLineGreen.color.setHex( 0x00ff00 ); |
818 | 817 |
|
819 | 818 | const matLineBlue = gizmoLineMaterial.clone(); |
820 | | - matLineBlue.color.set( 0x0000ff ); |
| 819 | + matLineBlue.color.setHex( 0x0000ff ); |
821 | 820 |
|
822 | 821 | const matLineCyan = gizmoLineMaterial.clone(); |
823 | | - matLineCyan.color.set( 0x00ffff ); |
| 822 | + matLineCyan.color.setHex( 0x00ffff ); |
824 | 823 |
|
825 | 824 | const matLineMagenta = gizmoLineMaterial.clone(); |
826 | | - matLineMagenta.color.set( 0xff00ff ); |
| 825 | + matLineMagenta.color.setHex( 0xff00ff ); |
827 | 826 |
|
828 | 827 | const matLineYellow = gizmoLineMaterial.clone(); |
829 | | - matLineYellow.color.set( 0xffff00 ); |
| 828 | + matLineYellow.color.setHex( 0xffff00 ); |
830 | 829 |
|
831 | 830 | const matLineGray = gizmoLineMaterial.clone(); |
832 | | - matLineGray.color.set( 0x787878 ); |
| 831 | + matLineGray.color.setHex( 0x787878 ); |
833 | 832 |
|
834 | 833 | const matLineYellowTransparent = matLineYellow.clone(); |
835 | 834 | matLineYellowTransparent.opacity = 0.25; |
@@ -1522,37 +1521,27 @@ class TransformControlsGizmo extends Object3D { |
1522 | 1521 |
|
1523 | 1522 | // highlight selected axis |
1524 | 1523 |
|
1525 | | - handle.material._opacity = handle.material._opacity || handle.material.opacity; |
1526 | 1524 | handle.material._color = handle.material._color || handle.material.color.clone(); |
| 1525 | + handle.material._opacity = handle.material._opacity || handle.material.opacity; |
1527 | 1526 |
|
1528 | 1527 | handle.material.color.copy( handle.material._color ); |
1529 | 1528 | handle.material.opacity = handle.material._opacity; |
1530 | 1529 |
|
1531 | | - if ( ! this.enabled ) { |
1532 | | - |
1533 | | - handle.material.opacity *= 0.5; |
1534 | | - handle.material.color.lerp( new Color( 1, 1, 1 ), 0.5 ); |
1535 | | - |
1536 | | - } else if ( this.axis ) { |
| 1530 | + if ( this.enabled && this.axis ) { |
1537 | 1531 |
|
1538 | 1532 | if ( handle.name === this.axis ) { |
1539 | 1533 |
|
| 1534 | + handle.material.color.setHex( 0xffff00 ); |
1540 | 1535 | handle.material.opacity = 1.0; |
1541 | | - handle.material.color.lerp( new Color( 1, 1, 1 ), 0.5 ); |
1542 | 1536 |
|
1543 | 1537 | } else if ( this.axis.split( '' ).some( function ( a ) { |
1544 | 1538 |
|
1545 | 1539 | return handle.name === a; |
1546 | 1540 |
|
1547 | 1541 | } ) ) { |
1548 | 1542 |
|
| 1543 | + handle.material.color.setHex( 0xffff00 ); |
1549 | 1544 | handle.material.opacity = 1.0; |
1550 | | - handle.material.color.lerp( new Color( 1, 1, 1 ), 0.5 ); |
1551 | | - |
1552 | | - } else { |
1553 | | - |
1554 | | - handle.material.opacity *= 0.25; |
1555 | | - handle.material.color.lerp( new Color( 1, 1, 1 ), 0.5 ); |
1556 | 1545 |
|
1557 | 1546 | } |
1558 | 1547 |
|
|
0 commit comments