Updated generated code
Removes warnings associated with switch statement
Fixes string handling
Use 'num' instead of 'double'
Fix transformDirect3
Fix Vector copy (missing semicolon)
Signed-off-by: John McCutchan <john@johnmccutchan.com>
diff --git a/lib/VectorMath/gen/matrix2x2_gen.dart b/lib/VectorMath/gen/matrix2x2_gen.dart
index 34ccc69..4af35be 100644
--- a/lib/VectorMath/gen/matrix2x2_gen.dart
+++ b/lib/VectorMath/gen/matrix2x2_gen.dart
@@ -112,8 +112,8 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -126,8 +126,8 @@
vec2 operator[](int column) {
assert(column >= 0 && column < 2);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
+ case 0: return col0;
+ case 1: return col1;
}
throw new IllegalArgumentException(column);
}
@@ -135,8 +135,8 @@
vec2 operator[]=(int column, vec2 arg) {
assert(column >= 0 && column < 2);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
}
throw new IllegalArgumentException(column);
}
@@ -198,28 +198,6 @@
r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y);
return r;
}
- if (arg.cols == 3) {
- r = new mat3x2();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y);
- return r;
- }
- if (arg.cols == 4) {
- r = new mat4x2();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y);
- r.col3.x = (this.col0.x * arg.col3.x) + (this.col1.x * arg.col3.y);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y);
- r.col3.y = (this.col0.y * arg.col3.x) + (this.col1.y * arg.col3.y);
- return r;
- }
return r;
}
throw new IllegalArgumentException(arg);
@@ -311,12 +289,12 @@
}
/// Invert the matrix. Returns the determinant.
num invert() {
- double det = determinant();
+ num det = determinant();
if (det == 0.0) {
return 0.0;
}
- double invDet = 1.0 / det;
- double temp = col0.x;
+ num invDet = 1.0 / det;
+ num temp = col0.x;
col0.x = col1.y * invDet;
col0.y = - col0.y * invDet;
col1.x = - col1.x * invDet;
@@ -325,16 +303,16 @@
}
/// Turns the matrix into a rotation of [radians]
void setRotation(num radians_) {
- double c = Math.cos(radians_);
- double s = Math.sin(radians_);
+ num c = Math.cos(radians_);
+ num s = Math.sin(radians_);
col0.x = c;
col0.y = s;
col1.x = -s;
col1.y = c;
}
/// Converts into Adjugate matrix and scales by [scale]
- void selfScaleAdjoint(double scale) {
- double temp = col0.x;
+ void selfScaleAdjoint(num scale) {
+ num temp = col0.x;
col0.x = col1.y * scale;
col1.x = - col1.x * scale;
col0.y = - col0.y * scale;
@@ -372,10 +350,10 @@
return this;
}
mat2x2 selfMultiply(mat2x2 arg) {
- double m00 = col0.x;
- double m01 = col1.x;
- double m10 = col0.y;
- double m11 = col1.y;
+ num m00 = col0.x;
+ num m01 = col1.x;
+ num m10 = col0.y;
+ num m11 = col1.y;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col0.y);
col1.x = (m00 * arg.col1.x) + (m01 * arg.col1.y);
col0.y = (m10 * arg.col0.x) + (m11 * arg.col0.y);
@@ -383,10 +361,10 @@
return this;
}
mat2x2 selfTransposeMultiply(mat2x2 arg) {
- double m00 = col0.x;
- double m01 = col0.y;
- double m10 = col1.x;
- double m11 = col1.y;
+ num m00 = col0.x;
+ num m01 = col0.y;
+ num m10 = col1.x;
+ num m11 = col1.y;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col0.y);
col1.x = (m00 * arg.col1.x) + (m01 * arg.col1.y);
col0.y = (m10 * arg.col0.x) + (m11 * arg.col0.y);
@@ -394,14 +372,25 @@
return this;
}
mat2x2 selfMultiplyTranpose(mat2x2 arg) {
- double m00 = col0.x;
- double m01 = col1.x;
- double m10 = col0.y;
- double m11 = col1.y;
+ num m00 = col0.x;
+ num m01 = col1.x;
+ num m10 = col0.y;
+ num m11 = col1.y;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col1.x);
col1.x = (m00 * arg.col0.y) + (m01 * arg.col1.y);
col0.y = (m10 * arg.col0.x) + (m11 * arg.col1.x);
col1.y = (m10 * arg.col0.y) + (m11 * arg.col1.y);
return this;
}
+ vec2 transformDirect(vec2 arg) {
+ num x_ = (this.col0.x * arg.x) + (this.col1.x * arg.y);
+ num y_ = (this.col0.y * arg.x) + (this.col1.y * arg.y);
+ arg.x = x_;
+ arg.y = y_;
+ return arg;
+ }
+ vec2 transform(vec2 arg) {
+ vec2 d = arg.copy();
+ return transformDirect(d);
+ }
}
diff --git a/lib/VectorMath/gen/matrix2x3_gen.dart b/lib/VectorMath/gen/matrix2x3_gen.dart
index cc24f33..b32607f 100644
--- a/lib/VectorMath/gen/matrix2x3_gen.dart
+++ b/lib/VectorMath/gen/matrix2x3_gen.dart
@@ -125,9 +125,9 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
- s += '[2] ${getRow(2)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
+ s = '$s[2] ${getRow(2)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -140,8 +140,8 @@
vec3 operator[](int column) {
assert(column >= 0 && column < 2);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
+ case 0: return col0;
+ case 1: return col1;
}
throw new IllegalArgumentException(column);
}
@@ -149,8 +149,8 @@
vec3 operator[]=(int column, vec3 arg) {
assert(column >= 0 && column < 2);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
}
throw new IllegalArgumentException(column);
}
@@ -234,22 +234,6 @@
r.col2.z = (this.col0.z * arg.col2.x) + (this.col1.z * arg.col2.y);
return r;
}
- if (arg.cols == 4) {
- r = new mat4x3();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y);
- r.col3.x = (this.col0.x * arg.col3.x) + (this.col1.x * arg.col3.y);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y);
- r.col3.y = (this.col0.y * arg.col3.x) + (this.col1.y * arg.col3.y);
- r.col0.z = (this.col0.z * arg.col0.x) + (this.col1.z * arg.col0.y);
- r.col1.z = (this.col0.z * arg.col1.x) + (this.col1.z * arg.col1.y);
- r.col2.z = (this.col0.z * arg.col2.x) + (this.col1.z * arg.col2.y);
- r.col3.z = (this.col0.z * arg.col3.x) + (this.col1.z * arg.col3.y);
- return r;
- }
return r;
}
throw new IllegalArgumentException(arg);
diff --git a/lib/VectorMath/gen/matrix2x4_gen.dart b/lib/VectorMath/gen/matrix2x4_gen.dart
index 09d5284..eca7c90 100644
--- a/lib/VectorMath/gen/matrix2x4_gen.dart
+++ b/lib/VectorMath/gen/matrix2x4_gen.dart
@@ -146,10 +146,10 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
- s += '[2] ${getRow(2)}\n';
- s += '[3] ${getRow(3)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
+ s = '$s[2] ${getRow(2)}\n';
+ s = '$s[3] ${getRow(3)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -162,8 +162,8 @@
vec4 operator[](int column) {
assert(column >= 0 && column < 2);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
+ case 0: return col0;
+ case 1: return col1;
}
throw new IllegalArgumentException(column);
}
@@ -171,8 +171,8 @@
vec4 operator[]=(int column, vec4 arg) {
assert(column >= 0 && column < 2);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
}
throw new IllegalArgumentException(column);
}
diff --git a/lib/VectorMath/gen/matrix3x2_gen.dart b/lib/VectorMath/gen/matrix3x2_gen.dart
index f61c7ad..64ecfdd 100644
--- a/lib/VectorMath/gen/matrix3x2_gen.dart
+++ b/lib/VectorMath/gen/matrix3x2_gen.dart
@@ -134,8 +134,8 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -148,9 +148,9 @@
vec2 operator[](int column) {
assert(column >= 0 && column < 3);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
- case 2: return col2; break;
+ case 0: return col0;
+ case 1: return col1;
+ case 2: return col2;
}
throw new IllegalArgumentException(column);
}
@@ -158,9 +158,9 @@
vec2 operator[]=(int column, vec2 arg) {
assert(column >= 0 && column < 3);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
- case 2: col2 = arg; return col2; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
+ case 2: col2 = arg; return col2;
}
throw new IllegalArgumentException(column);
}
@@ -226,28 +226,6 @@
r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z);
return r;
}
- if (arg.cols == 3) {
- r = new mat3x2();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y) + (this.col2.x * arg.col0.z);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y) + (this.col2.x * arg.col1.z);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y) + (this.col2.x * arg.col2.z);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y) + (this.col2.y * arg.col0.z);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y) + (this.col2.y * arg.col2.z);
- return r;
- }
- if (arg.cols == 4) {
- r = new mat4x2();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y) + (this.col2.x * arg.col0.z);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y) + (this.col2.x * arg.col1.z);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y) + (this.col2.x * arg.col2.z);
- r.col3.x = (this.col0.x * arg.col3.x) + (this.col1.x * arg.col3.y) + (this.col2.x * arg.col3.z);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y) + (this.col2.y * arg.col0.z);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y) + (this.col2.y * arg.col2.z);
- r.col3.y = (this.col0.y * arg.col3.x) + (this.col1.y * arg.col3.y) + (this.col2.y * arg.col3.z);
- return r;
- }
return r;
}
throw new IllegalArgumentException(arg);
diff --git a/lib/VectorMath/gen/matrix3x3_gen.dart b/lib/VectorMath/gen/matrix3x3_gen.dart
index 5143c2d..483f18d 100644
--- a/lib/VectorMath/gen/matrix3x3_gen.dart
+++ b/lib/VectorMath/gen/matrix3x3_gen.dart
@@ -198,9 +198,9 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
- s += '[2] ${getRow(2)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
+ s = '$s[2] ${getRow(2)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -213,9 +213,9 @@
vec3 operator[](int column) {
assert(column >= 0 && column < 3);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
- case 2: return col2; break;
+ case 0: return col0;
+ case 1: return col1;
+ case 2: return col2;
}
throw new IllegalArgumentException(column);
}
@@ -223,9 +223,9 @@
vec3 operator[]=(int column, vec3 arg) {
assert(column >= 0 && column < 3);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
- case 2: col2 = arg; return col2; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
+ case 2: col2 = arg; return col2;
}
throw new IllegalArgumentException(column);
}
@@ -314,22 +314,6 @@
r.col2.z = (this.col0.z * arg.col2.x) + (this.col1.z * arg.col2.y) + (this.col2.z * arg.col2.z);
return r;
}
- if (arg.cols == 4) {
- r = new mat4x3();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y) + (this.col2.x * arg.col0.z);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y) + (this.col2.x * arg.col1.z);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y) + (this.col2.x * arg.col2.z);
- r.col3.x = (this.col0.x * arg.col3.x) + (this.col1.x * arg.col3.y) + (this.col2.x * arg.col3.z);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y) + (this.col2.y * arg.col0.z);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y) + (this.col2.y * arg.col2.z);
- r.col3.y = (this.col0.y * arg.col3.x) + (this.col1.y * arg.col3.y) + (this.col2.y * arg.col3.z);
- r.col0.z = (this.col0.z * arg.col0.x) + (this.col1.z * arg.col0.y) + (this.col2.z * arg.col0.z);
- r.col1.z = (this.col0.z * arg.col1.x) + (this.col1.z * arg.col1.y) + (this.col2.z * arg.col1.z);
- r.col2.z = (this.col0.z * arg.col2.x) + (this.col1.z * arg.col2.y) + (this.col2.z * arg.col2.z);
- r.col3.z = (this.col0.z * arg.col3.x) + (this.col1.z * arg.col3.y) + (this.col2.z * arg.col3.z);
- return r;
- }
return r;
}
throw new IllegalArgumentException(arg);
@@ -455,11 +439,11 @@
}
/// Invert the matrix. Returns the determinant.
num invert() {
- double det = determinant();
+ num det = determinant();
if (det == 0.0) {
return 0.0;
}
- double invDet = 1.0 / det;
+ num invDet = 1.0 / det;
vec3 i = new vec3.zero();
vec3 j = new vec3.zero();
vec3 k = new vec3.zero();
@@ -479,8 +463,8 @@
}
/// Turns the matrix into a rotation of [radians] around X
void setRotationAroundX(num radians_) {
- double c = Math.cos(radians_);
- double s = Math.sin(radians_);
+ num c = Math.cos(radians_);
+ num s = Math.sin(radians_);
col0.x = 1.0;
col0.y = 0.0;
col0.z = 0.0;
@@ -493,8 +477,8 @@
}
/// Turns the matrix into a rotation of [radians] around Y
void setRotationAroundY(num radians_) {
- double c = Math.cos(radians_);
- double s = Math.sin(radians_);
+ num c = Math.cos(radians_);
+ num s = Math.sin(radians_);
col0.x = c;
col0.y = 0.0;
col0.z = -s;
@@ -507,8 +491,8 @@
}
/// Turns the matrix into a rotation of [radians] around Z
void setRotationAroundZ(num radians_) {
- double c = Math.cos(radians_);
- double s = Math.sin(radians_);
+ num c = Math.cos(radians_);
+ num s = Math.sin(radians_);
col0.x = c;
col0.y = s;
col0.z = 0.0;
@@ -520,16 +504,16 @@
col2.z = 1.0;
}
/// Converts into Adjugate matrix and scales by [scale]
- void selfScaleAdjoint(double scale) {
- double m00 = col0.x;
- double m01 = col1.x;
- double m02 = col2.x;
- double m10 = col0.y;
- double m11 = col1.y;
- double m12 = col2.y;
- double m20 = col0.z;
- double m21 = col1.z;
- double m22 = col2.z;
+ void selfScaleAdjoint(num scale) {
+ num m00 = col0.x;
+ num m01 = col1.x;
+ num m02 = col2.x;
+ num m10 = col0.y;
+ num m11 = col1.y;
+ num m12 = col2.y;
+ num m20 = col0.z;
+ num m21 = col1.z;
+ num m22 = col2.z;
col0.x = (m11 * m22 - m12 * m21) * scale;
col0.y = (m12 * m20 - m10 * m22) * scale;
col0.z = (m10 * m21 - m11 * m20) * scale;
@@ -592,15 +576,15 @@
return this;
}
mat3x3 selfMultiply(mat3x3 arg) {
- double m00 = col0.x;
- double m01 = col1.x;
- double m02 = col2.x;
- double m10 = col0.y;
- double m11 = col1.y;
- double m12 = col2.y;
- double m20 = col0.z;
- double m21 = col1.z;
- double m22 = col2.z;
+ num m00 = col0.x;
+ num m01 = col1.x;
+ num m02 = col2.x;
+ num m10 = col0.y;
+ num m11 = col1.y;
+ num m12 = col2.y;
+ num m20 = col0.z;
+ num m21 = col1.z;
+ num m22 = col2.z;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col0.y) + (m02 * arg.col0.z);
col1.x = (m00 * arg.col1.x) + (m01 * arg.col1.y) + (m02 * arg.col1.z);
col2.x = (m00 * arg.col2.x) + (m01 * arg.col2.y) + (m02 * arg.col2.z);
@@ -613,15 +597,15 @@
return this;
}
mat3x3 selfTransposeMultiply(mat3x3 arg) {
- double m00 = col0.x;
- double m01 = col0.y;
- double m02 = col0.z;
- double m10 = col1.x;
- double m11 = col1.y;
- double m12 = col1.z;
- double m20 = col2.x;
- double m21 = col2.y;
- double m22 = col2.z;
+ num m00 = col0.x;
+ num m01 = col0.y;
+ num m02 = col0.z;
+ num m10 = col1.x;
+ num m11 = col1.y;
+ num m12 = col1.z;
+ num m20 = col2.x;
+ num m21 = col2.y;
+ num m22 = col2.z;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col0.y) + (m02 * arg.col0.z);
col1.x = (m00 * arg.col1.x) + (m01 * arg.col1.y) + (m02 * arg.col1.z);
col2.x = (m00 * arg.col2.x) + (m01 * arg.col2.y) + (m02 * arg.col2.z);
@@ -634,15 +618,15 @@
return this;
}
mat3x3 selfMultiplyTranpose(mat3x3 arg) {
- double m00 = col0.x;
- double m01 = col1.x;
- double m02 = col2.x;
- double m10 = col0.y;
- double m11 = col1.y;
- double m12 = col2.y;
- double m20 = col0.z;
- double m21 = col1.z;
- double m22 = col2.z;
+ num m00 = col0.x;
+ num m01 = col1.x;
+ num m02 = col2.x;
+ num m10 = col0.y;
+ num m11 = col1.y;
+ num m12 = col2.y;
+ num m20 = col0.z;
+ num m21 = col1.z;
+ num m22 = col2.z;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col1.x) + (m02 * arg.col2.x);
col1.x = (m00 * arg.col0.y) + (m01 * arg.col1.y) + (m02 * arg.col2.y);
col2.x = (m00 * arg.col0.z) + (m01 * arg.col1.z) + (m02 * arg.col2.z);
@@ -654,4 +638,17 @@
col2.z = (m20 * arg.col0.z) + (m21 * arg.col1.z) + (m22 * arg.col2.z);
return this;
}
+ vec3 transformDirect(vec3 arg) {
+ num x_ = (this.col0.x * arg.x) + (this.col1.x * arg.y) + (this.col2.x * arg.z);
+ num y_ = (this.col0.y * arg.x) + (this.col1.y * arg.y) + (this.col2.y * arg.z);
+ num z_ = (this.col0.z * arg.x) + (this.col1.z * arg.y) + (this.col2.z * arg.z);
+ arg.x = x_;
+ arg.y = y_;
+ arg.z = z_;
+ return arg;
+ }
+ vec3 transform(vec3 arg) {
+ vec3 d = arg.copy();
+ return transformDirect(d);
+ }
}
diff --git a/lib/VectorMath/gen/matrix3x4_gen.dart b/lib/VectorMath/gen/matrix3x4_gen.dart
index 8e5c5ef..972af24 100644
--- a/lib/VectorMath/gen/matrix3x4_gen.dart
+++ b/lib/VectorMath/gen/matrix3x4_gen.dart
@@ -218,10 +218,10 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
- s += '[2] ${getRow(2)}\n';
- s += '[3] ${getRow(3)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
+ s = '$s[2] ${getRow(2)}\n';
+ s = '$s[3] ${getRow(3)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -234,9 +234,9 @@
vec4 operator[](int column) {
assert(column >= 0 && column < 3);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
- case 2: return col2; break;
+ case 0: return col0;
+ case 1: return col1;
+ case 2: return col2;
}
throw new IllegalArgumentException(column);
}
@@ -244,9 +244,9 @@
vec4 operator[]=(int column, vec4 arg) {
assert(column >= 0 && column < 3);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
- case 2: col2 = arg; return col2; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
+ case 2: col2 = arg; return col2;
}
throw new IllegalArgumentException(column);
}
diff --git a/lib/VectorMath/gen/matrix4x2_gen.dart b/lib/VectorMath/gen/matrix4x2_gen.dart
index b95afb5..8f4d759 100644
--- a/lib/VectorMath/gen/matrix4x2_gen.dart
+++ b/lib/VectorMath/gen/matrix4x2_gen.dart
@@ -164,8 +164,8 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -178,10 +178,10 @@
vec2 operator[](int column) {
assert(column >= 0 && column < 4);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
- case 2: return col2; break;
- case 3: return col3; break;
+ case 0: return col0;
+ case 1: return col1;
+ case 2: return col2;
+ case 3: return col3;
}
throw new IllegalArgumentException(column);
}
@@ -189,10 +189,10 @@
vec2 operator[]=(int column, vec2 arg) {
assert(column >= 0 && column < 4);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
- case 2: col2 = arg; return col2; break;
- case 3: col3 = arg; return col3; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
+ case 2: col2 = arg; return col2;
+ case 3: col3 = arg; return col3;
}
throw new IllegalArgumentException(column);
}
@@ -262,28 +262,6 @@
r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z) + (this.col3.y * arg.col1.w);
return r;
}
- if (arg.cols == 3) {
- r = new mat3x2();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y) + (this.col2.x * arg.col0.z) + (this.col3.x * arg.col0.w);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y) + (this.col2.x * arg.col1.z) + (this.col3.x * arg.col1.w);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y) + (this.col2.x * arg.col2.z) + (this.col3.x * arg.col2.w);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y) + (this.col2.y * arg.col0.z) + (this.col3.y * arg.col0.w);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z) + (this.col3.y * arg.col1.w);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y) + (this.col2.y * arg.col2.z) + (this.col3.y * arg.col2.w);
- return r;
- }
- if (arg.cols == 4) {
- r = new mat4x2();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y) + (this.col2.x * arg.col0.z) + (this.col3.x * arg.col0.w);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y) + (this.col2.x * arg.col1.z) + (this.col3.x * arg.col1.w);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y) + (this.col2.x * arg.col2.z) + (this.col3.x * arg.col2.w);
- r.col3.x = (this.col0.x * arg.col3.x) + (this.col1.x * arg.col3.y) + (this.col2.x * arg.col3.z) + (this.col3.x * arg.col3.w);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y) + (this.col2.y * arg.col0.z) + (this.col3.y * arg.col0.w);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z) + (this.col3.y * arg.col1.w);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y) + (this.col2.y * arg.col2.z) + (this.col3.y * arg.col2.w);
- r.col3.y = (this.col0.y * arg.col3.x) + (this.col1.y * arg.col3.y) + (this.col2.y * arg.col3.z) + (this.col3.y * arg.col3.w);
- return r;
- }
return r;
}
throw new IllegalArgumentException(arg);
diff --git a/lib/VectorMath/gen/matrix4x3_gen.dart b/lib/VectorMath/gen/matrix4x3_gen.dart
index 69fb6f3..66236dd 100644
--- a/lib/VectorMath/gen/matrix4x3_gen.dart
+++ b/lib/VectorMath/gen/matrix4x3_gen.dart
@@ -227,9 +227,9 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
- s += '[2] ${getRow(2)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
+ s = '$s[2] ${getRow(2)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -242,10 +242,10 @@
vec3 operator[](int column) {
assert(column >= 0 && column < 4);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
- case 2: return col2; break;
- case 3: return col3; break;
+ case 0: return col0;
+ case 1: return col1;
+ case 2: return col2;
+ case 3: return col3;
}
throw new IllegalArgumentException(column);
}
@@ -253,10 +253,10 @@
vec3 operator[]=(int column, vec3 arg) {
assert(column >= 0 && column < 4);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
- case 2: col2 = arg; return col2; break;
- case 3: col3 = arg; return col3; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
+ case 2: col2 = arg; return col2;
+ case 3: col3 = arg; return col3;
}
throw new IllegalArgumentException(column);
}
@@ -350,22 +350,6 @@
r.col2.z = (this.col0.z * arg.col2.x) + (this.col1.z * arg.col2.y) + (this.col2.z * arg.col2.z) + (this.col3.z * arg.col2.w);
return r;
}
- if (arg.cols == 4) {
- r = new mat4x3();
- r.col0.x = (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y) + (this.col2.x * arg.col0.z) + (this.col3.x * arg.col0.w);
- r.col1.x = (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y) + (this.col2.x * arg.col1.z) + (this.col3.x * arg.col1.w);
- r.col2.x = (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y) + (this.col2.x * arg.col2.z) + (this.col3.x * arg.col2.w);
- r.col3.x = (this.col0.x * arg.col3.x) + (this.col1.x * arg.col3.y) + (this.col2.x * arg.col3.z) + (this.col3.x * arg.col3.w);
- r.col0.y = (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y) + (this.col2.y * arg.col0.z) + (this.col3.y * arg.col0.w);
- r.col1.y = (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z) + (this.col3.y * arg.col1.w);
- r.col2.y = (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y) + (this.col2.y * arg.col2.z) + (this.col3.y * arg.col2.w);
- r.col3.y = (this.col0.y * arg.col3.x) + (this.col1.y * arg.col3.y) + (this.col2.y * arg.col3.z) + (this.col3.y * arg.col3.w);
- r.col0.z = (this.col0.z * arg.col0.x) + (this.col1.z * arg.col0.y) + (this.col2.z * arg.col0.z) + (this.col3.z * arg.col0.w);
- r.col1.z = (this.col0.z * arg.col1.x) + (this.col1.z * arg.col1.y) + (this.col2.z * arg.col1.z) + (this.col3.z * arg.col1.w);
- r.col2.z = (this.col0.z * arg.col2.x) + (this.col1.z * arg.col2.y) + (this.col2.z * arg.col2.z) + (this.col3.z * arg.col2.w);
- r.col3.z = (this.col0.z * arg.col3.x) + (this.col1.z * arg.col3.y) + (this.col2.z * arg.col3.z) + (this.col3.z * arg.col3.w);
- return r;
- }
return r;
}
throw new IllegalArgumentException(arg);
diff --git a/lib/VectorMath/gen/matrix4x4_gen.dart b/lib/VectorMath/gen/matrix4x4_gen.dart
index 3d255b6..ef9837b 100644
--- a/lib/VectorMath/gen/matrix4x4_gen.dart
+++ b/lib/VectorMath/gen/matrix4x4_gen.dart
@@ -324,10 +324,10 @@
/// Returns a printable string
String toString() {
String s = '';
- s += '[0] ${getRow(0)}\n';
- s += '[1] ${getRow(1)}\n';
- s += '[2] ${getRow(2)}\n';
- s += '[3] ${getRow(3)}\n';
+ s = '$s[0] ${getRow(0)}\n';
+ s = '$s[1] ${getRow(1)}\n';
+ s = '$s[2] ${getRow(2)}\n';
+ s = '$s[3] ${getRow(3)}\n';
return s;
}
/// Returns the number of rows in the matrix.
@@ -340,10 +340,10 @@
vec4 operator[](int column) {
assert(column >= 0 && column < 4);
switch (column) {
- case 0: return col0; break;
- case 1: return col1; break;
- case 2: return col2; break;
- case 3: return col3; break;
+ case 0: return col0;
+ case 1: return col1;
+ case 2: return col2;
+ case 3: return col3;
}
throw new IllegalArgumentException(column);
}
@@ -351,10 +351,10 @@
vec4 operator[]=(int column, vec4 arg) {
assert(column >= 0 && column < 4);
switch (column) {
- case 0: col0 = arg; return col0; break;
- case 1: col1 = arg; return col1; break;
- case 2: col2 = arg; return col2; break;
- case 3: col3 = arg; return col3; break;
+ case 0: col0 = arg; return col0;
+ case 1: col1 = arg; return col1;
+ case 2: col2 = arg; return col2;
+ case 3: col3 = arg; return col3;
}
throw new IllegalArgumentException(column);
}
@@ -698,20 +698,20 @@
this.col1.z = temp;
}
num invert() {
- double det = determinant();
+ num det = determinant();
if (det == 0.0) {
return 0.0;
}
- double invDet = 1.0 / det;
+ num invDet = 1.0 / det;
selfScaleAdjoint(invDet);
return det;
}
num invertRotation() {
- double det = determinant();
+ num det = determinant();
if (det == 0.0) {
return 0.0;
}
- double invDet = 1.0 / det;
+ num invDet = 1.0 / det;
vec4 i = new vec4.zero();
vec4 j = new vec4.zero();
vec4 k = new vec4.zero();
@@ -731,8 +731,8 @@
}
/// Sets the upper 3x3 to a rotation of [radians] around X
void setRotationAroundX(num radians_) {
- double c = Math.cos(radians_);
- double s = Math.sin(radians_);
+ num c = Math.cos(radians_);
+ num s = Math.sin(radians_);
col0.x = 1.0;
col0.y = 0.0;
col0.z = 0.0;
@@ -748,8 +748,8 @@
}
/// Sets the upper 3x3 to a rotation of [radians] around Y
void setRotationAroundY(num radians_) {
- double c = Math.cos(radians_);
- double s = Math.sin(radians_);
+ num c = Math.cos(radians_);
+ num s = Math.sin(radians_);
col0.x = c;
col0.y = 0.0;
col0.z = -s;
@@ -765,8 +765,8 @@
}
/// Sets the upper 3x3 to a rotation of [radians] around Z
void setRotationAroundZ(num radians_) {
- double c = Math.cos(radians_);
- double s = Math.sin(radians_);
+ num c = Math.cos(radians_);
+ num s = Math.sin(radians_);
col0.x = c;
col0.y = s;
col0.z = 0.0;
@@ -781,24 +781,24 @@
col2.w = 0.0;
}
/// Converts into Adjugate matrix and scales by [scale]
- void selfScaleAdjoint(double scale) {
+ void selfScaleAdjoint(num scale) {
// Adapted from code by Richard Carling.
- double a1 = col0.x;
- double b1 = col1.x;
- double c1 = col2.x;
- double d1 = col3.x;
- double a2 = col0.y;
- double b2 = col1.y;
- double c2 = col2.y;
- double d2 = col3.y;
- double a3 = col0.z;
- double b3 = col1.z;
- double c3 = col2.z;
- double d3 = col3.z;
- double a4 = col0.w;
- double b4 = col1.w;
- double c4 = col2.w;
- double d4 = col3.w;
+ num a1 = col0.x;
+ num b1 = col1.x;
+ num c1 = col2.x;
+ num d1 = col3.x;
+ num a2 = col0.y;
+ num b2 = col1.y;
+ num c2 = col2.y;
+ num d2 = col3.y;
+ num a3 = col0.z;
+ num b3 = col1.z;
+ num c3 = col2.z;
+ num d3 = col3.z;
+ num a4 = col0.w;
+ num b4 = col1.w;
+ num c4 = col2.w;
+ num d4 = col3.w;
col0.x = (b2 * (c3 * d4 - c4 * d3) - c2 * (b3 * d4 - b4 * d3) + d2 * (b3 * c4 - b4 * c3)) * scale;
col0.y = - (a2 * (c3 * d4 - c4 * d3) - c2 * (a3 * d4 - a4 * d3) + d2 * (a3 * c4 - a4 * c3)) * scale;
col0.z = (a2 * (b3 * d4 - b4 * d3) - b2 * (a3 * d4 - a4 * d3) + d2 * (a3 * b4 - a4 * b3)) * scale;
@@ -896,22 +896,22 @@
return this;
}
mat4x4 selfMultiply(mat4x4 arg) {
- double m00 = col0.x;
- double m01 = col1.x;
- double m02 = col2.x;
- double m03 = col3.x;
- double m10 = col0.y;
- double m11 = col1.y;
- double m12 = col2.y;
- double m13 = col3.y;
- double m20 = col0.z;
- double m21 = col1.z;
- double m22 = col2.z;
- double m23 = col3.z;
- double m30 = col0.w;
- double m31 = col1.w;
- double m32 = col2.w;
- double m33 = col3.w;
+ num m00 = col0.x;
+ num m01 = col1.x;
+ num m02 = col2.x;
+ num m03 = col3.x;
+ num m10 = col0.y;
+ num m11 = col1.y;
+ num m12 = col2.y;
+ num m13 = col3.y;
+ num m20 = col0.z;
+ num m21 = col1.z;
+ num m22 = col2.z;
+ num m23 = col3.z;
+ num m30 = col0.w;
+ num m31 = col1.w;
+ num m32 = col2.w;
+ num m33 = col3.w;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col0.y) + (m02 * arg.col0.z) + (m03 * arg.col0.w);
col1.x = (m00 * arg.col1.x) + (m01 * arg.col1.y) + (m02 * arg.col1.z) + (m03 * arg.col1.w);
col2.x = (m00 * arg.col2.x) + (m01 * arg.col2.y) + (m02 * arg.col2.z) + (m03 * arg.col2.w);
@@ -931,22 +931,22 @@
return this;
}
mat4x4 selfTransposeMultiply(mat4x4 arg) {
- double m00 = col0.x;
- double m01 = col0.y;
- double m02 = col0.z;
- double m03 = col0.w;
- double m10 = col1.x;
- double m11 = col1.y;
- double m12 = col1.z;
- double m13 = col1.w;
- double m20 = col2.x;
- double m21 = col2.y;
- double m22 = col2.z;
- double m23 = col2.w;
- double m30 = col3.x;
- double m31 = col3.y;
- double m32 = col3.z;
- double m33 = col3.w;
+ num m00 = col0.x;
+ num m01 = col0.y;
+ num m02 = col0.z;
+ num m03 = col0.w;
+ num m10 = col1.x;
+ num m11 = col1.y;
+ num m12 = col1.z;
+ num m13 = col1.w;
+ num m20 = col2.x;
+ num m21 = col2.y;
+ num m22 = col2.z;
+ num m23 = col2.w;
+ num m30 = col3.x;
+ num m31 = col3.y;
+ num m32 = col3.z;
+ num m33 = col3.w;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col0.y) + (m02 * arg.col0.z) + (m03 * arg.col0.w);
col1.x = (m00 * arg.col1.x) + (m01 * arg.col1.y) + (m02 * arg.col1.z) + (m03 * arg.col1.w);
col2.x = (m00 * arg.col2.x) + (m01 * arg.col2.y) + (m02 * arg.col2.z) + (m03 * arg.col2.w);
@@ -966,22 +966,22 @@
return this;
}
mat4x4 selfMultiplyTranpose(mat4x4 arg) {
- double m00 = col0.x;
- double m01 = col1.x;
- double m02 = col2.x;
- double m03 = col3.x;
- double m10 = col0.y;
- double m11 = col1.y;
- double m12 = col2.y;
- double m13 = col3.y;
- double m20 = col0.z;
- double m21 = col1.z;
- double m22 = col2.z;
- double m23 = col3.z;
- double m30 = col0.w;
- double m31 = col1.w;
- double m32 = col2.w;
- double m33 = col3.w;
+ num m00 = col0.x;
+ num m01 = col1.x;
+ num m02 = col2.x;
+ num m03 = col3.x;
+ num m10 = col0.y;
+ num m11 = col1.y;
+ num m12 = col2.y;
+ num m13 = col3.y;
+ num m20 = col0.z;
+ num m21 = col1.z;
+ num m22 = col2.z;
+ num m23 = col3.z;
+ num m30 = col0.w;
+ num m31 = col1.w;
+ num m32 = col2.w;
+ num m33 = col3.w;
col0.x = (m00 * arg.col0.x) + (m01 * arg.col1.x) + (m02 * arg.col2.x) + (m03 * arg.col3.x);
col1.x = (m00 * arg.col0.y) + (m01 * arg.col1.y) + (m02 * arg.col2.y) + (m03 * arg.col3.y);
col2.x = (m00 * arg.col0.z) + (m01 * arg.col1.z) + (m02 * arg.col2.z) + (m03 * arg.col3.z);
@@ -1000,4 +1000,32 @@
col3.w = (m30 * arg.col0.w) + (m31 * arg.col1.w) + (m32 * arg.col2.w) + (m33 * arg.col3.w);
return this;
}
+ vec3 transformDirect3(vec3 arg) {
+ num x_ = (this.col0.x * arg.x) + (this.col1.x * arg.y) + (this.col2.x * arg.z);
+ num y_ = (this.col0.y * arg.x) + (this.col1.y * arg.y) + (this.col2.y * arg.z);
+ num z_ = (this.col0.z * arg.x) + (this.col1.z * arg.y) + (this.col2.z * arg.z);
+ arg.x = x_;
+ arg.y = y_;
+ arg.z = z_;
+ return arg;
+ }
+ vec3 transform3(vec3 arg) {
+ vec3 d = arg.copy();
+ return transformDirect3(d);
+ }
+ vec4 transformDirect(vec4 arg) {
+ num x_ = (this.col0.x * arg.x) + (this.col1.x * arg.y) + (this.col2.x * arg.z);
+ num y_ = (this.col0.y * arg.x) + (this.col1.y * arg.y) + (this.col2.y * arg.z);
+ num z_ = (this.col0.z * arg.x) + (this.col1.z * arg.y) + (this.col2.z * arg.z);
+ num w_ = (this.col0.w * arg.x) + (this.col1.w * arg.y) + (this.col2.w * arg.z);
+ arg.x = x_;
+ arg.y = y_;
+ arg.z = z_;
+ arg.w = w_;
+ return arg;
+ }
+ vec4 transform(vec4 arg) {
+ vec4 d = arg.copy();
+ return transformDirect(d);
+ }
}
diff --git a/lib/VectorMath/gen/vec2_gen.dart b/lib/VectorMath/gen/vec2_gen.dart
index b85ac74..9781e4b 100644
--- a/lib/VectorMath/gen/vec2_gen.dart
+++ b/lib/VectorMath/gen/vec2_gen.dart
@@ -86,8 +86,8 @@
num operator[](int i) {
assert(i >= 0 && i < 2);
switch (i) {
- case 0: return x; break;
- case 1: return y; break;
+ case 0: return x;
+ case 1: return y;
};
return 0.0;
}
@@ -95,8 +95,8 @@
num operator[]=(int i, num v) {
assert(i >= 0 && i < 2);
switch (i) {
- case 0: x = v; return x; break;
- case 1: y = v; return y; break;
+ case 0: x = v; return x;
+ case 1: y = v; return y;
};
return 0.0;
}
@@ -292,6 +292,6 @@
}
vec2 copy() {
vec2 c = new vec2.copy(this);
- return c
+ return c;
}
}
diff --git a/lib/VectorMath/gen/vec3_gen.dart b/lib/VectorMath/gen/vec3_gen.dart
index e42a2d8..31ec7fc 100644
--- a/lib/VectorMath/gen/vec3_gen.dart
+++ b/lib/VectorMath/gen/vec3_gen.dart
@@ -33,7 +33,7 @@
this.z = y_;
}
if (x_ is num && y_ is vec2) {
- this.x = x_.x;
+ this.x = x_;
this.yz = y_.xy;
}
if (x_ is vec2 && y_ == null) {
@@ -103,9 +103,9 @@
num operator[](int i) {
assert(i >= 0 && i < 3);
switch (i) {
- case 0: return x; break;
- case 1: return y; break;
- case 2: return z; break;
+ case 0: return x;
+ case 1: return y;
+ case 2: return z;
};
return 0.0;
}
@@ -113,9 +113,9 @@
num operator[]=(int i, num v) {
assert(i >= 0 && i < 3);
switch (i) {
- case 0: x = v; return x; break;
- case 1: y = v; return y; break;
- case 2: z = v; return z; break;
+ case 0: x = v; return x;
+ case 1: y = v; return y;
+ case 2: z = v; return z;
};
return 0.0;
}
@@ -734,6 +734,6 @@
}
vec3 copy() {
vec3 c = new vec3.copy(this);
- return c
+ return c;
}
}
diff --git a/lib/VectorMath/gen/vec4_gen.dart b/lib/VectorMath/gen/vec4_gen.dart
index e7b9d3d..b71babc 100644
--- a/lib/VectorMath/gen/vec4_gen.dart
+++ b/lib/VectorMath/gen/vec4_gen.dart
@@ -112,10 +112,10 @@
num operator[](int i) {
assert(i >= 0 && i < 4);
switch (i) {
- case 0: return x; break;
- case 1: return y; break;
- case 2: return z; break;
- case 3: return w; break;
+ case 0: return x;
+ case 1: return y;
+ case 2: return z;
+ case 3: return w;
};
return 0.0;
}
@@ -123,10 +123,10 @@
num operator[]=(int i, num v) {
assert(i >= 0 && i < 4);
switch (i) {
- case 0: x = v; return x; break;
- case 1: y = v; return y; break;
- case 2: z = v; return z; break;
- case 3: w = v; return w; break;
+ case 0: x = v; return x;
+ case 1: y = v; return y;
+ case 2: z = v; return z;
+ case 3: w = v; return w;
};
return 0.0;
}
@@ -2186,6 +2186,6 @@
}
vec4 copy() {
vec4 c = new vec4.copy(this);
- return c
+ return c;
}
}