Changeset 2087 for code/trunk/src/util/Math.h
- Timestamp:
- Nov 1, 2008, 7:04:09 PM (17 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/util
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/code/branches/ceguilua/src/util merged eligible /code/branches/script_trigger/src/util merged eligible /code/branches/core3/src/util 1572-1739,1742-2014 /code/branches/gcc43/src/util 1580 /code/branches/gui/src/util 1635-1723 /code/branches/input/src/util 1629-1636
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
code/trunk/src/util/Math.h
r1840 r2087 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. … … 243 275 244 276 _UtilExport unsigned long getUniqueNumber(); 245 _UtilExport std::string getUniqueNumberStr();246 277 247 278 class _UtilExport IntVector2
Note: See TracChangeset
for help on using the changeset viewer.