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<3, float, true>
132 typedef glm_f32vec4 type;
136 struct storage<3, int, true>
138 typedef glm_i32vec4 type;
142 struct storage<3, unsigned int, true>
144 typedef glm_u32vec4 type;
148 struct storage<2, double, true>
150 typedef glm_f64vec2 type;
154 struct storage<2, detail::
int64, true>
156 typedef glm_i64vec2 type;
160 struct storage<2, detail::
uint64, true>
162 typedef glm_u64vec2 type;
167 struct storage<3, detail::
uint64, true>
169 typedef glm_u64vec2 type;
173 struct storage<4, double, true>
175 # if (GLM_ARCH & GLM_ARCH_AVX_BIT)
176 typedef glm_f64vec4 type;
181 GLM_CONSTEXPR glm_f64vec2 getv(
int i)
const {
184 GLM_CONSTEXPR
void setv(
int i,
const glm_f64vec2& v) {
193 struct storage<3, double, true> :
public storage<4, double, true>
198 # if (GLM_ARCH & GLM_ARCH_AVX2_BIT)
200 struct storage<4, detail::
int64, true>
202 typedef glm_i64vec4 type;
206 struct storage<4, detail::
uint64, true>
208 typedef glm_u64vec4 type;
212 # if GLM_ARCH & GLM_ARCH_NEON_BIT
214 struct storage<4, float, true>
216 typedef glm_f32vec4 type;
220 struct storage<3, float, true> :
public storage<4, float, true>
224 struct storage<4, int, true>
226 typedef glm_i32vec4 type;
230 struct storage<3, int, true> :
public storage<4, int, true>
234 struct storage<4, unsigned int, true>
236 typedef glm_u32vec4 type;
240 struct storage<3, unsigned int, true> :
public storage<4, unsigned int, true>
245 struct storage<3, double, true>
247 typedef struct alignas(4 * sizeof(double)) type {
251 # endif//GLM_HAS_ALIGNOF
262 template <
typename genType>
266 template <length_t C, length_t R,
typename T>
267 struct genTypeTrait<mat<C, R, T> >
269 static const genTypeEnum GENTYPE = GENTYPE_MAT;
272 template<
typename genType, genTypeEnum type>
277 template<
typename genType>
278 struct init_gentype<genType, GENTYPE_QUAT>
280 GLM_FUNC_QUALIFIER GLM_CONSTEXPR
static genType
identity()
282 return genType(1, 0, 0, 0);
286 template<
typename genType>
287 struct init_gentype<genType, GENTYPE_MAT>
289 GLM_FUNC_QUALIFIER GLM_CONSTEXPR
static genType
identity()