Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.5KB

  1. /// @ref gtc_random
  2. /// @file glm/gtc/random.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtx_random (extended)
  6. ///
  7. /// @defgroup gtc_random GLM_GTC_random
  8. /// @ingroup gtc
  9. ///
  10. /// Include <glm/gtc/random.hpp> to use the features of this extension.
  11. ///
  12. /// Generate random number from various distribution methods.
  13. #pragma once
  14. // Dependency:
  15. #include "../vec2.hpp"
  16. #include "../vec3.hpp"
  17. #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
  18. # pragma message("GLM: GLM_GTC_random extension included")
  19. #endif
  20. namespace glm
  21. {
  22. /// @addtogroup gtc_random
  23. /// @{
  24. /// Generate random numbers in the interval [Min, Max], according a linear distribution
  25. ///
  26. /// @param Min Minimum value included in the sampling
  27. /// @param Max Maximum value included in the sampling
  28. /// @tparam genType Value type. Currently supported: float or double scalars.
  29. /// @see gtc_random
  30. template<typename genType>
  31. GLM_FUNC_DECL genType linearRand(genType Min, genType Max);
  32. /// Generate random numbers in the interval [Min, Max], according a linear distribution
  33. ///
  34. /// @param Min Minimum value included in the sampling
  35. /// @param Max Maximum value included in the sampling
  36. /// @tparam T Value type. Currently supported: float or double.
  37. ///
  38. /// @see gtc_random
  39. template<length_t L, typename T, qualifier Q>
  40. GLM_FUNC_DECL vec<L, T, Q> linearRand(vec<L, T, Q> const& Min, vec<L, T, Q> const& Max);
  41. /// Generate random numbers in the interval [Min, Max], according a gaussian distribution
  42. ///
  43. /// @see gtc_random
  44. template<typename genType>
  45. GLM_FUNC_DECL genType gaussRand(genType Mean, genType Deviation);
  46. /// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius
  47. ///
  48. /// @see gtc_random
  49. template<typename T>
  50. GLM_FUNC_DECL vec<2, T, defaultp> circularRand(T Radius);
  51. /// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius
  52. ///
  53. /// @see gtc_random
  54. template<typename T>
  55. GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(T Radius);
  56. /// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius
  57. ///
  58. /// @see gtc_random
  59. template<typename T>
  60. GLM_FUNC_DECL vec<2, T, defaultp> diskRand(T Radius);
  61. /// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius
  62. ///
  63. /// @see gtc_random
  64. template<typename T>
  65. GLM_FUNC_DECL vec<3, T, defaultp> ballRand(T Radius);
  66. /// @}
  67. }//namespace glm
  68. #include "random.inl"