From efd3403bf2e2caf885843ba581b9be43333774e5 Mon Sep 17 00:00:00 2001 From: kvark Date: Sat, 2 Nov 2013 09:51:20 -0400 Subject: [PATCH] ToStr implemented for transform::Decomposed --- src/cgmath/transform.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cgmath/transform.rs b/src/cgmath/transform.rs index 5a1e844..7dd2bbe 100644 --- a/src/cgmath/transform.rs +++ b/src/cgmath/transform.rs @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::num; +use std::{fmt,num}; use matrix::{Matrix, Mat4, ToMat4}; use point::{Point, Point3}; @@ -137,6 +137,15 @@ ToMat4 for Decomposed, R> { impl> Transform3 for Decomposed,R> {} +impl> +ToStr for Decomposed,R> { + fn to_str(&self) -> ~str { + format!("(scale({}), rot({:s}), disp{:s})", + self.scale, self.rot.to_str(), self.disp.to_str()) + } +} + + /// A homogeneous transformation matrix. pub struct AffineMatrix3 { mat: Mat4,