Prepare release 2.0.6
diff --git a/.gitignore b/.gitignore
index 8f8b3ed..f05d952 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
pubspec.lock
.pub
.packages
+.dart_tool
diff --git a/changelog.md b/changelog.md
index e4c8fa2..0677340 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,8 +1,11 @@
# Changelog - vector_math
-## v 2.0.6 - Unreleased
+## v 2.0.7 - Unreleased
+
+## v 2.0.6 - March 2018
- Fixed angleTo for vectors that do not have unit length
+- Added Matrix4.tryInvert.
## v 2.0.5 - July 2017
diff --git a/lib/src/vector_math_64/matrix4.dart b/lib/src/vector_math_64/matrix4.dart
index e883051..c01cc65 100644
--- a/lib/src/vector_math_64/matrix4.dart
+++ b/lib/src/vector_math_64/matrix4.dart
@@ -148,6 +148,17 @@
(a20 * b03 - a21 * b01 + a22 * b00) * bW);
}
+ /// Returns a matrix that is the inverse of [other] if [other] is invertible,
+ /// otherwise `null`.
+ static Matrix4 tryInvert(Matrix4 other) {
+ final Matrix4 r = new Matrix4.zero();
+ final double determinant = r.copyInverse(other);
+ if (determinant == 0.0) {
+ return null;
+ }
+ return r;
+ }
+
/// Return index in storage for [row], [col] value.
int index(int row, int col) => (col * 4) + row;
diff --git a/pubspec.yaml b/pubspec.yaml
index 44722e1..9b58883 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: vector_math
-version: 2.0.6-dev
+version: 2.0.6
author: John McCutchan <john@johnmccutchan.com>
description: A Vector Math library for 2D and 3D applications.
homepage: https://github.com/google/vector_math.dart