Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #pragma once
  2.  
  3. #define SMALL_NUMBER (1.e-8f)
  4. #define KINDA_SMALL_NUMBER (1.e-4f)
  5. #define BIG_NUMBER (3.4e+38f)
  6.  
  7. #define THRESH_VECTOR_NORMALIZED (0.01f)
  8.  
  9. namespace Math
  10. {
  11. template <typename T>
  12. static inline T Abs(const T a) { return (a >= (T)0) ? a : -a; }
  13. //template <typename T>
  14. //static inline T Max(const T a, const T b) { return (a >= b) ? a : b; }
  15. //template <typename T>
  16. //static inline T Min(const T a, const T b) { return (a <= b) ? a : b; }
  17.  
  18.  
  19. template <typename T>
  20. static inline T Square(const T a) { return a * a; }
  21. static inline float InvSqrt(float f) { return 1.0f / sqrtf(f); }
  22.  
  23. static inline float Sqrtf(const float a) { return sqrtf(a); }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement