master
ブランチ master
VulkanExample / dep / include / glm / gtc / constants.hpp
4.2 KB、170行 生 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 unit-circle circumference, or pi * 2.
43 /// @see gtc_constants
44 template<typename genType>
45 GLM_FUNC_DECL GLM_CONSTEXPR genType tau();
46
47 /// Return square root of pi.
48 /// @see gtc_constants
49 template<typename genType>
50 GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi();
51
52 /// Return pi / 2.
53 /// @see gtc_constants
54 template<typename genType>
55 GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi();
56
57 /// Return pi / 2 * 3.
58 /// @see gtc_constants
59 template<typename genType>
60 GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi();
61
62 /// Return pi / 4.
63 /// @see gtc_constants
64 template<typename genType>
65 GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi();
66
67 /// Return 1 / pi.
68 /// @see gtc_constants
69 template<typename genType>
70 GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi();
71
72 /// Return 1 / (pi * 2).
73 /// @see gtc_constants
74 template<typename genType>
75 GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi();
76
77 /// Return 2 / pi.
78 /// @see gtc_constants
79 template<typename genType>
80 GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi();
81
82 /// Return 4 / pi.
83 /// @see gtc_constants
84 template<typename genType>
85 GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi();
86
87 /// Return 2 / sqrt(pi).
88 /// @see gtc_constants
89 template<typename genType>
90 GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi();
91
92 /// Return 1 / sqrt(2).
93 /// @see gtc_constants
94 template<typename genType>
95 GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two();
96
97 /// Return sqrt(pi / 2).
98 /// @see gtc_constants
99 template<typename genType>
100 GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi();
101
102 /// Return sqrt(2 * pi).
103 /// @see gtc_constants
104 template<typename genType>
105 GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi();
106
107 /// Return sqrt(ln(4)).
108 /// @see gtc_constants
109 template<typename genType>
110 GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four();
111
112 /// Return e constant.
113 /// @see gtc_constants
114 template<typename genType>
115 GLM_FUNC_DECL GLM_CONSTEXPR genType e();
116
117 /// Return Euler's constant.
118 /// @see gtc_constants
119 template<typename genType>
120 GLM_FUNC_DECL GLM_CONSTEXPR genType euler();
121
122 /// Return sqrt(2).
123 /// @see gtc_constants
124 template<typename genType>
125 GLM_FUNC_DECL GLM_CONSTEXPR genType root_two();
126
127 /// Return sqrt(3).
128 /// @see gtc_constants
129 template<typename genType>
130 GLM_FUNC_DECL GLM_CONSTEXPR genType root_three();
131
132 /// Return sqrt(5).
133 /// @see gtc_constants
134 template<typename genType>
135 GLM_FUNC_DECL GLM_CONSTEXPR genType root_five();
136
137 /// Return ln(2).
138 /// @see gtc_constants
139 template<typename genType>
140 GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two();
141
142 /// Return ln(10).
143 /// @see gtc_constants
144 template<typename genType>
145 GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten();
146
147 /// Return ln(ln(2)).
148 /// @see gtc_constants
149 template<typename genType>
150 GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two();
151
152 /// Return 1 / 3.
153 /// @see gtc_constants
154 template<typename genType>
155 GLM_FUNC_DECL GLM_CONSTEXPR genType third();
156
157 /// Return 2 / 3.
158 /// @see gtc_constants
159 template<typename genType>
160 GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds();
161
162 /// Return the golden ratio constant.
163 /// @see gtc_constants
164 template<typename genType>
165 GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio();
166
167 /// @}
168} //namespace glm
169
170#include "constants.inl"