master
ブランチ master
ShaderPlayground / deps / glm / glm / gtc / constants.hpp
3.9 KB、165行 生 Blame 履歴
1/// @ref gtc_constants
2/// @file glm/gtc/constants.hpp
3///
4/// @see core (dependence)
5///
6/// @defgroup gtc_constants GLM_GTC_constants
7/// @ingroup gtc
8///
9/// Include <glm/gtc/constants.hpp> to use the features of this extension.
10///
11/// Provide a list of constants and precomputed useful values.
12
13#pragma once
14
15// Dependencies
16#include "../ext/scalar_constants.hpp"
17
18#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
19# pragma message("GLM: GLM_GTC_constants extension included")
20#endif
21
22namespace glm
23{
24 /// @addtogroup gtc_constants
25 /// @{
26
27 /// Return 0.
28 /// @see gtc_constants
29 template<typename genType>
30 GLM_FUNC_DECL GLM_CONSTEXPR genType zero();
31
32 /// Return 1.
33 /// @see gtc_constants
34 template<typename genType>
35 GLM_FUNC_DECL GLM_CONSTEXPR genType one();
36
37 /// Return pi * 2.
38 /// @see gtc_constants
39 template<typename genType>
40 GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi();
41
42 /// Return square root of pi.
43 /// @see gtc_constants
44 template<typename genType>
45 GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi();
46
47 /// Return pi / 2.
48 /// @see gtc_constants
49 template<typename genType>
50 GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi();
51
52 /// Return pi / 2 * 3.
53 /// @see gtc_constants
54 template<typename genType>
55 GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi();
56
57 /// Return pi / 4.
58 /// @see gtc_constants
59 template<typename genType>
60 GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi();
61
62 /// Return 1 / pi.
63 /// @see gtc_constants
64 template<typename genType>
65 GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi();
66
67 /// Return 1 / (pi * 2).
68 /// @see gtc_constants
69 template<typename genType>
70 GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi();
71
72 /// Return 2 / pi.
73 /// @see gtc_constants
74 template<typename genType>
75 GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi();
76
77 /// Return 4 / pi.
78 /// @see gtc_constants
79 template<typename genType>
80 GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi();
81
82 /// Return 2 / sqrt(pi).
83 /// @see gtc_constants
84 template<typename genType>
85 GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi();
86
87 /// Return 1 / sqrt(2).
88 /// @see gtc_constants
89 template<typename genType>
90 GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two();
91
92 /// Return sqrt(pi / 2).
93 /// @see gtc_constants
94 template<typename genType>
95 GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi();
96
97 /// Return sqrt(2 * pi).
98 /// @see gtc_constants
99 template<typename genType>
100 GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi();
101
102 /// Return sqrt(ln(4)).
103 /// @see gtc_constants
104 template<typename genType>
105 GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four();
106
107 /// Return e constant.
108 /// @see gtc_constants
109 template<typename genType>
110 GLM_FUNC_DECL GLM_CONSTEXPR genType e();
111
112 /// Return Euler's constant.
113 /// @see gtc_constants
114 template<typename genType>
115 GLM_FUNC_DECL GLM_CONSTEXPR genType euler();
116
117 /// Return sqrt(2).
118 /// @see gtc_constants
119 template<typename genType>
120 GLM_FUNC_DECL GLM_CONSTEXPR genType root_two();
121
122 /// Return sqrt(3).
123 /// @see gtc_constants
124 template<typename genType>
125 GLM_FUNC_DECL GLM_CONSTEXPR genType root_three();
126
127 /// Return sqrt(5).
128 /// @see gtc_constants
129 template<typename genType>
130 GLM_FUNC_DECL GLM_CONSTEXPR genType root_five();
131
132 /// Return ln(2).
133 /// @see gtc_constants
134 template<typename genType>
135 GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two();
136
137 /// Return ln(10).
138 /// @see gtc_constants
139 template<typename genType>
140 GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten();
141
142 /// Return ln(ln(2)).
143 /// @see gtc_constants
144 template<typename genType>
145 GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two();
146
147 /// Return 1 / 3.
148 /// @see gtc_constants
149 template<typename genType>
150 GLM_FUNC_DECL GLM_CONSTEXPR genType third();
151
152 /// Return 2 / 3.
153 /// @see gtc_constants
154 template<typename genType>
155 GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds();
156
157 /// Return the golden ratio constant.
158 /// @see gtc_constants
159 template<typename genType>
160 GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio();
161
162 /// @}
163} //namespace glm
164
165#include "constants.inl"