14 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
18 aligned = aligned_highp,
22 mediump = packed_mediump,
24 packed = packed_highp,
26 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
27 defaultp = aligned_highp
33 typedef qualifier precision;
35 template<length_t L,
typename T, qualifier Q = defaultp>
struct vec;
36 template<length_t C, length_t R,
typename T, qualifier Q = defaultp>
struct mat;
37 template<
typename T, qualifier Q = defaultp>
struct qua;
39 # if GLM_HAS_TEMPLATE_ALIASES
40 template <
typename T, qualifier Q = defaultp>
using tvec1 = vec<1, T, Q>;
41 template <
typename T, qualifier Q = defaultp>
using tvec2 = vec<2, T, Q>;
42 template <
typename T, qualifier Q = defaultp>
using tvec3 = vec<3, T, Q>;
43 template <
typename T, qualifier Q = defaultp>
using tvec4 = vec<4, T, Q>;
44 template <
typename T, qualifier Q = defaultp>
using tmat2x2 = mat<2, 2, T, Q>;
45 template <
typename T, qualifier Q = defaultp>
using tmat2x3 = mat<2, 3, T, Q>;
46 template <
typename T, qualifier Q = defaultp>
using tmat2x4 = mat<2, 4, T, Q>;
47 template <
typename T, qualifier Q = defaultp>
using tmat3x2 = mat<3, 2, T, Q>;
48 template <
typename T, qualifier Q = defaultp>
using tmat3x3 = mat<3, 3, T, Q>;
49 template <
typename T, qualifier Q = defaultp>
using tmat3x4 = mat<3, 4, T, Q>;
50 template <
typename T, qualifier Q = defaultp>
using tmat4x2 = mat<4, 2, T, Q>;
51 template <
typename T, qualifier Q = defaultp>
using tmat4x3 = mat<4, 3, T, Q>;
52 template <
typename T, qualifier Q = defaultp>
using tmat4x4 = mat<4, 4, T, Q>;
53 template <
typename T, qualifier Q = defaultp>
using tquat = qua<T, Q>;
58 template<glm::qualifier P>
61 static const bool value =
false;
64 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
66 struct is_aligned<glm::aligned_lowp>
68 static const bool value =
true;
72 struct is_aligned<glm::aligned_mediump>
74 static const bool value =
true;
78 struct is_aligned<glm::aligned_highp>
80 static const bool value =
true;
84 template<length_t L,
typename T,
bool is_aligned>
93 template<length_t L,
typename T>
94 struct storage<L, T, true>
96 typedef struct alignas(L * sizeof(T)) type {
102 struct storage<3, T, true>
104 typedef struct alignas(4 * sizeof(T)) type {
110 # if GLM_ARCH & GLM_ARCH_SSE2_BIT
112 struct storage<4, float, true>
114 typedef glm_f32vec4 type;
118 struct storage<4, int, true>
120 typedef glm_i32vec4 type;
124 struct storage<4, unsigned int, true>
126 typedef glm_u32vec4 type;
130 struct storage<2, double, true>
132 typedef glm_f64vec2 type;
136 struct storage<2, detail::
int64, true>
138 typedef glm_i64vec2 type;
142 struct storage<2, detail::
uint64, true>
144 typedef glm_u64vec2 type;
147 # if (GLM_ARCH & GLM_ARCH_AVX_BIT)
149 struct storage<4, double, true>
151 typedef glm_f64vec4 type;
155 # if (GLM_ARCH & GLM_ARCH_AVX2_BIT)
157 struct storage<4, detail::
int64, true>
159 typedef glm_i64vec4 type;
163 struct storage<4, detail::
uint64, true>
165 typedef glm_u64vec4 type;
169 # if GLM_ARCH & GLM_ARCH_NEON_BIT
171 struct storage<4, float, true>
173 typedef glm_f32vec4 type;
177 struct storage<4, int, true>
179 typedef glm_i32vec4 type;
183 struct storage<4, unsigned int, true>
185 typedef glm_u32vec4 type;
196 template <
typename genType>
200 template <length_t C, length_t R,
typename T>
201 struct genTypeTrait<mat<C, R, T> >
203 static const genTypeEnum GENTYPE = GENTYPE_MAT;
206 template<
typename genType, genTypeEnum type>
211 template<
typename genType>
212 struct init_gentype<genType, GENTYPE_QUAT>
214 GLM_FUNC_QUALIFIER GLM_CONSTEXPR
static genType
identity()
216 return genType(1, 0, 0, 0);
220 template<
typename genType>
221 struct init_gentype<genType, GENTYPE_MAT>
223 GLM_FUNC_QUALIFIER GLM_CONSTEXPR
static genType
identity()