]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/cml/quaternion/quaternion_print.h
version bump cml to version 1.0.2
[chaz/yoink] / src / Moof / cml / quaternion / quaternion_print.h
index dd73d3c58fdfa2ad7fccf9181c056d71ef1b9660..483dfc4cefec591321ddcbbad3df2773df9f8118 100644 (file)
@@ -48,11 +48,21 @@ operator<<(std::ostream& os, const cml::quaternion<E,AT,vector_first,CT>& q)
 template<typename E, class AT, class OT, typename CT> std::ostream&
 operator<<(std::ostream& os, const cml::quaternion<E,AT,OT,CT>& q)
 {
-    os << "[";
-    for (size_t i = 0; i < 4; ++i) {
-        os << " " << q[i];
-    }
-    os << " ]";
+    typedef typename cml::quaternion<E,AT,OT,CT>::order_type order_type;
+    enum {
+        W = order_type::W,
+        X = order_type::X,
+        Y = order_type::Y,
+        Z = order_type::Z
+    };
+
+    os << "[ "
+      << " " << q[W]
+      << " " << q[X]
+      << " " << q[Y]
+      << " " << q[Z]
+      << " ]";
+
     return os;
 }
 
This page took 0.017436 seconds and 4 git commands to generate.