Move to latest team lints, require Dart 2.19 (#281)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 92c1642..0c50966 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,7 +14,7 @@
strategy:
fail-fast: false
matrix:
- sdk: [2.14.0, dev]
+ sdk: [2.19.0, dev]
steps:
# These are the latest versions of the github actions; dependabot will
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b77c4a..152d750 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.1.5
+
+- Require Dart 2.19
+
## 2.1.4
- Refactor the locations of the `SimplexNoise` related part files.
diff --git a/analysis_options.yaml b/analysis_options.yaml
index d2d8b98..6c14937 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,4 +1,4 @@
-include: package:lints/recommended.yaml
+include: package:dart_flutter_team_lints/analysis_options.yaml
analyzer:
errors:
@@ -10,9 +10,7 @@
linter:
rules:
- - always_declare_return_types
- avoid_bool_literals_in_conditional_expressions
- - avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_private_typedef_functions
- avoid_redundant_argument_values
@@ -22,29 +20,17 @@
- avoid_void_async
- cancel_subscriptions
- comment_references
- - directives_ordering
- join_return_with_assignment
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_runtimeType_toString
- - omit_local_variable_types
- - only_throw_errors
- package_api_docs
- - prefer_asserts_in_initializer_lists
- prefer_const_constructors
- prefer_expression_function_bodies
- prefer_final_locals
- - prefer_interpolation_to_compose_strings
- prefer_relative_imports
- - prefer_single_quotes
- - sort_pub_dependencies
- test_types_in_equals
- - throw_in_finally
- - unawaited_futures
- unnecessary_await_in_return
- - unnecessary_lambdas
- - unnecessary_null_aware_assignments
- - unnecessary_parenthesis
- - unnecessary_statements
- use_string_buffers
+ - use_super_parameters
diff --git a/lib/src/vector_math/aabb2.dart b/lib/src/vector_math/aabb2.dart
index a20a8c3..41283d1 100644
--- a/lib/src/vector_math/aabb2.dart
+++ b/lib/src/vector_math/aabb2.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a 2-dimensional axis-aligned bounding box between a [min] and a
/// [max] position.
diff --git a/lib/src/vector_math/aabb3.dart b/lib/src/vector_math/aabb3.dart
index 48e17d5..f48511d 100644
--- a/lib/src/vector_math/aabb3.dart
+++ b/lib/src/vector_math/aabb3.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a 3-dimensional axis-aligned bounding box between a [min] and a
/// [max] position.
@@ -587,8 +587,10 @@
}
}
- // Test the three axes corresponding to the face normals of AABB b (category 1). // Exit if...
- // ... [-e0, e0] and [min(v0.x,v1.x,v2.x), max(v0.x,v1.x,v2.x)] do not overlap
+ // Test the three axes corresponding to the face normals of AABB b
+ // (category 1).
+ // Exit if [-e0, e0] and [min(v0.x,v1.x,v2.x), max(v0.x,v1.x,v2.x)] do not
+ // overlap
if (math.max(_v0.x, math.max(_v1.x, _v2.x)) < -_aabbHalfExtents[0] ||
math.min(_v0.x, math.min(_v1.x, _v2.x)) > _aabbHalfExtents[0]) {
return false;
@@ -598,7 +600,8 @@
result._depth = a;
result.axis.setFrom(_u0);
}
- // ... [-e1, e1] and [min(v0.y,v1.y,v2.y), max(v0.y,v1.y,v2.y)] do not overlap
+ // ... [-e1, e1] and [min(v0.y,v1.y,v2.y), max(v0.y,v1.y,v2.y)] do not
+ // overlap
if (math.max(_v0.y, math.max(_v1.y, _v2.y)) < -_aabbHalfExtents[1] ||
math.min(_v0.y, math.min(_v1.y, _v2.y)) > _aabbHalfExtents[1]) {
return false;
@@ -608,7 +611,8 @@
result._depth = a;
result.axis.setFrom(_u1);
}
- // ... [-e2, e2] and [min(v0.z,v1.z,v2.z), max(v0.z,v1.z,v2.z)] do not overlap
+ // ... [-e2, e2] and [min(v0.z,v1.z,v2.z), max(v0.z,v1.z,v2.z)] do not
+ // overlap
if (math.max(_v0.z, math.max(_v1.z, _v2.z)) < -_aabbHalfExtents[2] ||
math.min(_v0.z, math.min(_v1.z, _v2.z)) > _aabbHalfExtents[2]) {
return false;
diff --git a/lib/src/vector_math/colors.dart b/lib/src/vector_math/colors.dart
index b35a5bc..fed2bd6 100644
--- a/lib/src/vector_math/colors.dart
+++ b/lib/src/vector_math/colors.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Contains functions for converting between different color models and
/// manipulating colors. In addition to that, some known colors can be accessed
diff --git a/lib/src/vector_math/constants.dart b/lib/src/vector_math/constants.dart
index 3b3350d..e7ab907 100644
--- a/lib/src/vector_math/constants.dart
+++ b/lib/src/vector_math/constants.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Constant factor to convert and angle from degrees to radians.
const double degrees2Radians = math.pi / 180.0;
diff --git a/lib/src/vector_math/error_helpers.dart b/lib/src/vector_math/error_helpers.dart
index 3739f05..5ce06d8 100644
--- a/lib/src/vector_math/error_helpers.dart
+++ b/lib/src/vector_math/error_helpers.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Returns relative error between [calculated] and [correct].
/// The type of [calculated] and [correct] must match and can
@@ -12,7 +12,8 @@
final diff = (calculated - correct).abs().toDouble();
return diff / correct;
}
- // ignore: return_of_invalid_type
+ // avoiding an `as double` cast here to maximize speed on dart2js
+ // ignore: avoid_dynamic_calls, return_of_invalid_type
return calculated.relativeError(correct);
}
@@ -24,6 +25,7 @@
final diff = (calculated - correct).abs().toDouble();
return diff;
}
- // ignore: return_of_invalid_type
+ // avoiding an `as double` cast here to maximize speed on dart2js
+ // ignore: avoid_dynamic_calls, return_of_invalid_type
return calculated.absoluteError(correct);
}
diff --git a/lib/src/vector_math/frustum.dart b/lib/src/vector_math/frustum.dart
index b5d5577..a2381be 100644
--- a/lib/src/vector_math/frustum.dart
+++ b/lib/src/vector_math/frustum.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a frustum constructed out of six [Plane]s.
class Frustum {
diff --git a/lib/src/vector_math/intersection_result.dart b/lib/src/vector_math/intersection_result.dart
index 75b56a1..bdcef35 100644
--- a/lib/src/vector_math/intersection_result.dart
+++ b/lib/src/vector_math/intersection_result.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a result of an intersection test.
class IntersectionResult {
diff --git a/lib/src/vector_math/matrix2.dart b/lib/src/vector_math/matrix2.dart
index 1d2cceb..50bb87f 100644
--- a/lib/src/vector_math/matrix2.dart
+++ b/lib/src/vector_math/matrix2.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// 2D Matrix.
/// Values are stored in column major order.
diff --git a/lib/src/vector_math/matrix3.dart b/lib/src/vector_math/matrix3.dart
index befbb80..c2b1c83 100644
--- a/lib/src/vector_math/matrix3.dart
+++ b/lib/src/vector_math/matrix3.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// 3D Matrix.
/// Values are stored in column major order.
diff --git a/lib/src/vector_math/matrix4.dart b/lib/src/vector_math/matrix4.dart
index d0cdaf4..c87081f 100644
--- a/lib/src/vector_math/matrix4.dart
+++ b/lib/src/vector_math/matrix4.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// 4D Matrix.
/// Values are stored in column major order.
@@ -1110,7 +1110,8 @@
return diff_norm;
}
- /// Returns the translation vector from this homogeneous transformation matrix.
+ /// Returns the translation vector from this homogeneous transformation
+ /// matrix.
Vector3 getTranslation() {
final z = _m4storage[14];
final y = _m4storage[13];
@@ -1172,8 +1173,10 @@
_m4storage[10] = rStorage[8];
}
- /// Returns the normal matrix from this homogeneous transformation matrix. The normal
- /// matrix is the transpose of the inverse of the top-left 3x3 part of this 4x4 matrix.
+ /// Returns the normal matrix from this homogeneous transformation matrix.
+ ///
+ /// The normal matrix is the transpose of the inverse of the top-left 3x3 part
+ /// of this 4x4 matrix.
Matrix3 getNormalMatrix() => Matrix3.identity()..copyNormalMatrix(this);
/// Returns the max scale value of the 3 axes.
diff --git a/lib/src/vector_math/noise.dart b/lib/src/vector_math/noise.dart
index 32180be..c389bd3 100644
--- a/lib/src/vector_math/noise.dart
+++ b/lib/src/vector_math/noise.dart
@@ -19,7 +19,7 @@
*/
-part of vector_math;
+part of '../../vector_math.dart';
/*
* This is based on the implementation of Simplex Noise by Stefan Gustavson
@@ -249,8 +249,8 @@
}
// A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z),
// a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and
- // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where
- // c = 1/6.
+ // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z),
+ // where c = 1/6.
final x1 = x0 - i1 + _g3; // Offsets for second corner in (x,y,z) coords
final y1 = y0 - j1 + _g3;
final z1 = z0 - k1 + _g3;
@@ -365,9 +365,11 @@
int i2, j2, k2, l2; // The integer offsets for the third simplex corner
int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner
// simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.
- // Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w
- // impossible. Only the 24 indices which have non-zero entries make any sense.
- // We use a thresholding to set the coordinates in turn from the largest magnitude.
+ // Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and
+ // x<w impossible. Only the 24 indices which have non-zero entries make any
+ // sense.
+ // We use a thresholding to set the coordinates in turn from the largest
+ // magnitude.
// Rank 3 denotes the largest coordinate.
i1 = rankx >= 3 ? 1 : 0;
j1 = ranky >= 3 ? 1 : 0;
@@ -383,7 +385,8 @@
j3 = ranky >= 1 ? 1 : 0;
k3 = rankz >= 1 ? 1 : 0;
l3 = rankw >= 1 ? 1 : 0;
- // The fifth corner has all coordinate offsets = 1, so no need to compute that.
+ // The fifth corner has all coordinate offsets = 1, so no need to compute
+ // that.
final x1 = x0 - i1 + _G4; // Offsets for second corner in (x,y,z,w) coords
final y1 = y0 - j1 + _G4;
final z1 = z0 - k1 + _G4;
diff --git a/lib/src/vector_math/obb3.dart b/lib/src/vector_math/obb3.dart
index 876685f..ee94b5e 100644
--- a/lib/src/vector_math/obb3.dart
+++ b/lib/src/vector_math/obb3.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a 3-dimensional oriented bounding box defined with a [center],
/// [halfExtents] and axes.
@@ -167,7 +167,8 @@
}
}
- /// Find the closest point [q] on the OBB to the point [p] and store it in [q].
+ /// Find the closest point [q] on the OBB to the point [p] and store it in
+ /// [q].
void closestPointTo(Vector3 p, Vector3 q) {
final d = p - _center;
diff --git a/lib/src/vector_math/opengl.dart b/lib/src/vector_math/opengl.dart
index 26e5df3..935bc1a 100644
--- a/lib/src/vector_math/opengl.dart
+++ b/lib/src/vector_math/opengl.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Constructs a rotation matrix in [rotationMatrix].
///
diff --git a/lib/src/vector_math/plane.dart b/lib/src/vector_math/plane.dart
index c8d9b61..55533f4 100644
--- a/lib/src/vector_math/plane.dart
+++ b/lib/src/vector_math/plane.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
class Plane {
final Vector3 _normal;
diff --git a/lib/src/vector_math/quad.dart b/lib/src/vector_math/quad.dart
index 7d322ad..39064b9 100644
--- a/lib/src/vector_math/quad.dart
+++ b/lib/src/vector_math/quad.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a quad by four points.
class Quad {
diff --git a/lib/src/vector_math/quaternion.dart b/lib/src/vector_math/quaternion.dart
index 7f134ff..5ff2f6b 100644
--- a/lib/src/vector_math/quaternion.dart
+++ b/lib/src/vector_math/quaternion.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a [Quaternion] (a four-dimensional vector) for efficient rotation
/// calculations.
@@ -170,12 +170,14 @@
// a and b are parallel in opposite directions. We need any
// vector as our rotation axis that is perpendicular.
- // Find one by taking the cross product of v1 with an appropriate unit axis
+ // Find one by taking the cross product of v1 with an appropriate unit
+ // axis
if (v1.x > v1.y && v1.x > v1.z) {
// v1 points in a dominantly x direction, so don't cross with that axis
axis = v1.cross(Vector3(0.0, 1.0, 0.0));
} else {
- // Predominantly points in some other direction, so x-axis should be safe
+ // Predominantly points in some other direction, so x-axis should be
+ // safe
axis = v1.cross(Vector3(1.0, 0.0, 0.0));
}
} else if ((1.0 - c).abs() < 0.0005) {
@@ -219,14 +221,14 @@
final ox = omegaStorage[0];
final oy = omegaStorage[1];
final oz = omegaStorage[2];
- final _x = ox * qw + oy * qz - oz * qy;
- final _y = oy * qw + oz * qx - ox * qz;
- final _z = oz * qw + ox * qy - oy * qx;
- final _w = -ox * qx - oy * qy - oz * qz;
- _qStorage[0] = _x * 0.5;
- _qStorage[1] = _y * 0.5;
- _qStorage[2] = _z * 0.5;
- _qStorage[3] = _w * 0.5;
+ final x = ox * qw + oy * qz - oz * qy;
+ final y = oy * qw + oz * qx - ox * qz;
+ final z = oz * qw + ox * qy - oy * qx;
+ final w = -ox * qx - oy * qy - oz * qz;
+ _qStorage[0] = x * 0.5;
+ _qStorage[1] = y * 0.5;
+ _qStorage[2] = z * 0.5;
+ _qStorage[3] = w * 0.5;
}
/// Set quaternion with rotation of [yaw], [pitch] and [roll].
@@ -323,21 +325,21 @@
/// Rotates [v] by this.
Vector3 rotate(Vector3 v) {
// conjugate(this) * [v,0] * this
- final _w = _qStorage[3];
- final _z = _qStorage[2];
- final _y = _qStorage[1];
- final _x = _qStorage[0];
- final tiw = _w;
- final tiz = -_z;
- final tiy = -_y;
- final tix = -_x;
+ final w = _qStorage[3];
+ final z = _qStorage[2];
+ final y = _qStorage[1];
+ final x = _qStorage[0];
+ final tiw = w;
+ final tiz = -z;
+ final tiy = -y;
+ final tix = -x;
final tx = tiw * v.x + tix * 0.0 + tiy * v.z - tiz * v.y;
final ty = tiw * v.y + tiy * 0.0 + tiz * v.x - tix * v.z;
final tz = tiw * v.z + tiz * 0.0 + tix * v.y - tiy * v.x;
final tw = tiw * 0.0 - tix * v.x - tiy * v.y - tiz * v.z;
- final result_x = tw * _x + tx * _w + ty * _z - tz * _y;
- final result_y = tw * _y + ty * _w + tz * _x - tx * _z;
- final result_z = tw * _z + tz * _w + tx * _y - ty * _x;
+ final result_x = tw * x + tx * w + ty * z - tz * y;
+ final result_y = tw * y + ty * w + tz * x - tx * z;
+ final result_z = tw * z + tz * w + tx * y - ty * x;
final vStorage = v.storage;
vStorage[2] = result_z;
vStorage[1] = result_y;
@@ -376,20 +378,20 @@
/// this rotated by [other].
Quaternion operator *(Quaternion other) {
- final _w = _qStorage[3];
- final _z = _qStorage[2];
- final _y = _qStorage[1];
- final _x = _qStorage[0];
+ final w = _qStorage[3];
+ final z = _qStorage[2];
+ final y = _qStorage[1];
+ final x = _qStorage[0];
final otherStorage = other._qStorage;
final ow = otherStorage[3];
final oz = otherStorage[2];
final oy = otherStorage[1];
final ox = otherStorage[0];
return Quaternion(
- _w * ox + _x * ow + _y * oz - _z * oy,
- _w * oy + _y * ow + _z * ox - _x * oz,
- _w * oz + _z * ow + _x * oy - _y * ox,
- _w * ow - _x * ox - _y * oy - _z * oz);
+ w * ox + x * ow + y * oz - z * oy,
+ w * oy + y * ow + z * ox - x * oz,
+ w * oz + z * ow + x * oy - y * ox,
+ w * ow - x * ox - y * oy - z * oz);
}
/// Returns copy of this + [other].
@@ -419,26 +421,26 @@
assert(d != 0.0);
final s = 2.0 / d;
- final _x = _qStorage[0];
- final _y = _qStorage[1];
- final _z = _qStorage[2];
- final _w = _qStorage[3];
+ final x = _qStorage[0];
+ final y = _qStorage[1];
+ final z = _qStorage[2];
+ final w = _qStorage[3];
- final xs = _x * s;
- final ys = _y * s;
- final zs = _z * s;
+ final xs = x * s;
+ final ys = y * s;
+ final zs = z * s;
- final wx = _w * xs;
- final wy = _w * ys;
- final wz = _w * zs;
+ final wx = w * xs;
+ final wy = w * ys;
+ final wz = w * zs;
- final xx = _x * xs;
- final xy = _x * ys;
- final xz = _x * zs;
+ final xx = x * xs;
+ final xy = x * ys;
+ final xz = x * zs;
- final yy = _y * ys;
- final yz = _y * zs;
- final zz = _z * zs;
+ final yy = y * ys;
+ final yz = y * zs;
+ final zz = z * zs;
final rotationMatrixStorage = rotationMatrix.storage;
rotationMatrixStorage[0] = 1.0 - (yy + zz); // column 0
diff --git a/lib/src/vector_math/ray.dart b/lib/src/vector_math/ray.dart
index 779fb96..8832663 100644
--- a/lib/src/vector_math/ray.dart
+++ b/lib/src/vector_math/ray.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a [Ray] by an [origin] and a [direction].
class Ray {
diff --git a/lib/src/vector_math/sphere.dart b/lib/src/vector_math/sphere.dart
index 492f0f6..0a0118e 100644
--- a/lib/src/vector_math/sphere.dart
+++ b/lib/src/vector_math/sphere.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a sphere with a [center] and a [radius].
class Sphere {
diff --git a/lib/src/vector_math/triangle.dart b/lib/src/vector_math/triangle.dart
index b960c2d..f3ffdfa 100644
--- a/lib/src/vector_math/triangle.dart
+++ b/lib/src/vector_math/triangle.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Defines a triangle by three points.
class Triangle {
diff --git a/lib/src/vector_math/utilities.dart b/lib/src/vector_math/utilities.dart
index 332cbfb..c0aaf57 100644
--- a/lib/src/vector_math/utilities.dart
+++ b/lib/src/vector_math/utilities.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// Convert [radians] to degrees.
double degrees(double radians) => radians * radians2Degrees;
diff --git a/lib/src/vector_math/vector.dart b/lib/src/vector_math/vector.dart
index c769450..7ce644b 100644
--- a/lib/src/vector_math/vector.dart
+++ b/lib/src/vector_math/vector.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// 2D dot product.
double dot2(Vector2 x, Vector2 y) => x.dot(y);
diff --git a/lib/src/vector_math/vector2.dart b/lib/src/vector_math/vector2.dart
index b12fdff..3ea345c 100644
--- a/lib/src/vector_math/vector2.dart
+++ b/lib/src/vector_math/vector2.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// 2D column vector.
class Vector2 implements Vector {
@@ -230,8 +230,8 @@
///
/// Transforms this into the product of this as a row vector,
/// postmultiplied by matrix, [arg].
- /// If [arg] is a rotation matrix, this is a computational shortcut for applying,
- /// the inverse of the transformation.
+ /// If [arg] is a rotation matrix, this is a computational shortcut for
+ /// applying, the inverse of the transformation.
///
void postmultiply(Matrix2 arg) {
final argStorage = arg.storage;
@@ -247,7 +247,9 @@
return _v2storage[0] * otherStorage[1] - _v2storage[1] * otherStorage[0];
}
- /// Rotate this by 90 degrees then scale it. Store result in [out]. Return [out].
+ /// Rotate this by 90 degrees then scale it.
+ ///
+ /// Store result in [out]. Return [out].
Vector2 scaleOrthogonalInto(double scale, Vector2 out) {
out.setValues(-scale * _v2storage[1], scale * _v2storage[0]);
return out;
diff --git a/lib/src/vector_math/vector3.dart b/lib/src/vector_math/vector3.dart
index c6eff4c..7a565db 100644
--- a/lib/src/vector_math/vector3.dart
+++ b/lib/src/vector_math/vector3.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// 3D column vector.
class Vector3 implements Vector {
@@ -241,10 +241,11 @@
return sum;
}
- /// Transforms this into the product of this as a row vector,
- /// postmultiplied by matrix, [arg].
- /// If [arg] is a rotation matrix, this is a computational shortcut for applying,
- /// the inverse of the transformation.
+ /// Transforms this into the product of this as a row vector, postmultiplied
+ /// by matrix, [arg].
+ ///
+ /// If [arg] is a rotation matrix, this is a computational shortcut for
+ /// applying, the inverse of the transformation.
void postmultiply(Matrix3 arg) {
final argStorage = arg.storage;
final v0 = _v3storage[0];
@@ -261,14 +262,14 @@
/// Cross product.
Vector3 cross(Vector3 other) {
- final _x = _v3storage[0];
- final _y = _v3storage[1];
- final _z = _v3storage[2];
+ final x = _v3storage[0];
+ final y = _v3storage[1];
+ final z = _v3storage[2];
final otherStorage = other._v3storage;
final ox = otherStorage[0];
final oy = otherStorage[1];
final oz = otherStorage[2];
- return Vector3(_y * oz - _z * oy, _z * ox - _x * oz, _x * oy - _y * ox);
+ return Vector3(y * oz - z * oy, z * ox - x * oz, x * oy - y * ox);
}
/// Cross product. Stores result in [out].
diff --git a/lib/src/vector_math/vector4.dart b/lib/src/vector_math/vector4.dart
index 6ba88f3..88d04cd 100644
--- a/lib/src/vector_math/vector4.dart
+++ b/lib/src/vector_math/vector4.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math;
+part of '../../vector_math.dart';
/// 4D column vector.
class Vector4 implements Vector {
diff --git a/lib/src/vector_math_64/aabb2.dart b/lib/src/vector_math_64/aabb2.dart
index b3ac51d..fea7535 100644
--- a/lib/src/vector_math_64/aabb2.dart
+++ b/lib/src/vector_math_64/aabb2.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a 2-dimensional axis-aligned bounding box between a [min] and a
/// [max] position.
diff --git a/lib/src/vector_math_64/aabb3.dart b/lib/src/vector_math_64/aabb3.dart
index 63572e0..22a62dc 100644
--- a/lib/src/vector_math_64/aabb3.dart
+++ b/lib/src/vector_math_64/aabb3.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a 3-dimensional axis-aligned bounding box between a [min] and a
/// [max] position.
@@ -587,8 +587,10 @@
}
}
- // Test the three axes corresponding to the face normals of AABB b (category 1). // Exit if...
- // ... [-e0, e0] and [min(v0.x,v1.x,v2.x), max(v0.x,v1.x,v2.x)] do not overlap
+ // Test the three axes corresponding to the face normals of AABB b
+ // (category 1).
+ // Exit if [-e0, e0] and [min(v0.x,v1.x,v2.x), max(v0.x,v1.x,v2.x)] do not
+ // overlap
if (math.max(_v0.x, math.max(_v1.x, _v2.x)) < -_aabbHalfExtents[0] ||
math.min(_v0.x, math.min(_v1.x, _v2.x)) > _aabbHalfExtents[0]) {
return false;
@@ -598,7 +600,8 @@
result._depth = a;
result.axis.setFrom(_u0);
}
- // ... [-e1, e1] and [min(v0.y,v1.y,v2.y), max(v0.y,v1.y,v2.y)] do not overlap
+ // ... [-e1, e1] and [min(v0.y,v1.y,v2.y), max(v0.y,v1.y,v2.y)] do not
+ // overlap
if (math.max(_v0.y, math.max(_v1.y, _v2.y)) < -_aabbHalfExtents[1] ||
math.min(_v0.y, math.min(_v1.y, _v2.y)) > _aabbHalfExtents[1]) {
return false;
@@ -608,7 +611,8 @@
result._depth = a;
result.axis.setFrom(_u1);
}
- // ... [-e2, e2] and [min(v0.z,v1.z,v2.z), max(v0.z,v1.z,v2.z)] do not overlap
+ // ... [-e2, e2] and [min(v0.z,v1.z,v2.z), max(v0.z,v1.z,v2.z)] do not
+ // overlap
if (math.max(_v0.z, math.max(_v1.z, _v2.z)) < -_aabbHalfExtents[2] ||
math.min(_v0.z, math.min(_v1.z, _v2.z)) > _aabbHalfExtents[2]) {
return false;
diff --git a/lib/src/vector_math_64/colors.dart b/lib/src/vector_math_64/colors.dart
index 49b30f7..6bb069b 100644
--- a/lib/src/vector_math_64/colors.dart
+++ b/lib/src/vector_math_64/colors.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Contains functions for converting between different color models and
/// manipulating colors. In addition to that, some known colors can be accessed
diff --git a/lib/src/vector_math_64/constants.dart b/lib/src/vector_math_64/constants.dart
index fb5c52e..776705b 100644
--- a/lib/src/vector_math_64/constants.dart
+++ b/lib/src/vector_math_64/constants.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Constant factor to convert and angle from degrees to radians.
const double degrees2Radians = math.pi / 180.0;
diff --git a/lib/src/vector_math_64/error_helpers.dart b/lib/src/vector_math_64/error_helpers.dart
index 6cc4293..1d1514c 100644
--- a/lib/src/vector_math_64/error_helpers.dart
+++ b/lib/src/vector_math_64/error_helpers.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Returns relative error between [calculated] and [correct].
/// The type of [calculated] and [correct] must match and can
@@ -12,7 +12,8 @@
final diff = (calculated - correct).abs().toDouble();
return diff / correct;
}
- // ignore: return_of_invalid_type
+ // avoiding an `as double` cast here to maximize speed on dart2js
+ // ignore: avoid_dynamic_calls, return_of_invalid_type
return calculated.relativeError(correct);
}
@@ -24,6 +25,7 @@
final diff = (calculated - correct).abs().toDouble();
return diff;
}
- // ignore: return_of_invalid_type
+ // avoiding an `as double` cast here to maximize speed on dart2js
+ // ignore: avoid_dynamic_calls, return_of_invalid_type
return calculated.absoluteError(correct);
}
diff --git a/lib/src/vector_math_64/frustum.dart b/lib/src/vector_math_64/frustum.dart
index 3b8fac6..8b2c94b 100644
--- a/lib/src/vector_math_64/frustum.dart
+++ b/lib/src/vector_math_64/frustum.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a frustum constructed out of six [Plane]s.
class Frustum {
diff --git a/lib/src/vector_math_64/intersection_result.dart b/lib/src/vector_math_64/intersection_result.dart
index ff5a583..377973c 100644
--- a/lib/src/vector_math_64/intersection_result.dart
+++ b/lib/src/vector_math_64/intersection_result.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a result of an intersection test.
class IntersectionResult {
diff --git a/lib/src/vector_math_64/matrix2.dart b/lib/src/vector_math_64/matrix2.dart
index f4b5403..e8f3b40 100644
--- a/lib/src/vector_math_64/matrix2.dart
+++ b/lib/src/vector_math_64/matrix2.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// 2D Matrix.
/// Values are stored in column major order.
diff --git a/lib/src/vector_math_64/matrix3.dart b/lib/src/vector_math_64/matrix3.dart
index df20c0f..f497024 100644
--- a/lib/src/vector_math_64/matrix3.dart
+++ b/lib/src/vector_math_64/matrix3.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// 3D Matrix.
/// Values are stored in column major order.
diff --git a/lib/src/vector_math_64/matrix4.dart b/lib/src/vector_math_64/matrix4.dart
index f427e8a..90a2e8c 100644
--- a/lib/src/vector_math_64/matrix4.dart
+++ b/lib/src/vector_math_64/matrix4.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// 4D Matrix.
/// Values are stored in column major order.
@@ -1110,7 +1110,8 @@
return diff_norm;
}
- /// Returns the translation vector from this homogeneous transformation matrix.
+ /// Returns the translation vector from this homogeneous transformation
+ /// matrix.
Vector3 getTranslation() {
final z = _m4storage[14];
final y = _m4storage[13];
@@ -1172,8 +1173,10 @@
_m4storage[10] = rStorage[8];
}
- /// Returns the normal matrix from this homogeneous transformation matrix. The normal
- /// matrix is the transpose of the inverse of the top-left 3x3 part of this 4x4 matrix.
+ /// Returns the normal matrix from this homogeneous transformation matrix.
+ ///
+ /// The normal matrix is the transpose of the inverse of the top-left 3x3 part
+ /// of this 4x4 matrix.
Matrix3 getNormalMatrix() => Matrix3.identity()..copyNormalMatrix(this);
/// Returns the max scale value of the 3 axes.
diff --git a/lib/src/vector_math_64/noise.dart b/lib/src/vector_math_64/noise.dart
index 1980dd3..701ba4a 100644
--- a/lib/src/vector_math_64/noise.dart
+++ b/lib/src/vector_math_64/noise.dart
@@ -19,7 +19,7 @@
*/
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/*
* This is based on the implementation of Simplex Noise by Stefan Gustavson
@@ -248,8 +248,8 @@
}
// A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z),
// a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and
- // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where
- // c = 1/6.
+ // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z),
+ // where c = 1/6.
final x1 = x0 - i1 + _g3; // Offsets for second corner in (x,y,z) coords
final y1 = y0 - j1 + _g3;
final z1 = z0 - k1 + _g3;
@@ -364,9 +364,11 @@
int i2, j2, k2, l2; // The integer offsets for the third simplex corner
int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner
// simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.
- // Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w
- // impossible. Only the 24 indices which have non-zero entries make any sense.
- // We use a thresholding to set the coordinates in turn from the largest magnitude.
+ // Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and
+ // x<w impossible. Only the 24 indices which have non-zero entries make any
+ // sense.
+ // We use a thresholding to set the coordinates in turn from the largest
+ // magnitude.
// Rank 3 denotes the largest coordinate.
i1 = rankx >= 3 ? 1 : 0;
j1 = ranky >= 3 ? 1 : 0;
@@ -382,7 +384,8 @@
j3 = ranky >= 1 ? 1 : 0;
k3 = rankz >= 1 ? 1 : 0;
l3 = rankw >= 1 ? 1 : 0;
- // The fifth corner has all coordinate offsets = 1, so no need to compute that.
+ // The fifth corner has all coordinate offsets = 1, so no need to compute
+ // that.
final x1 = x0 - i1 + _G4; // Offsets for second corner in (x,y,z,w) coords
final y1 = y0 - j1 + _G4;
final z1 = z0 - k1 + _G4;
diff --git a/lib/src/vector_math_64/obb3.dart b/lib/src/vector_math_64/obb3.dart
index 62f15ea..409f520 100644
--- a/lib/src/vector_math_64/obb3.dart
+++ b/lib/src/vector_math_64/obb3.dart
@@ -1,7 +1,7 @@
// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a 3-dimensional oriented bounding box defined with a [center],
/// [halfExtents] and axes.
@@ -167,7 +167,8 @@
}
}
- /// Find the closest point [q] on the OBB to the point [p] and store it in [q].
+ /// Find the closest point [q] on the OBB to the point [p] and store it in
+ /// [q].
void closestPointTo(Vector3 p, Vector3 q) {
final d = p - _center;
diff --git a/lib/src/vector_math_64/opengl.dart b/lib/src/vector_math_64/opengl.dart
index 66bccd5..7d7de93 100644
--- a/lib/src/vector_math_64/opengl.dart
+++ b/lib/src/vector_math_64/opengl.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Constructs a rotation matrix in [rotationMatrix].
///
diff --git a/lib/src/vector_math_64/plane.dart b/lib/src/vector_math_64/plane.dart
index f9295dc..3436c17 100644
--- a/lib/src/vector_math_64/plane.dart
+++ b/lib/src/vector_math_64/plane.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
class Plane {
final Vector3 _normal;
diff --git a/lib/src/vector_math_64/quad.dart b/lib/src/vector_math_64/quad.dart
index 3ef31ef..5a5b3aa 100644
--- a/lib/src/vector_math_64/quad.dart
+++ b/lib/src/vector_math_64/quad.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a quad by four points.
class Quad {
diff --git a/lib/src/vector_math_64/quaternion.dart b/lib/src/vector_math_64/quaternion.dart
index 8c8009c..13c3ac7 100644
--- a/lib/src/vector_math_64/quaternion.dart
+++ b/lib/src/vector_math_64/quaternion.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a [Quaternion] (a four-dimensional vector) for efficient rotation
/// calculations.
@@ -170,12 +170,14 @@
// a and b are parallel in opposite directions. We need any
// vector as our rotation axis that is perpendicular.
- // Find one by taking the cross product of v1 with an appropriate unit axis
+ // Find one by taking the cross product of v1 with an appropriate unit
+ // axis
if (v1.x > v1.y && v1.x > v1.z) {
// v1 points in a dominantly x direction, so don't cross with that axis
axis = v1.cross(Vector3(0.0, 1.0, 0.0));
} else {
- // Predominantly points in some other direction, so x-axis should be safe
+ // Predominantly points in some other direction, so x-axis should be
+ // safe
axis = v1.cross(Vector3(1.0, 0.0, 0.0));
}
} else if ((1.0 - c).abs() < 0.0005) {
@@ -219,14 +221,14 @@
final ox = omegaStorage[0];
final oy = omegaStorage[1];
final oz = omegaStorage[2];
- final _x = ox * qw + oy * qz - oz * qy;
- final _y = oy * qw + oz * qx - ox * qz;
- final _z = oz * qw + ox * qy - oy * qx;
- final _w = -ox * qx - oy * qy - oz * qz;
- _qStorage[0] = _x * 0.5;
- _qStorage[1] = _y * 0.5;
- _qStorage[2] = _z * 0.5;
- _qStorage[3] = _w * 0.5;
+ final x = ox * qw + oy * qz - oz * qy;
+ final y = oy * qw + oz * qx - ox * qz;
+ final z = oz * qw + ox * qy - oy * qx;
+ final w = -ox * qx - oy * qy - oz * qz;
+ _qStorage[0] = x * 0.5;
+ _qStorage[1] = y * 0.5;
+ _qStorage[2] = z * 0.5;
+ _qStorage[3] = w * 0.5;
}
/// Set quaternion with rotation of [yaw], [pitch] and [roll].
@@ -323,21 +325,21 @@
/// Rotates [v] by this.
Vector3 rotate(Vector3 v) {
// conjugate(this) * [v,0] * this
- final _w = _qStorage[3];
- final _z = _qStorage[2];
- final _y = _qStorage[1];
- final _x = _qStorage[0];
- final tiw = _w;
- final tiz = -_z;
- final tiy = -_y;
- final tix = -_x;
+ final w = _qStorage[3];
+ final z = _qStorage[2];
+ final y = _qStorage[1];
+ final x = _qStorage[0];
+ final tiw = w;
+ final tiz = -z;
+ final tiy = -y;
+ final tix = -x;
final tx = tiw * v.x + tix * 0.0 + tiy * v.z - tiz * v.y;
final ty = tiw * v.y + tiy * 0.0 + tiz * v.x - tix * v.z;
final tz = tiw * v.z + tiz * 0.0 + tix * v.y - tiy * v.x;
final tw = tiw * 0.0 - tix * v.x - tiy * v.y - tiz * v.z;
- final result_x = tw * _x + tx * _w + ty * _z - tz * _y;
- final result_y = tw * _y + ty * _w + tz * _x - tx * _z;
- final result_z = tw * _z + tz * _w + tx * _y - ty * _x;
+ final result_x = tw * x + tx * w + ty * z - tz * y;
+ final result_y = tw * y + ty * w + tz * x - tx * z;
+ final result_z = tw * z + tz * w + tx * y - ty * x;
final vStorage = v.storage;
vStorage[2] = result_z;
vStorage[1] = result_y;
@@ -376,20 +378,20 @@
/// this rotated by [other].
Quaternion operator *(Quaternion other) {
- final _w = _qStorage[3];
- final _z = _qStorage[2];
- final _y = _qStorage[1];
- final _x = _qStorage[0];
+ final w = _qStorage[3];
+ final z = _qStorage[2];
+ final y = _qStorage[1];
+ final x = _qStorage[0];
final otherStorage = other._qStorage;
final ow = otherStorage[3];
final oz = otherStorage[2];
final oy = otherStorage[1];
final ox = otherStorage[0];
return Quaternion(
- _w * ox + _x * ow + _y * oz - _z * oy,
- _w * oy + _y * ow + _z * ox - _x * oz,
- _w * oz + _z * ow + _x * oy - _y * ox,
- _w * ow - _x * ox - _y * oy - _z * oz);
+ w * ox + x * ow + y * oz - z * oy,
+ w * oy + y * ow + z * ox - x * oz,
+ w * oz + z * ow + x * oy - y * ox,
+ w * ow - x * ox - y * oy - z * oz);
}
/// Returns copy of this + [other].
@@ -419,26 +421,26 @@
assert(d != 0.0);
final s = 2.0 / d;
- final _x = _qStorage[0];
- final _y = _qStorage[1];
- final _z = _qStorage[2];
- final _w = _qStorage[3];
+ final x = _qStorage[0];
+ final y = _qStorage[1];
+ final z = _qStorage[2];
+ final w = _qStorage[3];
- final xs = _x * s;
- final ys = _y * s;
- final zs = _z * s;
+ final xs = x * s;
+ final ys = y * s;
+ final zs = z * s;
- final wx = _w * xs;
- final wy = _w * ys;
- final wz = _w * zs;
+ final wx = w * xs;
+ final wy = w * ys;
+ final wz = w * zs;
- final xx = _x * xs;
- final xy = _x * ys;
- final xz = _x * zs;
+ final xx = x * xs;
+ final xy = x * ys;
+ final xz = x * zs;
- final yy = _y * ys;
- final yz = _y * zs;
- final zz = _z * zs;
+ final yy = y * ys;
+ final yz = y * zs;
+ final zz = z * zs;
final rotationMatrixStorage = rotationMatrix.storage;
rotationMatrixStorage[0] = 1.0 - (yy + zz); // column 0
diff --git a/lib/src/vector_math_64/ray.dart b/lib/src/vector_math_64/ray.dart
index 2377c28..2aedd31 100644
--- a/lib/src/vector_math_64/ray.dart
+++ b/lib/src/vector_math_64/ray.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a [Ray] by an [origin] and a [direction].
class Ray {
diff --git a/lib/src/vector_math_64/sphere.dart b/lib/src/vector_math_64/sphere.dart
index 5d61fb9..fad7a10 100644
--- a/lib/src/vector_math_64/sphere.dart
+++ b/lib/src/vector_math_64/sphere.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a sphere with a [center] and a [radius].
class Sphere {
diff --git a/lib/src/vector_math_64/triangle.dart b/lib/src/vector_math_64/triangle.dart
index 23b43fc..f77ad04 100644
--- a/lib/src/vector_math_64/triangle.dart
+++ b/lib/src/vector_math_64/triangle.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Defines a triangle by three points.
class Triangle {
diff --git a/lib/src/vector_math_64/utilities.dart b/lib/src/vector_math_64/utilities.dart
index d5d8a3e..9c3cf7b 100644
--- a/lib/src/vector_math_64/utilities.dart
+++ b/lib/src/vector_math_64/utilities.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// Convert [radians] to degrees.
double degrees(double radians) => radians * radians2Degrees;
diff --git a/lib/src/vector_math_64/vector.dart b/lib/src/vector_math_64/vector.dart
index 2d97566..4e11024 100644
--- a/lib/src/vector_math_64/vector.dart
+++ b/lib/src/vector_math_64/vector.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// 2D dot product.
double dot2(Vector2 x, Vector2 y) => x.dot(y);
diff --git a/lib/src/vector_math_64/vector2.dart b/lib/src/vector_math_64/vector2.dart
index 5d953a7..c3a48c3 100644
--- a/lib/src/vector_math_64/vector2.dart
+++ b/lib/src/vector_math_64/vector2.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// 2D column vector.
class Vector2 implements Vector {
@@ -230,8 +230,8 @@
///
/// Transforms this into the product of this as a row vector,
/// postmultiplied by matrix, [arg].
- /// If [arg] is a rotation matrix, this is a computational shortcut for applying,
- /// the inverse of the transformation.
+ /// If [arg] is a rotation matrix, this is a computational shortcut for
+ /// applying, the inverse of the transformation.
///
void postmultiply(Matrix2 arg) {
final argStorage = arg.storage;
@@ -247,7 +247,9 @@
return _v2storage[0] * otherStorage[1] - _v2storage[1] * otherStorage[0];
}
- /// Rotate this by 90 degrees then scale it. Store result in [out]. Return [out].
+ /// Rotate this by 90 degrees then scale it.
+ ///
+ /// Store result in [out]. Return [out].
Vector2 scaleOrthogonalInto(double scale, Vector2 out) {
out.setValues(-scale * _v2storage[1], scale * _v2storage[0]);
return out;
diff --git a/lib/src/vector_math_64/vector3.dart b/lib/src/vector_math_64/vector3.dart
index 7e190b7..fddf24d 100644
--- a/lib/src/vector_math_64/vector3.dart
+++ b/lib/src/vector_math_64/vector3.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// 3D column vector.
class Vector3 implements Vector {
@@ -241,10 +241,11 @@
return sum;
}
- /// Transforms this into the product of this as a row vector,
- /// postmultiplied by matrix, [arg].
- /// If [arg] is a rotation matrix, this is a computational shortcut for applying,
- /// the inverse of the transformation.
+ /// Transforms this into the product of this as a row vector, postmultiplied
+ /// by matrix, [arg].
+ ///
+ /// If [arg] is a rotation matrix, this is a computational shortcut for
+ /// applying, the inverse of the transformation.
void postmultiply(Matrix3 arg) {
final argStorage = arg.storage;
final v0 = _v3storage[0];
@@ -261,14 +262,14 @@
/// Cross product.
Vector3 cross(Vector3 other) {
- final _x = _v3storage[0];
- final _y = _v3storage[1];
- final _z = _v3storage[2];
+ final x = _v3storage[0];
+ final y = _v3storage[1];
+ final z = _v3storage[2];
final otherStorage = other._v3storage;
final ox = otherStorage[0];
final oy = otherStorage[1];
final oz = otherStorage[2];
- return Vector3(_y * oz - _z * oy, _z * ox - _x * oz, _x * oy - _y * ox);
+ return Vector3(y * oz - z * oy, z * ox - x * oz, x * oy - y * ox);
}
/// Cross product. Stores result in [out].
diff --git a/lib/src/vector_math_64/vector4.dart b/lib/src/vector_math_64/vector4.dart
index 9faef2b..bbffdc8 100644
--- a/lib/src/vector_math_64/vector4.dart
+++ b/lib/src/vector_math_64/vector4.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_64;
+part of '../../vector_math_64.dart';
/// 4D column vector.
class Vector4 implements Vector {
diff --git a/lib/src/vector_math_geometry/filters/barycentric_filter.dart b/lib/src/vector_math_geometry/filters/barycentric_filter.dart
index f76049f..7652951 100644
--- a/lib/src/vector_math_geometry/filters/barycentric_filter.dart
+++ b/lib/src/vector_math_geometry/filters/barycentric_filter.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class BarycentricFilter extends GeometryFilter {
@override
diff --git a/lib/src/vector_math_geometry/filters/color_filter.dart b/lib/src/vector_math_geometry/filters/color_filter.dart
index 60e81c2..ffd351e 100644
--- a/lib/src/vector_math_geometry/filters/color_filter.dart
+++ b/lib/src/vector_math_geometry/filters/color_filter.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class ColorFilter extends GeometryFilter {
Vector4 color;
diff --git a/lib/src/vector_math_geometry/filters/flat_shade_filter.dart b/lib/src/vector_math_geometry/filters/flat_shade_filter.dart
index 23203f3..2bcc2dc 100644
--- a/lib/src/vector_math_geometry/filters/flat_shade_filter.dart
+++ b/lib/src/vector_math_geometry/filters/flat_shade_filter.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class FlatShadeFilter extends GeometryFilter {
@override
diff --git a/lib/src/vector_math_geometry/filters/geometry_filter.dart b/lib/src/vector_math_geometry/filters/geometry_filter.dart
index c915d74..b028d45 100644
--- a/lib/src/vector_math_geometry/filters/geometry_filter.dart
+++ b/lib/src/vector_math_geometry/filters/geometry_filter.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
abstract class GeometryFilter {
bool get inplace => false;
diff --git a/lib/src/vector_math_geometry/filters/invert_filter.dart b/lib/src/vector_math_geometry/filters/invert_filter.dart
index fc46c9a..3d1ec15 100644
--- a/lib/src/vector_math_geometry/filters/invert_filter.dart
+++ b/lib/src/vector_math_geometry/filters/invert_filter.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class InvertFilter extends InplaceGeometryFilter {
@override
diff --git a/lib/src/vector_math_geometry/filters/transform_filter.dart b/lib/src/vector_math_geometry/filters/transform_filter.dart
index d677859..97cc8a4 100644
--- a/lib/src/vector_math_geometry/filters/transform_filter.dart
+++ b/lib/src/vector_math_geometry/filters/transform_filter.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class TransformFilter extends InplaceGeometryFilter {
Matrix4 transform;
diff --git a/lib/src/vector_math_geometry/generators/attribute_generators.dart b/lib/src/vector_math_geometry/generators/attribute_generators.dart
index a078991..6c76ac4 100644
--- a/lib/src/vector_math_geometry/generators/attribute_generators.dart
+++ b/lib/src/vector_math_geometry/generators/attribute_generators.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
/// Generate vertex normals based on a list of [positions] and [indices].
/// [normals] is assumed to be zeroed out, and much match [positions] in length.
diff --git a/lib/src/vector_math_geometry/generators/circle_generator.dart b/lib/src/vector_math_geometry/generators/circle_generator.dart
index a6d14f4..63d55bf 100644
--- a/lib/src/vector_math_geometry/generators/circle_generator.dart
+++ b/lib/src/vector_math_geometry/generators/circle_generator.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class CircleGenerator extends GeometryGenerator {
late double _radius;
diff --git a/lib/src/vector_math_geometry/generators/cube_generator.dart b/lib/src/vector_math_geometry/generators/cube_generator.dart
index 2309eb5..dcbbc63 100644
--- a/lib/src/vector_math_geometry/generators/cube_generator.dart
+++ b/lib/src/vector_math_geometry/generators/cube_generator.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class CubeGenerator extends GeometryGenerator {
late double _width;
diff --git a/lib/src/vector_math_geometry/generators/cylinder_generator.dart b/lib/src/vector_math_geometry/generators/cylinder_generator.dart
index 1665658..bdcfdbf 100644
--- a/lib/src/vector_math_geometry/generators/cylinder_generator.dart
+++ b/lib/src/vector_math_geometry/generators/cylinder_generator.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class CylinderGenerator extends GeometryGenerator {
late double _topRadius;
diff --git a/lib/src/vector_math_geometry/generators/geometry_generator.dart b/lib/src/vector_math_geometry/generators/geometry_generator.dart
index 1b0779a..3bc5dd8 100644
--- a/lib/src/vector_math_geometry/generators/geometry_generator.dart
+++ b/lib/src/vector_math_geometry/generators/geometry_generator.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class GeometryGeneratorFlags {
final bool texCoords;
diff --git a/lib/src/vector_math_geometry/generators/ring_generator.dart b/lib/src/vector_math_geometry/generators/ring_generator.dart
index c83cd6b..7976962 100644
--- a/lib/src/vector_math_geometry/generators/ring_generator.dart
+++ b/lib/src/vector_math_geometry/generators/ring_generator.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class RingGenerator extends GeometryGenerator {
late double _innerRadius;
diff --git a/lib/src/vector_math_geometry/generators/sphere_generator.dart b/lib/src/vector_math_geometry/generators/sphere_generator.dart
index 23375de..6e9fe38 100644
--- a/lib/src/vector_math_geometry/generators/sphere_generator.dart
+++ b/lib/src/vector_math_geometry/generators/sphere_generator.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../../vector_math_geometry.dart';
class SphereGenerator extends GeometryGenerator {
late double _radius;
diff --git a/lib/src/vector_math_geometry/mesh_geometry.dart b/lib/src/vector_math_geometry/mesh_geometry.dart
index 54b2f89..6893e0f 100644
--- a/lib/src/vector_math_geometry/mesh_geometry.dart
+++ b/lib/src/vector_math_geometry/mesh_geometry.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_geometry;
+part of '../../vector_math_geometry.dart';
class VertexAttrib {
final String name;
diff --git a/lib/src/vector_math_lists/scalar_list_view.dart b/lib/src/vector_math_lists/scalar_list_view.dart
index 8c06e0f..44062a4 100644
--- a/lib/src/vector_math_lists/scalar_list_view.dart
+++ b/lib/src/vector_math_lists/scalar_list_view.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_lists;
+part of '../../vector_math_lists.dart';
/// Defines a view of scalar values over a [Float32List] that allows for a
/// custom offset and stride.
diff --git a/lib/src/vector_math_lists/vector2_list.dart b/lib/src/vector_math_lists/vector2_list.dart
index 8a582ed..3984d6d 100644
--- a/lib/src/vector_math_lists/vector2_list.dart
+++ b/lib/src/vector_math_lists/vector2_list.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_lists;
+part of '../../vector_math_lists.dart';
/// A list of [Vector2].
class Vector2List extends VectorList<Vector2> {
diff --git a/lib/src/vector_math_lists/vector3_list.dart b/lib/src/vector_math_lists/vector3_list.dart
index d7a1945..df8d9d6 100644
--- a/lib/src/vector_math_lists/vector3_list.dart
+++ b/lib/src/vector_math_lists/vector3_list.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_lists;
+part of '../../vector_math_lists.dart';
/// A list of [Vector3].
class Vector3List extends VectorList<Vector3> {
diff --git a/lib/src/vector_math_lists/vector4_list.dart b/lib/src/vector_math_lists/vector4_list.dart
index 860b747..1e6453c 100644
--- a/lib/src/vector_math_lists/vector4_list.dart
+++ b/lib/src/vector_math_lists/vector4_list.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_lists;
+part of '../../vector_math_lists.dart';
/// A list of [Vector4].
class Vector4List extends VectorList<Vector4> {
diff --git a/lib/src/vector_math_lists/vector_list.dart b/lib/src/vector_math_lists/vector_list.dart
index 62e4b5a..2628c0f 100644
--- a/lib/src/vector_math_lists/vector_list.dart
+++ b/lib/src/vector_math_lists/vector_list.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_lists;
+part of '../../vector_math_lists.dart';
/// Abstract base class for vector lists. See [Vector2List], [Vector3List], and
/// [Vector4List] for implementations of this class.
diff --git a/lib/src/vector_math_operations/matrix.dart b/lib/src/vector_math_operations/matrix.dart
index 724a061..2fd7551 100644
--- a/lib/src/vector_math_operations/matrix.dart
+++ b/lib/src/vector_math_operations/matrix.dart
@@ -2,7 +2,7 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_operations;
+part of '../../vector_math_operations.dart';
// ignore: avoid_classes_with_only_static_members
/// Static methods operating on 4x4 matrices packed column major into a
diff --git a/lib/src/vector_math_operations/vector.dart b/lib/src/vector_math_operations/vector.dart
index 2059d93..0f8922b 100644
--- a/lib/src/vector_math_operations/vector.dart
+++ b/lib/src/vector_math_operations/vector.dart
@@ -2,4 +2,4 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-part of vector_math_operations;
+part of '../../vector_math_operations.dart';
diff --git a/lib/vector_math.dart b/lib/vector_math.dart
index 5a74df3..cf3bf0e 100644
--- a/lib/vector_math.dart
+++ b/lib/vector_math.dart
@@ -13,7 +13,7 @@
/// In addition some utilities are available as color operations (See [Colors]
/// class) and common OpenGL operations (like [makeViewMatrix],
/// [makePerspectiveMatrix], or [pickRay]).
-library vector_math;
+library;
import 'dart:math' as math;
import 'dart:typed_data';
diff --git a/lib/vector_math_64.dart b/lib/vector_math_64.dart
index 203096e..aaf5f9e 100644
--- a/lib/vector_math_64.dart
+++ b/lib/vector_math_64.dart
@@ -13,7 +13,7 @@
/// In addition some utilities are available as color operations (See [Colors]
/// class) and common OpenGL operations (like [makeViewMatrix],
/// [makePerspectiveMatrix], or [pickRay]).
-library vector_math_64;
+library;
import 'dart:math' as math;
import 'dart:typed_data';
diff --git a/lib/vector_math_geometry.dart b/lib/vector_math_geometry.dart
index b2f20b2..1993426 100644
--- a/lib/vector_math_geometry.dart
+++ b/lib/vector_math_geometry.dart
@@ -5,7 +5,7 @@
/// A library containing geometry generators (like [CubeGenerator],
/// [SphereGenerator] and [CylinderGenerator]) and filters ([BarycentricFilter],
/// [ColorFilter] and [InvertFilter]).
-library vector_math_geometry;
+library;
import 'dart:math' as math;
import 'dart:typed_data';
@@ -13,19 +13,17 @@
import 'vector_math.dart';
import 'vector_math_lists.dart';
-part 'src/vector_math_geometry/mesh_geometry.dart';
-
part 'src/vector_math_geometry/filters/barycentric_filter.dart';
part 'src/vector_math_geometry/filters/color_filter.dart';
part 'src/vector_math_geometry/filters/flat_shade_filter.dart';
part 'src/vector_math_geometry/filters/geometry_filter.dart';
part 'src/vector_math_geometry/filters/invert_filter.dart';
part 'src/vector_math_geometry/filters/transform_filter.dart';
-
part 'src/vector_math_geometry/generators/attribute_generators.dart';
part 'src/vector_math_geometry/generators/circle_generator.dart';
part 'src/vector_math_geometry/generators/cube_generator.dart';
part 'src/vector_math_geometry/generators/cylinder_generator.dart';
part 'src/vector_math_geometry/generators/geometry_generator.dart';
-part 'src/vector_math_geometry/generators/sphere_generator.dart';
part 'src/vector_math_geometry/generators/ring_generator.dart';
+part 'src/vector_math_geometry/generators/sphere_generator.dart';
+part 'src/vector_math_geometry/mesh_geometry.dart';
diff --git a/lib/vector_math_lists.dart b/lib/vector_math_lists.dart
index fdb0968..82095a8 100644
--- a/lib/vector_math_lists.dart
+++ b/lib/vector_math_lists.dart
@@ -3,14 +3,15 @@
// license that can be found in the LICENSE file.
/// A library for working with lists of vectors in a memory efficient way.
-library vector_math_lists;
+library;
import 'dart:math' as math;
import 'dart:typed_data';
+
import 'vector_math.dart';
part 'src/vector_math_lists/scalar_list_view.dart';
-part 'src/vector_math_lists/vector_list.dart';
part 'src/vector_math_lists/vector2_list.dart';
part 'src/vector_math_lists/vector3_list.dart';
part 'src/vector_math_lists/vector4_list.dart';
+part 'src/vector_math_lists/vector_list.dart';
diff --git a/lib/vector_math_operations.dart b/lib/vector_math_operations.dart
index 0d5732f..1fdface 100644
--- a/lib/vector_math_operations.dart
+++ b/lib/vector_math_operations.dart
@@ -6,9 +6,9 @@
/// performed on [Float32List] instances and SIMD optimized operations
/// ([Matrix44SIMDOperations]) that can be performed on [Float32x4List]
/// instances.
-library vector_math_operations;
+library;
import 'dart:typed_data';
-part 'src/vector_math_operations/vector.dart';
part 'src/vector_math_operations/matrix.dart';
+part 'src/vector_math_operations/vector.dart';
diff --git a/pubspec.yaml b/pubspec.yaml
index 88bbe60..2d71433 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,16 +1,16 @@
name: vector_math
-version: 2.1.4
+version: 2.1.5-dev
description: A Vector Math library for 2D and 3D applications.
repository: https://github.com/google/vector_math.dart
environment:
- sdk: ">=2.14.0 <3.0.0"
+ sdk: ">=2.19.0 <3.0.0"
dev_dependencies:
benchmark_harness: ^2.0.0
build_runner: ^2.0.0
build_test: ^2.0.0
build_web_compilers: ^3.0.0
- lints: ^1.0.0
+ dart_flutter_team_lints: ^1.0.0
path: ^1.8.0
test: ^1.16.0
diff --git a/test/matrix3_test.dart b/test/matrix3_test.dart
index 6ba0c7f..933c4a0 100644
--- a/test/matrix3_test.dart
+++ b/test/matrix3_test.dart
@@ -5,7 +5,6 @@
import 'dart:math' as math;
import 'package:test/test.dart';
-
import 'package:vector_math/vector_math.dart';
import 'test_utils.dart';
@@ -40,7 +39,9 @@
assert(input.length == expectedOutput.length);
for (var i = 0; i < input.length; i++) {
+ // ignore: avoid_dynamic_calls
final dynamic output = input[i].clone();
+ // ignore: avoid_dynamic_calls
output.scaleAdjoint(1.0);
relativeTest(output, expectedOutput[i]);
}
diff --git a/test/matrix4_test.dart b/test/matrix4_test.dart
index 52caf24..e338752 100644
--- a/test/matrix4_test.dart
+++ b/test/matrix4_test.dart
@@ -183,7 +183,6 @@
for (var i = 0; i < inputA.length; i++) {
final output = inputA[i] * inputB[i] as Matrix4;
- //print('${inputA[i].cols}x${inputA[i].rows} * ${inputB[i].cols}x${inputB[i].rows} = ${output.cols}x${output.rows}');
relativeTest(output, expectedOutput[i]);
}
}
@@ -424,12 +423,12 @@
}
void testMatrix4GetRotation() {
- final mat4 = Matrix4.rotationX(math.pi) *
- Matrix4.rotationY(-math.pi) *
- Matrix4.rotationZ(math.pi) as Matrix4;
- final mat3 = Matrix3.rotationX(math.pi) *
- Matrix3.rotationY(-math.pi) *
- Matrix3.rotationZ(math.pi) as Matrix3;
+ final mat4 =
+ (Matrix4.rotationX(math.pi) * Matrix4.rotationY(-math.pi) as Matrix4) *
+ Matrix4.rotationZ(math.pi) as Matrix4;
+ final mat3 =
+ (Matrix3.rotationX(math.pi) * Matrix3.rotationY(-math.pi) as Matrix3) *
+ Matrix3.rotationZ(math.pi) as Matrix3;
final matRot = mat4.getRotation();
relativeTest(mat3, matRot);
diff --git a/test/quaternion_test.dart b/test/quaternion_test.dart
index 9f749ac..3ba0a75 100644
--- a/test/quaternion_test.dart
+++ b/test/quaternion_test.dart
@@ -214,7 +214,7 @@
void main() {
group('Quaternion', () {
- test('Float32List instacing', testQuaternionInstacingFromByteBuffer);
+ test('Float32List instacing', testQuaternionInstacinfFromFloat32List);
test('ByteBuffer instacing', testQuaternionInstacingFromByteBuffer);
test('Conjugate', testQuaternionConjugate);
test('Matrix Quaternion Round Trip',
diff --git a/test/test_all.dart b/test/test_all.dart
index 46443cf..d093fd0 100644
--- a/test/test_all.dart
+++ b/test/test_all.dart
@@ -2,8 +2,6 @@
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-library console_test_harness;
-
import 'aabb2_test.dart' as aabb2;
import 'aabb3_test.dart' as aabb3;
import 'colors_test.dart' as colors;
diff --git a/test/test_utils.dart b/test/test_utils.dart
index f27d4b8..974f1f8 100644
--- a/test/test_utils.dart
+++ b/test/test_utils.dart
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
import 'package:test/test.dart';
-
import 'package:vector_math/vector_math.dart';
Vector2 $v2(double x, double y) => Vector2(x, y);
@@ -70,8 +69,8 @@
final dynamic m = makeMatrix(rows.length, col_count);
for (var j = 0; j < rows.length; j++) {
for (var i = 0; i < col_count; i++) {
+ // ignore: avoid_dynamic_calls
m[m.index(j, i)] = values[j * col_count + i];
- //m[i][j] = values[j*col_count+i];
}
}
diff --git a/tool/generate_vector_math_64.dart b/tool/generate_vector_math_64.dart
index 2e57021..8d6280b 100644
--- a/tool/generate_vector_math_64.dart
+++ b/tool/generate_vector_math_64.dart
@@ -1,7 +1,6 @@
// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-library generate_vector_math_64_task;
import 'dart:async';
import 'dart:io';