Strong mode and linter clean-up for plane
diff --git a/lib/src/vector_math/plane.dart b/lib/src/vector_math/plane.dart
index b719ac4..a8b89c9 100644
--- a/lib/src/vector_math/plane.dart
+++ b/lib/src/vector_math/plane.dart
@@ -11,25 +11,26 @@
/// Find the intersection point between the three planes [a], [b] and [c] and
/// copy it into [result].
static void intersection(Plane a, Plane b, Plane c, Vector3 result) {
- final cross = new Vector3.zero();
+ final Vector3 cross = new Vector3.zero();
b.normal.crossInto(c.normal, cross);
- final f = -a.normal.dot(cross);
+ final double f = -a.normal.dot(cross);
- final v1 = cross.scaled(a.constant);
+ final Vector3 v1 = cross.scaled(a.constant);
c.normal.crossInto(a.normal, cross);
- final v2 = cross.scaled(b.constant);
+ final Vector3 v2 = cross.scaled(b.constant);
a.normal.crossInto(b.normal, cross);
- final v3 = cross.scaled(c.constant);
+ final Vector3 v3 = cross.scaled(c.constant);
- result.x = (v1.x + v2.x + v3.x) / f;
- result.y = (v1.y + v2.y + v3.y) / f;
- result.z = (v1.z + v2.z + v3.z) / f;
+ result
+ ..x = (v1.x + v2.x + v3.x) / f
+ ..y = (v1.y + v2.y + v3.y) / f
+ ..z = (v1.z + v2.z + v3.z) / f;
}
Vector3 get normal => _normal;
@@ -63,12 +64,10 @@
}
void normalize() {
- var inverseLength = 1.0 / normal.length;
+ final double inverseLength = 1.0 / normal.length;
_normal.scale(inverseLength);
_constant *= inverseLength;
}
- double distanceToVector3(Vector3 point) {
- return _normal.dot(point) + _constant;
- }
+ double distanceToVector3(Vector3 point) => _normal.dot(point) + _constant;
}