MathDefs.pkg 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. $#include "Math/MathDefs.h"
  2. static const float M_PI;
  3. static const float M_HALF_PI;
  4. static const int M_MIN_INT;
  5. static const int M_MAX_INT;
  6. static const unsigned M_MIN_UNSIGNED;
  7. static const unsigned M_MAX_UNSIGNED;
  8. static const float M_EPSILON;
  9. static const float M_LARGE_EPSILON;
  10. static const float M_MIN_NEARCLIP;
  11. static const float M_MAX_FOV;
  12. static const float M_LARGE_VALUE;
  13. static const float M_INFINITY;
  14. static const float M_DEGTORAD;
  15. static const float M_DEGTORAD_2;
  16. static const float M_RADTODEG;
  17. enum Intersection
  18. {
  19. OUTSIDE,
  20. INTERSECTS,
  21. INSIDE
  22. };
  23. bool Equals(float lhs, float rhs);
  24. bool IsNaN(float value);
  25. float Lerp(float lhs, float rhs, float t);
  26. float InverseLerp(float lhs, float rhs, float x);
  27. float Min(float lhs, float rhs);
  28. float Max(float lhs, float rhs);
  29. float Abs(float value);
  30. float Sign(float value);
  31. float Clamp(float value, float min, float max);
  32. float SmoothStep(float lhs, float rhs, float t);
  33. float Sin(float angle);
  34. float Cos(float angle);
  35. float Tan(float angle);
  36. float Asin(float x);
  37. float Acos(float x);
  38. float Atan(float x);
  39. float Atan2(float y, float x);
  40. float Sqrt(float x);
  41. float Pow(float x, float y);
  42. float Ln(float x);
  43. float Mod(float x, float y);
  44. float Fract(float x);
  45. float Floor(float x);
  46. float Round(float x);
  47. float Ceil(float x);
  48. int FloorToInt(float x);
  49. int RoundToInt(float x);
  50. int CeilToInt(float x);
  51. int Min @ MinInt(int lhs, int rhs);
  52. int Max @ MaxInt(int lhs, int rhs);
  53. int Abs @ AbsInt(int value);
  54. int Clamp @ ClampInt(int value, int min, int max);
  55. bool IsPowerOfTwo(unsigned value);
  56. unsigned NextPowerOfTwo(unsigned value);
  57. unsigned CountSetBits(unsigned value);
  58. unsigned SDBMHash(unsigned hash, unsigned char c);
  59. float Random();
  60. float Random(float range);
  61. float Random(float min, float max);
  62. int Random @ RandomInt(int range);
  63. int Random @ RandomInt(int min, int max);
  64. float RandomNormal(float meanValue, float variance);