[Orxonox-commit 1419] r6137 - code/branches/presentation2/src/libraries/util

landauf at orxonox.net landauf at orxonox.net
Tue Nov 24 03:11:31 CET 2009


Author: landauf
Date: 2009-11-24 03:11:31 +0100 (Tue, 24 Nov 2009)
New Revision: 6137

Modified:
   code/branches/presentation2/src/libraries/util/Math.cc
   code/branches/presentation2/src/libraries/util/Math.h
Log:
Ogre introduced overloadings of the << operator for Radian and Degree in version 1.6.3
So exclude our own implementation of this if the version is greater or equal.

Modified: code/branches/presentation2/src/libraries/util/Math.cc
===================================================================
--- code/branches/presentation2/src/libraries/util/Math.cc	2009-11-24 01:35:24 UTC (rev 6136)
+++ code/branches/presentation2/src/libraries/util/Math.cc	2009-11-24 02:11:31 UTC (rev 6137)
@@ -42,6 +42,7 @@
 
 namespace orxonox
 {
+#if OGRE_VERSION < 0x010603
     /**
         @brief Function for writing a Radian to a stream.
     */
@@ -52,6 +53,16 @@
     }
 
     /**
+        @brief Function for writing a Degree to a stream.
+    */
+    std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree)
+    {
+        out << degree.valueDegrees();
+        return out;
+    }
+#endif
+
+    /**
         @brief Function for reading a Radian from a stream.
     */
     std::istream& operator>>(std::istream& in, orxonox::Radian& radian)
@@ -63,15 +74,6 @@
     }
 
     /**
-        @brief Function for writing a Degree to a stream.
-    */
-    std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree)
-    {
-        out << degree.valueDegrees();
-        return out;
-    }
-
-    /**
         @brief Function for reading a Degree from a stream.
     */
     std::istream& operator>>(std::istream& in, orxonox::Degree& degree)

Modified: code/branches/presentation2/src/libraries/util/Math.h
===================================================================
--- code/branches/presentation2/src/libraries/util/Math.h	2009-11-24 01:35:24 UTC (rev 6136)
+++ code/branches/presentation2/src/libraries/util/Math.h	2009-11-24 02:11:31 UTC (rev 6137)
@@ -58,9 +58,11 @@
 
 namespace orxonox
 {
+#if OGRE_VERSION < 0x010603
     _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian);
+    _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree);
+#endif
     _UtilExport std::istream& operator>>(std::istream& in, orxonox::Radian& radian);
-    _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Degree& degree);
     _UtilExport std::istream& operator>>(std::istream& in, orxonox::Degree& degree);
 
     _UtilExport float getAngle(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& otherposition);




More information about the Orxonox-commit mailing list