Changeset 9550 for code/trunk/src/libraries/util/Math.h
- Timestamp:
- Mar 12, 2013, 11:13:03 PM (12 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/testing (added) merged: 9015,9017,9020-9022,9025-9026,9047,9076-9078,9114-9115,9221-9226,9356,9473-9480,9524,9529-9531,9533-9545,9547-9549
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/util/Math.h
r8729 r9550 139 139 { 140 140 return x*x*x; 141 }142 143 /**144 @brief Rounds the value to the nearest integer.145 */146 template <typename T>147 inline int round(T x)148 {149 return static_cast<int>(x + 0.5);150 141 } 151 142 … … 247 238 inline T interpolate(float time, const T& start, const T& end) 248 239 { 249 return time * (end - start) + start;240 return static_cast<T>(time * (end - start) + start); 250 241 } 251 242 … … 260 251 inline T interpolateSmooth(float time, const T& start, const T& end) 261 252 { 262 return (-2 * (end - start) * cube(time)) + (3 * (end - start) * square(time)) + start;253 return static_cast<T>((-2 * (end - start) * cube(time)) + (3 * (end - start) * square(time)) + start); 263 254 } 264 255
Note: See TracChangeset
for help on using the changeset viewer.