1 /// @ref gtc_random
2 /// @file glm/gtc/random.hpp
3 ///
4 /// @see core (dependence)
5 /// @see gtc_half_float (dependence)
6 /// @see gtx_random (extended)
7 ///
8 /// @defgroup gtc_random GLM_GTC_random
9 /// @ingroup gtc
10 ///
11 /// @brief Generate random number from various distribution methods.
12 ///
13 /// <glm/gtc/random.hpp> need to be included to use these functionalities.
14 
15 #pragma once
16 
17 // Dependency:
18 #include "../vec2.hpp"
19 #include "../vec3.hpp"
20 
21 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
22 #	pragma message("GLM: GLM_GTC_random extension included")
23 #endif
24 
25 namespace glm
26 {
27 	/// @addtogroup gtc_random
28 	/// @{
29 
30 	/// Generate random numbers in the interval [Min, Max], according a linear distribution
31 	///
32 	/// @param Min
33 	/// @param Max
34 	/// @tparam genType Value type. Currently supported: float or double scalars.
35 	/// @see gtc_random
36 	template <typename genTYpe>
37 	GLM_FUNC_DECL genTYpe linearRand(
38 		genTYpe Min,
39 		genTYpe Max);
40 
41 	/// Generate random numbers in the interval [Min, Max], according a linear distribution
42 	///
43 	/// @param Min
44 	/// @param Max
45 	/// @tparam T Value type. Currently supported: float or double.
46 	/// @tparam vecType A vertor type: tvec1, tvec2, tvec3, tvec4 or compatible
47 	/// @see gtc_random
48 	template <typename T, precision P, template <typename, precision> class vecType>
49 	GLM_FUNC_DECL vecType<T, P> linearRand(
50 		vecType<T, P> const & Min,
51 		vecType<T, P> const & Max);
52 
53 	/// Generate random numbers in the interval [Min, Max], according a gaussian distribution
54 	///
55 	/// @param Mean
56 	/// @param Deviation
57 	/// @see gtc_random
58 	template <typename genType>
59 	GLM_FUNC_DECL genType gaussRand(
60 		genType Mean,
61 		genType Deviation);
62 
63 	/// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius
64 	///
65 	/// @param Radius
66 	/// @see gtc_random
67 	template <typename T>
68 	GLM_FUNC_DECL tvec2<T, defaultp> circularRand(
69 		T Radius);
70 
71 	/// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius
72 	///
73 	/// @param Radius
74 	/// @see gtc_random
75 	template <typename T>
76 	GLM_FUNC_DECL tvec3<T, defaultp> sphericalRand(
77 		T Radius);
78 
79 	/// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius
80 	///
81 	/// @param Radius
82 	/// @see gtc_random
83 	template <typename T>
84 	GLM_FUNC_DECL tvec2<T, defaultp> diskRand(
85 		T Radius);
86 
87 	/// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius
88 	///
89 	/// @param Radius
90 	/// @see gtc_random
91 	template <typename T>
92 	GLM_FUNC_DECL tvec3<T, defaultp> ballRand(
93 		T Radius);
94 
95 	/// @}
96 }//namespace glm
97 
98 #include "random.inl"
99