From 118ec262fdf5e2ad7bd3efce4440a4d8cec176d0 Mon Sep 17 00:00:00 2001 From: Romain Vaillant Date: Mon, 16 May 2016 15:22:37 +0200 Subject: [PATCH] Adds ApproxEq for Decomposed --- src/transform.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/transform.rs b/src/transform.rs index 54a25a0..284d647 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -149,6 +149,18 @@ impl> Transform2 for Decomposed, R> impl> Transform3 for Decomposed, R> {} +impl ApproxEq for Decomposed + where S: ApproxEq, S::Scalar: ApproxEq, R: ApproxEq +{ + type Epsilon = E; + + fn approx_eq_eps(&self, other: &Self, epsilon: &Self::Epsilon) -> bool { + self.scale.approx_eq_eps(&other.scale, epsilon) && + self.rot.approx_eq_eps(&other.rot, epsilon) && + self.disp.approx_eq_eps(&other.disp, epsilon) + } +} + #[cfg(feature = "eders")] #[doc(hidden)] mod eders_ser { @@ -294,4 +306,4 @@ mod eders_de { Ok(Decomposed { scale: scale, rot: rot, disp: disp }) } } -} \ No newline at end of file +}