Changeset 2002 for code/branches/objecthierarchy/src/util/Math.h
- Timestamp:
- Oct 24, 2008, 12:37:54 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/util/Math.h
r1840 r2002 39 39 #include <ostream> 40 40 #include <string> 41 #include <boost/static_assert.hpp> 41 42 42 43 #include <OgreMath.h> … … 189 190 } 190 191 192 template <typename T> 193 inline T zeroise() 194 { 195 BOOST_STATIC_ASSERT(sizeof(T) == 0); 196 return T(); 197 } 198 199 template <> inline char zeroise<char>() { return 0; } 200 template <> inline unsigned char zeroise<unsigned char>() { return 0; } 201 template <> inline short zeroise<short>() { return 0; } 202 template <> inline unsigned short zeroise<unsigned short>() { return 0; } 203 template <> inline int zeroise<int>() { return 0; } 204 template <> inline unsigned int zeroise<unsigned int>() { return 0; } 205 template <> inline long zeroise<long>() { return 0; } 206 template <> inline unsigned long zeroise<unsigned long>() { return 0; } 207 template <> inline long long zeroise<long long>() { return 0; } 208 template <> inline unsigned long long zeroise<unsigned long long>() { return 0; } 209 template <> inline float zeroise<float>() { return 0; } 210 template <> inline double zeroise<double>() { return 0; } 211 template <> inline long double zeroise<long double>() { return 0; } 212 template <> inline bool zeroise<bool>() { return 0; } 213 template <> inline void* zeroise<void*>() { return 0; } 214 template <> inline std::string zeroise<std::string>() { return ""; } 215 template <> inline orxonox::Radian zeroise<orxonox::Radian>() { return orxonox::Radian(0.0f); } 216 template <> inline orxonox::Degree zeroise<orxonox::Degree>() { return orxonox::Degree(0.0f); } 217 template <> inline orxonox::Vector2 zeroise<orxonox::Vector2>() { return orxonox::Vector2 (0, 0) ; } 218 template <> inline orxonox::Vector3 zeroise<orxonox::Vector3>() { return orxonox::Vector3 (0, 0, 0) ; } 219 template <> inline orxonox::Vector4 zeroise<orxonox::Vector4>() { return orxonox::Vector4 (0, 0, 0, 0); } 220 template <> inline orxonox::ColourValue zeroise<orxonox::ColourValue>() { return orxonox::ColourValue(0, 0, 0, 0); } 221 template <> inline orxonox::Quaternion zeroise<orxonox::Quaternion>() { return orxonox::Quaternion (0, 0, 0, 0); } 222 191 223 /** 192 224 @brief Interpolates between two values for a time between 0 and 1.
Note: See TracChangeset
for help on using the changeset viewer.