@@ -684,14 +684,14 @@ class Matrix4 {
684684 } else if (x is Vector4 ) {
685685 translateByVector4 (x);
686686 } else if (x is double ) {
687- translateByDouble (x, y, z, 1.0 );
687+ translateByDouble (x, y, z);
688688 } else {
689689 throw UnimplementedError ();
690690 }
691691 }
692692
693693 /// Translate this matrix by x, y, z, w.
694- void translateByDouble (double tx, double ty, double tz, double tw) {
694+ void translateByDouble (double tx, double ty, double tz, [ double tw = 1.0 ] ) {
695695 final t1 = _m4storage[0 ] * tx +
696696 _m4storage[4 ] * ty +
697697 _m4storage[8 ] * tz +
@@ -721,8 +721,7 @@ class Matrix4 {
721721 @pragma ('wasm:prefer-inline' )
722722 @pragma ('vm:prefer-inline' )
723723 @pragma ('dart2js:prefer-inline' )
724- void translateByVector3 (Vector3 v3) =>
725- translateByDouble (v3.x, v3.y, v3.z, 1.0 );
724+ void translateByVector3 (Vector3 v3) => translateByDouble (v3.x, v3.y, v3.z);
726725
727726 /// Translate this matrix by a [Vector4] .
728727 @pragma ('wasm:prefer-inline' )
@@ -750,14 +749,15 @@ class Matrix4 {
750749 } else if (x is Vector4 ) {
751750 leftTranslateByVector4 (x);
752751 } else if (x is double ) {
753- leftTranslateByDouble (x, y, z, 1.0 );
752+ leftTranslateByDouble (x, y, z);
754753 } else {
755754 throw UnimplementedError ();
756755 }
757756 }
758757
759758 /// Multiply this by a translation from the left.
760- void leftTranslateByDouble (double tx, double ty, double tz, double tw) {
759+ void leftTranslateByDouble (double tx, double ty, double tz,
760+ [double tw = 1.0 ]) {
761761 // Column 1
762762 final r1 = _m4storage[3 ];
763763 _m4storage[0 ] += tx * r1;
@@ -792,7 +792,7 @@ class Matrix4 {
792792 @pragma ('vm:prefer-inline' )
793793 @pragma ('dart2js:prefer-inline' )
794794 void leftTranslateByVector3 (Vector3 v3) =>
795- leftTranslateByDouble (v3.x, v3.y, v3.z, 1.0 );
795+ leftTranslateByDouble (v3.x, v3.y, v3.z);
796796
797797 /// Multiply this by a translation from the left.
798798 @pragma ('wasm:prefer-inline' )
@@ -928,14 +928,14 @@ class Matrix4 {
928928 } else if (x is Vector4 ) {
929929 scaleByVector4 (x);
930930 } else if (x is double ) {
931- scaleByDouble (x, y ?? x, z ?? x, 1.0 );
931+ scaleByDouble (x, y ?? x, z ?? x);
932932 } else {
933933 throw UnimplementedError ();
934934 }
935935 }
936936
937937 /// Scale this matrix.
938- void scaleByDouble (double sx, double sy, double sz, double sw) {
938+ void scaleByDouble (double sx, double sy, double sz, [ double sw = 1.0 ] ) {
939939 _m4storage[0 ] *= sx;
940940 _m4storage[1 ] *= sx;
941941 _m4storage[2 ] *= sx;
@@ -958,7 +958,7 @@ class Matrix4 {
958958 @pragma ('wasm:prefer-inline' )
959959 @pragma ('vm:prefer-inline' )
960960 @pragma ('dart2js:prefer-inline' )
961- void scaleByVector3 (Vector3 v3) => scaleByDouble (v3.x, v3.y, v3.z, 1.0 );
961+ void scaleByVector3 (Vector3 v3) => scaleByDouble (v3.x, v3.y, v3.z);
962962
963963 /// Scale this matrix.
964964 @pragma ('wasm:prefer-inline' )
0 commit comments