MathDefs.pkg 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. $#include "MathDefs.h"
  2. static const float M_PI;
  3. static const int M_MIN_INT;
  4. static const int M_MAX_INT;
  5. static const unsigned M_MIN_UNSIGNED;
  6. static const unsigned M_MAX_UNSIGNED;
  7. static const float M_EPSILON;
  8. static const float M_LARGE_EPSILON;
  9. static const float M_MIN_NEARCLIP;
  10. static const float M_MAX_FOV;
  11. static const float M_LARGE_VALUE;
  12. static const float M_INFINITY;
  13. static const float M_DEGTORAD;
  14. static const float M_DEGTORAD_2;
  15. static const float M_RADTODEG;
  16. enum Intersection
  17. {
  18. OUTSIDE,
  19. INTERSECTS,
  20. INSIDE
  21. };
  22. float Lerp(float lhs, float rhs, float t);
  23. float Min(float lhs, float rhs);
  24. float Max(float lhs, float rhs);
  25. float Abs(float value);
  26. float Sign(float value);
  27. float Clamp(float value, float min, float max);
  28. float SmoothStep(float lhs, float rhs, float t);
  29. bool Equals(float lhs, float rhs);
  30. bool IsNaN(float value);
  31. bool IsPowerOfTwo(unsigned value);
  32. unsigned NextPowerOfTwo(unsigned value);
  33. unsigned SDBMHash(unsigned hash, unsigned char c);
  34. float Random();
  35. float Random(float range);
  36. float Random(float min, float max);
  37. float RandomNormal(float meanValue, float variance);
  38. int Random @ RandomInt(int range);
  39. int Random @ RandomInt(int min, int max);