| 100 | namespace luxrays { |
| 101 | |
| 102 | inline double WallClockTime() { |
| 103 | #if defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__FreeBSD__) |
| 104 | struct timeval t; |
| 105 | gettimeofday(&t, NULL); |
| 106 | |
| 107 | return t.tv_sec + t.tv_usec / 1000000.0; |
| 108 | #elif defined (WIN32) |
| 109 | return GetTickCount() / 1000.0; |
| 110 | #else |
| 111 | #error "Unsupported Platform !!!" |
| 112 | #endif |
| 113 | } |
| 114 | |
| 115 | template<class T> inline T Lerp(float t, T v1, T v2) { |
| 116 | // Linear interpolation |
no outgoing calls