Permalink
Browse files

Added methods for getting formatted string of: vectors(2,3), queatern…

…ions, colors
  • Loading branch information...
1 parent b0b35c2 commit bfd105dbba8e46d9f52a50e98ef786f7b989b5b7 @max-frai max-frai committed Aug 29, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 include/Core/Utils.hpp
View
@@ -11,6 +11,7 @@
#include <Ogre.h>
#include "Managers/LogManager.hpp"
+#include "Core/Types.hpp"
using namespace std;
using namespace boost;
@@ -52,6 +53,12 @@ class Utils : public singleton<Utils>
ptime getCurrentTime() const;
void writeTimestamp();
string getTimeDifference();
+
+ string bool2string(bool var) { return(var ? "true" : "false"); }
+ string vec2string(const vec3 &v) { return FORMAT("vec3(x=%1%;y=%2%;z=%3%)", v.x % v.y % v.z); }
+ string vec2string(const vec2 &v) { return FORMAT("vec2(x=%1%;y=%2%)", v.x % v.y); }
+ string quat2string(const quat &q) { return FORMAT("quat(w=%1%;x=%2%;y=%3%;z=%4%)", q.w % q.x % q.y % q.z); }
+ string color2string(const colour &c) { return FORMAT("color(r=%1%;g=%2%;b=%3%;a=%4%)", c.r % c.g % c.b % c.a); }
};
#endif

0 comments on commit bfd105d

Please sign in to comment.