From 3c0d952a14a0924e5f4781d8e0cd7a880b6b87f7 Mon Sep 17 00:00:00 2001 From: Dmitry Atamanov Date: Mon, 27 Jul 2026 13:37:03 +0500 Subject: [PATCH] Update GLM to 1.0.3 --- cmake/FindGLM.cmake | 6 +- src/libprojectM/MilkdropPreset/CMakeLists.txt | 2 +- src/libprojectM/Renderer/CMakeLists.txt | 2 +- src/libprojectM/UserSprites/CMakeLists.txt | 2 +- src/sdl-test-ui/CMakeLists.txt | 2 +- vendor/glm/CMakeLists.txt | 53 +- vendor/glm/common.hpp | 59 +- vendor/glm/detail/_features.hpp | 3 - vendor/glm/detail/_fixes.hpp | 3 - vendor/glm/detail/_noise.hpp | 20 +- vendor/glm/detail/_swizzle.hpp | 317 +- vendor/glm/detail/_swizzle_func.hpp | 15 +- vendor/glm/detail/_vectorize.hpp | 177 +- vendor/glm/detail/compute_common.hpp | 50 + vendor/glm/detail/compute_vector_decl.hpp | 190 + .../glm/detail/compute_vector_relational.hpp | 14 +- vendor/glm/detail/dummy.cpp | 186 - vendor/glm/detail/func_common.inl | 366 +- vendor/glm/detail/func_common_simd.inl | 420 +- vendor/glm/detail/func_exponential.inl | 24 +- vendor/glm/detail/func_exponential_simd.inl | 2 + vendor/glm/detail/func_geometric.inl | 52 +- vendor/glm/detail/func_geometric_simd.inl | 92 +- vendor/glm/detail/func_integer.inl | 122 +- vendor/glm/detail/func_integer_simd.inl | 21 +- vendor/glm/detail/func_matrix.inl | 163 +- vendor/glm/detail/func_matrix_simd.inl | 190 +- vendor/glm/detail/func_packing.inl | 33 +- vendor/glm/detail/func_packing_simd.inl | 3 - vendor/glm/detail/func_trigonometric.inl | 49 +- vendor/glm/detail/func_trigonometric_simd.inl | 0 vendor/glm/detail/func_vector_relational.inl | 74 +- .../detail/func_vector_relational_simd.inl | 3 - vendor/glm/detail/glm.cpp | 24 +- vendor/glm/detail/qualifier.hpp | 238 +- vendor/glm/detail/setup.hpp | 1252 ++++-- vendor/glm/detail/type_float.hpp | 107 +- vendor/glm/detail/type_gentype.hpp | 195 - vendor/glm/detail/type_gentype.inl | 341 -- vendor/glm/detail/type_half.hpp | 3 - vendor/glm/detail/type_half.inl | 11 +- vendor/glm/detail/type_int.hpp | 306 -- vendor/glm/detail/type_mat.hpp | 766 ---- vendor/glm/detail/type_mat.inl | 3 - vendor/glm/detail/type_mat2x2.hpp | 111 +- vendor/glm/detail/type_mat2x2.inl | 274 +- vendor/glm/detail/type_mat2x3.hpp | 97 +- vendor/glm/detail/type_mat2x3.inl | 297 +- vendor/glm/detail/type_mat2x4.hpp | 97 +- vendor/glm/detail/type_mat2x4.inl | 318 +- vendor/glm/detail/type_mat3x2.hpp | 97 +- vendor/glm/detail/type_mat3x2.inl | 337 +- vendor/glm/detail/type_mat3x3.hpp | 111 +- vendor/glm/detail/type_mat3x3.inl | 436 +- vendor/glm/detail/type_mat3x4.hpp | 97 +- vendor/glm/detail/type_mat3x4.inl | 379 +- vendor/glm/detail/type_mat4x2.hpp | 105 +- vendor/glm/detail/type_mat4x2.inl | 377 +- vendor/glm/detail/type_mat4x3.hpp | 97 +- vendor/glm/detail/type_mat4x3.inl | 441 +- vendor/glm/detail/type_mat4x4.hpp | 111 +- vendor/glm/detail/type_mat4x4.inl | 557 ++- vendor/glm/detail/type_mat4x4_simd.inl | 1 - vendor/glm/detail/type_quat.hpp | 193 + vendor/glm/detail/type_quat.inl | 424 ++ vendor/glm/detail/type_quat_simd.inl | 208 + vendor/glm/detail/type_vec.hpp | 562 --- vendor/glm/detail/type_vec.inl | 2 - vendor/glm/detail/type_vec1.hpp | 308 ++ vendor/glm/detail/type_vec1.inl | 183 +- vendor/glm/detail/type_vec2.hpp | 289 +- vendor/glm/detail/type_vec2.inl | 274 +- vendor/glm/detail/type_vec3.hpp | 321 +- vendor/glm/detail/type_vec3.inl | 886 ++-- vendor/glm/detail/type_vec4.hpp | 365 +- vendor/glm/detail/type_vec4.inl | 783 ++-- vendor/glm/detail/type_vec4_simd.inl | 458 -- vendor/glm/detail/type_vec_simd.inl | 1032 +++++ vendor/glm/exponential.hpp | 6 +- vendor/glm/ext.hpp | 177 +- vendor/glm/ext/_matrix_vectorize.hpp | 128 + vendor/glm/ext/matrix_clip_space.hpp | 576 +++ vendor/glm/ext/matrix_clip_space.inl | 615 +++ vendor/glm/ext/matrix_common.hpp | 39 + vendor/glm/ext/matrix_common.inl | 34 + vendor/glm/ext/matrix_double2x2.hpp | 23 + vendor/glm/ext/matrix_double2x2_precision.hpp | 49 + vendor/glm/ext/matrix_double2x3.hpp | 18 + vendor/glm/ext/matrix_double2x3_precision.hpp | 31 + vendor/glm/ext/matrix_double2x4.hpp | 18 + vendor/glm/ext/matrix_double2x4_precision.hpp | 31 + vendor/glm/ext/matrix_double3x2.hpp | 18 + vendor/glm/ext/matrix_double3x2_precision.hpp | 31 + vendor/glm/ext/matrix_double3x3.hpp | 23 + vendor/glm/ext/matrix_double3x3_precision.hpp | 49 + vendor/glm/ext/matrix_double3x4.hpp | 18 + vendor/glm/ext/matrix_double3x4_precision.hpp | 31 + vendor/glm/ext/matrix_double4x2.hpp | 18 + vendor/glm/ext/matrix_double4x2_precision.hpp | 31 + vendor/glm/ext/matrix_double4x3.hpp | 18 + vendor/glm/ext/matrix_double4x3_precision.hpp | 31 + vendor/glm/ext/matrix_double4x4.hpp | 23 + vendor/glm/ext/matrix_double4x4_precision.hpp | 49 + vendor/glm/ext/matrix_float2x2.hpp | 23 + vendor/glm/ext/matrix_float2x2_precision.hpp | 49 + vendor/glm/ext/matrix_float2x3.hpp | 18 + vendor/glm/ext/matrix_float2x3_precision.hpp | 31 + vendor/glm/ext/matrix_float2x4.hpp | 18 + vendor/glm/ext/matrix_float2x4_precision.hpp | 31 + vendor/glm/ext/matrix_float3x2.hpp | 18 + vendor/glm/ext/matrix_float3x2_precision.hpp | 31 + vendor/glm/ext/matrix_float3x3.hpp | 23 + vendor/glm/ext/matrix_float3x3_precision.hpp | 49 + vendor/glm/ext/matrix_float3x4.hpp | 18 + vendor/glm/ext/matrix_float3x4_precision.hpp | 31 + vendor/glm/ext/matrix_float4x2.hpp | 18 + vendor/glm/ext/matrix_float4x2_precision.hpp | 31 + vendor/glm/ext/matrix_float4x3.hpp | 18 + vendor/glm/ext/matrix_float4x3_precision.hpp | 31 + vendor/glm/ext/matrix_float4x4.hpp | 23 + vendor/glm/ext/matrix_float4x4_precision.hpp | 49 + vendor/glm/ext/matrix_int2x2.hpp | 38 + vendor/glm/ext/matrix_int2x2_sized.hpp | 70 + vendor/glm/ext/matrix_int2x3.hpp | 33 + vendor/glm/ext/matrix_int2x3_sized.hpp | 49 + vendor/glm/ext/matrix_int2x4.hpp | 33 + vendor/glm/ext/matrix_int2x4_sized.hpp | 49 + vendor/glm/ext/matrix_int3x2.hpp | 33 + vendor/glm/ext/matrix_int3x2_sized.hpp | 49 + vendor/glm/ext/matrix_int3x3.hpp | 38 + vendor/glm/ext/matrix_int3x3_sized.hpp | 70 + vendor/glm/ext/matrix_int3x4.hpp | 33 + vendor/glm/ext/matrix_int3x4_sized.hpp | 49 + vendor/glm/ext/matrix_int4x2.hpp | 33 + vendor/glm/ext/matrix_int4x2_sized.hpp | 49 + vendor/glm/ext/matrix_int4x3.hpp | 33 + vendor/glm/ext/matrix_int4x3_sized.hpp | 49 + vendor/glm/ext/matrix_int4x4.hpp | 38 + vendor/glm/ext/matrix_int4x4_sized.hpp | 70 + vendor/glm/ext/matrix_integer.hpp | 91 + vendor/glm/ext/matrix_integer.inl | 38 + vendor/glm/ext/matrix_projection.hpp | 149 + vendor/glm/ext/matrix_projection.inl | 106 + vendor/glm/ext/matrix_relational.hpp | 132 + vendor/glm/ext/matrix_relational.inl | 88 + vendor/glm/ext/matrix_transform.hpp | 171 + vendor/glm/ext/matrix_transform.inl | 207 + vendor/glm/ext/matrix_uint2x2.hpp | 38 + vendor/glm/ext/matrix_uint2x2_sized.hpp | 70 + vendor/glm/ext/matrix_uint2x3.hpp | 33 + vendor/glm/ext/matrix_uint2x3_sized.hpp | 49 + vendor/glm/ext/matrix_uint2x4.hpp | 33 + vendor/glm/ext/matrix_uint2x4_sized.hpp | 49 + vendor/glm/ext/matrix_uint3x2.hpp | 33 + vendor/glm/ext/matrix_uint3x2_sized.hpp | 49 + vendor/glm/ext/matrix_uint3x3.hpp | 38 + vendor/glm/ext/matrix_uint3x3_sized.hpp | 70 + vendor/glm/ext/matrix_uint3x4.hpp | 33 + vendor/glm/ext/matrix_uint3x4_sized.hpp | 49 + vendor/glm/ext/matrix_uint4x2.hpp | 33 + vendor/glm/ext/matrix_uint4x2_sized.hpp | 49 + vendor/glm/ext/matrix_uint4x3.hpp | 33 + vendor/glm/ext/matrix_uint4x3_sized.hpp | 49 + vendor/glm/ext/matrix_uint4x4.hpp | 38 + vendor/glm/ext/matrix_uint4x4_sized.hpp | 70 + vendor/glm/ext/quaternion_common.hpp | 135 + vendor/glm/ext/quaternion_common.inl | 144 + vendor/glm/ext/quaternion_common_simd.inl | 18 + vendor/glm/ext/quaternion_double.hpp | 39 + .../glm/ext/quaternion_double_precision.hpp | 42 + vendor/glm/ext/quaternion_exponential.hpp | 63 + vendor/glm/ext/quaternion_exponential.inl | 89 + vendor/glm/ext/quaternion_float.hpp | 39 + vendor/glm/ext/quaternion_float_precision.hpp | 36 + vendor/glm/ext/quaternion_geometric.hpp | 70 + vendor/glm/ext/quaternion_geometric.inl | 36 + vendor/glm/ext/quaternion_relational.hpp | 62 + vendor/glm/ext/quaternion_relational.inl | 35 + vendor/glm/ext/quaternion_transform.hpp | 47 + vendor/glm/ext/quaternion_transform.inl | 24 + vendor/glm/ext/quaternion_trigonometric.hpp | 65 + vendor/glm/ext/quaternion_trigonometric.inl | 37 + vendor/glm/ext/scalar_common.hpp | 181 + vendor/glm/ext/scalar_common.inl | 170 + vendor/glm/ext/scalar_constants.hpp | 40 + vendor/glm/ext/scalar_constants.inl | 24 + vendor/glm/ext/scalar_int_sized.hpp | 70 + vendor/glm/ext/scalar_integer.hpp | 92 + vendor/glm/ext/scalar_integer.inl | 243 ++ vendor/glm/ext/scalar_packing.hpp | 32 + .../glm/ext/{vec1.inl => scalar_packing.inl} | 0 vendor/glm/ext/scalar_reciprocal.hpp | 135 + vendor/glm/ext/scalar_reciprocal.inl | 107 + vendor/glm/ext/scalar_relational.hpp | 68 + vendor/glm/ext/scalar_relational.inl | 40 + vendor/glm/ext/scalar_uint_sized.hpp | 70 + vendor/glm/ext/scalar_ulp.hpp | 77 + vendor/glm/ext/scalar_ulp.inl | 291 ++ vendor/glm/ext/vec1.hpp | 461 --- vendor/glm/ext/vector_bool1.hpp | 30 + vendor/glm/ext/vector_bool1_precision.hpp | 34 + vendor/glm/ext/vector_bool2.hpp | 18 + vendor/glm/ext/vector_bool2_precision.hpp | 31 + vendor/glm/ext/vector_bool3.hpp | 18 + vendor/glm/ext/vector_bool3_precision.hpp | 31 + vendor/glm/ext/vector_bool4.hpp | 18 + vendor/glm/ext/vector_bool4_precision.hpp | 31 + vendor/glm/ext/vector_common.hpp | 228 + vendor/glm/ext/vector_common.inl | 147 + vendor/glm/ext/vector_double1.hpp | 31 + vendor/glm/ext/vector_double1_precision.hpp | 36 + vendor/glm/ext/vector_double2.hpp | 18 + vendor/glm/ext/vector_double2_precision.hpp | 31 + vendor/glm/ext/vector_double3.hpp | 18 + vendor/glm/ext/vector_double3_precision.hpp | 34 + vendor/glm/ext/vector_double4.hpp | 18 + vendor/glm/ext/vector_double4_precision.hpp | 35 + vendor/glm/ext/vector_float1.hpp | 31 + vendor/glm/ext/vector_float1_precision.hpp | 36 + vendor/glm/ext/vector_float2.hpp | 18 + vendor/glm/ext/vector_float2_precision.hpp | 31 + vendor/glm/ext/vector_float3.hpp | 18 + vendor/glm/ext/vector_float3_precision.hpp | 31 + vendor/glm/ext/vector_float4.hpp | 18 + vendor/glm/ext/vector_float4_precision.hpp | 31 + vendor/glm/ext/vector_int1.hpp | 32 + vendor/glm/ext/vector_int1_sized.hpp | 49 + vendor/glm/ext/vector_int2.hpp | 18 + vendor/glm/ext/vector_int2_sized.hpp | 49 + vendor/glm/ext/vector_int3.hpp | 18 + vendor/glm/ext/vector_int3_sized.hpp | 49 + vendor/glm/ext/vector_int4.hpp | 18 + vendor/glm/ext/vector_int4_sized.hpp | 49 + vendor/glm/ext/vector_integer.hpp | 149 + vendor/glm/ext/vector_integer.inl | 85 + vendor/glm/ext/vector_packing.hpp | 32 + vendor/glm/ext/vector_packing.inl | 0 vendor/glm/ext/vector_reciprocal.hpp | 135 + vendor/glm/ext/vector_reciprocal.inl | 105 + vendor/glm/ext/vector_relational.hpp | 74 +- vendor/glm/ext/vector_relational.inl | 67 +- vendor/glm/ext/vector_uint1.hpp | 32 + vendor/glm/ext/vector_uint1_sized.hpp | 49 + vendor/glm/ext/vector_uint2.hpp | 18 + vendor/glm/ext/vector_uint2_sized.hpp | 49 + vendor/glm/ext/vector_uint3.hpp | 18 + vendor/glm/ext/vector_uint3_sized.hpp | 49 + vendor/glm/ext/vector_uint4.hpp | 18 + vendor/glm/ext/vector_uint4_sized.hpp | 49 + vendor/glm/ext/vector_ulp.hpp | 112 + vendor/glm/ext/vector_ulp.inl | 74 + vendor/glm/fwd.hpp | 3687 ++++++----------- vendor/glm/geometric.hpp | 10 +- vendor/glm/glm.cppm | 2678 ++++++++++++ vendor/glm/glm.hpp | 65 +- vendor/glm/gtc/bitfield.hpp | 42 +- vendor/glm/gtc/bitfield.inl | 126 +- vendor/glm/gtc/color_space.hpp | 2 +- vendor/glm/gtc/color_space.inl | 1 - vendor/glm/gtc/constants.hpp | 17 +- vendor/glm/gtc/constants.inl | 18 +- vendor/glm/gtc/epsilon.hpp | 2 +- vendor/glm/gtc/epsilon.inl | 7 +- vendor/glm/gtc/integer.hpp | 32 +- vendor/glm/gtc/integer.inl | 36 - vendor/glm/gtc/matrix_access.hpp | 2 +- vendor/glm/gtc/matrix_access.inl | 1 - vendor/glm/gtc/matrix_integer.hpp | 110 +- vendor/glm/gtc/matrix_inverse.hpp | 8 +- vendor/glm/gtc/matrix_inverse.inl | 28 +- vendor/glm/gtc/matrix_transform.hpp | 699 +--- vendor/glm/gtc/matrix_transform.inl | 805 ---- vendor/glm/gtc/noise.hpp | 2 +- vendor/glm/gtc/noise.inl | 23 +- vendor/glm/gtc/packing.hpp | 14 +- vendor/glm/gtc/packing.inl | 94 +- vendor/glm/gtc/quaternion.hpp | 382 +- vendor/glm/gtc/quaternion.inl | 712 +--- vendor/glm/gtc/quaternion_simd.inl | 198 - vendor/glm/gtc/random.hpp | 15 +- vendor/glm/gtc/random.inl | 25 +- vendor/glm/gtc/reciprocal.hpp | 117 +- vendor/glm/gtc/reciprocal.inl | 192 - vendor/glm/gtc/round.hpp | 46 +- vendor/glm/gtc/round.inl | 209 +- vendor/glm/gtc/type_aligned.hpp | 788 +++- vendor/glm/gtc/type_precision.hpp | 1813 ++++++-- vendor/glm/gtc/type_precision.inl | 3 +- vendor/glm/gtc/type_ptr.hpp | 7 +- vendor/glm/gtc/type_ptr.inl | 55 +- vendor/glm/gtc/ulp.hpp | 118 +- vendor/glm/gtc/ulp.inl | 362 +- vendor/glm/gtc/vec1.hpp | 14 +- vendor/glm/gtc/vec1.inl | 2 - vendor/glm/gtx/associated_min_max.hpp | 14 +- vendor/glm/gtx/associated_min_max.inl | 15 +- vendor/glm/gtx/bit.hpp | 6 +- vendor/glm/gtx/bit.inl | 11 +- vendor/glm/gtx/closest_point.hpp | 4 +- vendor/glm/gtx/closest_point.inl | 1 - vendor/glm/gtx/color_encoding.hpp | 4 +- vendor/glm/gtx/color_encoding.inl | 1 - vendor/glm/gtx/color_space.hpp | 4 +- vendor/glm/gtx/color_space.inl | 18 +- vendor/glm/gtx/color_space_YCoCg.hpp | 4 +- vendor/glm/gtx/color_space_YCoCg.inl | 1 - vendor/glm/gtx/common.hpp | 4 +- vendor/glm/gtx/common.inl | 13 +- vendor/glm/gtx/compatibility.hpp | 15 +- vendor/glm/gtx/compatibility.inl | 16 +- vendor/glm/gtx/component_wise.hpp | 14 +- vendor/glm/gtx/component_wise.inl | 31 +- vendor/glm/gtx/dual_quaternion.hpp | 34 +- vendor/glm/gtx/dual_quaternion.inl | 59 +- vendor/glm/gtx/easing.hpp | 8 +- vendor/glm/gtx/easing.inl | 3 +- vendor/glm/gtx/euler_angles.hpp | 28 +- vendor/glm/gtx/euler_angles.inl | 91 +- vendor/glm/gtx/extend.hpp | 4 +- vendor/glm/gtx/extend.inl | 1 - vendor/glm/gtx/extended_min_max.hpp | 103 +- vendor/glm/gtx/extended_min_max.inl | 81 - vendor/glm/gtx/exterior_product.hpp | 6 +- vendor/glm/gtx/exterior_product.inl | 9 +- vendor/glm/gtx/fast_exponential.hpp | 4 +- vendor/glm/gtx/fast_exponential.inl | 13 +- vendor/glm/gtx/fast_square_root.hpp | 12 +- vendor/glm/gtx/fast_square_root.inl | 16 +- vendor/glm/gtx/fast_trigonometry.hpp | 4 +- vendor/glm/gtx/fast_trigonometry.inl | 19 +- ...loat_notmalize.inl => float_normalize.inl} | 1 - vendor/glm/gtx/functions.hpp | 4 +- vendor/glm/gtx/functions.inl | 1 - vendor/glm/gtx/gradient_paint.hpp | 4 +- vendor/glm/gtx/gradient_paint.inl | 1 - vendor/glm/gtx/handed_coordinate_space.hpp | 6 +- vendor/glm/gtx/handed_coordinate_space.inl | 1 - vendor/glm/gtx/hash.hpp | 90 +- vendor/glm/gtx/hash.inl | 60 +- vendor/glm/gtx/integer.hpp | 4 +- vendor/glm/gtx/integer.inl | 11 +- vendor/glm/gtx/intersect.hpp | 6 +- vendor/glm/gtx/intersect.inl | 83 +- vendor/glm/gtx/io.hpp | 67 +- vendor/glm/gtx/io.inl | 20 +- vendor/glm/gtx/iteration.hpp | 87 + vendor/glm/gtx/iteration.inl | 116 + vendor/glm/gtx/log_base.hpp | 4 +- vendor/glm/gtx/log_base.inl | 2 - vendor/glm/gtx/matrix_cross_product.hpp | 4 +- vendor/glm/gtx/matrix_cross_product.inl | 1 - vendor/glm/gtx/matrix_decompose.hpp | 14 +- vendor/glm/gtx/matrix_decompose.inl | 59 +- vendor/glm/gtx/matrix_factorisation.hpp | 8 +- vendor/glm/gtx/matrix_factorisation.inl | 7 +- vendor/glm/gtx/matrix_interpolation.hpp | 19 +- vendor/glm/gtx/matrix_interpolation.inl | 68 +- vendor/glm/gtx/matrix_major_storage.hpp | 4 +- vendor/glm/gtx/matrix_major_storage.inl | 1 - vendor/glm/gtx/matrix_operation.hpp | 19 +- vendor/glm/gtx/matrix_operation.inl | 60 +- vendor/glm/gtx/matrix_query.hpp | 4 +- vendor/glm/gtx/matrix_query.inl | 27 +- vendor/glm/gtx/matrix_transform_2d.hpp | 4 +- vendor/glm/gtx/matrix_transform_2d.inl | 1 - vendor/glm/gtx/mixed_product.hpp | 4 +- vendor/glm/gtx/mixed_product.inl | 1 - vendor/glm/gtx/norm.hpp | 17 +- vendor/glm/gtx/norm.inl | 25 +- vendor/glm/gtx/normal.hpp | 4 +- vendor/glm/gtx/normal.inl | 1 - vendor/glm/gtx/normalize_dot.hpp | 6 +- vendor/glm/gtx/normalize_dot.inl | 1 - vendor/glm/gtx/number_precision.hpp | 19 +- vendor/glm/gtx/number_precision.inl | 7 - vendor/glm/gtx/optimum_pow.hpp | 8 +- vendor/glm/gtx/optimum_pow.inl | 1 - vendor/glm/gtx/orthonormalize.hpp | 4 +- vendor/glm/gtx/orthonormalize.inl | 1 - vendor/glm/gtx/pca.hpp | 112 + vendor/glm/gtx/pca.inl | 342 ++ vendor/glm/gtx/perpendicular.hpp | 4 +- vendor/glm/gtx/perpendicular.inl | 1 - vendor/glm/gtx/polar_coordinates.hpp | 6 +- vendor/glm/gtx/polar_coordinates.inl | 1 - vendor/glm/gtx/projection.hpp | 7 +- vendor/glm/gtx/projection.inl | 1 - vendor/glm/gtx/quaternion.hpp | 126 +- vendor/glm/gtx/quaternion.inl | 145 +- vendor/glm/gtx/range.hpp | 6 +- vendor/glm/gtx/raw_data.hpp | 6 +- vendor/glm/gtx/raw_data.inl | 2 +- vendor/glm/gtx/rotate_normalized_axis.hpp | 8 +- vendor/glm/gtx/rotate_normalized_axis.inl | 7 +- vendor/glm/gtx/rotate_vector.hpp | 8 +- vendor/glm/gtx/rotate_vector.inl | 5 +- vendor/glm/gtx/scalar_multiplication.hpp | 17 +- vendor/glm/gtx/scalar_relational.hpp | 8 +- vendor/glm/gtx/scalar_relational.inl | 5 +- vendor/glm/gtx/spline.hpp | 4 +- vendor/glm/gtx/spline.inl | 1 - vendor/glm/gtx/std_based_type.hpp | 4 +- vendor/glm/gtx/std_based_type.inl | 1 - vendor/glm/gtx/string_cast.hpp | 11 +- vendor/glm/gtx/string_cast.inl | 59 +- vendor/glm/gtx/structured_bindings.hpp | 92 + vendor/glm/gtx/structured_bindings.inl | 55 + vendor/glm/gtx/texture.hpp | 4 +- vendor/glm/gtx/texture.inl | 3 +- vendor/glm/gtx/transform.hpp | 4 +- vendor/glm/gtx/transform.inl | 1 - vendor/glm/gtx/transform2.hpp | 16 +- vendor/glm/gtx/transform2.inl | 22 +- vendor/glm/gtx/type_aligned.hpp | 11 +- vendor/glm/gtx/type_aligned.inl | 1 - vendor/glm/gtx/type_trait.hpp | 8 +- vendor/glm/gtx/type_trait.inl | 9 +- vendor/glm/gtx/vec_swizzle.hpp | 985 +++-- vendor/glm/gtx/vector_angle.hpp | 4 +- vendor/glm/gtx/vector_angle.inl | 12 +- vendor/glm/gtx/vector_query.hpp | 6 +- vendor/glm/gtx/vector_query.inl | 1 - vendor/glm/gtx/wrap.hpp | 26 +- vendor/glm/gtx/wrap.inl | 52 - vendor/glm/integer.hpp | 9 +- vendor/glm/mat2x2.hpp | 53 +- vendor/glm/mat2x3.hpp | 33 +- vendor/glm/mat2x4.hpp | 32 +- vendor/glm/mat3x2.hpp | 32 +- vendor/glm/mat3x3.hpp | 54 +- vendor/glm/mat3x4.hpp | 33 +- vendor/glm/mat4x2.hpp | 32 +- vendor/glm/mat4x3.hpp | 33 +- vendor/glm/mat4x4.hpp | 53 +- vendor/glm/matrix.hpp | 133 +- vendor/glm/packing.hpp | 9 +- vendor/glm/simd/common.h | 43 +- vendor/glm/simd/exponential.h | 4 +- vendor/glm/simd/geometric.h | 24 +- vendor/glm/simd/integer.h | 0 vendor/glm/simd/matrix.h | 12 + vendor/glm/simd/neon.h | 155 + vendor/glm/simd/packing.h | 0 vendor/glm/simd/platform.h | 394 +- vendor/glm/simd/trigonometric.h | 0 vendor/glm/simd/vector_relational.h | 0 vendor/glm/trigonometric.hpp | 8 +- vendor/glm/vec2.hpp | 14 +- vendor/glm/vec3.hpp | 14 +- vendor/glm/vec4.hpp | 13 +- vendor/glm/vector_relational.hpp | 24 +- 451 files changed, 29031 insertions(+), 16892 deletions(-) mode change 100755 => 100644 vendor/glm/CMakeLists.txt mode change 100755 => 100644 vendor/glm/common.hpp mode change 100755 => 100644 vendor/glm/detail/_features.hpp mode change 100755 => 100644 vendor/glm/detail/_fixes.hpp mode change 100755 => 100644 vendor/glm/detail/_noise.hpp mode change 100755 => 100644 vendor/glm/detail/_swizzle.hpp mode change 100755 => 100644 vendor/glm/detail/_swizzle_func.hpp mode change 100755 => 100644 vendor/glm/detail/_vectorize.hpp create mode 100644 vendor/glm/detail/compute_common.hpp create mode 100644 vendor/glm/detail/compute_vector_decl.hpp mode change 100755 => 100644 vendor/glm/detail/compute_vector_relational.hpp delete mode 100755 vendor/glm/detail/dummy.cpp mode change 100755 => 100644 vendor/glm/detail/func_common.inl mode change 100755 => 100644 vendor/glm/detail/func_common_simd.inl mode change 100755 => 100644 vendor/glm/detail/func_exponential.inl mode change 100755 => 100644 vendor/glm/detail/func_exponential_simd.inl mode change 100755 => 100644 vendor/glm/detail/func_geometric.inl mode change 100755 => 100644 vendor/glm/detail/func_geometric_simd.inl mode change 100755 => 100644 vendor/glm/detail/func_integer.inl mode change 100755 => 100644 vendor/glm/detail/func_integer_simd.inl mode change 100755 => 100644 vendor/glm/detail/func_matrix.inl mode change 100755 => 100644 vendor/glm/detail/func_matrix_simd.inl mode change 100755 => 100644 vendor/glm/detail/func_packing.inl mode change 100755 => 100644 vendor/glm/detail/func_packing_simd.inl mode change 100755 => 100644 vendor/glm/detail/func_trigonometric.inl mode change 100755 => 100644 vendor/glm/detail/func_trigonometric_simd.inl mode change 100755 => 100644 vendor/glm/detail/func_vector_relational.inl mode change 100755 => 100644 vendor/glm/detail/func_vector_relational_simd.inl mode change 100755 => 100644 vendor/glm/detail/glm.cpp mode change 100755 => 100644 vendor/glm/detail/qualifier.hpp mode change 100755 => 100644 vendor/glm/detail/setup.hpp mode change 100755 => 100644 vendor/glm/detail/type_float.hpp delete mode 100755 vendor/glm/detail/type_gentype.hpp delete mode 100755 vendor/glm/detail/type_gentype.inl mode change 100755 => 100644 vendor/glm/detail/type_half.hpp mode change 100755 => 100644 vendor/glm/detail/type_half.inl delete mode 100755 vendor/glm/detail/type_int.hpp delete mode 100755 vendor/glm/detail/type_mat.hpp delete mode 100755 vendor/glm/detail/type_mat.inl mode change 100755 => 100644 vendor/glm/detail/type_mat2x2.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat2x2.inl mode change 100755 => 100644 vendor/glm/detail/type_mat2x3.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat2x3.inl mode change 100755 => 100644 vendor/glm/detail/type_mat2x4.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat2x4.inl mode change 100755 => 100644 vendor/glm/detail/type_mat3x2.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat3x2.inl mode change 100755 => 100644 vendor/glm/detail/type_mat3x3.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat3x3.inl mode change 100755 => 100644 vendor/glm/detail/type_mat3x4.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat3x4.inl mode change 100755 => 100644 vendor/glm/detail/type_mat4x2.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat4x2.inl mode change 100755 => 100644 vendor/glm/detail/type_mat4x3.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat4x3.inl mode change 100755 => 100644 vendor/glm/detail/type_mat4x4.hpp mode change 100755 => 100644 vendor/glm/detail/type_mat4x4.inl mode change 100755 => 100644 vendor/glm/detail/type_mat4x4_simd.inl create mode 100644 vendor/glm/detail/type_quat.hpp create mode 100644 vendor/glm/detail/type_quat.inl create mode 100644 vendor/glm/detail/type_quat_simd.inl delete mode 100755 vendor/glm/detail/type_vec.hpp delete mode 100755 vendor/glm/detail/type_vec.inl mode change 100755 => 100644 vendor/glm/detail/type_vec1.hpp mode change 100755 => 100644 vendor/glm/detail/type_vec1.inl mode change 100755 => 100644 vendor/glm/detail/type_vec2.hpp mode change 100755 => 100644 vendor/glm/detail/type_vec2.inl mode change 100755 => 100644 vendor/glm/detail/type_vec3.hpp mode change 100755 => 100644 vendor/glm/detail/type_vec3.inl mode change 100755 => 100644 vendor/glm/detail/type_vec4.hpp mode change 100755 => 100644 vendor/glm/detail/type_vec4.inl delete mode 100755 vendor/glm/detail/type_vec4_simd.inl create mode 100644 vendor/glm/detail/type_vec_simd.inl mode change 100755 => 100644 vendor/glm/exponential.hpp mode change 100755 => 100644 vendor/glm/ext.hpp create mode 100644 vendor/glm/ext/_matrix_vectorize.hpp create mode 100644 vendor/glm/ext/matrix_clip_space.hpp create mode 100644 vendor/glm/ext/matrix_clip_space.inl create mode 100644 vendor/glm/ext/matrix_common.hpp create mode 100644 vendor/glm/ext/matrix_common.inl create mode 100644 vendor/glm/ext/matrix_double2x2.hpp create mode 100644 vendor/glm/ext/matrix_double2x2_precision.hpp create mode 100644 vendor/glm/ext/matrix_double2x3.hpp create mode 100644 vendor/glm/ext/matrix_double2x3_precision.hpp create mode 100644 vendor/glm/ext/matrix_double2x4.hpp create mode 100644 vendor/glm/ext/matrix_double2x4_precision.hpp create mode 100644 vendor/glm/ext/matrix_double3x2.hpp create mode 100644 vendor/glm/ext/matrix_double3x2_precision.hpp create mode 100644 vendor/glm/ext/matrix_double3x3.hpp create mode 100644 vendor/glm/ext/matrix_double3x3_precision.hpp create mode 100644 vendor/glm/ext/matrix_double3x4.hpp create mode 100644 vendor/glm/ext/matrix_double3x4_precision.hpp create mode 100644 vendor/glm/ext/matrix_double4x2.hpp create mode 100644 vendor/glm/ext/matrix_double4x2_precision.hpp create mode 100644 vendor/glm/ext/matrix_double4x3.hpp create mode 100644 vendor/glm/ext/matrix_double4x3_precision.hpp create mode 100644 vendor/glm/ext/matrix_double4x4.hpp create mode 100644 vendor/glm/ext/matrix_double4x4_precision.hpp create mode 100644 vendor/glm/ext/matrix_float2x2.hpp create mode 100644 vendor/glm/ext/matrix_float2x2_precision.hpp create mode 100644 vendor/glm/ext/matrix_float2x3.hpp create mode 100644 vendor/glm/ext/matrix_float2x3_precision.hpp create mode 100644 vendor/glm/ext/matrix_float2x4.hpp create mode 100644 vendor/glm/ext/matrix_float2x4_precision.hpp create mode 100644 vendor/glm/ext/matrix_float3x2.hpp create mode 100644 vendor/glm/ext/matrix_float3x2_precision.hpp create mode 100644 vendor/glm/ext/matrix_float3x3.hpp create mode 100644 vendor/glm/ext/matrix_float3x3_precision.hpp create mode 100644 vendor/glm/ext/matrix_float3x4.hpp create mode 100644 vendor/glm/ext/matrix_float3x4_precision.hpp create mode 100644 vendor/glm/ext/matrix_float4x2.hpp create mode 100644 vendor/glm/ext/matrix_float4x2_precision.hpp create mode 100644 vendor/glm/ext/matrix_float4x3.hpp create mode 100644 vendor/glm/ext/matrix_float4x3_precision.hpp create mode 100644 vendor/glm/ext/matrix_float4x4.hpp create mode 100644 vendor/glm/ext/matrix_float4x4_precision.hpp create mode 100644 vendor/glm/ext/matrix_int2x2.hpp create mode 100644 vendor/glm/ext/matrix_int2x2_sized.hpp create mode 100644 vendor/glm/ext/matrix_int2x3.hpp create mode 100644 vendor/glm/ext/matrix_int2x3_sized.hpp create mode 100644 vendor/glm/ext/matrix_int2x4.hpp create mode 100644 vendor/glm/ext/matrix_int2x4_sized.hpp create mode 100644 vendor/glm/ext/matrix_int3x2.hpp create mode 100644 vendor/glm/ext/matrix_int3x2_sized.hpp create mode 100644 vendor/glm/ext/matrix_int3x3.hpp create mode 100644 vendor/glm/ext/matrix_int3x3_sized.hpp create mode 100644 vendor/glm/ext/matrix_int3x4.hpp create mode 100644 vendor/glm/ext/matrix_int3x4_sized.hpp create mode 100644 vendor/glm/ext/matrix_int4x2.hpp create mode 100644 vendor/glm/ext/matrix_int4x2_sized.hpp create mode 100644 vendor/glm/ext/matrix_int4x3.hpp create mode 100644 vendor/glm/ext/matrix_int4x3_sized.hpp create mode 100644 vendor/glm/ext/matrix_int4x4.hpp create mode 100644 vendor/glm/ext/matrix_int4x4_sized.hpp create mode 100644 vendor/glm/ext/matrix_integer.hpp create mode 100644 vendor/glm/ext/matrix_integer.inl create mode 100644 vendor/glm/ext/matrix_projection.hpp create mode 100644 vendor/glm/ext/matrix_projection.inl create mode 100644 vendor/glm/ext/matrix_relational.hpp create mode 100644 vendor/glm/ext/matrix_relational.inl create mode 100644 vendor/glm/ext/matrix_transform.hpp create mode 100644 vendor/glm/ext/matrix_transform.inl create mode 100644 vendor/glm/ext/matrix_uint2x2.hpp create mode 100644 vendor/glm/ext/matrix_uint2x2_sized.hpp create mode 100644 vendor/glm/ext/matrix_uint2x3.hpp create mode 100644 vendor/glm/ext/matrix_uint2x3_sized.hpp create mode 100644 vendor/glm/ext/matrix_uint2x4.hpp create mode 100644 vendor/glm/ext/matrix_uint2x4_sized.hpp create mode 100644 vendor/glm/ext/matrix_uint3x2.hpp create mode 100644 vendor/glm/ext/matrix_uint3x2_sized.hpp create mode 100644 vendor/glm/ext/matrix_uint3x3.hpp create mode 100644 vendor/glm/ext/matrix_uint3x3_sized.hpp create mode 100644 vendor/glm/ext/matrix_uint3x4.hpp create mode 100644 vendor/glm/ext/matrix_uint3x4_sized.hpp create mode 100644 vendor/glm/ext/matrix_uint4x2.hpp create mode 100644 vendor/glm/ext/matrix_uint4x2_sized.hpp create mode 100644 vendor/glm/ext/matrix_uint4x3.hpp create mode 100644 vendor/glm/ext/matrix_uint4x3_sized.hpp create mode 100644 vendor/glm/ext/matrix_uint4x4.hpp create mode 100644 vendor/glm/ext/matrix_uint4x4_sized.hpp create mode 100644 vendor/glm/ext/quaternion_common.hpp create mode 100644 vendor/glm/ext/quaternion_common.inl create mode 100644 vendor/glm/ext/quaternion_common_simd.inl create mode 100644 vendor/glm/ext/quaternion_double.hpp create mode 100644 vendor/glm/ext/quaternion_double_precision.hpp create mode 100644 vendor/glm/ext/quaternion_exponential.hpp create mode 100644 vendor/glm/ext/quaternion_exponential.inl create mode 100644 vendor/glm/ext/quaternion_float.hpp create mode 100644 vendor/glm/ext/quaternion_float_precision.hpp create mode 100644 vendor/glm/ext/quaternion_geometric.hpp create mode 100644 vendor/glm/ext/quaternion_geometric.inl create mode 100644 vendor/glm/ext/quaternion_relational.hpp create mode 100644 vendor/glm/ext/quaternion_relational.inl create mode 100644 vendor/glm/ext/quaternion_transform.hpp create mode 100644 vendor/glm/ext/quaternion_transform.inl create mode 100644 vendor/glm/ext/quaternion_trigonometric.hpp create mode 100644 vendor/glm/ext/quaternion_trigonometric.inl create mode 100644 vendor/glm/ext/scalar_common.hpp create mode 100644 vendor/glm/ext/scalar_common.inl create mode 100644 vendor/glm/ext/scalar_constants.hpp create mode 100644 vendor/glm/ext/scalar_constants.inl create mode 100644 vendor/glm/ext/scalar_int_sized.hpp create mode 100644 vendor/glm/ext/scalar_integer.hpp create mode 100644 vendor/glm/ext/scalar_integer.inl create mode 100644 vendor/glm/ext/scalar_packing.hpp rename vendor/glm/ext/{vec1.inl => scalar_packing.inl} (100%) mode change 100755 => 100644 create mode 100644 vendor/glm/ext/scalar_reciprocal.hpp create mode 100644 vendor/glm/ext/scalar_reciprocal.inl create mode 100644 vendor/glm/ext/scalar_relational.hpp create mode 100644 vendor/glm/ext/scalar_relational.inl create mode 100644 vendor/glm/ext/scalar_uint_sized.hpp create mode 100644 vendor/glm/ext/scalar_ulp.hpp create mode 100644 vendor/glm/ext/scalar_ulp.inl delete mode 100755 vendor/glm/ext/vec1.hpp create mode 100644 vendor/glm/ext/vector_bool1.hpp create mode 100644 vendor/glm/ext/vector_bool1_precision.hpp create mode 100644 vendor/glm/ext/vector_bool2.hpp create mode 100644 vendor/glm/ext/vector_bool2_precision.hpp create mode 100644 vendor/glm/ext/vector_bool3.hpp create mode 100644 vendor/glm/ext/vector_bool3_precision.hpp create mode 100644 vendor/glm/ext/vector_bool4.hpp create mode 100644 vendor/glm/ext/vector_bool4_precision.hpp create mode 100644 vendor/glm/ext/vector_common.hpp create mode 100644 vendor/glm/ext/vector_common.inl create mode 100644 vendor/glm/ext/vector_double1.hpp create mode 100644 vendor/glm/ext/vector_double1_precision.hpp create mode 100644 vendor/glm/ext/vector_double2.hpp create mode 100644 vendor/glm/ext/vector_double2_precision.hpp create mode 100644 vendor/glm/ext/vector_double3.hpp create mode 100644 vendor/glm/ext/vector_double3_precision.hpp create mode 100644 vendor/glm/ext/vector_double4.hpp create mode 100644 vendor/glm/ext/vector_double4_precision.hpp create mode 100644 vendor/glm/ext/vector_float1.hpp create mode 100644 vendor/glm/ext/vector_float1_precision.hpp create mode 100644 vendor/glm/ext/vector_float2.hpp create mode 100644 vendor/glm/ext/vector_float2_precision.hpp create mode 100644 vendor/glm/ext/vector_float3.hpp create mode 100644 vendor/glm/ext/vector_float3_precision.hpp create mode 100644 vendor/glm/ext/vector_float4.hpp create mode 100644 vendor/glm/ext/vector_float4_precision.hpp create mode 100644 vendor/glm/ext/vector_int1.hpp create mode 100644 vendor/glm/ext/vector_int1_sized.hpp create mode 100644 vendor/glm/ext/vector_int2.hpp create mode 100644 vendor/glm/ext/vector_int2_sized.hpp create mode 100644 vendor/glm/ext/vector_int3.hpp create mode 100644 vendor/glm/ext/vector_int3_sized.hpp create mode 100644 vendor/glm/ext/vector_int4.hpp create mode 100644 vendor/glm/ext/vector_int4_sized.hpp create mode 100644 vendor/glm/ext/vector_integer.hpp create mode 100644 vendor/glm/ext/vector_integer.inl create mode 100644 vendor/glm/ext/vector_packing.hpp create mode 100644 vendor/glm/ext/vector_packing.inl create mode 100644 vendor/glm/ext/vector_reciprocal.hpp create mode 100644 vendor/glm/ext/vector_reciprocal.inl mode change 100755 => 100644 vendor/glm/ext/vector_relational.hpp mode change 100755 => 100644 vendor/glm/ext/vector_relational.inl create mode 100644 vendor/glm/ext/vector_uint1.hpp create mode 100644 vendor/glm/ext/vector_uint1_sized.hpp create mode 100644 vendor/glm/ext/vector_uint2.hpp create mode 100644 vendor/glm/ext/vector_uint2_sized.hpp create mode 100644 vendor/glm/ext/vector_uint3.hpp create mode 100644 vendor/glm/ext/vector_uint3_sized.hpp create mode 100644 vendor/glm/ext/vector_uint4.hpp create mode 100644 vendor/glm/ext/vector_uint4_sized.hpp create mode 100644 vendor/glm/ext/vector_ulp.hpp create mode 100644 vendor/glm/ext/vector_ulp.inl mode change 100755 => 100644 vendor/glm/fwd.hpp mode change 100755 => 100644 vendor/glm/geometric.hpp create mode 100644 vendor/glm/glm.cppm mode change 100755 => 100644 vendor/glm/glm.hpp mode change 100755 => 100644 vendor/glm/gtc/bitfield.hpp mode change 100755 => 100644 vendor/glm/gtc/bitfield.inl mode change 100755 => 100644 vendor/glm/gtc/color_space.hpp mode change 100755 => 100644 vendor/glm/gtc/color_space.inl mode change 100755 => 100644 vendor/glm/gtc/constants.hpp mode change 100755 => 100644 vendor/glm/gtc/constants.inl mode change 100755 => 100644 vendor/glm/gtc/epsilon.hpp mode change 100755 => 100644 vendor/glm/gtc/epsilon.inl mode change 100755 => 100644 vendor/glm/gtc/integer.hpp mode change 100755 => 100644 vendor/glm/gtc/integer.inl mode change 100755 => 100644 vendor/glm/gtc/matrix_access.hpp mode change 100755 => 100644 vendor/glm/gtc/matrix_access.inl mode change 100755 => 100644 vendor/glm/gtc/matrix_integer.hpp mode change 100755 => 100644 vendor/glm/gtc/matrix_inverse.hpp mode change 100755 => 100644 vendor/glm/gtc/matrix_inverse.inl mode change 100755 => 100644 vendor/glm/gtc/matrix_transform.hpp mode change 100755 => 100644 vendor/glm/gtc/matrix_transform.inl mode change 100755 => 100644 vendor/glm/gtc/noise.hpp mode change 100755 => 100644 vendor/glm/gtc/noise.inl mode change 100755 => 100644 vendor/glm/gtc/packing.hpp mode change 100755 => 100644 vendor/glm/gtc/packing.inl mode change 100755 => 100644 vendor/glm/gtc/quaternion.hpp mode change 100755 => 100644 vendor/glm/gtc/quaternion.inl mode change 100755 => 100644 vendor/glm/gtc/quaternion_simd.inl mode change 100755 => 100644 vendor/glm/gtc/random.hpp mode change 100755 => 100644 vendor/glm/gtc/random.inl mode change 100755 => 100644 vendor/glm/gtc/reciprocal.hpp delete mode 100755 vendor/glm/gtc/reciprocal.inl mode change 100755 => 100644 vendor/glm/gtc/round.hpp mode change 100755 => 100644 vendor/glm/gtc/round.inl mode change 100755 => 100644 vendor/glm/gtc/type_aligned.hpp mode change 100755 => 100644 vendor/glm/gtc/type_precision.hpp mode change 100755 => 100644 vendor/glm/gtc/type_precision.inl mode change 100755 => 100644 vendor/glm/gtc/type_ptr.hpp mode change 100755 => 100644 vendor/glm/gtc/type_ptr.inl mode change 100755 => 100644 vendor/glm/gtc/ulp.hpp mode change 100755 => 100644 vendor/glm/gtc/ulp.inl mode change 100755 => 100644 vendor/glm/gtc/vec1.hpp delete mode 100755 vendor/glm/gtc/vec1.inl mode change 100755 => 100644 vendor/glm/gtx/associated_min_max.hpp mode change 100755 => 100644 vendor/glm/gtx/associated_min_max.inl mode change 100755 => 100644 vendor/glm/gtx/bit.hpp mode change 100755 => 100644 vendor/glm/gtx/bit.inl mode change 100755 => 100644 vendor/glm/gtx/closest_point.hpp mode change 100755 => 100644 vendor/glm/gtx/closest_point.inl mode change 100755 => 100644 vendor/glm/gtx/color_encoding.hpp mode change 100755 => 100644 vendor/glm/gtx/color_encoding.inl mode change 100755 => 100644 vendor/glm/gtx/color_space.hpp mode change 100755 => 100644 vendor/glm/gtx/color_space.inl mode change 100755 => 100644 vendor/glm/gtx/color_space_YCoCg.hpp mode change 100755 => 100644 vendor/glm/gtx/color_space_YCoCg.inl mode change 100755 => 100644 vendor/glm/gtx/common.hpp mode change 100755 => 100644 vendor/glm/gtx/common.inl mode change 100755 => 100644 vendor/glm/gtx/compatibility.hpp mode change 100755 => 100644 vendor/glm/gtx/compatibility.inl mode change 100755 => 100644 vendor/glm/gtx/component_wise.hpp mode change 100755 => 100644 vendor/glm/gtx/component_wise.inl mode change 100755 => 100644 vendor/glm/gtx/dual_quaternion.hpp mode change 100755 => 100644 vendor/glm/gtx/dual_quaternion.inl mode change 100755 => 100644 vendor/glm/gtx/easing.hpp mode change 100755 => 100644 vendor/glm/gtx/easing.inl mode change 100755 => 100644 vendor/glm/gtx/euler_angles.hpp mode change 100755 => 100644 vendor/glm/gtx/euler_angles.inl mode change 100755 => 100644 vendor/glm/gtx/extend.hpp mode change 100755 => 100644 vendor/glm/gtx/extend.inl mode change 100755 => 100644 vendor/glm/gtx/extended_min_max.hpp mode change 100755 => 100644 vendor/glm/gtx/extended_min_max.inl mode change 100755 => 100644 vendor/glm/gtx/exterior_product.hpp mode change 100755 => 100644 vendor/glm/gtx/exterior_product.inl mode change 100755 => 100644 vendor/glm/gtx/fast_exponential.hpp mode change 100755 => 100644 vendor/glm/gtx/fast_exponential.inl mode change 100755 => 100644 vendor/glm/gtx/fast_square_root.hpp mode change 100755 => 100644 vendor/glm/gtx/fast_square_root.inl mode change 100755 => 100644 vendor/glm/gtx/fast_trigonometry.hpp mode change 100755 => 100644 vendor/glm/gtx/fast_trigonometry.inl rename vendor/glm/gtx/{float_notmalize.inl => float_normalize.inl} (88%) mode change 100755 => 100644 mode change 100755 => 100644 vendor/glm/gtx/functions.hpp mode change 100755 => 100644 vendor/glm/gtx/functions.inl mode change 100755 => 100644 vendor/glm/gtx/gradient_paint.hpp mode change 100755 => 100644 vendor/glm/gtx/gradient_paint.inl mode change 100755 => 100644 vendor/glm/gtx/handed_coordinate_space.hpp mode change 100755 => 100644 vendor/glm/gtx/handed_coordinate_space.inl mode change 100755 => 100644 vendor/glm/gtx/hash.hpp mode change 100755 => 100644 vendor/glm/gtx/hash.inl mode change 100755 => 100644 vendor/glm/gtx/integer.hpp mode change 100755 => 100644 vendor/glm/gtx/integer.inl mode change 100755 => 100644 vendor/glm/gtx/intersect.hpp mode change 100755 => 100644 vendor/glm/gtx/intersect.inl mode change 100755 => 100644 vendor/glm/gtx/io.hpp mode change 100755 => 100644 vendor/glm/gtx/io.inl create mode 100644 vendor/glm/gtx/iteration.hpp create mode 100644 vendor/glm/gtx/iteration.inl mode change 100755 => 100644 vendor/glm/gtx/log_base.hpp mode change 100755 => 100644 vendor/glm/gtx/log_base.inl mode change 100755 => 100644 vendor/glm/gtx/matrix_cross_product.hpp mode change 100755 => 100644 vendor/glm/gtx/matrix_cross_product.inl mode change 100755 => 100644 vendor/glm/gtx/matrix_decompose.hpp mode change 100755 => 100644 vendor/glm/gtx/matrix_decompose.inl mode change 100755 => 100644 vendor/glm/gtx/matrix_factorisation.hpp mode change 100755 => 100644 vendor/glm/gtx/matrix_factorisation.inl mode change 100755 => 100644 vendor/glm/gtx/matrix_interpolation.hpp mode change 100755 => 100644 vendor/glm/gtx/matrix_interpolation.inl mode change 100755 => 100644 vendor/glm/gtx/matrix_major_storage.hpp mode change 100755 => 100644 vendor/glm/gtx/matrix_major_storage.inl mode change 100755 => 100644 vendor/glm/gtx/matrix_operation.hpp mode change 100755 => 100644 vendor/glm/gtx/matrix_operation.inl mode change 100755 => 100644 vendor/glm/gtx/matrix_query.hpp mode change 100755 => 100644 vendor/glm/gtx/matrix_query.inl mode change 100755 => 100644 vendor/glm/gtx/matrix_transform_2d.hpp mode change 100755 => 100644 vendor/glm/gtx/matrix_transform_2d.inl mode change 100755 => 100644 vendor/glm/gtx/mixed_product.hpp mode change 100755 => 100644 vendor/glm/gtx/mixed_product.inl mode change 100755 => 100644 vendor/glm/gtx/norm.hpp mode change 100755 => 100644 vendor/glm/gtx/norm.inl mode change 100755 => 100644 vendor/glm/gtx/normal.hpp mode change 100755 => 100644 vendor/glm/gtx/normal.inl mode change 100755 => 100644 vendor/glm/gtx/normalize_dot.hpp mode change 100755 => 100644 vendor/glm/gtx/normalize_dot.inl mode change 100755 => 100644 vendor/glm/gtx/number_precision.hpp delete mode 100755 vendor/glm/gtx/number_precision.inl mode change 100755 => 100644 vendor/glm/gtx/optimum_pow.hpp mode change 100755 => 100644 vendor/glm/gtx/optimum_pow.inl mode change 100755 => 100644 vendor/glm/gtx/orthonormalize.hpp mode change 100755 => 100644 vendor/glm/gtx/orthonormalize.inl create mode 100644 vendor/glm/gtx/pca.hpp create mode 100644 vendor/glm/gtx/pca.inl mode change 100755 => 100644 vendor/glm/gtx/perpendicular.hpp mode change 100755 => 100644 vendor/glm/gtx/perpendicular.inl mode change 100755 => 100644 vendor/glm/gtx/polar_coordinates.hpp mode change 100755 => 100644 vendor/glm/gtx/polar_coordinates.inl mode change 100755 => 100644 vendor/glm/gtx/projection.hpp mode change 100755 => 100644 vendor/glm/gtx/projection.inl mode change 100755 => 100644 vendor/glm/gtx/quaternion.hpp mode change 100755 => 100644 vendor/glm/gtx/quaternion.inl mode change 100755 => 100644 vendor/glm/gtx/range.hpp mode change 100755 => 100644 vendor/glm/gtx/raw_data.hpp mode change 100755 => 100644 vendor/glm/gtx/raw_data.inl mode change 100755 => 100644 vendor/glm/gtx/rotate_normalized_axis.hpp mode change 100755 => 100644 vendor/glm/gtx/rotate_normalized_axis.inl mode change 100755 => 100644 vendor/glm/gtx/rotate_vector.hpp mode change 100755 => 100644 vendor/glm/gtx/rotate_vector.inl mode change 100755 => 100644 vendor/glm/gtx/scalar_multiplication.hpp mode change 100755 => 100644 vendor/glm/gtx/scalar_relational.hpp mode change 100755 => 100644 vendor/glm/gtx/scalar_relational.inl mode change 100755 => 100644 vendor/glm/gtx/spline.hpp mode change 100755 => 100644 vendor/glm/gtx/spline.inl mode change 100755 => 100644 vendor/glm/gtx/std_based_type.hpp mode change 100755 => 100644 vendor/glm/gtx/std_based_type.inl mode change 100755 => 100644 vendor/glm/gtx/string_cast.hpp mode change 100755 => 100644 vendor/glm/gtx/string_cast.inl create mode 100644 vendor/glm/gtx/structured_bindings.hpp create mode 100644 vendor/glm/gtx/structured_bindings.inl mode change 100755 => 100644 vendor/glm/gtx/texture.hpp mode change 100755 => 100644 vendor/glm/gtx/texture.inl mode change 100755 => 100644 vendor/glm/gtx/transform.hpp mode change 100755 => 100644 vendor/glm/gtx/transform.inl mode change 100755 => 100644 vendor/glm/gtx/transform2.hpp mode change 100755 => 100644 vendor/glm/gtx/transform2.inl mode change 100755 => 100644 vendor/glm/gtx/type_aligned.hpp mode change 100755 => 100644 vendor/glm/gtx/type_aligned.inl mode change 100755 => 100644 vendor/glm/gtx/type_trait.hpp mode change 100755 => 100644 vendor/glm/gtx/type_trait.inl mode change 100755 => 100644 vendor/glm/gtx/vec_swizzle.hpp mode change 100755 => 100644 vendor/glm/gtx/vector_angle.hpp mode change 100755 => 100644 vendor/glm/gtx/vector_angle.inl mode change 100755 => 100644 vendor/glm/gtx/vector_query.hpp mode change 100755 => 100644 vendor/glm/gtx/vector_query.inl mode change 100755 => 100644 vendor/glm/gtx/wrap.hpp mode change 100755 => 100644 vendor/glm/gtx/wrap.inl mode change 100755 => 100644 vendor/glm/integer.hpp mode change 100755 => 100644 vendor/glm/mat2x2.hpp mode change 100755 => 100644 vendor/glm/mat2x3.hpp mode change 100755 => 100644 vendor/glm/mat2x4.hpp mode change 100755 => 100644 vendor/glm/mat3x2.hpp mode change 100755 => 100644 vendor/glm/mat3x3.hpp mode change 100755 => 100644 vendor/glm/mat3x4.hpp mode change 100755 => 100644 vendor/glm/mat4x2.hpp mode change 100755 => 100644 vendor/glm/mat4x3.hpp mode change 100755 => 100644 vendor/glm/mat4x4.hpp mode change 100755 => 100644 vendor/glm/matrix.hpp mode change 100755 => 100644 vendor/glm/packing.hpp mode change 100755 => 100644 vendor/glm/simd/common.h mode change 100755 => 100644 vendor/glm/simd/exponential.h mode change 100755 => 100644 vendor/glm/simd/geometric.h mode change 100755 => 100644 vendor/glm/simd/integer.h mode change 100755 => 100644 vendor/glm/simd/matrix.h create mode 100644 vendor/glm/simd/neon.h mode change 100755 => 100644 vendor/glm/simd/packing.h mode change 100755 => 100644 vendor/glm/simd/platform.h mode change 100755 => 100644 vendor/glm/simd/trigonometric.h mode change 100755 => 100644 vendor/glm/simd/vector_relational.h mode change 100755 => 100644 vendor/glm/trigonometric.hpp mode change 100755 => 100644 vendor/glm/vec2.hpp mode change 100755 => 100644 vendor/glm/vec3.hpp mode change 100755 => 100644 vendor/glm/vec4.hpp mode change 100755 => 100644 vendor/glm/vector_relational.hpp diff --git a/cmake/FindGLM.cmake b/cmake/FindGLM.cmake index 18e5393a53..6382e234e7 100644 --- a/cmake/FindGLM.cmake +++ b/cmake/FindGLM.cmake @@ -11,10 +11,10 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GLM DEFAULT_MSG GLM_INCLUDE_FILE GLM_INCLUDE_DIR) -if(GLM_FOUND AND NOT TARGET GLM::GLM) - add_library(GLM::GLM INTERFACE IMPORTED) +if(GLM_FOUND AND NOT TARGET glm::glm) + add_library(glm::glm INTERFACE IMPORTED) - set_target_properties(GLM::GLM PROPERTIES + set_target_properties(glm::glm PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLM_INCLUDE_DIR}" ) endif() diff --git a/src/libprojectM/MilkdropPreset/CMakeLists.txt b/src/libprojectM/MilkdropPreset/CMakeLists.txt index d6682ae8a1..dc18c000c7 100644 --- a/src/libprojectM/MilkdropPreset/CMakeLists.txt +++ b/src/libprojectM/MilkdropPreset/CMakeLists.txt @@ -139,7 +139,7 @@ target_link_libraries(MilkdropPreset libprojectM::API # For export header PUBLIC hlslparser - GLM::GLM + glm::glm ) if(BUILD_SHARED_LIBS) diff --git a/src/libprojectM/Renderer/CMakeLists.txt b/src/libprojectM/Renderer/CMakeLists.txt index 9de0a624f8..74f17e1c2d 100644 --- a/src/libprojectM/Renderer/CMakeLists.txt +++ b/src/libprojectM/Renderer/CMakeLists.txt @@ -85,7 +85,7 @@ target_link_libraries(Renderer PRIVATE libprojectM::API # For export header PUBLIC - GLM::GLM + glm::glm hlslparser stb_image glad diff --git a/src/libprojectM/UserSprites/CMakeLists.txt b/src/libprojectM/UserSprites/CMakeLists.txt index 33e14839ad..97814e2505 100644 --- a/src/libprojectM/UserSprites/CMakeLists.txt +++ b/src/libprojectM/UserSprites/CMakeLists.txt @@ -34,7 +34,7 @@ target_link_libraries(UserSprites libprojectM::API # For export header PUBLIC MilkdropPreset - GLM::GLM + glm::glm ) if(BUILD_SHARED_LIBS) diff --git a/src/sdl-test-ui/CMakeLists.txt b/src/sdl-test-ui/CMakeLists.txt index fb57d51c31..af875e04d4 100644 --- a/src/sdl-test-ui/CMakeLists.txt +++ b/src/sdl-test-ui/CMakeLists.txt @@ -19,7 +19,7 @@ add_executable(projectM-Test-UI target_link_libraries(projectM-Test-UI PRIVATE libprojectM::playlist - GLM::GLM + glm::glm SDL2::SDL2 SDL2::SDL2main ${CMAKE_DL_LIBS} diff --git a/vendor/glm/CMakeLists.txt b/vendor/glm/CMakeLists.txt old mode 100755 new mode 100644 index 66669c22ae..178d23abdf --- a/vendor/glm/CMakeLists.txt +++ b/vendor/glm/CMakeLists.txt @@ -1,50 +1,69 @@ +file(GLOB ROOT_SOURCE *.cpp) file(GLOB ROOT_INLINE *.inl) file(GLOB ROOT_HEADER *.hpp) file(GLOB ROOT_TEXT ../*.txt) file(GLOB ROOT_MD ../*.md) file(GLOB ROOT_NAT ../util/glm.natvis) +file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) +file(GLOB_RECURSE EXT_SOURCE ./ext/*.cpp) file(GLOB_RECURSE EXT_INLINE ./ext/*.inl) file(GLOB_RECURSE EXT_HEADER ./ext/*.hpp) +file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) +file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) +file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp) file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl) file(GLOB_RECURSE SIMD_HEADER ./simd/*.h) source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) - +source_group("Core Files" FILES ${CORE_SOURCE}) source_group("Core Files" FILES ${CORE_INLINE}) source_group("Core Files" FILES ${CORE_HEADER}) +source_group("EXT Files" FILES ${EXT_SOURCE}) source_group("EXT Files" FILES ${EXT_INLINE}) source_group("EXT Files" FILES ${EXT_HEADER}) +source_group("GTC Files" FILES ${GTC_SOURCE}) source_group("GTC Files" FILES ${GTC_INLINE}) source_group("GTC Files" FILES ${GTC_HEADER}) +source_group("GTX Files" FILES ${GTX_SOURCE}) source_group("GTX Files" FILES ${GTX_INLINE}) source_group("GTX Files" FILES ${GTX_HEADER}) +source_group("SIMD Files" FILES ${SIMD_SOURCE}) source_group("SIMD Files" FILES ${SIMD_INLINE}) source_group("SIMD Files" FILES ${SIMD_HEADER}) -add_library(glm INTERFACE - ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} - ${ROOT_INLINE} ${ROOT_HEADER} - ${CORE_INLINE} ${CORE_HEADER} - ${EXT_INLINE} ${EXT_HEADER} - ${GTC_INLINE} ${GTC_HEADER} - ${GTX_INLINE} ${GTX_HEADER} - ${SIMD_INLINE} ${SIMD_HEADER} - ) - -target_include_directories(glm - INTERFACE - "${CMAKE_CURRENT_SOURCE_DIR}/.." - ) - -add_library(GLM::GLM ALIAS glm) +add_library(glm-header-only INTERFACE) +add_library(glm::glm-header-only ALIAS glm-header-only) + +target_include_directories(glm-header-only INTERFACE + "$" + "$" +) + +if (GLM_BUILD_LIBRARY) + add_library(glm + ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER} + ) + add_library(glm::glm ALIAS glm) + target_link_libraries(glm PUBLIC glm-header-only) +else() + add_library(glm INTERFACE) + add_library(glm::glm ALIAS glm) + target_link_libraries(glm INTERFACE glm-header-only) +endif() diff --git a/vendor/glm/common.hpp b/vendor/glm/common.hpp old mode 100755 new mode 100644 index 89722845a8..b59657d549 --- a/vendor/glm/common.hpp +++ b/vendor/glm/common.hpp @@ -6,15 +6,15 @@ /// @defgroup core_func_common Common functions /// @ingroup core /// -/// Include to use these core features. +/// Provides GLSL common functions /// /// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. #pragma once -#include "detail/setup.hpp" #include "detail/qualifier.hpp" -#include "detail/type_int.hpp" #include "detail/_fixes.hpp" namespace glm @@ -28,9 +28,8 @@ namespace glm /// /// @see GLSL abs man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - /// @see qualifier template - GLM_FUNC_DECL genType abs(genType x); + GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x); /// Returns x if x >= 0; otherwise, it returns -x. /// @@ -41,7 +40,7 @@ namespace glm /// @see GLSL abs man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec abs(vec const& x); + GLM_FUNC_DECL GLM_CONSTEXPR vec abs(vec const& x); /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. /// @@ -52,7 +51,7 @@ namespace glm /// @see GLSL sign man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec sign(vec const& x); + GLM_FUNC_DECL GLM_CONSTEXPR vec sign(vec const& x); /// Returns a value equal to the nearest integer that is less then or equal to x. /// @@ -175,7 +174,7 @@ namespace glm /// @see GLSL min man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType min(genType x, genType y); + GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y); /// Returns y if y < x; otherwise, it returns x. /// @@ -186,7 +185,7 @@ namespace glm /// @see GLSL min man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec min(vec const& x, T y); + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, T y); /// Returns y if y < x; otherwise, it returns x. /// @@ -197,7 +196,7 @@ namespace glm /// @see GLSL min man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec min(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, vec const& y); /// Returns y if x < y; otherwise, it returns x. /// @@ -206,7 +205,7 @@ namespace glm /// @see GLSL max man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType max(genType x, genType y); + GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y); /// Returns y if x < y; otherwise, it returns x. /// @@ -217,7 +216,7 @@ namespace glm /// @see GLSL max man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec max(vec const& x, T y); + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, T y); /// Returns y if x < y; otherwise, it returns x. /// @@ -228,7 +227,7 @@ namespace glm /// @see GLSL max man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec max(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y); /// Returns min(max(x, minVal), maxVal) for each component in x /// using the floating-point values minVal and maxVal. @@ -238,7 +237,7 @@ namespace glm /// @see GLSL clamp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); + GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal); /// Returns min(max(x, minVal), maxVal) for each component in x /// using the floating-point values minVal and maxVal. @@ -250,7 +249,7 @@ namespace glm /// @see GLSL clamp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec clamp(vec const& x, T minVal, T maxVal); + GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal); /// Returns min(max(x, minVal), maxVal) for each component in x /// using the floating-point values minVal and maxVal. @@ -262,7 +261,7 @@ namespace glm /// @see GLSL clamp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec clamp(vec const& x, vec const& minVal, vec const& maxVal); + GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal); /// If genTypeU is a floating scalar or vector: /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of @@ -307,13 +306,13 @@ namespace glm /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. /// @endcode template - GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); + GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a); template - GLM_FUNC_DECL vec mix(vec const& x, vec const& y, vec const& a); + GLM_FUNC_DECL GLM_CONSTEXPR vec mix(vec const& x, vec const& y, vec const& a); template - GLM_FUNC_DECL vec mix(vec const& x, vec const& y, U a); + GLM_FUNC_DECL GLM_CONSTEXPR vec mix(vec const& x, vec const& y, U a); /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. /// @@ -405,7 +404,7 @@ namespace glm /// /// @see GLSL floatBitsToInt man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - GLM_FUNC_DECL int floatBitsToInt(float const& v); + GLM_FUNC_DECL int floatBitsToInt(float v); /// Returns a signed integer value representing /// the encoding of a floating-point value. The floatingpoint @@ -425,7 +424,7 @@ namespace glm /// /// @see GLSL floatBitsToUint man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - GLM_FUNC_DECL uint floatBitsToUint(float const& v); + GLM_FUNC_DECL uint floatBitsToUint(float v); /// Returns a unsigned integer value representing /// the encoding of a floating-point value. The floatingpoint @@ -447,7 +446,7 @@ namespace glm /// /// @see GLSL intBitsToFloat man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - GLM_FUNC_DECL float intBitsToFloat(int const& v); + GLM_FUNC_DECL float intBitsToFloat(int v); /// Returns a floating-point value corresponding to a signed /// integer encoding of a floating-point value. @@ -471,7 +470,7 @@ namespace glm /// /// @see GLSL uintBitsToFloat man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - GLM_FUNC_DECL float uintBitsToFloat(uint const& v); + GLM_FUNC_DECL float uintBitsToFloat(uint v); /// Returns a floating-point value corresponding to a /// unsigned integer encoding of a floating-point value. @@ -510,8 +509,11 @@ namespace glm /// /// @see GLSL frexp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType frexp(genType const& x, genIType& exp); + template + GLM_FUNC_DECL genType frexp(genType x, int& exp); + + template + GLM_FUNC_DECL vec frexp(vec const& v, vec& exp); /// Builds a floating-point number from x and the /// corresponding integral exponent of two in exp, returning: @@ -524,8 +526,11 @@ namespace glm /// /// @see GLSL ldexp man page; /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType ldexp(genType const& x, genIType const& exp); + template + GLM_FUNC_DECL genType ldexp(genType const& x, int const& exp); + + template + GLM_FUNC_DECL vec ldexp(vec const& v, vec const& exp); /// @} }//namespace glm diff --git a/vendor/glm/detail/_features.hpp b/vendor/glm/detail/_features.hpp old mode 100755 new mode 100644 index cee12722ce..b0cbe9ff02 --- a/vendor/glm/detail/_features.hpp +++ b/vendor/glm/detail/_features.hpp @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/_features.hpp - #pragma once // #define GLM_CXX98_EXCEPTIONS diff --git a/vendor/glm/detail/_fixes.hpp b/vendor/glm/detail/_fixes.hpp old mode 100755 new mode 100644 index c957562b4e..a503c7c0d0 --- a/vendor/glm/detail/_fixes.hpp +++ b/vendor/glm/detail/_fixes.hpp @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/_fixes.hpp - #include //! Workaround for compatibility with other libraries diff --git a/vendor/glm/detail/_noise.hpp b/vendor/glm/detail/_noise.hpp old mode 100755 new mode 100644 index 946148ce2f..5a874a0222 --- a/vendor/glm/detail/_noise.hpp +++ b/vendor/glm/detail/_noise.hpp @@ -1,11 +1,5 @@ -/// @ref core -/// @file glm/detail/_noise.hpp - #pragma once -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" #include "../common.hpp" namespace glm{ @@ -44,43 +38,43 @@ namespace detail template GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r) { - return T(1.79284291400159) - T(0.85373472095314) * r; + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; } template GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r) { - return T(1.79284291400159) - T(0.85373472095314) * r; + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; } template GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r) { - return T(1.79284291400159) - T(0.85373472095314) * r; + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; } template GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r) { - return T(1.79284291400159) - T(0.85373472095314) * r; + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; } template GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t) { - return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); } template GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t) { - return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); } template GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t) { - return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); } }//namespace detail }//namespace glm diff --git a/vendor/glm/detail/_swizzle.hpp b/vendor/glm/detail/_swizzle.hpp old mode 100755 new mode 100644 index 2609e79740..f7d59841ce --- a/vendor/glm/detail/_swizzle.hpp +++ b/vendor/glm/detail/_swizzle.hpp @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/_swizzle.hpp - #pragma once namespace glm{ @@ -11,8 +8,8 @@ namespace detail struct _swizzle_base0 { protected: - GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast(_buffer))[i]; } - GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER T& elem(int i){ return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER T const& elem(int i) const{ return (reinterpret_cast(_buffer))[i]; } // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. // The size 1 buffer is assumed to aligned to the actual members so that the @@ -20,25 +17,30 @@ namespace detail char _buffer[1]; }; - template + template struct _swizzle_base1 : public _swizzle_base0 { }; - template - struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> : public _swizzle_base0 + template + struct _swizzle_base1 : public _swizzle_base0 + { + }; + + template + struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, false> : public _swizzle_base0 { GLM_FUNC_QUALIFIER vec<2, T, Q> operator ()() const { return vec<2, T, Q>(this->elem(E0), this->elem(E1)); } }; - template - struct _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> : public _swizzle_base0 + template + struct _swizzle_base1<3, T, Q, E0,E1,E2,3, false> : public _swizzle_base0 { GLM_FUNC_QUALIFIER vec<3, T, Q> operator ()() const { return vec<3, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2)); } }; - template - struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> : public _swizzle_base0 + template + struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, false> : public _swizzle_base0 { GLM_FUNC_QUALIFIER vec<4, T, Q> operator ()() const { return vec<4, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } }; @@ -54,9 +56,35 @@ namespace detail DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles containing duplicate elements so that they cannot be used as r-values). */ - template + template struct _swizzle_base2 : public _swizzle_base1::value> { + struct op_equal + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e = t; } + }; + + struct op_minus + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e -= t; } + }; + + struct op_plus + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e += t; } + }; + + struct op_mul + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e *= t; } + }; + + struct op_div + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e /= t; } + }; + + public: GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) { for (int i = 0; i < N; ++i) @@ -66,51 +94,36 @@ namespace detail GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec const& that) { - struct op { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e = t; } - }; - _apply_op(that, op()); + _apply_op(that, op_equal()); return *this; } GLM_FUNC_QUALIFIER void operator -= (vec const& that) { - struct op { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e -= t; } - }; - _apply_op(that, op()); + _apply_op(that, op_minus()); } GLM_FUNC_QUALIFIER void operator += (vec const& that) { - struct op { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e += t; } - }; - _apply_op(that, op()); + _apply_op(that, op_plus()); } GLM_FUNC_QUALIFIER void operator *= (vec const& that) { - struct op { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e *= t; } - }; - _apply_op(that, op()); + _apply_op(that, op_mul()); } GLM_FUNC_QUALIFIER void operator /= (vec const& that) { - struct op { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e /= t; } - }; - _apply_op(that, op()); + _apply_op(that, op_div()); } - GLM_FUNC_QUALIFIER T& operator[](size_t i) + GLM_FUNC_QUALIFIER T& operator[](int i) { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } - GLM_FUNC_QUALIFIER T operator[](size_t i) const + GLM_FUNC_QUALIFIER T operator[](int i) const { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); @@ -118,7 +131,7 @@ namespace detail protected: template - GLM_FUNC_QUALIFIER void _apply_op(vec const& that, U op) + GLM_FUNC_QUALIFIER void _apply_op(vec const& that, const U& op) { // Make a copy of the data in this == &that. // The copier should optimize out the copy in cases where the function is @@ -132,21 +145,21 @@ namespace detail }; // Specialization for swizzles containing duplicate elements. These cannot be modified. - template + template struct _swizzle_base2 : public _swizzle_base1::value> { struct Stub {}; GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; } - GLM_FUNC_QUALIFIER T operator[] (size_t i) const + GLM_FUNC_QUALIFIER T operator[] (int i) const { const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } }; - template + template struct _swizzle : public _swizzle_base2 { typedef _swizzle_base2 base_type; @@ -159,8 +172,8 @@ namespace detail // // To prevent the C++ syntax from getting entirely overwhelming, define some alias macros // -#define GLM_SWIZZLE_TEMPLATE1 template -#define GLM_SWIZZLE_TEMPLATE2 template +#define GLM_SWIZZLE_TEMPLATE1 template +#define GLM_SWIZZLE_TEMPLATE2 template #define GLM_SWIZZLE_TYPE1 _swizzle #define GLM_SWIZZLE_TYPE2 _swizzle @@ -187,48 +200,48 @@ namespace detail // // Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) // -#define GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const T& b) \ - { \ - return a() OPERAND b; \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER vec operator OPERAND ( const T& a, const GLM_SWIZZLE_TYPE1& b) \ - { \ - return a OPERAND b(); \ +#define GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const T& b) \ + { \ + return a() OPERAND b; \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const T& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ } // // Macro for wrapping a function taking one argument (e.g. abs()) // -#define GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a) \ - { \ - return FUNCTION(a()); \ +#define GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a) \ + { \ + return FUNCTION(a()); \ } // // Macro for wrapping a function taking two vector arguments (e.g. dot()). // -#define GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ - GLM_SWIZZLE_TEMPLATE2 \ +#define GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ + GLM_SWIZZLE_TEMPLATE2 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ { \ return FUNCTION(a(), b()); \ } \ - GLM_SWIZZLE_TEMPLATE1 \ + GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a(), b()); \ } \ - GLM_SWIZZLE_TEMPLATE1 \ + GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename V& b) \ { \ return FUNCTION(a(), b); \ } \ - GLM_SWIZZLE_TEMPLATE1 \ + GLM_SWIZZLE_TEMPLATE1 \ GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a, b()); \ @@ -342,33 +355,33 @@ namespace glm struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; #define GLM_SWIZZLE3_3_MEMBERS(T, Q ,E0,E1,E2) \ - struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; + struct { detail::_swizzle<3, T, Q, 0,0,0,3> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,1,3> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,2,3> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,0,3> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,1,3> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,2,3> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,0,3> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,1,3> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,2,3> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,0,3> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,1,3> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,2,3> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,0,3> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,1,3> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,2,3> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,0,3> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,1,3> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,2,3> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,0,3> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,1,3> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,2,3> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,0,3> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,1,3> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,2,3> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,0,3> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,1,3> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,2,3> E2 ## E2 ## E2; }; #define GLM_SWIZZLE3_4_MEMBERS(T, Q, E0,E1,E2) \ struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ @@ -472,70 +485,70 @@ namespace glm struct { detail::_swizzle<2,T, Q, 3,3,-1,-2> E3 ## E3; }; #define GLM_SWIZZLE4_3_MEMBERS(T, Q, E0,E1,E2,E3) \ - struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,3,-1> E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,3,-1> E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,3,-1> E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,0,-1> E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,1,-1> E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,2,-1> E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,3,-1> E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,3,-1> E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,3,-1> E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,3,-1> E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,0,-1> E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,1,-1> E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,2,-1> E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,3,-1> E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,3,-1> E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,3,-1> E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,3,-1> E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,0,-1> E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,1,-1> E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,2,-1> E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,3,-1> E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,0,-1> E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,1,-1> E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,2,-1> E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,3,-1> E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,0,-1> E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,1,-1> E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,2,-1> E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,3,-1> E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,0,-1> E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,1,-1> E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,2,-1> E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,3,-1> E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,0,-1> E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,1,-1> E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,2,-1> E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,3,-1> E3 ## E3 ## E3; }; + struct { detail::_swizzle<3, T, Q, 0,0,0,3> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,1,3> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,2,3> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,3,3> E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,0,3> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,1,3> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,2,3> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,3,3> E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,0,3> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,1,3> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,2,3> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,3,3> E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,0,3> E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,1,3> E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,2,3> E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,3,3> E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,0,3> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,1,3> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,2,3> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,3,3> E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,0,3> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,1,3> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,2,3> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,3,3> E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,0,3> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,1,3> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,2,3> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,3,3> E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,0,3> E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,1,3> E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,2,3> E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,3,3> E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,0,3> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,1,3> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,2,3> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,3,3> E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,0,3> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,1,3> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,2,3> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,3,3> E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,0,3> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,1,3> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,2,3> E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,3,3> E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,0,3> E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,1,3> E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,2,3> E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,3,3> E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,0,3> E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,1,3> E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,2,3> E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,3,3> E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,0,3> E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,1,3> E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,2,3> E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,3,3> E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,0,3> E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,1,3> E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,2,3> E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,3,3> E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,0,3> E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,1,3> E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,2,3> E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,3,3> E3 ## E3 ## E3; }; #define GLM_SWIZZLE4_4_MEMBERS(T, Q, E0,E1,E2,E3) \ struct { detail::_swizzle<4, T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ diff --git a/vendor/glm/detail/_swizzle_func.hpp b/vendor/glm/detail/_swizzle_func.hpp old mode 100755 new mode 100644 index d218337120..a264ae9eff --- a/vendor/glm/detail/_swizzle_func.hpp +++ b/vendor/glm/detail/_swizzle_func.hpp @@ -1,43 +1,40 @@ -/// @ref core -/// @file glm/detail/_swizzle_func.hpp - #pragma once #define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \ - vec<2, T, Q> A ## B() CONST \ + GLM_FUNC_QUALIFIER vec<2, T, Q> A ## B() CONST \ { \ return vec<2, T, Q>(this->A, this->B); \ } #define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \ - vec<3, T, Q> A ## B ## C() CONST \ + GLM_FUNC_QUALIFIER vec<3, T, Q> A ## B ## C() CONST \ { \ return vec<3, T, Q>(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \ - vec<4, T, Q> A ## B ## C ## D() CONST \ + GLM_FUNC_QUALIFIER vec<4, T, Q> A ## B ## C ## D() CONST \ { \ return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ } #define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \ template \ - vec vec::A ## B() CONST \ + GLM_FUNC_QUALIFIER vec vec::A ## B() CONST \ { \ return vec<2, T, Q>(this->A, this->B); \ } #define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \ template \ - vec<3, T, Q> vec::A ## B ## C() CONST \ + GLM_FUNC_QUALIFIER vec<3, T, Q> vec::A ## B ## C() CONST \ { \ return vec<3, T, Q>(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \ template \ - vec<4, T, Q> vec::A ## B ## C ## D() CONST \ + GLM_FUNC_QUALIFIER vec<4, T, Q> vec::A ## B ## C ## D() CONST \ { \ return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ } diff --git a/vendor/glm/detail/_vectorize.hpp b/vendor/glm/detail/_vectorize.hpp old mode 100755 new mode 100644 index 2e577a80e9..807b1b1de6 --- a/vendor/glm/detail/_vectorize.hpp +++ b/vendor/glm/detail/_vectorize.hpp @@ -1,131 +1,230 @@ -/// @ref core -/// @file glm/detail/_vectorize.hpp - #pragma once -#include "type_vec1.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" - namespace glm{ namespace detail { - template + template class vec, length_t L, typename R, typename T, qualifier Q> struct functor1{}; - template - struct functor1<1, R, T, Q> + template class vec, typename R, typename T, qualifier Q> + struct functor1 { - GLM_FUNC_QUALIFIER static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v) { return vec<1, R, Q>(Func(v.x)); } }; - template - struct functor1<2, R, T, Q> + template class vec, typename R, typename T, qualifier Q> + struct functor1 { - GLM_FUNC_QUALIFIER static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v) { return vec<2, R, Q>(Func(v.x), Func(v.y)); } }; - template - struct functor1<3, R, T, Q> + template class vec, typename R, typename T, qualifier Q> + struct functor1 { - GLM_FUNC_QUALIFIER static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v) { return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z)); } }; - template - struct functor1<4, R, T, Q> + template class vec, typename R, typename T, qualifier Q> + struct functor1 { - GLM_FUNC_QUALIFIER static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v) { return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); } }; - template + template class vec, length_t L, typename T, qualifier Q> struct functor2{}; - template - struct functor2<1, T, Q> + template class vec, typename T, qualifier Q> + struct functor2 { GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> const& b) { return vec<1, T, Q>(Func(a.x, b.x)); } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, T, Q> call(Fct Func, vec<1, T, Q> const& a, vec<1, T, Q> const& b) + { + return vec<1, T, Q>(Func(a.x, b.x)); + } }; - template - struct functor2<2, T, Q> + template class vec, typename T, qualifier Q> + struct functor2 { GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> const& b) { return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y)); } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, T, Q> call(Fct Func, vec<2, T, Q> const& a, vec<2, T, Q> const& b) + { + return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y)); + } }; - template - struct functor2<3, T, Q> + template class vec, typename T, qualifier Q> + struct functor2 { GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> const& b) { return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, T, Q> call(Fct Func, vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } }; - template - struct functor2<4, T, Q> + template class vec, typename T, qualifier Q> + struct functor2 { GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> const& b) { return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(Fct Func, vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } }; - template + template class vec, length_t L, typename T, qualifier Q> struct functor2_vec_sca{}; - template - struct functor2_vec_sca<1, T, Q> + template class vec, typename T, qualifier Q> + struct functor2_vec_sca { GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b) { return vec<1, T, Q>(Func(a.x, b)); } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, T, Q> call(Fct Func, vec<1, T, Q> const& a, T b) + { + return vec<1, T, Q>(Func(a.x, b)); + } }; - template - struct functor2_vec_sca<2, T, Q> + template class vec, typename T, qualifier Q> + struct functor2_vec_sca { GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b) { return vec<2, T, Q>(Func(a.x, b), Func(a.y, b)); } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, T, Q> call(Fct Func, vec<2, T, Q> const& a, T b) + { + return vec<2, T, Q>(Func(a.x, b), Func(a.y, b)); + } }; - template - struct functor2_vec_sca<3, T, Q> + template class vec, typename T, qualifier Q> + struct functor2_vec_sca { GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b) { return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, T, Q> call(Fct Func, vec<3, T, Q> const& a, T b) + { + return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); + } }; - template - struct functor2_vec_sca<4, T, Q> + template class vec, typename T, qualifier Q> + struct functor2_vec_sca { GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b) { return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(Fct Func, vec<4, T, Q> const& a, T b) + { + return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); + } + }; + + template + struct functor2_vec_int {}; + + template + struct functor2_vec_int<1, T, Q> + { + GLM_FUNC_QUALIFIER static vec<1, int, Q> call(int (*Func) (T x, int y), vec<1, T, Q> const& a, vec<1, int, Q> const& b) + { + return vec<1, int, Q>(Func(a.x, b.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, int, Q> call(Fct Func, vec<1, T, Q> const& a, vec<1, int, Q> const& b) + { + return vec<1, int, Q>(Func(a.x, b.x)); + } + }; + + template + struct functor2_vec_int<2, T, Q> + { + GLM_FUNC_QUALIFIER static vec<2, int, Q> call(int (*Func) (T x, int y), vec<2, T, Q> const& a, vec<2, int, Q> const& b) + { + return vec<2, int, Q>(Func(a.x, b.x), Func(a.y, b.y)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, int, Q> call(Fct Func, vec<2, T, Q> const& a, vec<2, int, Q> const& b) + { + return vec<2, int, Q>(Func(a.x, b.x), Func(a.y, b.y)); + } + }; + + template + struct functor2_vec_int<3, T, Q> + { + GLM_FUNC_QUALIFIER static vec<3, int, Q> call(int (*Func) (T x, int y), vec<3, T, Q> const& a, vec<3, int, Q> const& b) + { + return vec<3, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, int, Q> call(Fct Func, vec<3, T, Q> const& a, vec<3, int, Q> const& b) + { + return vec<3, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + }; + + template + struct functor2_vec_int<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(int (*Func) (T x, int y), vec<4, T, Q> const& a, vec<4, int, Q> const& b) + { + return vec<4, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, int, Q> call(Fct Func, vec<4, T, Q> const& a, vec<4, int, Q> const& b) + { + return vec<4, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } }; }//namespace detail }//namespace glm diff --git a/vendor/glm/detail/compute_common.hpp b/vendor/glm/detail/compute_common.hpp new file mode 100644 index 0000000000..83362bc7b3 --- /dev/null +++ b/vendor/glm/detail/compute_common.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include "setup.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct compute_abs + {}; + + template + struct compute_abs + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_signed, + "'abs' only accept floating-point and integer scalar or vector inputs"); + + return x >= genFIType(0) ? x : -x; + // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; + } + }; + +#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) + template<> + struct compute_abs + { + GLM_FUNC_QUALIFIER static float call(float x) + { + return fabsf(x); + } + }; +#endif + + template + struct compute_abs + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) + { + GLM_STATIC_ASSERT( + (!std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'abs' only accept floating-point and integer scalar or vector inputs"); + return x; + } + }; +}//namespace detail +}//namespace glm diff --git a/vendor/glm/detail/compute_vector_decl.hpp b/vendor/glm/detail/compute_vector_decl.hpp new file mode 100644 index 0000000000..709f8e4af7 --- /dev/null +++ b/vendor/glm/detail/compute_vector_decl.hpp @@ -0,0 +1,190 @@ + +#pragma once +#include +#include "_vectorize.hpp" + +namespace glm { + namespace detail + { + template + struct compute_vec_add {}; + + template + struct compute_vec_sub {}; + + template + struct compute_vec_mul {}; + + template + struct compute_vec_div {}; + + template + struct compute_vec_mod {}; + + template + struct compute_splat {}; + + template + struct compute_vec_and {}; + + template + struct compute_vec_or {}; + + template + struct compute_vec_xor {}; + + template + struct compute_vec_shift_left {}; + + template + struct compute_vec_shift_right {}; + + template + struct compute_vec_equal {}; + + template + struct compute_vec_nequal {}; + + template + struct compute_vec_bitwise_not {}; + + template + struct compute_vec_add + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + return detail::functor2::call(std::plus(), a, b); + } + }; + + template + struct compute_vec_sub + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + return detail::functor2::call(std::minus(), a, b); + } + }; + + template + struct compute_vec_mul + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + return detail::functor2::call(std::multiplies(), a, b); + } + }; + + template + struct compute_vec_div + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + return detail::functor2::call(std::divides(), a, b); + } + }; + + template + struct compute_vec_mod + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + return detail::functor2::call(std::modulus(), a, b); + } + }; + + template + struct compute_vec_and + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + vec v(a); + for (length_t i = 0; i < L; ++i) + v[i] &= static_cast(b[i]); + return v; + } + }; + + template + struct compute_vec_or + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + vec v(a); + for (length_t i = 0; i < L; ++i) + v[i] |= static_cast(b[i]); + return v; + } + }; + + template + struct compute_vec_xor + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + vec v(a); + for (length_t i = 0; i < L; ++i) + v[i] ^= static_cast(b[i]); + return v; + } + }; + + template + struct compute_vec_shift_left + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + vec v(a); + for (length_t i = 0; i < L; ++i) + v[i] <<= static_cast(b[i]); + return v; + } + }; + + template + struct compute_vec_shift_right + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a, vec const& b) + { + vec v(a); + for (length_t i = 0; i < L; ++i) + v[i] >>= static_cast(b[i]); + return v; + } + }; + + template + struct compute_vec_equal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec const& v1, vec const& v2) + { + bool b = true; + for (length_t i = 0; b && i < L; ++i) + b = detail::compute_equal::is_iec559>::call(v1[i], v2[i]); + return b; + } + }; + + template + struct compute_vec_nequal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return !compute_vec_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + } + }; + + template + struct compute_vec_bitwise_not + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec v(a); + for (length_t i = 0; i < L; ++i) + v[i] = ~v[i]; + return v; + } + }; + + } +} diff --git a/vendor/glm/detail/compute_vector_relational.hpp b/vendor/glm/detail/compute_vector_relational.hpp old mode 100755 new mode 100644 index e5610ef10b..167b6345dd --- a/vendor/glm/detail/compute_vector_relational.hpp +++ b/vendor/glm/detail/compute_vector_relational.hpp @@ -1,28 +1,30 @@ #pragma once +//#include "compute_common.hpp" #include "setup.hpp" -#include #include namespace glm{ namespace detail { - template ::is_iec559> + template struct compute_equal { - GLM_FUNC_QUALIFIER static bool call(T a, T b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) { return a == b; } }; - +/* template struct compute_equal { - GLM_FUNC_QUALIFIER static bool call(T a, T b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) { - return std::memcmp(&a, &b, sizeof(T)) == 0; + return detail::compute_abs::is_signed>::call(b - a) <= static_cast(0); + //return std::memcmp(&a, &b, sizeof(T)) == 0; } }; +*/ }//namespace detail }//namespace glm diff --git a/vendor/glm/detail/dummy.cpp b/vendor/glm/detail/dummy.cpp deleted file mode 100755 index 01e4ba8e34..0000000000 --- a/vendor/glm/detail/dummy.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/// @ref core -/// @file glm/core/dummy.cpp -/// -/// GLM is a header only library. There is nothing to compile. -/// dummy.cpp exist only a wordaround for CMake file. - -/* -#define GLM_MESSAGES -#include -#include -#include - -struct material -{ - glm::vec4 emission; // Ecm - glm::vec4 ambient; // Acm - glm::vec4 diffuse; // Dcm - glm::vec4 specular; // Scm - float shininess; // Srm -}; - -struct light -{ - glm::vec4 ambient; // Acli - glm::vec4 diffuse; // Dcli - glm::vec4 specular; // Scli - glm::vec4 position; // Ppli - glm::vec4 halfVector; // Derived: Hi - glm::vec3 spotDirection; // Sdli - float spotExponent; // Srli - float spotCutoff; // Crli - // (range: [0.0,90.0], 180.0) - float spotCosCutoff; // Derived: cos(Crli) - // (range: [1.0,0.0],-1.0) - float constantAttenuation; // K0 - float linearAttenuation; // K1 - float quadraticAttenuation;// K2 -}; - - -// Sample 1 -#include // glm::vec3 -#include // glm::cross, glm::normalize - -glm::vec3 computeNormal -( - glm::vec3 const& a, - glm::vec3 const& b, - glm::vec3 const& c -) -{ - return glm::normalize(glm::cross(c - a, b - a)); -} - -typedef unsigned int GLuint; -#define GL_FALSE 0 -void glUniformMatrix4fv(GLuint, int, int, float*){} - -// Sample 2 -#include // glm::vec3 -#include // glm::vec4, glm::ivec4 -#include // glm::mat4 -#include // glm::translate, glm::rotate, glm::scale, glm::perspective -#include // glm::value_ptr -void func(GLuint LocationMVP, float Translate, glm::vec2 const& Rotate) -{ - glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); - glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); - glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); - glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); - glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); - glm::mat4 MVP = Projection * View * Model; - glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); -} - -// Sample 3 -#include // glm::vec2 -#include // glm::packUnorm2x16 -#include // glm::uint -#include // glm::i8vec2, glm::i32vec2 -std::size_t const VertexCount = 4; -// Float quad geometry -std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); -glm::vec2 const PositionDataF32[VertexCount] = -{ - glm::vec2(-1.0f,-1.0f), - glm::vec2( 1.0f,-1.0f), - glm::vec2( 1.0f, 1.0f), - glm::vec2(-1.0f, 1.0f) - }; -// Half-float quad geometry -std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint); -glm::uint const PositionDataF16[VertexCount] = -{ - glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, -1.0f))), - glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, -1.0f))), - glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, 1.0f))), - glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, 1.0f))) -}; -// 8 bits signed integer quad geometry -std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); -glm::i8vec2 const PositionDataI8[VertexCount] = -{ - glm::i8vec2(-1,-1), - glm::i8vec2( 1,-1), - glm::i8vec2( 1, 1), - glm::i8vec2(-1, 1) -}; -// 32 bits signed integer quad geometry -std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); -glm::i32vec2 const PositionDataI32[VertexCount] = -{ - glm::i32vec2 (-1,-1), - glm::i32vec2 ( 1,-1), - glm::i32vec2 ( 1, 1), - glm::i32vec2 (-1, 1) -}; - -struct intersection -{ - glm::vec4 position; - glm::vec3 normal; -}; -*/ - - -/* -// Sample 4 -#include // glm::vec3 -#include // glm::normalize, glm::dot, glm::reflect -#include // glm::pow -#include // glm::vecRand3 -glm::vec3 lighting -( - intersection const& Intersection, - material const& Material, - light const& Light, - glm::vec3 const& View -) -{ - glm::vec3 Color(0.0f); - glm::vec3 LightVertor(glm::normalize( - Light.position - Intersection.position + - glm::vecRand3(0.0f, Light.inaccuracy)); - - if(!shadow(Intersection.position, Light.position, LightVertor)) - { - float Diffuse = glm::dot(Intersection.normal, LightVector); - if(Diffuse <= 0.0f) - return Color; - if(Material.isDiffuse()) - Color += Light.color() * Material.diffuse * Diffuse; - if(Material.isSpecular()) - { - glm::vec3 Reflect(glm::reflect( - glm::normalize(-LightVector), - glm::normalize(Intersection.normal))); - float Dot = glm::dot(Reflect, View); - float Base = Dot > 0.0f ? Dot : 0.0f; - float Specular = glm::pow(Base, Material.exponent); - Color += Material.specular * Specular; - } - } - return Color; -} -*/ - -int main() -{ -/* - glm::vec1 o(1); - glm::vec2 a(1); - glm::vec3 b(1); - glm::vec4 c(1); - - glm::quat q; - glm::dualquat p; - - glm::mat4 m(1); - - float a0 = normalizeDotA(a, a); - float b0 = normalizeDotB(b, b); - float c0 = normalizeDotC(c, c); -*/ - return 0; -} diff --git a/vendor/glm/detail/func_common.inl b/vendor/glm/detail/func_common.inl old mode 100755 new mode 100644 index 8b2d0b02b3..5f01c38dcf --- a/vendor/glm/detail/func_common.inl +++ b/vendor/glm/detail/func_common.inl @@ -2,6 +2,8 @@ /// @file glm/detail/func_common.inl #include "../vector_relational.hpp" +#include "compute_common.hpp" +#include "type_vec1.hpp" #include "type_vec2.hpp" #include "type_vec3.hpp" #include "type_vec4.hpp" @@ -12,29 +14,44 @@ namespace glm { // min template - GLM_FUNC_QUALIFIER genType min(genType x, genType y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType min(genType x, genType y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); return (y < x) ? y : x; } + template + struct TMin { + GLM_FUNC_QUALIFIER T operator()(const T& a, const T& b) { return min(a, b); } + }; + // max template - GLM_FUNC_QUALIFIER genType max(genType x, genType y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType max(genType x, genType y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); return (x < y) ? y : x; } + template + struct TMax { + GLM_FUNC_QUALIFIER T operator()(const T& a, const T& b) { return max(a, b); } + }; + // abs template<> - GLM_FUNC_QUALIFIER int32 abs(int32 x) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR int abs(int x) { - int32 const y = x >> 31; + int const y = x >> (sizeof(int) * 8 - 1); return (x ^ y) - y; } + template + struct TAbs { + T operator()(const T& a) { return abs(a); } + }; + // round # if GLM_HAS_CXX11_STL using ::std::round; @@ -42,12 +59,17 @@ namespace glm template GLM_FUNC_QUALIFIER genType round(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'round' only accept floating-point inputs"); return x < static_cast(0) ? static_cast(int(x - static_cast(0.5))) : static_cast(int(x + static_cast(0.5))); } # endif + template + struct TRound { + T operator()(const T& a) { return round(a); } + }; + // trunc # if GLM_HAS_CXX11_STL using ::std::trunc; @@ -55,64 +77,33 @@ namespace glm template GLM_FUNC_QUALIFIER genType trunc(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'trunc' only accept floating-point inputs"); return x < static_cast(0) ? -std::floor(-x) : std::floor(x); } # endif + template + struct TTrunc { + T operator()(const T& a) { return trunc(a); } + }; + + template + struct TFmod { + T operator()(const T& a, const T& b) { return std::fmod(a, b); } + }; + }//namespace glm namespace glm{ namespace detail { - template - struct compute_abs - {}; - - template - struct compute_abs - { - GLM_FUNC_QUALIFIER static genFIType call(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || std::numeric_limits::is_signed || GLM_UNRESTRICTED_GENTYPE, - "'abs' only accept floating-point and integer scalar or vector inputs"); - - return x >= genFIType(0) ? x : -x; - // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; - } - }; - - #if GLM_COMPILER & GLM_COMPILER_CUDA - template<> - struct compute_abs - { - GLM_FUNC_QUALIFIER static float call(float x) - { - return fabsf(x); - } - }; - #endif - - template - struct compute_abs - { - GLM_FUNC_QUALIFIER static genFIType call(genFIType x) - { - GLM_STATIC_ASSERT( - (!std::numeric_limits::is_signed && std::numeric_limits::is_integer) || GLM_UNRESTRICTED_GENTYPE, - "'abs' only accept floating-point and integer scalar or vector inputs"); - return x; - } - }; - template struct compute_abs_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x) { - return detail::functor1::call(abs, x); + return detail::functor1::call(abs, x); } }; @@ -121,9 +112,9 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); - return vec(vec(x) + a * vec(y - x)); + return vec(vec(x) * (static_cast(1) - a) + vec(y) * a); } }; @@ -132,7 +123,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) { - vec Result; + vec Result(0); for(length_t i = 0; i < x.length(); ++i) Result[i] = a[i] ? y[i] : x[i]; return Result; @@ -144,9 +135,9 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); - return vec(vec(x) + a * vec(y - x)); + return vec(vec(x) * (static_cast(1) - a) + vec(y) * a); } }; @@ -164,9 +155,9 @@ namespace detail { GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); - return static_cast(static_cast(x) + a * static_cast(y - x)); + return static_cast(static_cast(x) * (static_cast(1) - a) + static_cast(y) * a); } }; @@ -195,7 +186,7 @@ namespace detail GLM_FUNC_QUALIFIER static vec call(vec const& x) { T const Shift(static_cast(sizeof(T) * 8 - 1)); - vec const y(vec::type, Q>(-x) >> typename make_unsigned::type(Shift)); + vec const y(vec::type, Q>(-x) >> typename detail::make_unsigned::type(Shift)); return (x >> Shift) | y; } @@ -207,7 +198,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(std::floor, x); + return detail::functor1::call(std::floor, x); } }; @@ -216,7 +207,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(std::ceil, x); + return detail::functor1::call(std::ceil, x); } }; @@ -234,7 +225,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(trunc, x); + return detail::functor1::call(trunc, x); } }; @@ -243,7 +234,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(round, x); + return detail::functor1::call(round, x); } }; @@ -252,17 +243,26 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mod' only accept floating-point inputs. Include for integer inputs."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mod' only accept floating-point inputs. Include for integer inputs."); return a - b * floor(a / b); } }; + template + struct compute_fma + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b, vec const& c) + { + return a * b + c; + } + }; + template struct compute_min_vector { GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) { - return detail::functor2::call(min, x, y); + return detail::functor2::call(TMin(), x, y); } }; @@ -271,7 +271,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) { - return detail::functor2::call(max, x, y); + return detail::functor2::call(TMax(), x, y); } }; @@ -298,21 +298,71 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); } }; + + template + struct convert_vec3_to_vec4W0 + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<3, T, Q> const& a) + { + return vec<4, T, Q>(a.x, a.y, a.z, 0.0f); + } + }; + + template + struct convert_vec3_to_vec4WZ + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<3, T, Q> const& a) + { + return vec<4, T, Q>(a.x, a.y, a.z, a.z); + } + }; + + template + struct convert_vec3_to_vec4W1 + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<3, T, Q> const& a) + { + return vec<4, T, Q>(a.x, a.y, a.z, 1.0f); + } + }; + + template + struct convert_vec4_to_vec3 + { + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(vec<4, T, Q> const& a) + { + return vec<3, T, Q>(a.x, a.y, a.z); + } + }; + + template + struct convert_splat { + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec v(T(0)); + for (int i = 0; i < L; ++i) + v[i] = a[c]; + return v; + } + }; + + }//namespace detail template - GLM_FUNC_QUALIFIER genFIType abs(genFIType x) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genFIType abs(genFIType x) { return detail::compute_abs::is_signed>::call(x); } template - GLM_FUNC_QUALIFIER vec abs(vec const& x) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec abs(vec const& x) { return detail::compute_abs_vector::value>::call(x); } @@ -320,20 +370,21 @@ namespace detail // sign // fast and works for any type template - GLM_FUNC_QUALIFIER genFIType sign(genFIType x) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genFIType sign(genFIType x) { GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), + std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), "'sign' only accept signed inputs"); - return detail::compute_sign<1, genFIType, defaultp, std::numeric_limits::is_iec559, highp>::call(vec<1, genFIType>(x)).x; + return detail::compute_sign<1, genFIType, defaultp, + std::numeric_limits::is_iec559, detail::is_aligned::value>::call(vec<1, genFIType>(x)).x; } template - GLM_FUNC_QUALIFIER vec sign(vec const& x) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec sign(vec const& x) { GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), + std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), "'sign' only accept signed inputs"); return detail::compute_sign::is_iec559, detail::is_aligned::value>::call(x); @@ -344,21 +395,21 @@ namespace detail template GLM_FUNC_QUALIFIER vec floor(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'floor' only accept floating-point inputs."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'floor' only accept floating-point inputs."); return detail::compute_floor::value>::call(x); } template GLM_FUNC_QUALIFIER vec trunc(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'trunc' only accept floating-point inputs"); return detail::compute_trunc::value>::call(x); } template GLM_FUNC_QUALIFIER vec round(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'round' only accept floating-point inputs"); return detail::compute_round::value>::call(x); } @@ -367,7 +418,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType roundEven(genType const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs"); return genType(int(x + genType(int(x) % 2))); } @@ -377,7 +428,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType roundEven(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs"); int Integer = static_cast(x); genType IntegerPart = static_cast(Integer); @@ -408,8 +459,8 @@ namespace detail template GLM_FUNC_QUALIFIER vec roundEven(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); - return detail::functor1::call(roundEven, x); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs"); + return detail::functor1::call(roundEven, x); } // ceil @@ -417,7 +468,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec ceil(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ceil' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceil' only accept floating-point inputs"); return detail::compute_ceil::value>::call(x); } @@ -431,7 +482,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec fract(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fract' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fract' only accept floating-point inputs"); return detail::compute_fract::value>::call(x); } @@ -439,7 +490,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType mod(genType x, genType y) { -# if GLM_COMPILER & GLM_COMPILER_CUDA +# if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) // Another Cuda compiler bug https://github.com/g-truc/glm/issues/530 vec<1, genType, defaultp> Result(mod(vec<1, genType, defaultp>(x), y)); return Result.x; @@ -460,11 +511,66 @@ namespace detail return detail::compute_mod::value>::call(x, y); } + template + GLM_FUNC_QUALIFIER vec fma(vec const& a, vec const& b, vec const& c) + { + return detail::compute_fma::value>::call(a, b, c); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> xyz0(vec<3, T, Q> const& a) + { + return detail::convert_vec3_to_vec4W0::value>::call(a); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> xyz1(vec<3, T, Q> const& a) + { + return detail::convert_vec3_to_vec4W1::value>::call(a); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> xyzz(vec<3, T, Q> const& a) + { + return detail::convert_vec3_to_vec4WZ::value>::call(a); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> xyz(vec<4, T, Q> const& a) + { + return detail::convert_vec4_to_vec3::value>::call(a); + } + + template + GLM_FUNC_QUALIFIER vec splatX(vec const& a) + { + return detail::convert_splat::value>::template call<0>(a); + } + + template + GLM_FUNC_QUALIFIER vec splatY(vec const& a) + { + return detail::convert_splat::value>::template call<1>(a); + } + + template + GLM_FUNC_QUALIFIER vec splatZ(vec const& a) + { + return detail::convert_splat::value>::template call<2>(a); + } + + template + GLM_FUNC_QUALIFIER vec splatW(vec const& a) + { + return detail::convert_splat::value>::template call<3>(a); + } + + // modf template GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'modf' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'modf' only accept floating-point inputs"); return std::modf(x, &i); } @@ -512,68 +618,68 @@ namespace detail // min template - GLM_FUNC_QUALIFIER vec min(vec const& a, T b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& a, T b) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); return detail::compute_min_vector::value>::call(a, vec(b)); } template - GLM_FUNC_QUALIFIER vec min(vec const& a, vec const& b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& a, vec const& b) { return detail::compute_min_vector::value>::call(a, b); } // max template - GLM_FUNC_QUALIFIER vec max(vec const& a, T b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& a, T b) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); return detail::compute_max_vector::value>::call(a, vec(b)); } template - GLM_FUNC_QUALIFIER vec max(vec const& a, vec const& b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& a, vec const& b) { return detail::compute_max_vector::value>::call(a, b); } // clamp template - GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); return min(max(x, minVal), maxVal); } template - GLM_FUNC_QUALIFIER vec clamp(vec const& x, T minVal, T maxVal) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); return detail::compute_clamp_vector::value>::call(x, vec(minVal), vec(maxVal)); } template - GLM_FUNC_QUALIFIER vec clamp(vec const& x, vec const& minVal, vec const& maxVal) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); return detail::compute_clamp_vector::value>::call(x, minVal, maxVal); } template - GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a) { return detail::compute_mix::call(x, y, a); } template - GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, U a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec mix(vec const& x, vec const& y, U a) { return detail::compute_mix_scalar::value>::call(x, y, a); } template - GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, vec const& a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec mix(vec const& x, vec const& y, vec const& a) { return detail::compute_mix_vector::value>::call(x, y, a); } @@ -601,7 +707,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1))); return tmp * tmp * (genType(3) - genType(2) * tmp); @@ -625,7 +731,7 @@ namespace detail template GLM_FUNC_QUALIFIER bool isnan(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs"); # if GLM_HAS_CXX11_STL return std::isnan(x); @@ -639,7 +745,7 @@ namespace detail # endif # elif (GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L return _isnan(x) != 0; -# elif GLM_COMPILER & GLM_COMPILER_CUDA +# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) return ::isnan(x) != 0; # else return std::isnan(x); @@ -650,9 +756,9 @@ namespace detail template GLM_FUNC_QUALIFIER vec isnan(vec const& v) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs"); - vec Result; + vec Result(0); for (length_t l = 0; l < v.length(); ++l) Result[l] = glm::isnan(v[l]); return Result; @@ -664,7 +770,7 @@ namespace detail template GLM_FUNC_QUALIFIER bool isinf(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs"); # if GLM_HAS_CXX11_STL return std::isinf(x); @@ -680,7 +786,7 @@ namespace detail # else return std::isinf(x); # endif -# elif GLM_COMPILER & GLM_COMPILER_CUDA +# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab return ::isinf(double(x)) != 0; # else @@ -692,15 +798,15 @@ namespace detail template GLM_FUNC_QUALIFIER vec isinf(vec const& v) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs"); - vec Result; + vec Result(0); for (length_t l = 0; l < v.length(); ++l) Result[l] = glm::isinf(v[l]); return Result; } - GLM_FUNC_QUALIFIER int floatBitsToInt(float const& v) + GLM_FUNC_QUALIFIER int floatBitsToInt(float v) { union { @@ -716,10 +822,10 @@ namespace detail template GLM_FUNC_QUALIFIER vec floatBitsToInt(vec const& v) { - return reinterpret_cast&>(const_cast&>(v)); + return detail::functor1::call(floatBitsToInt, v); } - GLM_FUNC_QUALIFIER uint floatBitsToUint(float const& v) + GLM_FUNC_QUALIFIER uint floatBitsToUint(float v) { union { @@ -735,10 +841,10 @@ namespace detail template GLM_FUNC_QUALIFIER vec floatBitsToUint(vec const& v) { - return reinterpret_cast&>(const_cast&>(v)); + return detail::functor1::call(floatBitsToUint, v); } - GLM_FUNC_QUALIFIER float intBitsToFloat(int const& v) + GLM_FUNC_QUALIFIER float intBitsToFloat(int v) { union { @@ -754,10 +860,10 @@ namespace detail template GLM_FUNC_QUALIFIER vec intBitsToFloat(vec const& v) { - return reinterpret_cast&>(const_cast&>(v)); + return detail::functor1::call(intBitsToFloat, v); } - GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const& v) + GLM_FUNC_QUALIFIER float uintBitsToFloat(uint v) { union { @@ -776,16 +882,20 @@ namespace detail return reinterpret_cast&>(const_cast&>(v)); } - template - GLM_FUNC_QUALIFIER genType fma(genType const& a, genType const& b, genType const& c) - { - return a * b + c; - } +# if GLM_HAS_CXX11_STL + using std::fma; +# else + template + GLM_FUNC_QUALIFIER genType fma(genType const& a, genType const& b, genType const& c) + { + return a * b + c; + } +# endif template GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'frexp' only accept floating-point inputs"); return std::frexp(x, &exp); } @@ -793,9 +903,9 @@ namespace detail template GLM_FUNC_QUALIFIER vec frexp(vec const& v, vec& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'frexp' only accept floating-point inputs"); - vec Result; + vec Result(0); for (length_t l = 0; l < v.length(); ++l) Result[l] = std::frexp(v[l], &exp[l]); return Result; @@ -804,7 +914,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType ldexp(genType const& x, int const& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ldexp' only accept floating-point inputs"); return std::ldexp(x, exp); } @@ -812,15 +922,15 @@ namespace detail template GLM_FUNC_QUALIFIER vec ldexp(vec const& v, vec const& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ldexp' only accept floating-point inputs"); - vec Result; + vec Result(0); for (length_t l = 0; l < v.length(); ++l) Result[l] = std::ldexp(v[l], exp[l]); return Result; } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_common_simd.inl" #endif diff --git a/vendor/glm/detail/func_common_simd.inl b/vendor/glm/detail/func_common_simd.inl old mode 100755 new mode 100644 index a3482ff4c5..55f54c47e7 --- a/vendor/glm/detail/func_common_simd.inl +++ b/vendor/glm/detail/func_common_simd.inl @@ -99,22 +99,22 @@ namespace detail }; template - struct compute_min_vector<4, int32, Q, true> + struct compute_min_vector<4, int, Q, true> { - GLM_FUNC_QUALIFIER static vec<4, int32, Q> call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) { - vec<4, int32, Q> result; + vec<4, int, Q> result; result.data = _mm_min_epi32(v1.data, v2.data); return result; } }; template - struct compute_min_vector<4, uint32, Q, true> + struct compute_min_vector<4, uint, Q, true> { - GLM_FUNC_QUALIFIER static vec<4, int32, Q> call(vec<4, uint32, Q> const& v1, vec<4, uint32, Q> const& v2) + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) { - vec<4, uint32, Q> result; + vec<4, uint, Q> result; result.data = _mm_min_epu32(v1.data, v2.data); return result; } @@ -132,22 +132,22 @@ namespace detail }; template - struct compute_max_vector<4, int32, Q, true> + struct compute_max_vector<4, int, Q, true> { - GLM_FUNC_QUALIFIER static vec<4, int32, Q> call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) { - vec<4, int32, Q> result; + vec<4, int, Q> result; result.data = _mm_max_epi32(v1.data, v2.data); return result; } }; template - struct compute_max_vector<4, uint32, Q, true> + struct compute_max_vector<4, uint, Q, true> { - GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& v1, vec<4, uint32, Q> const& v2) + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) { - vec<4, uint32, Q> result; + vec<4, uint, Q> result; result.data = _mm_max_epu32(v1.data, v2.data); return result; } @@ -165,22 +165,22 @@ namespace detail }; template - struct compute_clamp_vector<4, int32, Q, true> + struct compute_clamp_vector<4, int, Q, true> { - GLM_FUNC_QUALIFIER static vec<4, int32, Q> call(vec<4, int32, Q> const& x, vec<4, int32, Q> const& minVal, vec<4, int32, Q> const& maxVal) + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& x, vec<4, int, Q> const& minVal, vec<4, int, Q> const& maxVal) { - vec<4, int32, Q> result; + vec<4, int, Q> result; result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data); return result; } }; template - struct compute_clamp_vector<4, uint32, Q, true> + struct compute_clamp_vector<4, uint, Q, true> { - GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& x, vec<4, uint32, Q> const& minVal, vec<4, uint32, Q> const& maxVal) + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& x, vec<4, uint, Q> const& minVal, vec<4, uint, Q> const& maxVal) { - vec<4, uint32, Q> result; + vec<4, uint, Q> result; result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data); return result; } @@ -225,7 +225,391 @@ namespace detail return Result; } }; + + template + struct compute_fma<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b, vec<4, float, Q> const& c) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_fma(a.data, b.data, c.data); + return Result; + } + }; + + template + struct compute_fma<3, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<3, float, Q> call(vec<3, float, Q> const& a, vec<3, float, Q> const& b, vec<3, float, Q> const& c) + { + vec<3, float, Q> Result; + Result.data = glm_vec4_fma(a.data, b.data, c.data); + return Result; + } + }; + + + template + struct compute_fma<4, double, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b, vec<4, double, Q> const& c) + { + vec<4, double, Q> Result; +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) + Result.data = _mm256_fmadd_pd(a.data, b.data, c.data); +# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) + Result.data = _mm256_add_pd(_mm256_mul_pd(a.data, b.data), c.data); +# else + Result.data.setv(0, _mm_add_pd(_mm_mul_pd(a.data.getv(0), b.data.getv(0)), c.data.getv(0))); + Result.data.setv(1, _mm_add_pd(_mm_mul_pd(a.data.getv(1), b.data.getv(1)), c.data.getv(1))); +# endif + return Result; + } + }; + + // copy vec3 to vec4 and set w to 0 + template + struct convert_vec3_to_vec4W0 + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<3, float, Q> const& a) + { + vec<4, float, Q> v; +#if (GLM_ARCH & GLM_ARCH_SSE41_BIT) + v.data = _mm_blend_ps(a.data, _mm_setzero_ps(), 8); +#else + __m128i mask = _mm_set_epi32(0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF); + __m128 v0 = _mm_castsi128_ps(_mm_and_si128(_mm_castps_si128(a.data), mask)); + v.data = v0; +#endif + return v; + } + }; + + // copy vec3 to vec4 and set w to 1 + template + struct convert_vec3_to_vec4W1 + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<3, float, Q> const& a) + { + vec<4, float, Q> v; +#if (GLM_ARCH & GLM_ARCH_SSE41_BIT) + v.data = _mm_blend_ps(a.data, _mm_set1_ps(1.0f), 8); +#else + __m128 t1 = _mm_shuffle_ps(a.data, a.data, _MM_SHUFFLE(0, 2, 1, 3)); //permute x, w + __m128 t2 = _mm_move_ss(t1, _mm_set_ss(1.0f)); // set x to 1.0f + v.data = _mm_shuffle_ps(t2, t2, _MM_SHUFFLE(0, 2, 1, 3)); //permute x, w +#endif + return v; + } + }; + + // copy vec3 to vec4 and set w to vec3.z + template + struct convert_vec3_to_vec4WZ + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<3, float, Q> const& a) + { + vec<4, float, Q> v; + v.data = _mm_shuffle_ps(a.data, a.data, _MM_SHUFFLE(2, 2, 1, 0)); + return v; + } + }; + + // copy vec3 to vec4 and set w to 0 + template + struct convert_vec3_to_vec4W0 + { + GLM_FUNC_QUALIFIER static vec<4, double, Q> call(vec<3, double, Q> const& a) + { + vec<4, double, Q> v; +#if (GLM_ARCH & GLM_ARCH_AVX_BIT) + v.data = _mm256_blend_pd(a.data, _mm256_setzero_pd(), 8); +#else + v.data.setv(0, a.data.getv(0)); + glm_dvec2 av2 = a.data.getv(1); + av2 = _mm_shuffle_pd(av2, _mm_setzero_pd(), 2); + v.data.setv(1, av2); +#endif + return v; + } + }; + + // copy vec3 to vec4 and set w to vec3.z + template + struct convert_vec3_to_vec4WZ + { + GLM_FUNC_QUALIFIER static vec<4, double, Q> call(vec<3, double, Q> const& a) + { + vec<4, double, Q> v; +#if (GLM_ARCH & GLM_ARCH_AVX_BIT) + v.data = _mm256_permute_pd(a.data, 2); +#else + v.data.setv(0, a.data.getv(0)); + glm_dvec2 av2 = a.data.getv(1); + __m128d t1 = _mm_shuffle_pd(av2, av2, 0); + v.data.setv(1, t1); +#endif + return v; + } + }; + + // copy vec3 to vec4 and set w to 1 + template + struct convert_vec3_to_vec4W1 + { + GLM_FUNC_QUALIFIER static vec<4, double, Q> call(vec<3, double, Q> const& a) + { + vec<4, double, Q> v; +#if (GLM_ARCH & GLM_ARCH_AVX_BIT) + v.data = _mm256_blend_pd(a.data, _mm256_set1_pd(1.0), 8); +#else + v.data.setv(0, a.data.getv(0)); + glm_dvec2 av2 = a.data.getv(1); + av2 = _mm_shuffle_pd(av2, _mm_set1_pd(1.), 2); + v.data.setv(1, av2); +#endif + return v; + } + }; + + template + struct convert_vec4_to_vec3 { + GLM_FUNC_QUALIFIER static vec<3, float, Q> call(vec<4, float, Q> const& a) + { + vec<3, float, Q> v; + v.data = a.data; + return v; + } + }; + + template + struct convert_vec4_to_vec3 { + GLM_FUNC_QUALIFIER static vec<3, double, Q> call(vec<4, double, Q> const& a) + { + vec<3, double, Q> v; +#if GLM_ARCH & GLM_ARCH_AVX_BIT + v.data = a.data; +#else + v.data.setv(0, a.data.getv(0)); + v.data.setv(1, a.data.getv(1)); +#endif + return v; + } + }; + + + // set all coordinates to same value vec[c] + template + struct convert_splat { + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec Result; + const int s = _MM_SHUFFLE(c, c, c, c); + glm_f32vec4 va = static_cast(a.data); +# if GLM_ARCH & GLM_ARCH_AVX_BIT + Result.data = _mm_permute_ps(va, s); +# else + Result.data = _mm_shuffle_ps(va, va, s); +# endif + return Result; + } + }; + + // set all coordinates to same value vec[c] + template + struct convert_splat { + + template + struct detailSSE + {}; + + template + struct detailSSE + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec Result; + glm_f64vec2 r0 = _mm_shuffle_pd(a.data.getv(0), a.data.getv(0), c | c << 1); + Result.data.setv(0, r0); + Result.data.setv(1, r0); + return Result; + } + }; + + template + struct detailSSE + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec Result; + const unsigned int d = static_cast(c - 2); + glm_f64vec2 r0 = _mm_shuffle_pd(a.data.getv(1), a.data.getv(1), d | d << 1); + Result.data.setv(0, r0); + Result.data.setv(1, r0); + return Result; + } + }; + +#if GLM_ARCH & GLM_ARCH_AVX_BIT + template //note: bool is useless but needed to compil on linux (gcc) + struct detailAVX + {}; + + template + struct detailAVX + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec Result; + __m256d t1 = _mm256_permute2f128_pd(a.data, a.data, 0x0); + Result.data = _mm256_permute_pd(t1, 0); + return Result; + } + }; + + template + struct detailAVX + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec Result; + __m256d t1 = _mm256_permute2f128_pd(a.data, a.data, 0x0); + Result.data = _mm256_permute_pd(t1, 0xf); + return Result; + } + }; + + template + struct detailAVX + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec Result; + __m256d t2 = _mm256_permute2f128_pd(a.data, a.data, 0x11); + Result.data = _mm256_permute_pd(t2, 0x0); + return Result; + } + }; + + template + struct detailAVX + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + vec Result; + __m256d t2 = _mm256_permute2f128_pd(a.data, a.data, 0x11); + Result.data = _mm256_permute_pd(t2, 0xf); + return Result; + } + }; +#endif //GLM_ARCH & GLM_ARCH_AVX_BIT + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& a) + { + //return compute_splat::call(a); + vec Result; +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + Result.data = _mm256_permute4x64_pd(a.data, _MM_SHUFFLE(c, c, c, c)); +# elif GLM_ARCH & GLM_ARCH_AVX_BIT + Result = detailAVX::call(a); +# else +#if 1 //detail<(c <= 1), c>::call2(a) is equivalent to following code but without if constexpr usage + Result = detailSSE<(c <= 1), c>::call(a); +#else + if constexpr (c <= 1) + { + glm_f64vec2 r0 = _mm_shuffle_pd(a.data.getv(0), a.data.getv(0), c | c << 1); + Result.data.setv(0, r0); + Result.data.setv(1, r0); + } + else + { + const unsigned int d = (unsigned int)(c - 2); + glm_f64vec2 r0 = _mm_shuffle_pd(a.data.getv(1), a.data.getv(1), d | d << 1); + Result.data.setv(0, r0); + Result.data.setv(1, r0); + } +#endif +# endif + return Result; + } + }; + + }//namespace detail }//namespace glm #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + +#if GLM_ARCH & GLM_ARCH_NEON_BIT +namespace glm { +namespace detail { + template + struct convert_vec3_to_vec4W0 + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<3, float, Q> const& a) + { + vec<4, float, Q> v; + static const uint32x4_t mask = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0 }; + v.data = vbslq_f32(mask, a.data, vdupq_n_f32(0)); + return v; + } + }; + + template + struct convert_vec4_to_vec3 { + GLM_FUNC_QUALIFIER static vec<3, float, Q> call(vec<4, float, Q> const& a) + { + vec<3, float, Q> v; + v.data = a.data; + return v; + } + }; + +/* compute_splat is never called? + template + struct compute_splat { + template + GLM_FUNC_QUALIFIER static vec call(vec const& a) + { + (void)a; + } + + template<> + GLM_FUNC_QUALIFIER static vec call<0>(vec const& a) + { + vec Result; + Result.data = vdupq_lane_f32(vget_low_f32(a.data), 0); + return Result; + } + + template<> + GLM_FUNC_QUALIFIER static vec call<1>(vec const& a) + { + vec Result; + Result.data = vdupq_lane_f32(vget_low_f32(a.data), 1); + return Result; + } + + template<> + GLM_FUNC_QUALIFIER static vec call<2>(vec const& a) + { + vec Result; + Result.data = vdupq_lane_f32(vget_high_f32(a.data), 0); + return Result; + } + + template<> + GLM_FUNC_QUALIFIER static vec call<3>(vec const& a) + { + vec Result; + Result.data = vdupq_lane_f32(vget_high_f32(a.data), 1); + return Result; + } + }; +*/ +}//namespace detail +}//namespace glm +#endif //GLM_ARCH & GLM_ARCH_NEON_BIT diff --git a/vendor/glm/detail/func_exponential.inl b/vendor/glm/detail/func_exponential.inl old mode 100755 new mode 100644 index b962674821..7b91f140dd --- a/vendor/glm/detail/func_exponential.inl +++ b/vendor/glm/detail/func_exponential.inl @@ -14,7 +14,7 @@ namespace detail using std::log2; # else template - genType log2(genType Value) + GLM_FUNC_QUALIFIER genType log2(genType Value) { return std::log(Value) * static_cast(1.4426950408889634073599246810019); } @@ -25,9 +25,9 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& v) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'log2' only accept floating-point inputs. Include for integer inputs."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'log2' only accept floating-point inputs. Include for integer inputs."); - return detail::functor1::call(log2, v); + return detail::functor1::call(log2, v); } }; @@ -36,7 +36,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(std::sqrt, x); + return detail::functor1::call(std::sqrt, x); } }; @@ -71,7 +71,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec pow(vec const& base, vec const& exponent) { - return detail::functor2::call(pow, base, exponent); + return detail::functor2::call(pow, base, exponent); } // exp @@ -79,7 +79,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec exp(vec const& x) { - return detail::functor1::call(exp, x); + return detail::functor1::call(exp, x); } // log @@ -87,7 +87,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec log(vec const& x) { - return detail::functor1::call(log, x); + return detail::functor1::call(log, x); } # if GLM_HAS_CXX11_STL @@ -97,7 +97,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType exp2(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'exp2' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'exp2' only accept floating-point inputs"); return std::exp(static_cast(0.69314718055994530941723212145818) * x); } @@ -106,7 +106,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec exp2(vec const& x) { - return detail::functor1::call(exp2, x); + return detail::functor1::call(exp2, x); } // log2, ln2 = 0.69314718055994530941723212145818f @@ -127,7 +127,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec sqrt(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sqrt' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sqrt' only accept floating-point inputs"); return detail::compute_sqrt::value>::call(x); } @@ -141,12 +141,12 @@ namespace detail template GLM_FUNC_QUALIFIER vec inversesqrt(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'inversesqrt' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'inversesqrt' only accept floating-point inputs"); return detail::compute_inversesqrt::value>::call(x); } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_exponential_simd.inl" #endif diff --git a/vendor/glm/detail/func_exponential_simd.inl b/vendor/glm/detail/func_exponential_simd.inl old mode 100755 new mode 100644 index 4b2ef45554..fb78951727 --- a/vendor/glm/detail/func_exponential_simd.inl +++ b/vendor/glm/detail/func_exponential_simd.inl @@ -19,6 +19,7 @@ namespace detail } }; +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> struct compute_sqrt<4, float, aligned_lowp, true> { @@ -29,6 +30,7 @@ namespace detail return Result; } }; +# endif }//namespace detail }//namespace glm diff --git a/vendor/glm/detail/func_geometric.inl b/vendor/glm/detail/func_geometric.inl old mode 100755 new mode 100644 index 67255d450e..8f3cc7734c --- a/vendor/glm/detail/func_geometric.inl +++ b/vendor/glm/detail/func_geometric.inl @@ -1,11 +1,5 @@ -/// @ref core -/// @file glm/detail/func_geometric.inl - #include "../exponential.hpp" #include "../common.hpp" -#include "type_vec2.hpp" -#include "type_vec4.hpp" -#include "type_float.hpp" namespace glm{ namespace detail @@ -34,7 +28,7 @@ namespace detail template struct compute_dot, T, Aligned> { - GLM_FUNC_QUALIFIER static T call(vec<1, T, Q> const& a, vec<1, T, Q> const& b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<1, T, Q> const& a, vec<1, T, Q> const& b) { return a.x * b.x; } @@ -43,7 +37,7 @@ namespace detail template struct compute_dot, T, Aligned> { - GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& a, vec<2, T, Q> const& b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<2, T, Q> const& a, vec<2, T, Q> const& b) { vec<2, T, Q> tmp(a * b); return tmp.x + tmp.y; @@ -53,7 +47,7 @@ namespace detail template struct compute_dot, T, Aligned> { - GLM_FUNC_QUALIFIER static T call(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<3, T, Q> const& a, vec<3, T, Q> const& b) { vec<3, T, Q> tmp(a * b); return tmp.x + tmp.y + tmp.z; @@ -63,17 +57,22 @@ namespace detail template struct compute_dot, T, Aligned> { - GLM_FUNC_QUALIFIER static T call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) { - vec<4, T, Q> tmp(a * b); - return (tmp.x + tmp.y) + (tmp.z + tmp.w); + // VS 17.7.4 generates longer assembly (~20 instructions vs 11 instructions) + #if defined(_MSC_VER) + return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w; + #else + vec<4, T, Q> tmp(a * b); + return (tmp.x + tmp.y) + (tmp.z + tmp.w); + #endif } }; template struct compute_cross { - GLM_FUNC_QUALIFIER static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); @@ -82,6 +81,17 @@ namespace detail x.z * y.x - y.z * x.x, x.x * y.y - y.x * x.y); } + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& x, vec<4, T, Q> const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); + + return vec<4, T, Q>( + x.y * y.z - y.y * x.z, + x.z * y.x - y.z * x.x, + x.x * y.y - y.x * x.y, + 0.0f); + } }; template @@ -122,7 +132,9 @@ namespace detail { T const dotValue(dot(N, I)); T const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue)); - return (eta * I - (eta * dotValue + std::sqrt(k)) * N) * static_cast(k >= static_cast(0)); + vec const Result = + (k >= static_cast(0)) ? (eta * I - (eta * dotValue + std::sqrt(k)) * N) : vec(0); + return Result; } }; }//namespace detail @@ -161,14 +173,14 @@ namespace detail // dot template - GLM_FUNC_QUALIFIER T dot(T x, T y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(T x, T y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); return x * y; } template - GLM_FUNC_QUALIFIER T dot(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(vec const& x, vec const& y) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); @@ -176,11 +188,11 @@ namespace detail // cross template - GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y) { return detail::compute_cross::value>::call(x, y); } - +/* // normalize template GLM_FUNC_QUALIFIER genType normalize(genType const& x) @@ -189,7 +201,7 @@ namespace detail return x < genType(0) ? genType(-1) : genType(1); } - +*/ template GLM_FUNC_QUALIFIER vec normalize(vec const& x) { @@ -242,6 +254,6 @@ namespace detail } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_geometric_simd.inl" #endif diff --git a/vendor/glm/detail/func_geometric_simd.inl b/vendor/glm/detail/func_geometric_simd.inl old mode 100755 new mode 100644 index e6c8d85f2b..4c7f56bf6f --- a/vendor/glm/detail/func_geometric_simd.inl +++ b/vendor/glm/detail/func_geometric_simd.inl @@ -35,18 +35,36 @@ namespace detail } }; + template + struct compute_dot, float, true> + { + GLM_FUNC_QUALIFIER static float call(vec<3, float, Q> const& a, vec<3, float, Q> const& b) + { + vec<4, float, Q> aa = xyz0(a); + vec<4, float, Q> bb = xyz0(b); + return _mm_cvtss_f32(glm_vec1_dot(aa.data, bb.data)); + } + }; + template struct compute_cross { GLM_FUNC_QUALIFIER static vec<3, float, Q> call(vec<3, float, Q> const& a, vec<3, float, Q> const& b) { - __m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x); - __m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x); - __m128 const xpd0 = glm_vec4_cross(set0, set1); + vec<4, float, Q> aa = xyzz(a); + vec<4, float, Q> bb = xyzz(b); + __m128 const xpd0 = glm_vec4_cross(aa.data, bb.data); - vec<4, float, Q> Result; + vec<3, float, Q> Result; Result.data = xpd0; - return vec<3, float, Q>(Result); + return Result; + } + + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_cross(a.data, b.data); + return Result; } }; @@ -96,4 +114,68 @@ namespace detail }//namespace detail }//namespace glm +#elif GLM_ARCH & GLM_ARCH_NEON_BIT +namespace glm{ +namespace detail +{ + template + struct compute_length<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) + { + return sqrt(compute_dot, float, true>::call(v, v)); + } + }; + + template + struct compute_distance<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1) + { + return compute_length<4, float, Q, true>::call(p1 - p0); + } + }; + + + template + struct compute_dot, float, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) + { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + float32x4_t v = vmulq_f32(x.data, y.data); + return vaddvq_f32(v); +#else // Armv7a with Neon + float32x4_t p = vmulq_f32(x.data, y.data); + float32x2_t v = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); + v = vpadd_f32(v, v); + return vget_lane_f32(v, 0); +#endif + } + }; + + template + struct compute_normalize<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + float32x4_t p = vmulq_f32(v.data, v.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + p = vpaddq_f32(p, p); + p = vpaddq_f32(p, p); +#else + float32x2_t t = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); + t = vpadd_f32(t, t); + p = vcombine_f32(t, t); +#endif + + float32x4_t vd = vrsqrteq_f32(p); + vec<4, float, Q> Result; + Result.data = vmulq_f32(v.data, vd); + return Result; + } + }; +}//namespace detail +}//namespace glm + #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/vendor/glm/detail/func_integer.inl b/vendor/glm/detail/func_integer.inl old mode 100755 new mode 100644 index 8f9ed43d5d..d0f6a84d50 --- a/vendor/glm/detail/func_integer.inl +++ b/vendor/glm/detail/func_integer.inl @@ -1,11 +1,5 @@ /// @ref core -/// @file glm/detail/func_integer.inl -#include "../ext/vec1.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include "type_int.hpp" #include "_vectorize.hpp" #if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) # include @@ -15,9 +9,11 @@ #if !GLM_HAS_EXTENDED_INTEGER_TYPE # if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wlong-long" # endif # if (GLM_COMPILER & GLM_COMPILER_CLANG) +# pragma clang diagnostic push # pragma clang diagnostic ignored "-Wc++11-long-long" # endif #endif @@ -153,7 +149,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(compute_findMSB_32, x); + return detail::functor1::call(compute_findMSB_32, x); } }; @@ -171,7 +167,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& x) { - return detail::functor1::call(compute_findMSB_64, x); + return detail::functor1::call(compute_findMSB_64, x); } }; # endif @@ -181,80 +177,70 @@ namespace detail // uaddCarry GLM_FUNC_QUALIFIER uint uaddCarry(uint const& x, uint const& y, uint & Carry) { - uint64 const Value64(static_cast(x) + static_cast(y)); - uint64 const Max32((static_cast(1) << static_cast(32)) - static_cast(1)); + detail::uint64 const Value64(static_cast(x) + static_cast(y)); + detail::uint64 const Max32((static_cast(1) << static_cast(32)) - static_cast(1)); Carry = Value64 > Max32 ? 1u : 0u; - return static_cast(Value64 % (Max32 + static_cast(1))); + return static_cast(Value64 % (Max32 + static_cast(1))); } template GLM_FUNC_QUALIFIER vec uaddCarry(vec const& x, vec const& y, vec& Carry) { - vec Value64(vec(x) + vec(y)); - vec Max32((static_cast(1) << static_cast(32)) - static_cast(1)); - Carry = mix(vec(0), vec(1), greaterThan(Value64, Max32)); - return vec(Value64 % (Max32 + static_cast(1))); + vec Value64(vec(x) + vec(y)); + vec Max32((static_cast(1) << static_cast(32)) - static_cast(1)); + Carry = mix(vec(0), vec(1), greaterThan(Value64, Max32)); + return vec(Value64 % (Max32 + static_cast(1))); } // usubBorrow GLM_FUNC_QUALIFIER uint usubBorrow(uint const& x, uint const& y, uint & Borrow) { - GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); - - Borrow = x >= y ? static_cast(0) : static_cast(1); - if(y >= x) - return y - x; + Borrow = x >= y ? static_cast(0) : static_cast(1); + if(x >= y) + return x - y; else - return static_cast((static_cast(1) << static_cast(32)) + (static_cast(y) - static_cast(x))); + return static_cast((static_cast(1) << static_cast(32)) + (static_cast(x) - static_cast(y))); } template GLM_FUNC_QUALIFIER vec usubBorrow(vec const& x, vec const& y, vec& Borrow) { Borrow = mix(vec(1), vec(0), greaterThanEqual(x, y)); - vec const YgeX(y - x); - vec const XgeY(vec((static_cast(1) << static_cast(32)) + (vec(y) - vec(x)))); - return mix(XgeY, YgeX, greaterThanEqual(y, x)); + vec const XgeY(x - y); + vec const YgX(vec((static_cast(1) << static_cast(32)) + (vec(x) - vec(y)))); + return mix(YgX, XgeY, greaterThanEqual(x, y)); } // umulExtended GLM_FUNC_QUALIFIER void umulExtended(uint const& x, uint const& y, uint & msb, uint & lsb) { - GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); - - uint64 Value64 = static_cast(x) * static_cast(y); - msb = static_cast(Value64 >> static_cast(32)); + detail::uint64 Value64 = static_cast(x) * static_cast(y); + msb = static_cast(Value64 >> static_cast(32)); lsb = static_cast(Value64); } template GLM_FUNC_QUALIFIER void umulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) { - GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); - - vec Value64(vec(x) * vec(y)); - msb = vec(Value64 >> static_cast(32)); - lsb = vec(Value64); + vec Value64(vec(x) * vec(y)); + msb = vec(Value64 >> static_cast(32)); + lsb = vec(Value64); } // imulExtended GLM_FUNC_QUALIFIER void imulExtended(int x, int y, int& msb, int& lsb) { - GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); - - int64 Value64 = static_cast(x) * static_cast(y); - msb = static_cast(Value64 >> static_cast(32)); + detail::int64 Value64 = static_cast(x) * static_cast(y); + msb = static_cast(Value64 >> static_cast(32)); lsb = static_cast(Value64); } template GLM_FUNC_QUALIFIER void imulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) { - GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); - - vec Value64(vec(x) * vec(y)); - lsb = vec(Value64 & static_cast(0xFFFFFFFF)); - msb = vec((Value64 >> static_cast(32)) & static_cast(0xFFFFFFFF)); + vec Value64(vec(x) * vec(y)); + lsb = vec(Value64 & static_cast(0xFFFFFFFF)); + msb = vec((Value64 >> static_cast(32)) & static_cast(0xFFFFFFFF)); } // bitfieldExtract @@ -276,6 +262,8 @@ namespace detail template GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const& Base, genIUType const& Insert, int Offset, int Bits) { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); + return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x; } @@ -284,20 +272,29 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); - T const Mask = static_cast(detail::mask(Bits) << Offset); - return (Base & ~Mask) | (Insert & Mask); + T const Mask = detail::mask(static_cast(Bits)) << Offset; + return (Base & ~Mask) | ((Insert << static_cast(Offset)) & Mask); } +#if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable : 4309) +#endif + // bitfieldReverse - template - GLM_FUNC_QUALIFIER genType bitfieldReverse(genType x) + template + GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType x) { - return bitfieldReverse(glm::vec<1, genType, glm::defaultp>(x)).x; + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); + + return bitfieldReverse(glm::vec<1, genIUType, glm::defaultp>(x)).x; } template GLM_FUNC_QUALIFIER vec bitfieldReverse(vec const& v) { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); + vec x(v); x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 2>::call(x, static_cast(0x5555555555555555ull), static_cast( 1)); x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 4>::call(x, static_cast(0x3333333333333333ull), static_cast( 2)); @@ -308,22 +305,30 @@ namespace detail return x; } +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif + // bitCount - template - GLM_FUNC_QUALIFIER int bitCount(genType x) + template + GLM_FUNC_QUALIFIER int bitCount(genIUType x) { - return bitCount(glm::vec<1, genType, glm::defaultp>(x)).x; + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); + + return bitCount(glm::vec<1, genIUType, glm::defaultp>(x)).x; } template GLM_FUNC_QUALIFIER vec bitCount(vec const& v) { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); + # if GLM_COMPILER & GLM_COMPILER_VC # pragma warning(push) # pragma warning(disable : 4310) //cast truncates constant value # endif - vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v)); + vec::type, Q> x(v); x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned::type(0x5555555555555555ull), typename detail::make_unsigned::type( 1)); x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned::type(0x3333333333333333ull), typename detail::make_unsigned::type( 2)); x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned::type( 4)); @@ -351,7 +356,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); - return detail::functor1::call(findLSB, x); + return detail::functor1::call(findLSB, x); } // findMSB @@ -368,11 +373,20 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - return detail::compute_findMSB_vec::call(v); + return detail::compute_findMSB_vec(sizeof(T) * 8)>::call(v); } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +#if !GLM_HAS_EXTENDED_INTEGER_TYPE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# endif +# if (GLM_COMPILER & GLM_COMPILER_CLANG) +# pragma clang diagnostic pop +# endif +#endif + +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_integer_simd.inl" #endif diff --git a/vendor/glm/detail/func_integer_simd.inl b/vendor/glm/detail/func_integer_simd.inl old mode 100755 new mode 100644 index 690671a370..5600c84993 --- a/vendor/glm/detail/func_integer_simd.inl +++ b/vendor/glm/detail/func_integer_simd.inl @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/func_integer_simd.inl - #include "../simd/integer.h" #if GLM_ARCH & GLM_ARCH_SSE2_BIT @@ -9,19 +6,19 @@ namespace glm{ namespace detail { template - struct compute_bitfieldReverseStep<4, uint32, Q, true, true> + struct compute_bitfieldReverseStep<4, uint, Q, true, true> { - GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& v, uint32 Mask, uint32 Shift) + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v, uint Mask, uint Shift) { __m128i const set0 = v.data; __m128i const set1 = _mm_set1_epi32(static_cast(Mask)); __m128i const and1 = _mm_and_si128(set0, set1); - __m128i const sft1 = _mm_slli_epi32(and1, Shift); + __m128i const sft1 = _mm_slli_epi32(and1, static_cast(Shift)); __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1)); __m128i const and2 = _mm_and_si128(set0, set2); - __m128i const sft2 = _mm_srai_epi32(and2, Shift); + __m128i const sft2 = _mm_srai_epi32(and2, static_cast(Shift)); __m128i const or0 = _mm_or_si128(sft1, sft2); @@ -30,15 +27,15 @@ namespace detail }; template - struct compute_bitfieldBitCountStep<4, uint32, Q, true, true> + struct compute_bitfieldBitCountStep<4, uint, Q, true, true> { - GLM_FUNC_QUALIFIER static vec<4, uint32, Q> call(vec<4, uint32, Q> const& v, uint32 Mask, uint32 Shift) + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v, uint Mask, uint Shift) { __m128i const set0 = v.data; __m128i const set1 = _mm_set1_epi32(static_cast(Mask)); __m128i const and0 = _mm_and_si128(set0, set1); - __m128i const sft0 = _mm_slli_epi32(set0, Shift); + __m128i const sft0 = _mm_slli_epi32(set0, static_cast(Shift)); __m128i const and1 = _mm_and_si128(sft0, set1); __m128i const add0 = _mm_add_epi32(and0, and1); @@ -49,14 +46,14 @@ namespace detail # if GLM_ARCH & GLM_ARCH_AVX_BIT template<> - GLM_FUNC_QUALIFIER int bitCount(uint32 x) + GLM_FUNC_QUALIFIER int bitCount(uint x) { return _mm_popcnt_u32(x); } # if(GLM_MODEL == GLM_MODEL_64) template<> - GLM_FUNC_QUALIFIER int bitCount(uint64 x) + GLM_FUNC_QUALIFIER int bitCount(detail::uint64 x) { return static_cast(_mm_popcnt_u64(x)); } diff --git a/vendor/glm/detail/func_matrix.inl b/vendor/glm/detail/func_matrix.inl old mode 100755 new mode 100644 index d823d76bfa..9c7f7eb765 --- a/vendor/glm/detail/func_matrix.inl +++ b/vendor/glm/detail/func_matrix.inl @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/func_matrix.inl - #include "../geometric.hpp" #include @@ -12,13 +9,45 @@ namespace detail { GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) { - mat Result; + mat Result(1); for(length_t i = 0; i < Result.length(); ++i) Result[i] = x[i] * y[i]; return Result; } }; + template + struct compute_matrixCompMult_type { + GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, + "'matrixCompMult' only accept floating-point inputs, include to discard this restriction."); + return detail::compute_matrixCompMult::value>::call(x, y); + } + }; + + template + struct compute_outerProduct { + GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) + { + typename detail::outerProduct_trait::type m(0); + for(length_t i = 0; i < m.length(); ++i) + m[i] = c * r[i]; + return m; + } + }; + + template + struct compute_outerProduct_type { + GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, + "'outerProduct' only accept floating-point inputs, include to discard this restriction."); + + return detail::compute_outerProduct::call(c, r); + } + }; + template struct compute_transpose{}; @@ -27,7 +56,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) { - mat<2, 2, T, Q> Result; + mat<2, 2, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[1][0] = m[0][1]; @@ -41,7 +70,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<3, 2, T, Q> call(mat<2, 3, T, Q> const& m) { - mat<3,2, T, Q> Result; + mat<3,2, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[1][0] = m[0][1]; @@ -57,7 +86,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<4, 2, T, Q> call(mat<2, 4, T, Q> const& m) { - mat<4, 2, T, Q> Result; + mat<4, 2, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[1][0] = m[0][1]; @@ -75,7 +104,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<2, 3, T, Q> call(mat<3, 2, T, Q> const& m) { - mat<2, 3, T, Q> Result; + mat<2, 3, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -91,7 +120,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) { - mat<3, 3, T, Q> Result; + mat<3, 3, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -112,7 +141,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<4, 3, T, Q> call(mat<3, 4, T, Q> const& m) { - mat<4, 3, T, Q> Result; + mat<4, 3, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -134,7 +163,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<2, 4, T, Q> call(mat<4, 2, T, Q> const& m) { - mat<2, 4, T, Q> Result; + mat<2, 4, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -152,7 +181,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<3, 4, T, Q> call(mat<4, 3, T, Q> const& m) { - mat<3, 4, T, Q> Result; + mat<3, 4, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -174,7 +203,7 @@ namespace detail { GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) { - mat<4, 4, T, Q> Result; + mat<4, 4, T, Q> Result(1); Result[0][0] = m[0][0]; Result[0][1] = m[1][0]; Result[0][2] = m[2][0]; @@ -198,6 +227,16 @@ namespace detail } }; + template + struct compute_transpose_type { + GLM_FUNC_QUALIFIER static mat call(mat const& m) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, + "'transpose' only accept floating-point inputs, include to discard this restriction."); + return detail::compute_transpose::value>::call(m); + } + }; + template struct compute_determinant{}; @@ -246,6 +285,17 @@ namespace detail } }; + template + struct compute_determinant_type{ + + GLM_FUNC_QUALIFIER static T call(mat const& m) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, + "'determinant' only accept floating-point inputs, include to discard this restriction."); + return detail::compute_determinant::value>::call(m); + } + }; + template struct compute_inverse{}; @@ -268,31 +318,72 @@ namespace detail } }; - template - struct compute_inverse<3, 3, T, Q, Aligned> + template + struct inv3x3 {}; + + template + struct inv3x3 + { + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) + { + // see: https://www.onlinemathstutor.org/post/3x3_inverses + + vec<4, T, Q> a = xyz0(m[0]); + vec<4, T, Q> b = xyz0(m[1]); + vec<4, T, Q> c = xyz0(m[2]); + + vec<4, T, Q> i0 = compute_cross::call(b, c); + vec<4, T, Q> i1 = compute_cross::call(c, a); + vec<4, T, Q> i2 = compute_cross::call(a, b); + + mat<3, 3, T, Q> Inverse; + Inverse[0] = xyz(i0); + Inverse[1] = xyz(i1); + Inverse[2] = xyz(i2); + Inverse = transpose(Inverse); + + T Determinant = compute_dot, T, true>::call(a, compute_cross::call(b, c)); + vec<3, T, Q> OneOverDeterminant(static_cast(1) / Determinant); + Inverse *= OneOverDeterminant; + return Inverse; + } + }; + + template + struct inv3x3 { GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) { T OneOverDeterminant = static_cast(1) / ( - + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) + +m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2])); mat<3, 3, T, Q> Inverse; - Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant; - Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant; - Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant; - Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * OneOverDeterminant; - Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * OneOverDeterminant; - Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * OneOverDeterminant; - Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * OneOverDeterminant; - Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * OneOverDeterminant; - Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * OneOverDeterminant; - + Inverse[0][0] = +(m[1][1] * m[2][2] - m[2][1] * m[1][2]); + Inverse[1][0] = -(m[1][0] * m[2][2] - m[2][0] * m[1][2]); + Inverse[2][0] = +(m[1][0] * m[2][1] - m[2][0] * m[1][1]); + Inverse[0][1] = -(m[0][1] * m[2][2] - m[2][1] * m[0][2]); + Inverse[1][1] = +(m[0][0] * m[2][2] - m[2][0] * m[0][2]); + Inverse[2][1] = -(m[0][0] * m[2][1] - m[2][0] * m[0][1]); + Inverse[0][2] = +(m[0][1] * m[1][2] - m[1][1] * m[0][2]); + Inverse[1][2] = -(m[0][0] * m[1][2] - m[1][0] * m[0][2]); + Inverse[2][2] = +(m[0][0] * m[1][1] - m[1][0] * m[0][1]); + + Inverse *= OneOverDeterminant; return Inverse; } }; + template + struct compute_inverse<3, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) + { + return detail::inv3x3::value>::call(m); + } + }; + template struct compute_inverse<4, 4, T, Q, Aligned> { @@ -358,44 +449,36 @@ namespace detail template GLM_FUNC_QUALIFIER mat matrixCompMult(mat const& x, mat const& y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs"); - return detail::compute_matrixCompMult::value>::call(x, y); + return detail::compute_matrixCompMult_type::is_iec559, detail::is_aligned::value>::call(x, y); } template GLM_FUNC_QUALIFIER typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs"); - - typename detail::outerProduct_trait::type m; - for(length_t i = 0; i < m.length(); ++i) - m[i] = c * r[i]; - return m; + return detail::compute_outerProduct_type::is_iec559>::call(c, r); } template GLM_FUNC_QUALIFIER typename mat::transpose_type transpose(mat const& m) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs"); - return detail::compute_transpose::value>::call(m); + return detail::compute_transpose_type::is_iec559, detail::is_aligned::value>::call(m); } template GLM_FUNC_QUALIFIER T determinant(mat const& m) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs"); - return detail::compute_determinant::value>::call(m); + return detail::compute_determinant_type::is_iec559, detail::is_aligned::value>::call(m); } template GLM_FUNC_QUALIFIER mat inverse(mat const& m) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); return detail::compute_inverse::value>::call(m); } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_matrix_simd.inl" #endif diff --git a/vendor/glm/detail/func_matrix_simd.inl b/vendor/glm/detail/func_matrix_simd.inl old mode 100755 new mode 100644 index b96c028249..9e47bf707a --- a/vendor/glm/detail/func_matrix_simd.inl +++ b/vendor/glm/detail/func_matrix_simd.inl @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/func_matrix_simd.inl - #if GLM_ARCH & GLM_ARCH_SSE2_BIT #include "type_mat4x4.hpp" @@ -11,6 +8,7 @@ namespace glm{ namespace detail { +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template struct compute_matrixCompMult<4, 4, float, Q, true> { @@ -20,12 +18,13 @@ namespace detail { mat<4, 4, float, Q> Result; glm_mat4_matrixCompMult( - *static_cast(&x[0].data), - *static_cast(&y[0].data), - *static_cast(&Result[0].data)); + &x[0].data, + &y[0].data, + &Result[0].data); return Result; } }; +# endif template struct compute_transpose<4, 4, float, Q, true> @@ -33,9 +32,18 @@ namespace detail GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) { mat<4, 4, float, Q> Result; - glm_mat4_transpose( - *static_cast(&m[0].data), - *static_cast(&Result[0].data)); + glm_mat4_transpose(&m[0].data, &Result[0].data); + return Result; + } + }; + + template + struct compute_transpose<3, 3, float, Q, true> + { + GLM_FUNC_QUALIFIER static mat<3, 3, float, Q> call(mat<3, 3, float, Q> const& m) + { + mat<3, 3, float, Q> Result; + glm_mat3_transpose(&m[0].data, &Result[0].data); return Result; } }; @@ -45,7 +53,7 @@ namespace detail { GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, Q> const& m) { - return _mm_cvtss_f32(glm_mat4_determinant(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data))); + return _mm_cvtss_f32(glm_mat4_determinant(&m[0].data)); } }; @@ -55,12 +63,13 @@ namespace detail GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) { mat<4, 4, float, Q> Result; - glm_mat4_inverse(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data), *reinterpret_cast<__m128(*)[4]>(&Result[0].data)); + glm_mat4_inverse(&m[0].data, &Result[0].data); return Result; } }; }//namespace detail +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp>(vec<4, float, aligned_lowp> const& c, vec<4, float, aligned_lowp> const& r) { @@ -90,6 +99,165 @@ namespace detail std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); return Result; } +# endif }//namespace glm +#elif GLM_ARCH & GLM_ARCH_NEON_BIT + +namespace glm { +#if GLM_LANG & GLM_LANG_CXX11_FLAG + template + GLM_FUNC_QUALIFIER + typename std::enable_if::value, mat<4, 4, float, Q>>::type + operator*(mat<4, 4, float, Q> const & m1, mat<4, 4, float, Q> const & m2) + { + auto MulRow = [&](int l) { + float32x4_t const SrcA = m2[l].data; + + float32x4_t r = neon::mul_lane(m1[0].data, SrcA, 0); + r = neon::madd_lane(r, m1[1].data, SrcA, 1); + r = neon::madd_lane(r, m1[2].data, SrcA, 2); + r = neon::madd_lane(r, m1[3].data, SrcA, 3); + + return r; + }; + + mat<4, 4, float, aligned_highp> Result; + Result[0].data = MulRow(0); + Result[1].data = MulRow(1); + Result[2].data = MulRow(2); + Result[3].data = MulRow(3); + + return Result; + } +#endif // CXX11 + +namespace detail +{ + template + struct compute_inverse<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) + { + float32x4_t const& m0 = m[0].data; + float32x4_t const& m1 = m[1].data; + float32x4_t const& m2 = m[2].data; + float32x4_t const& m3 = m[3].data; + + // m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + float32x4_t Fac0; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac0 = w0 * w1 - w2 * w3; + } + + // m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + float32x4_t Fac1; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac1 = w0 * w1 - w2 * w3; + } + + // m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + float32x4_t Fac2; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + Fac2 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + float32x4_t Fac3; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac3 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + float32x4_t Fac4; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + Fac4 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + float32x4_t Fac5; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + Fac5 = w0 * w1 - w2 * w3; + } + + float32x4_t Vec0 = neon::copy_lane(neon::dupq_lane(m0, 0), 0, m1, 0); // (m[1][0], m[0][0], m[0][0], m[0][0]); + float32x4_t Vec1 = neon::copy_lane(neon::dupq_lane(m0, 1), 0, m1, 1); // (m[1][1], m[0][1], m[0][1], m[0][1]); + float32x4_t Vec2 = neon::copy_lane(neon::dupq_lane(m0, 2), 0, m1, 2); // (m[1][2], m[0][2], m[0][2], m[0][2]); + float32x4_t Vec3 = neon::copy_lane(neon::dupq_lane(m0, 3), 0, m1, 3); // (m[1][3], m[0][3], m[0][3], m[0][3]); + + float32x4_t Inv0 = Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2; + float32x4_t Inv1 = Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4; + float32x4_t Inv2 = Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5; + float32x4_t Inv3 = Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5; + + float32x4_t r0 = float32x4_t{-1, +1, -1, +1} * Inv0; + float32x4_t r1 = float32x4_t{+1, -1, +1, -1} * Inv1; + float32x4_t r2 = float32x4_t{-1, +1, -1, +1} * Inv2; + float32x4_t r3 = float32x4_t{+1, -1, +1, -1} * Inv3; + + float32x4_t det = neon::mul_lane(r0, m0, 0); + det = neon::madd_lane(det, r1, m0, 1); + det = neon::madd_lane(det, r2, m0, 2); + det = neon::madd_lane(det, r3, m0, 3); + + float32x4_t rdet = vdupq_n_f32(1 / vgetq_lane_f32(det, 0)); + + mat<4, 4, float, Q> r; + r[0].data = vmulq_f32(r0, rdet); + r[1].data = vmulq_f32(r1, rdet); + r[2].data = vmulq_f32(r2, rdet); + r[3].data = vmulq_f32(r3, rdet); + return r; + } + }; +}//namespace detail +}//namespace glm #endif diff --git a/vendor/glm/detail/func_packing.inl b/vendor/glm/detail/func_packing.inl old mode 100755 new mode 100644 index 7c22eb9eaa..234b093c08 --- a/vendor/glm/detail/func_packing.inl +++ b/vendor/glm/detail/func_packing.inl @@ -3,7 +3,6 @@ #include "../common.hpp" #include "type_half.hpp" -#include "../fwd.hpp" namespace glm { @@ -11,11 +10,11 @@ namespace glm { union { - u16 in[2]; + unsigned short in[2]; uint out; } u; - u16vec2 result(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); + vec<2, unsigned short, defaultp> result(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); u.in[0] = result[0]; u.in[1] = result[1]; @@ -28,7 +27,7 @@ namespace glm union { uint in; - u16 out[2]; + unsigned short out[2]; } u; u.in = p; @@ -40,11 +39,11 @@ namespace glm { union { - i16 in[2]; + signed short in[2]; uint out; } u; - - i16vec2 result(round(clamp(v, -1.0f, 1.0f) * 32767.0f)); + + vec<2, short, defaultp> result(round(clamp(v, -1.0f, 1.0f) * 32767.0f)); u.in[0] = result[0]; u.in[1] = result[1]; @@ -57,7 +56,7 @@ namespace glm union { uint in; - i16 out[2]; + signed short out[2]; } u; u.in = p; @@ -69,11 +68,11 @@ namespace glm { union { - u8 in[4]; + unsigned char in[4]; uint out; } u; - u8vec4 result(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + vec<4, unsigned char, defaultp> result(round(clamp(v, 0.0f, 1.0f) * 255.0f)); u.in[0] = result[0]; u.in[1] = result[1]; @@ -88,7 +87,7 @@ namespace glm union { uint in; - u8 out[4]; + unsigned char out[4]; } u; u.in = p; @@ -100,11 +99,11 @@ namespace glm { union { - i8 in[4]; + signed char in[4]; uint out; } u; - i8vec4 result(round(clamp(v, -1.0f, 1.0f) * 127.0f)); + vec<4, signed char, defaultp> result(round(clamp(v, -1.0f, 1.0f) * 127.0f)); u.in[0] = result[0]; u.in[1] = result[1]; @@ -119,7 +118,7 @@ namespace glm union { uint in; - i8 out[4]; + signed char out[4]; } u; u.in = p; @@ -158,7 +157,7 @@ namespace glm { union { - i16 in[2]; + signed short in[2]; uint out; } u; @@ -173,7 +172,7 @@ namespace glm union { uint in; - i16 out[2]; + signed short out[2]; } u; u.in = v; @@ -184,7 +183,7 @@ namespace glm } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_packing_simd.inl" #endif diff --git a/vendor/glm/detail/func_packing_simd.inl b/vendor/glm/detail/func_packing_simd.inl old mode 100755 new mode 100644 index 1d4a5225d7..fd0fe8b7d9 --- a/vendor/glm/detail/func_packing_simd.inl +++ b/vendor/glm/detail/func_packing_simd.inl @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/func_packing_simd.inl - namespace glm{ namespace detail { diff --git a/vendor/glm/detail/func_trigonometric.inl b/vendor/glm/detail/func_trigonometric.inl old mode 100755 new mode 100644 index 291fccd4b6..9e6d9cfb1c --- a/vendor/glm/detail/func_trigonometric.inl +++ b/vendor/glm/detail/func_trigonometric.inl @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/func_trigonometric.inl - #include "_vectorize.hpp" #include #include @@ -11,7 +8,7 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'radians' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'radians' only accept floating-point input"); return degrees * static_cast(0.01745329251994329576923690768489); } @@ -19,14 +16,14 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec radians(vec const& v) { - return detail::functor1::call(radians, v); + return detail::functor1::call(radians, v); } // degrees template GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'degrees' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'degrees' only accept floating-point input"); return radians * static_cast(57.295779513082320876798154814105); } @@ -34,7 +31,7 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec degrees(vec const& v) { - return detail::functor1::call(degrees, v); + return detail::functor1::call(degrees, v); } // sin @@ -43,7 +40,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec sin(vec const& v) { - return detail::functor1::call(sin, v); + return detail::functor1::call(sin, v); } // cos @@ -52,7 +49,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec cos(vec const& v) { - return detail::functor1::call(cos, v); + return detail::functor1::call(cos, v); } // tan @@ -61,7 +58,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec tan(vec const& v) { - return detail::functor1::call(tan, v); + return detail::functor1::call(tan, v); } // asin @@ -70,7 +67,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec asin(vec const& v) { - return detail::functor1::call(asin, v); + return detail::functor1::call(asin, v); } // acos @@ -79,22 +76,22 @@ namespace glm template GLM_FUNC_QUALIFIER vec acos(vec const& v) { - return detail::functor1::call(acos, v); + return detail::functor1::call(acos, v); } // atan template GLM_FUNC_QUALIFIER genType atan(genType y, genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atan' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'atan' only accept floating-point input"); return ::std::atan2(y, x); } template - GLM_FUNC_QUALIFIER vec atan(vec const& a, vec const& b) + GLM_FUNC_QUALIFIER vec atan(vec const& y, vec const& x) { - return detail::functor2::call(::std::atan2, a, b); + return detail::functor2::call(::std::atan2, y, x); } using std::atan; @@ -102,7 +99,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec atan(vec const& v) { - return detail::functor1::call(atan, v); + return detail::functor1::call(atan, v); } // sinh @@ -111,7 +108,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec sinh(vec const& v) { - return detail::functor1::call(sinh, v); + return detail::functor1::call(sinh, v); } // cosh @@ -120,7 +117,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec cosh(vec const& v) { - return detail::functor1::call(cosh, v); + return detail::functor1::call(cosh, v); } // tanh @@ -129,7 +126,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec tanh(vec const& v) { - return detail::functor1::call(tanh, v); + return detail::functor1::call(tanh, v); } // asinh @@ -139,7 +136,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType asinh(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asinh' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asinh' only accept floating-point input"); return (x < static_cast(0) ? static_cast(-1) : (x > static_cast(0) ? static_cast(1) : static_cast(0))) * log(std::abs(x) + sqrt(static_cast(1) + x * x)); } @@ -148,7 +145,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec asinh(vec const& v) { - return detail::functor1::call(asinh, v); + return detail::functor1::call(asinh, v); } // acosh @@ -158,7 +155,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType acosh(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acosh' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acosh' only accept floating-point input"); if(x < static_cast(1)) return static_cast(0); @@ -169,7 +166,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec acosh(vec const& v) { - return detail::functor1::call(acosh, v); + return detail::functor1::call(acosh, v); } // atanh @@ -179,7 +176,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType atanh(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atanh' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'atanh' only accept floating-point input"); if(std::abs(x) >= static_cast(1)) return 0; @@ -190,11 +187,11 @@ namespace glm template GLM_FUNC_QUALIFIER vec atanh(vec const& v) { - return detail::functor1::call(atanh, v); + return detail::functor1::call(atanh, v); } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_trigonometric_simd.inl" #endif diff --git a/vendor/glm/detail/func_trigonometric_simd.inl b/vendor/glm/detail/func_trigonometric_simd.inl old mode 100755 new mode 100644 diff --git a/vendor/glm/detail/func_vector_relational.inl b/vendor/glm/detail/func_vector_relational.inl old mode 100755 new mode 100644 index b081a90d38..80c9e87fcb --- a/vendor/glm/detail/func_vector_relational.inl +++ b/vendor/glm/detail/func_vector_relational.inl @@ -1,105 +1,87 @@ -/// @ref core -/// @file glm/detail/func_vector_relational.inl - -#include "compute_vector_relational.hpp" - namespace glm { template - GLM_FUNC_QUALIFIER vec lessThan(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec lessThan(vec const& x, vec const& y) { - assert(x.length() == y.length()); - - vec Result; - for(length_t i = 0; i < x.length(); ++i) + vec Result(true); + for(length_t i = 0; i < L; ++i) Result[i] = x[i] < y[i]; - return Result; } template - GLM_FUNC_QUALIFIER vec lessThanEqual(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec lessThanEqual(vec const& x, vec const& y) { - assert(x.length() == y.length()); - - vec Result; - for(length_t i = 0; i < x.length(); ++i) + vec Result(true); + for(length_t i = 0; i < L; ++i) Result[i] = x[i] <= y[i]; return Result; } template - GLM_FUNC_QUALIFIER vec greaterThan(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec greaterThan(vec const& x, vec const& y) { - assert(x.length() == y.length()); - - vec Result; - for(length_t i = 0; i < x.length(); ++i) + vec Result(true); + for(length_t i = 0; i < L; ++i) Result[i] = x[i] > y[i]; return Result; } template - GLM_FUNC_QUALIFIER vec greaterThanEqual(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec greaterThanEqual(vec const& x, vec const& y) { - assert(x.length() == y.length()); - - vec Result; - for(length_t i = 0; i < x.length(); ++i) + vec Result(true); + for(length_t i = 0; i < L; ++i) Result[i] = x[i] >= y[i]; return Result; } template - GLM_FUNC_QUALIFIER vec equal(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y) { - assert(x.length() == y.length()); - - vec Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = detail::compute_equal::call(x[i], y[i]); + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] == y[i]; return Result; } template - GLM_FUNC_QUALIFIER vec notEqual(vec const& x, vec const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y) { - assert(x.length() == y.length()); - - vec Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = !detail::compute_equal::call(x[i], y[i]); + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] != y[i]; return Result; } template - GLM_FUNC_QUALIFIER bool any(vec const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool any(vec const& v) { bool Result = false; - for(length_t i = 0; i < v.length(); ++i) + for(length_t i = 0; i < L; ++i) Result = Result || v[i]; return Result; } template - GLM_FUNC_QUALIFIER bool all(vec const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool all(vec const& v) { bool Result = true; - for(length_t i = 0; i < v.length(); ++i) + for(length_t i = 0; i < L; ++i) Result = Result && v[i]; return Result; } template - GLM_FUNC_QUALIFIER vec not_(vec const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec not_(vec const& v) { - vec Result; - for(length_t i = 0; i < v.length(); ++i) + vec Result(true); + for(length_t i = 0; i < L; ++i) Result[i] = !v[i]; return Result; } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "func_vector_relational_simd.inl" #endif diff --git a/vendor/glm/detail/func_vector_relational_simd.inl b/vendor/glm/detail/func_vector_relational_simd.inl old mode 100755 new mode 100644 index faab59b82a..fd0fe8b7d9 --- a/vendor/glm/detail/func_vector_relational_simd.inl +++ b/vendor/glm/detail/func_vector_relational_simd.inl @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/func_vector_relational_simd.inl - namespace glm{ namespace detail { diff --git a/vendor/glm/detail/glm.cpp b/vendor/glm/detail/glm.cpp old mode 100755 new mode 100644 index f4224ac0a1..b95ada54aa --- a/vendor/glm/detail/glm.cpp +++ b/vendor/glm/detail/glm.cpp @@ -1,11 +1,15 @@ /// @ref core /// @file glm/glm.cpp +#ifndef GLM_ENABLE_EXPERIMENTAL #define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include +#endif +#include "../gtx/dual_quaternion.hpp" +#include "../gtc/vec1.hpp" +#include "../gtc/quaternion.hpp" +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../glm.hpp" namespace glm { @@ -236,14 +240,14 @@ template struct mat<4, 4, float32, highp>; template struct mat<4, 4, float64, highp>; // tquat type explicit instantiation -template struct tquat; -template struct tquat; +template struct qua; +template struct qua; -template struct tquat; -template struct tquat; +template struct qua; +template struct qua; -template struct tquat; -template struct tquat; +template struct qua; +template struct qua; //tdualquat type explicit instantiation template struct tdualquat; diff --git a/vendor/glm/detail/qualifier.hpp b/vendor/glm/detail/qualifier.hpp old mode 100755 new mode 100644 index 262ec329f8..08ee5a5c61 --- a/vendor/glm/detail/qualifier.hpp +++ b/vendor/glm/detail/qualifier.hpp @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/qualifier.hpp - #pragma once #include "setup.hpp" @@ -14,7 +11,7 @@ namespace glm packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance -# if GLM_HAS_ALIGNED_TYPE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance @@ -26,7 +23,7 @@ namespace glm lowp = packed_lowp, ///< By default lowp qualifier is also packed packed = packed_highp, ///< By default packed qualifier is also high precision -# if GLM_HAS_ALIGNED_TYPE && defined(GLM_FORCE_ALIGNED) +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) defaultp = aligned_highp # else defaultp = highp @@ -37,6 +34,24 @@ namespace glm template struct vec; template struct mat; + template struct qua; + +# if GLM_HAS_TEMPLATE_ALIASES + template using tvec1 = vec<1, T, Q>; + template using tvec2 = vec<2, T, Q>; + template using tvec3 = vec<3, T, Q>; + template using tvec4 = vec<4, T, Q>; + template using tmat2x2 = mat<2, 2, T, Q>; + template using tmat2x3 = mat<2, 3, T, Q>; + template using tmat2x4 = mat<2, 4, T, Q>; + template using tmat3x2 = mat<3, 2, T, Q>; + template using tmat3x3 = mat<3, 3, T, Q>; + template using tmat3x4 = mat<3, 4, T, Q>; + template using tmat4x2 = mat<4, 2, T, Q>; + template using tmat4x3 = mat<4, 3, T, Q>; + template using tmat4x4 = mat<4, 4, T, Q>; + template using tquat = qua; +# endif namespace detail { @@ -46,7 +61,7 @@ namespace detail static const bool value = false; }; -# if GLM_HAS_ALIGNED_TYPE +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE template<> struct is_aligned { @@ -65,5 +80,216 @@ namespace detail static const bool value = true; }; # endif + + template + struct storage + { + typedef struct type { + T data[L]; + } type; + }; + +# if GLM_HAS_ALIGNOF + template + struct storage + { + typedef struct alignas(L * sizeof(T)) type { + T data[L]; + } type; + }; + + template + struct storage<3, T, true> + { + typedef struct alignas(4 * sizeof(T)) type { + T data[4]; + } type; + }; +# endif + +# if GLM_ARCH & GLM_ARCH_SSE2_BIT + template<> + struct storage<4, float, true> + { + typedef glm_f32vec4 type; + }; + + template<> + struct storage<4, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<4, unsigned int, true> + { + typedef glm_u32vec4 type; + }; + + template<> + struct storage<3, float, true> + { + typedef glm_f32vec4 type; + }; + + template<> + struct storage<3, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<3, unsigned int, true> + { + typedef glm_u32vec4 type; + }; + + template<> + struct storage<2, double, true> + { + typedef glm_f64vec2 type; + }; + + template<> + struct storage<2, detail::int64, true> + { + typedef glm_i64vec2 type; + }; + + template<> + struct storage<2, detail::uint64, true> + { + typedef glm_u64vec2 type; + }; + + + template<> + struct storage<3, detail::uint64, true> + { + typedef glm_u64vec2 type; + }; + + template<> + struct storage<4, double, true> + { +# if (GLM_ARCH & GLM_ARCH_AVX_BIT) + typedef glm_f64vec4 type; +# else + struct type + { + glm_f64vec2 data[2]; + GLM_CONSTEXPR glm_f64vec2 getv(int i) const { + return data[i]; + } + GLM_CONSTEXPR void setv(int i, const glm_f64vec2& v) { + data[i] = v; + } + }; +# endif + }; + + + template<> + struct storage<3, double, true> : public storage<4, double, true> + {}; + +# endif + +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) + template<> + struct storage<4, detail::int64, true> + { + typedef glm_i64vec4 type; + }; + + template<> + struct storage<4, detail::uint64, true> + { + typedef glm_u64vec4 type; + }; +# endif + +# if GLM_ARCH & GLM_ARCH_NEON_BIT + template<> + struct storage<4, float, true> + { + typedef glm_f32vec4 type; + }; + + template<> + struct storage<3, float, true> : public storage<4, float, true> + {}; + + template<> + struct storage<4, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<3, int, true> : public storage<4, int, true> + {}; + + template<> + struct storage<4, unsigned int, true> + { + typedef glm_u32vec4 type; + }; + + template<> + struct storage<3, unsigned int, true> : public storage<4, unsigned int, true> + {}; + +# if GLM_HAS_ALIGNOF + template<> + struct storage<3, double, true> + { + typedef struct alignas(4 * sizeof(double)) type { + double data[4]; + } type; + }; +# endif//GLM_HAS_ALIGNOF + +# endif + + enum genTypeEnum + { + GENTYPE_VEC, + GENTYPE_MAT, + GENTYPE_QUAT + }; + + template + struct genTypeTrait + {}; + + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = GENTYPE_MAT; + }; + + template + struct init_gentype + { + }; + + template + struct init_gentype + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + { + return genType(1, 0, 0, 0); + } + }; + + template + struct init_gentype + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + { + return genType(1); + } + }; }//namespace detail }//namespace glm diff --git a/vendor/glm/detail/setup.hpp b/vendor/glm/detail/setup.hpp old mode 100755 new mode 100644 index 7475916591..7c69e2e15e --- a/vendor/glm/detail/setup.hpp +++ b/vendor/glm/detail/setup.hpp @@ -1,33 +1,39 @@ -/// @ref core -/// @file glm/detail/setup.hpp - #ifndef GLM_SETUP_INCLUDED -#define GLM_VERSION_MAJOR 0 -#define GLM_VERSION_MINOR 9 -#define GLM_VERSION_PATCH 9 -#define GLM_VERSION_REVISION 0 -#define GLM_VERSION 990 +#include +#include + +#define GLM_VERSION_MAJOR 1 +#define GLM_VERSION_MINOR 0 +#define GLM_VERSION_PATCH 3 +#define GLM_VERSION_REVISION 0 // Deprecated +#define GLM_VERSION 1000 // Deprecated + +#define GLM_MAKE_API_VERSION(variant, major, minor, patch) \ + ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) + +#define GLM_VERSION_COMPLETE GLM_MAKE_API_VERSION(0, GLM_VERSION_MAJOR, GLM_VERSION_MINOR, GLM_VERSION_PATCH) #define GLM_SETUP_INCLUDED GLM_VERSION -#if defined(GLM_FORCE_SWIZZLE) && defined(GLM_FORCE_UNRESTRICTED_GENTYPE) -# error "Both GLM_FORCE_SWIZZLE and GLM_FORCE_UNRESTRICTED_GENTYPE can't be defined at the same time" -#endif +#define GLM_GET_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U) +#define GLM_GET_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU) +#define GLM_GET_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) +#define GLM_GET_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) -#include -#include +/////////////////////////////////////////////////////////////////////////////////// +// Active states + +#define GLM_DISABLE 0 +#define GLM_ENABLE 1 /////////////////////////////////////////////////////////////////////////////////// // Messages -#define GLM_MESSAGES_ENABLED 1 -#define GLM_MESSAGES_DISABLE 0 - #if defined(GLM_FORCE_MESSAGES) -# define GLM_MESSAGES GLM_MESSAGES_ENABLED +# define GLM_MESSAGES GLM_ENABLE #else -# define GLM_MESSAGES GLM_MESSAGES_DISABLE +# define GLM_MESSAGES GLM_DISABLE #endif /////////////////////////////////////////////////////////////////////////////////// @@ -35,38 +41,12 @@ #include "../simd/platform.h" -/////////////////////////////////////////////////////////////////////////////////// -// Version - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_VERSION_DISPLAYED) -# define GLM_MESSAGE_VERSION_DISPLAYED -# pragma message ("GLM: version 0.9.9.0") -#endif//GLM_MESSAGES - -// Report compiler detection -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_COMPILER_DISPLAYED) -# define GLM_MESSAGE_COMPILER_DISPLAYED -# if GLM_COMPILER & GLM_COMPILER_CUDA -# pragma message("GLM: CUDA compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma message("GLM: Visual C++ compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# pragma message("GLM: Clang compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# pragma message("GLM: Intel Compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma message("GLM: GCC compiler detected") -# else -# pragma message("GLM: Compiler not detected") -# endif -#endif//GLM_MESSAGES - /////////////////////////////////////////////////////////////////////////////////// // Build model -#if defined(__arch64__) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) +#if defined(_M_ARM64) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) # define GLM_MODEL GLM_MODEL_64 -#elif defined(__i386__) || defined(__ppc__) +#elif defined(__i386__) || defined(__ppc__) || defined(__ILP32__) || defined(_M_ARM) # define GLM_MODEL GLM_MODEL_32 #else # define GLM_MODEL GLM_MODEL_32 @@ -76,58 +56,18 @@ # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message." #endif//GLM_MODEL -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_MODEL_DISPLAYED) -# define GLM_MESSAGE_MODEL_DISPLAYED -# if(GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: 64 bits model") -# elif(GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: 32 bits model") -# endif//GLM_MODEL -#endif//GLM_MESSAGES - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_ARCH_DISPLAYED) -# define GLM_MESSAGE_ARCH_DISPLAYED -# if(GLM_ARCH == GLM_ARCH_PURE) -# pragma message("GLM: Platform independent code") -# elif(GLM_ARCH == GLM_ARCH_AVX2) -# pragma message("GLM: AVX2 instruction set") -# elif(GLM_ARCH == GLM_ARCH_AVX) -# pragma message("GLM: AVX instruction set") -# elif(GLM_ARCH == GLM_ARCH_SSE42) -# pragma message("GLM: SSE4.2 instruction set") -# elif(GLM_ARCH == GLM_ARCH_SSE41) -# pragma message("GLM: SSE4.1 instruction set") -# elif(GLM_ARCH == GLM_ARCH_SSSE3) -# pragma message("GLM: SSSE3 instruction set") -# elif(GLM_ARCH == GLM_ARCH_SSE3) -# pragma message("GLM: SSE3 instruction set") -# elif(GLM_ARCH == GLM_ARCH_SSE2) -# pragma message("GLM: SSE2 instruction set") -# elif(GLM_ARCH == GLM_ARCH_X86) -# pragma message("GLM: x86 instruction set") -# elif(GLM_ARCH == GLM_ARCH_NEON) -# pragma message("GLM: NEON instruction set") -# elif(GLM_ARCH == GLM_ARCH_ARM) -# pragma message("GLM: ARM instruction set") -# elif(GLM_ARCH == GLM_ARCH_MIPS) -# pragma message("GLM: MIPS instruction set") -# elif(GLM_ARCH == GLM_ARCH_PPC) -# pragma message("GLM: PowerPC architechture") -# endif//GLM_ARCH -#endif//GLM_MESSAGES - /////////////////////////////////////////////////////////////////////////////////// // C++ Version -// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14 +// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A #define GLM_LANG_CXX98_FLAG (1 << 1) #define GLM_LANG_CXX03_FLAG (1 << 2) #define GLM_LANG_CXX0X_FLAG (1 << 3) #define GLM_LANG_CXX11_FLAG (1 << 4) -#define GLM_LANG_CXX1Y_FLAG (1 << 5) -#define GLM_LANG_CXX14_FLAG (1 << 6) -#define GLM_LANG_CXX1Z_FLAG (1 << 7) +#define GLM_LANG_CXX14_FLAG (1 << 5) +#define GLM_LANG_CXX17_FLAG (1 << 6) +#define GLM_LANG_CXX20_FLAG (1 << 7) #define GLM_LANG_CXXMS_FLAG (1 << 8) #define GLM_LANG_CXXGNU_FLAG (1 << 9) @@ -135,148 +75,71 @@ #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) -#define GLM_LANG_CXX1Y (GLM_LANG_CXX11 | GLM_LANG_CXX1Y_FLAG) -#define GLM_LANG_CXX14 (GLM_LANG_CXX1Y | GLM_LANG_CXX14_FLAG) -#define GLM_LANG_CXX1Z (GLM_LANG_CXX14 | GLM_LANG_CXX1Z_FLAG) +#define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG) +#define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG) +#define GLM_LANG_CXX20 (GLM_LANG_CXX17 | GLM_LANG_CXX20_FLAG) #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG -#if defined(GLM_FORCE_CXX14) -# if((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER <= GLM_COMPILER_GCC50)) || ((GLM_COMPILER & GLM_COMPILER_CLANG) && (GLM_COMPILER <= GLM_COMPILER_CLANG34)) -# pragma message("GLM: Using GLM_FORCE_CXX14 with a compiler that doesn't fully support C++14") -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma message("GLM: Using GLM_FORCE_CXX14 but there is no known version of Visual C++ compiler that fully supports C++14") -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# pragma message("GLM: Using GLM_FORCE_CXX14 but there is no known version of ICC compiler that fully supports C++14") -# endif -# define GLM_LANG GLM_LANG_CXX14 +#if (defined(_MSC_EXTENSIONS)) +# define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG +#elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) +# define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG +#else +# define GLM_LANG_EXT 0 +#endif + +#if (defined(GLM_FORCE_CXX_UNKNOWN)) +# define GLM_LANG 0 +#elif defined(GLM_FORCE_CXX20) +# define GLM_LANG (GLM_LANG_CXX20 | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX17) +# define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX14) +# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) # define GLM_LANG_STL11_FORCED #elif defined(GLM_FORCE_CXX11) -# if((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER <= GLM_COMPILER_GCC48)) || ((GLM_COMPILER & GLM_COMPILER_CLANG) && (GLM_COMPILER <= GLM_COMPILER_CLANG33)) -# pragma message("GLM: Using GLM_FORCE_CXX11 with a compiler that doesn't fully support C++11") -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma message("GLM: Using GLM_FORCE_CXX11 but there is no known version of Visual C++ compiler that fully supports C++11") -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# pragma message("GLM: Using GLM_FORCE_CXX11 but there is no known version of ICC compiler that fully supports C++11") -# endif -# define GLM_LANG GLM_LANG_CXX11 +# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) # define GLM_LANG_STL11_FORCED #elif defined(GLM_FORCE_CXX03) -# define GLM_LANG GLM_LANG_CXX03 +# define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT) #elif defined(GLM_FORCE_CXX98) -# define GLM_LANG GLM_LANG_CXX98 -#else -# if GLM_COMPILER & GLM_COMPILER_CLANG -# if __cplusplus >= 201402L // GLM_COMPILER_CLANG34 + -std=c++14 -# define GLM_LANG GLM_LANG_CXX14 -# elif __has_feature(cxx_decltype_auto) && __has_feature(cxx_aggregate_nsdmi) // GLM_COMPILER_CLANG33 + -std=c++1y -# define GLM_LANG GLM_LANG_CXX1Y -# elif __cplusplus >= 201103L // GLM_COMPILER_CLANG33 + -std=c++11 -# define GLM_LANG GLM_LANG_CXX11 -# elif __has_feature(cxx_static_assert) // GLM_COMPILER_CLANG29 + -std=c++11 -# define GLM_LANG GLM_LANG_CXX0X -# elif __cplusplus >= 199711L -# define GLM_LANG GLM_LANG_CXX98 -# else -# define GLM_LANG GLM_LANG_CXX -# endif -# elif GLM_COMPILER & GLM_COMPILER_GCC -# if __cplusplus >= 201402L -# define GLM_LANG GLM_LANG_CXX14 -# elif __cplusplus >= 201103L -# define GLM_LANG GLM_LANG_CXX11 -# elif defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GLM_LANG GLM_LANG_CXX0X -# else -# define GLM_LANG GLM_LANG_CXX98 -# endif -# elif GLM_COMPILER & GLM_COMPILER_VC -# ifdef _MSC_EXTENSIONS -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# endif -# else -# if __cplusplus >= 201402L -# define GLM_LANG GLM_LANG_CXX14 -# elif __cplusplus >= 201103L -# define GLM_LANG GLM_LANG_CXX11 +# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) +#else +# if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG) +# if GLM_COMPILER >= GLM_COMPILER_VC15_7 +# define GLM_LANG_PLATFORM _MSVC_LANG +# elif GLM_COMPILER >= GLM_COMPILER_VC15 +# if _MSVC_LANG > 201402L +# define GLM_LANG_PLATFORM 201402L # else -# define GLM_LANG GLM_LANG_CXX0X +# define GLM_LANG_PLATFORM _MSVC_LANG # endif -# endif -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# ifdef _MSC_EXTENSIONS -# define GLM_MSC_EXT GLM_LANG_CXXMS_FLAG -# else -# define GLM_MSC_EXT 0 -# endif -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_MSC_EXT) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_MSC_EXT) -# elif __INTEL_CXX11_MODE__ -# define GLM_LANG (GLM_LANG_CXX0X | GLM_MSC_EXT) -# elif __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_MSC_EXT) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT) -# endif -# elif GLM_COMPILER & GLM_COMPILER_CUDA -# ifdef _MSC_EXTENSIONS -# define GLM_MSC_EXT GLM_LANG_CXXMS_FLAG # else -# define GLM_MSC_EXT 0 -# endif -# if GLM_COMPILER >= GLM_COMPILER_CUDA75 -# define GLM_LANG (GLM_LANG_CXX0X | GLM_MSC_EXT) -# else -# define GLM_LANG (GLM_LANG_CXX98 | GLM_MSC_EXT) -# endif -# else // Unknown compiler -# if __cplusplus >= 201402L -# define GLM_LANG GLM_LANG_CXX14 -# elif __cplusplus >= 201103L -# define GLM_LANG GLM_LANG_CXX11 -# elif __cplusplus >= 199711L -# define GLM_LANG GLM_LANG_CXX98 -# else -# define GLM_LANG GLM_LANG_CXX // Good luck with that! -# endif -# ifndef GLM_FORCE_PURE -# define GLM_FORCE_PURE +# define GLM_LANG_PLATFORM 0 # endif +# else +# define GLM_LANG_PLATFORM 0 # endif -#endif -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_LANG_DISPLAYED) -# define GLM_MESSAGE_LANG_DISPLAYED - -# if GLM_LANG & GLM_LANG_CXX1Z_FLAG -# pragma message("GLM: C++1z") -# elif GLM_LANG & GLM_LANG_CXX14_FLAG -# pragma message("GLM: C++14") -# elif GLM_LANG & GLM_LANG_CXX1Y_FLAG -# pragma message("GLM: C++1y") -# elif GLM_LANG & GLM_LANG_CXX11_FLAG -# pragma message("GLM: C++11") -# elif GLM_LANG & GLM_LANG_CXX0X_FLAG -# pragma message("GLM: C++0x") -# elif GLM_LANG & GLM_LANG_CXX03_FLAG -# pragma message("GLM: C++03") -# elif GLM_LANG & GLM_LANG_CXX98_FLAG -# pragma message("GLM: C++98") +# if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L +# define GLM_LANG (GLM_LANG_CXX20 | GLM_LANG_EXT) +# elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L +# define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) +# elif __cplusplus == 201402L || __cplusplus == 201406L || __cplusplus == 201500L || GLM_LANG_PLATFORM == 201402L +# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) +# elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L +# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) +# elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT) +# elif __cplusplus == 199711L +# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) # else -# pragma message("GLM: C++ language undetected") -# endif//GLM_LANG - -# if GLM_LANG & (GLM_LANG_CXXGNU_FLAG | GLM_LANG_CXXMS_FLAG) -# pragma message("GLM: Language extensions enabled") -# endif//GLM_LANG -#endif//GLM_MESSAGES +# define GLM_LANG (0 | GLM_LANG_EXT) +# endif +#endif /////////////////////////////////////////////////////////////////////////////////// // Has of C++ features @@ -285,15 +148,18 @@ // http://gcc.gnu.org/projects/cxx0x.html // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx -// Android has multiple STLs but C++11 STL detection doesn't always work #284 #564 -#if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED) +#if (GLM_COMPILER & GLM_COMPILER_CUDA_RTC) == GLM_COMPILER_CUDA_RTC +# define GLM_HAS_CXX11_STL 0 +#elif (GLM_COMPILER & GLM_COMPILER_HIP) # define GLM_HAS_CXX11_STL 0 #elif GLM_COMPILER & GLM_COMPILER_CLANG -# if (defined(_LIBCPP_VERSION) && GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED) +# if (defined(_LIBCPP_VERSION) || (GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED)) # define GLM_HAS_CXX11_STL 1 # else # define GLM_HAS_CXX11_STL 0 # endif +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_CXX11_STL 1 #else # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ @@ -308,9 +174,9 @@ # define GLM_HAS_STATIC_ASSERT 1 #else # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC)) || \ ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC)))) + ((GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N1988 @@ -320,61 +186,46 @@ # define GLM_HAS_EXTENDED_INTEGER_TYPE (\ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG))) + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP))) #endif -// N2235 -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_CONSTEXPR __has_feature(cxx_constexpr) -# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_CONSTEXPR 1 -# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR -#else -# define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)))) // GCC 4.6 support constexpr but there is a compiler bug causing a crash -# define GLM_HAS_CONSTEXPR_PARTIAL (GLM_HAS_CONSTEXPR || ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14))) -#endif - -// N2672 +// N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_INITIALIZER_LISTS 1 #else # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75)))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf #if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) -#elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_UNRESTRICTED_UNIONS 1 #else # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_LANG & GLM_LANG_CXXMS_FLAG)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75)) || \ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46))) + (GLM_COMPILER & GLM_COMPILER_VC) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP))) #endif // N2346 -#if defined(GLM_FORCE_UNRESTRICTED_GENTYPE) -# define GLM_HAS_DEFAULTED_FUNCTIONS 0 -#elif GLM_COMPILER & GLM_COMPILER_CLANG +#if GLM_COMPILER & GLM_COMPILER_CLANG # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_DEFAULTED_FUNCTIONS 1 #else # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ - (GLM_COMPILER & GLM_COMPILER_CUDA))) + (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP))) #endif // N2118 @@ -384,9 +235,9 @@ # define GLM_HAS_RVALUE_REFERENCES 1 #else # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC)) || \ ((GLM_COMPILER & GLM_COMPILER_VC)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)))) + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf @@ -396,10 +247,10 @@ # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 #else # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)))) + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf @@ -410,9 +261,9 @@ #else # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC47)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)))) + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html @@ -422,28 +273,73 @@ # define GLM_HAS_RANGE_FOR 1 #else # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ ((GLM_COMPILER & GLM_COMPILER_VC)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)))) + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf #if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_ALIGNOF __has_feature(c_alignof) +# define GLM_HAS_ALIGNOF __has_feature(cxx_alignas) #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_ALIGNOF 1 #else # define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA70)))) + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif -#define GLM_HAS_ONLY_XYZW ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER < GLM_COMPILER_GCC46)) -#if GLM_HAS_ONLY_XYZW -# pragma message("GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components") +// N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf +// N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html +#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr... +# define GLM_HAS_CONSTEXPR 0 +#elif (GLM_COMPILER & GLM_COMPILER_CLANG) +# define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr) +#elif (GLM_LANG & GLM_LANG_CXX14_FLAG) +# define GLM_HAS_CONSTEXPR 1 +#else +# define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)))) +#endif + +#if GLM_HAS_CONSTEXPR +# define GLM_CONSTEXPR constexpr +#else +# define GLM_CONSTEXPR +#endif + +// +#if GLM_HAS_CONSTEXPR +# if (GLM_COMPILER & GLM_COMPILER_CLANG) +# if __has_feature(cxx_if_constexpr) +# define GLM_HAS_IF_CONSTEXPR 1 +# else +# define GLM_HAS_IF_CONSTEXPR 0 +# endif +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) +# define GLM_HAS_IF_CONSTEXPR 1 +# else +# define GLM_HAS_IF_CONSTEXPR 0 +# endif +#else +# define GLM_HAS_IF_CONSTEXPR 0 +#endif + +#if GLM_HAS_IF_CONSTEXPR +# define GLM_IF_CONSTEXPR if constexpr +#else +# define GLM_IF_CONSTEXPR if +#endif + +// [nodiscard] +#if GLM_LANG & GLM_LANG_CXX17_FLAG +# define GLM_NODISCARD [[nodiscard]] +#else +# define GLM_NODISCARD #endif // @@ -464,17 +360,32 @@ #else # define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)))) + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif -#if GLM_ARCH == GLM_ARCH_PURE -# define GLM_HAS_BITSCAN_WINDOWS 0 -#else +// +#if defined(GLM_FORCE_INTRINSICS) # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT)))) +#else +# define GLM_HAS_BITSCAN_WINDOWS 0 +#endif + +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_NOEXCEPT 1 +#else +# define GLM_HAS_NOEXCEPT 0 #endif +#if GLM_HAS_NOEXCEPT +# define GLM_NOEXCEPT noexcept +#else +# define GLM_NOEXCEPT +#endif + +/////////////////////////////////////////////////////////////////////////////////// // OpenMP #ifdef _OPENMP # if GLM_COMPILER & GLM_COMPILER_GCC @@ -511,14 +422,13 @@ /////////////////////////////////////////////////////////////////////////////////// // nullptr -// #if GLM_LANG & GLM_LANG_CXX0X_FLAG -# define GLM_HAS_NULLPTR 1 +# define GLM_CONFIG_NULLPTR GLM_ENABLE #else -# define GLM_HAS_NULLPTR 0 +# define GLM_CONFIG_NULLPTR GLM_DISABLE #endif -#if GLM_HAS_NULLPTR +#if GLM_CONFIG_NULLPTR == GLM_ENABLE # define GLM_NULLPTR nullptr #else # define GLM_NULLPTR 0 @@ -532,35 +442,42 @@ #elif GLM_COMPILER & GLM_COMPILER_VC # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] #else -# define GLM_STATIC_ASSERT(x, message) -# define GLM_STATIC_ASSERT_NULL +# define GLM_STATIC_ASSERT(x, message) assert(x) #endif//GLM_LANG /////////////////////////////////////////////////////////////////////////////////// // Qualifiers -#if GLM_COMPILER & GLM_COMPILER_CUDA -# define GLM_CUDA_FUNC_DEF __device__ __host__ -# define GLM_CUDA_FUNC_DECL __device__ __host__ +// User defines: GLM_CUDA_FORCE_DEVICE_FUNC, GLM_CUDA_FORCE_HOST_FUNC + +#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) +# if defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC) +# error "GLM error: GLM_CUDA_FORCE_DEVICE_FUNC and GLM_CUDA_FORCE_HOST_FUNC should not be defined at the same time, GLM by default generates both device and host code for CUDA compiler." +# endif//defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC) + +# if defined(GLM_CUDA_FORCE_DEVICE_FUNC) +# define GLM_CUDA_FUNC_DEF __device__ +# define GLM_CUDA_FUNC_DECL __device__ +# elif defined(GLM_CUDA_FORCE_HOST_FUNC) +# define GLM_CUDA_FUNC_DEF __host__ +# define GLM_CUDA_FUNC_DECL __host__ +# else +# define GLM_CUDA_FUNC_DEF __device__ __host__ +# define GLM_CUDA_FUNC_DECL __device__ __host__ +# endif//defined(GLM_CUDA_FORCE_XXXX_FUNC) #else # define GLM_CUDA_FUNC_DEF # define GLM_CUDA_FUNC_DECL #endif -#if GLM_COMPILER & GLM_COMPILER_GCC -# define GLM_VAR_USED __attribute__ ((unused)) -#else -# define GLM_VAR_USED -#endif - #if defined(GLM_FORCE_INLINE) # if GLM_COMPILER & GLM_COMPILER_VC # define GLM_INLINE __forceinline -# define GLM_NEVER_INLINE __declspec((noinline)) +# define GLM_NEVER_INLINE __declspec(noinline) # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) # define GLM_INLINE inline __attribute__((__always_inline__)) # define GLM_NEVER_INLINE __attribute__((__noinline__)) -# elif GLM_COMPILER & GLM_COMPILER_CUDA +# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) # define GLM_INLINE __forceinline__ # define GLM_NEVER_INLINE __noinline__ # else @@ -572,31 +489,48 @@ # define GLM_NEVER_INLINE #endif//defined(GLM_FORCE_INLINE) -#define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL +#define GLM_CTOR_DECL GLM_CUDA_FUNC_DECL GLM_CONSTEXPR +#define GLM_FUNC_DISCARD_DECL GLM_CUDA_FUNC_DECL +#define GLM_FUNC_DECL GLM_NODISCARD GLM_CUDA_FUNC_DECL #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE +// Do not use CUDA function qualifiers on CUDA compiler when functions are made default +#if GLM_HAS_DEFAULTED_FUNCTIONS +# define GLM_DEFAULTED_FUNC_DECL +# define GLM_DEFAULTED_FUNC_QUALIFIER GLM_INLINE +#else +# define GLM_DEFAULTED_FUNC_DECL GLM_FUNC_DISCARD_DECL +# define GLM_DEFAULTED_FUNC_QUALIFIER GLM_FUNC_QUALIFIER +#endif//GLM_HAS_DEFAULTED_FUNCTIONS +#if !defined(GLM_FORCE_CTOR_INIT) +# define GLM_DEFAULTED_DEFAULT_CTOR_DECL +# define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_DEFAULTED_FUNC_QUALIFIER +#else +# define GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_FUNC_DISCARD_DECL +# define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_FUNC_QUALIFIER +#endif//GLM_FORCE_CTOR_INIT + /////////////////////////////////////////////////////////////////////////////////// // Swizzle operators // User defines: GLM_FORCE_SWIZZLE -#define GLM_SWIZZLE_ENABLED 1 -#define GLM_SWIZZLE_DISABLE 0 +#define GLM_SWIZZLE_DISABLED 0 +#define GLM_SWIZZLE_OPERATOR 1 +#define GLM_SWIZZLE_FUNCTION 2 -#if defined(GLM_FORCE_SWIZZLE) -# define GLM_SWIZZLE GLM_SWIZZLE_ENABLED -#else -# define GLM_SWIZZLE GLM_SWIZZLE_DISABLE +#if defined(GLM_SWIZZLE) +# pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.") +# define GLM_FORCE_SWIZZLE #endif -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED) -# define GLM_MESSAGE_SWIZZLE_DISPLAYED -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED -# pragma message("GLM: Swizzling operators enabled") -# else -# pragma message("GLM: Swizzling operators disabled, #define GLM_SWIZZLE to enable swizzle operators") -# endif -#endif//GLM_MESSAGES +#if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && !defined(GLM_FORCE_XYZW_ONLY) +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR +#elif defined(GLM_FORCE_SWIZZLE) +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION +#else +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED +#endif /////////////////////////////////////////////////////////////////////////////////// // Allows using not basic types as genType @@ -604,172 +538,74 @@ // #define GLM_FORCE_UNRESTRICTED_GENTYPE #ifdef GLM_FORCE_UNRESTRICTED_GENTYPE -# define GLM_UNRESTRICTED_GENTYPE 1 +# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE #else -# define GLM_UNRESTRICTED_GENTYPE 0 +# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE #endif -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_UNRESTRICTED_GENTYPE_DISPLAYED) -# define GLM_MESSAGE_UNRESTRICTED_GENTYPE_DISPLAYED -# ifdef GLM_FORCE_UNRESTRICTED_GENTYPE -# pragma message("GLM: Use unrestricted genType") -# endif -#endif//GLM_MESSAGES - /////////////////////////////////////////////////////////////////////////////////// -// Force single only (remove explicit float64 types) +// Allows using any scaler as float -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_SINGLE_ONLY_DISPLAYED) -# define GLM_MESSAGE_SINGLE_ONLY_DISPLAYED -# ifdef GLM_FORCE_SINGLE_ONLY -# pragma message("GLM: Using only single precision floating-point types") -# endif -#endif//GLM_MESSAGES - -/////////////////////////////////////////////////////////////////////////////////// -// Clip control - -#define GLM_DEPTH_ZERO_TO_ONE 0x00000001 -#define GLM_DEPTH_NEGATIVE_ONE_TO_ONE 0x00000002 +// #define GLM_FORCE_UNRESTRICTED_FLOAT -#ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE -# define GLM_DEPTH_CLIP_SPACE GLM_DEPTH_ZERO_TO_ONE +#ifdef GLM_FORCE_UNRESTRICTED_FLOAT +# define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_ENABLE #else -# define GLM_DEPTH_CLIP_SPACE GLM_DEPTH_NEGATIVE_ONE_TO_ONE +# define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_DISABLE #endif -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_DEPTH_DISPLAYED) -# define GLM_MESSAGE_DEPTH_DISPLAYED -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE -# pragma message("GLM: Depth clip space: Zero to one") -# else -# pragma message("GLM: Depth clip space: negative one to one") -# endif -#endif//GLM_MESSAGES - /////////////////////////////////////////////////////////////////////////////////// +// Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM +// to use a clip space between 0 to 1. // Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM // to use left handed coordinate system by default. -#define GLM_LEFT_HANDED 0x00000001 // For DirectX, Metal, Vulkan -#define GLM_RIGHT_HANDED 0x00000002 // For OpenGL, default in GLM +#define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE +#define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE +#define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan +#define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM -#ifdef GLM_FORCE_LEFT_HANDED -# define GLM_COORDINATE_SYSTEM GLM_LEFT_HANDED -#else -# define GLM_COORDINATE_SYSTEM GLM_RIGHT_HANDED -#endif +#define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT) +#define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT) +#define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT) +#define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT) -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_HANDED_DISPLAYED) -# define GLM_MESSAGE_HANDED_DISPLAYED -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED -# pragma message("GLM: Coordinate system: left handed") +#ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE +# ifdef GLM_FORCE_LEFT_HANDED +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO # else -# pragma message("GLM: Coordinate system: right handed") +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO # endif -#endif//GLM_MESSAGES +#else +# ifdef GLM_FORCE_LEFT_HANDED +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO +# else +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO +# endif +#endif /////////////////////////////////////////////////////////////////////////////////// // Qualifiers #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) # define GLM_DEPRECATED __declspec(deprecated) -# define GLM_ALIGN(x) __declspec(align(x)) -# define GLM_ALIGNED_STRUCT(x) struct __declspec(align(x)) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name -# define GLM_RESTRICT_FUNC __declspec(restrict) -# define GLM_RESTRICT __restrict -# if GLM_COMPILER >= GLM_COMPILER_VC12 -# define GLM_VECTOR_CALL __vectorcall -# else -# define GLM_VECTOR_CALL -# endif #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) -# define GLM_DEPRECATED __attribute__((__deprecated__)) -# define GLM_ALIGN(x) __attribute__((aligned(x))) -# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) -# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) -# define GLM_RESTRICT_FUNC __restrict__ -# define GLM_RESTRICT __restrict__ -# if GLM_COMPILER & GLM_COMPILER_CLANG -# if GLM_COMPILER >= GLM_COMPILER_CLANG37 -# define GLM_VECTOR_CALL __vectorcall -# else -# define GLM_VECTOR_CALL -# endif +# if GLM_LANG & GLM_LANG_CXX14_FLAG +# define GLM_DEPRECATED [[deprecated]] # else -# define GLM_VECTOR_CALL +# define GLM_DEPRECATED __attribute__((__deprecated__)) # endif -#elif GLM_COMPILER & GLM_COMPILER_CUDA +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) +#elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) # define GLM_DEPRECATED -# define GLM_ALIGN(x) __align__(x) -# define GLM_ALIGNED_STRUCT(x) struct __align__(x) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) -# define GLM_RESTRICT_FUNC __restrict__ -# define GLM_RESTRICT __restrict__ -# define GLM_VECTOR_CALL #else # define GLM_DEPRECATED -# define GLM_ALIGN -# define GLM_ALIGNED_STRUCT(x) struct # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name -# define GLM_RESTRICT_FUNC -# define GLM_RESTRICT -# define GLM_VECTOR_CALL -#endif//GLM_COMPILER - -#if GLM_HAS_DEFAULTED_FUNCTIONS -# define GLM_DEFAULT = default - -# ifdef GLM_FORCE_NO_CTOR_INIT -# undef GLM_FORCE_CTOR_INIT -# endif - -# ifdef GLM_FORCE_CTOR_INIT -# define GLM_DEFAULT_CTOR -# else -# define GLM_DEFAULT_CTOR = default -# endif -#else -# define GLM_DEFAULT -# define GLM_DEFAULT_CTOR -#endif - -#if GLM_HAS_CONSTEXPR || GLM_HAS_CONSTEXPR_PARTIAL -# define GLM_CONSTEXPR constexpr -# if ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER <= GLM_COMPILER_VC14)) // Visual C++ has a bug #594 https://github.com/g-truc/glm/issues/594 -# define GLM_CONSTEXPR_CTOR -# else -# define GLM_CONSTEXPR_CTOR constexpr -# endif -#else -# define GLM_CONSTEXPR -# define GLM_CONSTEXPR_CTOR #endif -#if GLM_HAS_CONSTEXPR -# define GLM_RELAXED_CONSTEXPR constexpr -#else -# define GLM_RELAXED_CONSTEXPR const -#endif - -#if GLM_LANG >= GLM_LANG_CXX14 -# if ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER <= GLM_COMPILER_VC14)) // Visual C++ < 2017 does not support extended const expressions https://msdn.microsoft.com/en-us/library/hh567368.aspx https://github.com/g-truc/glm/issues/749 -# define GLM_CONSTEXPR_CXX14 -# else -# define GLM_CONSTEXPR_CXX14 GLM_CONSTEXPR -# endif -# define GLM_CONSTEXPR_CTOR_CXX14 GLM_CONSTEXPR_CTOR -#else -# define GLM_CONSTEXPR_CXX14 -# define GLM_CONSTEXPR_CTOR_CXX14 -#endif - -#if GLM_ARCH == GLM_ARCH_PURE -# define GLM_CONSTEXPR_SIMD GLM_CONSTEXPR_CTOR -#else -# define GLM_CONSTEXPR_SIMD -#endif +/////////////////////////////////////////////////////////////////////////////////// #ifdef GLM_FORCE_EXPLICIT_CTOR # define GLM_EXPLICIT explicit @@ -777,40 +613,38 @@ # define GLM_EXPLICIT #endif -/////////////////////////////////////////////////////////////////////////////////// - -#define GLM_HAS_ALIGNED_TYPE GLM_HAS_UNRESTRICTED_UNIONS - /////////////////////////////////////////////////////////////////////////////////// // Length type: all length functions returns a length_t type. // When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise // length_t is a typedef of int like GLSL defines it. -// User define: GLM_FORCE_SIZE_T_LENGTH +#define GLM_LENGTH_INT 1 +#define GLM_LENGTH_SIZE_T 2 + +#ifdef GLM_FORCE_SIZE_T_LENGTH +# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T +# define GLM_ASSERT_LENGTH(l, max) (assert ((l) < (max))) +#else +# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT +# define GLM_ASSERT_LENGTH(l, max) (assert ((l) >= 0 && (l) < (max))) +#endif namespace glm { using std::size_t; -# if defined(GLM_FORCE_SIZE_T_LENGTH) +# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T typedef size_t length_t; # else typedef int length_t; # endif }//namespace glm -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_FORCE_SIZE_T_LENGTH) -# define GLM_MESSAGE_FORCE_SIZE_T_LENGTH -# if defined GLM_FORCE_SIZE_T_LENGTH -# pragma message("GLM: .length() returns glm::length_t, a typedef of std::size_t") -# else -# pragma message("GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification") -# endif -#endif//GLM_MESSAGES - /////////////////////////////////////////////////////////////////////////////////// -// countof +// constexpr + +#if GLM_HAS_CONSTEXPR +# define GLM_CONFIG_CONSTEXP GLM_ENABLE -#if GLM_HAS_CONSTEXPR_PARTIAL namespace glm { template @@ -821,11 +655,312 @@ namespace glm }//namespace glm # define GLM_COUNTOF(arr) glm::countof(arr) #elif defined(_MSC_VER) +# define GLM_CONFIG_CONSTEXP GLM_DISABLE + # define GLM_COUNTOF(arr) _countof(arr) #else +# define GLM_CONFIG_CONSTEXP GLM_DISABLE + # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) #endif +/////////////////////////////////////////////////////////////////////////////////// +// uint + +namespace glm{ +namespace detail +{ + template + struct is_int + { + enum test {value = 0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + typedef unsigned int uint; +}//namespace glm + +/////////////////////////////////////////////////////////////////////////////////// +// 64-bit int + +#if GLM_HAS_EXTENDED_INTEGER_TYPE +# include +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::uint64_t uint64; + typedef std::int64_t int64; +# elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available + typedef uint64_t uint64; + typedef int64_t int64; +# elif GLM_COMPILER & GLM_COMPILER_VC + typedef unsigned __int64 uint64; + typedef signed __int64 int64; +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic ignored "-Wlong-long" + __extension__ typedef unsigned long long uint64; + __extension__ typedef signed long long int64; +# elif (GLM_COMPILER & GLM_COMPILER_CLANG) +# pragma clang diagnostic ignored "-Wc++11-long-long" + typedef unsigned long long uint64; + typedef signed long long int64; +# else//unknown compiler + typedef unsigned long long uint64; + typedef signed long long int64; +# endif +}//namespace detail +}//namespace glm + +/////////////////////////////////////////////////////////////////////////////////// +// make_unsigned + +#if GLM_HAS_MAKE_SIGNED +# include + +namespace glm{ +namespace detail +{ + using std::make_unsigned; +}//namespace detail +}//namespace glm + +#else + +namespace glm{ +namespace detail +{ + template + struct make_unsigned + {}; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned short type; + }; + + template<> + struct make_unsigned + { + typedef unsigned int type; + }; + + template<> + struct make_unsigned + { + typedef unsigned long type; + }; + + template<> + struct make_unsigned + { + typedef uint64 type; + }; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned short type; + }; + + template<> + struct make_unsigned + { + typedef unsigned int type; + }; + + template<> + struct make_unsigned + { + typedef unsigned long type; + }; + + template<> + struct make_unsigned + { + typedef uint64 type; + }; +}//namespace detail +}//namespace glm +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Only use x, y, z, w as vector type components + +#ifdef GLM_FORCE_XYZW_ONLY +# define GLM_CONFIG_XYZW_ONLY GLM_ENABLE +#else +# define GLM_CONFIG_XYZW_ONLY GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of defaulted initialized types + +#define GLM_CTOR_INIT_DISABLE 0 +#define GLM_CTOR_INITIALIZER_LIST 1 +#define GLM_CTOR_INITIALISATION 2 + +#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST +#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION +#else +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Use SIMD instruction sets + +#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) +# define GLM_CONFIG_SIMD GLM_ENABLE +#else +# define GLM_CONFIG_SIMD GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of defaulted function + +#if GLM_HAS_DEFAULTED_FUNCTIONS +# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE +# define GLM_DEFAULT = default +#else +# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE +# define GLM_DEFAULT +#endif + +#if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE && GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE +# define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_ENABLE +# define GLM_DEFAULT_CTOR GLM_DEFAULT +#else +# define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_DISABLE +# define GLM_DEFAULT_CTOR +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of aligned gentypes + +#ifdef GLM_FORCE_ALIGNED // Legacy define +# define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#endif + +#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +# define GLM_FORCE_ALIGNED_GENTYPES +#endif + +#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE)) +# define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE +#else +# define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of anonymous structure as implementation detail + +#if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)) +# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE +#else +# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Silent warnings + +#ifdef GLM_FORCE_WARNINGS +# define GLM_SILENT_WARNINGS GLM_DISABLE +#else +# define GLM_SILENT_WARNINGS GLM_ENABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Precision + +#define GLM_HIGHP 1 +#define GLM_MEDIUMP 2 +#define GLM_LOWP 3 + +#if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_INT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP +#endif + /////////////////////////////////////////////////////////////////////////////////// // Check inclusions of different versions of GLM @@ -833,4 +968,221 @@ namespace glm # error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error." #elif GLM_SETUP_INCLUDED == GLM_VERSION +/////////////////////////////////////////////////////////////////////////////////// +// Messages + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED) +# define GLM_MESSAGE_DISPLAYED +# define GLM_STR_HELPER(x) #x +# define GLM_STR(x) GLM_STR_HELPER(x) + + // Report GLM version +# pragma message ("GLM: version " GLM_STR(GLM_VERSION_MAJOR) "." GLM_STR(GLM_VERSION_MINOR) "." GLM_STR(GLM_VERSION_PATCH)) + + // Report C++ language +# if (GLM_LANG & GLM_LANG_CXX20_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 20 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX20_FLAG) +# pragma message("GLM: C++ 2A") +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 17 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) +# pragma message("GLM: C++ 17") +# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 14 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) +# pragma message("GLM: C++ 14") +# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 11 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) +# pragma message("GLM: C++ 11") +# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 0x with extensions") +# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) +# pragma message("GLM: C++ 0x") +# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 03 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) +# pragma message("GLM: C++ 03") +# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 98 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) +# pragma message("GLM: C++ 98") +# else +# pragma message("GLM: C++ language undetected") +# endif//GLM_LANG + + // Report compiler detection +# if GLM_COMPILER & GLM_COMPILER_CUDA +# pragma message("GLM: CUDA compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_HIP +# pragma message("GLM: HIP compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma message("GLM: Visual C++ compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma message("GLM: Clang compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# pragma message("GLM: Intel Compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma message("GLM: GCC compiler detected") +# else +# pragma message("GLM: Compiler not detected") +# endif + + // Report build target +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with AVX2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with AVX2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with AVX instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with AVX instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSSE3 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSSE3 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE3 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE3 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: ARM 64 bits with Neon instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: ARM 32 bits with Neon instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: ARM 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: ARM 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: MIPS 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: MIPS 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: PowerPC 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: PowerPC 32 bits build target") +# else +# pragma message("GLM: Unknown build target") +# endif//GLM_ARCH + + // Report platform name +# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) +# pragma message("GLM: QNX platform detected") +//# elif(GLM_PLATFORM & GLM_PLATFORM_IOS) +//# pragma message("GLM: iOS platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) +# pragma message("GLM: Apple platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) +# pragma message("GLM: WinCE platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) +# pragma message("GLM: Windows platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) +# pragma message("GLM: Native Client detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) +# pragma message("GLM: Android platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) +# pragma message("GLM: Linux platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) +# pragma message("GLM: UNIX platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) +# pragma message("GLM: platform unknown") +# else +# pragma message("GLM: platform not detected") +# endif + + // Report whether only xyzw component are used +# if defined GLM_FORCE_XYZW_ONLY +# pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.") +# endif + + // Report swizzle operator support +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.") +# elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.") +# else +# pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.") +# endif + + // Report .length() type +# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T +# pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.") +# else +# pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.") +# endif + +# if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.") +# else +# pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.") +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.") +# else +# pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.") +# endif + +# ifdef GLM_FORCE_SINGLE_ONLY +# pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.") +# endif + +# if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE) +# undef GLM_FORCE_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.") +# elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) +# undef GLM_FORCE_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") +# endif + +# if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE +# undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") +# elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.") +# endif +# endif + +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT +# pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.") +# else +# pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.") +# endif + +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT +# pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.") +# else +# pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.") +# endif +#endif//GLM_MESSAGES + #endif//GLM_SETUP_INCLUDED diff --git a/vendor/glm/detail/type_float.hpp b/vendor/glm/detail/type_float.hpp old mode 100755 new mode 100644 index 28abb5f848..c8037ebd7a --- a/vendor/glm/detail/type_float.hpp +++ b/vendor/glm/detail/type_float.hpp @@ -1,75 +1,68 @@ -/// @ref core -/// @file glm/detail/type_float.hpp - #pragma once #include "setup.hpp" +#if GLM_COMPILER == GLM_COMPILER_VC12 +# pragma warning(push) +# pragma warning(disable: 4512) // assignment operator could not be generated +#endif + namespace glm{ namespace detail { - typedef float float32; - -# ifndef GLM_FORCE_SINGLE_ONLY - typedef double float64; -# endif//GLM_FORCE_SINGLE_ONLY -}//namespace detail + template + union float_t + {}; - typedef float lowp_float_t; - typedef float mediump_float_t; - typedef double highp_float_t; + // https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ + template <> + union float_t + { + typedef int int_type; + typedef float float_type; - /// @addtogroup core_precision - /// @{ + GLM_CONSTEXPR float_t(float_type Num = 0.0f) : f(Num) {} - /// Low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.4 Floats - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef lowp_float_t lowp_float; + GLM_CONSTEXPR float_t& operator=(float_t const& x) + { + f = x.f; + return *this; + } - /// Medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.4 Floats - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mediump_float_t mediump_float; + // Portable extraction of components. + GLM_CONSTEXPR bool negative() const { return i < 0; } + GLM_CONSTEXPR int_type mantissa() const { return i & ((1 << 23) - 1); } + GLM_CONSTEXPR int_type exponent() const { return (i >> 23) & ((1 << 8) - 1); } - /// High qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.4 Floats - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef highp_float_t highp_float; + int_type i; + float_type f; + }; -#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_float float_t; -#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef highp_float float_t; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_float float_t; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_float float_t; -#else -# error "GLM error: multiple default precision requested for floating-point types" -#endif - - typedef float float32; + template <> + union float_t + { + typedef detail::int64 int_type; + typedef double float_type; -# ifndef GLM_FORCE_SINGLE_ONLY - typedef double float64; -# endif//GLM_FORCE_SINGLE_ONLY + GLM_CONSTEXPR float_t(float_type Num = static_cast(0)) : f(Num) {} -//////////////////// -// check type sizes -#ifndef GLM_STATIC_ASSERT_NULL - GLM_STATIC_ASSERT(sizeof(glm::float32) == 4, "float32 size isn't 4 bytes on this platform"); -# ifndef GLM_FORCE_SINGLE_ONLY - GLM_STATIC_ASSERT(sizeof(glm::float64) == 8, "float64 size isn't 8 bytes on this platform"); -# endif//GLM_FORCE_SINGLE_ONLY -#endif//GLM_STATIC_ASSERT_NULL + GLM_CONSTEXPR float_t& operator=(float_t const& x) + { + f = x.f; + return *this; + } - /// @} + // Portable extraction of components. + GLM_CONSTEXPR bool negative() const { return i < 0; } + GLM_CONSTEXPR int_type mantissa() const { return i & ((int_type(1) << 52) - 1); } + GLM_CONSTEXPR int_type exponent() const { return (i >> 52) & ((int_type(1) << 11) - 1); } + int_type i; + float_type f; + }; +}//namespace detail }//namespace glm + +#if GLM_COMPILER == GLM_COMPILER_VC12 +# pragma warning(pop) +#endif diff --git a/vendor/glm/detail/type_gentype.hpp b/vendor/glm/detail/type_gentype.hpp deleted file mode 100755 index b45cdf47b5..0000000000 --- a/vendor/glm/detail/type_gentype.hpp +++ /dev/null @@ -1,195 +0,0 @@ -/// @ref core -/// @file glm/detail/type_gentype.hpp - -#pragma once - -namespace glm -{ - enum profile - { - nice, - fast, - simd - }; - - typedef std::size_t sizeType; - -namespace detail -{ - template - < - typename VALTYPE, - template class TYPE - > - struct genType - { - public: - enum ctor{null}; - - typedef VALTYPE value_type; - typedef VALTYPE & value_reference; - typedef VALTYPE * value_pointer; - typedef VALTYPE const * value_const_pointer; - typedef TYPE bool_type; - - typedef sizeType size_type; - static bool is_vector(); - static bool is_matrix(); - - typedef TYPE type; - typedef TYPE * pointer; - typedef TYPE const * const_pointer; - typedef TYPE const * const const_pointer_const; - typedef TYPE * const pointer_const; - typedef TYPE & reference; - typedef TYPE const& const_reference; - typedef TYPE const& param_type; - - ////////////////////////////////////// - // Address (Implementation details) - - value_const_pointer value_address() const{return value_pointer(this);} - value_pointer value_address(){return value_pointer(this);} - - //protected: - // enum kind - // { - // GEN_TYPE, - // VEC_TYPE, - // MAT_TYPE - // }; - - // typedef typename TYPE::kind kind; - }; - - template - < - typename VALTYPE, - template class TYPE - > - bool genType::is_vector() - { - return true; - } -/* - template - class base - { - public: - ////////////////////////////////////// - // Traits - - typedef sizeType size_type; - typedef valTypeT value_type; - - typedef base class_type; - - typedef base bool_type; - typedef base col_type; - typedef base row_type; - typedef base transpose_type; - - static size_type col_size(); - static size_type row_size(); - static size_type value_size(); - static bool is_scalar(); - static bool is_vector(); - static bool is_matrix(); - - private: - // Data - col_type value[colT]; - - public: - ////////////////////////////////////// - // Constructors - base(); - base(class_type const& m); - - explicit base(T const& x); - explicit base(value_type const * const x); - explicit base(col_type const * const x); - - ////////////////////////////////////// - // Conversions - template - explicit base(base const& m); - - ////////////////////////////////////// - // Accesses - col_type& operator[](size_type i); - col_type const& operator[](size_type i) const; - - ////////////////////////////////////// - // Unary updatable operators - class_type& operator= (class_type const& x); - class_type& operator+= (T const& x); - class_type& operator+= (class_type const& x); - class_type& operator-= (T const& x); - class_type& operator-= (class_type const& x); - class_type& operator*= (T const& x); - class_type& operator*= (class_type const& x); - class_type& operator/= (T const& x); - class_type& operator/= (class_type const& x); - class_type& operator++ (); - class_type& operator-- (); - }; -*/ - - //template - //struct traits - //{ - // static const bool is_signed = false; - // static const bool is_float = false; - // static const bool is_vector = false; - // static const bool is_matrix = false; - // static const bool is_genType = false; - // static const bool is_genIType = false; - // static const bool is_genUType = false; - //}; - - //template<> - //struct traits - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template<> - //struct traits - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template<> - //struct traits - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template - //struct desc - //{ - // typedef genType type; - // typedef genType * pointer; - // typedef genType const* const_pointer; - // typedef genType const *const const_pointer_const; - // typedef genType *const pointer_const; - // typedef genType & reference; - // typedef genType const& const_reference; - // typedef genType const& param_type; - - // typedef typename genType::value_type value_type; - // typedef typename genType::size_type size_type; - // static const typename size_type value_size; - //}; - - //template - //const typename desc::size_type desc::value_size = genType::value_size(); - -}//namespace detail -}//namespace glm - -//#include "type_gentype.inl" diff --git a/vendor/glm/detail/type_gentype.inl b/vendor/glm/detail/type_gentype.inl deleted file mode 100755 index 60ffa9a9ec..0000000000 --- a/vendor/glm/detail/type_gentype.inl +++ /dev/null @@ -1,341 +0,0 @@ -/// @ref core -/// @file glm/detail/type_gentype.inl - -namespace glm{ -namespace detail{ - -///////////////////////////////// -// Static functions - -template -typename base::size_type base::col_size() -{ - return cT; -} - -template -typename base::size_type base::row_size() -{ - return rT; -} - -template -typename base::size_type base::value_size() -{ - return rT * cT; -} - -template -bool base::is_scalar() -{ - return rT == 1 && cT == 1; -} - -template -bool base::is_vector() -{ - return rT == 1; -} - -template -bool base::is_matrix() -{ - return rT != 1; -} - -///////////////////////////////// -// Constructor - -template -base::base() -{ - memset(&this->value, 0, cT * rT * sizeof(vT)); -} - -template -base::base -( - typename base::class_type const& m -) -{ - for - ( - typename genType::size_type i = typename base::size_type(0); - i < base::col_size(); - ++i - ) - { - this->value[i] = m[i]; - } -} - -template -base::base -( - typename base::T const& x -) -{ - if(rT == 1) // vector - { - for - ( - typename base::size_type i = typename base::size_type(0); - i < base::col_size(); - ++i - ) - { - this->value[i][rT] = x; - } - } - else // matrix - { - memset(&this->value, 0, cT * rT * sizeof(vT)); - - typename base::size_type stop = cT < rT ? cT : rT; - - for - ( - typename base::size_type i = typename base::size_type(0); - i < stop; - ++i - ) - { - this->value[i][i] = x; - } - } -} - -template -base::base -( - typename base::value_type const * const x -) -{ - memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); -} - -template -base::base -( - typename base::col_type const * const x -) -{ - for - ( - typename base::size_type i = typename base::size_type(0); - i < base::col_size(); - ++i - ) - { - this->value[i] = x[i]; - } -} - -template -template -base::base -( - base const& m -) -{ - for - ( - typename base::size_type i = typename base::size_type(0); - i < base::col_size(); - ++i - ) - { - this->value[i] = base(m[i]); - } -} - -////////////////////////////////////// -// Accesses - -template -typename base::col_type& base::operator[] -( - typename base::size_type i -) -{ - return this->value[i]; -} - -template -typename base::col_type const& base::operator[] -( - typename base::size_type i -) const -{ - return this->value[i]; -} - -////////////////////////////////////// -// Unary updatable operators - -template -typename base::class_type& base::operator= -( - typename base::class_type const& x -) -{ - memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); - return *this; -} - -template -typename base::class_type& base::operator+= -( - typename base::T const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] += x; - - return *this; -} - -template -typename base::class_type& base::operator+= -( - typename base::class_type const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] += x[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator-= -( - typename base::T const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] -= x; - - return *this; -} - -template -typename base::class_type& base::operator-= -( - typename base::class_type const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] -= x[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator*= -( - typename base::T const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] *= x; - - return *this; -} - -template -typename base::class_type& base::operator*= -( - typename base::class_type const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] *= x[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator/= -( - typename base::T const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] /= x; - - return *this; -} - -template -typename base::class_type& base::operator/= -( - typename base::class_type const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] /= x[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator++ () -{ - typename base::size_type stop_col = col_size(); - typename base::size_type stop_row = row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - ++this->value[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator-- () -{ - typename base::size_type stop_col = col_size(); - typename base::size_type stop_row = row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - --this->value[j][i]; - - return *this; -} - -} //namespace detail -} //namespace glm diff --git a/vendor/glm/detail/type_half.hpp b/vendor/glm/detail/type_half.hpp old mode 100755 new mode 100644 index 57f7dec6d7..40b8bec00d --- a/vendor/glm/detail/type_half.hpp +++ b/vendor/glm/detail/type_half.hpp @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/type_half.hpp - #pragma once #include "setup.hpp" diff --git a/vendor/glm/detail/type_half.inl b/vendor/glm/detail/type_half.inl old mode 100755 new mode 100644 index 29e8160b10..5d239cf22c --- a/vendor/glm/detail/type_half.inl +++ b/vendor/glm/detail/type_half.inl @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/type_half.inl - namespace glm{ namespace detail { @@ -9,7 +6,7 @@ namespace detail volatile float f = 1e10; for(int i = 0; i < 10; ++i) - f *= f; // this will overflow before the for loop terminates + f = f * f; // this will overflow before the for loop terminates return f; } @@ -23,12 +20,12 @@ namespace detail f(f_) {} - GLM_FUNC_QUALIFIER uif32(uint32 i_) : + GLM_FUNC_QUALIFIER uif32(unsigned int i_) : i(i_) {} float f; - uint32 i; + unsigned int i; }; GLM_FUNC_QUALIFIER float toFloat32(hdata value) @@ -115,7 +112,7 @@ namespace detail // Our floating point number, f, is represented by the bit // pattern in integer i. Disassemble that bit pattern into // the sign, s, the exponent, e, and the significand, m. - // Shift s into the position where it will go in in the + // Shift s into the position where it will go in the // resulting half number. // Adjust e, accounting for the different exponent bias // of float and half (127 versus 15). diff --git a/vendor/glm/detail/type_int.hpp b/vendor/glm/detail/type_int.hpp deleted file mode 100755 index c8b1d150f1..0000000000 --- a/vendor/glm/detail/type_int.hpp +++ /dev/null @@ -1,306 +0,0 @@ -/// @ref core -/// @file glm/detail/type_int.hpp - -#pragma once - -#include "setup.hpp" -#if GLM_HAS_MAKE_SIGNED -# include -#endif - -#if GLM_HAS_EXTENDED_INTEGER_TYPE -# include -#endif - -namespace glm{ -namespace detail -{ -# if GLM_HAS_EXTENDED_INTEGER_TYPE - typedef std::int8_t int8; - typedef std::int16_t int16; - typedef std::int32_t int32; - typedef std::int64_t int64; - - typedef std::uint8_t uint8; - typedef std::uint16_t uint16; - typedef std::uint32_t uint32; - typedef std::uint64_t uint64; -# else -# if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available - typedef int64_t sint64; - typedef uint64_t uint64; - -# elif GLM_COMPILER & GLM_COMPILER_VC - typedef signed __int64 sint64; - typedef unsigned __int64 uint64; - -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic ignored "-Wlong-long" - __extension__ typedef signed long long sint64; - __extension__ typedef unsigned long long uint64; - -# elif (GLM_COMPILER & GLM_COMPILER_CLANG) -# pragma clang diagnostic ignored "-Wc++11-long-long" - typedef signed long long sint64; - typedef unsigned long long uint64; - -# else//unknown compiler - typedef signed long long sint64; - typedef unsigned long long uint64; -# endif//GLM_COMPILER - - typedef signed char int8; - typedef signed short int16; - typedef signed int int32; - typedef sint64 int64; - - typedef unsigned char uint8; - typedef unsigned short uint16; - typedef unsigned int uint32; - typedef uint64 uint64; -#endif// - - typedef signed int lowp_int_t; - typedef signed int mediump_int_t; - typedef signed int highp_int_t; - - typedef unsigned int lowp_uint_t; - typedef unsigned int mediump_uint_t; - typedef unsigned int highp_uint_t; - -# if GLM_HAS_MAKE_SIGNED - using std::make_signed; - using std::make_unsigned; - -# else//GLM_HAS_MAKE_SIGNED - template - struct make_signed - {}; - - template<> - struct make_signed - { - typedef char type; - }; - - template<> - struct make_signed - { - typedef short type; - }; - - template<> - struct make_signed - { - typedef int type; - }; - - template<> - struct make_signed - { - typedef long type; - }; - - template<> - struct make_signed - { - typedef char type; - }; - - template<> - struct make_signed - { - typedef short type; - }; - - template<> - struct make_signed - { - typedef int type; - }; - - template<> - struct make_signed - { - typedef long type; - }; - - template - struct make_unsigned - {}; - - template<> - struct make_unsigned - { - typedef unsigned char type; - }; - - template<> - struct make_unsigned - { - typedef unsigned short type; - }; - - template<> - struct make_unsigned - { - typedef unsigned int type; - }; - - template<> - struct make_unsigned - { - typedef unsigned long type; - }; - - template<> - struct make_unsigned - { - typedef unsigned char type; - }; - - template<> - struct make_unsigned - { - typedef unsigned short type; - }; - - template<> - struct make_unsigned - { - typedef unsigned int type; - }; - - template<> - struct make_unsigned - { - typedef unsigned long type; - }; - - template<> - struct make_signed - { - typedef long long type; - }; - - template<> - struct make_signed - { - typedef long long type; - }; - - template<> - struct make_unsigned - { - typedef unsigned long long type; - }; - - template<> - struct make_unsigned - { - typedef unsigned long long type; - }; -# endif//GLM_HAS_MAKE_SIGNED -}//namespace detail - - typedef detail::int8 int8; - typedef detail::int16 int16; - typedef detail::int32 int32; - typedef detail::int64 int64; - - typedef detail::uint8 uint8; - typedef detail::uint16 uint16; - typedef detail::uint32 uint32; - typedef detail::uint64 uint64; - - /// @addtogroup core_precision - /// @{ - - /// Low qualifier signed integer. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.3 Integers - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef detail::lowp_int_t lowp_int; - - /// Medium qualifier signed integer. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.3 Integers - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef detail::mediump_int_t mediump_int; - - /// High qualifier signed integer. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.3 Integers - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef detail::highp_int_t highp_int; - - /// Low qualifier unsigned integer. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.3 Integers - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef detail::lowp_uint_t lowp_uint; - - /// Medium qualifier unsigned integer. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.3 Integers - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef detail::mediump_uint_t mediump_uint; - - /// High qualifier unsigned integer. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.3 Integers - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef detail::highp_uint_t highp_uint; - -#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) - typedef mediump_int int_t; -#elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) - typedef highp_int int_t; -#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) - typedef mediump_int int_t; -#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_int int_t; -#else -# error "GLM error: multiple default precision requested for signed integer types" -#endif - -#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) - typedef mediump_uint uint_t; -#elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) - typedef highp_uint uint_t; -#elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) - typedef mediump_uint uint_t; -#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_uint uint_t; -#else -# error "GLM error: multiple default precision requested for unsigned integer types" -#endif - - /// Unsigned integer type. - /// - /// @see GLSL 4.20.8 specification, section 4.1.3 Integers - typedef unsigned int uint; - - /// @} - -//////////////////// -// check type sizes -#ifndef GLM_STATIC_ASSERT_NULL - GLM_STATIC_ASSERT(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform"); - - GLM_STATIC_ASSERT(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform"); - GLM_STATIC_ASSERT(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform"); -#endif//GLM_STATIC_ASSERT_NULL - -}//namespace glm diff --git a/vendor/glm/detail/type_mat.hpp b/vendor/glm/detail/type_mat.hpp deleted file mode 100755 index db839b3b50..0000000000 --- a/vendor/glm/detail/type_mat.hpp +++ /dev/null @@ -1,766 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat.hpp - -#pragma once - -#include "qualifier.hpp" - -namespace glm{ -namespace detail -{ - template - struct outerProduct_trait{}; -}//namespace detail - -#if GLM_HAS_TEMPLATE_ALIASES - template using tmat2x2 = mat<2, 2, T, Q>; - template using tmat2x3 = mat<2, 3, T, Q>; - template using tmat2x4 = mat<2, 4, T, Q>; - template using tmat3x2 = mat<3, 2, T, Q>; - template using tmat3x3 = mat<3, 3, T, Q>; - template using tmat3x4 = mat<3, 4, T, Q>; - template using tmat4x2 = mat<4, 2, T, Q>; - template using tmat4x3 = mat<4, 3, T, Q>; - template using tmat4x4 = mat<4, 4, T, Q>; -#endif//GLM_HAS_TEMPLATE_ALIASES - - template - GLM_FUNC_DECL mat inverse(mat const& m); - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 2 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, lowp> lowp_mat2; - - /// 2 columns of 2 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, mediump> mediump_mat2; - - /// 2 columns of 2 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, highp> highp_mat2; - - /// 2 columns of 2 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, lowp> lowp_mat2x2; - - /// 2 columns of 2 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, mediump> mediump_mat2x2; - - /// 2 columns of 2 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, highp> highp_mat2x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 3 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, lowp> lowp_mat2x3; - - /// 2 columns of 3 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, mediump> mediump_mat2x3; - - /// 2 columns of 3 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, highp> highp_mat2x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 4 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, lowp> lowp_mat2x4; - - /// 2 columns of 4 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, mediump> mediump_mat2x4; - - /// 2 columns of 4 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, highp> highp_mat2x4; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 2 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, lowp> lowp_mat3x2; - - /// 3 columns of 2 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, mediump> mediump_mat3x2; - - /// 3 columns of 2 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, highp> highp_mat3x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 3 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, lowp> lowp_mat3; - - /// 3 columns of 3 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, mediump> mediump_mat3; - - /// 3 columns of 3 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, highp> highp_mat3; - - /// 3 columns of 3 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, lowp> lowp_mat3x3; - - /// 3 columns of 3 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, mediump> mediump_mat3x3; - - /// 3 columns of 3 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, highp> highp_mat3x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 4 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, lowp> lowp_mat3x4; - - /// 3 columns of 4 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, mediump> mediump_mat3x4; - - /// 3 columns of 4 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, highp> highp_mat3x4; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 2 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, lowp> lowp_mat4x2; - - /// 4 columns of 2 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, mediump> mediump_mat4x2; - - /// 4 columns of 2 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, highp> highp_mat4x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 3 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, lowp> lowp_mat4x3; - - /// 4 columns of 3 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, mediump> mediump_mat4x3; - - /// 4 columns of 3 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, highp> highp_mat4x3; - - /// @} - - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 4 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, lowp> lowp_mat4; - - /// 4 columns of 4 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, mediump> mediump_mat4; - - /// 4 columns of 4 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, highp> highp_mat4; - - /// 4 columns of 4 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, lowp> lowp_mat4x4; - - /// 4 columns of 4 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, mediump> mediump_mat4x4; - - /// 4 columns of 4 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, highp> highp_mat4x4; - - /// @} - - /// @addtogroup core_types - /// @{ - - ////////////////////////// - // Float definition - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_mat2x2 mat2x2; - typedef lowp_mat2x3 mat2x3; - typedef lowp_mat2x4 mat2x4; - typedef lowp_mat3x2 mat3x2; - typedef lowp_mat3x3 mat3x3; - typedef lowp_mat3x4 mat3x4; - typedef lowp_mat4x2 mat4x2; - typedef lowp_mat4x3 mat4x3; - typedef lowp_mat4x4 mat4x4; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef mediump_mat2x2 mat2x2; - typedef mediump_mat2x3 mat2x3; - typedef mediump_mat2x4 mat2x4; - typedef mediump_mat3x2 mat3x2; - typedef mediump_mat3x3 mat3x3; - typedef mediump_mat3x4 mat3x4; - typedef mediump_mat4x2 mat4x2; - typedef mediump_mat4x3 mat4x3; - typedef mediump_mat4x4 mat4x4; -#else - //! 2 columns of 2 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat2x2 mat2x2; - - //! 2 columns of 3 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat2x3 mat2x3; - - //! 2 columns of 4 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat2x4 mat2x4; - - //! 3 columns of 2 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat3x2 mat3x2; - - //! 3 columns of 3 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat3x3 mat3x3; - - //! 3 columns of 4 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat3x4 mat3x4; - - //! 4 columns of 2 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat4x2 mat4x2; - - //! 4 columns of 3 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat4x3 mat4x3; - - //! 4 columns of 4 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_mat4x4 mat4x4; - -#endif//GLM_PRECISION - - //! 2 columns of 2 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat2x2 mat2; - - //! 3 columns of 3 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat3x3 mat3; - - //! 4 columns of 4 components matrix of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat4x4 mat4; - - ////////////////////////// - // Double definition - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 2 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, lowp> lowp_dmat2; - - /// 2 columns of 2 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, mediump> mediump_dmat2; - - /// 2 columns of 2 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, highp> highp_dmat2; - - /// 2 columns of 2 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, lowp> lowp_dmat2x2; - - /// 2 columns of 2 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, mediump> mediump_dmat2x2; - - /// 2 columns of 2 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, highp> highp_dmat2x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 3 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, double, lowp> lowp_dmat2x3; - - /// 2 columns of 3 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, double, mediump> mediump_dmat2x3; - - /// 2 columns of 3 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, double, highp> highp_dmat2x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 2 columns of 4 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, double, lowp> lowp_dmat2x4; - - /// 2 columns of 4 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, double, mediump> mediump_dmat2x4; - - /// 2 columns of 4 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, double, highp> highp_dmat2x4; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 2 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, double, lowp> lowp_dmat3x2; - - /// 3 columns of 2 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, double, mediump> mediump_dmat3x2; - - /// 3 columns of 2 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, double, highp> highp_dmat3x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 3 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, lowp> lowp_dmat3; - - /// 3 columns of 3 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, mediump> mediump_dmat3; - - /// 3 columns of 3 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, highp> highp_dmat3; - - /// 3 columns of 3 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, lowp> lowp_dmat3x3; - - /// 3 columns of 3 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, mediump> mediump_dmat3x3; - - /// 3 columns of 3 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, highp> highp_dmat3x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 columns of 4 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, double, lowp> lowp_dmat3x4; - - /// 3 columns of 4 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, double, mediump> mediump_dmat3x4; - - /// 3 columns of 4 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, double, highp> highp_dmat3x4; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 2 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, double, lowp> lowp_dmat4x2; - - /// 4 columns of 2 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, double, mediump> mediump_dmat4x2; - - /// 4 columns of 2 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, double, highp> highp_dmat4x2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 3 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, double, lowp> lowp_dmat4x3; - - /// 4 columns of 3 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, double, mediump> mediump_dmat4x3; - - /// 4 columns of 3 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, double, highp> highp_dmat4x3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 columns of 4 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, lowp> lowp_dmat4; - - /// 4 columns of 4 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, mediump> mediump_dmat4; - - /// 4 columns of 4 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, highp> highp_dmat4; - - /// 4 columns of 4 components matrix of low qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, lowp> lowp_dmat4x4; - - /// 4 columns of 4 components matrix of medium qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, mediump> mediump_dmat4x4; - - /// 4 columns of 4 components matrix of high qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, highp> highp_dmat4x4; - - /// @} - -#if(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_dmat2x2 dmat2x2; - typedef lowp_dmat2x3 dmat2x3; - typedef lowp_dmat2x4 dmat2x4; - typedef lowp_dmat3x2 dmat3x2; - typedef lowp_dmat3x3 dmat3x3; - typedef lowp_dmat3x4 dmat3x4; - typedef lowp_dmat4x2 dmat4x2; - typedef lowp_dmat4x3 dmat4x3; - typedef lowp_dmat4x4 dmat4x4; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef mediump_dmat2x2 dmat2x2; - typedef mediump_dmat2x3 dmat2x3; - typedef mediump_dmat2x4 dmat2x4; - typedef mediump_dmat3x2 dmat3x2; - typedef mediump_dmat3x3 dmat3x3; - typedef mediump_dmat3x4 dmat3x4; - typedef mediump_dmat4x2 dmat4x2; - typedef mediump_dmat4x3 dmat4x3; - typedef mediump_dmat4x4 dmat4x4; -#else //defined(GLM_PRECISION_HIGHP_DOUBLE) - - //! 2 * 2 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat2x2 dmat2; - - //! 3 * 3 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat3x3 dmat3; - - //! 4 * 4 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat4x4 dmat4; - - //! 2 * 2 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat2x2 dmat2x2; - - //! 2 * 3 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat2x3 dmat2x3; - - //! 2 * 4 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat2x4 dmat2x4; - - //! 3 * 2 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat3x2 dmat3x2; - - /// 3 * 3 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat3x3 dmat3x3; - - /// 3 * 4 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat3x4 dmat3x4; - - /// 4 * 2 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat4x2 dmat4x2; - - /// 4 * 3 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat4x3 dmat4x3; - - /// 4 * 4 matrix of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef highp_dmat4x4 dmat4x4; - -#endif//GLM_PRECISION - - /// @} -}//namespace glm diff --git a/vendor/glm/detail/type_mat.inl b/vendor/glm/detail/type_mat.inl deleted file mode 100755 index 5714995417..0000000000 --- a/vendor/glm/detail/type_mat.inl +++ /dev/null @@ -1,3 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat.inl - diff --git a/vendor/glm/detail/type_mat2x2.hpp b/vendor/glm/detail/type_mat2x2.hpp old mode 100755 new mode 100644 index 47e28cba10..82e9f66cd5 --- a/vendor/glm/detail/type_mat2x2.hpp +++ b/vendor/glm/detail/type_mat2x2.hpp @@ -3,9 +3,7 @@ #pragma once -#include "../fwd.hpp" #include "type_vec2.hpp" -#include "type_mat.hpp" #include #include @@ -29,152 +27,149 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, P> const& m); + GLM_CTOR_DECL mat(mat<2, 2, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL GLM_EXPLICIT mat(T scalar); + GLM_CTOR_DECL mat( T const& x1, T const& y1, T const& x2, T const& y2); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v1, col_type const& v2); // -- Conversions -- template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( U const& x1, V const& y1, M const& x2, N const& y2); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<2, U, Q> const& v1, vec<2, V, Q> const& v2); // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, U, P> const& m); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 2, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q> & operator=(mat<2, 2, T, Q> const& v) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(U s); template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<2, 2, T, Q> & operator++ (); - GLM_FUNC_DECL mat<2, 2, T, Q> & operator-- (); - GLM_FUNC_DECL mat<2, 2, T, Q> operator++(int); - GLM_FUNC_DECL mat<2, 2, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator++ (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-- (); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m); template - GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m); template - GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); } //namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_mat2x2.inl b/vendor/glm/detail/type_mat2x2.inl old mode 100755 new mode 100644 index 72971d8c02..afb2b31e59 --- a/vendor/glm/detail/type_mat2x2.inl +++ b/vendor/glm/detail/type_mat2x2.inl @@ -1,184 +1,240 @@ -/// @ref core -/// @file glm/detail/type_mat2x2.inl - #include "../matrix.hpp" namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); # endif } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(T scalar) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(scalar, 0), col_type(0, scalar)} +# endif { - this->value[0] = col_type(scalar, 0); - this->value[1] = col_type(0, scalar); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(scalar, 0); + this->value[1] = col_type(0, scalar); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat ( T const& x0, T const& y0, T const& x1, T const& y1 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1)} +# endif { - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{v0, v1} +# endif { - this->value[0] = v0; - this->value[1] = v1; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; +# endif } // -- Conversion constructors -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat ( X1 const& x1, Y1 const& y1, X2 const& x2, Y2 const& y2 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(static_cast(x1), value_type(y1)), col_type(static_cast(x2), value_type(y2)) } +# endif { - this->value[0] = col_type(static_cast(x1), value_type(y1)); - this->value[1] = col_type(static_cast(x2), value_type(y2)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(static_cast(x1), value_type(y1)); + this->value[1] = col_type(static_cast(x2), value_type(y2)); +# endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif } // -- mat2x2 matrix conversions -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type const& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type const& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary updatable operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -187,7 +243,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(U scalar) { this->value[0] += scalar; this->value[1] += scalar; @@ -196,7 +252,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(mat<2, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(mat<2, 2, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -205,7 +261,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(U scalar) { this->value[0] -= scalar; this->value[1] -= scalar; @@ -214,7 +270,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(mat<2, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(mat<2, 2, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -223,7 +279,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(U scalar) { this->value[0] *= scalar; this->value[1] *= scalar; @@ -232,14 +288,14 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m) { return (*this = *this * m); } template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(U scalar) { this->value[0] /= scalar; this->value[1] /= scalar; @@ -248,7 +304,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m) { return *this *= inverse(m); } @@ -256,7 +312,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -264,7 +320,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -272,7 +328,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int) { mat<2, 2, T, Q> Result(*this); ++*this; @@ -280,7 +336,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int) { mat<2, 2, T, Q> Result(*this); --*this; @@ -290,13 +346,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m) { return mat<2, 2, T, Q>( -m[0], @@ -306,7 +362,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar) { return mat<2, 2, T, Q>( m[0] + scalar, @@ -314,7 +370,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m) { return mat<2, 2, T, Q>( m[0] + scalar, @@ -322,7 +378,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { return mat<2, 2, T, Q>( m1[0] + m2[0], @@ -330,7 +386,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar) { return mat<2, 2, T, Q>( m[0] - scalar, @@ -338,7 +394,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m) { return mat<2, 2, T, Q>( scalar - m[0], @@ -346,7 +402,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { return mat<2, 2, T, Q>( m1[0] - m2[0], @@ -354,7 +410,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar) { return mat<2, 2, T, Q>( m[0] * scalar, @@ -362,7 +418,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m) { return mat<2, 2, T, Q>( m[0] * scalar, @@ -370,7 +426,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator* ( mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v @@ -382,7 +438,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator* ( typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m @@ -394,7 +450,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { return mat<2, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], @@ -404,7 +460,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { return mat<3, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], @@ -416,7 +472,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { return mat<4, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], @@ -430,7 +486,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar) { return mat<2, 2, T, Q>( m[0] / scalar, @@ -438,7 +494,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m) { return mat<2, 2, T, Q>( scalar / m[0], @@ -446,19 +502,19 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v) { return inverse(m) * v; } template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m) { return v * inverse(m); } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { mat<2, 2, T, Q> m1_copy(m1); return m1_copy /= m2; @@ -467,13 +523,13 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]); } diff --git a/vendor/glm/detail/type_mat2x3.hpp b/vendor/glm/detail/type_mat2x3.hpp old mode 100755 new mode 100644 index 0f4b43adf9..b65d1c5c46 --- a/vendor/glm/detail/type_mat2x3.hpp +++ b/vendor/glm/detail/type_mat2x3.hpp @@ -3,10 +3,8 @@ #pragma once -#include "../fwd.hpp" #include "type_vec2.hpp" #include "type_vec3.hpp" -#include "type_mat.hpp" #include #include @@ -30,133 +28,130 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, P> const& m); + GLM_CTOR_DECL mat(mat<2, 3, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL GLM_EXPLICIT mat(T scalar); + GLM_CTOR_DECL mat( T x0, T y0, T z0, T x1, T y1, T z1); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1); // -- Conversions -- template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<3, U, Q> const& v1, vec<3, V, Q> const& v2); // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, U, P> const& m); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 3, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q> & operator=(mat<2, 3, T, Q> const& m) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<2, 3, T, Q> & operator++ (); - GLM_FUNC_DECL mat<2, 3, T, Q> & operator-- (); - GLM_FUNC_DECL mat<2, 3, T, Q> operator++(int); - GLM_FUNC_DECL mat<2, 3, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator++ (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-- (); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m); template - GLM_FUNC_DECL typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_mat2x3.inl b/vendor/glm/detail/type_mat2x3.inl old mode 100755 new mode 100644 index de9cbf0f3e..c29666c3b8 --- a/vendor/glm/detail/type_mat2x3.inl +++ b/vendor/glm/detail/type_mat2x3.inl @@ -1,61 +1,72 @@ -/// @ref core -/// @file glm/detail/type_mat2x3.inl - namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); # endif } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(T scalar) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(scalar, 0, 0), col_type(0, scalar, 0)} +# endif { - this->value[0] = col_type(scalar, 0, 0); - this->value[1] = col_type(0, scalar, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(scalar, 0, 0); + this->value[1] = col_type(0, scalar, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat ( T x0, T y0, T z0, T x1, T y1, T z1 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1)} +# endif { - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1)} +# endif { - this->value[0] = v0; - this->value[1] = v1; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); +# endif } // -- Conversion constructors -- @@ -64,121 +75,166 @@ namespace glm template< typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1), col_type(x2, y2, z2)} +# endif { - this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1)); - this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1); + this->value[1] = col_type(x2, y2, z2); +# endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif } // -- Matrix conversions -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type & mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type & mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type const& mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type const& mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary updatable operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -187,7 +243,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator+=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -196,7 +252,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator+=(mat<2, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator+=(mat<2, 3, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -205,7 +261,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -214,7 +270,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(mat<2, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(mat<2, 3, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -223,7 +279,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator*=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -232,7 +288,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator/=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -242,7 +298,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -250,7 +306,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -258,7 +314,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int) { mat<2, 3, T, Q> Result(*this); ++*this; @@ -266,7 +322,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int) { mat<2, 3, T, Q> Result(*this); --*this; @@ -276,13 +332,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m) { return mat<2, 3, T, Q>( -m[0], @@ -292,7 +348,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar) { return mat<2, 3, T, Q>( m[0] + scalar, @@ -300,7 +356,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { return mat<2, 3, T, Q>( m1[0] + m2[0], @@ -308,7 +364,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar) { return mat<2, 3, T, Q>( m[0] - scalar, @@ -316,7 +372,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { return mat<2, 3, T, Q>( m1[0] - m2[0], @@ -324,7 +380,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar) { return mat<2, 3, T, Q>( m[0] * scalar, @@ -332,7 +388,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m) { return mat<2, 3, T, Q>( m[0] * scalar, @@ -340,7 +396,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type operator* ( mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v) @@ -352,7 +408,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::row_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::row_type operator* ( typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m) @@ -363,7 +419,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { return mat<2, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], @@ -375,37 +431,22 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - T SrcA00 = m1[0][0]; - T SrcA01 = m1[0][1]; - T SrcA02 = m1[0][2]; - T SrcA10 = m1[1][0]; - T SrcA11 = m1[1][1]; - T SrcA12 = m1[1][2]; - - T SrcB00 = m2[0][0]; - T SrcB01 = m2[0][1]; - T SrcB10 = m2[1][0]; - T SrcB11 = m2[1][1]; - T SrcB20 = m2[2][0]; - T SrcB21 = m2[2][1]; - - mat<3, 3, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; - return Result; + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1]); } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { return mat<4, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], @@ -423,7 +464,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar) { return mat<2, 3, T, Q>( m[0] / scalar, @@ -431,7 +472,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m) { return mat<2, 3, T, Q>( scalar / m[0], @@ -441,13 +482,13 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]); } diff --git a/vendor/glm/detail/type_mat2x4.hpp b/vendor/glm/detail/type_mat2x4.hpp old mode 100755 new mode 100644 index 366f783860..7ca43e59a1 --- a/vendor/glm/detail/type_mat2x4.hpp +++ b/vendor/glm/detail/type_mat2x4.hpp @@ -3,10 +3,8 @@ #pragma once -#include "../fwd.hpp" #include "type_vec2.hpp" #include "type_vec4.hpp" -#include "type_mat.hpp" #include #include @@ -30,21 +28,20 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, P> const& m); + GLM_CTOR_DECL mat(mat<2, 4, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL GLM_EXPLICIT mat(T scalar); + GLM_CTOR_DECL mat( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1); @@ -53,112 +50,110 @@ namespace glm template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<4, U, Q> const& v1, vec<4, V, Q> const& v2); // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, U, P> const& m); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 4, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q> & operator=(mat<2, 4, T, Q> const& m) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<2, 4, T, Q> & operator++ (); - GLM_FUNC_DECL mat<2, 4, T, Q> & operator-- (); - GLM_FUNC_DECL mat<2, 4, T, Q> operator++(int); - GLM_FUNC_DECL mat<2, 4, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator++ (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-- (); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m); template - GLM_FUNC_DECL typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_mat2x4.inl b/vendor/glm/detail/type_mat2x4.inl old mode 100755 new mode 100644 index 0f3f631b6e..bde07ced09 --- a/vendor/glm/detail/type_mat2x4.inl +++ b/vendor/glm/detail/type_mat2x4.inl @@ -1,62 +1,72 @@ -/// @ref core -/// @file glm/detail/type_mat2x4.inl - namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); # endif } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0)} +# endif { - value_type const Zero(0); - this->value[0] = col_type(scalar, Zero, Zero, Zero); - this->value[1] = col_type(Zero, scalar, Zero, Zero); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat ( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0, w0), col_type(x1, y1, z1, w1)} +# endif { - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1)} +# endif { - this->value[0] = v0; - this->value[1] = v1; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; +# endif } // -- Conversion constructors -- @@ -65,121 +75,168 @@ namespace glm template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif { - this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1), value_type(w1)); - this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2), value_type(w2)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1, w1); + this->value[1] = col_type(x2, y2, z2, w2); +# endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif } // -- Matrix conversions -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type & mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type & mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type const& mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type const& mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary updatable operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -188,7 +245,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -197,7 +254,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(mat<2, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(mat<2, 4, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -206,7 +263,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -215,7 +272,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(mat<2, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(mat<2, 4, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -224,7 +281,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator*=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -233,7 +290,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> & mat<2, 4, T, Q>::operator/=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> & mat<2, 4, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -243,7 +300,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -251,7 +308,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -259,7 +316,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int) { mat<2, 4, T, Q> Result(*this); ++*this; @@ -267,7 +324,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int) { mat<2, 4, T, Q> Result(*this); --*this; @@ -277,13 +334,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m) { return mat<2, 4, T, Q>( -m[0], @@ -293,7 +350,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar) { return mat<2, 4, T, Q>( m[0] + scalar, @@ -301,7 +358,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { return mat<2, 4, T, Q>( m1[0] + m2[0], @@ -309,7 +366,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar) { return mat<2, 4, T, Q>( m[0] - scalar, @@ -317,7 +374,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { return mat<2, 4, T, Q>( m1[0] - m2[0], @@ -325,7 +382,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar) { return mat<2, 4, T, Q>( m[0] * scalar, @@ -333,7 +390,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m) { return mat<2, 4, T, Q>( m[0] * scalar, @@ -341,7 +398,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v) { return typename mat<2, 4, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y, @@ -351,7 +408,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m) { return typename mat<2, 4, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], @@ -359,48 +416,29 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - T SrcA00 = m1[0][0]; - T SrcA01 = m1[0][1]; - T SrcA02 = m1[0][2]; - T SrcA03 = m1[0][3]; - T SrcA10 = m1[1][0]; - T SrcA11 = m1[1][1]; - T SrcA12 = m1[1][2]; - T SrcA13 = m1[1][3]; - - T SrcB00 = m2[0][0]; - T SrcB01 = m2[0][1]; - T SrcB10 = m2[1][0]; - T SrcB11 = m2[1][1]; - T SrcB20 = m2[2][0]; - T SrcB21 = m2[2][1]; - T SrcB30 = m2[3][0]; - T SrcB31 = m2[3][1]; - - mat<4, 4, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31; - return Result; + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], + m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1], + m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1], + m1[0][3] * m2[3][0] + m1[1][3] * m2[3][1]); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2) { return mat<2, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], @@ -414,7 +452,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { return mat<3, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], @@ -432,7 +470,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar) { return mat<2, 4, T, Q>( m[0] / scalar, @@ -440,7 +478,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m) { return mat<2, 4, T, Q>( scalar / m[0], @@ -450,13 +488,13 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]); } diff --git a/vendor/glm/detail/type_mat3x2.hpp b/vendor/glm/detail/type_mat3x2.hpp old mode 100755 new mode 100644 index cb7f0bb537..0249befd4e --- a/vendor/glm/detail/type_mat3x2.hpp +++ b/vendor/glm/detail/type_mat3x2.hpp @@ -3,10 +3,8 @@ #pragma once -#include "../fwd.hpp" #include "type_vec2.hpp" #include "type_vec3.hpp" -#include "type_mat.hpp" #include #include @@ -30,22 +28,21 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, P> const& m); + GLM_CTOR_DECL mat(mat<3, 2, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL GLM_EXPLICIT mat(T scalar); + GLM_CTOR_DECL mat( T x0, T y0, T x1, T y1, T x2, T y2); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -56,13 +53,13 @@ namespace glm typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( X1 x1, Y1 y1, X2 x2, Y2 y2, X3 x3, Y3 y3); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3); @@ -70,100 +67,98 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, U, P> const& m); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 2, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q> & operator=(mat<3, 2, T, Q> const& m) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<3, 2, T, Q> & operator++ (); - GLM_FUNC_DECL mat<3, 2, T, Q> & operator-- (); - GLM_FUNC_DECL mat<3, 2, T, Q> operator++(int); - GLM_FUNC_DECL mat<3, 2, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator++ (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-- (); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m); template - GLM_FUNC_DECL typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); }//namespace glm diff --git a/vendor/glm/detail/type_mat3x2.inl b/vendor/glm/detail/type_mat3x2.inl old mode 100755 new mode 100644 index 9b789d0976..dc7654d1d5 --- a/vendor/glm/detail/type_mat3x2.inl +++ b/vendor/glm/detail/type_mat3x2.inl @@ -1,15 +1,15 @@ -/// @ref core -/// @file glm/detail/type_mat3x2.inl - namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1), col_type(0, 0)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); this->value[2] = col_type(0, 0); @@ -17,199 +17,243 @@ namespace glm } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0), col_type(0, s), col_type(0, 0)} +# endif { - this->value[0] = col_type(scalar, 0); - this->value[1] = col_type(0, scalar); - this->value[2] = col_type(0, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0); + this->value[1] = col_type(0, s); + this->value[2] = col_type(0, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat ( T x0, T y0, T x1, T y1, T x2, T y2 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} +# endif { - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat - ( - col_type const& v0, - col_type const& v1, - col_type const& v2 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; +# endif } // -- Conversion constructors -- template template< + typename X0, typename Y0, typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat + typename X2, typename Y2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat ( + X0 x0, Y0 y0, X1 x1, Y1 y1, - X2 x2, Y2 y2, - X3 x3, Y3 y3 + X2 x2, Y2 y2 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} +# endif { - this->value[0] = col_type(static_cast(x1), value_type(y1)); - this->value[1] = col_type(static_cast(x2), value_type(y2)); - this->value[2] = col_type(static_cast(x3), value_type(y3)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); +# endif } template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat - ( - vec<2, V1, Q> const& v1, - vec<2, V2, Q> const& v2, - vec<2, V3, Q> const& v3 - ) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif } // -- Matrix conversions -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(T(0)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(T(0)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type & mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type & mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type const& mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type const& mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary updatable operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -219,7 +263,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -229,7 +273,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(mat<3, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(mat<3, 2, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -239,7 +283,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -249,7 +293,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(mat<3, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(mat<3, 2, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -259,7 +303,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator*=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -269,7 +313,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> & mat<3, 2, T, Q>::operator/=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> & mat<3, 2, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -280,7 +324,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -289,7 +333,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -298,7 +342,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int) { mat<3, 2, T, Q> Result(*this); ++*this; @@ -306,7 +350,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int) { mat<3, 2, T, Q> Result(*this); --*this; @@ -316,13 +360,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m) { return mat<3, 2, T, Q>( -m[0], @@ -333,7 +377,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar) { return mat<3, 2, T, Q>( m[0] + scalar, @@ -342,7 +386,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { return mat<3, 2, T, Q>( m1[0] + m2[0], @@ -351,7 +395,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar) { return mat<3, 2, T, Q>( m[0] - scalar, @@ -360,7 +404,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { return mat<3, 2, T, Q>( m1[0] - m2[0], @@ -369,7 +413,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar) { return mat<3, 2, T, Q>( m[0] * scalar, @@ -378,7 +422,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m) { return mat<3, 2, T, Q>( m[0] * scalar, @@ -387,7 +431,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v) { return typename mat<3, 2, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, @@ -395,7 +439,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m) { return typename mat<3, 2, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1], @@ -404,32 +448,17 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - - mat<2, 2, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - return Result; + return mat<2, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2]); } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { return mat<3, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], @@ -441,7 +470,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { return mat<4, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], @@ -455,7 +484,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar) { return mat<3, 2, T, Q>( m[0] / scalar, @@ -464,7 +493,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m) { return mat<3, 2, T, Q>( scalar / m[0], @@ -475,13 +504,13 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); } diff --git a/vendor/glm/detail/type_mat3x3.hpp b/vendor/glm/detail/type_mat3x3.hpp old mode 100755 new mode 100644 index f6e2d159eb..e4cbbdceda --- a/vendor/glm/detail/type_mat3x3.hpp +++ b/vendor/glm/detail/type_mat3x3.hpp @@ -3,9 +3,7 @@ #pragma once -#include "../fwd.hpp" #include "type_vec3.hpp" -#include "type_mat.hpp" #include #include @@ -29,22 +27,21 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, P> const& m); + GLM_CTOR_DECL mat(mat<3, 3, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL GLM_EXPLICIT mat(T scalar); + GLM_CTOR_DECL mat( T x0, T y0, T z0, T x1, T y1, T z1, T x2, T y2, T z2); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -55,13 +52,13 @@ namespace glm typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3> - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2, X3 x3, Y3 y3, Z3 z3); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3); @@ -69,119 +66,117 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, U, P> const& m); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 3, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & operator=(mat<3, 3, T, Q> const& m) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator/=(U s); template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<3, 3, T, Q> & operator++(); - GLM_FUNC_DECL mat<3, 3, T, Q> & operator--(); - GLM_FUNC_DECL mat<3, 3, T, Q> operator++(int); - GLM_FUNC_DECL mat<3, 3, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m); template - GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m); template - GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_mat3x3.inl b/vendor/glm/detail/type_mat3x3.inl old mode 100755 new mode 100644 index 81338a35c9..d81bdf299f --- a/vendor/glm/detail/type_mat3x3.inl +++ b/vendor/glm/detail/type_mat3x3.inl @@ -1,75 +1,81 @@ -/// @ref core -/// @file glm/detail/type_mat3x3.inl - #include "../matrix.hpp" +#include "../common.hpp" namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT - this->value[0] = col_type(1, 0, 0); +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); this->value[2] = col_type(0, 0, 1); # endif } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s)} +# endif { - this->value[0] = col_type(scalar, 0, 0); - this->value[1] = col_type(0, scalar, 0); - this->value[2] = col_type(0, 0, scalar); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0); + this->value[1] = col_type(0, s, 0); + this->value[2] = col_type(0, 0, s); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat ( T x0, T y0, T z0, T x1, T y1, T z1, T x2, T y2, T z2 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2)} +# endif { - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat - ( - col_type const& v0, - col_type const& v1, - col_type const& v2 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif } // -- Conversion constructors -- @@ -79,139 +85,178 @@ namespace glm typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat ( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2, X3 x3, Y3 y3, Z3 z3 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif { - this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1)); - this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2)); - this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1); + this->value[1] = col_type(x2, y2, z2); + this->value[2] = col_type(x3, y3, z3); +# endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat - ( - vec<3, V1, Q> const& v1, - vec<3, V2, Q> const& v2, - vec<3, V3, Q> const& v3 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3)} +# endif { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); +# endif } // -- Matrix conversions -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type & mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type & mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary updatable operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -221,7 +266,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -231,7 +276,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(mat<3, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(mat<3, 3, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -241,7 +286,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -251,7 +296,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(mat<3, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(mat<3, 3, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -261,24 +306,25 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(U s) { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; + col_type sv(s); + this->value[0] *= sv; + this->value[1] *= sv; + this->value[2] *= sv; return *this; } template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m) { return (*this = *this * m); } template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -288,7 +334,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m) { return *this *= inverse(m); } @@ -296,7 +342,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -305,7 +351,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -314,7 +360,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int) { mat<3, 3, T, Q> Result(*this); ++*this; @@ -322,7 +368,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int) { mat<3, 3, T, Q> Result(*this); --*this; @@ -332,13 +378,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( -m[0], @@ -349,7 +395,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar) { return mat<3, 3, T, Q>( m[0] + scalar, @@ -358,7 +404,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( m[0] + scalar, @@ -367,7 +413,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { return mat<3, 3, T, Q>( m1[0] + m2[0], @@ -376,7 +422,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar) { return mat<3, 3, T, Q>( m[0] - scalar, @@ -385,7 +431,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( scalar - m[0], @@ -394,7 +440,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { return mat<3, 3, T, Q>( m1[0] - m2[0], @@ -403,7 +449,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar) { return mat<3, 3, T, Q>( m[0] * scalar, @@ -412,7 +458,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( m[0] * scalar, @@ -421,61 +467,89 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) { return typename mat<3, 3, T, Q>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); + m[0] * splatX(v) + m[1] * splatY(v) + m[2] * splatZ(v)); } template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) { return typename mat<3, 3, T, Q>::row_type( - m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, - m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, - m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA02 = m1[0][2]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA12 = m1[1][2]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA22 = m1[2][2]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB20 = m2[2][0]; - T const SrcB21 = m2[2][1]; - T const SrcB22 = m2[2][2]; - - mat<3, 3, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - return Result; + dot(m[0], v), + dot(m[1], v), + dot(m[2], v)); + } + + namespace detail + { + template + struct mul3x3 {}; + +#if GLM_CONFIG_SIMD == GLM_ENABLE + template + struct mul3x3 + { + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + typename mat<4, 4, T, Q>::col_type const SrcA0 = xyzz(m1[0]); + typename mat<4, 4, T, Q>::col_type const SrcA1 = xyzz(m1[1]); + typename mat<4, 4, T, Q>::col_type const SrcA2 = xyzz(m1[2]); + + typename mat<4, 4, T, Q>::col_type const SrcB0 = xyzz(m2[0]); + typename mat<4, 4, T, Q>::col_type const SrcB1 = xyzz(m2[1]); + typename mat<4, 4, T, Q>::col_type const SrcB2 = xyzz(m2[2]); + + typename mat<3, 3, T, Q>::col_type const tmp0 = xyz(glm::fma(SrcA2, splatZ(SrcB0), glm::fma(SrcA1, splatY(SrcB0), SrcA0 * splatX(SrcB0)))); + typename mat<3, 3, T, Q>::col_type const tmp1 = xyz(glm::fma(SrcA2, splatZ(SrcB1), glm::fma(SrcA1, splatY(SrcB1), SrcA0 * splatX(SrcB1)))); + typename mat<3, 3, T, Q>::col_type const tmp2 = xyz(glm::fma(SrcA2, splatZ(SrcB2), glm::fma(SrcA1, splatY(SrcB2), SrcA0 * splatX(SrcB2)))); + + return mat<3, 3, T, Q>(tmp0, tmp1, tmp2); + } + }; +#endif + template + struct mul3x3 + { + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + typename mat<3, 3, T, Q>::col_type const& SrcA0 = m1[0]; + typename mat<3, 3, T, Q>::col_type const& SrcA1 = m1[1]; + typename mat<3, 3, T, Q>::col_type const& SrcA2 = m1[2]; + + typename mat<3, 3, T, Q>::col_type const& SrcB0 = m2[0]; + typename mat<3, 3, T, Q>::col_type const& SrcB1 = m2[1]; + typename mat<3, 3, T, Q>::col_type const& SrcB2 = m2[2]; + + // note: the following lines are decomposed to have consistent results between simd and non simd code (prevent rounding error because of operation order) + //Result[0] = SrcA2 * SrcB0.z + SrcA1 * SrcB0.y + SrcA0 * SrcB0.x; + //Result[1] = SrcA2 * SrcB1.z + SrcA1 * SrcB1.y + SrcA0 * SrcB1.x; + //Result[2] = SrcA2 * SrcB2.z + SrcA1 * SrcB2.y + SrcA0 * SrcB2.x; + + typename mat<3, 3, T, Q>::col_type tmp0 = SrcA0 * SrcB0.x; + tmp0 += SrcA1 * SrcB0.y; + tmp0 += SrcA2 * SrcB0.z; + typename mat<3, 3, T, Q>::col_type tmp1 = SrcA0 * SrcB1.x; + tmp1 += SrcA1 * SrcB1.y; + tmp1 += SrcA2 * SrcB1.z; + typename mat<3, 3, T, Q>::col_type tmp2 = SrcA0 * SrcB2.x; + tmp2 += SrcA1 * SrcB2.y; + tmp2 += SrcA2 * SrcB2.z; + + return mat<3, 3, T, Q>(tmp0, tmp1, tmp2); + } + }; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return detail::mul3x3::value>::call(m1, m2); } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { return mat<2, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], @@ -487,7 +561,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { return mat<4, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], @@ -505,7 +579,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar) { return mat<3, 3, T, Q>( m[0] / scalar, @@ -514,7 +588,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m) { return mat<3, 3, T, Q>( scalar / m[0], @@ -523,19 +597,19 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) { return inverse(m) * v; } template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) { return v * inverse(m); } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { mat<3, 3, T, Q> m1_copy(m1); return m1_copy /= m2; @@ -544,13 +618,13 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); } diff --git a/vendor/glm/detail/type_mat3x4.hpp b/vendor/glm/detail/type_mat3x4.hpp old mode 100755 new mode 100644 index 7e02d6e622..f9913d271e --- a/vendor/glm/detail/type_mat3x4.hpp +++ b/vendor/glm/detail/type_mat3x4.hpp @@ -3,10 +3,8 @@ #pragma once -#include "../fwd.hpp" #include "type_vec3.hpp" #include "type_vec4.hpp" -#include "type_mat.hpp" #include #include @@ -30,22 +28,21 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, P> const& m); + GLM_CTOR_DECL mat(mat<3, 4, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL GLM_EXPLICIT mat(T scalar); + GLM_CTOR_DECL mat( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1, T x2, T y2, T z2, T w2); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -56,13 +53,13 @@ namespace glm typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2, X3 x3, Y3 y3, Z3 z3, W3 w3); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3); @@ -70,100 +67,98 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, U, P> const& m); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q> & operator=(mat<3, 4, T, Q> const& m) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<3, 4, T, Q> & operator++(); - GLM_FUNC_DECL mat<3, 4, T, Q> & operator--(); - GLM_FUNC_DECL mat<3, 4, T, Q> operator++(int); - GLM_FUNC_DECL mat<3, 4, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m); template - GLM_FUNC_DECL typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<3, 4, T, Q>::row_type operator*(typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 4, T, Q>::row_type operator*(typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_mat3x4.inl b/vendor/glm/detail/type_mat3x4.inl old mode 100755 new mode 100644 index c8562d154f..a4afac0da6 --- a/vendor/glm/detail/type_mat3x4.inl +++ b/vendor/glm/detail/type_mat3x4.inl @@ -1,15 +1,15 @@ -/// @ref core -/// @file glm/detail/type_mat3x4.inl - namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); this->value[2] = col_type(0, 0, 1, 0); @@ -17,199 +17,249 @@ namespace glm } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0)} +# endif { - this->value[0] = col_type(scalar, 0, 0, 0); - this->value[1] = col_type(0, scalar, 0, 0); - this->value[2] = col_type(0, 0, scalar, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); + this->value[2] = col_type(0, 0, s, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat ( T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1, T x2, T y2, T z2, T w2 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif { - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat - ( - col_type const& v0, - col_type const& v1, - col_type const& v2 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; +# endif } // -- Conversion constructors -- template template< + typename X0, typename Y0, typename Z0, typename W0, typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat + typename X2, typename Y2, typename Z2, typename W2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat ( + X0 x0, Y0 y0, Z0 z0, W0 w0, X1 x1, Y1 y1, Z1 z1, W1 w1, - X2 x2, Y2 y2, Z2 z2, W2 w2, - X3 x3, Y3 y3, Z3 z3, W3 w3 + X2 x2, Y2 y2, Z2 z2, W2 w2 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif { - this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1), value_type(w1)); - this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2), value_type(w2)); - this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3), value_type(w3)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); +# endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat - ( - vec<4, V1, Q> const& v1, - vec<4, V2, Q> const& v2, - vec<4, V3, Q> const& v3 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(vec<4, V1, Q> const& v0, vec<4, V2, Q> const& v1, vec<4, V3, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif } // -- Matrix conversions -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type & mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type & mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type const& mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type const& mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary updatable operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -219,7 +269,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -229,7 +279,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -239,7 +289,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -249,7 +299,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(mat<3, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(mat<3, 4, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -259,7 +309,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator*=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -269,7 +319,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> & mat<3, 4, T, Q>::operator/=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> & mat<3, 4, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -280,7 +330,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -289,7 +339,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -298,7 +348,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int) { mat<3, 4, T, Q> Result(*this); ++*this; @@ -306,7 +356,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int) { mat<3, 4, T, Q> Result(*this); --*this; @@ -316,13 +366,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m) { return mat<3, 4, T, Q>( -m[0], @@ -333,7 +383,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar) { return mat<3, 4, T, Q>( m[0] + scalar, @@ -342,7 +392,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { return mat<3, 4, T, Q>( m1[0] + m2[0], @@ -351,7 +401,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar) { return mat<3, 4, T, Q>( m[0] - scalar, @@ -360,7 +410,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { return mat<3, 4, T, Q>( m1[0] - m2[0], @@ -369,7 +419,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar) { return mat<3, 4, T, Q>( m[0] * scalar, @@ -378,7 +428,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m) { return mat<3, 4, T, Q>( m[0] * scalar, @@ -387,7 +437,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type operator* ( mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v @@ -401,7 +451,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::row_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::row_type operator* ( typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m @@ -414,56 +464,29 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA03 = m1[0][3]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA13 = m1[1][3]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA23 = m1[2][3]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - const T SrcB32 = m2[3][2]; - - mat<4, 4, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; - return Result; + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], + m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2], + m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2], + m1[0][3] * m2[3][0] + m1[1][3] * m2[3][1] + m1[2][3] * m2[3][2]); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2) { return mat<2, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], @@ -477,7 +500,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2) { return mat<3, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], @@ -495,7 +518,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar) { return mat<3, 4, T, Q>( m[0] / scalar, @@ -504,7 +527,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m) { return mat<3, 4, T, Q>( scalar / m[0], @@ -515,13 +538,13 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); } diff --git a/vendor/glm/detail/type_mat4x2.hpp b/vendor/glm/detail/type_mat4x2.hpp old mode 100755 new mode 100644 index 9064dd3c35..7057d4ce17 --- a/vendor/glm/detail/type_mat4x2.hpp +++ b/vendor/glm/detail/type_mat4x2.hpp @@ -3,10 +3,8 @@ #pragma once -#include "../fwd.hpp" #include "type_vec2.hpp" #include "type_vec4.hpp" -#include "type_mat.hpp" #include #include @@ -30,23 +28,22 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, P> const& m); + GLM_CTOR_DECL mat(mat<4, 2, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat(T scalar); + GLM_CTOR_DECL mat( T x0, T y0, T x1, T y1, T x2, T y2, T x3, T y3); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -55,18 +52,18 @@ namespace glm // -- Conversions -- template< + typename X0, typename Y0, typename X1, typename Y1, typename X2, typename Y2, - typename X3, typename Y3, - typename X4, typename Y4> - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + typename X3, typename Y3> + GLM_CTOR_DECL mat( + X0 x0, Y0 y0, X1 x1, Y1 y1, X2 x2, Y2 y2, - X3 x3, Y3 y3, - X4 x4, Y4 y4); + X3 x3, Y3 y3); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3, @@ -75,100 +72,98 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, U, P> const& m); + GLM_CTOR_DECL mat(mat<4, 2, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); + GLM_CTOR_DECL mat(mat<2, 2, T, Q> const& x); + GLM_CTOR_DECL mat(mat<3, 3, T, Q> const& x); + GLM_CTOR_DECL mat(mat<4, 4, T, Q> const& x); + GLM_CTOR_DECL mat(mat<2, 3, T, Q> const& x); + GLM_CTOR_DECL mat(mat<3, 2, T, Q> const& x); + GLM_CTOR_DECL mat(mat<2, 4, T, Q> const& x); + GLM_CTOR_DECL mat(mat<4, 3, T, Q> const& x); + GLM_CTOR_DECL mat(mat<3, 4, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q> & operator=(mat<4, 2, T, Q> const& m) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<4, 2, T, Q> & operator++ (); - GLM_FUNC_DECL mat<4, 2, T, Q> & operator-- (); - GLM_FUNC_DECL mat<4, 2, T, Q> operator++(int); - GLM_FUNC_DECL mat<4, 2, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator++ (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-- (); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m); template - GLM_FUNC_DECL typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_mat4x2.inl b/vendor/glm/detail/type_mat4x2.inl old mode 100755 new mode 100644 index f0ac30fe6d..0b7ff048c9 --- a/vendor/glm/detail/type_mat4x2.inl +++ b/vendor/glm/detail/type_mat4x2.inl @@ -1,15 +1,15 @@ -/// @ref core -/// @file glm/detail/type_mat4x2.inl - namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0); this->value[1] = col_type(0, 1); this->value[2] = col_type(0, 0); @@ -18,221 +18,261 @@ namespace glm } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0), col_type(0, s), col_type(0, 0), col_type(0, 0)} +# endif { - this->value[0] = col_type(scalar, 0); - this->value[1] = col_type(0, scalar); - this->value[2] = col_type(0, 0); - this->value[3] = col_type(0, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0); + this->value[1] = col_type(0, s); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat ( T x0, T y0, T x1, T y1, T x2, T y2, T x3, T y3 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} +# endif { - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - this->value[3] = col_type(x3, y3); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); + this->value[3] = col_type(x3, y3); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat - ( - col_type const& v0, - col_type const& v1, - col_type const& v2, - col_type const& v3 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif } // -- Conversion constructors -- template template< + typename X0, typename Y0, typename X1, typename Y1, typename X2, typename Y2, - typename X3, typename Y3, - typename X4, typename Y4> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat + typename X3, typename Y3> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat ( + X0 x0, Y0 y0, X1 x1, Y1 y1, X2 x2, Y2 y2, - X3 x3, Y3 y3, - X4 x4, Y4 y4 + X3 x3, Y3 y3 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} +# endif { - this->value[0] = col_type(static_cast(x1), value_type(y1)); - this->value[1] = col_type(static_cast(x2), value_type(y2)); - this->value[2] = col_type(static_cast(x3), value_type(y3)); - this->value[3] = col_type(static_cast(x4), value_type(y4)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); + this->value[3] = col_type(x3, y3); +# endif } template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat - ( - vec<2, V1, Q> const& v1, - vec<2, V2, Q> const& v2, - vec<2, V3, Q> const& v3, - vec<2, V4, Q> const& v4 - ) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); + this->value[3] = col_type(v3); +# endif } // -- Conversion -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type & mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type & mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type const& mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type const& mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary updatable operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -243,7 +283,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -254,7 +294,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -265,7 +305,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -276,7 +316,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -287,7 +327,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -298,7 +338,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -310,7 +350,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -320,7 +360,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -330,7 +370,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int) { mat<4, 2, T, Q> Result(*this); ++*this; @@ -338,7 +378,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int) { mat<4, 2, T, Q> Result(*this); --*this; @@ -348,13 +388,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m) { return mat<4, 2, T, Q>( -m[0], @@ -366,7 +406,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar) { return mat<4, 2, T, Q>( m[0] + scalar, @@ -376,7 +416,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { return mat<4, 2, T, Q>( m1[0] + m2[0], @@ -386,7 +426,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar) { return mat<4, 2, T, Q>( m[0] - scalar, @@ -396,7 +436,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { return mat<4, 2, T, Q>( m1[0] - m2[0], @@ -406,7 +446,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar) { return mat<4, 2, T, Q>( m[0] * scalar, @@ -416,7 +456,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m) { return mat<4, 2, T, Q>( m[0] * scalar, @@ -426,7 +466,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v) { return typename mat<4, 2, T, Q>::col_type( m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, @@ -434,7 +474,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m) { return typename mat<4, 2, T, Q>::row_type( v.x * m[0][0] + v.y * m[0][1], @@ -444,36 +484,17 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA30 = m1[3][0]; - T const SrcA31 = m1[3][1]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB03 = m2[0][3]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB13 = m2[1][3]; - - mat<2, 2, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - return Result; + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3]); } template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { return mat<3, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], @@ -485,7 +506,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { return mat<4, 2, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], @@ -499,7 +520,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar) { return mat<4, 2, T, Q>( m[0] / scalar, @@ -509,7 +530,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m) { return mat<4, 2, T, Q>( scalar / m[0], @@ -521,13 +542,13 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); } diff --git a/vendor/glm/detail/type_mat4x3.hpp b/vendor/glm/detail/type_mat4x3.hpp old mode 100755 new mode 100644 index a17add575d..52a38d871f --- a/vendor/glm/detail/type_mat4x3.hpp +++ b/vendor/glm/detail/type_mat4x3.hpp @@ -3,10 +3,8 @@ #pragma once -#include "../fwd.hpp" #include "type_vec3.hpp" #include "type_vec4.hpp" -#include "type_mat.hpp" #include #include @@ -30,23 +28,22 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, P> const& m); + GLM_CTOR_DECL mat(mat<4, 3, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T const& x); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL GLM_EXPLICIT mat(T s); + GLM_CTOR_DECL mat( T const& x0, T const& y0, T const& z0, T const& x1, T const& y1, T const& z1, T const& x2, T const& y2, T const& z2, T const& x3, T const& y3, T const& z3); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -59,14 +56,14 @@ namespace glm typename X2, typename Y2, typename Z2, typename X3, typename Y3, typename Z3, typename X4, typename Y4, typename Z4> - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( X1 const& x1, Y1 const& y1, Z1 const& z1, X2 const& x2, Y2 const& y2, Z2 const& z2, X3 const& x3, Y3 const& y3, Z3 const& z3, X4 const& x4, Y4 const& y4, Z4 const& z4); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, @@ -75,100 +72,98 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, U, P> const& m); + GLM_CTOR_DECL mat(mat<4, 3, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); + GLM_CTOR_DECL mat(mat<2, 2, T, Q> const& x); + GLM_CTOR_DECL mat(mat<3, 3, T, Q> const& x); + GLM_CTOR_DECL mat(mat<4, 4, T, Q> const& x); + GLM_CTOR_DECL mat(mat<2, 3, T, Q> const& x); + GLM_CTOR_DECL mat(mat<3, 2, T, Q> const& x); + GLM_CTOR_DECL mat(mat<2, 4, T, Q> const& x); + GLM_CTOR_DECL mat(mat<4, 2, T, Q> const& x); + GLM_CTOR_DECL mat(mat<3, 4, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q> & operator=(mat<4, 3, T, Q> const& m) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<4, 3, T, Q>& operator++(); - GLM_FUNC_DECL mat<4, 3, T, Q>& operator--(); - GLM_FUNC_DECL mat<4, 3, T, Q> operator++(int); - GLM_FUNC_DECL mat<4, 3, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(T scalar, mat<4, 3, T, Q> const& m); template - GLM_FUNC_DECL typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<4, 3, T, Q>::row_type operator*(typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 3, T, Q>::row_type operator*(typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator/(T scalar, mat<4, 3, T, Q> const& m); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_mat4x3.inl b/vendor/glm/detail/type_mat4x3.inl old mode 100755 new mode 100644 index df50b0018d..ab438ffce0 --- a/vendor/glm/detail/type_mat4x3.inl +++ b/vendor/glm/detail/type_mat4x3.inl @@ -1,15 +1,15 @@ -/// @ref core -/// @file glm/detail/type_mat4x3.inl - namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0); this->value[1] = col_type(0, 1, 0); this->value[2] = col_type(0, 0, 1); @@ -18,221 +18,261 @@ namespace glm } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s), col_type(0, 0, 0)} +# endif { - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - this->value[2] = col_type(0, 0, s); - this->value[3] = col_type(0, 0, 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0); + this->value[1] = col_type(0, s, 0); + this->value[2] = col_type(0, 0, s); + this->value[3] = col_type(0, 0, 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat ( T const& x0, T const& y0, T const& z0, T const& x1, T const& y1, T const& z1, T const& x2, T const& y2, T const& z2, T const& x3, T const& y3, T const& z3 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif { - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); - this->value[3] = col_type(x3, y3, z3); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); + this->value[3] = col_type(x3, y3, z3); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat - ( - col_type const& v0, - col_type const& v1, - col_type const& v2, - col_type const& v3 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif } // -- Conversion constructors -- template template< + typename X0, typename Y0, typename Z0, typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3, - typename X4, typename Y4, typename Z4> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat + typename X3, typename Y3, typename Z3> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat ( + X0 const& x0, Y0 const& y0, Z0 const& z0, X1 const& x1, Y1 const& y1, Z1 const& z1, X2 const& x2, Y2 const& y2, Z2 const& z2, - X3 const& x3, Y3 const& y3, Z3 const& z3, - X4 const& x4, Y4 const& y4, Z4 const& z4 + X3 const& x3, Y3 const& y3, Z3 const& z3 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif { - this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1)); - this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2)); - this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3)); - this->value[3] = col_type(static_cast(x4), value_type(y4), value_type(z4)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); + this->value[3] = col_type(x3, y3, z3); +# endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat - ( - vec<3, V1, Q> const& v1, - vec<3, V2, Q> const& v2, - vec<3, V3, Q> const& v3, - vec<3, V4, Q> const& v4 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, vec<3, V4, Q> const& v4) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} +# endif { - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); + this->value[3] = col_type(v4); +# endif } // -- Matrix conversions -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1), col_type(0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(m[3], 0)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(m[3], 0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); + this->value[3] = col_type(m[3], 0); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type & mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type & mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type const& mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type const& mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary updatable operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, T, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m) { this->value[0] = m[0]; this->value[1] = m[1]; @@ -243,7 +283,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -254,7 +294,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -265,7 +305,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -276,7 +316,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -287,7 +327,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator*=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -298,7 +338,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator/=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -310,7 +350,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -320,7 +360,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -330,7 +370,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int) { mat<4, 3, T, Q> Result(*this); ++*this; @@ -338,7 +378,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int) { mat<4, 3, T, Q> Result(*this); --*this; @@ -348,13 +388,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m) { return mat<4, 3, T, Q>( -m[0], @@ -366,17 +406,17 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T scalar) { return mat<4, 3, T, Q>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); + m[0] + scalar, + m[1] + scalar, + m[2] + scalar, + m[3] + scalar); } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { return mat<4, 3, T, Q>( m1[0] + m2[0], @@ -386,17 +426,17 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T scalar) { return mat<4, 3, T, Q>( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); + m[0] - scalar, + m[1] - scalar, + m[2] - scalar, + m[3] - scalar); } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { return mat<4, 3, T, Q>( m1[0] - m2[0], @@ -406,27 +446,27 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T scalar) { return mat<4, 3, T, Q>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(T scalar, mat<4, 3, T, Q> const& m) { return mat<4, 3, T, Q>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); } template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type operator* ( mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v) @@ -438,7 +478,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::row_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::row_type operator* ( typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m) @@ -451,7 +491,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { return mat<2, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], @@ -463,49 +503,22 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA02 = m1[0][2]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA12 = m1[1][2]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA22 = m1[2][2]; - T const SrcA30 = m1[3][0]; - T const SrcA31 = m1[3][1]; - T const SrcA32 = m1[3][2]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB03 = m2[0][3]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB13 = m2[1][3]; - T const SrcB20 = m2[2][0]; - T const SrcB21 = m2[2][1]; - T const SrcB22 = m2[2][2]; - T const SrcB23 = m2[2][3]; - - mat<3, 3, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; - return Result; + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3]); } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { return mat<4, 3, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], @@ -523,35 +536,35 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T scalar) { return mat<4, 3, T, Q>( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); + m[0] / scalar, + m[1] / scalar, + m[2] / scalar, + m[3] / scalar); } template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator/(T scalar, mat<4, 3, T, Q> const& m) { return mat<4, 3, T, Q>( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); + scalar / m[0], + scalar / m[1], + scalar / m[2], + scalar / m[3]); } // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); } diff --git a/vendor/glm/detail/type_mat4x4.hpp b/vendor/glm/detail/type_mat4x4.hpp old mode 100755 new mode 100644 index 694dcd0091..ad7597b8e2 --- a/vendor/glm/detail/type_mat4x4.hpp +++ b/vendor/glm/detail/type_mat4x4.hpp @@ -3,9 +3,7 @@ #pragma once -#include "../fwd.hpp" #include "type_vec4.hpp" -#include "type_mat.hpp" #include #include @@ -29,23 +27,22 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL col_type const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, P> const& m); + GLM_CTOR_DECL mat(mat<4, 4, T, P> const& m); - GLM_FUNC_DECL explicit GLM_CONSTEXPR_CTOR_CXX14 mat(T const& x); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL GLM_EXPLICIT mat(T s); + GLM_CTOR_DECL mat( T const& x0, T const& y0, T const& z0, T const& w0, T const& x1, T const& y1, T const& z1, T const& w1, T const& x2, T const& y2, T const& z2, T const& w2, T const& x3, T const& y3, T const& z3, T const& w3); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -58,14 +55,14 @@ namespace glm typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3, typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat( + GLM_CTOR_DECL mat( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, @@ -74,119 +71,117 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, U, P> const& m); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 4, U, P> const& m); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x); + GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x); // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q> & operator=(mat<4, 4, T, Q> const& m) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator+=(U s); template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator-=(U s); template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator*=(U s); template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator/=(U s); template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); // -- Increment and decrement operators -- - GLM_FUNC_DECL mat<4, 4, T, Q> & operator++(); - GLM_FUNC_DECL mat<4, 4, T, Q> & operator--(); - GLM_FUNC_DECL mat<4, 4, T, Q> operator++(int); - GLM_FUNC_DECL mat<4, 4, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator--(int); }; // -- Unary operators -- template - GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m); // -- Binary operators -- template - GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(T scalar, mat<4, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(T scalar, mat<4, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const& s); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(T scalar, mat<4, 4, T, Q> const& m); template - GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator*(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::row_type operator*(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T scalar); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(T scalar, mat<4, 4, T, Q> const& m); template - GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); template - GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); + GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); template - GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); template - GLM_FUNC_DECL bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_mat4x4.inl b/vendor/glm/detail/type_mat4x4.inl old mode 100755 new mode 100644 index 26157c6ae9..9b81203475 --- a/vendor/glm/detail/type_mat4x4.inl +++ b/vendor/glm/detail/type_mat4x4.inl @@ -1,17 +1,18 @@ -/// @ref core -/// @file glm/detail/type_mat4x4.inl - #include "../matrix.hpp" +#include "../geometric.hpp" namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat() + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif { -# ifdef GLM_FORCE_CTOR_INIT +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION this->value[0] = col_type(1, 0, 0, 0); this->value[1] = col_type(0, 1, 0, 0); this->value[2] = col_type(0, 0, 1, 0); @@ -20,74 +21,86 @@ namespace glm } # endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) - { + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS this->value[0] = m[0]; this->value[1] = m[1]; this->value[2] = m[2]; this->value[3] = m[3]; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0), col_type(0, 0, 0, s)} +# endif { - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); - this->value[2] = col_type(0, 0, s, 0); - this->value[3] = col_type(0, 0, 0, s); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); + this->value[2] = col_type(0, 0, s, 0); + this->value[3] = col_type(0, 0, 0, s); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat ( T const& x0, T const& y0, T const& z0, T const& w0, T const& x1, T const& y1, T const& z1, T const& w1, T const& x2, T const& y2, T const& z2, T const& w2, T const& x3, T const& y3, T const& z3, T const& w3 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2), + col_type(x3, y3, z3, w3)} +# endif { - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); - this->value[3] = col_type(x3, y3, z3, w3); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); + this->value[3] = col_type(x3, y3, z3, w3); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat - ( - col_type const& v0, - col_type const& v1, - col_type const& v2, - col_type const& v3 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif { - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif } // -- Conversions -- @@ -98,170 +111,200 @@ namespace glm typename X2, typename Y2, typename Z2, typename W2, typename X3, typename Y3, typename Z3, typename W3, typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat ( X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4 ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1, w1), col_type(x2, y2, z2, w2), col_type(x3, y3, z3, w3), col_type(x4, y4, z4, w4)} +# endif { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); - this->value[0] = col_type(static_cast(x1), value_type(y1), value_type(z1), value_type(w1)); - this->value[1] = col_type(static_cast(x2), value_type(y2), value_type(z2), value_type(w2)); - this->value[2] = col_type(static_cast(x3), value_type(y3), value_type(z3), value_type(w3)); - this->value[3] = col_type(static_cast(x4), value_type(y4), value_type(z4), value_type(w4)); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1, w1); + this->value[1] = col_type(x2, y2, z2, w2); + this->value[2] = col_type(x3, y3, z3, w3); + this->value[3] = col_type(x4, y4, z4, w4); +# endif } template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat - ( - vec<4, V1, Q> const& v1, - vec<4, V2, Q> const& v2, - vec<4, V3, Q> const& v3, - vec<4, V4, Q> const& v4 - ) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, vec<4, V4, Q> const& v4) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} +# endif { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); + this->value[3] = col_type(v4); +# endif } // -- Matrix conversions -- template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(0, 0, 0, 1)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - this->value[3] = col_type(0, 0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0), col_type(0, 0, 0, 1)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); - this->value[3] = col_type(0, 0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif { - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0, 0, 0, 1)} +# endif { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = col_type(0, 0, 0, 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = col_type(0, 0, 0, 1); +# endif } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(m[3], 1)} +# endif { - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - this->value[3] = col_type(m[3], 1); +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); + this->value[3] = col_type(m[3], 1); +# endif } // -- Accesses -- template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type & mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type & mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type const& mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type const& mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) const GLM_NOEXCEPT { - assert(i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); return this->value[i]; } // -- Unary arithmetic operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, T, Q> const& m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(valType)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m) { //memcpy could be faster //memcpy(&this->value, &m.value, 16 * sizeof(valType)); @@ -274,7 +317,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(U s) { this->value[0] += s; this->value[1] += s; @@ -285,7 +328,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(mat<4, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(mat<4, 4, U, Q> const& m) { this->value[0] += m[0]; this->value[1] += m[1]; @@ -296,7 +339,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(U s) { this->value[0] -= s; this->value[1] -= s; @@ -307,7 +350,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(mat<4, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(mat<4, 4, U, Q> const& m) { this->value[0] -= m[0]; this->value[1] -= m[1]; @@ -318,7 +361,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(U s) { this->value[0] *= s; this->value[1] *= s; @@ -329,14 +372,14 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m) { return (*this = *this * m); } template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(U s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(U s) { this->value[0] /= s; this->value[1] /= s; @@ -347,7 +390,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m) { return *this *= inverse(m); } @@ -355,7 +398,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++() { ++this->value[0]; ++this->value[1]; @@ -365,7 +408,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--() { --this->value[0]; --this->value[1]; @@ -375,7 +418,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int) { mat<4, 4, T, Q> Result(*this); ++*this; @@ -383,7 +426,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int) { mat<4, 4, T, Q> Result(*this); --*this; @@ -393,13 +436,13 @@ namespace glm // -- Unary constant operators -- template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m) { return m; } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m) { return mat<4, 4, T, Q>( -m[0], @@ -411,27 +454,27 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T scalar) { return mat<4, 4, T, Q>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); + m[0] + scalar, + m[1] + scalar, + m[2] + scalar, + m[3] + scalar); } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(T scalar, mat<4, 4, T, Q> const& m) { return mat<4, 4, T, Q>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); + m[0] + scalar, + m[1] + scalar, + m[2] + scalar, + m[3] + scalar); } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { return mat<4, 4, T, Q>( m1[0] + m2[0], @@ -441,27 +484,27 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T scalar) { return mat<4, 4, T, Q>( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); + m[0] - scalar, + m[1] - scalar, + m[2] - scalar, + m[3] - scalar); } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(T scalar, mat<4, 4, T, Q> const& m) { return mat<4, 4, T, Q>( - s - m[0], - s - m[1], - s - m[2], - s - m[3]); + scalar - m[0], + scalar - m[1], + scalar - m[2], + scalar - m[3]); } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { return mat<4, 4, T, Q>( m1[0] - m2[0], @@ -471,27 +514,27 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const & s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T scalar) { return mat<4, 4, T, Q>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(T scalar, mat<4, 4, T, Q> const& m) { return mat<4, 4, T, Q>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); } template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator* ( mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v @@ -539,21 +582,21 @@ namespace glm } template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator* + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::row_type operator* ( typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m ) { return typename mat<4, 4, T, Q>::row_type( - m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3], - m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3], - m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3], - m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]); + glm::dot(m[0], v), + glm::dot(m[1], v), + glm::dot(m[2], v), + glm::dot(m[3], v)); } template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) { return mat<2, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], @@ -567,7 +610,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) { return mat<3, 4, T, Q>( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], @@ -584,61 +627,119 @@ namespace glm m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]); } - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + namespace detail { - typename mat<4, 4, T, Q>::col_type const SrcA0 = m1[0]; - typename mat<4, 4, T, Q>::col_type const SrcA1 = m1[1]; - typename mat<4, 4, T, Q>::col_type const SrcA2 = m1[2]; - typename mat<4, 4, T, Q>::col_type const SrcA3 = m1[3]; + template + struct mul4x4 {}; + + template + struct mul4x4 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + typename mat<4, 4, T, Q>::col_type const SrcA0 = m1[0]; + typename mat<4, 4, T, Q>::col_type const SrcA1 = m1[1]; + typename mat<4, 4, T, Q>::col_type const SrcA2 = m1[2]; + typename mat<4, 4, T, Q>::col_type const SrcA3 = m1[3]; + + typename mat<4, 4, T, Q>::col_type const SrcB0 = m2[0]; + typename mat<4, 4, T, Q>::col_type const SrcB1 = m2[1]; + typename mat<4, 4, T, Q>::col_type const SrcB2 = m2[2]; + typename mat<4, 4, T, Q>::col_type const SrcB3 = m2[3]; + + typename mat<4, 4, T, Q>::col_type const tmp0 = glm::fma(SrcA3, splatW(SrcB0), glm::fma(SrcA2, splatZ(SrcB0), glm::fma(SrcA1, splatY(SrcB0), SrcA0 * splatX(SrcB0)))); + typename mat<4, 4, T, Q>::col_type const tmp1 = glm::fma(SrcA3, splatW(SrcB1), glm::fma(SrcA2, splatZ(SrcB1), glm::fma(SrcA1, splatY(SrcB1), SrcA0 * splatX(SrcB1)))); + typename mat<4, 4, T, Q>::col_type const tmp2 = glm::fma(SrcA3, splatW(SrcB2), glm::fma(SrcA2, splatZ(SrcB2), glm::fma(SrcA1, splatY(SrcB2), SrcA0 * splatX(SrcB2)))); + typename mat<4, 4, T, Q>::col_type const tmp3 = glm::fma(SrcA3, splatW(SrcB3), glm::fma(SrcA2, splatZ(SrcB3), glm::fma(SrcA1, splatY(SrcB3), SrcA0 * splatX(SrcB3)))); + + return mat < 4, 4, T, Q > (tmp0, tmp1, tmp2, tmp3); + } + }; - typename mat<4, 4, T, Q>::col_type const SrcB0 = m2[0]; - typename mat<4, 4, T, Q>::col_type const SrcB1 = m2[1]; - typename mat<4, 4, T, Q>::col_type const SrcB2 = m2[2]; - typename mat<4, 4, T, Q>::col_type const SrcB3 = m2[3]; + template + struct mul4x4 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + typename mat<4, 4, T, Q>::col_type const& SrcA0 = m1[0]; + typename mat<4, 4, T, Q>::col_type const& SrcA1 = m1[1]; + typename mat<4, 4, T, Q>::col_type const& SrcA2 = m1[2]; + typename mat<4, 4, T, Q>::col_type const& SrcA3 = m1[3]; - mat<4, 4, T, Q> Result; - Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; - Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; - Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; - Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3]; - return Result; + typename mat<4, 4, T, Q>::col_type const& SrcB0 = m2[0]; + typename mat<4, 4, T, Q>::col_type const& SrcB1 = m2[1]; + typename mat<4, 4, T, Q>::col_type const& SrcB2 = m2[2]; + typename mat<4, 4, T, Q>::col_type const& SrcB3 = m2[3]; + + // note: the following lines are decomposed to have consistent results between simd and non simd code (prevent rounding error because of operation order) + //Result[0] = SrcA3 * SrcB0.w + SrcA2 * SrcB0.z + SrcA1 * SrcB0.y + SrcA0 * SrcB0.x; + //Result[1] = SrcA3 * SrcB1.w + SrcA2 * SrcB1.z + SrcA1 * SrcB1.y + SrcA0 * SrcB1.x; + //Result[2] = SrcA3 * SrcB2.w + SrcA2 * SrcB2.z + SrcA1 * SrcB2.y + SrcA0 * SrcB2.x; + //Result[3] = SrcA3 * SrcB3.w + SrcA2 * SrcB3.z + SrcA1 * SrcB3.y + SrcA0 * SrcB3.x; + + typename mat<4, 4, T, Q>::col_type tmp0 = SrcA0 * SrcB0.x; + tmp0 += SrcA1 * SrcB0.y; + tmp0 += SrcA2 * SrcB0.z; + tmp0 += SrcA3 * SrcB0.w; + typename mat<4, 4, T, Q>::col_type tmp1 = SrcA0 * SrcB1.x; + tmp1 += SrcA1 * SrcB1.y; + tmp1 += SrcA2 * SrcB1.z; + tmp1 += SrcA3 * SrcB1.w; + typename mat<4, 4, T, Q>::col_type tmp2 = SrcA0 * SrcB2.x; + tmp2 += SrcA1 * SrcB2.y; + tmp2 += SrcA2 * SrcB2.z; + tmp2 += SrcA3 * SrcB2.w; + typename mat<4, 4, T, Q>::col_type tmp3 = SrcA0 * SrcB3.x; + tmp3 += SrcA1 * SrcB3.y; + tmp3 += SrcA2 * SrcB3.z; + tmp3 += SrcA3 * SrcB3.w; + + return mat<4, 4, T, Q>(tmp0, tmp1, tmp2, tmp3); + } + }; + } + + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return detail::mul4x4::value>::call(m1, m2); } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T scalar) { return mat<4, 4, T, Q>( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); + m[0] / scalar, + m[1] / scalar, + m[2] / scalar, + m[3] / scalar); } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(T scalar, mat<4, 4, T, Q> const& m) { return mat<4, 4, T, Q>( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); + scalar / m[0], + scalar / m[1], + scalar / m[2], + scalar / m[3]); } template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v) { return inverse(m) * v; } template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m) { return v * inverse(m); } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { mat<4, 4, T, Q> m1_copy(m1); return m1_copy /= m2; @@ -647,18 +748,18 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); } template - GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) { return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "type_mat4x4_simd.inl" #endif diff --git a/vendor/glm/detail/type_mat4x4_simd.inl b/vendor/glm/detail/type_mat4x4_simd.inl old mode 100755 new mode 100644 index 09d0b1f15e..fb3a16f062 --- a/vendor/glm/detail/type_mat4x4_simd.inl +++ b/vendor/glm/detail/type_mat4x4_simd.inl @@ -1,5 +1,4 @@ /// @ref core -/// @file glm/detail/type_mat4x4_sse2.inl namespace glm { diff --git a/vendor/glm/detail/type_quat.hpp b/vendor/glm/detail/type_quat.hpp new file mode 100644 index 0000000000..1b41e15602 --- /dev/null +++ b/vendor/glm/detail/type_quat.hpp @@ -0,0 +1,193 @@ +/// @ref core +/// @file glm/detail/type_quat.hpp + +#pragma once + +// Dependency: +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat4x4.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" +#include "../ext/vector_relational.hpp" +#include "../ext/quaternion_relational.hpp" +#include "../gtc/constants.hpp" +#include "../gtc/matrix_transform.hpp" + +namespace glm +{ +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + + template + struct qua + { + // -- Implementation detail -- + + typedef qua type; + typedef T value_type; + + // -- Data -- + +# if GLM_LANG & GLM_LANG_CXXMS_FLAG + union + { +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + struct { T w, x, y, z; }; +# else + struct { T x, y, z, w; }; +# endif + + typename detail::storage<4, T, detail::is_aligned::value>::type data; + }; +# else +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + T w, x, y, z; +# else + T x, y, z, w; +# endif +# endif + + // -- Component accesses -- + + typedef length_t length_type; + + /// Return the count of components of a quaternion + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR qua() GLM_DEFAULT_CTOR; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR qua(qua const& q) GLM_DEFAULT; + template + GLM_CTOR_DECL qua(qua const& q); + + // -- Explicit basic constructors -- + + GLM_CTOR_DECL qua(T s, vec<3, T, Q> const& v); + +# ifdef GLM_FORCE_QUAT_DATA_XYZW + GLM_CTOR_DECL qua(T x, T y, T z, T w); +# else + GLM_CTOR_DECL qua(T w, T x, T y, T z); +# endif + + GLM_FUNC_DECL static GLM_CONSTEXPR qua wxyz(T w, T x, T y, T z); + + // -- Conversion constructors -- + + template + GLM_CTOR_DECL GLM_EXPLICIT qua(qua const& q); + + /// Explicit conversion operators +# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>() const; + GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>() const; +# endif + + /// Create a quaternion from two normalized axis + /// + /// @param u A first normalized axis + /// @param v A second normalized axis + /// @see gtc_quaternion + /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors + GLM_FUNC_DISCARD_DECL qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v); + + /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. + GLM_CTOR_DECL GLM_EXPLICIT qua(vec<3, T, Q> const& eulerAngles); + GLM_CTOR_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q> const& q); + GLM_CTOR_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q> const& q); + + // -- Unary arithmetic operators -- + + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q) GLM_DEFAULT; + + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator=(qua const& q); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator+=(qua const& q); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator-=(qua const& q); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator*=(qua const& q); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator*=(U s); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator/=(U s); + }; + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator+(qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator-(qua const& q); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator+(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator-(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(qua const& q, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(qua const& q, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(qua const& q, T const& s); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(T const& s, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator/(qua const& q, T const& s); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(qua const& q1, qua const& q2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(qua const& q1, qua const& q2); +} //namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_quat.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_quat.inl b/vendor/glm/detail/type_quat.inl new file mode 100644 index 0000000000..6a8f9871bc --- /dev/null +++ b/vendor/glm/detail/type_quat.inl @@ -0,0 +1,424 @@ +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include "../ext/quaternion_common.hpp" +#include "../ext/quaternion_geometric.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = GENTYPE_QUAT; + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(qua const& a, qua const& b) + { + vec<4, T, Q> tmp(a.w * b.w, a.x * b.x, a.y * b.y, a.z * b.z); + return (tmp.x + tmp.y) + (tmp.z + tmp.w); + } + }; + + template + struct compute_quat_add + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) + { + return qua::wxyz(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); + } + }; + + template + struct compute_quat_sub + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) + { + return qua::wxyz(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); + } + }; + + template + struct compute_quat_mul_scalar + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) + { + return qua::wxyz(q.w * s, q.x * s, q.y * s, q.z * s); + } + }; + + template + struct compute_quat_div_scalar + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) + { + return qua::wxyz(q.w / s, q.x / s, q.y / s, q.z / s); + } + }; + + template + struct compute_quat_mul_vec4 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(qua const& q, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); + } + }; +}//namespace detail + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua::operator[](typename qua::length_type i) + { + GLM_ASSERT_LENGTH(i, this->length()); +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + return (&w)[i]; +# else + return (&x)[i]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua::operator[](typename qua::length_type i) const + { + GLM_ASSERT_LENGTH(i, this->length()); +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + return (&w)[i]; +# else + return (&x)[i]; +# endif + } + + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR qua::qua() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(1), x(0), y(0), z(0) +# else + : x(0), y(0), z(0), w(1) +# endif +# endif + {} +# endif + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(q.w), x(q.x), y(q.y), z(q.z) +# else + : x(q.x), y(q.y), z(q.z), w(q.w) +# endif + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(q.w), x(q.x), y(q.y), z(q.z) +# else + : x(q.x), y(q.y), z(q.z), w(q.w) +# endif + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T s, vec<3, T, Q> const& v) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(s), x(v.x), y(v.y), z(v.z) +# else + : x(v.x), y(v.y), z(v.z), w(s) +# endif + {} + + template +# ifdef GLM_FORCE_QUAT_DATA_XYZW + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _x, T _y, T _z, T _w) +# else + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _w, T _x, T _y, T _z) +# endif +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(_w), x(_x), y(_y), z(_z) +# else + : x(_x), y(_y), z(_z), w(_w) +# endif + {} + + template + GLM_CONSTEXPR qua qua::wxyz(T w, T x, T y, T z) { +# ifdef GLM_FORCE_QUAT_DATA_XYZW + return qua(x, y, z, w); +# else + return qua(w, x, y, z); +# endif + } + + // -- Conversion constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + : w(static_cast(q.w)), x(static_cast(q.x)), y(static_cast(q.y)), z(static_cast(q.z)) +# else + : x(static_cast(q.x)), y(static_cast(q.y)), z(static_cast(q.z)), w(static_cast(q.w)) +# endif + {} + + //template + //GLM_FUNC_QUALIFIER qua::qua + //( + // valType const& pitch, + // valType const& yaw, + // valType const& roll + //) + //{ + // vec<3, valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5)); + // vec<3, valType> c = glm::cos(eulerAngle * valType(0.5)); + // vec<3, valType> s = glm::sin(eulerAngle * valType(0.5)); + // + // this->w = c.x * c.y * c.z + s.x * s.y * s.z; + // this->x = s.x * c.y * c.z - c.x * s.y * s.z; + // this->y = c.x * s.y * c.z + s.x * c.y * s.z; + // this->z = c.x * c.y * s.z - s.x * s.y * c.z; + //} + + template + GLM_FUNC_QUALIFIER qua::qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v) + { + T norm_u_norm_v = sqrt(dot(u, u) * dot(v, v)); + T real_part = norm_u_norm_v + dot(u, v); + vec<3, T, Q> t; + + if(real_part < static_cast(1.e-6f) * norm_u_norm_v) + { + // If u and v are exactly opposite, rotate 180 degrees + // around an arbitrary orthogonal axis. Axis normalisation + // can happen later, when we normalise the quaternion. + real_part = static_cast(0); + t = abs(u.x) > abs(u.z) ? vec<3, T, Q>(-u.y, u.x, static_cast(0)) : vec<3, T, Q>(static_cast(0), -u.z, u.y); + } + else + { + // Otherwise, build quaternion the standard way. + t = cross(u, v); + } + + *this = normalize(qua::wxyz(real_part, t.x, t.y, t.z)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(vec<3, T, Q> const& eulerAngle) + { + vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5)); + vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5)); + + this->w = c.x * c.y * c.z + s.x * s.y * s.z; + this->x = s.x * c.y * c.z - c.x * s.y * s.z; + this->y = c.x * s.y * c.z + s.x * c.y * s.z; + this->z = c.x * c.y * s.z - s.x * s.y * c.z; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(mat<3, 3, T, Q> const& m) + { + *this = quat_cast(m); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(mat<4, 4, T, Q> const& m) + { + *this = quat_cast(m); + } + +# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + template + GLM_FUNC_QUALIFIER qua::operator mat<3, 3, T, Q>() const + { + return mat3_cast(*this); + } + + template + GLM_FUNC_QUALIFIER qua::operator mat<4, 4, T, Q>() const + { + return mat4_cast(*this); + } +# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) + { + this->w = q.w; + this->x = q.x; + this->y = q.y; + this->z = q.z; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) + { + this->w = static_cast(q.w); + this->x = static_cast(q.x); + this->y = static_cast(q.y); + this->z = static_cast(q.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator+=(qua const& q) + { + return (*this = detail::compute_quat_add::value>::call(*this, qua(q))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator-=(qua const& q) + { + return (*this = detail::compute_quat_sub::value>::call(*this, qua(q))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator*=(qua const& r) + { + qua const p(*this); + qua const q(r); + + this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z; + this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y; + this->y = p.w * q.y + p.y * q.w + p.z * q.x - p.x * q.z; + this->z = p.w * q.z + p.z * q.w + p.x * q.y - p.y * q.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator*=(U s) + { + return (*this = detail::compute_quat_mul_scalar::value>::call(*this, static_cast(s))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator/=(U s) + { + return (*this = detail::compute_quat_div_scalar::value>::call(*this, static_cast(s))); + } + + // -- Unary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator+(qua const& q) + { + return q; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q) + { + return qua::wxyz(-q.w, -q.x, -q.y, -q.z); + } + + // -- Binary operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator+(qua const& q, qua const& p) + { + return qua(q) += p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q, qua const& p) + { + return qua(q) -= p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, qua const& p) + { + return qua(q) *= p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(qua const& q, vec<3, T, Q> const& v) + { + vec<3, T, Q> const QuatVector(q.x, q.y, q.z); + vec<3, T, Q> const uv(glm::cross(QuatVector, v)); + vec<3, T, Q> const uuv(glm::cross(QuatVector, uv)); + + return v + ((uv * q.w) + uuv) * static_cast(2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(qua const& q, vec<4, T, Q> const& v) + { + return detail::compute_quat_mul_vec4::value>::call(q, v); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, T const& s) + { + return qua::wxyz( + q.w * s, q.x * s, q.y * s, q.z * s); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(T const& s, qua const& q) + { + return q * s; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator/(qua const& q, T const& s) + { + return qua::wxyz( + q.w / s, q.x / s, q.y / s, q.z / s); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(qua const& q1, qua const& q2) + { + return q1.x == q2.x && q1.y == q2.y && q1.z == q2.z && q1.w == q2.w; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(qua const& q1, qua const& q2) + { + return q1.x != q2.x || q1.y != q2.y || q1.z != q2.z || q1.w != q2.w; + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_quat_simd.inl" +#endif + diff --git a/vendor/glm/detail/type_quat_simd.inl b/vendor/glm/detail/type_quat_simd.inl new file mode 100644 index 0000000000..7f673c6f4d --- /dev/null +++ b/vendor/glm/detail/type_quat_simd.inl @@ -0,0 +1,208 @@ +/// @ref core + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ +/* + template + struct compute_quat_mul + { + static qua call(qua const& q1, qua const& q2) + { + // SSE2 STATS: 11 shuffle, 8 mul, 8 add + // SSE4 STATS: 3 shuffle, 4 mul, 4 dpps + + __m128 const mul0 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(0, 1, 2, 3))); + __m128 const mul1 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(1, 0, 3, 2))); + __m128 const mul2 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(2, 3, 0, 1))); + __m128 const mul3 = _mm_mul_ps(q1.data, q2.data); + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + __m128 const add0 = _mm_dp_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f), 0xff); + __m128 const add1 = _mm_dp_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f), 0xff); + __m128 const add2 = _mm_dp_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f), 0xff); + __m128 const add3 = _mm_dp_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f), 0xff); +# else + __m128 const mul4 = _mm_mul_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f)); + __m128 const add0 = _mm_add_ps(mul0, _mm_movehl_ps(mul4, mul4)); + __m128 const add4 = _mm_add_ss(add0, _mm_shuffle_ps(add0, add0, 1)); + + __m128 const mul5 = _mm_mul_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f)); + __m128 const add1 = _mm_add_ps(mul1, _mm_movehl_ps(mul5, mul5)); + __m128 const add5 = _mm_add_ss(add1, _mm_shuffle_ps(add1, add1, 1)); + + __m128 const mul6 = _mm_mul_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f)); + __m128 const add2 = _mm_add_ps(mul6, _mm_movehl_ps(mul6, mul6)); + __m128 const add6 = _mm_add_ss(add2, _mm_shuffle_ps(add2, add2, 1)); + + __m128 const mul7 = _mm_mul_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f)); + __m128 const add3 = _mm_add_ps(mul3, _mm_movehl_ps(mul7, mul7)); + __m128 const add7 = _mm_add_ss(add3, _mm_shuffle_ps(add3, add3, 1)); + #endif + + // This SIMD code is a politically correct way of doing this, but in every test I've tried it has been slower than + // the final code below. I'll keep this here for reference - maybe somebody else can do something better... + // + //__m128 xxyy = _mm_shuffle_ps(add4, add5, _MM_SHUFFLE(0, 0, 0, 0)); + //__m128 zzww = _mm_shuffle_ps(add6, add7, _MM_SHUFFLE(0, 0, 0, 0)); + // + //return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0)); + + qua Result; + _mm_store_ss(&Result.x, add4); + _mm_store_ss(&Result.y, add5); + _mm_store_ss(&Result.z, add6); + _mm_store_ss(&Result.w, add7); + return Result; + } + }; +*/ + + template + struct compute_quat_add + { + static qua call(qua const& q, qua const& p) + { + qua Result; + Result.data = _mm_add_ps(q.data, p.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_add + { + static qua call(qua const& a, qua const& b) + { + qua Result; + Result.data = _mm256_add_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_quat_sub + { + static qua call(qua const& q, qua const& p) + { + qua Result; + Result.data = _mm_sub_ps(q.data, p.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_sub + { + static qua call(qua const& a, qua const& b) + { + qua Result; + Result.data = _mm256_sub_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_quat_mul_scalar + { + static qua call(qua const& q, float s) + { + qua Result; + Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s)); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_mul_scalar + { + static qua call(qua const& q, double s) + { + qua Result; + Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s)); + return Result; + } + }; +# endif + + template + struct compute_quat_div_scalar + { + static qua call(qua const& q, float s) + { + qua Result; + Result.data = _mm_div_ps(q.data, _mm_set_ps1(s)); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_div_scalar + { + static qua call(qua const& q, double s) + { + qua Result; + Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s)); + return Result; + } + }; +# endif + + template + struct compute_quat_mul_vec4 + { + static vec<4, float, Q> call(qua const& q, vec<4, float, Q> const& v) + { +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + __m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(0, 1, 3, 2)); + __m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(0, 2, 1, 3)); + __m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2)); + + __m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0)); + __m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 uuv = _mm_sub_ps(_mm_mul_ps(q_swp0, uv_swp1), _mm_mul_ps(q_swp1, uv_swp0)); + + __m128 const two = _mm_set1_ps(2.0f); + uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two)); + uuv = _mm_mul_ps(uuv, two); + + vec<4, float, Q> Result; + Result.data = _mm_add_ps(v.data, _mm_add_ps(uv, uuv)); + return Result; +# else + __m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2)); + + __m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0)); + __m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 uuv = _mm_sub_ps(_mm_mul_ps(q_swp0, uv_swp1), _mm_mul_ps(q_swp1, uv_swp0)); + + __m128 const two = _mm_set1_ps(2.0f); + uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two)); + uuv = _mm_mul_ps(uuv, two); + + vec<4, float, Q> Result; + Result.data = _mm_add_ps(v.data, _mm_add_ps(uv, uuv)); + return Result; +# endif + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/vendor/glm/detail/type_vec.hpp b/vendor/glm/detail/type_vec.hpp deleted file mode 100755 index cf4f34c69c..0000000000 --- a/vendor/glm/detail/type_vec.hpp +++ /dev/null @@ -1,562 +0,0 @@ -/// @ref core -/// @file glm/detail/type_vec.hpp - -#pragma once - -#include "qualifier.hpp" -#include "type_int.hpp" -#include "compute_vector_relational.hpp" - -namespace glm{ -namespace detail -{ - template - struct storage - { - typedef struct type { - uint8 data[size]; - } type; - }; - - #define GLM_ALIGNED_STORAGE_TYPE_STRUCT(x) \ - template \ - struct storage { \ - GLM_ALIGNED_STRUCT(x) type { \ - uint8 data[x]; \ - }; \ - }; - - GLM_ALIGNED_STORAGE_TYPE_STRUCT(1) - GLM_ALIGNED_STORAGE_TYPE_STRUCT(2) - GLM_ALIGNED_STORAGE_TYPE_STRUCT(4) - GLM_ALIGNED_STORAGE_TYPE_STRUCT(8) - GLM_ALIGNED_STORAGE_TYPE_STRUCT(16) - GLM_ALIGNED_STORAGE_TYPE_STRUCT(32) - GLM_ALIGNED_STORAGE_TYPE_STRUCT(64) - -# if GLM_ARCH & GLM_ARCH_SSE2_BIT - template<> - struct storage - { - typedef glm_vec4 type; - }; - - template<> - struct storage - { - typedef glm_ivec4 type; - }; - - template<> - struct storage - { - typedef glm_uvec4 type; - }; -/* -# else - typedef union __declspec(align(16)) glm_128 - { - unsigned __int8 data[16]; - } glm_128; - - template<> - struct storage - { - typedef glm_128 type; - }; - - template<> - struct storage - { - typedef glm_128 type; - }; - - template<> - struct storage - { - typedef glm_128 type; - }; -*/ -# endif - -# if (GLM_ARCH & GLM_ARCH_AVX_BIT) - template<> - struct storage - { - typedef glm_dvec4 type; - }; -# endif - -# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) - template<> - struct storage - { - typedef glm_i64vec4 type; - }; - - template<> - struct storage - { - typedef glm_u64vec4 type; - }; -# endif -}//namespace detail - -#if GLM_HAS_TEMPLATE_ALIASES - template using tvec2 = vec<2, T, Q>; - template using tvec3 = vec<3, T, Q>; - template using tvec4 = vec<4, T, Q>; -#endif//GLM_HAS_TEMPLATE_ALIASES - - /// @addtogroup core_precision - /// @{ - - /// 2 components vector of high single-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, float, highp> highp_vec2; - - /// 2 components vector of medium single-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, float, mediump> mediump_vec2; - - /// 2 components vector of low single-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, float, lowp> lowp_vec2; - - /// 2 components vector of high double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, double, highp> highp_dvec2; - - /// 2 components vector of medium double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, double, mediump> mediump_dvec2; - - /// 2 components vector of low double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, double, lowp> lowp_dvec2; - - /// 2 components vector of high qualifier signed integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, int, highp> highp_ivec2; - - /// 2 components vector of medium qualifier signed integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, int, mediump> mediump_ivec2; - - /// 2 components vector of low qualifier signed integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, int, lowp> lowp_ivec2; - - /// 2 components vector of high qualifier unsigned integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, uint, highp> highp_uvec2; - - /// 2 components vector of medium qualifier unsigned integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, uint, mediump> mediump_uvec2; - - /// 2 components vector of low qualifier unsigned integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, uint, lowp> lowp_uvec2; - - /// 2 components vector of high qualifier bool numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, bool, highp> highp_bvec2; - - /// 2 components vector of medium qualifier bool numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, bool, mediump> mediump_bvec2; - - /// 2 components vector of low qualifier bool numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, bool, lowp> lowp_bvec2; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 3 components vector of high single-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, float, highp> highp_vec3; - - /// 3 components vector of medium single-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, float, mediump> mediump_vec3; - - /// 3 components vector of low single-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, float, lowp> lowp_vec3; - - /// 3 components vector of high double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, double, highp> highp_dvec3; - - /// 3 components vector of medium double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, double, mediump> mediump_dvec3; - - /// 3 components vector of low double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, double, lowp> lowp_dvec3; - - /// 3 components vector of high qualifier signed integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, int, highp> highp_ivec3; - - /// 3 components vector of medium qualifier signed integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, int, mediump> mediump_ivec3; - - /// 3 components vector of low qualifier signed integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, int, lowp> lowp_ivec3; - - /// 3 components vector of high qualifier unsigned integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, uint, highp> highp_uvec3; - - /// 3 components vector of medium qualifier unsigned integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, uint, mediump> mediump_uvec3; - - /// 3 components vector of low qualifier unsigned integer numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, uint, lowp> lowp_uvec3; - - /// 3 components vector of high qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, bool, highp> highp_bvec3; - - /// 3 components vector of medium qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, bool, mediump> mediump_bvec3; - - /// 3 components vector of low qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, bool, lowp> lowp_bvec3; - - /// @} - - /// @addtogroup core_precision - /// @{ - - /// 4 components vector of high single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, float, highp> highp_vec4; - - /// 4 components vector of medium single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, float, mediump> mediump_vec4; - - /// 4 components vector of low single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, float, lowp> lowp_vec4; - - /// 4 components vector of high double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, double, highp> highp_dvec4; - - /// 4 components vector of medium double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, double, mediump> mediump_dvec4; - - /// 4 components vector of low double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, double, lowp> lowp_dvec4; - - /// 4 components vector of high qualifier signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, int, highp> highp_ivec4; - - /// 4 components vector of medium qualifier signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, int, mediump> mediump_ivec4; - - /// 4 components vector of low qualifier signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, int, lowp> lowp_ivec4; - - /// 4 components vector of high qualifier unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, uint, highp> highp_uvec4; - - /// 4 components vector of medium qualifier unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, uint, mediump> mediump_uvec4; - - /// 4 components vector of low qualifier unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, uint, lowp> lowp_uvec4; - - /// 4 components vector of high qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, bool, highp> highp_bvec4; - - /// 4 components vector of medium qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, bool, mediump> mediump_bvec4; - - /// 4 components vector of low qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, bool, lowp> lowp_bvec4; - - /// @} - - /// @addtogroup core_types - /// @{ - - // -- Default float definition -- - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_vec2 vec2; - typedef lowp_vec3 vec3; - typedef lowp_vec4 vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef mediump_vec2 vec2; - typedef mediump_vec3 vec3; - typedef mediump_vec4 vec4; -#else //defined(GLM_PRECISION_HIGHP_FLOAT) - /// 2 components vector of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_vec2 vec2; - - //! 3 components vector of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_vec3 vec3; - - //! 4 components vector of floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_vec4 vec4; -#endif//GLM_PRECISION - - // -- Default double definition -- - -#if(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_dvec2 dvec2; - typedef lowp_dvec3 dvec3; - typedef lowp_dvec4 dvec4; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef mediump_dvec2 dvec2; - typedef mediump_dvec3 dvec3; - typedef mediump_dvec4 dvec4; -#else //defined(GLM_PRECISION_HIGHP_DOUBLE) - /// 2 components vector of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_dvec2 dvec2; - - //! 3 components vector of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_dvec3 dvec3; - - //! 4 components vector of double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_dvec4 dvec4; -#endif//GLM_PRECISION - - // -- Signed integer definition -- - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_ivec2 ivec2; - typedef lowp_ivec3 ivec3; - typedef lowp_ivec4 ivec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_ivec2 ivec2; - typedef mediump_ivec3 ivec3; - typedef mediump_ivec4 ivec4; -#else //defined(GLM_PRECISION_HIGHP_INT) - /// 2 components vector of signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_ivec2 ivec2; - - /// 3 components vector of signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_ivec3 ivec3; - - /// 4 components vector of signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_ivec4 ivec4; -#endif//GLM_PRECISION - - // -- Unsigned integer definition -- - -#if(defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_uvec2 uvec2; - typedef lowp_uvec3 uvec3; - typedef lowp_uvec4 uvec4; -#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) - typedef mediump_uvec2 uvec2; - typedef mediump_uvec3 uvec3; - typedef mediump_uvec4 uvec4; -#else //defined(GLM_PRECISION_HIGHP_UINT) - /// 2 components vector of unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_uvec2 uvec2; - - /// 3 components vector of unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_uvec3 uvec3; - - /// 4 components vector of unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_uvec4 uvec4; -#endif//GLM_PRECISION - - // -- Boolean definition -- - -#if(defined(GLM_PRECISION_LOWP_BOOL)) - typedef lowp_bvec2 bvec2; - typedef lowp_bvec3 bvec3; - typedef lowp_bvec4 bvec4; -#elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) - typedef mediump_bvec2 bvec2; - typedef mediump_bvec3 bvec3; - typedef mediump_bvec4 bvec4; -#else //defined(GLM_PRECISION_HIGHP_BOOL) - /// 2 components vector of boolean. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_bvec2 bvec2; - - /// 3 components vector of boolean. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_bvec3 bvec3; - - /// 4 components vector of boolean. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef highp_bvec4 bvec4; -#endif//GLM_PRECISION - - /// @} -}//namespace glm diff --git a/vendor/glm/detail/type_vec.inl b/vendor/glm/detail/type_vec.inl deleted file mode 100755 index 2238a1bc6b..0000000000 --- a/vendor/glm/detail/type_vec.inl +++ /dev/null @@ -1,2 +0,0 @@ -/// @ref core -/// @file glm/detail/type_vec.inl diff --git a/vendor/glm/detail/type_vec1.hpp b/vendor/glm/detail/type_vec1.hpp old mode 100755 new mode 100644 index e69de29bb2..0cc7b5d4c9 --- a/vendor/glm/detail/type_vec1.hpp +++ b/vendor/glm/detail/type_vec1.hpp @@ -0,0 +1,308 @@ +/// @ref core +/// @file glm/detail/type_vec1.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<1, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<1, T, Q> type; + typedef vec<1, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x; +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + T x; + T r; + T s; + + typename detail::storage<1, T, detail::is_aligned::value>::type data; +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + _GLM_SWIZZLE1_2_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_2_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_2_MEMBERS(T, Q, s) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, s) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, s) +# endif +*/ + }; +# else + union {T x, r, s;}; +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, Q) +# endif +*/ +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + template + GLM_CTOR_DECL vec(vec<1, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_CTOR_DECL explicit vec(T scalar); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<2, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<3, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<1, U, P> const& v); + + // -- Swizzle constructors -- +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec(detail::_swizzle<1, T, Q, E0, -1,-2,-3> const& that) + { + *this = that(); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +*/ + // -- Unary arithmetic operators -- + + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT; + + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec1.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_vec1.inl b/vendor/glm/detail/type_vec1.inl old mode 100755 new mode 100644 index 7f77f6c286..18411e7f76 --- a/vendor/glm/detail/type_vec1.inl +++ b/vendor/glm/detail/type_vec1.inl @@ -1,36 +1,37 @@ /// @ref core -/// @file glm/detail/type_vec1.inl + +#include "./compute_vector_relational.hpp" namespace glm { // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec() -# ifdef GLM_FORCE_CTOR_INIT + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE : x(0) # endif {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, T, Q> const& v) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, Q> const& v) : x(v.x) {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, T, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, P> const& v) : x(v.x) {} // -- Explicit basic constructors -- template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(T scalar) : x(scalar) {} @@ -38,58 +39,56 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, U, P> const& v) : x(static_cast(v.x)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<2, U, P> const& v) : x(static_cast(v.x)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<3, U, P> const& v) : x(static_cast(v.x)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<4, U, P> const& v) : x(static_cast(v.x)) {} // -- Component accesses -- template - GLM_FUNC_QUALIFIER T & vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type) { - assert(i >= 0 && i < this->length()); - return (&x)[i]; + return x; } template - GLM_FUNC_QUALIFIER T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type) const { - assert(i >= 0 && i < this->length()); - return (&x)[i]; + return x; } // -- Unary arithmetic operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) { this->x = v.x; return *this; } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) { this->x = static_cast(v.x); return *this; @@ -97,7 +96,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator+=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(U scalar) { this->x += static_cast(scalar); return *this; @@ -105,7 +104,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator+=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(vec<1, U, Q> const& v) { this->x += static_cast(v.x); return *this; @@ -113,7 +112,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator-=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(U scalar) { this->x -= static_cast(scalar); return *this; @@ -121,7 +120,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator-=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(vec<1, U, Q> const& v) { this->x -= static_cast(v.x); return *this; @@ -129,7 +128,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator*=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(U scalar) { this->x *= static_cast(scalar); return *this; @@ -137,7 +136,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator*=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(vec<1, U, Q> const& v) { this->x *= static_cast(v.x); return *this; @@ -145,7 +144,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator/=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(U scalar) { this->x /= static_cast(scalar); return *this; @@ -153,7 +152,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator/=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(vec<1, U, Q> const& v) { this->x /= static_cast(v.x); return *this; @@ -162,21 +161,21 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator++() { ++this->x; return *this; } template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator--() { --this->x; return *this; } template - GLM_FUNC_QUALIFIER vec<1, T, Q> vec<1, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator++(int) { vec<1, T, Q> Result(*this); ++*this; @@ -184,7 +183,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<1, T, Q> vec<1, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator--(int) { vec<1, T, Q> Result(*this); --*this; @@ -195,7 +194,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator%=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(U scalar) { this->x %= static_cast(scalar); return *this; @@ -203,7 +202,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator%=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(vec<1, U, Q> const& v) { this->x %= static_cast(v.x); return *this; @@ -211,7 +210,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator&=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(U scalar) { this->x &= static_cast(scalar); return *this; @@ -219,7 +218,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator&=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(vec<1, U, Q> const& v) { this->x &= static_cast(v.x); return *this; @@ -227,7 +226,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator|=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(U scalar) { this->x |= static_cast(scalar); return *this; @@ -235,15 +234,15 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v) { - this->x |= U(v.x); + this->x |= static_cast(v.x); return *this; } template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator^=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(U scalar) { this->x ^= static_cast(scalar); return *this; @@ -251,7 +250,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator^=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(vec<1, U, Q> const& v) { this->x ^= static_cast(v.x); return *this; @@ -259,7 +258,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator<<=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(U scalar) { this->x <<= static_cast(scalar); return *this; @@ -267,7 +266,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator<<=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(vec<1, U, Q> const& v) { this->x <<= static_cast(v.x); return *this; @@ -275,7 +274,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator>>=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(U scalar) { this->x >>= static_cast(scalar); return *this; @@ -283,7 +282,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator>>=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(vec<1, U, Q> const& v) { this->x >>= static_cast(v.x); return *this; @@ -292,13 +291,13 @@ namespace glm // -- Unary constant operators -- template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v) { return v; } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v) { return vec<1, T, Q>( -v.x); @@ -307,21 +306,21 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( v.x + scalar); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( scalar + v.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( v1.x + v2.x); @@ -329,63 +328,63 @@ namespace glm //operator- template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( v.x - scalar); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( scalar - v.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( v1.x - v2.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( v.x * scalar); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( scalar * v.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( v1.x * v2.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( v.x / scalar); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( scalar / v.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( v1.x / v2.x); @@ -394,133 +393,133 @@ namespace glm // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( v.x % scalar); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( scalar % v.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( v1.x % v2.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( v.x & scalar); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( scalar & v.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( v1.x & v2.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( v.x | scalar); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( scalar | v.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( v1.x | v2.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( v.x ^ scalar); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( scalar ^ v.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( v1.x ^ v2.x); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( static_cast(v.x << scalar)); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( - scalar << v.x); + static_cast(scalar << v.x)); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( - v1.x << v2.x); + static_cast(v1.x << v2.x)); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar) { return vec<1, T, Q>( - v.x >> scalar); + static_cast(v.x >> scalar)); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v) { return vec<1, T, Q>( - scalar >> v.x); + static_cast(scalar >> v.x)); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<1, T, Q>( - v1.x >> v2.x); + static_cast(v1.x >> v2.x)); } template - GLM_FUNC_QUALIFIER vec<1, T, Q> operator~(vec<1, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v) { return vec<1, T, Q>( ~v.x); @@ -529,25 +528,25 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return detail::compute_equal::call(v1.x, v2.x); + return detail::compute_equal::is_iec559>::call(v1.x, v2.x); } template - GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { return !(v1 == v2); } template - GLM_FUNC_QUALIFIER vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) { return vec<1, bool, Q>(v1.x && v2.x); } template - GLM_FUNC_QUALIFIER vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) { return vec<1, bool, Q>(v1.x || v2.x); } diff --git a/vendor/glm/detail/type_vec2.hpp b/vendor/glm/detail/type_vec2.hpp old mode 100755 new mode 100644 index b6ab6853c0..66c6137cee --- a/vendor/glm/detail/type_vec2.hpp +++ b/vendor/glm/detail/type_vec2.hpp @@ -3,14 +3,12 @@ #pragma once -#include "type_vec.hpp" -#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED -# if GLM_HAS_UNRESTRICTED_UNIONS -# include "_swizzle.hpp" -# else -# include "_swizzle_func.hpp" -# endif -#endif //GLM_SWIZZLE +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif #include namespace glm @@ -21,32 +19,44 @@ namespace glm // -- Implementation detail -- typedef T value_type; - typedef vec type; + typedef vec<2, T, Q> type; typedef vec<2, bool, Q> bool_type; + enum is_aligned + { + value = false + }; // -- Data -- -# if GLM_HAS_ONLY_XYZW - T x, y; - -# elif GLM_HAS_ALIGNED_TYPE +# if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpedantic" -# endif -# if GLM_COMPILER & GLM_COMPILER_CLANG +# elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" # pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union # endif +# endif +# if GLM_CONFIG_XYZW_ONLY + T x, y; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, Q, x, y) +# endif//GLM_CONFIG_SWIZZLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { struct{ T x, y; }; struct{ T r, g; }; struct{ T s, t; }; -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED + typename detail::storage<2, T, detail::is_aligned::value>::type data; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE2_2_MEMBERS(T, Q, x, y) GLM_SWIZZLE2_2_MEMBERS(T, Q, r, g) GLM_SWIZZLE2_2_MEMBERS(T, Q, s, t) @@ -56,23 +66,25 @@ namespace glm GLM_SWIZZLE2_4_MEMBERS(T, Q, x, y) GLM_SWIZZLE2_4_MEMBERS(T, Q, r, g) GLM_SWIZZLE2_4_MEMBERS(T, Q, s, t) -# endif//GLM_SWIZZLE - +# endif }; +# else + union {T x, r, s;}; + union {T y, g, t;}; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, Q) +# endif//GLM_CONFIG_SWIZZLE +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic pop -# endif -# if GLM_COMPILER & GLM_COMPILER_GCC +# elif GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) # endif -# else - union {T x, r, s;}; - union {T y, g, t;}; - -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED - GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P) -# endif//GLM_SWIZZLE # endif // -- Component accesses -- @@ -81,305 +93,312 @@ namespace glm typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} - GLM_FUNC_DECL T& operator[](length_type i); - GLM_FUNC_DECL T const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR T& operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, T, P> const& v); + GLM_CTOR_DECL vec(vec<2, T, P> const& v); // -- Explicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(T x, T y); + GLM_CTOR_DECL explicit vec(T scalar); + GLM_CTOR_DECL vec(T x, T y); // -- Conversion constructors -- + template + GLM_CTOR_DECL explicit vec(vec<1, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A x, B y); + GLM_CTOR_DECL vec(A x, B y); + template + GLM_CTOR_DECL vec(vec<1, A, Q> const& x, B y); + template + GLM_CTOR_DECL vec(A x, vec<1, B, Q> const& y); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, Q> const& x, vec<1, B, Q> const& y); + GLM_CTOR_DECL vec(vec<1, A, Q> const& x, vec<1, B, Q> const& y); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<3, U, P> const& v); + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<3, U, P> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, P> const& v); + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<2, U, P> const& v); + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<2, U, P> const& v); // -- Swizzle constructors -- -# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template - GLM_FUNC_DECL vec(detail::_swizzle<2, T, Q, E0, E1,-1,-2> const& that) + GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<2, T, Q, E0, E1,-1,-2> const& that) { *this = that(); } -# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec& operator=(vec const& v) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec& operator=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec& operator+=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar); template - GLM_FUNC_DECL vec& operator+=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec& operator+=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec& operator-=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar); template - GLM_FUNC_DECL vec& operator-=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec& operator-=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec& operator*=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar); template - GLM_FUNC_DECL vec& operator*=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec& operator*=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec& operator/=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar); template - GLM_FUNC_DECL vec& operator/=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec& operator/=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<2, U, Q> const& v); // -- Increment and decrement operators -- - GLM_FUNC_DECL vec & operator++(); - GLM_FUNC_DECL vec & operator--(); - GLM_FUNC_DECL vec operator++(int); - GLM_FUNC_DECL vec operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator--(int); // -- Unary bit operators -- template - GLM_FUNC_DECL vec & operator%=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar); template - GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator%=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec & operator&=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar); template - GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator&=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec & operator|=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar); template - GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator|=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec & operator^=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar); template - GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator^=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec & operator<<=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator<<=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<2, U, Q> const& v); template - GLM_FUNC_DECL vec & operator>>=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator>>=(vec<2, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<2, U, Q> const& v); }; // -- Unary operators -- template - GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v); // -- Binary operators -- template - GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v); template - GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, T, Q> operator~(vec<2, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); template - GLM_FUNC_DECL vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); template - GLM_FUNC_DECL vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_vec2.inl b/vendor/glm/detail/type_vec2.inl old mode 100755 new mode 100644 index 1273707906..e8408997f2 --- a/vendor/glm/detail/type_vec2.inl +++ b/vendor/glm/detail/type_vec2.inl @@ -1,56 +1,78 @@ /// @ref core -/// @file glm/core/type_tvec2.inl + +#include "./compute_vector_relational.hpp" namespace glm { // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec() -# ifdef GLM_FORCE_CTOR_INIT + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE : x(0), y(0) # endif {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<2, T, Q> const& v) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, Q> const& v) : x(v.x), y(v.y) {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<2, T, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, P> const& v) : x(v.x), y(v.y) {} // -- Explicit basic constructors -- template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(T scalar) : x(scalar), y(scalar) {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(T _x, T _y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(T _x, T _y) : x(_x), y(_y) {} // -- Conversion scalar constructors -- + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + {} + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(A _x, B _y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(A _x, B _y) : x(static_cast(_x)) , y(static_cast(_y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, B _y) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(A _x, vec<1, B, Q> const& _y) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y) : x(static_cast(_x.x)) , y(static_cast(_y.x)) {} @@ -59,21 +81,21 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<2, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, U, P> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<3, U, P> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<4, U, P> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) {} @@ -81,34 +103,48 @@ namespace glm // -- Component accesses -- template - GLM_FUNC_QUALIFIER T & vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) { - assert(i >= 0 && i < this->length()); - return (&x)[i]; + GLM_ASSERT_LENGTH(i, this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + } } template - GLM_FUNC_QUALIFIER T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const { - assert(i >= 0 && i < this->length()); - return (&x)[i]; + GLM_ASSERT_LENGTH(i, this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + } } // -- Unary arithmetic operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) { this->x = v.x; this->y = v.y; return *this; } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); @@ -117,7 +153,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar) { this->x += static_cast(scalar); this->y += static_cast(scalar); @@ -126,7 +162,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<1, U, Q> const& v) { this->x += static_cast(v.x); this->y += static_cast(v.x); @@ -135,7 +171,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<2, U, Q> const& v) { this->x += static_cast(v.x); this->y += static_cast(v.y); @@ -144,7 +180,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator-=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(U scalar) { this->x -= static_cast(scalar); this->y -= static_cast(scalar); @@ -153,7 +189,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<1, U, Q> const& v) { this->x -= static_cast(v.x); this->y -= static_cast(v.x); @@ -162,7 +198,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<2, U, Q> const& v) { this->x -= static_cast(v.x); this->y -= static_cast(v.y); @@ -171,7 +207,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator*=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(U scalar) { this->x *= static_cast(scalar); this->y *= static_cast(scalar); @@ -180,7 +216,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<1, U, Q> const& v) { this->x *= static_cast(v.x); this->y *= static_cast(v.x); @@ -189,7 +225,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<2, U, Q> const& v) { this->x *= static_cast(v.x); this->y *= static_cast(v.y); @@ -198,7 +234,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator/=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(U scalar) { this->x /= static_cast(scalar); this->y /= static_cast(scalar); @@ -207,7 +243,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<1, U, Q> const& v) { this->x /= static_cast(v.x); this->y /= static_cast(v.x); @@ -216,7 +252,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<2, U, Q> const& v) { this->x /= static_cast(v.x); this->y /= static_cast(v.y); @@ -226,7 +262,7 @@ namespace glm // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator++() { ++this->x; ++this->y; @@ -234,7 +270,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator--() { --this->x; --this->y; @@ -242,7 +278,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> vec<2, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator++(int) { vec<2, T, Q> Result(*this); ++*this; @@ -250,7 +286,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> vec<2, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator--(int) { vec<2, T, Q> Result(*this); --*this; @@ -261,7 +297,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator%=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(U scalar) { this->x %= static_cast(scalar); this->y %= static_cast(scalar); @@ -270,7 +306,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<1, U, Q> const& v) { this->x %= static_cast(v.x); this->y %= static_cast(v.x); @@ -279,7 +315,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<2, U, Q> const& v) { this->x %= static_cast(v.x); this->y %= static_cast(v.y); @@ -288,7 +324,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator&=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(U scalar) { this->x &= static_cast(scalar); this->y &= static_cast(scalar); @@ -297,7 +333,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<1, U, Q> const& v) { this->x &= static_cast(v.x); this->y &= static_cast(v.x); @@ -306,7 +342,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<2, U, Q> const& v) { this->x &= static_cast(v.x); this->y &= static_cast(v.y); @@ -315,7 +351,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator|=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(U scalar) { this->x |= static_cast(scalar); this->y |= static_cast(scalar); @@ -324,7 +360,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<1, U, Q> const& v) { this->x |= static_cast(v.x); this->y |= static_cast(v.x); @@ -333,7 +369,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<2, U, Q> const& v) { this->x |= static_cast(v.x); this->y |= static_cast(v.y); @@ -342,7 +378,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator^=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(U scalar) { this->x ^= static_cast(scalar); this->y ^= static_cast(scalar); @@ -351,7 +387,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<1, U, Q> const& v) { this->x ^= static_cast(v.x); this->y ^= static_cast(v.x); @@ -360,7 +396,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<2, U, Q> const& v) { this->x ^= static_cast(v.x); this->y ^= static_cast(v.y); @@ -369,7 +405,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator<<=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(U scalar) { this->x <<= static_cast(scalar); this->y <<= static_cast(scalar); @@ -378,7 +414,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<1, U, Q> const& v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.x); @@ -387,7 +423,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<2, U, Q> const& v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.y); @@ -396,7 +432,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator>>=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(U scalar) { this->x >>= static_cast(scalar); this->y >>= static_cast(scalar); @@ -405,7 +441,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<1, U, Q> const& v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.x); @@ -414,7 +450,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<2, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<2, U, Q> const& v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.y); @@ -424,13 +460,13 @@ namespace glm // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v) { return v; } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v) { return vec<2, T, Q>( -v.x, @@ -440,7 +476,7 @@ namespace glm // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x + scalar, @@ -448,7 +484,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x + v2.x, @@ -456,7 +492,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar + v.x, @@ -464,7 +500,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x + v2.x, @@ -472,7 +508,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x + v2.x, @@ -480,7 +516,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x - scalar, @@ -488,7 +524,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x - v2.x, @@ -496,7 +532,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar - v.x, @@ -504,7 +540,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x - v2.x, @@ -512,7 +548,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x - v2.x, @@ -520,7 +556,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x * scalar, @@ -528,7 +564,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x * v2.x, @@ -536,7 +572,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar * v.x, @@ -544,7 +580,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x * v2.x, @@ -552,7 +588,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x * v2.x, @@ -560,7 +596,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x / scalar, @@ -568,7 +604,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x / v2.x, @@ -576,7 +612,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar / v.x, @@ -584,7 +620,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x / v2.x, @@ -592,7 +628,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x / v2.x, @@ -602,7 +638,7 @@ namespace glm // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x % scalar, @@ -610,7 +646,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x % v2.x, @@ -618,7 +654,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar % v.x, @@ -626,7 +662,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x % v2.x, @@ -634,7 +670,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x % v2.x, @@ -642,7 +678,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x & scalar, @@ -650,7 +686,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x & v2.x, @@ -658,7 +694,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar & v.x, @@ -666,7 +702,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x & v2.x, @@ -674,7 +710,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x & v2.x, @@ -682,7 +718,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x | scalar, @@ -690,7 +726,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x | v2.x, @@ -698,7 +734,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar | v.x, @@ -706,7 +742,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x | v2.x, @@ -714,7 +750,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x | v2.x, @@ -722,7 +758,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x ^ scalar, @@ -730,7 +766,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x ^ v2.x, @@ -738,7 +774,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar ^ v.x, @@ -746,7 +782,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x ^ v2.x, @@ -754,7 +790,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x ^ v2.x, @@ -762,7 +798,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x << scalar, @@ -770,7 +806,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x << v2.x, @@ -778,7 +814,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar << v.x, @@ -786,7 +822,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x << v2.x, @@ -794,7 +830,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x << v2.x, @@ -802,7 +838,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar) { return vec<2, T, Q>( v.x >> scalar, @@ -810,7 +846,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<2, T, Q>( v1.x >> v2.x, @@ -818,7 +854,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v) { return vec<2, T, Q>( scalar >> v.x, @@ -826,7 +862,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x >> v2.x, @@ -834,7 +870,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return vec<2, T, Q>( v1.x >> v2.x, @@ -842,7 +878,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<2, T, Q> operator~(vec<2, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v) { return vec<2, T, Q>( ~v.x, @@ -852,27 +888,27 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return - detail::compute_equal::call(v1.x, v2.x) && - detail::compute_equal::call(v1.y, v2.y); + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y); } template - GLM_FUNC_QUALIFIER bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return !(v1 == v2); } template - GLM_FUNC_QUALIFIER vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) { return vec<2, bool, Q>(v1.x && v2.x, v1.y && v2.y); } template - GLM_FUNC_QUALIFIER vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) { return vec<2, bool, Q>(v1.x || v2.x, v1.y || v2.y); } diff --git a/vendor/glm/detail/type_vec3.hpp b/vendor/glm/detail/type_vec3.hpp old mode 100755 new mode 100644 index 506e8a36a6..90de2f8a41 --- a/vendor/glm/detail/type_vec3.hpp +++ b/vendor/glm/detail/type_vec3.hpp @@ -3,14 +3,12 @@ #pragma once -#include "type_vec.hpp" -#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED -# if GLM_HAS_UNRESTRICTED_UNIONS -# include "_swizzle.hpp" -# else -# include "_swizzle_func.hpp" -# endif -#endif //GLM_SWIZZLE == GLM_SWIZZLE_ENABLED +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif #include namespace glm @@ -21,32 +19,49 @@ namespace glm // -- Implementation detail -- typedef T value_type; - typedef vec type; + typedef vec<3, T, Q> type; typedef vec<3, bool, Q> bool_type; - // -- Data -- + enum is_aligned + { + value = detail::is_aligned::value + }; -# if GLM_HAS_ONLY_XYZW - T x, y, z; + // -- Data -- -# elif GLM_HAS_ALIGNED_TYPE +# if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpedantic" -# endif -# if GLM_COMPILER & GLM_COMPILER_CLANG +# elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" # pragma clang diagnostic ignored "-Wnested-anon-types" +# pragma clang diagnostic ignored "-Wpadded" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# pragma warning(disable: 4324) // structure was padded due to alignment specifier +# endif # endif +# endif +# if GLM_CONFIG_XYZW_ONLY + T x, y, z; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, Q, x, y, z) +# endif//GLM_CONFIG_SWIZZLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { struct{ T x, y, z; }; struct{ T r, g, b; }; struct{ T s, t, p; }; -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED + typename detail::storage<3, T, detail::is_aligned::value>::type data; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE3_2_MEMBERS(T, Q, x, y, z) GLM_SWIZZLE3_2_MEMBERS(T, Q, r, g, b) GLM_SWIZZLE3_2_MEMBERS(T, Q, s, t, p) @@ -56,351 +71,375 @@ namespace glm GLM_SWIZZLE3_4_MEMBERS(T, Q, x, y, z) GLM_SWIZZLE3_4_MEMBERS(T, Q, r, g, b) GLM_SWIZZLE3_4_MEMBERS(T, Q, s, t, p) -# endif//GLM_SWIZZLE +# endif }; - -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# endif -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# endif # else union { T x, r, s; }; union { T y, g, t; }; union { T z, b, p; }; -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED - GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P) -# endif//GLM_SWIZZLE +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, Q) +# endif//GLM_CONFIG_SWIZZLE # endif//GLM_LANG +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + // -- Component accesses -- /// Return the count of components of the vector typedef length_t length_type; GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;} - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, T, P> const& v); + GLM_CTOR_DECL vec(vec<3, T, P> const& v); // -- Explicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(T a, T b, T c); + GLM_CTOR_DECL explicit vec(T scalar); + GLM_CTOR_DECL vec(T a, T b, T c); // -- Conversion scalar constructors -- - /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL explicit vec(vec<1, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL vec(X x, Y y, Z z); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z); + template + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(X x, Y y, Z z); + GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z); + template + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, P> const& _xy, B _z); + GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, B _z); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z); + GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A _x, vec<2, B, P> const& _yz); + GLM_CTOR_DECL vec(A _x, vec<2, B, P> const& _yz); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz); + GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, P> const& v); + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<3, U, P> const& v); + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<3, U, P> const& v); // -- Swizzle constructors -- -# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template - GLM_FUNC_DECL vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that) + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that) { *this = that(); } template - GLM_FUNC_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& scalar) + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& scalar) { *this = vec(v(), scalar); } template - GLM_FUNC_DECL vec(T const& scalar, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec(T const& scalar, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) { *this = vec(scalar, v()); } -# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec & operator=(vec const& v) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> const& v) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec & operator=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator+=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar); template - GLM_FUNC_DECL vec & operator+=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator+=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator-=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar); template - GLM_FUNC_DECL vec & operator-=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator-=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator*=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar); template - GLM_FUNC_DECL vec & operator*=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator*=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator/=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar); template - GLM_FUNC_DECL vec & operator/=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator/=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<3, U, Q> const& v); // -- Increment and decrement operators -- - GLM_FUNC_DECL vec & operator++(); - GLM_FUNC_DECL vec & operator--(); - GLM_FUNC_DECL vec operator++(int); - GLM_FUNC_DECL vec operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator--(int); // -- Unary bit operators -- template - GLM_FUNC_DECL vec & operator%=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar); template - GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator%=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator&=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar); template - GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator&=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator|=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar); template - GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator|=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator^=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar); template - GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator^=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator<<=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator<<=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<3, U, Q> const& v); template - GLM_FUNC_DECL vec & operator>>=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec & operator>>=(vec<3, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<3, U, Q> const& v); }; + + // -- Unary operators -- template - GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v); // -- Binary operators -- template - GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator%(T const& scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v); template - GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, T, Q> operator~(vec<3, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template - GLM_FUNC_DECL vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); template - GLM_FUNC_DECL vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); + + + + }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_vec3.inl b/vendor/glm/detail/type_vec3.inl old mode 100755 new mode 100644 index 15fd4839de..cd7cfa1f67 --- a/vendor/glm/detail/type_vec3.inl +++ b/vendor/glm/detail/type_vec3.inl @@ -1,49 +1,59 @@ /// @ref core -/// @file glm/detail/type_tvec3.inl + +#include "compute_vector_relational.hpp" +#include "compute_vector_decl.hpp" namespace glm { // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec() -# ifdef GLM_FORCE_CTOR_INIT + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE : x(0), y(0), z(0) # endif {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<3, T, Q> const& v) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, Q> const& v) : x(v.x), y(v.y), z(v.z) {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<3, T, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, P> const& v) : x(v.x), y(v.y), z(v.z) {} // -- Explicit basic constructors -- template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(T scalar) : x(scalar), y(scalar), z(scalar) {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(T _x, T _y, T _z) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(T _x, T _y, T _z) : x(_x), y(_y), z(_z) {} // -- Conversion scalar constructors -- + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + , z(static_cast(v.x)) + {} + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(X _x, Y _y, Z _z) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, Y _y, Z _z) : x(static_cast(_x)) , y(static_cast(_y)) , z(static_cast(_z)) @@ -51,17 +61,65 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) - : x(static_cast(_x)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z) + : x(static_cast(_x.x)) , y(static_cast(_y)) , z(static_cast(_z)) {} + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + {} + // -- Conversion vector constructors -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, B _z) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, B _z) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_z)) @@ -69,7 +127,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_z.x)) @@ -77,7 +135,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(A _x, vec<2, B, P> const& _yz) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(A _x, vec<2, B, P> const& _yz) : x(static_cast(_x)) , y(static_cast(_yz.x)) , z(static_cast(_yz.y)) @@ -85,7 +143,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz) : x(static_cast(_x.x)) , y(static_cast(_yz.x)) , z(static_cast(_yz.y)) @@ -93,7 +151,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<3, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, U, P> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) , z(static_cast(v.z)) @@ -101,7 +159,7 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<4, U, P> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) , z(static_cast(v.z)) @@ -110,35 +168,53 @@ namespace glm // -- Component accesses -- template - GLM_FUNC_QUALIFIER T & vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) { - assert(i >= 0 && i < this->length()); - return (&x)[i]; + GLM_ASSERT_LENGTH(i, this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + } } template - GLM_FUNC_QUALIFIER T const& vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) const { - assert(i >= 0 && i < this->length()); - return (&x)[i]; + GLM_ASSERT_LENGTH(i, this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + } } // -- Unary arithmetic operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) { this->x = v.x; this->y = v.y; this->z = v.z; return *this; } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); @@ -148,128 +224,92 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator+=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(U scalar) { - this->x += static_cast(scalar); - this->y += static_cast(scalar); - this->z += static_cast(scalar); - return *this; + return (*this = detail::compute_vec_add<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<1, U, Q> const& v) { - this->x += static_cast(v.x); - this->y += static_cast(v.x); - this->z += static_cast(v.x); - return *this; + return (*this = detail::compute_vec_add<3, T, Q, detail::is_aligned::value>::call(*this, vec<1, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<3, U, Q> const& v) { - this->x += static_cast(v.x); - this->y += static_cast(v.y); - this->z += static_cast(v.z); - return *this; + return (*this = detail::compute_vec_add<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator-=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(U scalar) { - this->x -= static_cast(scalar); - this->y -= static_cast(scalar); - this->z -= static_cast(scalar); - return *this; + return (*this = detail::compute_vec_sub<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<1, U, Q> const& v) { - this->x -= static_cast(v.x); - this->y -= static_cast(v.x); - this->z -= static_cast(v.x); - return *this; + return (*this = detail::compute_vec_sub<3, T, Q, detail::is_aligned::value>::call(*this, vec<1, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<3, U, Q> const& v) { - this->x -= static_cast(v.x); - this->y -= static_cast(v.y); - this->z -= static_cast(v.z); - return *this; + return (*this = detail::compute_vec_sub<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator*=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(U scalar) { - this->x *= static_cast(scalar); - this->y *= static_cast(scalar); - this->z *= static_cast(scalar); - return *this; + return (*this = detail::compute_vec_mul<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(static_cast(scalar)))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<1, U, Q> const& v) { - this->x *= static_cast(v.x); - this->y *= static_cast(v.x); - this->z *= static_cast(v.x); - return *this; + return (*this = detail::compute_vec_mul<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<3, U, Q> const& v) { - this->x *= static_cast(v.x); - this->y *= static_cast(v.y); - this->z *= static_cast(v.z); - return *this; + return (*this = detail::compute_vec_mul<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator/=(U v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(U v) { - this->x /= static_cast(v); - this->y /= static_cast(v); - this->z /= static_cast(v); - return *this; + return (*this = detail::compute_vec_div<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<1, U, Q> const& v) { - this->x /= static_cast(v.x); - this->y /= static_cast(v.x); - this->z /= static_cast(v.x); - return *this; + return (*this = detail::compute_vec_div<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<3, U, Q> const& v) { - this->x /= static_cast(v.x); - this->y /= static_cast(v.y); - this->z /= static_cast(v.z); - return *this; + return (*this = detail::compute_vec_div<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator++() { ++this->x; ++this->y; @@ -278,7 +318,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator--() { --this->x; --this->y; @@ -287,7 +327,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<3, T, Q> vec<3, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator++(int) { vec<3, T, Q> Result(*this); ++*this; @@ -295,7 +335,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<3, T, Q> vec<3, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator--(int) { vec<3, T, Q> Result(*this); --*this; @@ -306,657 +346,452 @@ namespace glm template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator%=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(U scalar) { - this->x %= scalar; - this->y %= scalar; - this->z %= scalar; - return *this; + return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<1, U, Q> const& v) { - this->x %= v.x; - this->y %= v.x; - this->z %= v.x; - return *this; + return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<3, U, Q> const& v) { - this->x %= v.x; - this->y %= v.y; - this->z %= v.z; - return *this; + return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator&=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(U scalar) { - this->x &= scalar; - this->y &= scalar; - this->z &= scalar; - return *this; + return (*this = detail::compute_vec_and<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<1, U, Q> const& v) { - this->x &= v.x; - this->y &= v.x; - this->z &= v.x; - return *this; + return (*this = detail::compute_vec_and<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<3, U, Q> const& v) { - this->x &= v.x; - this->y &= v.y; - this->z &= v.z; - return *this; + return (*this = detail::compute_vec_and<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator|=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(U scalar) { - this->x |= scalar; - this->y |= scalar; - this->z |= scalar; - return *this; + return (*this = detail::compute_vec_or<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<1, U, Q> const& v) { - this->x |= v.x; - this->y |= v.x; - this->z |= v.x; - return *this; + return (*this = detail::compute_vec_or<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<3, U, Q> const& v) { - this->x |= v.x; - this->y |= v.y; - this->z |= v.z; - return *this; + return (*this = detail::compute_vec_or<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator^=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(U scalar) { - this->x ^= scalar; - this->y ^= scalar; - this->z ^= scalar; - return *this; + return (*this = detail::compute_vec_xor<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<1, U, Q> const& v) { - this->x ^= v.x; - this->y ^= v.x; - this->z ^= v.x; - return *this; + return (*this = detail::compute_vec_xor<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<3, U, Q> const& v) { - this->x ^= v.x; - this->y ^= v.y; - this->z ^= v.z; - return *this; + return (*this = detail::compute_vec_xor<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator<<=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(U scalar) { - this->x <<= scalar; - this->y <<= scalar; - this->z <<= scalar; - return *this; + return (*this = detail::compute_vec_shift_left<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<1, U, Q> const& v) { - this->x <<= static_cast(v.x); - this->y <<= static_cast(v.x); - this->z <<= static_cast(v.x); - return *this; + return (*this = detail::compute_vec_shift_left<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<1, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<3, U, Q> const& v) { - this->x <<= static_cast(v.x); - this->y <<= static_cast(v.y); - this->z <<= static_cast(v.z); - return *this; + return (*this = detail::compute_vec_shift_left<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator>>=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(U scalar) { - this->x >>= static_cast(scalar); - this->y >>= static_cast(scalar); - this->z >>= static_cast(scalar); - return *this; + return (*this = detail::compute_vec_shift_right<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<1, U, Q> const& v) { - this->x >>= static_cast(v.x); - this->y >>= static_cast(v.x); - this->z >>= static_cast(v.x); - return *this; + return (*this = detail::compute_vec_shift_right<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<3, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<3, U, Q> const& v) { - this->x >>= static_cast(v.x); - this->y >>= static_cast(v.y); - this->z >>= static_cast(v.z); - return *this; + return (*this = detail::compute_vec_shift_right<3, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); + } // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v) { return v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v) { - return vec<3, T, Q>( - -v.x, - -v.y, - -v.z); + return vec<3, T, Q>(T(0)) -= v; } // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x + scalar, - v.y + scalar, - v.z + scalar); + return vec<3, T, Q>(v) += scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2) { - return vec<3, T, Q>( - v.x + scalar.x, - v.y + scalar.x, - v.z + scalar.x); + return vec<3, T, Q>(v1) += v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar + v.x, - scalar + v.y, - scalar + v.z); + return vec<3, T, Q>(v) += scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x + v.x, - scalar.x + v.y, - scalar.x + v.z); + return vec<3, T, Q>(scalar) += v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z); + return vec<3, T, Q>(v1) += v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x - scalar, - v.y - scalar, - v.z - scalar); + return vec<3, T, Q>(v) -= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x - scalar.x, - v.y - scalar.x, - v.z - scalar.x); + return vec<3, T, Q>(v) -= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar - v.x, - scalar - v.y, - scalar - v.z); + return vec<3, T, Q>(scalar) -= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x - v.x, - scalar.x - v.y, - scalar.x - v.z); + return vec<3, T, Q>(scalar) -= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z); + return vec<3, T, Q>(v1) -= v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x * scalar, - v.y * scalar, - v.z * scalar); + return vec<3, T, Q>(v) *= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x * scalar.x, - v.y * scalar.x, - v.z * scalar.x); + return vec<3, T, Q>(v) *= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar * v.x, - scalar * v.y, - scalar * v.z); + return vec<3, T, Q>(v) *= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x * v.x, - scalar.x * v.y, - scalar.x * v.z); + return vec<3, T, Q>(v) *= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z); + return vec<3, T, Q>(v1) *= v2; + } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x / scalar, - v.y / scalar, - v.z / scalar); + return vec<3, T, Q>(v) /= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x / scalar.x, - v.y / scalar.x, - v.z / scalar.x); + return vec<3, T, Q>(v) /= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar / v.x, - scalar / v.y, - scalar / v.z); + return vec<3, T, Q>(scalar) /= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x / v.x, - scalar.x / v.y, - scalar.x / v.z); + return vec<3, T, Q>(scalar) /= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z); + return vec<3, T, Q>(v1) /= v2; } // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x % scalar, - v.y % scalar, - v.z % scalar); + return vec<3, T, Q>(v) %= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x % scalar.x, - v.y % scalar.x, - v.z % scalar.x); + return vec<3, T, Q>(v) %= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar % v.x, - scalar % v.y, - scalar % v.z); + return vec<3, T, Q>(scalar) %= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x % v.x, - scalar.x % v.y, - scalar.x % v.z); + return vec<3, T, Q>(scalar.x) %= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x % v2.x, - v1.y % v2.y, - v1.z % v2.z); + return vec<3, T, Q>(v1) %= v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x & scalar, - v.y & scalar, - v.z & scalar); + return vec<3, T, Q>(v) &= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x & scalar.x, - v.y & scalar.x, - v.z & scalar.x); + return vec<3, T, Q>(v) &= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar & v.x, - scalar & v.y, - scalar & v.z); + return vec<3, T, Q>(scalar) &= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x & v.x, - scalar.x & v.y, - scalar.x & v.z); + return vec<3, T, Q>(scalar.x) &= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x & v2.x, - v1.y & v2.y, - v1.z & v2.z); + return vec<3, T, Q>(v1) &= v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x | scalar, - v.y | scalar, - v.z | scalar); + return vec<3, T, Q>(v) |= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x | scalar.x, - v.y | scalar.x, - v.z | scalar.x); + return vec<3, T, Q>(v) |= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar | v.x, - scalar | v.y, - scalar | v.z); + return vec<3, T, Q>(scalar) |= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x | v.x, - scalar.x | v.y, - scalar.x | v.z); + return vec<3, T, Q>(scalar.x) |= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x | v2.x, - v1.y | v2.y, - v1.z | v2.z); + return vec<3, T, Q>(v1) |= v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x ^ scalar, - v.y ^ scalar, - v.z ^ scalar); + return vec<3, T, Q>(v) ^= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x ^ scalar.x, - v.y ^ scalar.x, - v.z ^ scalar.x); + return vec<3, T, Q>(v) ^= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar ^ v.x, - scalar ^ v.y, - scalar ^ v.z); + return vec<3, T, Q>(scalar) ^= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x ^ v.x, - scalar.x ^ v.y, - scalar.x ^ v.z); + return vec<3, T, Q>(scalar.x) ^= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x ^ v2.x, - v1.y ^ v2.y, - v1.z ^ v2.z); + return vec<3, T, Q>(v1) ^= v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x << scalar, - v.y << scalar, - v.z << scalar); + return vec<3, T, Q>(v) <<= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x << scalar.x, - v.y << scalar.x, - v.z << scalar.x); + return vec<3, T, Q>(v) <<= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar << v.x, - scalar << v.y, - scalar << v.z); + return vec<3, T, Q>(scalar) << v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x << v.x, - scalar.x << v.y, - scalar.x << v.z); + return vec<3, T, Q>(scalar.x) << v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x << v2.x, - v1.y << v2.y, - v1.z << v2.z); + return vec<3, T, Q>(v1) <<= v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar) { - return vec<3, T, Q>( - v.x >> scalar, - v.y >> scalar, - v.z >> scalar); + return vec<3, T, Q>(v) >>= scalar; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) { - return vec<3, T, Q>( - v.x >> scalar.x, - v.y >> scalar.x, - v.z >> scalar.x); + return vec<3, T, Q>(v) >>= scalar.x; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar >> v.x, - scalar >> v.y, - scalar >> v.z); + return vec<3, T, Q>(scalar) >>= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) { - return vec<3, T, Q>( - scalar.x >> v.x, - scalar.x >> v.y, - scalar.x >> v.z); + return vec<3, T, Q>(scalar.x) >>= v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { - return vec<3, T, Q>( - v1.x >> v2.x, - v1.y >> v2.y, - v1.z >> v2.z); + return vec<3, T, Q>(v1) >>= v2; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator~(vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v) { return vec<3, T, Q>( ~v.x, @@ -967,29 +802,184 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { return - detail::compute_equal::call(v1.x, v2.x) && - detail::compute_equal::call(v1.y, v2.y) && - detail::compute_equal::call(v1.z, v2.z); + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y) && + detail::compute_equal::is_iec559>::call(v1.z, v2.z); } template - GLM_FUNC_QUALIFIER bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { return !(v1 == v2); } template - GLM_FUNC_QUALIFIER vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) { return vec<3, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z); } template - GLM_FUNC_QUALIFIER vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) { return vec<3, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z); } }//namespace glm + + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_vec_simd.inl" + +namespace glm { + +#if (GLM_ARCH & GLM_ARCH_NEON_BIT) && !GLM_CONFIG_XYZW_ONLY + CTORSL(3, CTOR_FLOAT); + CTORSL(3, CTOR_INT); + CTORSL(3, CTOR_UINT); + CTORSL(3, CTOR_VECF_INT3); + CTORSL(3, CTOR_VECF_UINT3); + CTORSL(3, CTOR_VECF_VECF); + CTORSL(3, CTOR_VECF_VECI); + CTORSL(3, CTOR_VECF_VECU); +#endif + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + CTORSL(3, CTOR_FLOAT_COPY3); + CTORSL(3, CTOR_DOUBLE_COPY3); + CTORSL(3, CTOR_FLOAT); + CTORSL(3, CTOR_FLOAT3); + CTORSL(3, CTOR_DOUBLE3); + CTORSL(3, CTOR_INT); + CTORSL(3, CTOR_INT3); + CTORSL(3, CTOR_VECF_INT3); + + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, double, aligned_highp>::vec(const vec<3, double, aligned_highp>& v) +#if (GLM_ARCH & GLM_ARCH_AVX_BIT) + :data(v.data) {} +#else + { + data.setv(0, v.data.getv(0)); + data.setv(1, v.data.getv(1)); + } +#endif + + + + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, float, aligned_highp>::vec(const vec<3, float, aligned_highp>& v) : + data(v.data) {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, float, aligned_highp>::vec(const vec<3, float, packed_highp>& v) + { + data = _mm_set_ps(v[2], v[2], v[1], v[0]); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, float, packed_highp>::vec(const vec<3, float, aligned_highp>& v) + { + _mm_store_sd(reinterpret_cast(this), _mm_castps_pd(v.data)); + __m128 mz = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(this)+2, mz); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, double, aligned_highp>::vec(const vec<3, double, packed_highp>& v) + { +#if (GLM_ARCH & GLM_ARCH_AVX_BIT) + data = _mm256_set_pd(v[2], v[2], v[1], v[0]); +#else + data.setv(0, _mm_loadu_pd(reinterpret_cast(&v))); + data.setv(1, _mm_loadu_pd(reinterpret_cast(&v)+2)); +#endif + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, double, packed_highp>::vec(const vec<3, double, aligned_highp>& v) + { +#if (GLM_ARCH & GLM_ARCH_AVX_BIT) + __m256d T1 = _mm256_permute_pd(v.data, 1); + _mm_store_sd((reinterpret_cast(this)) + 0, _mm256_castpd256_pd128(v.data)); + _mm_store_sd((reinterpret_cast(this)) + 1, _mm256_castpd256_pd128(T1)); + _mm_store_sd((reinterpret_cast(this)) + 2, _mm256_extractf128_pd(v.data, 1)); +#else + _mm_storeu_pd(reinterpret_cast(this), v.data.getv(0)); + _mm_store_sd((reinterpret_cast(this)) + 2, v.data.getv(1)); +#endif + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, int, aligned_highp>::vec(const vec<3, int, aligned_highp>& v) : + data(v.data) + { + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, int, aligned_highp>::vec(const vec<3, int, packed_highp>& v) + { + __m128 mx = _mm_load_ss(reinterpret_cast(&v[0])); + __m128 my = _mm_load_ss(reinterpret_cast(&v[1])); + __m128 mz = _mm_load_ss(reinterpret_cast(&v[2])); + __m128 mxy = _mm_unpacklo_ps(mx, my); + data = _mm_castps_si128(_mm_movelh_ps(mxy, mz)); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, int, packed_highp>::vec(const vec<3, int, aligned_highp>& v) + { + _mm_store_sd(reinterpret_cast(this), _mm_castsi128_pd(v.data)); + __m128 mz = _mm_shuffle_ps(_mm_castsi128_ps(v.data), _mm_castsi128_ps(v.data), _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(this)+2, mz); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, unsigned int, aligned_highp>::vec(const vec<3, unsigned int, aligned_highp>& v) : + data(v.data) + { + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, unsigned int, aligned_highp>::vec(const vec<3, unsigned int, packed_highp>& v) + { + __m128 mx = _mm_load_ss(reinterpret_cast(&v[0])); + __m128 my = _mm_load_ss(reinterpret_cast(&v[1])); + __m128 mz = _mm_load_ss(reinterpret_cast(&v[2])); + __m128 mxy = _mm_unpacklo_ps(mx, my); + data = _mm_castps_si128(_mm_movelh_ps(mxy, mz)); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, unsigned int, packed_highp>::vec(const vec<3, unsigned int, aligned_highp>& v) + { + _mm_store_sd(reinterpret_cast(this), _mm_castsi128_pd(v.data)); + __m128 mz = _mm_shuffle_ps(_mm_castsi128_ps(v.data), _mm_castsi128_ps(v.data), _MM_SHUFFLE(2, 2, 2, 2)); + _mm_store_ss(reinterpret_cast(this) + 2, mz); + } + + CTORSL(3, CTOR_DOUBLE); + //CTORSL(3, CTOR_INT64); + +#endif //GLM_ARCH & GLM_ARCH_SSE2_BITt + + +} + +#endif diff --git a/vendor/glm/detail/type_vec4.hpp b/vendor/glm/detail/type_vec4.hpp old mode 100755 new mode 100644 index 43395ca456..9ba11229f6 --- a/vendor/glm/detail/type_vec4.hpp +++ b/vendor/glm/detail/type_vec4.hpp @@ -3,14 +3,12 @@ #pragma once -#include "type_vec.hpp" -#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED -# if GLM_HAS_UNRESTRICTED_UNIONS -# include "_swizzle.hpp" -# else -# include "_swizzle_func.hpp" -# endif -#endif //GLM_SWIZZLE +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif #include namespace glm @@ -23,32 +21,43 @@ namespace glm typedef T value_type; typedef vec<4, T, Q> type; typedef vec<4, bool, Q> bool_type; + + enum is_aligned + { + value = detail::is_aligned::value + }; // -- Data -- -# if GLM_HAS_ONLY_XYZW - T x, y, z, w; - -# elif GLM_HAS_ALIGNED_TYPE +# if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wpedantic" -# endif -# if GLM_COMPILER & GLM_COMPILER_CLANG +# elif GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wgnu-anonymous-struct" # pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union # endif +# endif +# if GLM_CONFIG_XYZW_ONLY + T x, y, z, w; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, Q, x, y, z, w) +# endif//GLM_CONFIG_SWIZZLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE union { - struct { T x, y, z, w;}; + struct { T x, y, z, w; }; struct { T r, g, b, a; }; struct { T s, t, p, q; }; - typename detail::storage::value>::type data; + typename detail::storage<4, T, detail::is_aligned::value>::type data; -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR GLM_SWIZZLE4_2_MEMBERS(T, Q, x, y, z, w) GLM_SWIZZLE4_2_MEMBERS(T, Q, r, g, b, a) GLM_SWIZZLE4_2_MEMBERS(T, Q, s, t, p, q) @@ -58,394 +67,446 @@ namespace glm GLM_SWIZZLE4_4_MEMBERS(T, Q, x, y, z, w) GLM_SWIZZLE4_4_MEMBERS(T, Q, r, g, b, a) GLM_SWIZZLE4_4_MEMBERS(T, Q, s, t, p, q) -# endif//GLM_SWIZZLE +# endif }; - -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# endif -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# endif # else union { T x, r, s; }; union { T y, g, t; }; union { T z, b, p; }; union { T w, a, q; }; -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED - GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P) -# endif//GLM_SWIZZLE +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, Q) +# endif +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif # endif // -- Component accesses -- - /// Return the count of components of the vector typedef length_t length_type; + + /// Return the count of components of the vector GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const& operator[](length_type i) const; + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v) GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, Q> const& v) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, P> const& v); + GLM_CTOR_DECL vec(vec<4, T, P> const& v); // -- Explicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(T x, T y, T z, T w); + GLM_CTOR_DECL explicit vec(T scalar); + GLM_CTOR_DECL vec(T x, T y, T z, T w); // -- Conversion scalar constructors -- + template + GLM_CTOR_DECL explicit vec(vec<1, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(X _x, Y _y, Z _z, W _w); + GLM_CTOR_DECL vec(X _x, Y _y, Z _z, W _w); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _Y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w); + template + GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); // -- Conversion vector constructors -- /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, P> const& _xy, B _z, C _w); + GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, B _z, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w); + GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A _x, vec<2, B, P> const& _yz, C _w); + GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A _x, B _y, vec<2, C, P> const& _zw); + GLM_CTOR_DECL vec(A _x, vec<2, B, P> const& _yz, C _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); + GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL vec(A _x, B _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, A, P> const& _xyz, B _w); + GLM_CTOR_DECL vec(vec<3, A, P> const& _xyz, B _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w); + GLM_CTOR_DECL vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A _x, vec<3, B, P> const& _yzw); + GLM_CTOR_DECL vec(A _x, vec<3, B, P> const& _yzw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw); + GLM_CTOR_DECL vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw); + GLM_CTOR_DECL vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw); /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, P> const& v); + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<4, U, P> const& v); // -- Swizzle constructors -- -# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template - GLM_FUNC_DECL vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that) + GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that) { *this = that(); } template - GLM_FUNC_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u) + GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u) { *this = vec<4, T, Q>(v(), u()); } template - GLM_FUNC_DECL vec(T const& x, T const& y, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) + GLM_FUNC_DISCARD_DECL vec(T const& x, T const& y, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) { *this = vec<4, T, Q>(x, y, v()); } template - GLM_FUNC_DECL vec(T const& x, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& w) + GLM_FUNC_DISCARD_DECL vec(T const& x, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& w) { *this = vec<4, T, Q>(x, v(), w); } template - GLM_FUNC_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& z, T const& w) + GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& z, T const& w) { *this = vec<4, T, Q>(v(), z, w); } template - GLM_FUNC_DECL vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v, T const& w) + GLM_FUNC_DISCARD_DECL vec(detail::_swizzle<3, T, Q, E0, E1, E2, 3> const& v, T const& w) { *this = vec<4, T, Q>(v(), w); } template - GLM_FUNC_DECL vec(T const& x, detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v) + GLM_FUNC_DISCARD_DECL vec(T const& x, detail::_swizzle<3, T, Q, E0, E1, E2, 3> const& v) { *this = vec<4, T, Q>(x, v()); } -# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec<4, T, Q>& operator=(vec<4, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q>& operator+=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q>& operator+=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q>& operator+=(vec<4, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q>& operator-=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q>& operator-=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q>& operator-=(vec<4, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q>& operator*=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q>& operator*=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q>& operator*=(vec<4, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q>& operator/=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q>& operator/=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q>& operator/=(vec<4, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<4, U, Q> const& v); // -- Increment and decrement operators -- - GLM_FUNC_DECL vec<4, T, Q> & operator++(); - GLM_FUNC_DECL vec<4, T, Q> & operator--(); - GLM_FUNC_DECL vec<4, T, Q> operator++(int); - GLM_FUNC_DECL vec<4, T, Q> operator--(int); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q> & operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator--(int); // -- Unary bit operators -- template - GLM_FUNC_DECL vec<4, T, Q> & operator%=(U scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q> & operator%=(vec<1, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator%=(vec<4, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator&=(U scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q> & operator&=(vec<1, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator&=(vec<4, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator|=(U scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q> & operator|=(vec<1, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator|=(vec<4, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator^=(U scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q> & operator^=(vec<1, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator^=(vec<4, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator<<=(U scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator>>=(U scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DECL vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v); }; + // -- Unary operators -- template - GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v); // -- Binary operators -- template - GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); template - GLM_FUNC_DECL vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); template - GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, T, Q> operator~(vec<4, T, Q> const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v); // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); template - GLM_FUNC_DECL vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); template - GLM_FUNC_DECL vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/detail/type_vec4.inl b/vendor/glm/detail/type_vec4.inl old mode 100755 new mode 100644 index 972cb4e4d7..66539e3049 --- a/vendor/glm/detail/type_vec4.inl +++ b/vendor/glm/detail/type_vec4.inl @@ -1,202 +1,64 @@ /// @ref core -/// @file glm/detail/type_tvec4.inl + +#include "compute_vector_relational.hpp" +#include "compute_vector_decl.hpp" namespace glm{ namespace detail { - template - struct is_int - { - enum test {value = 0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template - struct compute_vec4_add - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); - } - }; - template - struct compute_vec4_sub - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); - } - }; - - template - struct compute_vec4_mul - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); - } - }; - - template - struct compute_vec4_div - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); - } - }; - - template - struct compute_vec4_mod - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x % b.x, a.y % b.y, a.z % b.z, a.w % b.w); - } - }; - - template - struct compute_vec4_and - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x & b.x, a.y & b.y, a.z & b.z, a.w & b.w); - } - }; - - template - struct compute_vec4_or - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x | b.x, a.y | b.y, a.z | b.z, a.w | b.w); - } - }; - - template - struct compute_vec4_xor - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); - } - }; - - template - struct compute_vec4_shift_left - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x << b.x, a.y << b.y, a.z << b.z, a.w << b.w); - } - }; - - template - struct compute_vec4_shift_right - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x >> b.x, a.y >> b.y, a.z >> b.z, a.w >> b.w); - } - }; - - template - struct compute_vec4_equal - { - GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return - detail::compute_equal::call(v1.x, v2.x) && - detail::compute_equal::call(v1.y, v2.y) && - detail::compute_equal::call(v1.z, v2.z) && - detail::compute_equal::call(v1.w, v2.w); - } - }; - - template - struct compute_vec4_nequal - { - GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return !compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); - } - }; - - template - struct compute_vec4_bitwise_not - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& v) - { - return vec<4, T, Q>(~v.x, ~v.y, ~v.z, ~v.w); - } - }; }//namespace detail // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec() -# ifdef GLM_FORCE_CTOR_INIT + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE : x(0), y(0), z(0), w(0) # endif {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(vec<4, T, Q> const& v) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, Q> const& v) : x(v.x), y(v.y), z(v.z), w(v.w) {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(vec<4, T, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, P> const& v) : x(v.x), y(v.y), z(v.z), w(v.w) {} // -- Explicit basic constructors -- template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(T scalar) : x(scalar), y(scalar), z(scalar), w(scalar) {} - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(T _x, T _y, T _z, T _w) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(T _x, T _y, T _z, T _w) : x(_x), y(_y), z(_z), w(_w) {} // -- Conversion scalar constructors -- + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + , z(static_cast(v.x)) + , w(static_cast(v.x)) + {} + template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec(X _x, Y _y, Z _z, W _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, Z _z, W _w) : x(static_cast(_x)) , y(static_cast(_y)) , z(static_cast(_z)) @@ -205,7 +67,124 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) : x(static_cast(_x.x)) , y(static_cast(_y.x)) , z(static_cast(_z.x)) @@ -216,7 +195,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, C _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, C _w) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_z)) @@ -225,7 +204,25 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_z.x)) @@ -234,7 +231,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, C _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, C _w) : x(static_cast(_x)) , y(static_cast(_yz.x)) , z(static_cast(_yz.y)) @@ -243,16 +240,34 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w) : x(static_cast(_x.x)) , y(static_cast(_yz.x)) , z(static_cast(_yz.y)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) + : x(static_cast(_x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) , w(static_cast(_w.x)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(A _x, B _y, vec<2, C, P> const& _zw) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, B _y, vec<2, C, P> const& _zw) : x(static_cast(_x)) , y(static_cast(_y)) , z(static_cast(_zw.x)) @@ -261,7 +276,25 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) : x(static_cast(_x.x)) , y(static_cast(_y.x)) , z(static_cast(_zw.x)) @@ -270,7 +303,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, B _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, B _w) : x(static_cast(_xyz.x)) , y(static_cast(_xyz.y)) , z(static_cast(_xyz.z)) @@ -279,7 +312,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w) : x(static_cast(_xyz.x)) , y(static_cast(_xyz.y)) , z(static_cast(_xyz.z)) @@ -288,7 +321,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(A _x, vec<3, B, P> const& _yzw) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<3, B, P> const& _yzw) : x(static_cast(_x)) , y(static_cast(_yzw.x)) , z(static_cast(_yzw.y)) @@ -297,7 +330,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw) : x(static_cast(_x.x)) , y(static_cast(_yzw.x)) , z(static_cast(_yzw.y)) @@ -306,7 +339,7 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw) : x(static_cast(_xy.x)) , y(static_cast(_xy.y)) , z(static_cast(_zw.x)) @@ -315,34 +348,57 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<4, T, Q>::vec(vec<4, U, P> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, U, P> const& v) : x(static_cast(v.x)) , y(static_cast(v.y)) , z(static_cast(v.z)) , w(static_cast(v.w)) {} + // -- Component accesses -- template - GLM_FUNC_QUALIFIER T& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) { - assert(i >= 0 && i < this->length()); - return (&x)[i]; + GLM_ASSERT_LENGTH(i, this->length()); + switch (i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + case 3: + return w; + } } template - GLM_FUNC_QUALIFIER T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const { - assert(i >= 0 && i < this->length()); - return (&x)[i]; + GLM_ASSERT_LENGTH(i, this->length()); + switch (i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + case 3: + return w; + } } // -- Unary arithmetic operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) { this->x = v.x; this->y = v.y; @@ -350,11 +406,11 @@ namespace detail this->w = v.w; return *this; } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) { this->x = static_cast(v.x); this->y = static_cast(v.y); @@ -365,92 +421,92 @@ namespace detail template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator+=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(U scalar) { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_add<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v.x))); + return (*this = detail::compute_vec_add<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_add<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator-=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(U scalar) { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_sub<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v.x))); + return (*this = detail::compute_vec_sub<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_sub<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator*=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(U scalar) { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_mul<4,T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v.x))); + return (*this = detail::compute_vec_mul<4,T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_mul<4,T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator/=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(U scalar) { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_div<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v.x))); + return (*this = detail::compute_vec_div<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v.x))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_div<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } // -- Increment and decrement operators -- template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator++() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator++() { ++this->x; ++this->y; @@ -460,7 +516,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator--() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator--() { --this->x; --this->y; @@ -470,7 +526,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER vec<4, T, Q> vec<4, T, Q>::operator++(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator++(int) { vec<4, T, Q> Result(*this); ++*this; @@ -478,7 +534,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER vec<4, T, Q> vec<4, T, Q>::operator--(int) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator--(int) { vec<4, T, Q> Result(*this); --*this; @@ -489,140 +545,140 @@ namespace detail template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator%=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(U scalar) { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_mod<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned::value>::call(*this, vec<3, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_mod<4, T, Q, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator&=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(U scalar) { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_and<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_and<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_and<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator|=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(U scalar) { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_or<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_or<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_or<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator^=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(U scalar) { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_xor<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_xor<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_xor<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator<<=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(U scalar) { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_shift_left<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_shift_left<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_shift_left<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator>>=(U scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(U scalar) { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + return (*this = detail::compute_vec_shift_right<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<1, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<1, U, Q> const& v) { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_shift_right<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } template template - GLM_FUNC_QUALIFIER vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<4, U, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<4, U, Q> const& v) { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + return (*this = detail::compute_vec_shift_right<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); } // -- Unary constant operators -- template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v) { return v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v) { return vec<4, T, Q>(0) -= v; } @@ -630,121 +686,121 @@ namespace detail // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) += scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) += v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(v) += scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v2) += v1; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) += v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) -= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) -= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) -= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1.x) -= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) -= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) *= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) *= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(v) *= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v2) *= v1; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) *= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) /= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) /= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) /= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1.x) /= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) /= v2; } @@ -752,218 +808,323 @@ namespace detail // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) %= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) %= v2.x; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) %= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar.x) %= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) %= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) &= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar) { return vec<4, T, Q>(v) &= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) &= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1.x) &= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) &= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) |= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) |= v2.x; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) |= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1.x) |= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) |= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) ^= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) ^= v2.x; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) ^= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1.x) ^= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) ^= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) <<= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) <<= v2.x; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) <<= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1.x) <<= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) <<= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar) { return vec<4, T, Q>(v) >>= scalar; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) { return vec<4, T, Q>(v1) >>= v2.x; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v) { return vec<4, T, Q>(scalar) >>= v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1.x) >>= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return vec<4, T, Q>(v1) >>= v2; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator~(vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v) { - return detail::compute_vec4_bitwise_not::value, sizeof(T) * 8, detail::is_aligned::value>::call(v); + return detail::compute_vec_bitwise_not<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(v); } // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return detail::compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + return detail::compute_vec_equal<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); } template - GLM_FUNC_QUALIFIER bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { - return detail::compute_vec4_nequal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + return detail::compute_vec_nequal<4, T, Q, detail::is_int::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) { return vec<4, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z, v1.w && v2.w); } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) { return vec<4, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z, v1.w || v2.w); } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_ALIGNED_TYPE -# include "type_vec4_simd.inl" +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_vec_simd.inl" + +namespace glm { +#if GLM_ARCH & GLM_ARCH_NEON_BIT && !GLM_CONFIG_XYZW_ONLY + CTORSL(4, CTOR_FLOAT); + CTORSL(4, CTOR_INT); + CTORSL(4, CTOR_UINT); + CTORSL(4, CTOR_VECF_INT4); + CTORSL(4, CTOR_VECF_UINT4); + CTORSL(4, CTOR_VECF_VECF); + CTORSL(4, CTOR_VECF_VECI); + CTORSL(4, CTOR_VECF_VECU); + + +#endif// GLM_ARCH & GLM_ARCH_NEON_BIT + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + CTORSL(4, CTOR_FLOAT); + CTORSL(4, CTOR_DOUBLE); + CTORSL(4, CTOR_FLOAT4); + CTORSL(4, CTOR_DOUBLE4); + CTORSL(4, CTOR_INT); + CTORSL(4, CTOR_INT4); + CTORSL(4, CTOR_VECF_INT4); + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, float, aligned_highp>& v): + data(v.data) + { + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, float, packed_highp>& v) + { + data = _mm_loadu_ps(reinterpret_cast(&v)); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, packed_highp>::vec(const vec<4, float, aligned_highp>& v) + { + _mm_storeu_ps(reinterpret_cast(this), v.data); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(const vec<4, int, aligned_highp>& v) : + data(v.data) + { + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(const vec<4, int, packed_highp>& v) + { + data = _mm_loadu_si128(reinterpret_cast(&v)); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, packed_highp>::vec(const vec<4, int, aligned_highp>& v) + { + _mm_storeu_si128(reinterpret_cast<__m128i*>(this), v.data); + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_highp>::vec(const vec<4, double, aligned_highp>& v) + { +# if (GLM_ARCH & GLM_ARCH_AVX_BIT) + data = v.data; +#else + data.setv(0, v.data.getv(0)); + data.setv(1, v.data.getv(1)); +#endif + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_highp>::vec(const vec<4, double, packed_highp>& v) + { +# if (GLM_ARCH & GLM_ARCH_AVX_BIT) + data = _mm256_loadu_pd(reinterpret_cast(&v)); +#else + data.setv(0, _mm_loadu_pd(reinterpret_cast(&v))); + data.setv(1, _mm_loadu_pd(reinterpret_cast(&v)+2)); +#endif + } + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, packed_highp>::vec(const vec<4, double, aligned_highp>& v) + { +# if (GLM_ARCH & GLM_ARCH_AVX_BIT) + _mm256_storeu_pd(reinterpret_cast(this), v.data); +#else + _mm_storeu_pd(reinterpret_cast(this), v.data.getv(0)); + _mm_storeu_pd(reinterpret_cast(this) + 2, v.data.getv(1)); +#endif + } + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT +} + #endif diff --git a/vendor/glm/detail/type_vec4_simd.inl b/vendor/glm/detail/type_vec4_simd.inl deleted file mode 100755 index adfb20cf6a..0000000000 --- a/vendor/glm/detail/type_vec4_simd.inl +++ /dev/null @@ -1,458 +0,0 @@ -/// @ref core -/// @file glm/detail/type_tvec4_simd.inl - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -namespace glm{ -namespace detail -{ -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED - template - struct _swizzle_base1<4, float, Q, E0,E1,E2,E3, true> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, float, Q> operator ()() const - { - __m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer); - - vec<4, float, Q> Result; -# if GLM_ARCH & GLM_ARCH_AVX_BIT - Result.data = _mm_permute_ps(data, _MM_SHUFFLE(E3, E2, E1, E0)); -# else - Result.data = _mm_shuffle_ps(data, data, _MM_SHUFFLE(E3, E2, E1, E0)); -# endif - return Result; - } - }; - - template - struct _swizzle_base1<4, int32, Q, E0,E1,E2,E3, true> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, int32, Q> operator ()() const - { - __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); - - vec<4, int32, Q> Result; - Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); - return Result; - } - }; - - template - struct _swizzle_base1<4, uint32, Q, E0,E1,E2,E3, true> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, uint32, Q> operator ()() const - { - __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); - - vec<4, uint32, Q> Result; - Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); - return Result; - } - }; -# endif// GLM_SWIZZLE == GLM_SWIZZLE_ENABLED - - template - struct compute_vec4_add - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = _mm_add_ps(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_vec4_add - { - static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) - { - vec<4, double, Q> Result; - Result.data = _mm256_add_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_sub - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = _mm_sub_ps(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_vec4_sub - { - static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) - { - vec<4, double, Q> Result; - Result.data = _mm256_sub_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_mul - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = _mm_mul_ps(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_vec4_mul - { - static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) - { - vec<4, double, Q> Result; - Result.data = _mm256_mul_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_div - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = _mm_div_ps(a.data, b.data); - return Result; - } - }; - - # if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_vec4_div - { - static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) - { - vec<4, double, Q> Result; - Result.data = _mm256_div_pd(a.data, b.data); - return Result; - } - }; -# endif - - template<> - struct compute_vec4_div - { - static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& a, vec<4, float, aligned_lowp> const& b) - { - vec<4, float, aligned_lowp> Result; - Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data)); - return Result; - } - }; - - template - struct compute_vec4_and - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_and_si128(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_and - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_and_si256(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_or - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_or_si128(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_or - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_or_si256(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_xor - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_xor_si128(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_xor - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_xor_si256(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_shift_left - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_sll_epi32(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_shift_left - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_sll_epi64(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_shift_right - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_srl_epi32(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_shift_right - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_srl_epi64(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_bitwise_not - { - static vec<4, T, Q> call(vec<4, T, Q> const& v) - { - vec<4, T, Q> Result; - Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1)); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_bitwise_not - { - static vec<4, T, Q> call(vec<4, T, Q> const& v) - { - vec<4, T, Q> Result; - Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1)); - return Result; - } - }; -# endif - - template - struct compute_vec4_equal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0; - } - }; - - template - struct compute_vec4_equal - { - static bool call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) - { - return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0; - } - }; - - template - struct compute_vec4_nequal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0; - } - }; - - template - struct compute_vec4_nequal - { - static bool call(vec<4, int32, Q> const& v1, vec<4, int32, Q> const& v2) - { - return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0; - } - }; -}//namespace detail - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float _s) : - data(_mm_set1_ps(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(float _s) : - data(_mm_set1_ps(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(float _s) : - data(_mm_set1_ps(_s)) - {} - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_lowp>::vec(double _s) : - data(_mm256_set1_pd(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_mediump>::vec(double _s) : - data(_mm256_set1_pd(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_highp>::vec(double _s) : - data(_mm256_set1_pd(_s)) - {} -# endif - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_lowp>::vec(int32 _s) : - data(_mm_set1_epi32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_mediump>::vec(int32 _s) : - data(_mm_set1_epi32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_highp>::vec(int32 _s) : - data(_mm_set1_epi32(_s)) - {} - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_lowp>::vec(int64 _s) : - data(_mm256_set1_epi64x(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_mediump>::vec(int64 _s) : - data(_mm256_set1_epi64x(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_highp>::vec(int64 _s) : - data(_mm256_set1_epi64x(_s)) - {} -# endif - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float _x, float _y, float _z, float _w) : - data(_mm_set_ps(_w, _z, _y, _x)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(float _x, float _y, float _z, float _w) : - data(_mm_set_ps(_w, _z, _y, _x)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(float _x, float _y, float _z, float _w) : - data(_mm_set_ps(_w, _z, _y, _x)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_lowp>::vec(int32 _x, int32 _y, int32 _z, int32 _w) : - data(_mm_set_epi32(_w, _z, _y, _x)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_mediump>::vec(int32 _x, int32 _y, int32 _z, int32 _w) : - data(_mm_set_epi32(_w, _z, _y, _x)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_highp>::vec(int32 _x, int32 _y, int32 _z, int32 _w) : - data(_mm_set_epi32(_w, _z, _y, _x)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(int32 _x, int32 _y, int32 _z, int32 _w) : - data(_mm_castsi128_ps(_mm_set_epi32(_w, _z, _y, _x))) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(int32 _x, int32 _y, int32 _z, int32 _w) : - data(_mm_castsi128_ps(_mm_set_epi32(_w, _z, _y, _x))) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(int32 _x, int32 _y, int32 _z, int32 _w) : - data(_mm_castsi128_ps(_mm_set_epi32(_w, _z, _y, _x))) - {} -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/vendor/glm/detail/type_vec_simd.inl b/vendor/glm/detail/type_vec_simd.inl new file mode 100644 index 0000000000..ca1d2fd01f --- /dev/null +++ b/vendor/glm/detail/type_vec_simd.inl @@ -0,0 +1,1032 @@ +#pragma once + +#define CTORSL(L, CTOR)\ +CTOR(L, aligned_lowp)\ +CTOR(L, aligned_mediump)\ +CTOR(L, aligned_highp)\ + +namespace glm { + namespace detail + { + +template +struct compute_vec_and : public compute_vec_and +{}; + +template +struct compute_vec_or: public compute_vec_or +{}; + +template +struct compute_vec_xor : public compute_vec_xor +{}; + +template +struct compute_vec_shift_left : public compute_vec_shift_left +{}; + +template +struct compute_vec_shift_right : public compute_vec_shift_right +{}; + +template +struct compute_vec_bitwise_not:public compute_vec_bitwise_not +{}; + +template +struct compute_vec_equal : public compute_vec_equal +{}; + +template +struct compute_vec_nequal : public compute_vec_nequal +{}; + +template +struct compute_vec_mod : public compute_vec_mod +{}; + + +template +struct compute_vec_add : public compute_vec_add +{}; + +template< length_t L, typename T, qualifier Q> +struct compute_vec_sub : public compute_vec_sub +{}; + +template< length_t L, typename T, qualifier Q> +struct compute_vec_mul : public compute_vec_mul +{}; + +template< length_t L, typename T, qualifier Q> +struct compute_vec_div : public compute_vec_div +{}; + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec operator ()() const + { + __m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer); + + vec Result; +# if GLM_ARCH & GLM_ARCH_AVX_BIT + Result.data = _mm_permute_ps(data, _MM_SHUFFLE(E3, E2, E1, E0)); +# else + Result.data = _mm_shuffle_ps(data, data, _MM_SHUFFLE(E3, E2, E1, E0)); +# endif + return Result; + } + }; + + template + struct _swizzle_base1<2, float, Q, E0, E1, E2, E3, true> : public _swizzle_base1<2, float, Q, E0, E1, E2, E3, false> {}; + + template + struct _swizzle_base1<2, int, Q, E0, E1, E2, E3, true> : public _swizzle_base1<2, int, Q, E0, E1, E2, E3, false> {}; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec operator ()() const + { + __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); + + vec Result; + Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); + return Result; + } + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec operator ()() const + { + __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); + + vec Result; + Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); + return Result; + } + }; +# endif// GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + + template + struct compute_vec_add + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_add_ps(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_add + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_add_epi32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_add + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; +# if (GLM_ARCH & GLM_ARCH_AVX_BIT) + Result.data = _mm256_add_pd(a.data, b.data); +#else + Result.data.setv(0, _mm_add_pd(a.data.getv(0), b.data.getv(0))); + Result.data.setv(1, _mm_add_pd(a.data.getv(1), b.data.getv(1))); +#endif + return Result; + } + }; + + template + struct compute_vec_sub + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_sub_ps(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_sub + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_sub_epi32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_sub + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; +#if (GLM_ARCH & GLM_ARCH_AVX_BIT) + Result.data = _mm256_sub_pd(a.data, b.data); +#else + Result.data.setv(0, _mm_sub_pd(a.data.getv(0), b.data.getv(0))); + Result.data.setv(1, _mm_sub_pd(a.data.getv(1), b.data.getv(1))); +#endif + return Result; + } + }; + + template + struct compute_vec_mul + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_mul_ps(a.data, b.data); + return Result; + } + }; + + + template + struct compute_vec_mul + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; +#if (GLM_ARCH & GLM_ARCH_AVX_BIT) + Result.data = _mm256_mul_pd(a.data, b.data); +#else + Result.data.setv(0, _mm_mul_pd(a.data.getv(0), b.data.getv(0))); + Result.data.setv(1, _mm_mul_pd(a.data.getv(1), b.data.getv(1))); +#endif + return Result; + } + }; + + template + struct compute_vec_mul + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + glm_i32vec4 ia = a.data; + glm_i32vec4 ib = b.data; +#ifdef __SSE4_1__ // modern CPU - use SSE 4.1 + Result.data = _mm_mullo_epi32(ia, ib); +#else // old CPU - use SSE 2 + __m128i tmp1 = _mm_mul_epu32(ia, ib); /* mul 2,0*/ + __m128i tmp2 = _mm_mul_epu32(_mm_srli_si128(ia, 4), _mm_srli_si128(ib, 4)); /* mul 3,1 */ + Result.data = _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE(0, 0, 2, 0))); /* shuffle results to [63..0] and pack */ +#endif + return Result; + } + }; + + template + struct compute_vec_div + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_div_ps(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_div + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { +#if defined(_MSC_VER) && _MSC_VER >= 1920 //_mm_div_epi32 only defined with VS >= 2019 + vec Result; + Result.data = _mm_div_epi32(a.data, b.data); + return Result; +#else + return compute_vec_div::call(a, b); +#endif + } + }; + + + // note: div on uninitialized w can generate div by 0 exception + template + struct compute_vec_div<3, int, Q, true> + { + + GLM_FUNC_QUALIFIER static vec<3, int, Q> call(vec<3, int, Q> const& a, vec<3, int, Q> const& b) + { +#if defined(_MSC_VER) && _MSC_VER >= 1920 //_mm_div_epi32 only defined with VS >= 2019 + vec<3, int, Q> Result; + glm_i32vec4 bv = b.data; + bv = _mm_shuffle_epi32(bv, _MM_SHUFFLE(0, 2, 1, 0)); + Result.data = _mm_div_epi32(a.data, bv); + return Result; +#else + return compute_vec_div<3, int, Q, false>::call(a, b); +#endif + } + }; + + + template + struct compute_vec_div + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; +# if GLM_ARCH & GLM_ARCH_AVX_BIT + Result.data = _mm256_div_pd(a.data, b.data); +# else + Result.data.setv(0, _mm_div_pd(a.data.getv(0), b.data.getv(0))); + Result.data.setv(1, _mm_div_pd(a.data.getv(1), b.data.getv(1))); +# endif + return Result; + } + }; + + template + struct compute_vec_div + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data)); + return Result; + } + }; + + template + struct compute_vec_and + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_and_si128(a.data, b.data); + return Result; + } + }; + + + template + struct compute_vec_and + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + Result.data = _mm256_and_si256(a.data, b.data); +# elif GLM_ARCH & GLM_ARCH_AVX_BIT + Result.data = _mm256_and_pd(_mm256_castpd256_pd128(a.data), _mm256_castpd256_pd128(b.data)); +# else + Result.data.setv(0, _mm_and_si128(a.data.getv(0), b.data.getv(0))); + Result.data.setv(1, _mm_and_si128(a.data.getv(1), b.data.getv(1))); +# endif + return Result; + } + }; + + + + template + struct compute_vec_or + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_or_si128(a.data, b.data); + return Result; + } + }; + + + template + struct compute_vec_or + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + Result.data = _mm256_or_si256(a.data, b.data); +# else + Result.data.setv(0, _mm_or_si128(a.data.getv(0), b.data.getv(0))); + Result.data.setv(1, _mm_or_si128(a.data.getv(1), b.data.getv(1))); +# endif + return Result; + } + }; + + template + struct compute_vec_xor + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = _mm_xor_si128(a.data, b.data); + return Result; + } + }; + + + template + struct compute_vec_xor + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + vec Result; +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + Result.data = _mm256_xor_si256(a.data, b.data); +# else + Result.data.setv(0, _mm_xor_si128(a.data.getv(0), b.data.getv(0))); + Result.data.setv(1, _mm_xor_si128(a.data.getv(1), b.data.getv(1))); +# endif + return Result; + } + }; + + + //template + //struct compute_vec_shift_left<3, T, Q, -1, 32, true> + //{ + // GLM_FUNC_QUALIFIER static vec<3, T, Q> call(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + // { + // vec<3, T, Q> Result; + // __m128 v2 = _mm_castsi128_ps(b.data); + // v2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(0, 0, 0, 0)); // note: shift is done with xmm[3] that correspond vec w that doesn't exist on vect3 + // _mm_set1_epi64x(_w, _z, _y, _x); + // __m128i vr = _mm_sll_epi32(a.data, _mm_castps_si128(v2)); + // Result.data = vr; + // return Result; + // } + //}; + + //template + //struct compute_vec_shift_left + //{ + // GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + // { + // vec Result; + // Result.data = _mm_sll_epi32(a.data, b.data); + // return Result; + // } + //}; + + +// template +// struct compute_vec_shift_left +// { +// GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) +// { +// vec Result; +//# if GLM_ARCH & GLM_ARCH_AVX2_BIT +// Result.data = _mm256_sll_epi64(a.data, b.data); +//# else +// Result.data.setv(0, _mm_sll_epi64(a.data.getv(0), b.data.getv(0))); +// Result.data.setv(1, _mm_sll_epi64(a.data.getv(1), b.data.getv(1))); +//# endif +// return Result; +// } +// }; + + +// template +// struct compute_vec_shift_right +// { +// GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) +// { +// vec Result; +// Result.data = _mm_srl_epi32(a.data, b.data); +// return Result; +// } +// }; +// +// template +// struct compute_vec_shift_right +// { +// GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) +// { +// vec Result; +//# if GLM_ARCH & GLM_ARCH_AVX2_BIT +// Result.data = _mm256_srl_epi64(a.data, b.data); +//# else +// Result.data.setv(0, _mm_srl_epi64(a.data.getv(0), b.data.getv(0))); +// Result.data.setv(1, _mm_srl_epi64(a.data.getv(1), b.data.getv(1))); +//# endif +// return Result; +// } +// }; + + template + struct compute_vec_bitwise_not + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + vec Result; + Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1)); + return Result; + } + }; + + + template + struct compute_vec_bitwise_not + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + vec Result; +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + Result.data = _mm256_xor_si256(v.data, _mm256_set1_epi32(-1)); +# else + Result.data.setv(0, _mm_xor_si128(v.data.getv(0), _mm_set1_epi32(-1))); + Result.data.setv(1, _mm_xor_si128(v.data.getv(1), _mm_set1_epi32(-1))); +# endif + return Result; + } + }; + + + template + struct compute_vec_equal + { + GLM_FUNC_QUALIFIER static bool call(vec const& v1, vec const& v2) + { + return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) == 0; + } + }; + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + template + struct compute_vec_equal + { + GLM_FUNC_QUALIFIER static bool call(vec const& v1, vec const& v2) + { + //return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0; + __m128i neq = _mm_xor_si128(v1.data, v2.data); + return _mm_test_all_zeros(neq, neq) == 0; + } + }; +# endif + + + + template + struct compute_vec_nequal + { + GLM_FUNC_QUALIFIER static bool call(vec const& v1, vec const& v2) + { + return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0; + } + }; + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + template + struct compute_vec_nequal + { + GLM_FUNC_QUALIFIER static bool call(vec const& v1, vec const& v2) + { + //return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0; + __m128i neq = _mm_xor_si128(v1.data, v2.data); + int v = _mm_test_all_zeros(neq, neq); + return v != 1; + } + }; + template + struct compute_vec_nequal + { + GLM_FUNC_QUALIFIER static bool call(vec const& v1, vec const& v2) + { + //return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0; + __m128i neq = _mm_xor_si128(v1.data, v2.data); + return _mm_test_all_zeros(neq, neq) != 1; + } + }; +# else + + + template + struct compute_vec_nequal + { + GLM_FUNC_QUALIFIER static bool call(vec const& v1, vec const& v2) + { + return compute_vec_nequal::call(v1, v2); + } + }; + +# endif + + + + +}//namespace detail + + +#define CTOR_FLOAT(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(float _s) :\ + data(_mm_set1_ps(_s))\ + {} + +#if GLM_ARCH & GLM_ARCH_AVX_BIT +# define CTOR_DOUBLE(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(double _s) :\ + data(_mm256_set1_pd(_s)){} + +#define CTOR_DOUBLE4(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(double _x, double _y, double _z, double _w):\ + data(_mm256_set_pd(_w, _z, _y, _x)) {} + +#define CTOR_DOUBLE3(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(double _x, double _y, double _z):\ + data(_mm256_set_pd(_z, _z, _y, _x)) {} + +# define CTOR_INT64(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(detail::int64 _s) :\ + data(_mm256_set1_epi64x(_s)){} + +#define CTOR_DOUBLE_COPY3(L, Q)\ + template<>\ + template\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, double, Q>::vec(vec<3, double, P> const& v) :\ + data(_mm256_setr_pd(v.x, v.y, v.z, v.z)){} + +#else +# define CTOR_DOUBLE(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(double _v) \ + {\ + data.setv(0, _mm_set1_pd(_v)); \ + data.setv(1, _mm_set1_pd(_v)); \ + } + +#define CTOR_DOUBLE4(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(double _x, double _y, double _z, double _w)\ + {\ + data.setv(0, _mm_setr_pd(_x, _y)); \ + data.setv(1, _mm_setr_pd(_z, _w)); \ + } + +#define CTOR_DOUBLE3(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(double _x, double _y, double _z)\ + {\ + data.setv(0, _mm_setr_pd(_x, _y)); \ + data.setv(1, _mm_setr_pd(_z, _z)); \ + } + +# define CTOR_INT64(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(detail::int64 _s) :\ + data(_mm256_set1_epi64x(_s)){} + +#define CTOR_DOUBLE_COPY3(L, Q)\ + template<>\ + template\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, double, Q>::vec(vec<3, double, P> const& v)\ + {\ + data.setv(0, _mm_setr_pd(v.x, v.y));\ + data.setv(1, _mm_setr_pd(v.z, 1.0));\ + } + +#endif //GLM_ARCH & GLM_ARCH_AVX_BIT + +#define CTOR_INT(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(int _s) :\ + data(_mm_set1_epi32(_s))\ + {} + +#define CTOR_FLOAT4(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(float _x, float _y, float _z, float _w) :\ + data(_mm_set_ps(_w, _z, _y, _x))\ + {} + +#define CTOR_FLOAT3(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(float _x, float _y, float _z) :\ + data(_mm_set_ps(_z, _z, _y, _x)){} + + +#define CTOR_INT4(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(int _x, int _y, int _z, int _w) :\ + data(_mm_set_epi32(_w, _z, _y, _x)){} + +#define CTOR_INT3(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(int _x, int _y, int _z) :\ + data(_mm_set_epi32(_z, _z, _y, _x)){} + +#define CTOR_VECF_INT4(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(int _x, int _y, int _z, int _w) :\ + data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x)))\ + {} + +#define CTOR_VECF_INT3(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(int _x, int _y, int _z) :\ + data(_mm_cvtepi32_ps(_mm_set_epi32(_z, _z, _y, _x)))\ + {} + +#define CTOR_DEFAULT(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec() :\ + data(_mm_setzero_ps())\ + {} + +#define CTOR_FLOAT_COPY3(L, Q)\ + template<>\ + template\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, float, Q>::vec(vec<3, float, P> const& v)\ + :data(_mm_set_ps(v.z, v.z, v.y, v.x))\ + {} + + + +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + +#if GLM_ARCH & GLM_ARCH_NEON_BIT + +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +// the functions below needs to be properly implemented, use unoptimized function fro now. + +template +struct _swizzle_base1 : public _swizzle_base1{}; + +template +struct _swizzle_base1 : public _swizzle_base1 {}; + +template +struct _swizzle_base1 : public _swizzle_base1 {}; + +# endif// GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + + template + struct compute_vec_add + { + GLM_FUNC_QUALIFIER static + vec + call(vec const& a, vec const& b) + { + vec Result; + Result.data = vaddq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_add + { + GLM_FUNC_QUALIFIER static + vec + call(vec const& a, vec const& b) + { + vec Result; + Result.data = vaddq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_add + { + static + vec + call(vec const& a, vec const& b) + { + vec Result; + Result.data = vaddq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_sub + { + static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = vsubq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_sub + { + static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = vsubq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_sub + { + static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = vsubq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_mul + { + static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = vmulq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_mul + { + static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = vmulq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_mul + { + static vec call(vec const& a, vec const& b) + { + vec Result; + Result.data = vmulq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec_div + { + static vec call(vec const& a, vec const& b) + { + vec Result; +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + Result.data = vdivq_f32(a.data, b.data); +#else + /* Arm assembler reference: + * + * The Newton-Raphson iteration: x[n+1] = x[n] * (2 - d * x[n]) + * converges to (1/d) if x0 is the result of VRECPE applied to d. + * + * Note: The precision usually improves with two interactions, but more than two iterations are not helpful. */ + float32x4_t x = vrecpeq_f32(b.data); + x = vmulq_f32(vrecpsq_f32(b.data, x), x); + x = vmulq_f32(vrecpsq_f32(b.data, x), x); + Result.data = vmulq_f32(a.data, x); +#endif + return Result; + } + }; + + template + struct compute_vec_equal + { + static bool call(vec const& v1, vec const& v2) + { + uint32x4_t cmp = vceqq_f32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec_equal + { + static bool call(vec const& v1, vec const& v2) + { + uint32x4_t cmp = vceqq_u32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec_equal + { + static bool call(vec const& v1, vec const& v2) + { + uint32x4_t cmp = vceqq_s32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec_nequal + { + static bool call(vec const& v1, vec const& v2) + { + return !compute_vec_equal::call(v1, v2); + } + }; + + template + struct compute_vec_nequal + { + static bool call(vec const& v1, vec const& v2) + { + return !compute_vec_equal::call(v1, v2); + } + }; + + template + struct compute_vec_nequal + { + static bool call(vec const& v1, vec const& v2) + { + return !compute_vec_equal::call(v1, v2); + } + }; + + +#if !GLM_CONFIG_XYZW_ONLY + +#define CTOR_FLOAT(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(float _s) :\ + data(vdupq_n_f32(_s))\ + {} + +#define CTOR_INT(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(int _s) :\ + data(vdupq_n_s32(_s))\ + {} + +#define CTOR_UINT(L, Q)\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(uint _s) :\ + data(vdupq_n_u32(_s))\ + {} + +#define CTOR_VECF_INT4(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(int _x, int _y, int _z, int _w) :\ + data(vcvtq_f32_s32(vec(_x, _y, _z, _w).data))\ + {} + +#define CTOR_VECF_UINT4(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(uint _x, uint _y, uint _z, uint _w) :\ + data(vcvtq_f32_u32(vec(_x, _y, _z, _w).data))\ + {} + +#define CTOR_VECF_INT3(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(int _x, int _y, int _z) :\ + data(vcvtq_f32_s32(vec(_x, _y, _z).data))\ + {} + +#define CTOR_VECF_UINT4(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(uint _x, uint _y, uint _z, uint _w) :\ + data(vcvtq_f32_u32(vec(_x, _y, _z, _w).data))\ + {} + +#define CTOR_VECF_UINT3(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(uint _x, uint _y, uint _z) :\ + data(vcvtq_f32_u32(vec(_x, _y, _z).data))\ + {} + + +#define CTOR_VECF_VECF(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(const vec& rhs) :\ + data(rhs.data)\ + {} + +#define CTOR_VECF_VECI(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(const vec& rhs) :\ + data(vcvtq_f32_s32(rhs.data))\ + {} + +#define CTOR_VECF_VECU(L, Q)\ + template<>\ + template<>\ + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec::vec(const vec& rhs) :\ + data(vcvtq_f32_u32(rhs.data))\ + {} + + +#endif + + +}//namespace detail + +}//namespace glm + +#endif diff --git a/vendor/glm/exponential.hpp b/vendor/glm/exponential.hpp old mode 100755 new mode 100644 index 8fac30ee2b..1614f7695d --- a/vendor/glm/exponential.hpp +++ b/vendor/glm/exponential.hpp @@ -6,9 +6,11 @@ /// @defgroup core_func_exponential Exponential functions /// @ingroup core /// -/// Include to use these core features. +/// Provides GLSL exponential functions /// /// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. #pragma once @@ -33,7 +35,7 @@ namespace glm template GLM_FUNC_DECL vec pow(vec const& base, vec const& exponent); - /// Returns the natural exponentiation of x, i.e., e^x. + /// Returns the natural exponentiation of v, i.e., e^v. /// /// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier. /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. diff --git a/vendor/glm/ext.hpp b/vendor/glm/ext.hpp old mode 100755 new mode 100644 index 1f74f3cbc3..4356dbacf6 --- a/vendor/glm/ext.hpp +++ b/vendor/glm/ext.hpp @@ -6,15 +6,169 @@ #pragma once -#include "glm.hpp" +#include "./glm.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED) # define GLM_MESSAGE_EXT_INCLUDED_DISPLAYED # pragma message("GLM: All extensions included (not recommended)") #endif//GLM_MESSAGES -#include "./ext/vec1.hpp" +#include "./ext/matrix_clip_space.hpp" +#include "./ext/matrix_common.hpp" + +#include "./ext/matrix_double2x2.hpp" +#include "./ext/matrix_double2x2_precision.hpp" +#include "./ext/matrix_double2x3.hpp" +#include "./ext/matrix_double2x3_precision.hpp" +#include "./ext/matrix_double2x4.hpp" +#include "./ext/matrix_double2x4_precision.hpp" +#include "./ext/matrix_double3x2.hpp" +#include "./ext/matrix_double3x2_precision.hpp" +#include "./ext/matrix_double3x3.hpp" +#include "./ext/matrix_double3x3_precision.hpp" +#include "./ext/matrix_double3x4.hpp" +#include "./ext/matrix_double3x4_precision.hpp" +#include "./ext/matrix_double4x2.hpp" +#include "./ext/matrix_double4x2_precision.hpp" +#include "./ext/matrix_double4x3.hpp" +#include "./ext/matrix_double4x3_precision.hpp" +#include "./ext/matrix_double4x4.hpp" +#include "./ext/matrix_double4x4_precision.hpp" + +#include "./ext/matrix_float2x2.hpp" +#include "./ext/matrix_float2x2_precision.hpp" +#include "./ext/matrix_float2x3.hpp" +#include "./ext/matrix_float2x3_precision.hpp" +#include "./ext/matrix_float2x4.hpp" +#include "./ext/matrix_float2x4_precision.hpp" +#include "./ext/matrix_float3x2.hpp" +#include "./ext/matrix_float3x2_precision.hpp" +#include "./ext/matrix_float3x3.hpp" +#include "./ext/matrix_float3x3_precision.hpp" +#include "./ext/matrix_float3x4.hpp" +#include "./ext/matrix_float3x4_precision.hpp" +#include "./ext/matrix_float4x2.hpp" +#include "./ext/matrix_float4x2_precision.hpp" +#include "./ext/matrix_float4x3.hpp" +#include "./ext/matrix_float4x3_precision.hpp" +#include "./ext/matrix_float4x4.hpp" +#include "./ext/matrix_float4x4_precision.hpp" + +#include "./ext/matrix_int2x2.hpp" +#include "./ext/matrix_int2x2_sized.hpp" +#include "./ext/matrix_int2x3.hpp" +#include "./ext/matrix_int2x3_sized.hpp" +#include "./ext/matrix_int2x4.hpp" +#include "./ext/matrix_int2x4_sized.hpp" +#include "./ext/matrix_int3x2.hpp" +#include "./ext/matrix_int3x2_sized.hpp" +#include "./ext/matrix_int3x3.hpp" +#include "./ext/matrix_int3x3_sized.hpp" +#include "./ext/matrix_int3x4.hpp" +#include "./ext/matrix_int3x4_sized.hpp" +#include "./ext/matrix_int4x2.hpp" +#include "./ext/matrix_int4x2_sized.hpp" +#include "./ext/matrix_int4x3.hpp" +#include "./ext/matrix_int4x3_sized.hpp" +#include "./ext/matrix_int4x4.hpp" +#include "./ext/matrix_int4x4_sized.hpp" + +#include "./ext/matrix_uint2x2.hpp" +#include "./ext/matrix_uint2x2_sized.hpp" +#include "./ext/matrix_uint2x3.hpp" +#include "./ext/matrix_uint2x3_sized.hpp" +#include "./ext/matrix_uint2x4.hpp" +#include "./ext/matrix_uint2x4_sized.hpp" +#include "./ext/matrix_uint3x2.hpp" +#include "./ext/matrix_uint3x2_sized.hpp" +#include "./ext/matrix_uint3x3.hpp" +#include "./ext/matrix_uint3x3_sized.hpp" +#include "./ext/matrix_uint3x4.hpp" +#include "./ext/matrix_uint3x4_sized.hpp" +#include "./ext/matrix_uint4x2.hpp" +#include "./ext/matrix_uint4x2_sized.hpp" +#include "./ext/matrix_uint4x3.hpp" +#include "./ext/matrix_uint4x3_sized.hpp" +#include "./ext/matrix_uint4x4.hpp" +#include "./ext/matrix_uint4x4_sized.hpp" + +#include "./ext/matrix_projection.hpp" +#include "./ext/matrix_relational.hpp" +#include "./ext/matrix_transform.hpp" + +#include "./ext/quaternion_common.hpp" +#include "./ext/quaternion_double.hpp" +#include "./ext/quaternion_double_precision.hpp" +#include "./ext/quaternion_float.hpp" +#include "./ext/quaternion_float_precision.hpp" +#include "./ext/quaternion_exponential.hpp" +#include "./ext/quaternion_geometric.hpp" +#include "./ext/quaternion_relational.hpp" +#include "./ext/quaternion_transform.hpp" +#include "./ext/quaternion_trigonometric.hpp" + +#include "./ext/scalar_common.hpp" +#include "./ext/scalar_constants.hpp" +#include "./ext/scalar_integer.hpp" +#include "./ext/scalar_packing.hpp" +#include "./ext/scalar_reciprocal.hpp" +#include "./ext/scalar_relational.hpp" +#include "./ext/scalar_ulp.hpp" + +#include "./ext/scalar_int_sized.hpp" +#include "./ext/scalar_uint_sized.hpp" + +#include "./ext/vector_common.hpp" +#include "./ext/vector_integer.hpp" +#include "./ext/vector_packing.hpp" +#include "./ext/vector_reciprocal.hpp" #include "./ext/vector_relational.hpp" +#include "./ext/vector_ulp.hpp" + +#include "./ext/vector_bool1.hpp" +#include "./ext/vector_bool1_precision.hpp" +#include "./ext/vector_bool2.hpp" +#include "./ext/vector_bool2_precision.hpp" +#include "./ext/vector_bool3.hpp" +#include "./ext/vector_bool3_precision.hpp" +#include "./ext/vector_bool4.hpp" +#include "./ext/vector_bool4_precision.hpp" + +#include "./ext/vector_double1.hpp" +#include "./ext/vector_double1_precision.hpp" +#include "./ext/vector_double2.hpp" +#include "./ext/vector_double2_precision.hpp" +#include "./ext/vector_double3.hpp" +#include "./ext/vector_double3_precision.hpp" +#include "./ext/vector_double4.hpp" +#include "./ext/vector_double4_precision.hpp" + +#include "./ext/vector_float1.hpp" +#include "./ext/vector_float1_precision.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float2_precision.hpp" +#include "./ext/vector_float3.hpp" +#include "./ext/vector_float3_precision.hpp" +#include "./ext/vector_float4.hpp" +#include "./ext/vector_float4_precision.hpp" + +#include "./ext/vector_int1.hpp" +#include "./ext/vector_int1_sized.hpp" +#include "./ext/vector_int2.hpp" +#include "./ext/vector_int2_sized.hpp" +#include "./ext/vector_int3.hpp" +#include "./ext/vector_int3_sized.hpp" +#include "./ext/vector_int4.hpp" +#include "./ext/vector_int4_sized.hpp" + +#include "./ext/vector_uint1.hpp" +#include "./ext/vector_uint1_sized.hpp" +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_uint2_sized.hpp" +#include "./ext/vector_uint3.hpp" +#include "./ext/vector_uint3_sized.hpp" +#include "./ext/vector_uint4.hpp" +#include "./ext/vector_uint4_sized.hpp" #include "./gtc/bitfield.hpp" #include "./gtc/color_space.hpp" @@ -31,12 +185,11 @@ #include "./gtc/random.hpp" #include "./gtc/reciprocal.hpp" #include "./gtc/round.hpp" -//#include "./gtc/type_aligned.hpp" #include "./gtc/type_precision.hpp" #include "./gtc/type_ptr.hpp" #include "./gtc/ulp.hpp" #include "./gtc/vec1.hpp" -#if GLM_HAS_ALIGNED_TYPE +#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE # include "./gtc/type_aligned.hpp" #endif @@ -47,9 +200,11 @@ #include "./gtx/color_encoding.hpp" #include "./gtx/color_space.hpp" #include "./gtx/color_space_YCoCg.hpp" +#include "./gtx/common.hpp" #include "./gtx/compatibility.hpp" #include "./gtx/component_wise.hpp" #include "./gtx/dual_quaternion.hpp" +#include "./gtx/easing.hpp" #include "./gtx/euler_angles.hpp" #include "./gtx/extend.hpp" #include "./gtx/extended_min_max.hpp" @@ -59,10 +214,18 @@ #include "./gtx/functions.hpp" #include "./gtx/gradient_paint.hpp" #include "./gtx/handed_coordinate_space.hpp" + +#if __cplusplus >= 201103L +#include "./gtx/hash.hpp" +#endif + #include "./gtx/integer.hpp" #include "./gtx/intersect.hpp" +#include "./gtx/io.hpp" #include "./gtx/log_base.hpp" #include "./gtx/matrix_cross_product.hpp" +#include "./gtx/matrix_decompose.hpp" +#include "./gtx/matrix_factorisation.hpp" #include "./gtx/matrix_interpolation.hpp" #include "./gtx/matrix_major_storage.hpp" #include "./gtx/matrix_operation.hpp" @@ -74,15 +237,17 @@ #include "./gtx/number_precision.hpp" #include "./gtx/optimum_pow.hpp" #include "./gtx/orthonormalize.hpp" +#include "./gtx/pca.hpp" #include "./gtx/perpendicular.hpp" #include "./gtx/polar_coordinates.hpp" #include "./gtx/projection.hpp" #include "./gtx/quaternion.hpp" #include "./gtx/raw_data.hpp" +#include "./gtx/rotate_normalized_axis.hpp" #include "./gtx/rotate_vector.hpp" #include "./gtx/spline.hpp" #include "./gtx/std_based_type.hpp" -#if !(GLM_COMPILER & GLM_COMPILER_CUDA) +#if !((GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)) # include "./gtx/string_cast.hpp" #endif #include "./gtx/transform.hpp" diff --git a/vendor/glm/ext/_matrix_vectorize.hpp b/vendor/glm/ext/_matrix_vectorize.hpp new file mode 100644 index 0000000000..0d08117ed1 --- /dev/null +++ b/vendor/glm/ext/_matrix_vectorize.hpp @@ -0,0 +1,128 @@ +#pragma once + +namespace glm { + + namespace detail { + + template class mat, length_t C, length_t R, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<2, 2, T, Q> call(Ret (*Func)(T x), mat<2, 2, T, Q> const &x) { + return mat<2, 2, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), + Func(x[1][0]), Func(x[1][1]) + ); + } + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<2, 3, T, Q> call(Ret (*Func)(T x), mat<2, 3, T, Q> const &x) { + return mat<2, 3, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<2, 4, T, Q> call(Ret (*Func)(T x), mat<2, 4, T, Q> const &x) { + return mat<2, 4, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), Func(x[0][3]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), Func(x[1][3]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<3, 2, T, Q> call(Ret (*Func)(T x), mat<3, 2, T, Q> const &x) { + return mat<3, 2, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), + Func(x[1][0]), Func(x[1][1]), + Func(x[2][0]), Func(x[2][1]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<3, 3, T, Q> call(Ret (*Func)(T x), mat<3, 3, T, Q> const &x) { + return mat<3, 3, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), + Func(x[2][0]), Func(x[2][1]), Func(x[2][2]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<3, 4, T, Q> call(Ret (*Func)(T x), mat<3, 4, T, Q> const &x) { + return mat<3, 4, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), Func(x[0][3]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), Func(x[1][3]), + Func(x[2][0]), Func(x[2][1]), Func(x[2][2]), Func(x[2][3]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<4, 2, T, Q> call(Ret (*Func)(T x), mat<4, 2, T, Q> const &x) { + return mat<4, 2, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), + Func(x[1][0]), Func(x[1][1]), + Func(x[2][0]), Func(x[2][1]), + Func(x[3][0]), Func(x[3][1]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<4, 3, T, Q> call(Ret (*Func)(T x), mat<4, 3, T, Q> const &x) { + return mat<4, 3, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), + Func(x[2][0]), Func(x[2][1]), Func(x[2][2]), + Func(x[3][0]), Func(x[3][1]), Func(x[3][2]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<4, 4, T, Q> call(Ret (*Func)(T x), mat<4, 4, T, Q> const &x) { + return mat<4, 4, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), Func(x[0][3]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), Func(x[1][3]), + Func(x[2][0]), Func(x[2][1]), Func(x[2][2]), Func(x[2][3]), + Func(x[3][0]), Func(x[3][1]), Func(x[3][2]), Func(x[3][3]) + ); + } + + }; + + } + +}// namespace glm diff --git a/vendor/glm/ext/matrix_clip_space.hpp b/vendor/glm/ext/matrix_clip_space.hpp new file mode 100644 index 0000000000..89f7968132 --- /dev/null +++ b/vendor/glm/ext/matrix_clip_space.hpp @@ -0,0 +1,576 @@ +/// @ref ext_matrix_clip_space +/// @file glm/ext/matrix_clip_space.hpp +/// +/// @defgroup ext_matrix_clip_space GLM_EXT_matrix_clip_space +/// @ingroup ext +/// +/// Defines functions that generate clip space transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_transform +/// @see ext_matrix_projection + +#pragma once + +// Dependencies +#include "../ext/scalar_constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_clip_space extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_clip_space + /// @{ + + /// Creates a matrix for projecting two-dimensional coordinates onto the screen. + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top, T const& zNear, T const& zFar) + /// @see gluOrtho2D man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( + T left, T right, T bottom, T top); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_ZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_NO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_ZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_NO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoNO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + /// @see glOrtho man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a left-handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_ZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a left-handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_NO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right-handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_ZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right-handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_NO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumNO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a left-handed frustum matrix. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right-handed frustum matrix. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix with default handedness, using the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @tparam T A floating-point scalar type + /// @see glFrustum man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum( + T left, T right, T bottom, T top, T near, T far); + + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_ZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_NO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_ZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_NO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symmetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symmetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveNO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symmetric perspective-view frustum based on the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param fovy Specifies the field of view angle in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + /// @see gluPerspective man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective( + T fovy, T aspect, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_ZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_NO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_ZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_NO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovNO( + T fov, T width, T height, T near, T far); + + /// Builds a right-handed perspective projection matrix based on a field of view. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH( + T fov, T width, T height, T near, T far); + + /// Builds a left-handed perspective projection matrix based on a field of view. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view and the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov( + T fov, T width, T height, T near, T far); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum with far plane at infinite. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH_ZO( + T fovy, T aspect, T near); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum with far plane at infinite. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH_NO( + T fovy, T aspect, T near); + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum with far plane at infinite. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH_ZO( + T fovy, T aspect, T near); + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum with far plane at infinite. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH_NO( + T fovy, T aspect, T near); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum with far plane at infinite. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH( + T fovy, T aspect, T near); + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum with far plane at infinite. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param ep Epsilon + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( + T fovy, T aspect, T near, T ep); + + /// @} +}//namespace glm + +#include "matrix_clip_space.inl" diff --git a/vendor/glm/ext/matrix_clip_space.inl b/vendor/glm/ext/matrix_clip_space.inl new file mode 100644 index 0000000000..ee13a22b2a --- /dev/null +++ b/vendor/glm/ext/matrix_clip_space.inl @@ -0,0 +1,615 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top) + { + mat<4, 4, T, defaultp> Result(static_cast(1)); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(1); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = static_cast(1) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - zNear / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_NO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = static_cast(2) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(1) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - zNear / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_NO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(2) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoZO(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoNO(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# endif + + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = -(right + left) / (right - left); + Result[2][1] = -(top + bottom) / (top - bottom); + Result[2][2] = farVal / (farVal - nearVal); + Result[2][3] = static_cast(1); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = -(right + left) / (right - left); + Result[2][1] = -(top + bottom) / (top - bottom); + Result[2][2] = (farVal + nearVal) / (farVal - nearVal); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = farVal / (nearVal - farVal); + Result[2][3] = static_cast(-1); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = - (farVal + nearVal) / (farVal - nearVal); + Result[2][3] = static_cast(-1); + Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumNO(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_ZO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = zFar / (zNear - zFar); + Result[2][3] = - static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_NO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[2][3] = - static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_ZO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = zFar / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_NO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveZO(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveNO(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# endif + + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_ZO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = zFar / (zNear - zFar); + Result[2][3] = - static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_NO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[2][3] = - static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_ZO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = zFar / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_NO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovZO(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovNO(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH_NO(T fovy, T aspect, T zNear) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = - static_cast(1); + Result[2][3] = - static_cast(1); + Result[3][2] = - static_cast(2) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH_ZO(T fovy, T aspect, T zNear) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = - static_cast(1); + Result[2][3] = - static_cast(1); + Result[3][2] = - zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH_NO(T fovy, T aspect, T zNear) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(T(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = static_cast(1); + Result[2][3] = static_cast(1); + Result[3][2] = - static_cast(2) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH_ZO(T fovy, T aspect, T zNear) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(T(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = static_cast(1); + Result[2][3] = static_cast(1); + Result[3][2] = - zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return infinitePerspectiveRH_ZO(fovy, aspect, zNear); +# else + return infinitePerspectiveRH_NO(fovy, aspect, zNear); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return infinitePerspectiveLH_ZO(fovy, aspect, zNear); +# else + return infinitePerspectiveLH_NO(fovy, aspect, zNear); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return infinitePerspectiveLH_ZO(fovy, aspect, zNear); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return infinitePerspectiveLH_NO(fovy, aspect, zNear); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return infinitePerspectiveRH_ZO(fovy, aspect, zNear); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return infinitePerspectiveRH_NO(fovy, aspect, zNear); +# endif + } + + // Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = ep - static_cast(1); + Result[2][3] = static_cast(-1); + Result[3][2] = (ep - static_cast(2)) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear) + { + return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon()); + } +}//namespace glm diff --git a/vendor/glm/ext/matrix_common.hpp b/vendor/glm/ext/matrix_common.hpp new file mode 100644 index 0000000000..6bb3d06e7e --- /dev/null +++ b/vendor/glm/ext/matrix_common.hpp @@ -0,0 +1,39 @@ +/// @ref ext_matrix_common +/// @file glm/ext/matrix_common.hpp +/// +/// @defgroup ext_matrix_common GLM_EXT_matrix_common +/// @ingroup ext +/// +/// Defines functions for common matrix operations. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_common + +#pragma once + +#include "../detail/qualifier.hpp" +#include "../detail/_fixes.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_common + /// @{ + + template + GLM_FUNC_DECL mat mix(mat const& x, mat const& y, mat const& a); + + template + GLM_FUNC_DECL mat mix(mat const& x, mat const& y, U a); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat abs(mat const& x); + + /// @} +}//namespace glm + +#include "matrix_common.inl" diff --git a/vendor/glm/ext/matrix_common.inl b/vendor/glm/ext/matrix_common.inl new file mode 100644 index 0000000000..1be422202e --- /dev/null +++ b/vendor/glm/ext/matrix_common.inl @@ -0,0 +1,34 @@ +#include "../matrix.hpp" + +#include "_matrix_vectorize.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, U a) + { + return mat(x) * (static_cast(1) - a) + mat(y) * a; + } + + template + GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, mat const& a) + { + return matrixCompMult(mat(x), static_cast(1) - a) + matrixCompMult(mat(y), a); + } + + template + struct compute_abs_matrix + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat call(mat const& x) + { + return detail::matrix_functor_1::call(abs, x); + } + }; + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat abs(mat const& x) + { + return compute_abs_matrix::value>::call(x); + } + +}//namespace glm diff --git a/vendor/glm/ext/matrix_double2x2.hpp b/vendor/glm/ext/matrix_double2x2.hpp new file mode 100644 index 0000000000..94dca54b59 --- /dev/null +++ b/vendor/glm/ext/matrix_double2x2.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double2x2.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, double, defaultp> dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, double, defaultp> dmat2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double2x2_precision.hpp b/vendor/glm/ext/matrix_double2x2_precision.hpp new file mode 100644 index 0000000000..9e2c174e43 --- /dev/null +++ b/vendor/glm/ext/matrix_double2x2_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, lowp> lowp_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, mediump> mediump_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, highp> highp_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, lowp> lowp_dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, mediump> mediump_dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, highp> highp_dmat2x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double2x3.hpp b/vendor/glm/ext/matrix_double2x3.hpp new file mode 100644 index 0000000000..bfef87a666 --- /dev/null +++ b/vendor/glm/ext/matrix_double2x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double2x3.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 3, double, defaultp> dmat2x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double2x3_precision.hpp b/vendor/glm/ext/matrix_double2x3_precision.hpp new file mode 100644 index 0000000000..098fb6046e --- /dev/null +++ b/vendor/glm/ext/matrix_double2x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double2x3_precision.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, lowp> lowp_dmat2x3; + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, mediump> mediump_dmat2x3; + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, highp> highp_dmat2x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double2x4.hpp b/vendor/glm/ext/matrix_double2x4.hpp new file mode 100644 index 0000000000..499284bce1 --- /dev/null +++ b/vendor/glm/ext/matrix_double2x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double2x4.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 4, double, defaultp> dmat2x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double2x4_precision.hpp b/vendor/glm/ext/matrix_double2x4_precision.hpp new file mode 100644 index 0000000000..9b61ebcee1 --- /dev/null +++ b/vendor/glm/ext/matrix_double2x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double2x4_precision.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, lowp> lowp_dmat2x4; + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, mediump> mediump_dmat2x4; + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, highp> highp_dmat2x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double3x2.hpp b/vendor/glm/ext/matrix_double3x2.hpp new file mode 100644 index 0000000000..dd23f36cdb --- /dev/null +++ b/vendor/glm/ext/matrix_double3x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double3x2.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 2, double, defaultp> dmat3x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double3x2_precision.hpp b/vendor/glm/ext/matrix_double3x2_precision.hpp new file mode 100644 index 0000000000..068d9e9117 --- /dev/null +++ b/vendor/glm/ext/matrix_double3x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double3x2_precision.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, lowp> lowp_dmat3x2; + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, mediump> mediump_dmat3x2; + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, highp> highp_dmat3x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double3x3.hpp b/vendor/glm/ext/matrix_double3x3.hpp new file mode 100644 index 0000000000..53572b7356 --- /dev/null +++ b/vendor/glm/ext/matrix_double3x3.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double3x3.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, double, defaultp> dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, double, defaultp> dmat3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double3x3_precision.hpp b/vendor/glm/ext/matrix_double3x3_precision.hpp new file mode 100644 index 0000000000..8691e7808d --- /dev/null +++ b/vendor/glm/ext/matrix_double3x3_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double3x3_precision.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, lowp> lowp_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, mediump> mediump_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, highp> highp_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, lowp> lowp_dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, mediump> mediump_dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, highp> highp_dmat3x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double3x4.hpp b/vendor/glm/ext/matrix_double3x4.hpp new file mode 100644 index 0000000000..c572d637cd --- /dev/null +++ b/vendor/glm/ext/matrix_double3x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double3x4.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 4, double, defaultp> dmat3x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double3x4_precision.hpp b/vendor/glm/ext/matrix_double3x4_precision.hpp new file mode 100644 index 0000000000..f040217e74 --- /dev/null +++ b/vendor/glm/ext/matrix_double3x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double3x4_precision.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, lowp> lowp_dmat3x4; + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, mediump> mediump_dmat3x4; + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, highp> highp_dmat3x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double4x2.hpp b/vendor/glm/ext/matrix_double4x2.hpp new file mode 100644 index 0000000000..9b229f471e --- /dev/null +++ b/vendor/glm/ext/matrix_double4x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double4x2.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 2, double, defaultp> dmat4x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double4x2_precision.hpp b/vendor/glm/ext/matrix_double4x2_precision.hpp new file mode 100644 index 0000000000..6ad18ba9e6 --- /dev/null +++ b/vendor/glm/ext/matrix_double4x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double4x2_precision.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, lowp> lowp_dmat4x2; + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, mediump> mediump_dmat4x2; + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, highp> highp_dmat4x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double4x3.hpp b/vendor/glm/ext/matrix_double4x3.hpp new file mode 100644 index 0000000000..dca4cf956f --- /dev/null +++ b/vendor/glm/ext/matrix_double4x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double4x3.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 3, double, defaultp> dmat4x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double4x3_precision.hpp b/vendor/glm/ext/matrix_double4x3_precision.hpp new file mode 100644 index 0000000000..f7371de849 --- /dev/null +++ b/vendor/glm/ext/matrix_double4x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double4x3_precision.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, lowp> lowp_dmat4x3; + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, mediump> mediump_dmat4x3; + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, highp> highp_dmat4x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double4x4.hpp b/vendor/glm/ext/matrix_double4x4.hpp new file mode 100644 index 0000000000..81e1bf65cb --- /dev/null +++ b/vendor/glm/ext/matrix_double4x4.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double4x4.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, double, defaultp> dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, double, defaultp> dmat4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_double4x4_precision.hpp b/vendor/glm/ext/matrix_double4x4_precision.hpp new file mode 100644 index 0000000000..4c36a8486c --- /dev/null +++ b/vendor/glm/ext/matrix_double4x4_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double4x4_precision.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, lowp> lowp_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, mediump> mediump_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, highp> highp_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, lowp> lowp_dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, mediump> mediump_dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, highp> highp_dmat4x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float2x2.hpp b/vendor/glm/ext/matrix_float2x2.hpp new file mode 100644 index 0000000000..53df921fe2 --- /dev/null +++ b/vendor/glm/ext/matrix_float2x2.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, float, defaultp> mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, float, defaultp> mat2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float2x2_precision.hpp b/vendor/glm/ext/matrix_float2x2_precision.hpp new file mode 100644 index 0000000000..898b6db714 --- /dev/null +++ b/vendor/glm/ext/matrix_float2x2_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, lowp> lowp_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, mediump> mediump_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, highp> highp_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, lowp> lowp_mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, mediump> mediump_mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, highp> highp_mat2x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float2x3.hpp b/vendor/glm/ext/matrix_float2x3.hpp new file mode 100644 index 0000000000..6f68822dbf --- /dev/null +++ b/vendor/glm/ext/matrix_float2x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float2x3.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 3, float, defaultp> mat2x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float2x3_precision.hpp b/vendor/glm/ext/matrix_float2x3_precision.hpp new file mode 100644 index 0000000000..50c103245c --- /dev/null +++ b/vendor/glm/ext/matrix_float2x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x3_precision.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, lowp> lowp_mat2x3; + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, mediump> mediump_mat2x3; + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, highp> highp_mat2x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float2x4.hpp b/vendor/glm/ext/matrix_float2x4.hpp new file mode 100644 index 0000000000..30f30de3cb --- /dev/null +++ b/vendor/glm/ext/matrix_float2x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float2x4.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 4, float, defaultp> mat2x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float2x4_precision.hpp b/vendor/glm/ext/matrix_float2x4_precision.hpp new file mode 100644 index 0000000000..079d638286 --- /dev/null +++ b/vendor/glm/ext/matrix_float2x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x4_precision.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, lowp> lowp_mat2x4; + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, mediump> mediump_mat2x4; + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, highp> highp_mat2x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float3x2.hpp b/vendor/glm/ext/matrix_float3x2.hpp new file mode 100644 index 0000000000..280d0a3e97 --- /dev/null +++ b/vendor/glm/ext/matrix_float3x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float3x2.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 2, float, defaultp> mat3x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float3x2_precision.hpp b/vendor/glm/ext/matrix_float3x2_precision.hpp new file mode 100644 index 0000000000..8572c2a1b2 --- /dev/null +++ b/vendor/glm/ext/matrix_float3x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float3x2_precision.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, lowp> lowp_mat3x2; + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, mediump> mediump_mat3x2; + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, highp> highp_mat3x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float3x3.hpp b/vendor/glm/ext/matrix_float3x3.hpp new file mode 100644 index 0000000000..177d809ff9 --- /dev/null +++ b/vendor/glm/ext/matrix_float3x3.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float3x3.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, float, defaultp> mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, float, defaultp> mat3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float3x3_precision.hpp b/vendor/glm/ext/matrix_float3x3_precision.hpp new file mode 100644 index 0000000000..8a900c1642 --- /dev/null +++ b/vendor/glm/ext/matrix_float3x3_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float3x3_precision.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, lowp> lowp_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, mediump> mediump_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, highp> highp_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, lowp> lowp_mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, mediump> mediump_mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, highp> highp_mat3x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float3x4.hpp b/vendor/glm/ext/matrix_float3x4.hpp new file mode 100644 index 0000000000..64b8459dcd --- /dev/null +++ b/vendor/glm/ext/matrix_float3x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float3x4.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 4, float, defaultp> mat3x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float3x4_precision.hpp b/vendor/glm/ext/matrix_float3x4_precision.hpp new file mode 100644 index 0000000000..bc36bf13a1 --- /dev/null +++ b/vendor/glm/ext/matrix_float3x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float3x4_precision.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, lowp> lowp_mat3x4; + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, mediump> mediump_mat3x4; + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, highp> highp_mat3x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float4x2.hpp b/vendor/glm/ext/matrix_float4x2.hpp new file mode 100644 index 0000000000..1ed5227bf5 --- /dev/null +++ b/vendor/glm/ext/matrix_float4x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float4x2.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 2, float, defaultp> mat4x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float4x2_precision.hpp b/vendor/glm/ext/matrix_float4x2_precision.hpp new file mode 100644 index 0000000000..88fd069630 --- /dev/null +++ b/vendor/glm/ext/matrix_float4x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, lowp> lowp_mat4x2; + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, mediump> mediump_mat4x2; + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, highp> highp_mat4x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float4x3.hpp b/vendor/glm/ext/matrix_float4x3.hpp new file mode 100644 index 0000000000..5dbe765704 --- /dev/null +++ b/vendor/glm/ext/matrix_float4x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float4x3.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 3, float, defaultp> mat4x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float4x3_precision.hpp b/vendor/glm/ext/matrix_float4x3_precision.hpp new file mode 100644 index 0000000000..846ed4fc8d --- /dev/null +++ b/vendor/glm/ext/matrix_float4x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float4x3_precision.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, lowp> lowp_mat4x3; + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, mediump> mediump_mat4x3; + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, highp> highp_mat4x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float4x4.hpp b/vendor/glm/ext/matrix_float4x4.hpp new file mode 100644 index 0000000000..5ba111de04 --- /dev/null +++ b/vendor/glm/ext/matrix_float4x4.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float4x4.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @ingroup core_matrix + /// @{ + + /// 4 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, float, defaultp> mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, float, defaultp> mat4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_float4x4_precision.hpp b/vendor/glm/ext/matrix_float4x4_precision.hpp new file mode 100644 index 0000000000..597149bcf9 --- /dev/null +++ b/vendor/glm/ext/matrix_float4x4_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float4x4_precision.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, lowp> lowp_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, mediump> mediump_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, highp> highp_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, lowp> lowp_mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, mediump> mediump_mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, highp> highp_mat4x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int2x2.hpp b/vendor/glm/ext/matrix_int2x2.hpp new file mode 100644 index 0000000000..c6aa0686ae --- /dev/null +++ b/vendor/glm/ext/matrix_int2x2.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int2x2 +/// @file glm/ext/matrix_int2x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x2 GLM_EXT_matrix_int2x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x2 + /// @{ + + /// Signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2 + typedef mat<2, 2, int, defaultp> imat2x2; + + /// Signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2 + typedef mat<2, 2, int, defaultp> imat2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int2x2_sized.hpp b/vendor/glm/ext/matrix_int2x2_sized.hpp new file mode 100644 index 0000000000..70c0c2106a --- /dev/null +++ b/vendor/glm/ext/matrix_int2x2_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int2x2_sized +/// @file glm/ext/matrix_int2x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x2_sized GLM_EXT_matrix_int2x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x2_sized + /// @{ + + /// 8 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int8, defaultp> i8mat2x2; + + /// 16 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int16, defaultp> i16mat2x2; + + /// 32 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int32, defaultp> i32mat2x2; + + /// 64 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int64, defaultp> i64mat2x2; + + + /// 8 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int8, defaultp> i8mat2; + + /// 16 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int16, defaultp> i16mat2; + + /// 32 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int32, defaultp> i32mat2; + + /// 64 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int64, defaultp> i64mat2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int2x3.hpp b/vendor/glm/ext/matrix_int2x3.hpp new file mode 100644 index 0000000000..aee415caa6 --- /dev/null +++ b/vendor/glm/ext/matrix_int2x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int2x3 +/// @file glm/ext/matrix_int2x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x3 GLM_EXT_matrix_int2x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x3 + /// @{ + + /// Signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3 + typedef mat<2, 3, int, defaultp> imat2x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int2x3_sized.hpp b/vendor/glm/ext/matrix_int2x3_sized.hpp new file mode 100644 index 0000000000..b5526fe551 --- /dev/null +++ b/vendor/glm/ext/matrix_int2x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int2x3_sized +/// @file glm/ext/matrix_int2x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x3_sized GLM_EXT_matrix_int2x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x3_sized + /// @{ + + /// 8 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int8, defaultp> i8mat2x3; + + /// 16 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int16, defaultp> i16mat2x3; + + /// 32 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int32, defaultp> i32mat2x3; + + /// 64 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int64, defaultp> i64mat2x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int2x4.hpp b/vendor/glm/ext/matrix_int2x4.hpp new file mode 100644 index 0000000000..4f36331d66 --- /dev/null +++ b/vendor/glm/ext/matrix_int2x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int2x4 +/// @file glm/ext/matrix_int2x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x4 GLM_EXT_matrix_int2x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x4 + /// @{ + + /// Signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4 + typedef mat<2, 4, int, defaultp> imat2x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int2x4_sized.hpp b/vendor/glm/ext/matrix_int2x4_sized.hpp new file mode 100644 index 0000000000..a66a5e7268 --- /dev/null +++ b/vendor/glm/ext/matrix_int2x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int2x4_sized +/// @file glm/ext/matrix_int2x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x4_sized GLM_EXT_matrix_int2x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x4_sized + /// @{ + + /// 8 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int8, defaultp> i8mat2x4; + + /// 16 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int16, defaultp> i16mat2x4; + + /// 32 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int32, defaultp> i32mat2x4; + + /// 64 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int64, defaultp> i64mat2x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int3x2.hpp b/vendor/glm/ext/matrix_int3x2.hpp new file mode 100644 index 0000000000..3bd563b7de --- /dev/null +++ b/vendor/glm/ext/matrix_int3x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int3x2 +/// @file glm/ext/matrix_int3x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x2 GLM_EXT_matrix_int3x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x2 + /// @{ + + /// Signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2 + typedef mat<3, 2, int, defaultp> imat3x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int3x2_sized.hpp b/vendor/glm/ext/matrix_int3x2_sized.hpp new file mode 100644 index 0000000000..7e34c5240f --- /dev/null +++ b/vendor/glm/ext/matrix_int3x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int3x2_sized +/// @file glm/ext/matrix_int3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x2_sized GLM_EXT_matrix_int3x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x2_sized + /// @{ + + /// 8 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int8, defaultp> i8mat3x2; + + /// 16 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int16, defaultp> i16mat3x2; + + /// 32 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int32, defaultp> i32mat3x2; + + /// 64 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int64, defaultp> i64mat3x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int3x3.hpp b/vendor/glm/ext/matrix_int3x3.hpp new file mode 100644 index 0000000000..287488da03 --- /dev/null +++ b/vendor/glm/ext/matrix_int3x3.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int3x3 +/// @file glm/ext/matrix_int3x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x3 GLM_EXT_matrix_int3x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x3 + /// @{ + + /// Signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3 + typedef mat<3, 3, int, defaultp> imat3x3; + + /// Signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3 + typedef mat<3, 3, int, defaultp> imat3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int3x3_sized.hpp b/vendor/glm/ext/matrix_int3x3_sized.hpp new file mode 100644 index 0000000000..577e305aa7 --- /dev/null +++ b/vendor/glm/ext/matrix_int3x3_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int3x3_sized +/// @file glm/ext/matrix_int3x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x3_sized GLM_EXT_matrix_int3x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x3_sized + /// @{ + + /// 8 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int8, defaultp> i8mat3x3; + + /// 16 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int16, defaultp> i16mat3x3; + + /// 32 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int32, defaultp> i32mat3x3; + + /// 64 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int64, defaultp> i64mat3x3; + + + /// 8 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int8, defaultp> i8mat3; + + /// 16 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int16, defaultp> i16mat3; + + /// 32 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int32, defaultp> i32mat3; + + /// 64 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int64, defaultp> i64mat3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int3x4.hpp b/vendor/glm/ext/matrix_int3x4.hpp new file mode 100644 index 0000000000..08e534d9c4 --- /dev/null +++ b/vendor/glm/ext/matrix_int3x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int3x4 +/// @file glm/ext/matrix_int3x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x4 GLM_EXT_matrix_int3x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x4 + /// @{ + + /// Signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4 + typedef mat<3, 4, int, defaultp> imat3x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int3x4_sized.hpp b/vendor/glm/ext/matrix_int3x4_sized.hpp new file mode 100644 index 0000000000..692c48c439 --- /dev/null +++ b/vendor/glm/ext/matrix_int3x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int3x4_sized +/// @file glm/ext/matrix_int3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x4_sized GLM_EXT_matrix_int3x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x4_sized + /// @{ + + /// 8 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int8, defaultp> i8mat3x4; + + /// 16 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int16, defaultp> i16mat3x4; + + /// 32 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int32, defaultp> i32mat3x4; + + /// 64 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int64, defaultp> i64mat3x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int4x2.hpp b/vendor/glm/ext/matrix_int4x2.hpp new file mode 100644 index 0000000000..f756ef2804 --- /dev/null +++ b/vendor/glm/ext/matrix_int4x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int4x2 +/// @file glm/ext/matrix_int4x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x2 GLM_EXT_matrix_int4x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x2 + /// @{ + + /// Signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2 + typedef mat<4, 2, int, defaultp> imat4x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int4x2_sized.hpp b/vendor/glm/ext/matrix_int4x2_sized.hpp new file mode 100644 index 0000000000..63a99d604d --- /dev/null +++ b/vendor/glm/ext/matrix_int4x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int4x2_sized +/// @file glm/ext/matrix_int4x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x2_sized GLM_EXT_matrix_int4x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x2_sized + /// @{ + + /// 8 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int8, defaultp> i8mat4x2; + + /// 16 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int16, defaultp> i16mat4x2; + + /// 32 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int32, defaultp> i32mat4x2; + + /// 64 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int64, defaultp> i64mat4x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int4x3.hpp b/vendor/glm/ext/matrix_int4x3.hpp new file mode 100644 index 0000000000..d5d97a7a37 --- /dev/null +++ b/vendor/glm/ext/matrix_int4x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int4x3 +/// @file glm/ext/matrix_int4x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x3 GLM_EXT_matrix_int4x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x3 + /// @{ + + /// Signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3 + typedef mat<4, 3, int, defaultp> imat4x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int4x3_sized.hpp b/vendor/glm/ext/matrix_int4x3_sized.hpp new file mode 100644 index 0000000000..55078fadc6 --- /dev/null +++ b/vendor/glm/ext/matrix_int4x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int4x3_sized +/// @file glm/ext/matrix_int4x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x3_sized GLM_EXT_matrix_int4x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x3_sized + /// @{ + + /// 8 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int8, defaultp> i8mat4x3; + + /// 16 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int16, defaultp> i16mat4x3; + + /// 32 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int32, defaultp> i32mat4x3; + + /// 64 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int64, defaultp> i64mat4x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int4x4.hpp b/vendor/glm/ext/matrix_int4x4.hpp new file mode 100644 index 0000000000..e17cff17f9 --- /dev/null +++ b/vendor/glm/ext/matrix_int4x4.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int4x4 +/// @file glm/ext/matrix_int4x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x4 GLM_EXT_matrix_int4x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x4 + /// @{ + + /// Signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4 + typedef mat<4, 4, int, defaultp> imat4x4; + + /// Signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4 + typedef mat<4, 4, int, defaultp> imat4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_int4x4_sized.hpp b/vendor/glm/ext/matrix_int4x4_sized.hpp new file mode 100644 index 0000000000..4a11203eb2 --- /dev/null +++ b/vendor/glm/ext/matrix_int4x4_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int4x4_sized +/// @file glm/ext/matrix_int4x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x4_sized GLM_EXT_matrix_int4x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x4_sized + /// @{ + + /// 8 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int8, defaultp> i8mat4x4; + + /// 16 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int16, defaultp> i16mat4x4; + + /// 32 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int32, defaultp> i32mat4x4; + + /// 64 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int64, defaultp> i64mat4x4; + + + /// 8 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int8, defaultp> i8mat4; + + /// 16 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int16, defaultp> i16mat4; + + /// 32 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int32, defaultp> i32mat4; + + /// 64 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int64, defaultp> i64mat4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_integer.hpp b/vendor/glm/ext/matrix_integer.hpp new file mode 100644 index 0000000000..7d7dfc5a5b --- /dev/null +++ b/vendor/glm/ext/matrix_integer.hpp @@ -0,0 +1,91 @@ +/// @ref ext_matrix_integer +/// @file glm/ext/matrix_integer.hpp +/// +/// @defgroup ext_matrix_integer GLM_EXT_matrix_integer +/// @ingroup ext +/// +/// Defines functions that generate common transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_projection +/// @see ext_matrix_clip_space + +#pragma once + +// Dependencies +#include "../gtc/constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_integer + /// @{ + + /// Multiply matrix x by matrix y component-wise, i.e., + /// result[i][j] is the scalar product of x[i][j] and y[i][j]. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL matrixCompMult man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL mat matrixCompMult(mat const& x, mat const& y); + + /// Treats the first parameter c as a column vector + /// and the second parameter r as a row vector + /// and does a linear algebraic matrix multiply c * r. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL outerProduct man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r); + + /// Returns the transposed matrix of x + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL transpose man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL typename mat::transpose_type transpose(mat const& x); + + /// Return the determinant of a squared matrix. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL determinant man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL T determinant(mat const& m); + + /// @} +}//namespace glm + +#include "matrix_integer.inl" diff --git a/vendor/glm/ext/matrix_integer.inl b/vendor/glm/ext/matrix_integer.inl new file mode 100644 index 0000000000..8b377ce2a8 --- /dev/null +++ b/vendor/glm/ext/matrix_integer.inl @@ -0,0 +1,38 @@ +namespace glm{ +namespace detail +{ + template + struct compute_matrixCompMult_type { + GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) + { + return detail::compute_matrixCompMult::value>::call(x, y); + } + }; + + template + struct compute_outerProduct_type { + GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) + { + return detail::compute_outerProduct::call(c, r); + } + }; + + template + struct compute_transpose_type + { + GLM_FUNC_QUALIFIER static mat call(mat const& m) + { + return detail::compute_transpose::value>::call(m); + } + }; + + template + struct compute_determinant_type{ + + GLM_FUNC_QUALIFIER static T call(mat const& m) + { + return detail::compute_determinant::value>::call(m); + } + }; +}//namespace detail +}//namespace glm diff --git a/vendor/glm/ext/matrix_projection.hpp b/vendor/glm/ext/matrix_projection.hpp new file mode 100644 index 0000000000..51fd01bd8e --- /dev/null +++ b/vendor/glm/ext/matrix_projection.hpp @@ -0,0 +1,149 @@ +/// @ref ext_matrix_projection +/// @file glm/ext/matrix_projection.hpp +/// +/// @defgroup ext_matrix_projection GLM_EXT_matrix_projection +/// @ingroup ext +/// +/// Functions that generate common projection transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_transform +/// @see ext_matrix_clip_space + +#pragma once + +// Dependencies +#include "../gtc/constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_projection extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_projection + /// @{ + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> projectZO( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> projectNO( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates using default near and far clip planes definition. + /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> project( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProjectZO( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProjectNO( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using default near and far clip planes definition. + /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProject( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Define a picking region + /// + /// @param center Specify the center of a picking region in window coordinates. + /// @param delta Specify the width and height, respectively, of the picking region in window coordinates. + /// @param viewport Rendering viewport + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluPickMatrix man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> pickMatrix( + vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport); + + /// @} +}//namespace glm + +#include "matrix_projection.inl" diff --git a/vendor/glm/ext/matrix_projection.inl b/vendor/glm/ext/matrix_projection.inl new file mode 100644 index 0000000000..2f2c196aac --- /dev/null +++ b/vendor/glm/ext/matrix_projection.inl @@ -0,0 +1,106 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> projectZO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); + tmp = model * tmp; + tmp = proj * tmp; + + tmp /= tmp.w; + tmp.x = tmp.x * static_cast(0.5) + static_cast(0.5); + tmp.y = tmp.y * static_cast(0.5) + static_cast(0.5); + + tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); + tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); + + return vec<3, T, Q>(tmp); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> projectNO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); + tmp = model * tmp; + tmp = proj * tmp; + + tmp /= tmp.w; + tmp = tmp * static_cast(0.5) + static_cast(0.5); + tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); + tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); + + return vec<3, T, Q>(tmp); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> project(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return projectZO(obj, model, proj, viewport); +# else + return projectNO(obj, model, proj, viewport); +# endif + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectZO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + mat<4, 4, T, Q> Inverse = inverse(proj * model); + + vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); + tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); + tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); + tmp.x = tmp.x * static_cast(2) - static_cast(1); + tmp.y = tmp.y * static_cast(2) - static_cast(1); + + vec<4, T, Q> obj = Inverse * tmp; + obj /= obj.w; + + return vec<3, T, Q>(obj); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectNO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + mat<4, 4, T, Q> Inverse = inverse(proj * model); + + vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); + tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); + tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); + tmp = tmp * static_cast(2) - static_cast(1); + + vec<4, T, Q> obj = Inverse * tmp; + obj /= obj.w; + + return vec<3, T, Q>(obj); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProject(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return unProjectZO(win, model, proj, viewport); +# else + return unProjectNO(win, model, proj, viewport); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> pickMatrix(vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport) + { + assert(delta.x > static_cast(0) && delta.y > static_cast(0)); + mat<4, 4, T, Q> Result(static_cast(1)); + + if(!(delta.x > static_cast(0) && delta.y > static_cast(0))) + return Result; // Error + + vec<3, T, Q> Temp( + (static_cast(viewport[2]) - static_cast(2) * (center.x - static_cast(viewport[0]))) / delta.x, + (static_cast(viewport[3]) - static_cast(2) * (center.y - static_cast(viewport[1]))) / delta.y, + static_cast(0)); + + // Translate and scale the picked region to the entire window + Result = translate(Result, Temp); + return scale(Result, vec<3, T, Q>(static_cast(viewport[2]) / delta.x, static_cast(viewport[3]) / delta.y, static_cast(1))); + } +}//namespace glm diff --git a/vendor/glm/ext/matrix_relational.hpp b/vendor/glm/ext/matrix_relational.hpp new file mode 100644 index 0000000000..20023ad89a --- /dev/null +++ b/vendor/glm/ext/matrix_relational.hpp @@ -0,0 +1,132 @@ +/// @ref ext_matrix_relational +/// @file glm/ext/matrix_relational.hpp +/// +/// @defgroup ext_matrix_relational GLM_EXT_matrix_relational +/// @ingroup ext +/// +/// Exposes comparison functions for matrix types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_relational +/// @see ext_scalar_relational +/// @see ext_quaternion_relational + +#pragma once + +// Dependencies +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_relational + /// @{ + + /// Perform a component-wise equal-to comparison of two matrices. + /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y); + + /// Perform a component-wise not-equal-to comparison of two matrices. + /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, vec const& epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, vec const& epsilon); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, vec const& ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, vec const& ULPs); + + /// @} +}//namespace glm + +#include "matrix_relational.inl" diff --git a/vendor/glm/ext/matrix_relational.inl b/vendor/glm/ext/matrix_relational.inl new file mode 100644 index 0000000000..9cd42b772b --- /dev/null +++ b/vendor/glm/ext/matrix_relational.inl @@ -0,0 +1,88 @@ +/// @ref ext_vector_relational +/// @file glm/ext/vector_relational.inl + +// Dependency: +#include "../ext/vector_relational.hpp" +#include "../common.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, T Epsilon) + { + return equal(a, b, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, vec const& Epsilon) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i], Epsilon[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = any(notEqual(a[i], b[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, T Epsilon) + { + return notEqual(a, b, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, vec const& Epsilon) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = any(notEqual(a[i], b[i], Epsilon[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, int MaxULPs) + { + return equal(a, b, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, vec const& MaxULPs) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i], MaxULPs[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, int MaxULPs) + { + return notEqual(a, b, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, vec const& MaxULPs) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = any(notEqual(a[i], b[i], MaxULPs[i])); + return Result; + } + +}//namespace glm diff --git a/vendor/glm/ext/matrix_transform.hpp b/vendor/glm/ext/matrix_transform.hpp new file mode 100644 index 0000000000..52695b8bf4 --- /dev/null +++ b/vendor/glm/ext/matrix_transform.hpp @@ -0,0 +1,171 @@ +/// @ref ext_matrix_transform +/// @file glm/ext/matrix_transform.hpp +/// +/// @defgroup ext_matrix_transform GLM_EXT_matrix_transform +/// @ingroup ext +/// +/// Defines functions that generate common transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_projection +/// @see ext_matrix_clip_space + +#pragma once + +// Dependencies +#include "../gtc/constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_transform extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_transform + /// @{ + + /// Builds an identity matrix. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType identity(); + + /// Builds a translation 4 * 4 matrix created from a vector of 3 components. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param v Coordinates of a translation vector. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @code + /// #include + /// #include + /// ... + /// glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); + /// // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f + /// // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f + /// // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f + /// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f + /// @endcode + /// + /// @see - translate(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - translate(vec<3, T, Q> const& v) + /// @see glTranslate man page + template + GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> translate( + mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); + + /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle. + /// + /// @param m Input matrix multiplied by this rotation matrix. + /// @param angle Rotation angle expressed in radians. + /// @param axis Rotation axis, recommended to be normalized. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) + /// @see - rotate(T angle, vec<3, T, Q> const& v) + /// @see glRotate man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotate( + mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& axis); + + /// Builds a scale 4 * 4 matrix created from 3 scalars. + /// + /// @param m Input matrix multiplied by this scale matrix. + /// @param v Ratio of scaling for each axis. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - scale(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - scale(vec<3, T, Q> const& v) + /// @see glScale man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> scale( + mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); + + /// Builds a scale 4 * 4 matrix created from point referent 3 shearers. + /// + /// @param m Input matrix multiplied by this shear matrix. + /// @param p Point of shearing as reference. + /// @param l_x Ratio of matrix.x projection in YZ plane relative to the y-axis/z-axis. + /// @param l_y Ratio of matrix.y projection in XZ plane relative to the x-axis/z-axis. + /// @param l_z Ratio of matrix.z projection in XY plane relative to the x-axis/y-axis. + /// + /// as example: + /// [1 , l_xy, l_xz, -(l_xy+l_xz) * p_x] [x] T + /// [x`, y`, z`, w`] = [x`, y`, z`, w`] * [l_yx, 1 , l_yz, -(l_yx+l_yz) * p_y] [y] + /// [l_zx, l_zy, 1 , -(l_zx+l_zy) * p_z] [z] + /// [0 , 0 , 0 , 1 ] [w] + /// + /// @tparam T A floating-point shear type + /// @tparam Q A value from qualifier enum + /// + /// @see - shear(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - shear(vec<3, T, Q> const& p) + /// @see - shear(vec<2, T, Q> const& l_x) + /// @see - shear(vec<2, T, Q> const& l_y) + /// @see - shear(vec<2, T, Q> const& l_z) + /// @see no resource... + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear( + mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z); + + /// Build a right handed look at view matrix. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAtRH( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// Build a left handed look at view matrix. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAtLH( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// Build a look at view matrix based on the default handedness. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + /// @see gluLookAt man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAt( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// @} +}//namespace glm + +#include "matrix_transform.inl" diff --git a/vendor/glm/ext/matrix_transform.inl b/vendor/glm/ext/matrix_transform.inl new file mode 100644 index 0000000000..029ef0fb5d --- /dev/null +++ b/vendor/glm/ext/matrix_transform.inl @@ -0,0 +1,207 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType identity() + { + return detail::init_gentype::GENTYPE>::identity(); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> translate(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result(m); + Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + + vec<3, T, Q> axis(normalize(v)); + vec<3, T, Q> temp((T(1) - c) * axis); + + mat<4, 4, T, Q> Rotate; + Rotate[0][0] = c + temp[0] * axis[0]; + Rotate[0][1] = temp[0] * axis[1] + s * axis[2]; + Rotate[0][2] = temp[0] * axis[2] - s * axis[1]; + + Rotate[1][0] = temp[1] * axis[0] - s * axis[2]; + Rotate[1][1] = c + temp[1] * axis[1]; + Rotate[1][2] = temp[1] * axis[2] + s * axis[0]; + + Rotate[2][0] = temp[2] * axis[0] + s * axis[1]; + Rotate[2][1] = temp[2] * axis[1] - s * axis[0]; + Rotate[2][2] = c + temp[2] * axis[2]; + + mat<4, 4, T, Q> Result; + Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + Result[3] = m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate_slow(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + mat<4, 4, T, Q> Result; + + vec<3, T, Q> axis = normalize(v); + + Result[0][0] = c + (static_cast(1) - c) * axis.x * axis.x; + Result[0][1] = (static_cast(1) - c) * axis.x * axis.y + s * axis.z; + Result[0][2] = (static_cast(1) - c) * axis.x * axis.z - s * axis.y; + Result[0][3] = static_cast(0); + + Result[1][0] = (static_cast(1) - c) * axis.y * axis.x - s * axis.z; + Result[1][1] = c + (static_cast(1) - c) * axis.y * axis.y; + Result[1][2] = (static_cast(1) - c) * axis.y * axis.z + s * axis.x; + Result[1][3] = static_cast(0); + + Result[2][0] = (static_cast(1) - c) * axis.z * axis.x + s * axis.y; + Result[2][1] = (static_cast(1) - c) * axis.z * axis.y - s * axis.x; + Result[2][2] = c + (static_cast(1) - c) * axis.z * axis.z; + Result[2][3] = static_cast(0); + + Result[3] = vec<4, T, Q>(0, 0, 0, 1); + return m * Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result; + Result[0] = m[0] * v[0]; + Result[1] = m[1] * v[1]; + Result[2] = m[2] * v[2]; + Result[3] = m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale_slow(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result(T(1)); + Result[0][0] = v.x; + Result[1][1] = v.y; + Result[2][2] = v.z; + return m * Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z) + { + T const lambda_xy = l_x[0]; + T const lambda_xz = l_x[1]; + T const lambda_yx = l_y[0]; + T const lambda_yz = l_y[1]; + T const lambda_zx = l_z[0]; + T const lambda_zy = l_z[1]; + + vec<3, T, Q> point_lambda = vec<3, T, Q>( + (lambda_xy + lambda_xz), (lambda_yx + lambda_yz), (lambda_zx + lambda_zy) + ); + + mat<4, 4, T, Q> Shear = mat<4, 4, T, Q>( + 1 , lambda_yx , lambda_zx , 0, + lambda_xy , 1 , lambda_zy , 0, + lambda_xz , lambda_yz , 1 , 0, + -point_lambda[0] * p[0], -point_lambda[1] * p[1], -point_lambda[2] * p[2], 1 + ); + + mat<4, 4, T, Q> Result; + Result[0] = m[0] * Shear[0][0] + m[1] * Shear[0][1] + m[2] * Shear[0][2] + m[3] * Shear[0][3]; + Result[1] = m[0] * Shear[1][0] + m[1] * Shear[1][1] + m[2] * Shear[1][2] + m[3] * Shear[1][3]; + Result[2] = m[0] * Shear[2][0] + m[1] * Shear[2][1] + m[2] * Shear[2][2] + m[3] * Shear[2][3]; + Result[3] = m[0] * Shear[3][0] + m[1] * Shear[3][1] + m[2] * Shear[3][2] + m[3] * Shear[3][3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear_slow(mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z) + { + T const lambda_xy = static_cast(l_x[0]); + T const lambda_xz = static_cast(l_x[1]); + T const lambda_yx = static_cast(l_y[0]); + T const lambda_yz = static_cast(l_y[1]); + T const lambda_zx = static_cast(l_z[0]); + T const lambda_zy = static_cast(l_z[1]); + + vec<3, T, Q> point_lambda = vec<3, T, Q>( + static_cast(lambda_xy + lambda_xz), + static_cast(lambda_yx + lambda_yz), + static_cast(lambda_zx + lambda_zy) + ); + + mat<4, 4, T, Q> Shear = mat<4, 4, T, Q>( + 1 , lambda_yx , lambda_zx , 0, + lambda_xy , 1 , lambda_zy , 0, + lambda_xz , lambda_yz , 1 , 0, + -point_lambda[0] * p[0], -point_lambda[1] * p[1], -point_lambda[2] * p[2], 1 + ); + return m * Shear; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtRH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { + vec<3, T, Q> const f(normalize(center - eye)); + vec<3, T, Q> const s(normalize(cross(f, up))); + vec<3, T, Q> const u(cross(s, f)); + + mat<4, 4, T, Q> Result(1); + Result[0][0] = s.x; + Result[1][0] = s.y; + Result[2][0] = s.z; + Result[0][1] = u.x; + Result[1][1] = u.y; + Result[2][1] = u.z; + Result[0][2] =-f.x; + Result[1][2] =-f.y; + Result[2][2] =-f.z; + Result[3][0] =-dot(s, eye); + Result[3][1] =-dot(u, eye); + Result[3][2] = dot(f, eye); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtLH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { + vec<3, T, Q> const f(normalize(center - eye)); + vec<3, T, Q> const s(normalize(cross(up, f))); + vec<3, T, Q> const u(cross(f, s)); + + mat<4, 4, T, Q> Result(1); + Result[0][0] = s.x; + Result[1][0] = s.y; + Result[2][0] = s.z; + Result[0][1] = u.x; + Result[1][1] = u.y; + Result[2][1] = u.z; + Result[0][2] = f.x; + Result[1][2] = f.y; + Result[2][2] = f.z; + Result[3][0] = -dot(s, eye); + Result[3][1] = -dot(u, eye); + Result[3][2] = -dot(f, eye); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAt(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { +# if (GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) + return lookAtLH(eye, center, up); +# else + return lookAtRH(eye, center, up); +# endif + } +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint2x2.hpp b/vendor/glm/ext/matrix_uint2x2.hpp new file mode 100644 index 0000000000..034771ae52 --- /dev/null +++ b/vendor/glm/ext/matrix_uint2x2.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint2x2 +/// @file glm/ext/matrix_uint2x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x2 GLM_EXT_matrix_uint2x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x2 + /// @{ + + /// Unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2 + typedef mat<2, 2, uint, defaultp> umat2x2; + + /// Unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2 + typedef mat<2, 2, uint, defaultp> umat2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint2x2_sized.hpp b/vendor/glm/ext/matrix_uint2x2_sized.hpp new file mode 100644 index 0000000000..4555324d2b --- /dev/null +++ b/vendor/glm/ext/matrix_uint2x2_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint2x2_sized +/// @file glm/ext/matrix_uint2x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x2_sized GLM_EXT_matrix_uint2x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x2_sized + /// @{ + + /// 8 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint8, defaultp> u8mat2x2; + + /// 16 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint16, defaultp> u16mat2x2; + + /// 32 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint32, defaultp> u32mat2x2; + + /// 64 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint64, defaultp> u64mat2x2; + + + /// 8 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint8, defaultp> u8mat2; + + /// 16 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint16, defaultp> u16mat2; + + /// 32 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint32, defaultp> u32mat2; + + /// 64 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint64, defaultp> u64mat2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint2x3.hpp b/vendor/glm/ext/matrix_uint2x3.hpp new file mode 100644 index 0000000000..f496c531a0 --- /dev/null +++ b/vendor/glm/ext/matrix_uint2x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint2x3 +/// @file glm/ext/matrix_uint2x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x3 GLM_EXT_matrix_uint2x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x3 + /// @{ + + /// Unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3 + typedef mat<2, 3, uint, defaultp> umat2x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint2x3_sized.hpp b/vendor/glm/ext/matrix_uint2x3_sized.hpp new file mode 100644 index 0000000000..db7939c946 --- /dev/null +++ b/vendor/glm/ext/matrix_uint2x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint2x3_sized +/// @file glm/ext/matrix_uint2x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x3_sized GLM_EXT_matrix_uint2x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x3_sized + /// @{ + + /// 8 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint8, defaultp> u8mat2x3; + + /// 16 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint16, defaultp> u16mat2x3; + + /// 32 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint32, defaultp> u32mat2x3; + + /// 64 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint64, defaultp> u64mat2x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint2x4.hpp b/vendor/glm/ext/matrix_uint2x4.hpp new file mode 100644 index 0000000000..0f993509c2 --- /dev/null +++ b/vendor/glm/ext/matrix_uint2x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint2x4 +/// @file glm/ext/matrix_uint2x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x4 GLM_EXT_matrix_int2x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x4 + /// @{ + + /// Unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4 + typedef mat<2, 4, uint, defaultp> umat2x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint2x4_sized.hpp b/vendor/glm/ext/matrix_uint2x4_sized.hpp new file mode 100644 index 0000000000..5c55547ff7 --- /dev/null +++ b/vendor/glm/ext/matrix_uint2x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint2x4_sized +/// @file glm/ext/matrix_uint2x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x4_sized GLM_EXT_matrix_uint2x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x4_sized + /// @{ + + /// 8 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint8, defaultp> u8mat2x4; + + /// 16 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint16, defaultp> u16mat2x4; + + /// 32 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint32, defaultp> u32mat2x4; + + /// 64 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint64, defaultp> u64mat2x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint3x2.hpp b/vendor/glm/ext/matrix_uint3x2.hpp new file mode 100644 index 0000000000..55a9bed688 --- /dev/null +++ b/vendor/glm/ext/matrix_uint3x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint3x2 +/// @file glm/ext/matrix_uint3x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x2 GLM_EXT_matrix_uint3x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x2 + /// @{ + + /// Unsigned integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2 + typedef mat<3, 2, uint, defaultp> umat3x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint3x2_sized.hpp b/vendor/glm/ext/matrix_uint3x2_sized.hpp new file mode 100644 index 0000000000..c81af8f968 --- /dev/null +++ b/vendor/glm/ext/matrix_uint3x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint3x2_sized +/// @file glm/ext/matrix_uint3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x2_sized GLM_EXT_matrix_uint3x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x2_sized + /// @{ + + /// 8 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint8, defaultp> u8mat3x2; + + /// 16 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint16, defaultp> u16mat3x2; + + /// 32 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint32, defaultp> u32mat3x2; + + /// 64 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint64, defaultp> u64mat3x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint3x3.hpp b/vendor/glm/ext/matrix_uint3x3.hpp new file mode 100644 index 0000000000..1004c0d2d5 --- /dev/null +++ b/vendor/glm/ext/matrix_uint3x3.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint3x3 +/// @file glm/ext/matrix_uint3x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x3 GLM_EXT_matrix_uint3x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x3 + /// @{ + + /// Unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3 + typedef mat<3, 3, uint, defaultp> umat3x3; + + /// Unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3 + typedef mat<3, 3, uint, defaultp> umat3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint3x3_sized.hpp b/vendor/glm/ext/matrix_uint3x3_sized.hpp new file mode 100644 index 0000000000..41a8be7486 --- /dev/null +++ b/vendor/glm/ext/matrix_uint3x3_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint3x3_sized +/// @file glm/ext/matrix_uint3x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x3_sized GLM_EXT_matrix_uint3x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x3_sized + /// @{ + + /// 8 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint8, defaultp> u8mat3x3; + + /// 16 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint16, defaultp> u16mat3x3; + + /// 32 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint32, defaultp> u32mat3x3; + + /// 64 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint64, defaultp> u64mat3x3; + + + /// 8 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint8, defaultp> u8mat3; + + /// 16 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint16, defaultp> u16mat3; + + /// 32 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint32, defaultp> u32mat3; + + /// 64 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint64, defaultp> u64mat3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint3x4.hpp b/vendor/glm/ext/matrix_uint3x4.hpp new file mode 100644 index 0000000000..c6dd78c4a0 --- /dev/null +++ b/vendor/glm/ext/matrix_uint3x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint3x4 +/// @file glm/ext/matrix_uint3x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x4 GLM_EXT_matrix_uint3x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x4 + /// @{ + + /// Signed integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4 + typedef mat<3, 4, uint, defaultp> umat3x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint3x4_sized.hpp b/vendor/glm/ext/matrix_uint3x4_sized.hpp new file mode 100644 index 0000000000..2ce28ad816 --- /dev/null +++ b/vendor/glm/ext/matrix_uint3x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint3x4_sized +/// @file glm/ext/matrix_uint3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x4_sized GLM_EXT_matrix_uint3x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x4_sized + /// @{ + + /// 8 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint8, defaultp> u8mat3x4; + + /// 16 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint16, defaultp> u16mat3x4; + + /// 32 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint32, defaultp> u32mat3x4; + + /// 64 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint64, defaultp> u64mat3x4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint4x2.hpp b/vendor/glm/ext/matrix_uint4x2.hpp new file mode 100644 index 0000000000..0446f5745b --- /dev/null +++ b/vendor/glm/ext/matrix_uint4x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint4x2 +/// @file glm/ext/matrix_uint4x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x2 GLM_EXT_matrix_uint4x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x2 + /// @{ + + /// Unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2 + typedef mat<4, 2, uint, defaultp> umat4x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint4x2_sized.hpp b/vendor/glm/ext/matrix_uint4x2_sized.hpp new file mode 100644 index 0000000000..57a66bf9b8 --- /dev/null +++ b/vendor/glm/ext/matrix_uint4x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint4x2_sized +/// @file glm/ext/matrix_uint4x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x2_sized GLM_EXT_matrix_uint4x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x2_sized + /// @{ + + /// 8 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint8, defaultp> u8mat4x2; + + /// 16 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint16, defaultp> u16mat4x2; + + /// 32 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint32, defaultp> u32mat4x2; + + /// 64 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint64, defaultp> u64mat4x2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint4x3.hpp b/vendor/glm/ext/matrix_uint4x3.hpp new file mode 100644 index 0000000000..54c24e4e50 --- /dev/null +++ b/vendor/glm/ext/matrix_uint4x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint4x3 +/// @file glm/ext/matrix_uint4x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x3 GLM_EXT_matrix_uint4x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x3 + /// @{ + + /// Unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3 + typedef mat<4, 3, uint, defaultp> umat4x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint4x3_sized.hpp b/vendor/glm/ext/matrix_uint4x3_sized.hpp new file mode 100644 index 0000000000..2e61124d63 --- /dev/null +++ b/vendor/glm/ext/matrix_uint4x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint4x3_sized +/// @file glm/ext/matrix_uint4x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x3_sized GLM_EXT_matrix_uint4x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x3_sized + /// @{ + + /// 8 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint8, defaultp> u8mat4x3; + + /// 16 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint16, defaultp> u16mat4x3; + + /// 32 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint32, defaultp> u32mat4x3; + + /// 64 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint64, defaultp> u64mat4x3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint4x4.hpp b/vendor/glm/ext/matrix_uint4x4.hpp new file mode 100644 index 0000000000..5cc84553d9 --- /dev/null +++ b/vendor/glm/ext/matrix_uint4x4.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint4x4 +/// @file glm/ext/matrix_uint4x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x4 GLM_EXT_matrix_uint4x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x4 + /// @{ + + /// Unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4 + typedef mat<4, 4, uint, defaultp> umat4x4; + + /// Unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4 + typedef mat<4, 4, uint, defaultp> umat4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/matrix_uint4x4_sized.hpp b/vendor/glm/ext/matrix_uint4x4_sized.hpp new file mode 100644 index 0000000000..bb10bd2b77 --- /dev/null +++ b/vendor/glm/ext/matrix_uint4x4_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint4x4_sized +/// @file glm/ext/matrix_uint4x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x4_sized GLM_EXT_matrix_uint4x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x4_sized + /// @{ + + /// 8 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint8, defaultp> u8mat4x4; + + /// 16 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint16, defaultp> u16mat4x4; + + /// 32 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint32, defaultp> u32mat4x4; + + /// 64 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint64, defaultp> u64mat4x4; + + + /// 8 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint8, defaultp> u8mat4; + + /// 16 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint16, defaultp> u16mat4; + + /// 32 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint32, defaultp> u32mat4; + + /// 64 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint64, defaultp> u64mat4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/quaternion_common.hpp b/vendor/glm/ext/quaternion_common.hpp new file mode 100644 index 0000000000..f738692a47 --- /dev/null +++ b/vendor/glm/ext/quaternion_common.hpp @@ -0,0 +1,135 @@ +/// @ref ext_quaternion_common +/// @file glm/ext/quaternion_common.hpp +/// +/// @defgroup ext_quaternion_common GLM_EXT_quaternion_common +/// @ingroup ext +/// +/// Provides common functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_common +/// @see ext_vector_common +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_trigonometric +/// @see ext_quaternion_transform + +#pragma once + +// Dependency: +#include "../ext/scalar_constants.hpp" +#include "../ext/quaternion_geometric.hpp" +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_common + /// @{ + + /// Spherical linear interpolation of two quaternions. + /// The interpolation is oriented and the rotation is performed at constant speed. + /// For short path spherical linear interpolation, use the slerp function. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - slerp(qua const& x, qua const& y, T const& a) + template + GLM_FUNC_DECL qua mix(qua const& x, qua const& y, T a); + + /// Linear interpolation of two quaternions. + /// The interpolation is oriented. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR qua lerp(qua const& x, qua const& y, T a); + + /// Spherical linear interpolation of two quaternions. + /// The interpolation always take the short path and the rotation is performed at constant speed. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua slerp(qua const& x, qua const& y, T a); + + /// Spherical linear interpolation of two quaternions with multiple spins over rotation axis. + /// The interpolation always take the short path when the spin count is positive and long path + /// when count is negative. Rotation is performed at constant speed. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// @param k Additional spin count. If Value is negative interpolation will be on "long" path. + /// + /// @tparam T A floating-point scalar type + /// @tparam S An integer scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua slerp(qua const& x, qua const& y, T a, S k); + + /// Returns the q conjugate. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR qua conjugate(qua const& q); + + /// Returns the q inverse. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR qua inverse(qua const& q); + + /// Returns true if x holds a NaN (not a number) + /// representation in the underlying implementation's set of + /// floating point representations. Returns false otherwise, + /// including for implementations with no NaN + /// representations. + /// + /// /!\ When using compiler fast math, this function may fail. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> isnan(qua const& x); + + /// Returns true if x holds a positive infinity or negative + /// infinity representation in the underlying implementation's + /// set of floating point representations. Returns false + /// otherwise, including for implementations with no infinity + /// representations. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> isinf(qua const& x); + + /// @} +} //namespace glm + +#include "quaternion_common.inl" diff --git a/vendor/glm/ext/quaternion_common.inl b/vendor/glm/ext/quaternion_common.inl new file mode 100644 index 0000000000..ad171f9d4b --- /dev/null +++ b/vendor/glm/ext/quaternion_common.inl @@ -0,0 +1,144 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua mix(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mix' only accept floating-point inputs"); + + T const cosTheta = dot(x, y); + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if(cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua::wxyz( + mix(x.w, y.w, a), + mix(x.x, y.x, a), + mix(x.y, y.y, a), + mix(x.z, y.z, a)); + } + else + { + // Essential Mathematics, page 467 + T angle = acos(cosTheta); + return (sin((static_cast(1) - a) * angle) * x + sin(a * angle) * y) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua lerp(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'lerp' only accept floating-point inputs"); + + // Lerp is only defined in [0, 1] + assert(a >= static_cast(0)); + assert(a <= static_cast(1)); + + return x * (static_cast(1) - a) + (y * a); + } + + template + GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs"); + + qua z = y; + + T cosTheta = dot(x, y); + + // If cosTheta < 0, the interpolation will take the long way around the sphere. + // To fix this, one quat must be negated. + if(cosTheta < static_cast(0)) + { + z = -y; + cosTheta = -cosTheta; + } + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if(cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua::wxyz( + mix(x.w, z.w, a), + mix(x.x, z.x, a), + mix(x.y, z.y, a), + mix(x.z, z.z, a)); + } + else + { + // Essential Mathematics, page 467 + T angle = acos(cosTheta); + return (sin((static_cast(1) - a) * angle) * x + sin(a * angle) * z) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a, S k) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'slerp' only accept integer for spin count"); + + qua z = y; + + T cosTheta = dot(x, y); + + // If cosTheta < 0, the interpolation will take the long way around the sphere. + // To fix this, one quat must be negated. + if (cosTheta < static_cast(0)) + { + z = -y; + cosTheta = -cosTheta; + } + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if (cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua::wxyz( + mix(x.w, z.w, a), + mix(x.x, z.x, a), + mix(x.y, z.y, a), + mix(x.z, z.z, a)); + } + else + { + // Graphics Gems III, page 96 + T angle = acos(cosTheta); + T phi = angle + static_cast(k) * glm::pi(); + return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua conjugate(qua const& q) + { + return qua::wxyz(q.w, -q.x, -q.y, -q.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua inverse(qua const& q) + { + return conjugate(q) / dot(q, q); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(qua const& q) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs"); + + return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(qua const& q) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs"); + + return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w)); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "quaternion_common_simd.inl" +#endif + diff --git a/vendor/glm/ext/quaternion_common_simd.inl b/vendor/glm/ext/quaternion_common_simd.inl new file mode 100644 index 0000000000..ddfc8a44f6 --- /dev/null +++ b/vendor/glm/ext/quaternion_common_simd.inl @@ -0,0 +1,18 @@ +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_dot, float, true> + { + static GLM_FUNC_QUALIFIER float call(qua const& x, qua const& y) + { + return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + diff --git a/vendor/glm/ext/quaternion_double.hpp b/vendor/glm/ext/quaternion_double.hpp new file mode 100644 index 0000000000..63b24de4d5 --- /dev/null +++ b/vendor/glm/ext/quaternion_double.hpp @@ -0,0 +1,39 @@ +/// @ref ext_quaternion_double +/// @file glm/ext/quaternion_double.hpp +/// +/// @defgroup ext_quaternion_double GLM_EXT_quaternion_double +/// @ingroup ext +/// +/// Exposes double-precision floating point quaternion type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double_precision +/// @see ext_quaternion_common +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_double extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_double + /// @{ + + /// Quaternion of double-precision floating-point numbers. + typedef qua dquat; + + /// @} +} //namespace glm + diff --git a/vendor/glm/ext/quaternion_double_precision.hpp b/vendor/glm/ext/quaternion_double_precision.hpp new file mode 100644 index 0000000000..8aa24a1775 --- /dev/null +++ b/vendor/glm/ext/quaternion_double_precision.hpp @@ -0,0 +1,42 @@ +/// @ref ext_quaternion_double_precision +/// @file glm/ext/quaternion_double_precision.hpp +/// +/// @defgroup ext_quaternion_double_precision GLM_EXT_quaternion_double_precision +/// @ingroup ext +/// +/// Exposes double-precision floating point quaternion type with various precision in term of ULPs. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_double_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_double_precision + /// @{ + + /// Quaternion of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua lowp_dquat; + + /// Quaternion of medium double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua mediump_dquat; + + /// Quaternion of high double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua highp_dquat; + + /// @} +} //namespace glm + diff --git a/vendor/glm/ext/quaternion_exponential.hpp b/vendor/glm/ext/quaternion_exponential.hpp new file mode 100644 index 0000000000..affe2979aa --- /dev/null +++ b/vendor/glm/ext/quaternion_exponential.hpp @@ -0,0 +1,63 @@ +/// @ref ext_quaternion_exponential +/// @file glm/ext/quaternion_exponential.hpp +/// +/// @defgroup ext_quaternion_exponential GLM_EXT_quaternion_exponential +/// @ingroup ext +/// +/// Provides exponential functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see core_exponential +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../geometric.hpp" +#include "../ext/scalar_constants.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_exponential extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_transform + /// @{ + + /// Returns a exponential of a quaternion. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua exp(qua const& q); + + /// Returns a logarithm of a quaternion + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua log(qua const& q); + + /// Returns a quaternion raised to a power. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua pow(qua const& q, T y); + + /// Returns the square root of a quaternion + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua sqrt(qua const& q); + + /// @} +} //namespace glm + +#include "quaternion_exponential.inl" diff --git a/vendor/glm/ext/quaternion_exponential.inl b/vendor/glm/ext/quaternion_exponential.inl new file mode 100644 index 0000000000..26c4ab14be --- /dev/null +++ b/vendor/glm/ext/quaternion_exponential.inl @@ -0,0 +1,89 @@ +#include "scalar_constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua exp(qua const& q) + { + vec<3, T, Q> u(q.x, q.y, q.z); + T const Angle = glm::length(u); + if (Angle < epsilon()) + return qua(); + + vec<3, T, Q> const v(u / Angle); + return qua(cos(Angle), sin(Angle) * v); + } + + template + GLM_FUNC_QUALIFIER qua log(qua const& q) + { + vec<3, T, Q> u(q.x, q.y, q.z); + T Vec3Len = length(u); + + if (Vec3Len < epsilon()) + { + if(q.w > static_cast(0)) + return qua::wxyz(log(q.w), static_cast(0), static_cast(0), static_cast(0)); + else if(q.w < static_cast(0)) + return qua::wxyz(log(-q.w), pi(), static_cast(0), static_cast(0)); + else + return qua::wxyz(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); + } + else + { + T t = atan(Vec3Len, T(q.w)) / Vec3Len; + T QuatLen2 = Vec3Len * Vec3Len + q.w * q.w; + return qua::wxyz(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); + } + } + + template + GLM_FUNC_QUALIFIER qua pow(qua const& x, T y) + { + //Raising to the power of 0 should yield 1 + //Needed to prevent a division by 0 error later on + if(y > -epsilon() && y < epsilon()) + return qua::wxyz(1,0,0,0); + + //To deal with non-unit quaternions + T magnitude = sqrt(x.x * x.x + x.y * x.y + x.z * x.z + x.w *x.w); + + T Angle; + if(abs(x.w / magnitude) > cos_one_over_two()) + { + //Scalar component is close to 1; using it to recover angle would lose precision + //Instead, we use the non-scalar components since sin() is accurate around 0 + + //Prevent a division by 0 error later on + T VectorMagnitude = x.x * x.x + x.y * x.y + x.z * x.z; + //Despite the compiler might say, we actually want to compare + //VectorMagnitude to 0. here; we could use denorm_int() compiling a + //project with unsafe maths optimizations might make the comparison + //always false, even when VectorMagnitude is 0. + if (VectorMagnitude < (std::numeric_limits::min)()) { + //Equivalent to raising a real number to a power + return qua::wxyz(pow(x.w, y), 0, 0, 0); + } + + Angle = asin(sqrt(VectorMagnitude) / magnitude); + } + else + { + //Scalar component is small, shouldn't cause loss of precision + Angle = acos(x.w / magnitude); + } + + T NewAngle = Angle * y; + T Div = sin(NewAngle) / sin(Angle); + T Mag = pow(magnitude, y - static_cast(1)); + return qua::wxyz(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); + } + + template + GLM_FUNC_QUALIFIER qua sqrt(qua const& x) + { + return pow(x, static_cast(0.5)); + } +}//namespace glm + + diff --git a/vendor/glm/ext/quaternion_float.hpp b/vendor/glm/ext/quaternion_float.hpp new file mode 100644 index 0000000000..ca42a60597 --- /dev/null +++ b/vendor/glm/ext/quaternion_float.hpp @@ -0,0 +1,39 @@ +/// @ref ext_quaternion_float +/// @file glm/ext/quaternion_float.hpp +/// +/// @defgroup ext_quaternion_float GLM_EXT_quaternion_float +/// @ingroup ext +/// +/// Exposes single-precision floating point quaternion type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_double +/// @see ext_quaternion_float_precision +/// @see ext_quaternion_common +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_float extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_float + /// @{ + + /// Quaternion of single-precision floating-point numbers. + typedef qua quat; + + /// @} +} //namespace glm + diff --git a/vendor/glm/ext/quaternion_float_precision.hpp b/vendor/glm/ext/quaternion_float_precision.hpp new file mode 100644 index 0000000000..f9e4f5c21d --- /dev/null +++ b/vendor/glm/ext/quaternion_float_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_quaternion_float_precision +/// @file glm/ext/quaternion_float_precision.hpp +/// +/// @defgroup ext_quaternion_float_precision GLM_EXT_quaternion_float_precision +/// @ingroup ext +/// +/// Exposes single-precision floating point quaternion type with various precision in term of ULPs. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_float_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_float_precision + /// @{ + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua lowp_quat; + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua mediump_quat; + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua highp_quat; + + /// @} +} //namespace glm + diff --git a/vendor/glm/ext/quaternion_geometric.hpp b/vendor/glm/ext/quaternion_geometric.hpp new file mode 100644 index 0000000000..d3e593f350 --- /dev/null +++ b/vendor/glm/ext/quaternion_geometric.hpp @@ -0,0 +1,70 @@ +/// @ref ext_quaternion_geometric +/// @file glm/ext/quaternion_geometric.hpp +/// +/// @defgroup ext_quaternion_geometric GLM_EXT_quaternion_geometric +/// @ingroup ext +/// +/// Provides geometric functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see core_func_geometric +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../geometric.hpp" +#include "../exponential.hpp" +#include "../ext/vector_relational.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_geometric extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_geometric + /// @{ + + /// Returns the norm of a quaternions + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL T length(qua const& q); + + /// Returns the normalized quaternion. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL GLM_CONSTEXPR qua normalize(qua const& q); + + /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... + /// + /// @tparam T Floating-point scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL GLM_CONSTEXPR T dot(qua const& x, qua const& y); + + /// Compute a cross product. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua cross(qua const& q1, qua const& q2); + + /// @} +} //namespace glm + +#include "quaternion_geometric.inl" diff --git a/vendor/glm/ext/quaternion_geometric.inl b/vendor/glm/ext/quaternion_geometric.inl new file mode 100644 index 0000000000..e68eec99b0 --- /dev/null +++ b/vendor/glm/ext/quaternion_geometric.inl @@ -0,0 +1,36 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(qua const& x, qua const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'dot' accepts only floating-point inputs"); + return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER T length(qua const& q) + { + return glm::sqrt(dot(q, q)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua normalize(qua const& q) + { + T len = length(q); + if(len <= static_cast(0)) // Problem + return qua::wxyz(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + T oneOverLen = static_cast(1) / len; + return qua::wxyz(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua cross(qua const& q1, qua const& q2) + { + return qua::wxyz( + q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, + q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, + q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, + q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); + } +}//namespace glm + diff --git a/vendor/glm/ext/quaternion_relational.hpp b/vendor/glm/ext/quaternion_relational.hpp new file mode 100644 index 0000000000..7aa121da0a --- /dev/null +++ b/vendor/glm/ext/quaternion_relational.hpp @@ -0,0 +1,62 @@ +/// @ref ext_quaternion_relational +/// @file glm/ext/quaternion_relational.hpp +/// +/// @defgroup ext_quaternion_relational GLM_EXT_quaternion_relational +/// @ingroup ext +/// +/// Exposes comparison functions for quaternion types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see core_vector_relational +/// @see ext_vector_relational +/// @see ext_matrix_relational +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../vector_relational.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_relational + /// @{ + + /// Returns the component-wise comparison of result x == y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> equal(qua const& x, qua const& y); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon); + + /// Returns the component-wise comparison of result x != y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> notEqual(qua const& x, qua const& y); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon); + + /// @} +} //namespace glm + +#include "quaternion_relational.inl" diff --git a/vendor/glm/ext/quaternion_relational.inl b/vendor/glm/ext/quaternion_relational.inl new file mode 100644 index 0000000000..b1713e95c6 --- /dev/null +++ b/vendor/glm/ext/quaternion_relational.inl @@ -0,0 +1,35 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] == y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return lessThan(abs(v), vec<4, T, Q>(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] != y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); + } +}//namespace glm + diff --git a/vendor/glm/ext/quaternion_transform.hpp b/vendor/glm/ext/quaternion_transform.hpp new file mode 100644 index 0000000000..a9cc5c2b59 --- /dev/null +++ b/vendor/glm/ext/quaternion_transform.hpp @@ -0,0 +1,47 @@ +/// @ref ext_quaternion_transform +/// @file glm/ext/quaternion_transform.hpp +/// +/// @defgroup ext_quaternion_transform GLM_EXT_quaternion_transform +/// @ingroup ext +/// +/// Provides transformation functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_transform extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_transform + /// @{ + + /// Rotates a quaternion from a vector of 3 components axis and an angle. + /// + /// @param q Source orientation + /// @param angle Angle expressed in radians. + /// @param axis Axis of the rotation + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& axis); + /// @} +} //namespace glm + +#include "quaternion_transform.inl" diff --git a/vendor/glm/ext/quaternion_transform.inl b/vendor/glm/ext/quaternion_transform.inl new file mode 100644 index 0000000000..7e773fbd26 --- /dev/null +++ b/vendor/glm/ext/quaternion_transform.inl @@ -0,0 +1,24 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& v) + { + vec<3, T, Q> Tmp = v; + + // Axis of rotation must be normalised + T len = glm::length(Tmp); + if(abs(len - static_cast(1)) > static_cast(0.001)) + { + T oneOverLen = static_cast(1) / len; + Tmp.x *= oneOverLen; + Tmp.y *= oneOverLen; + Tmp.z *= oneOverLen; + } + + T const AngleRad(angle); + T const Sin = sin(AngleRad * static_cast(0.5)); + + return q * qua::wxyz(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + } +}//namespace glm + diff --git a/vendor/glm/ext/quaternion_trigonometric.hpp b/vendor/glm/ext/quaternion_trigonometric.hpp new file mode 100644 index 0000000000..574a704795 --- /dev/null +++ b/vendor/glm/ext/quaternion_trigonometric.hpp @@ -0,0 +1,65 @@ +/// @ref ext_quaternion_trigonometric +/// @file glm/ext/quaternion_trigonometric.hpp +/// +/// @defgroup ext_quaternion_trigonometric GLM_EXT_quaternion_trigonometric +/// @ingroup ext +/// +/// Provides trigonometric functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform + +#pragma once + +// Dependency: +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include "scalar_constants.hpp" +#include "vector_relational.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_trigonometric extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_trigonometric + /// @{ + + /// Returns the quaternion rotation angle. + /// + /// @param x A normalized quaternion. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL T angle(qua const& x); + + /// Returns the q rotation axis. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<3, T, Q> axis(qua const& x); + + /// Build a quaternion from an angle and a normalized axis. + /// + /// @param angle Angle expressed in radians. + /// @param axis Axis of the quaternion, must be normalized. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua angleAxis(T const& angle, vec<3, T, Q> const& axis); + + /// @} +} //namespace glm + +#include "quaternion_trigonometric.inl" diff --git a/vendor/glm/ext/quaternion_trigonometric.inl b/vendor/glm/ext/quaternion_trigonometric.inl new file mode 100644 index 0000000000..896449aa6e --- /dev/null +++ b/vendor/glm/ext/quaternion_trigonometric.inl @@ -0,0 +1,37 @@ +#include "scalar_constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T angle(qua const& x) + { + if (abs(x.w) > cos_one_over_two()) + { + T const a = asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast(2); + if(x.w < static_cast(0)) + return pi() * static_cast(2) - a; + return a; + } + + return acos(x.w) * static_cast(2); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> axis(qua const& x) + { + T const tmp1 = static_cast(1) - x.w * x.w; + if(tmp1 <= static_cast(0)) + return vec<3, T, Q>(0, 0, 1); + T const tmp2 = static_cast(1) / sqrt(tmp1); + return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); + } + + template + GLM_FUNC_QUALIFIER qua angleAxis(T const& angle, vec<3, T, Q> const& v) + { + T const a(angle); + T const s = glm::sin(a * static_cast(0.5)); + + return qua(glm::cos(a * static_cast(0.5)), v * s); + } +}//namespace glm diff --git a/vendor/glm/ext/scalar_common.hpp b/vendor/glm/ext/scalar_common.hpp new file mode 100644 index 0000000000..0a0f759a05 --- /dev/null +++ b/vendor/glm/ext/scalar_common.hpp @@ -0,0 +1,181 @@ +/// @ref ext_scalar_common +/// @file glm/ext/scalar_common.hpp +/// +/// @defgroup ext_scalar_common GLM_EXT_scalar_common +/// @ingroup ext +/// +/// Exposes min and max functions for 3 to 4 scalar parameters. +/// +/// Include to use the features of this extension. +/// +/// @see core_func_common +/// @see ext_vector_common + +#pragma once + +// Dependency: +#include "../common.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_common + /// @{ + + /// Returns the minimum component-wise values of 3 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (min)(T a, T b, T c); + + /// Returns the minimum component-wise values of 4 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (min)(T a, T b, T c, T d); + + /// Returns the maximum component-wise values of 3 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (max)(T a, T b, T c); + + /// Returns the maximum component-wise values of 4 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (max)(T a, T b, T c, T d); + + /// Returns the minimum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (fmin)(T a, T b); + + /// Returns the minimum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (fmin)(T a, T b, T c); + + /// Returns the minimum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (fmin)(T a, T b, T c, T d); + + /// Returns the maximum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (fmax)(T a, T b); + + /// Returns the maximum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (fmax)(T a, T b, T C); + + /// Returns the maximum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T (fmax)(T a, T b, T C, T D); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL genType fclamp(genType x, genType minVal, genType maxVal); + + /// Simulate GL_CLAMP OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType clamp(genType const& Texcoord); + + /// Simulate GL_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType repeat(genType const& Texcoord); + + /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType mirrorClamp(genType const& Texcoord); + + /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType mirrorRepeat(genType const& Texcoord); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam genType floating point scalar types. + /// + /// @see GLSL round man page + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL int iround(genType const& x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam genType floating point scalar types. + /// + /// @see GLSL round man page + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL uint uround(genType const& x); + + /// @} +}//namespace glm + +#include "scalar_common.inl" diff --git a/vendor/glm/ext/scalar_common.inl b/vendor/glm/ext/scalar_common.inl new file mode 100644 index 0000000000..97edcf5157 --- /dev/null +++ b/vendor/glm/ext/scalar_common.inl @@ -0,0 +1,170 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER T (min)(T a, T b, T c) + { + return (glm::min)((glm::min)(a, b), c); + } + + template + GLM_FUNC_QUALIFIER T (min)(T a, T b, T c, T d) + { + return (glm::min)((glm::min)(a, b), (glm::min)(c, d)); + } + + template + GLM_FUNC_QUALIFIER T (max)(T a, T b, T c) + { + return (glm::max)((glm::max)(a, b), c); + } + + template + GLM_FUNC_QUALIFIER T (max)(T a, T b, T c, T d) + { + return (glm::max)((glm::max)(a, b), (glm::max)(c, d)); + } + +# if GLM_HAS_CXX11_STL + using std::fmin; +# else + template + GLM_FUNC_QUALIFIER T fmin(T a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return b; + return min(a, b); + } +# endif + + template + GLM_FUNC_QUALIFIER T (fmin)(T a, T b, T c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return (fmin)(b, c); + if (isnan(b)) + return (fmin)(a, c); + if (isnan(c)) + return min(a, b); + return (min)(a, b, c); + } + + template + GLM_FUNC_QUALIFIER T (fmin)(T a, T b, T c, T d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return (fmin)(b, c, d); + if (isnan(b)) + return (min)(a, (fmin)(c, d)); + if (isnan(c)) + return (fmin)(min(a, b), d); + if (isnan(d)) + return (min)(a, b, c); + return (min)(a, b, c, d); + } + + +# if GLM_HAS_CXX11_STL + using std::fmax; +# else + template + GLM_FUNC_QUALIFIER T (fmax)(T a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return b; + return (max)(a, b); + } +# endif + + template + GLM_FUNC_QUALIFIER T (fmax)(T a, T b, T c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return (fmax)(b, c); + if (isnan(b)) + return (fmax)(a, c); + if (isnan(c)) + return (max)(a, b); + return (max)(a, b, c); + } + + template + GLM_FUNC_QUALIFIER T (fmax)(T a, T b, T c, T d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return (fmax)(b, c, d); + if (isnan(b)) + return (max)(a, (fmax)(c, d)); + if (isnan(c)) + return (fmax)((max)(a, b), d); + if (isnan(d)) + return (max)(a, b, c); + return (max)(a, b, c, d); + } + + // fclamp + template + GLM_FUNC_QUALIFIER genType fclamp(genType x, genType minVal, genType maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fclamp' only accept floating-point or integer inputs"); + return fmin((fmax)(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER genType clamp(genType const& Texcoord) + { + return glm::clamp(Texcoord, static_cast(0), static_cast(1)); + } + + template + GLM_FUNC_QUALIFIER genType repeat(genType const& Texcoord) + { + return glm::fract(Texcoord); + } + + template + GLM_FUNC_QUALIFIER genType mirrorClamp(genType const& Texcoord) + { + return glm::fract(glm::abs(Texcoord)); + } + + template + GLM_FUNC_QUALIFIER genType mirrorRepeat(genType const& Texcoord) + { + genType const Abs = glm::abs(Texcoord); + genType const Clamp = glm::mod(glm::floor(Abs), static_cast(2)); + genType const Floor = glm::floor(Abs); + genType const Rest = Abs - Floor; + genType const Mirror = Clamp + Rest; + return mix(Rest, static_cast(1) - Rest, Mirror >= static_cast(1)); + } + + template + GLM_FUNC_QUALIFIER int iround(genType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'iround' only accept floating-point inputs"); + assert(static_cast(0.0) <= x); + + return static_cast(x + static_cast(0.5)); + } + + template + GLM_FUNC_QUALIFIER uint uround(genType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'uround' only accept floating-point inputs"); + assert(static_cast(0.0) <= x); + + return static_cast(x + static_cast(0.5)); + } +}//namespace glm diff --git a/vendor/glm/ext/scalar_constants.hpp b/vendor/glm/ext/scalar_constants.hpp new file mode 100644 index 0000000000..74e210d9c0 --- /dev/null +++ b/vendor/glm/ext/scalar_constants.hpp @@ -0,0 +1,40 @@ +/// @ref ext_scalar_constants +/// @file glm/ext/scalar_constants.hpp +/// +/// @defgroup ext_scalar_constants GLM_EXT_scalar_constants +/// @ingroup ext +/// +/// Provides a list of constants and precomputed useful values. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_constants extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_constants + /// @{ + + /// Return the epsilon constant for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); + + /// Return the pi constant for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); + + /// Return the value of cos(1 / 2) for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType cos_one_over_two(); + + /// @} +} //namespace glm + +#include "scalar_constants.inl" diff --git a/vendor/glm/ext/scalar_constants.inl b/vendor/glm/ext/scalar_constants.inl new file mode 100644 index 0000000000..b928e5118b --- /dev/null +++ b/vendor/glm/ext/scalar_constants.inl @@ -0,0 +1,24 @@ +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'epsilon' only accepts floating-point inputs"); + return std::numeric_limits::epsilon(); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'pi' only accepts floating-point inputs"); + return static_cast(3.14159265358979323846264338327950288); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType cos_one_over_two() + { + return genType(0.877582561890372716130286068203503191); + } +} //namespace glm diff --git a/vendor/glm/ext/scalar_int_sized.hpp b/vendor/glm/ext/scalar_int_sized.hpp new file mode 100644 index 0000000000..8e9c511c9c --- /dev/null +++ b/vendor/glm/ext/scalar_int_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_scalar_int_sized +/// @file glm/ext/scalar_int_sized.hpp +/// +/// @defgroup ext_scalar_int_sized GLM_EXT_scalar_int_sized +/// @ingroup ext +/// +/// Exposes sized signed integer scalar types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized + +#pragma once + +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_int_sized extension included") +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::int8_t int8; + typedef std::int16_t int16; + typedef std::int32_t int32; +# else + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; +#endif// + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + + /// @addtogroup ext_scalar_int_sized + /// @{ + + /// 8 bit signed integer type. + typedef detail::int8 int8; + + /// 16 bit signed integer type. + typedef detail::int16 int16; + + /// 32 bit signed integer type. + typedef detail::int32 int32; + + /// 64 bit signed integer type. + typedef detail::int64 int64; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/scalar_integer.hpp b/vendor/glm/ext/scalar_integer.hpp new file mode 100644 index 0000000000..a2ca8a2ae3 --- /dev/null +++ b/vendor/glm/ext/scalar_integer.hpp @@ -0,0 +1,92 @@ +/// @ref ext_scalar_integer +/// @file glm/ext/scalar_integer.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_scalar_integer GLM_EXT_scalar_integer +/// @ingroup ext +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../detail/type_float.hpp" +#include "../vector_relational.hpp" +#include "../common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_integer + /// @{ + + /// Return true if the value is a power of two number. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL bool isPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType nextPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType prevPowerOfTwo(genIUType v); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam genIUType Integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType nextMultiple(genIUType v, genIUType Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam genIUType Integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType prevMultiple(genIUType v, genIUType Multiple); + + /// Returns the bit number of the Nth significant bit set to + /// 1 in the binary representation of value. + /// If value bitcount is less than the Nth significant bit, -1 will be returned. + /// + /// @tparam genIUType Signed or unsigned integer scalar types. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL int findNSB(genIUType x, int significantBitCount); + + /// @} +} //namespace glm + +#include "scalar_integer.inl" diff --git a/vendor/glm/ext/scalar_integer.inl b/vendor/glm/ext/scalar_integer.inl new file mode 100644 index 0000000000..d416197e86 --- /dev/null +++ b/vendor/glm/ext/scalar_integer.inl @@ -0,0 +1,243 @@ +#include "../integer.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_ceilShift + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T) + { + return v; + } + }; + + template + struct compute_ceilShift + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Shift) + { + return v | (v >> Shift); + } + }; + + template + struct compute_ceilPowerOfTwo + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); + + vec const Sign(sign(x)); + + vec v(abs(x)); + + v = v - static_cast(1); + v = v | (v >> static_cast(1)); + v = v | (v >> static_cast(2)); + v = v | (v >> static_cast(4)); + v = compute_ceilShift= 2>::call(v, 8); + v = compute_ceilShift= 4>::call(v, 16); + v = compute_ceilShift= 8>::call(v, 32); + return (v + static_cast(1)) * Sign; + } + }; + + template + struct compute_ceilPowerOfTwo + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); + + vec v(x); + + v = v - static_cast(1); + v = v | (v >> static_cast(1)); + v = v | (v >> static_cast(2)); + v = v | (v >> static_cast(4)); + v = compute_ceilShift= 2>::call(v, 8); + v = compute_ceilShift= 4>::call(v, 16); + v = compute_ceilShift= 8>::call(v, 32); + return v + static_cast(1); + } + }; + + template + struct compute_ceilMultiple{}; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source > genType(0)) + return Source + (Multiple - std::fmod(Source, Multiple)); + else + return Source + std::fmod(-Source, Multiple); + } + }; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + genType Tmp = Source - genType(1); + return Tmp + (Multiple - (Tmp % Multiple)); + } + }; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + assert(Multiple > genType(0)); + if(Source > genType(0)) + { + genType Tmp = Source - genType(1); + return Tmp + (Multiple - (Tmp % Multiple)); + } + else + return Source + (-Source % Multiple); + } + }; + + template + struct compute_floorMultiple{}; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - std::fmod(Source, Multiple); + else + return Source - std::fmod(Source, Multiple) - Multiple; + } + }; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER bool isPowerOfTwo(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isPowerOfTwo' only accept integer inputs"); + + genIUType const Result = glm::abs(Value); + return !(Result & (Result - 1)); + } + + template + GLM_FUNC_QUALIFIER genIUType nextPowerOfTwo(genIUType value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextPowerOfTwo' only accept integer inputs"); + + return detail::compute_ceilPowerOfTwo<1, genIUType, defaultp, std::numeric_limits::is_signed>::call(vec<1, genIUType, defaultp>(value)).x; + } + + template + GLM_FUNC_QUALIFIER genIUType prevPowerOfTwo(genIUType value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevPowerOfTwo' only accept integer inputs"); + + return isPowerOfTwo(value) ? value : static_cast(static_cast(1) << static_cast(findMSB(value))); + } + + template + GLM_FUNC_QUALIFIER bool isMultiple(genIUType Value, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return isMultiple(vec<1, genIUType>(Value), vec<1, genIUType>(Multiple)).x; + } + + template + GLM_FUNC_QUALIFIER genIUType nextMultiple(genIUType Source, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER genIUType prevMultiple(genIUType Source, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER int findNSB(genIUType x, int significantBitCount) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findNSB' only accept integer inputs"); + + if(bitCount(x) < significantBitCount) + return -1; + + genIUType const One = static_cast(1); + int bitPos = 0; + + genIUType key = x; + int nBitCount = significantBitCount; + int Step = sizeof(x) * 8 / 2; + while (key > One) + { + genIUType Mask = static_cast((One << Step) - One); + genIUType currentKey = key & Mask; + int currentBitCount = bitCount(currentKey); + if (nBitCount > currentBitCount) + { + nBitCount -= currentBitCount; + bitPos += Step; + key >>= static_cast(Step); + } + else + { + key = key & Mask; + } + + Step >>= 1; + } + + return static_cast(bitPos); + } +}//namespace glm diff --git a/vendor/glm/ext/scalar_packing.hpp b/vendor/glm/ext/scalar_packing.hpp new file mode 100644 index 0000000000..18b85b72a4 --- /dev/null +++ b/vendor/glm/ext/scalar_packing.hpp @@ -0,0 +1,32 @@ +/// @ref ext_scalar_packing +/// @file glm/ext/scalar_packing.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_scalar_packing GLM_EXT_scalar_packing +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// This extension provides a set of function to convert scalar values to packed +/// formats. + +#pragma once + +// Dependency: +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_packing extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_packing + /// @{ + + + /// @} +}// namespace glm + +#include "scalar_packing.inl" diff --git a/vendor/glm/ext/vec1.inl b/vendor/glm/ext/scalar_packing.inl old mode 100755 new mode 100644 similarity index 100% rename from vendor/glm/ext/vec1.inl rename to vendor/glm/ext/scalar_packing.inl diff --git a/vendor/glm/ext/scalar_reciprocal.hpp b/vendor/glm/ext/scalar_reciprocal.hpp new file mode 100644 index 0000000000..1c7b81dde0 --- /dev/null +++ b/vendor/glm/ext/scalar_reciprocal.hpp @@ -0,0 +1,135 @@ +/// @ref ext_scalar_reciprocal +/// @file glm/ext/scalar_reciprocal.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_scalar_reciprocal GLM_EXT_scalar_reciprocal +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Define secant, cosecant and cotangent functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_reciprocal extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_reciprocal + /// @{ + + /// Secant function. + /// hypotenuse / adjacent or 1 / cos(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType sec(genType angle); + + /// Cosecant function. + /// hypotenuse / opposite or 1 / sin(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType csc(genType angle); + + /// Cotangent function. + /// adjacent / opposite or 1 / tan(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType cot(genType angle); + + /// Inverse secant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType asec(genType x); + + /// Inverse cosecant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType acsc(genType x); + + /// Inverse cotangent function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType acot(genType x); + + /// Secant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType sech(genType angle); + + /// Cosecant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType csch(genType angle); + + /// Cotangent hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType coth(genType angle); + + /// Inverse secant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType asech(genType x); + + /// Inverse cosecant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType acsch(genType x); + + /// Inverse cotangent hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType acoth(genType x); + + /// @} +}//namespace glm + +#include "scalar_reciprocal.inl" diff --git a/vendor/glm/ext/scalar_reciprocal.inl b/vendor/glm/ext/scalar_reciprocal.inl new file mode 100644 index 0000000000..0cd5f87b4e --- /dev/null +++ b/vendor/glm/ext/scalar_reciprocal.inl @@ -0,0 +1,107 @@ +/// @ref ext_scalar_reciprocal + +#include "../trigonometric.hpp" +#include + +namespace glm +{ + // sec + template + GLM_FUNC_QUALIFIER genType sec(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sec' only accept floating-point values"); + return genType(1) / glm::cos(angle); + } + + // csc + template + GLM_FUNC_QUALIFIER genType csc(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csc' only accept floating-point values"); + return genType(1) / glm::sin(angle); + } + + // cot + template + GLM_FUNC_QUALIFIER genType cot(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cot' only accept floating-point values"); + + genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); + return glm::tan(pi_over_2 - angle); + } + + // asec + template + GLM_FUNC_QUALIFIER genType asec(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asec' only accept floating-point values"); + return acos(genType(1) / x); + } + + // acsc + template + GLM_FUNC_QUALIFIER genType acsc(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsc' only accept floating-point values"); + return asin(genType(1) / x); + } + + // acot + template + GLM_FUNC_QUALIFIER genType acot(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acot' only accept floating-point values"); + + genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); + return pi_over_2 - atan(x); + } + + // sech + template + GLM_FUNC_QUALIFIER genType sech(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sech' only accept floating-point values"); + return genType(1) / glm::cosh(angle); + } + + // csch + template + GLM_FUNC_QUALIFIER genType csch(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csch' only accept floating-point values"); + return genType(1) / glm::sinh(angle); + } + + // coth + template + GLM_FUNC_QUALIFIER genType coth(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'coth' only accept floating-point values"); + return glm::cosh(angle) / glm::sinh(angle); + } + + // asech + template + GLM_FUNC_QUALIFIER genType asech(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asech' only accept floating-point values"); + return acosh(genType(1) / x); + } + + // acsch + template + GLM_FUNC_QUALIFIER genType acsch(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsch' only accept floating-point values"); + return asinh(genType(1) / x); + } + + // acoth + template + GLM_FUNC_QUALIFIER genType acoth(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acoth' only accept floating-point values"); + return atanh(genType(1) / x); + } +}//namespace glm diff --git a/vendor/glm/ext/scalar_relational.hpp b/vendor/glm/ext/scalar_relational.hpp new file mode 100644 index 0000000000..e84df17868 --- /dev/null +++ b/vendor/glm/ext/scalar_relational.hpp @@ -0,0 +1,68 @@ +/// @ref ext_scalar_relational +/// @file glm/ext/scalar_relational.hpp +/// +/// @defgroup ext_scalar_relational GLM_EXT_scalar_relational +/// @ingroup ext +/// +/// Exposes comparison functions for scalar types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see core_vector_relational +/// @see ext_vector_relational +/// @see ext_matrix_relational + +#pragma once + +// Dependencies +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_relational + /// @{ + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon); + + /// Returns the component-wise comparison between two scalars in term of ULPs. + /// True if this expression is satisfied. + /// + /// @param x First operand. + /// @param y Second operand. + /// @param ULPs Maximum difference in ULPs between the two operators to consider them equal. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int ULPs); + + /// Returns the component-wise comparison between two scalars in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @param x First operand. + /// @param y Second operand. + /// @param ULPs Maximum difference in ULPs between the two operators to consider them not equal. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs); + + /// @} +}//namespace glm + +#include "scalar_relational.inl" diff --git a/vendor/glm/ext/scalar_relational.inl b/vendor/glm/ext/scalar_relational.inl new file mode 100644 index 0000000000..c85583ef5b --- /dev/null +++ b/vendor/glm/ext/scalar_relational.inl @@ -0,0 +1,40 @@ +#include "../common.hpp" +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/type_float.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon) + { + return abs(x - y) <= epsilon; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon) + { + return abs(x - y) > epsilon; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int MaxULPs) + { + detail::float_t const a(x); + detail::float_t const b(y); + + // Different signs means they do not match. + if(a.negative() != b.negative()) + return false; + + // Find the difference in ULPs. + typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); + return DiffULPs <= MaxULPs; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs) + { + return !equal(x, y, ULPs); + } +}//namespace glm diff --git a/vendor/glm/ext/scalar_uint_sized.hpp b/vendor/glm/ext/scalar_uint_sized.hpp new file mode 100644 index 0000000000..fd5267fad7 --- /dev/null +++ b/vendor/glm/ext/scalar_uint_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_scalar_uint_sized +/// @file glm/ext/scalar_uint_sized.hpp +/// +/// @defgroup ext_scalar_uint_sized GLM_EXT_scalar_uint_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer scalar types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized + +#pragma once + +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_uint_sized extension included") +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::uint8_t uint8; + typedef std::uint16_t uint16; + typedef std::uint32_t uint32; +# else + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; +#endif + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + + /// @addtogroup ext_scalar_uint_sized + /// @{ + + /// 8 bit unsigned integer type. + typedef detail::uint8 uint8; + + /// 16 bit unsigned integer type. + typedef detail::uint16 uint16; + + /// 32 bit unsigned integer type. + typedef detail::uint32 uint32; + + /// 64 bit unsigned integer type. + typedef detail::uint64 uint64; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/scalar_ulp.hpp b/vendor/glm/ext/scalar_ulp.hpp new file mode 100644 index 0000000000..6344d95bf2 --- /dev/null +++ b/vendor/glm/ext/scalar_ulp.hpp @@ -0,0 +1,77 @@ +/// @ref ext_scalar_ulp +/// @file glm/ext/scalar_ulp.hpp +/// +/// @defgroup ext_scalar_ulp GLM_EXT_scalar_ulp +/// @ingroup ext +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_ulp +/// @see ext_scalar_relational + +#pragma once + +// Dependencies +#include "../ext/scalar_int_sized.hpp" +#include "../common.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_ulp extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_ulp + /// @{ + + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType nextFloat(genType x); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType prevFloat(genType x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType nextFloat(genType x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType prevFloat(genType x, int ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @see ext_scalar_ulp + GLM_FUNC_DECL int floatDistance(float x, float y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @see ext_scalar_ulp + GLM_FUNC_DECL int64 floatDistance(double x, double y); + + /// @} +}//namespace glm + +#include "scalar_ulp.inl" diff --git a/vendor/glm/ext/scalar_ulp.inl b/vendor/glm/ext/scalar_ulp.inl new file mode 100644 index 0000000000..716528d0cf --- /dev/null +++ b/vendor/glm/ext/scalar_ulp.inl @@ -0,0 +1,291 @@ +/// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. +/// +/// Developed at SunPro, a Sun Microsystems, Inc. business. +/// Permission to use, copy, modify, and distribute this +/// software is freely granted, provided that this notice +/// is preserved. + +#include "../detail/type_float.hpp" +#include "../ext/scalar_constants.hpp" +#include +#include + +#if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable : 4127) +# pragma warning(disable : 4365) // '=': signed/unsigned mismatch +#elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wsign-conversion" +# pragma clang diagnostic ignored "-Wpadded" +#endif + +typedef union +{ + float value; + /* FIXME: Assumes 32 bit int. */ + unsigned int word; +} ieee_float_shape_type; + +typedef union +{ + double value; + struct + { + int lsw; + int msw; + } parts; +} ieee_double_shape_type; + +#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ + do { \ + ieee_double_shape_type ew_u; \ + ew_u.value = (d); \ + (ix0) = ew_u.parts.msw; \ + (ix1) = ew_u.parts.lsw; \ + } while (0) + +#define GLM_GET_FLOAT_WORD(i,d) \ + do { \ + ieee_float_shape_type gf_u; \ + gf_u.value = (d); \ + (i) = static_cast(gf_u.word); \ + } while (0) + +#define GLM_SET_FLOAT_WORD(d,i) \ + do { \ + ieee_float_shape_type sf_u; \ + sf_u.word = static_cast(i); \ + (d) = sf_u.value; \ + } while (0) + +#define GLM_INSERT_WORDS(d,ix0,ix1) \ + do { \ + ieee_double_shape_type iw_u; \ + iw_u.parts.msw = (ix0); \ + iw_u.parts.lsw = (ix1); \ + (d) = iw_u.value; \ + } while (0) + +namespace glm{ +namespace detail +{ + GLM_FUNC_QUALIFIER float nextafterf(float x, float y) + { + volatile float t; + int hx, hy, ix, iy; + + GLM_GET_FLOAT_WORD(hx, x); + GLM_GET_FLOAT_WORD(hy, y); + ix = hx & 0x7fffffff; // |x| + iy = hy & 0x7fffffff; // |y| + + if((ix > 0x7f800000) || // x is nan + (iy > 0x7f800000)) // y is nan + return x + y; + if(abs(y - x) <= epsilon()) + return y; // x=y, return y + if(ix == 0) + { // x == 0 + GLM_SET_FLOAT_WORD(x, (hy & 0x80000000) | 1);// return +-minsubnormal + t = x * x; + if(abs(t - x) <= epsilon()) + return t; + else + return x; // raise underflow flag + } + if(hx >= 0) + { // x > 0 + if(hx > hy) // x > y, x -= ulp + hx -= 1; + else // x < y, x += ulp + hx += 1; + } + else + { // x < 0 + if(hy >= 0 || hx > hy) // x < y, x -= ulp + hx -= 1; + else // x > y, x += ulp + hx += 1; + } + hy = hx & 0x7f800000; + if(hy >= 0x7f800000) + return x + x; // overflow + if(hy < 0x00800000) // underflow + { + t = x * x; + if(abs(t - x) > epsilon()) + { // raise underflow flag + GLM_SET_FLOAT_WORD(y, hx); + return y; + } + } + GLM_SET_FLOAT_WORD(x, hx); + return x; + } + + GLM_FUNC_QUALIFIER double nextafter(double x, double y) + { + volatile double t; + int hx, hy, ix, iy; + unsigned int lx, ly; + + GLM_EXTRACT_WORDS(hx, lx, x); + GLM_EXTRACT_WORDS(hy, ly, y); + ix = hx & 0x7fffffff; // |x| + iy = hy & 0x7fffffff; // |y| + + if(((ix >= 0x7ff00000) && ((ix - 0x7ff00000) | lx) != 0) || // x is nan + ((iy >= 0x7ff00000) && ((iy - 0x7ff00000) | ly) != 0)) // y is nan + return x + y; + if(abs(y - x) <= epsilon()) + return y; // x=y, return y + if((ix | lx) == 0) + { // x == 0 + GLM_INSERT_WORDS(x, hy & 0x80000000, 1); // return +-minsubnormal + t = x * x; + if(abs(t - x) <= epsilon()) + return t; + else + return x; // raise underflow flag + } + if(hx >= 0) { // x > 0 + if(hx > hy || ((hx == hy) && (lx > ly))) { // x > y, x -= ulp + if(lx == 0) hx -= 1; + lx -= 1; + } + else { // x < y, x += ulp + lx += 1; + if(lx == 0) hx += 1; + } + } + else { // x < 0 + if(hy >= 0 || hx > hy || ((hx == hy) && (lx > ly))){// x < y, x -= ulp + if(lx == 0) hx -= 1; + lx -= 1; + } + else { // x > y, x += ulp + lx += 1; + if(lx == 0) hx += 1; + } + } + hy = hx & 0x7ff00000; + if(hy >= 0x7ff00000) + return x + x; // overflow + if(hy < 0x00100000) + { // underflow + t = x * x; + if(abs(t - x) > epsilon()) + { // raise underflow flag + GLM_INSERT_WORDS(y, hx, lx); + return y; + } + } + GLM_INSERT_WORDS(x, hx, lx); + return x; + } +}//namespace detail +}//namespace glm + +#if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +#elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +#endif + +namespace glm +{ + template<> + GLM_FUNC_QUALIFIER float nextFloat(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MAX); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MAX); +# else + return nextafterf(x, FLT_MAX); +# endif + } + + template<> + GLM_FUNC_QUALIFIER double nextFloat(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafter(x, std::numeric_limits::max()); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MAX); +# else + return nextafter(x, DBL_MAX); +# endif + } + + template + GLM_FUNC_QUALIFIER T nextFloat(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'next_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for(int i = 0; i < ULPs; ++i) + temp = nextFloat(temp); + return temp; + } + + GLM_FUNC_QUALIFIER float prevFloat(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MIN); +# else + return nextafterf(x, FLT_MIN); +# endif + } + + GLM_FUNC_QUALIFIER double prevFloat(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return _nextafter(x, DBL_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MIN); +# else + return nextafter(x, DBL_MIN); +# endif + } + + template + GLM_FUNC_QUALIFIER T prevFloat(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'prev_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for(int i = 0; i < ULPs; ++i) + temp = prevFloat(temp); + return temp; + } + + GLM_FUNC_QUALIFIER int floatDistance(float x, float y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + + GLM_FUNC_QUALIFIER int64 floatDistance(double x, double y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } +}//namespace glm diff --git a/vendor/glm/ext/vec1.hpp b/vendor/glm/ext/vec1.hpp deleted file mode 100755 index 887877e572..0000000000 --- a/vendor/glm/ext/vec1.hpp +++ /dev/null @@ -1,461 +0,0 @@ -/// @ref ext_vec1 -/// @file glm/ext/vec1.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_vec1 GLM_EXT_vec1 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Add vec1, ivec1, uvec1 and bvec1 types. - -#pragma once - -#include "../fwd.hpp" -#include "../detail/type_vec.hpp" -#if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED -# if GLM_HAS_UNRESTRICTED_UNIONS -# include "../detail/_swizzle.hpp" -# else -# include "../detail/_swizzle_func.hpp" -# endif -#endif //GLM_SWIZZLE -#include - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vec1 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vec1 - /// @{ - - template - struct vec<1, T, Q> - { - // -- Implementation detail -- - - typedef T value_type; - typedef vec type; - typedef vec<1, bool, Q> bool_type; - - // -- Data -- - -# if GLM_HAS_ONLY_XYZW - T x; - -# elif GLM_HAS_ALIGNED_TYPE -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# endif -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -# pragma clang diagnostic ignored "-Wnested-anon-types" -# endif - - union - { - T x; - T r; - T s; -/* -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED - _GLM_SWIZZLE1_2_MEMBERS(T, Q, tvec2, x) - _GLM_SWIZZLE1_2_MEMBERS(T, Q, tvec2, r) - _GLM_SWIZZLE1_2_MEMBERS(T, Q, tvec2, s) - _GLM_SWIZZLE1_3_MEMBERS(T, Q, tvec3, x) - _GLM_SWIZZLE1_3_MEMBERS(T, Q, tvec3, r) - _GLM_SWIZZLE1_3_MEMBERS(T, Q, tvec3, s) - _GLM_SWIZZLE1_4_MEMBERS(T, Q, tvec4, x) - _GLM_SWIZZLE1_4_MEMBERS(T, Q, tvec4, r) - _GLM_SWIZZLE1_4_MEMBERS(T, Q, tvec4, s) -# endif//GLM_SWIZZLE*/ - }; - -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# endif -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# endif -# else - union {T x, r, s;}; -/* -# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED - GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, P, tvec2, tvec2, tvec3, tvec4) -# endif//GLM_SWIZZLE*/ -# endif - - // -- Component accesses -- - - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;} - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const& operator[](length_type i) const; - - // -- Implicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, T, P> const& v); - - // -- Explicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(T scalar); - - // -- Conversion vector constructors -- - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<2, U, P> const& v); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<3, U, P> const& v); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<4, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR GLM_EXPLICIT vec(vec<1, U, P> const& v); - - // -- Swizzle constructors -- -/* -# if(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)) - template - GLM_FUNC_DECL tvec(detail::_swizzle<1, T, Q, tvec1, E0, -1,-2,-3> const& that) - { - *this = that(); - } -# endif//(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)) -*/ - // -- Unary arithmetic operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec & operator=(vec const& v) GLM_DEFAULT; - - template - GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 vec & operator=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator+=(U scalar); - template - GLM_FUNC_DECL vec & operator+=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator-=(U scalar); - template - GLM_FUNC_DECL vec & operator-=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator*=(U scalar); - template - GLM_FUNC_DECL vec & operator*=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator/=(U scalar); - template - GLM_FUNC_DECL vec & operator/=(vec<1, U, Q> const& v); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL vec & operator++(); - GLM_FUNC_DECL vec & operator--(); - GLM_FUNC_DECL vec operator++(int); - GLM_FUNC_DECL vec operator--(int); - - // -- Unary bit operators -- - - template - GLM_FUNC_DECL vec & operator%=(U scalar); - template - GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator&=(U scalar); - template - GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator|=(U scalar); - template - GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator^=(U scalar); - template - GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator<<=(U scalar); - template - GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL vec & operator>>=(U scalar); - template - GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v); - - // -- Binary operators -- - - template - GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, T, Q> operator~(vec<1, T, Q> const& v); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); - - template - GLM_FUNC_DECL vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); - - /// 1 component vector of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see ext_vec1 - typedef vec<1, float, highp> highp_vec1; - - /// 1 component vector of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see ext_vec1 - typedef vec<1, float, mediump> mediump_vec1; - - /// 1 component vector of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see ext_vec1 - typedef vec<1, float, lowp> lowp_vec1; - - /// 1 component vector of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see ext_vec1 - typedef vec<1, double, highp> highp_dvec1; - - /// 1 component vector of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see ext_vec1 - typedef vec<1, double, mediump> mediump_dvec1; - - /// 1 component vector of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see ext_vec1 - typedef vec<1, double, lowp> lowp_dvec1; - - /// 1 component vector of signed integer numbers. - /// - /// @see ext_vec1 - typedef vec<1, int, highp> highp_ivec1; - - /// 1 component vector of signed integer numbers. - /// - /// @see ext_vec1 - typedef vec<1, int, mediump> mediump_ivec1; - - /// 1 component vector of signed integer numbers. - /// - /// @see ext_vec1 - typedef vec<1, int, lowp> lowp_ivec1; - - /// 1 component vector of unsigned integer numbers. - /// - /// @see ext_vec1 - typedef vec<1, uint, highp> highp_uvec1; - - /// 1 component vector of unsigned integer numbers. - /// - /// @see ext_vec1 - typedef vec<1, uint, mediump> mediump_uvec1; - - /// 1 component vector of unsigned integer numbers. - /// - /// @see ext_vec1 - typedef vec<1, uint, lowp> lowp_uvec1; - - /// 1 component vector of bool values. - /// - /// @see ext_vec1 - typedef vec<1, bool, highp> highp_bvec1; - - /// 1 component vector of bool values. - /// - /// @see ext_vec1 - typedef vec<1, bool, mediump> mediump_bvec1; - - /// 1 component vector of bool values. - /// - /// @see ext_vec1 - typedef vec<1, bool, lowp> lowp_bvec1; - -#if GLM_HAS_TEMPLATE_ALIASES - template using tvec1 = vec<1, T, Q>; -#endif//GLM_HAS_TEMPLATE_ALIASES - - ////////////////////////// - // vec1 definition - -#if(defined(GLM_PRECISION_HIGHP_BOOL)) - typedef highp_bvec1 bvec1; -#elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) - typedef mediump_bvec1 bvec1; -#elif(defined(GLM_PRECISION_LOWP_BOOL)) - typedef lowp_bvec1 bvec1; -#else - /// 1 component vector of boolean. - /// @see gtc_vec1 extension. - typedef highp_bvec1 bvec1; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_FLOAT)) - typedef highp_vec1 vec1; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef mediump_vec1 vec1; -#elif(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_vec1 vec1; -#else - /// 1 component vector of floating-point numbers. - /// @see gtc_vec1 extension. - typedef highp_vec1 vec1; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_DOUBLE)) - typedef highp_dvec1 dvec1; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef mediump_dvec1 dvec1; -#elif(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_dvec1 dvec1; -#else - /// 1 component vector of floating-point numbers. - /// @see gtc_vec1 extension. - typedef highp_dvec1 dvec1; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_INT)) - typedef highp_ivec1 ivec1; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_ivec1 ivec1; -#elif(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_ivec1 ivec1; -#else - /// 1 component vector of signed integer numbers. - /// @see gtc_vec1 extension. - typedef highp_ivec1 ivec1; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_UINT)) - typedef highp_uvec1 uvec1; -#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) - typedef mediump_uvec1 uvec1; -#elif(defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_uvec1 uvec1; -#else - /// 1 component vector of unsigned integer numbers. - /// @see gtc_vec1 extension. - typedef highp_uvec1 uvec1; -#endif//GLM_PRECISION - - /// @} -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "../detail/type_vec1.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/vendor/glm/ext/vector_bool1.hpp b/vendor/glm/ext/vector_bool1.hpp new file mode 100644 index 0000000000..002c3202ad --- /dev/null +++ b/vendor/glm/ext/vector_bool1.hpp @@ -0,0 +1,30 @@ +/// @ref ext_vector_bool1 +/// @file glm/ext/vector_bool1.hpp +/// +/// @defgroup ext_vector_bool1 GLM_EXT_vector_bool1 +/// @ingroup ext +/// +/// Exposes bvec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_bool1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_bool1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_bool1 + /// @{ + + /// 1 components vector of boolean. + typedef vec<1, bool, defaultp> bvec1; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_bool1_precision.hpp b/vendor/glm/ext/vector_bool1_precision.hpp new file mode 100644 index 0000000000..e62d3cfb5f --- /dev/null +++ b/vendor/glm/ext/vector_bool1_precision.hpp @@ -0,0 +1,34 @@ +/// @ref ext_vector_bool1_precision +/// @file glm/ext/vector_bool1_precision.hpp +/// +/// @defgroup ext_vector_bool1_precision GLM_EXT_vector_bool1_precision +/// @ingroup ext +/// +/// Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. +/// +/// Include to use the features of this extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_bool1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_bool1_precision + /// @{ + + /// 1 component vector of bool values. + typedef vec<1, bool, highp> highp_bvec1; + + /// 1 component vector of bool values. + typedef vec<1, bool, mediump> mediump_bvec1; + + /// 1 component vector of bool values. + typedef vec<1, bool, lowp> lowp_bvec1; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_bool2.hpp b/vendor/glm/ext/vector_bool2.hpp new file mode 100644 index 0000000000..52288b75c6 --- /dev/null +++ b/vendor/glm/ext/vector_bool2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, bool, defaultp> bvec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_bool2_precision.hpp b/vendor/glm/ext/vector_bool2_precision.hpp new file mode 100644 index 0000000000..43709332c6 --- /dev/null +++ b/vendor/glm/ext/vector_bool2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, highp> highp_bvec2; + + /// 2 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, mediump> mediump_bvec2; + + /// 2 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, lowp> lowp_bvec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_bool3.hpp b/vendor/glm/ext/vector_bool3.hpp new file mode 100644 index 0000000000..90a0b7ea5a --- /dev/null +++ b/vendor/glm/ext/vector_bool3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, bool, defaultp> bvec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_bool3_precision.hpp b/vendor/glm/ext/vector_bool3_precision.hpp new file mode 100644 index 0000000000..89cd2d3207 --- /dev/null +++ b/vendor/glm/ext/vector_bool3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, highp> highp_bvec3; + + /// 3 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, mediump> mediump_bvec3; + + /// 3 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, lowp> lowp_bvec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_bool4.hpp b/vendor/glm/ext/vector_bool4.hpp new file mode 100644 index 0000000000..18aa71bd0f --- /dev/null +++ b/vendor/glm/ext/vector_bool4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, bool, defaultp> bvec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_bool4_precision.hpp b/vendor/glm/ext/vector_bool4_precision.hpp new file mode 100644 index 0000000000..79786e5420 --- /dev/null +++ b/vendor/glm/ext/vector_bool4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool4_precision.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, highp> highp_bvec4; + + /// 4 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, mediump> mediump_bvec4; + + /// 4 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, lowp> lowp_bvec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_common.hpp b/vendor/glm/ext/vector_common.hpp new file mode 100644 index 0000000000..c0a2858cc2 --- /dev/null +++ b/vendor/glm/ext/vector_common.hpp @@ -0,0 +1,228 @@ +/// @ref ext_vector_common +/// @file glm/ext/vector_common.hpp +/// +/// @defgroup ext_vector_common GLM_EXT_vector_common +/// @ingroup ext +/// +/// Exposes min and max functions for 3 to 4 vector parameters. +/// +/// Include to use the features of this extension. +/// +/// @see core_common +/// @see ext_scalar_common + +#pragma once + +// Dependency: +#include "../ext/scalar_common.hpp" +#include "../common.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_common + /// @{ + + /// Return the minimum component-wise values of 3 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& a, vec const& b, vec const& c); + + /// Return the minimum component-wise values of 4 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Return the maximum component-wise values of 3 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z); + + /// Return the maximum component-wise values of 4 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max( vec const& x, vec const& y, vec const& z, vec const& w); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& x, T y); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& x, vec const& y); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& a, vec const& b, vec const& c); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, T b); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b, vec const& c); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common + template + GLM_FUNC_DECL vec fclamp(vec const& x, T minVal, T maxVal); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common + template + GLM_FUNC_DECL vec fclamp(vec const& x, vec const& minVal, vec const& maxVal); + + /// Simulate GL_CLAMP OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec clamp(vec const& Texcoord); + + /// Simulate GL_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec repeat(vec const& Texcoord); + + /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec mirrorClamp(vec const& Texcoord); + + /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec mirrorRepeat(vec const& Texcoord); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam T floating point scalar types. + /// + /// @see GLSL round man page + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec iround(vec const& x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam T floating point scalar types. + /// + /// @see GLSL round man page + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec uround(vec const& x); + + /// @} +}//namespace glm + +#include "vector_common.inl" diff --git a/vendor/glm/ext/vector_common.inl b/vendor/glm/ext/vector_common.inl new file mode 100644 index 0000000000..67817fc554 --- /dev/null +++ b/vendor/glm/ext/vector_common.inl @@ -0,0 +1,147 @@ +#include "../detail/_vectorize.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& x, vec const& y, vec const& z) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); + return glm::min(glm::min(x, y), z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& x, vec const& y, vec const& z, vec const& w) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); + return glm::max(glm::max(x, y), z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z, vec const& w) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); + return glm::max(glm::max(x, y), glm::max(z, w)); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return detail::functor2::call(fmin, a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return detail::functor2::call(fmin, a, b); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b, vec const& c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return fmin(fmin(a, b), c); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b, vec const& c, vec const& d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return fmin(fmin(a, b), fmin(c, d)); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return detail::functor2::call(fmax, a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return detail::functor2::call(fmax, a, b); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b, vec const& c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return fmax(fmax(a, b), c); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b, vec const& c, vec const& d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return fmax(fmax(a, b), fmax(c, d)); + } + + template + GLM_FUNC_QUALIFIER vec fclamp(vec const& x, T minVal, T maxVal) + { + return fmin(fmax(x, vec(minVal)), vec(maxVal)); + } + + template + GLM_FUNC_QUALIFIER vec fclamp(vec const& x, vec const& minVal, vec const& maxVal) + { + return fmin(fmax(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER vec clamp(vec const& Texcoord) + { + return glm::clamp(Texcoord, vec(0), vec(1)); + } + + template + GLM_FUNC_QUALIFIER vec repeat(vec const& Texcoord) + { + return glm::fract(Texcoord); + } + + template + GLM_FUNC_QUALIFIER vec mirrorClamp(vec const& Texcoord) + { + return glm::fract(glm::abs(Texcoord)); + } + + template + GLM_FUNC_QUALIFIER vec mirrorRepeat(vec const& Texcoord) + { + vec const Abs = glm::abs(Texcoord); + vec const Clamp = glm::mod(glm::floor(Abs), vec(2)); + vec const Floor = glm::floor(Abs); + vec const Rest = Abs - Floor; + vec const Mirror = Clamp + Rest; + return mix(Rest, vec(1) - Rest, glm::greaterThanEqual(Mirror, vec(1))); + } + + template + GLM_FUNC_QUALIFIER vec iround(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); + assert(all(lessThanEqual(vec(0), x))); + + return vec(x + static_cast(0.5)); + } + + template + GLM_FUNC_QUALIFIER vec uround(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); + assert(all(lessThanEqual(vec(0), x))); + + return vec(x + static_cast(0.5)); + } +}//namespace glm diff --git a/vendor/glm/ext/vector_double1.hpp b/vendor/glm/ext/vector_double1.hpp new file mode 100644 index 0000000000..388266774d --- /dev/null +++ b/vendor/glm/ext/vector_double1.hpp @@ -0,0 +1,31 @@ +/// @ref ext_vector_double1 +/// @file glm/ext/vector_double1.hpp +/// +/// @defgroup ext_vector_double1 GLM_EXT_vector_double1 +/// @ingroup ext +/// +/// Exposes double-precision floating point vector type with one component. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_double1_precision extension. +/// @see ext_vector_float1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_double1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_double1 + /// @{ + + /// 1 components vector of double-precision floating-point numbers. + typedef vec<1, double, defaultp> dvec1; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_double1_precision.hpp b/vendor/glm/ext/vector_double1_precision.hpp new file mode 100644 index 0000000000..1d47195954 --- /dev/null +++ b/vendor/glm/ext/vector_double1_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_vector_double1_precision +/// @file glm/ext/vector_double1_precision.hpp +/// +/// @defgroup ext_vector_double1_precision GLM_EXT_vector_double1_precision +/// @ingroup ext +/// +/// Exposes highp_dvec1, mediump_dvec1 and lowp_dvec1 types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_double1 + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_double1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_double1_precision + /// @{ + + /// 1 component vector of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, double, highp> highp_dvec1; + + /// 1 component vector of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, double, mediump> mediump_dvec1; + + /// 1 component vector of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, double, lowp> lowp_dvec1; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_double2.hpp b/vendor/glm/ext/vector_double2.hpp new file mode 100644 index 0000000000..60e357750b --- /dev/null +++ b/vendor/glm/ext/vector_double2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, double, defaultp> dvec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_double2_precision.hpp b/vendor/glm/ext/vector_double2_precision.hpp new file mode 100644 index 0000000000..fa53940f6b --- /dev/null +++ b/vendor/glm/ext/vector_double2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_double2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, highp> highp_dvec2; + + /// 2 components vector of medium double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, mediump> mediump_dvec2; + + /// 2 components vector of low double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, lowp> lowp_dvec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_double3.hpp b/vendor/glm/ext/vector_double3.hpp new file mode 100644 index 0000000000..6dfe4c675b --- /dev/null +++ b/vendor/glm/ext/vector_double3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, double, defaultp> dvec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_double3_precision.hpp b/vendor/glm/ext/vector_double3_precision.hpp new file mode 100644 index 0000000000..a8cfa37a8c --- /dev/null +++ b/vendor/glm/ext/vector_double3_precision.hpp @@ -0,0 +1,34 @@ +/// @ref core +/// @file glm/ext/vector_double3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, highp> highp_dvec3; + + /// 3 components vector of medium double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, mediump> mediump_dvec3; + + /// 3 components vector of low double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, lowp> lowp_dvec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_double4.hpp b/vendor/glm/ext/vector_double4.hpp new file mode 100644 index 0000000000..87f225f64d --- /dev/null +++ b/vendor/glm/ext/vector_double4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, double, defaultp> dvec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_double4_precision.hpp b/vendor/glm/ext/vector_double4_precision.hpp new file mode 100644 index 0000000000..09cafa1eba --- /dev/null +++ b/vendor/glm/ext/vector_double4_precision.hpp @@ -0,0 +1,35 @@ +/// @ref core +/// @file glm/ext/vector_double4_precision.hpp + +#pragma once +#include "../detail/setup.hpp" +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, highp> highp_dvec4; + + /// 4 components vector of medium double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, mediump> mediump_dvec4; + + /// 4 components vector of low double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, lowp> lowp_dvec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_float1.hpp b/vendor/glm/ext/vector_float1.hpp new file mode 100644 index 0000000000..28acc2c9ca --- /dev/null +++ b/vendor/glm/ext/vector_float1.hpp @@ -0,0 +1,31 @@ +/// @ref ext_vector_float1 +/// @file glm/ext/vector_float1.hpp +/// +/// @defgroup ext_vector_float1 GLM_EXT_vector_float1 +/// @ingroup ext +/// +/// Exposes single-precision floating point vector type with one component. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_float1_precision extension. +/// @see ext_vector_double1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_float1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_float1 + /// @{ + + /// 1 components vector of single-precision floating-point numbers. + typedef vec<1, float, defaultp> vec1; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_float1_precision.hpp b/vendor/glm/ext/vector_float1_precision.hpp new file mode 100644 index 0000000000..6e8dad8d17 --- /dev/null +++ b/vendor/glm/ext/vector_float1_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_vector_float1_precision +/// @file glm/ext/vector_float1_precision.hpp +/// +/// @defgroup ext_vector_float1_precision GLM_EXT_vector_float1_precision +/// @ingroup ext +/// +/// Exposes highp_vec1, mediump_vec1 and lowp_vec1 types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_float1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_float1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_float1_precision + /// @{ + + /// 1 component vector of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, float, highp> highp_vec1; + + /// 1 component vector of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, float, mediump> mediump_vec1; + + /// 1 component vector of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, float, lowp> lowp_vec1; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_float2.hpp b/vendor/glm/ext/vector_float2.hpp new file mode 100644 index 0000000000..d31545dcc9 --- /dev/null +++ b/vendor/glm/ext/vector_float2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, float, defaultp> vec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_float2_precision.hpp b/vendor/glm/ext/vector_float2_precision.hpp new file mode 100644 index 0000000000..23c0820d0a --- /dev/null +++ b/vendor/glm/ext/vector_float2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, highp> highp_vec2; + + /// 2 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, mediump> mediump_vec2; + + /// 2 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, lowp> lowp_vec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_float3.hpp b/vendor/glm/ext/vector_float3.hpp new file mode 100644 index 0000000000..cd79a62004 --- /dev/null +++ b/vendor/glm/ext/vector_float3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, float, defaultp> vec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_float3_precision.hpp b/vendor/glm/ext/vector_float3_precision.hpp new file mode 100644 index 0000000000..be640b5316 --- /dev/null +++ b/vendor/glm/ext/vector_float3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, highp> highp_vec3; + + /// 3 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, mediump> mediump_vec3; + + /// 3 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, lowp> lowp_vec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_float4.hpp b/vendor/glm/ext/vector_float4.hpp new file mode 100644 index 0000000000..d84adcc22f --- /dev/null +++ b/vendor/glm/ext/vector_float4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, float, defaultp> vec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_float4_precision.hpp b/vendor/glm/ext/vector_float4_precision.hpp new file mode 100644 index 0000000000..aede83882e --- /dev/null +++ b/vendor/glm/ext/vector_float4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float4_precision.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, highp> highp_vec4; + + /// 4 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, mediump> mediump_vec4; + + /// 4 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, lowp> lowp_vec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_int1.hpp b/vendor/glm/ext/vector_int1.hpp new file mode 100644 index 0000000000..dc8603891a --- /dev/null +++ b/vendor/glm/ext/vector_int1.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_int1 +/// @file glm/ext/vector_int1.hpp +/// +/// @defgroup ext_vector_int1 GLM_EXT_vector_int1 +/// @ingroup ext +/// +/// Exposes ivec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_uint1 extension. +/// @see ext_vector_int1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int1 + /// @{ + + /// 1 component vector of signed integer numbers. + typedef vec<1, int, defaultp> ivec1; + + /// @} +}//namespace glm + diff --git a/vendor/glm/ext/vector_int1_sized.hpp b/vendor/glm/ext/vector_int1_sized.hpp new file mode 100644 index 0000000000..de0d4cf82e --- /dev/null +++ b/vendor/glm/ext/vector_int1_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int1_sized +/// @file glm/ext/vector_int1_sized.hpp +/// +/// @defgroup ext_vector_int1_sized GLM_EXT_vector_int1_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint1_sized + +#pragma once + +#include "../ext/vector_int1.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int1_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int1_sized + /// @{ + + /// 8 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int8, defaultp> i8vec1; + + /// 16 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int16, defaultp> i16vec1; + + /// 32 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int32, defaultp> i32vec1; + + /// 64 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int64, defaultp> i64vec1; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_int2.hpp b/vendor/glm/ext/vector_int2.hpp new file mode 100644 index 0000000000..aef803e91b --- /dev/null +++ b/vendor/glm/ext/vector_int2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, int, defaultp> ivec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_int2_sized.hpp b/vendor/glm/ext/vector_int2_sized.hpp new file mode 100644 index 0000000000..1fd57eef31 --- /dev/null +++ b/vendor/glm/ext/vector_int2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int2_sized +/// @file glm/ext/vector_int2_sized.hpp +/// +/// @defgroup ext_vector_int2_sized GLM_EXT_vector_int2_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 2 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint2_sized + +#pragma once + +#include "../ext/vector_int2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int2_sized + /// @{ + + /// 8 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int8, defaultp> i8vec2; + + /// 16 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int16, defaultp> i16vec2; + + /// 32 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int32, defaultp> i32vec2; + + /// 64 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int64, defaultp> i64vec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_int3.hpp b/vendor/glm/ext/vector_int3.hpp new file mode 100644 index 0000000000..4767e61e88 --- /dev/null +++ b/vendor/glm/ext/vector_int3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, int, defaultp> ivec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_int3_sized.hpp b/vendor/glm/ext/vector_int3_sized.hpp new file mode 100644 index 0000000000..085a3febbf --- /dev/null +++ b/vendor/glm/ext/vector_int3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int3_sized +/// @file glm/ext/vector_int3_sized.hpp +/// +/// @defgroup ext_vector_int3_sized GLM_EXT_vector_int3_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 3 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint3_sized + +#pragma once + +#include "../ext/vector_int3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int3_sized + /// @{ + + /// 8 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int8, defaultp> i8vec3; + + /// 16 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int16, defaultp> i16vec3; + + /// 32 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int32, defaultp> i32vec3; + + /// 64 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int64, defaultp> i64vec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_int4.hpp b/vendor/glm/ext/vector_int4.hpp new file mode 100644 index 0000000000..bb23adf706 --- /dev/null +++ b/vendor/glm/ext/vector_int4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, int, defaultp> ivec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_int4_sized.hpp b/vendor/glm/ext/vector_int4_sized.hpp new file mode 100644 index 0000000000..c63d46540b --- /dev/null +++ b/vendor/glm/ext/vector_int4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int4_sized +/// @file glm/ext/vector_int4_sized.hpp +/// +/// @defgroup ext_vector_int4_sized GLM_EXT_vector_int4_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 4 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint4_sized + +#pragma once + +#include "../ext/vector_int4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int4_sized + /// @{ + + /// 8 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int8, defaultp> i8vec4; + + /// 16 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int16, defaultp> i16vec4; + + /// 32 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int32, defaultp> i32vec4; + + /// 64 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int64, defaultp> i64vec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_integer.hpp b/vendor/glm/ext/vector_integer.hpp new file mode 100644 index 0000000000..1304dd8d66 --- /dev/null +++ b/vendor/glm/ext/vector_integer.hpp @@ -0,0 +1,149 @@ +/// @ref ext_vector_integer +/// @file glm/ext/vector_integer.hpp +/// +/// @see core (dependence) +/// @see ext_vector_integer (dependence) +/// +/// @defgroup ext_vector_integer GLM_EXT_vector_integer +/// @ingroup ext +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../vector_relational.hpp" +#include "../common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_integer + /// @{ + + /// Return true if the value is a power of two number. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isPowerOfTwo(vec const& v); + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextPowerOfTwo(vec const& v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevPowerOfTwo(vec const& v); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isMultiple(vec const& v, T Multiple); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isMultiple(vec const& v, vec const& Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextMultiple(vec const& v, T Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextMultiple(vec const& v, vec const& Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevMultiple(vec const& v, T Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevMultiple(vec const& v, vec const& Multiple); + + /// Returns the bit number of the Nth significant bit set to + /// 1 in the binary representation of value. + /// If value bitcount is less than the Nth significant bit, -1 will be returned. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec findNSB(vec const& Source, vec SignificantBitCount); + + /// @} +} //namespace glm + +#include "vector_integer.inl" diff --git a/vendor/glm/ext/vector_integer.inl b/vendor/glm/ext/vector_integer.inl new file mode 100644 index 0000000000..cefb132e23 --- /dev/null +++ b/vendor/glm/ext/vector_integer.inl @@ -0,0 +1,85 @@ +#include "scalar_integer.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec isPowerOfTwo(vec const& Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isPowerOfTwo' only accept integer inputs"); + + vec const Result(abs(Value)); + return equal(Result & (Result - vec(1)), vec(0)); + } + + template + GLM_FUNC_QUALIFIER vec nextPowerOfTwo(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextPowerOfTwo' only accept integer inputs"); + + return detail::compute_ceilPowerOfTwo::is_signed>::call(v); + } + + template + GLM_FUNC_QUALIFIER vec prevPowerOfTwo(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevPowerOfTwo' only accept integer inputs"); + + return detail::functor1::call(prevPowerOfTwo, v); + } + + template + GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return equal(Value % Multiple, vec(0)); + } + + template + GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return equal(Value % Multiple, vec(0)); + } + + template + GLM_FUNC_QUALIFIER vec nextMultiple(vec const& Source, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::functor2::call(nextMultiple, Source, vec(Multiple)); + } + + template + GLM_FUNC_QUALIFIER vec nextMultiple(vec const& Source, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::functor2::call(nextMultiple, Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec prevMultiple(vec const& Source, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::functor2::call(prevMultiple, Source, vec(Multiple)); + } + + template + GLM_FUNC_QUALIFIER vec prevMultiple(vec const& Source, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::functor2::call(prevMultiple, Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec findNSB(vec const& Source, vec SignificantBitCount) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findNSB' only accept integer inputs"); + + return detail::functor2_vec_int::call(findNSB, Source, SignificantBitCount); + } +}//namespace glm diff --git a/vendor/glm/ext/vector_packing.hpp b/vendor/glm/ext/vector_packing.hpp new file mode 100644 index 0000000000..76e5d0cc6c --- /dev/null +++ b/vendor/glm/ext/vector_packing.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_packing +/// @file glm/ext/vector_packing.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_vector_packing GLM_EXT_vector_packing +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// This extension provides a set of function to convert vectors to packed +/// formats. + +#pragma once + +// Dependency: +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_packing extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_packing + /// @{ + + + /// @} +}// namespace glm + +#include "vector_packing.inl" diff --git a/vendor/glm/ext/vector_packing.inl b/vendor/glm/ext/vector_packing.inl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vendor/glm/ext/vector_reciprocal.hpp b/vendor/glm/ext/vector_reciprocal.hpp new file mode 100644 index 0000000000..84d67662f2 --- /dev/null +++ b/vendor/glm/ext/vector_reciprocal.hpp @@ -0,0 +1,135 @@ +/// @ref ext_vector_reciprocal +/// @file glm/ext/vector_reciprocal.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_vector_reciprocal GLM_EXT_vector_reciprocal +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Define secant, cosecant and cotangent functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_reciprocal extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_reciprocal + /// @{ + + /// Secant function. + /// hypotenuse / adjacent or 1 / cos(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType sec(genType angle); + + /// Cosecant function. + /// hypotenuse / opposite or 1 / sin(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType csc(genType angle); + + /// Cotangent function. + /// adjacent / opposite or 1 / tan(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType cot(genType angle); + + /// Inverse secant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType asec(genType x); + + /// Inverse cosecant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType acsc(genType x); + + /// Inverse cotangent function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType acot(genType x); + + /// Secant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType sech(genType angle); + + /// Cosecant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType csch(genType angle); + + /// Cotangent hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType coth(genType angle); + + /// Inverse secant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType asech(genType x); + + /// Inverse cosecant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType acsch(genType x); + + /// Inverse cotangent hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType acoth(genType x); + + /// @} +}//namespace glm + +#include "vector_reciprocal.inl" diff --git a/vendor/glm/ext/vector_reciprocal.inl b/vendor/glm/ext/vector_reciprocal.inl new file mode 100644 index 0000000000..b85102a2f5 --- /dev/null +++ b/vendor/glm/ext/vector_reciprocal.inl @@ -0,0 +1,105 @@ +/// @ref ext_vector_reciprocal + +#include "../trigonometric.hpp" +#include + +namespace glm +{ + // sec + template + GLM_FUNC_QUALIFIER vec sec(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sec' only accept floating-point inputs"); + return static_cast(1) / detail::functor1::call(cos, x); + } + + // csc + template + GLM_FUNC_QUALIFIER vec csc(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csc' only accept floating-point inputs"); + return static_cast(1) / detail::functor1::call(sin, x); + } + + // cot + template + GLM_FUNC_QUALIFIER vec cot(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cot' only accept floating-point inputs"); + T const pi_over_2 = static_cast(3.1415926535897932384626433832795 / 2.0); + return detail::functor1::call(tan, pi_over_2 - x); + } + + // asec + template + GLM_FUNC_QUALIFIER vec asec(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asec' only accept floating-point inputs"); + return detail::functor1::call(acos, static_cast(1) / x); + } + + // acsc + template + GLM_FUNC_QUALIFIER vec acsc(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsc' only accept floating-point inputs"); + return detail::functor1::call(asin, static_cast(1) / x); + } + + // acot + template + GLM_FUNC_QUALIFIER vec acot(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acot' only accept floating-point inputs"); + T const pi_over_2 = static_cast(3.1415926535897932384626433832795 / 2.0); + return pi_over_2 - detail::functor1::call(atan, x); + } + + // sech + template + GLM_FUNC_QUALIFIER vec sech(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sech' only accept floating-point inputs"); + return static_cast(1) / detail::functor1::call(cosh, x); + } + + // csch + template + GLM_FUNC_QUALIFIER vec csch(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csch' only accept floating-point inputs"); + return static_cast(1) / detail::functor1::call(sinh, x); + } + + // coth + template + GLM_FUNC_QUALIFIER vec coth(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'coth' only accept floating-point inputs"); + return glm::cosh(x) / glm::sinh(x); + } + + // asech + template + GLM_FUNC_QUALIFIER vec asech(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asech' only accept floating-point inputs"); + return detail::functor1::call(acosh, static_cast(1) / x); + } + + // acsch + template + GLM_FUNC_QUALIFIER vec acsch(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsch' only accept floating-point inputs"); + return detail::functor1::call(asinh, static_cast(1) / x); + } + + // acoth + template + GLM_FUNC_QUALIFIER vec acoth(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acoth' only accept floating-point inputs"); + return detail::functor1::call(atanh, static_cast(1) / x); + } +}//namespace glm diff --git a/vendor/glm/ext/vector_relational.hpp b/vendor/glm/ext/vector_relational.hpp old mode 100755 new mode 100644 index e5cfa946f5..1c2367dc02 --- a/vendor/glm/ext/vector_relational.hpp +++ b/vendor/glm/ext/vector_relational.hpp @@ -2,21 +2,25 @@ /// @file glm/ext/vector_relational.hpp /// /// @see core (dependence) +/// @see ext_scalar_integer (dependence) /// /// @defgroup ext_vector_relational GLM_EXT_vector_relational /// @ingroup ext /// +/// Exposes comparison functions for vector types that take a user defined epsilon values. +/// /// Include to use the features of this extension. /// -/// Comparison functions for a user defined epsilon values. +/// @see core_vector_relational +/// @see ext_scalar_relational +/// @see ext_matrix_relational #pragma once // Dependencies -#include "../detail/setup.hpp" #include "../detail/qualifier.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_EXT_vector_relational extension included") #endif @@ -31,10 +35,8 @@ namespace glm /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_relational template - GLM_FUNC_DECL vec equal(vec const& x, vec const& y, T const& epsilon); + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, T epsilon); /// Returns the component-wise comparison of |x - y| < epsilon. /// True if this expression is satisfied. @@ -42,50 +44,62 @@ namespace glm /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_relational template - GLM_FUNC_DECL vec equal(vec const& x, vec const& y, vec const& epsilon); + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& epsilon); - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @tparam genType Floating-point or integer scalar types - /// - /// @see ext_vector_relational - template - GLM_FUNC_DECL bool equal(genType const& x, genType const& y, genType const& epsilon); - - /// Returns the component-wise comparison of |x - y| < epsilon. + /// Returns the component-wise comparison of |x - y| >= epsilon. /// True if this expression is not satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_relational template - GLM_FUNC_DECL vec notEqual(vec const& x, vec const& y, T const& epsilon); + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, T epsilon); - /// Returns the component-wise comparison of |x - y| < epsilon. + /// Returns the component-wise comparison of |x - y| >= epsilon. /// True if this expression is not satisfied. /// /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector /// @tparam T Floating-point or integer scalar types /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& epsilon); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. /// - /// @see ext_vector_relational + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum template - GLM_FUNC_DECL vec notEqual(vec const& x, vec const& y, vec const& epsilon); + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, int ULPs); - /// Returns the component-wise comparison of |x - y| >= epsilon. + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. /// True if this expression is not satisfied. /// - /// @tparam genType Floating-point or integer scalar types + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. /// - /// @see ext_vector_relational - template - GLM_FUNC_DECL bool notEqual(genType const& x, genType const& y, genType const& epsilon); + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& ULPs); /// @} }//namespace glm diff --git a/vendor/glm/ext/vector_relational.inl b/vendor/glm/ext/vector_relational.inl old mode 100755 new mode 100644 index 8532a022b3..8c50b2ff2a --- a/vendor/glm/ext/vector_relational.inl +++ b/vendor/glm/ext/vector_relational.inl @@ -1,46 +1,75 @@ -/// @ref ext_vector_relational -/// @file glm/ext/vector_relational.inl - -// Dependency: #include "../vector_relational.hpp" #include "../common.hpp" -#include "../detail/type_vec.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/type_float.hpp" namespace glm { - template - GLM_FUNC_QUALIFIER bool equal(genType const& x, genType const& y, genType const& epsilon) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, T Epsilon) + { + return equal(x, y, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& Epsilon) + { + return lessThanEqual(abs(x - y), Epsilon); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, T Epsilon) { - return abs(x - y) < epsilon; + return notEqual(x, y, vec(Epsilon)); } template - GLM_FUNC_QUALIFIER vec equal(vec const& x, vec const& y, T const& epsilon) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& Epsilon) { - return lessThan(abs(x - y), vec(epsilon)); + return greaterThan(abs(x - y), Epsilon); } + template - GLM_FUNC_QUALIFIER vec equal(vec const& x, vec const& y, vec const& epsilon) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, int MaxULPs) { - return lessThan(abs(x - y), epsilon); + return equal(x, y, vec(MaxULPs)); } - template - GLM_FUNC_QUALIFIER bool notEqual(genType const& x, genType const& y, genType const& epsilon) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& MaxULPs) { - return abs(x - y) >= epsilon; + vec Result(false); + for(length_t i = 0; i < L; ++i) + { + detail::float_t const a(x[i]); + detail::float_t const b(y[i]); + + // Different signs means they do not match. + if(a.negative() != b.negative()) + { + // Check for equality to make sure +0==-0 + Result[i] = a.mantissa() == b.mantissa() && a.exponent() == b.exponent(); + } + else + { + // Find the difference in ULPs. + typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); + Result[i] = DiffULPs <= MaxULPs[i]; + } + } + return Result; } template - GLM_FUNC_QUALIFIER vec notEqual(vec const& x, vec const& y, T const& epsilon) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, int MaxULPs) { - return greaterThanEqual(abs(x - y), vec(epsilon)); + return notEqual(x, y, vec(MaxULPs)); } template - GLM_FUNC_QUALIFIER vec notEqual(vec const& x, vec const& y, vec const& epsilon) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& MaxULPs) { - return greaterThanEqual(abs(x - y), epsilon); + return not_(equal(x, y, MaxULPs)); } }//namespace glm diff --git a/vendor/glm/ext/vector_uint1.hpp b/vendor/glm/ext/vector_uint1.hpp new file mode 100644 index 0000000000..eb8a704976 --- /dev/null +++ b/vendor/glm/ext/vector_uint1.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_uint1 +/// @file glm/ext/vector_uint1.hpp +/// +/// @defgroup ext_vector_uint1 GLM_EXT_vector_uint1 +/// @ingroup ext +/// +/// Exposes uvec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_int1 extension. +/// @see ext_vector_uint1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint1 + /// @{ + + /// 1 component vector of unsigned integer numbers. + typedef vec<1, unsigned int, defaultp> uvec1; + + /// @} +}//namespace glm + diff --git a/vendor/glm/ext/vector_uint1_sized.hpp b/vendor/glm/ext/vector_uint1_sized.hpp new file mode 100644 index 0000000000..2a938bbaf6 --- /dev/null +++ b/vendor/glm/ext/vector_uint1_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint1_sized +/// @file glm/ext/vector_uint1_sized.hpp +/// +/// @defgroup ext_vector_uint1_sized GLM_EXT_vector_uint1_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int1_sized + +#pragma once + +#include "../ext/vector_uint1.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint1_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint1_sized + /// @{ + + /// 8 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint8, defaultp> u8vec1; + + /// 16 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint16, defaultp> u16vec1; + + /// 32 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint32, defaultp> u32vec1; + + /// 64 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint64, defaultp> u64vec1; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_uint2.hpp b/vendor/glm/ext/vector_uint2.hpp new file mode 100644 index 0000000000..03c00f5ff5 --- /dev/null +++ b/vendor/glm/ext/vector_uint2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, unsigned int, defaultp> uvec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_uint2_sized.hpp b/vendor/glm/ext/vector_uint2_sized.hpp new file mode 100644 index 0000000000..620fdc6ece --- /dev/null +++ b/vendor/glm/ext/vector_uint2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint2_sized +/// @file glm/ext/vector_uint2_sized.hpp +/// +/// @defgroup ext_vector_uint2_sized GLM_EXT_vector_uint2_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 2 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int2_sized + +#pragma once + +#include "../ext/vector_uint2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint2_sized + /// @{ + + /// 8 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint8, defaultp> u8vec2; + + /// 16 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint16, defaultp> u16vec2; + + /// 32 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint32, defaultp> u32vec2; + + /// 64 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint64, defaultp> u64vec2; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_uint3.hpp b/vendor/glm/ext/vector_uint3.hpp new file mode 100644 index 0000000000..f5b41c4088 --- /dev/null +++ b/vendor/glm/ext/vector_uint3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, unsigned int, defaultp> uvec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_uint3_sized.hpp b/vendor/glm/ext/vector_uint3_sized.hpp new file mode 100644 index 0000000000..6f96b98e27 --- /dev/null +++ b/vendor/glm/ext/vector_uint3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint3_sized +/// @file glm/ext/vector_uint3_sized.hpp +/// +/// @defgroup ext_vector_uint3_sized GLM_EXT_vector_uint3_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 3 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int3_sized + +#pragma once + +#include "../ext/vector_uint3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint3_sized + /// @{ + + /// 8 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint8, defaultp> u8vec3; + + /// 16 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint16, defaultp> u16vec3; + + /// 32 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint32, defaultp> u32vec3; + + /// 64 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint64, defaultp> u64vec3; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_uint4.hpp b/vendor/glm/ext/vector_uint4.hpp new file mode 100644 index 0000000000..32ced58a8f --- /dev/null +++ b/vendor/glm/ext/vector_uint4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, unsigned int, defaultp> uvec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_uint4_sized.hpp b/vendor/glm/ext/vector_uint4_sized.hpp new file mode 100644 index 0000000000..da992ea2da --- /dev/null +++ b/vendor/glm/ext/vector_uint4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint4_sized +/// @file glm/ext/vector_uint4_sized.hpp +/// +/// @defgroup ext_vector_uint4_sized GLM_EXT_vector_uint4_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 4 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int4_sized + +#pragma once + +#include "../ext/vector_uint4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint4_sized + /// @{ + + /// 8 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint8, defaultp> u8vec4; + + /// 16 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint16, defaultp> u16vec4; + + /// 32 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint32, defaultp> u32vec4; + + /// 64 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint64, defaultp> u64vec4; + + /// @} +}//namespace glm diff --git a/vendor/glm/ext/vector_ulp.hpp b/vendor/glm/ext/vector_ulp.hpp new file mode 100644 index 0000000000..7c539bbf88 --- /dev/null +++ b/vendor/glm/ext/vector_ulp.hpp @@ -0,0 +1,112 @@ +/// @ref ext_vector_ulp +/// @file glm/ext/vector_ulp.hpp +/// +/// @defgroup ext_vector_ulp GLM_EXT_vector_ulp +/// @ingroup ext +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_ulp +/// @see ext_scalar_relational +/// @see ext_vector_relational + +#pragma once + +// Dependencies +#include "../ext/scalar_ulp.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_ulp extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_ulp + /// @{ + + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x, int ULPs); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x, vec const& ULPs); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x, vec const& ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec floatDistance(vec const& x, vec const& y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec floatDistance(vec const& x, vec const& y); + + /// @} +}//namespace glm + +#include "vector_ulp.inl" diff --git a/vendor/glm/ext/vector_ulp.inl b/vendor/glm/ext/vector_ulp.inl new file mode 100644 index 0000000000..d3c7648826 --- /dev/null +++ b/vendor/glm/ext/vector_ulp.inl @@ -0,0 +1,74 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x) + { + vec Result(0); + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, int ULPs) + { + vec Result(0); + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, vec const& ULPs) + { + vec Result(0); + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x) + { + vec Result(0); + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, int ULPs) + { + vec Result(0); + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, vec const& ULPs) + { + vec Result(0); + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) + { + vec Result(0); + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = floatDistance(x[i], y[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) + { + vec Result(0); + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = floatDistance(x[i], y[i]); + return Result; + } +}//namespace glm diff --git a/vendor/glm/fwd.hpp b/vendor/glm/fwd.hpp old mode 100755 new mode 100644 index 002fa5dfc5..9c2e5eafa4 --- a/vendor/glm/fwd.hpp +++ b/vendor/glm/fwd.hpp @@ -1,2572 +1,1233 @@ -/// @ref core -/// @file glm/fwd.hpp - -#include "detail/setup.hpp" - #pragma once -#include "detail/type_int.hpp" -#include "detail/type_float.hpp" -#include "detail/type_vec.hpp" -#include "detail/type_mat.hpp" - -////////////////////// -// GLM_GTC_quaternion -namespace glm -{ - template struct tquat; - - /// Quaternion of low single-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat lowp_quat; - - /// Quaternion of medium single-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat mediump_quat; - - /// Quaternion of high single-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat highp_quat; - -#if(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef highp_quat quat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_quat quat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_quat quat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - /// Quaternion of default single-qualifier floating-point numbers. - typedef highp_quat quat; -#endif - - /// Quaternion of low single-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef lowp_quat lowp_fquat; - - /// Quaternion of medium single-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef mediump_quat mediump_fquat; - - /// Quaternion of high single-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef highp_quat highp_fquat; - - /// Quaternion of default single-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef quat fquat; - - - /// Quaternion of low double-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat lowp_dquat; - - /// Quaternion of medium double-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat mediump_dquat; - - /// Quaternion of high double-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef tquat highp_dquat; - -#if(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef highp_dquat dquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef mediump_dquat dquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_dquat dquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - /// Quaternion of default double-qualifier floating-point numbers. - /// - /// @see gtc_quaternion - typedef highp_dquat dquat; -#endif - -}//namespace glm +#include "detail/qualifier.hpp" -////////////////////// -// GLM_GTC_precision namespace glm { - /// Low qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_int8; - - /// Low qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_int16; - - /// Low qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_int32; - - /// Low qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_int64; - - /// Low qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_int8_t; - - /// Low qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_int16_t; - - /// Low qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_int32_t; - - /// Low qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_int64_t; - - /// Low qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_i8; - - /// Low qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_i16; - - /// Low qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_i32; - - /// Low qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_i64; - - /// Medium qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_int8; - - /// Medium qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_int16; - - /// Medium qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_int32; - - /// Medium qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_int64; - - /// Medium qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_int8_t; - - /// Medium qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_int16_t; - - /// Medium qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_int32_t; - - /// Medium qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_int64_t; - - /// Medium qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_i8; - - /// Medium qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_i16; - - /// Medium qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_i32; - - /// Medium qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_i64; - - /// High qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_int8; - - /// High qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_int16; - - /// High qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_int32; - - /// High qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_int64; - - /// High qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_int8_t; - - /// High qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_int16_t; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_int32_t; - - /// High qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_int64_t; - - /// High qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_i8; - - /// High qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_i16; - - /// High qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_i32; - - /// High qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_i64; - - - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 int8; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 int16; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 int32; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 int64; - - #if GLM_HAS_EXTENDED_INTEGER_TYPE - using std::int8_t; - using std::int16_t; - using std::int32_t; - using std::int64_t; -#else - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 int8_t; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 int16_t; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 int32_t; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 int64_t; -#endif - - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 i8; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 i16; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 i32; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 i64; - - - - /// Low qualifier 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i8, lowp> lowp_i8vec1; - - /// Low qualifier 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i8, lowp> lowp_i8vec2; - - /// Low qualifier 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i8, lowp> lowp_i8vec3; - - /// Low qualifier 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i8, lowp> lowp_i8vec4; - - - /// Medium qualifier 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i8, mediump> mediump_i8vec1; - - /// Medium qualifier 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i8, mediump> mediump_i8vec2; - - /// Medium qualifier 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i8, mediump> mediump_i8vec3; - - /// Medium qualifier 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i8, mediump> mediump_i8vec4; - - - /// High qualifier 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i8, highp> highp_i8vec1; - - /// High qualifier 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i8, highp> highp_i8vec2; - - /// High qualifier 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i8, highp> highp_i8vec3; - - /// High qualifier 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i8, highp> highp_i8vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i8vec1 i8vec1; - typedef lowp_i8vec2 i8vec2; - typedef lowp_i8vec3 i8vec3; - typedef lowp_i8vec4 i8vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i8vec1 i8vec1; - typedef mediump_i8vec2 i8vec2; - typedef mediump_i8vec3 i8vec3; - typedef mediump_i8vec4 i8vec4; + typedef std::int8_t int8; + typedef std::int16_t int16; + typedef std::int32_t int32; + typedef std::int64_t int64; + + typedef std::uint8_t uint8; + typedef std::uint16_t uint16; + typedef std::uint32_t uint32; + typedef std::uint64_t uint64; #else - /// Default qualifier 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i8vec1 i8vec1; - - /// Default qualifier 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i8vec2 i8vec2; - - /// Default qualifier 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i8vec3 i8vec3; - - /// Default qualifier 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i8vec4 i8vec4; + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; + typedef detail::int64 int64; + + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; + typedef detail::uint64 uint64; #endif + // Scalar int + + typedef int8 lowp_i8; + typedef int8 mediump_i8; + typedef int8 highp_i8; + typedef int8 i8; + + typedef int8 lowp_int8; + typedef int8 mediump_int8; + typedef int8 highp_int8; + + typedef int8 lowp_int8_t; + typedef int8 mediump_int8_t; + typedef int8 highp_int8_t; + typedef int8 int8_t; + + typedef int16 lowp_i16; + typedef int16 mediump_i16; + typedef int16 highp_i16; + typedef int16 i16; + + typedef int16 lowp_int16; + typedef int16 mediump_int16; + typedef int16 highp_int16; + + typedef int16 lowp_int16_t; + typedef int16 mediump_int16_t; + typedef int16 highp_int16_t; + typedef int16 int16_t; + + typedef int32 lowp_i32; + typedef int32 mediump_i32; + typedef int32 highp_i32; + typedef int32 i32; + + typedef int32 lowp_int32; + typedef int32 mediump_int32; + typedef int32 highp_int32; + + typedef int32 lowp_int32_t; + typedef int32 mediump_int32_t; + typedef int32 highp_int32_t; + typedef int32 int32_t; + + typedef int64 lowp_i64; + typedef int64 mediump_i64; + typedef int64 highp_i64; + typedef int64 i64; + + typedef int64 lowp_int64; + typedef int64 mediump_int64; + typedef int64 highp_int64; + + typedef int64 lowp_int64_t; + typedef int64 mediump_int64_t; + typedef int64 highp_int64_t; + typedef int64 int64_t; + + // Scalar uint + + typedef unsigned int uint; + + typedef uint8 lowp_u8; + typedef uint8 mediump_u8; + typedef uint8 highp_u8; + typedef uint8 u8; + + typedef uint8 lowp_uint8; + typedef uint8 mediump_uint8; + typedef uint8 highp_uint8; + + typedef uint8 lowp_uint8_t; + typedef uint8 mediump_uint8_t; + typedef uint8 highp_uint8_t; + typedef uint8 uint8_t; + + typedef uint16 lowp_u16; + typedef uint16 mediump_u16; + typedef uint16 highp_u16; + typedef uint16 u16; + + typedef uint16 lowp_uint16; + typedef uint16 mediump_uint16; + typedef uint16 highp_uint16; + + typedef uint16 lowp_uint16_t; + typedef uint16 mediump_uint16_t; + typedef uint16 highp_uint16_t; + typedef uint16 uint16_t; + + typedef uint32 lowp_u32; + typedef uint32 mediump_u32; + typedef uint32 highp_u32; + typedef uint32 u32; + + typedef uint32 lowp_uint32; + typedef uint32 mediump_uint32; + typedef uint32 highp_uint32; + + typedef uint32 lowp_uint32_t; + typedef uint32 mediump_uint32_t; + typedef uint32 highp_uint32_t; + typedef uint32 uint32_t; + + typedef uint64 lowp_u64; + typedef uint64 mediump_u64; + typedef uint64 highp_u64; + typedef uint64 u64; + + typedef uint64 lowp_uint64; + typedef uint64 mediump_uint64; + typedef uint64 highp_uint64; + + typedef uint64 lowp_uint64_t; + typedef uint64 mediump_uint64_t; + typedef uint64 highp_uint64_t; + typedef uint64 uint64_t; + + // Scalar float + + typedef float lowp_f32; + typedef float mediump_f32; + typedef float highp_f32; + typedef float f32; + + typedef float lowp_float32; + typedef float mediump_float32; + typedef float highp_float32; + typedef float float32; + + typedef float lowp_float32_t; + typedef float mediump_float32_t; + typedef float highp_float32_t; + typedef float float32_t; + + + typedef double lowp_f64; + typedef double mediump_f64; + typedef double highp_f64; + typedef double f64; + + typedef double lowp_float64; + typedef double mediump_float64; + typedef double highp_float64; + typedef double float64; + + typedef double lowp_float64_t; + typedef double mediump_float64_t; + typedef double highp_float64_t; + typedef double float64_t; + + // Vector bool + + typedef vec<1, bool, lowp> lowp_bvec1; + typedef vec<2, bool, lowp> lowp_bvec2; + typedef vec<3, bool, lowp> lowp_bvec3; + typedef vec<4, bool, lowp> lowp_bvec4; + + typedef vec<1, bool, mediump> mediump_bvec1; + typedef vec<2, bool, mediump> mediump_bvec2; + typedef vec<3, bool, mediump> mediump_bvec3; + typedef vec<4, bool, mediump> mediump_bvec4; + + typedef vec<1, bool, highp> highp_bvec1; + typedef vec<2, bool, highp> highp_bvec2; + typedef vec<3, bool, highp> highp_bvec3; + typedef vec<4, bool, highp> highp_bvec4; + + typedef vec<1, bool, defaultp> bvec1; + typedef vec<2, bool, defaultp> bvec2; + typedef vec<3, bool, defaultp> bvec3; + typedef vec<4, bool, defaultp> bvec4; + + // Vector int + + typedef vec<1, int, lowp> lowp_ivec1; + typedef vec<2, int, lowp> lowp_ivec2; + typedef vec<3, int, lowp> lowp_ivec3; + typedef vec<4, int, lowp> lowp_ivec4; + + typedef vec<1, int, mediump> mediump_ivec1; + typedef vec<2, int, mediump> mediump_ivec2; + typedef vec<3, int, mediump> mediump_ivec3; + typedef vec<4, int, mediump> mediump_ivec4; + + typedef vec<1, int, highp> highp_ivec1; + typedef vec<2, int, highp> highp_ivec2; + typedef vec<3, int, highp> highp_ivec3; + typedef vec<4, int, highp> highp_ivec4; + + typedef vec<1, int, defaultp> ivec1; + typedef vec<2, int, defaultp> ivec2; + typedef vec<3, int, defaultp> ivec3; + typedef vec<4, int, defaultp> ivec4; + + typedef vec<1, i8, lowp> lowp_i8vec1; + typedef vec<2, i8, lowp> lowp_i8vec2; + typedef vec<3, i8, lowp> lowp_i8vec3; + typedef vec<4, i8, lowp> lowp_i8vec4; + + typedef vec<1, i8, mediump> mediump_i8vec1; + typedef vec<2, i8, mediump> mediump_i8vec2; + typedef vec<3, i8, mediump> mediump_i8vec3; + typedef vec<4, i8, mediump> mediump_i8vec4; + + typedef vec<1, i8, highp> highp_i8vec1; + typedef vec<2, i8, highp> highp_i8vec2; + typedef vec<3, i8, highp> highp_i8vec3; + typedef vec<4, i8, highp> highp_i8vec4; + + typedef vec<1, i8, defaultp> i8vec1; + typedef vec<2, i8, defaultp> i8vec2; + typedef vec<3, i8, defaultp> i8vec3; + typedef vec<4, i8, defaultp> i8vec4; - /// Low qualifier 16 bit signed integer scalar type. - /// @see gtc_type_precision typedef vec<1, i16, lowp> lowp_i16vec1; - - /// Low qualifier 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision typedef vec<2, i16, lowp> lowp_i16vec2; - - /// Low qualifier 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision typedef vec<3, i16, lowp> lowp_i16vec3; - - /// Low qualifier 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision typedef vec<4, i16, lowp> lowp_i16vec4; + typedef vec<1, i16, mediump> mediump_i16vec1; + typedef vec<2, i16, mediump> mediump_i16vec2; + typedef vec<3, i16, mediump> mediump_i16vec3; + typedef vec<4, i16, mediump> mediump_i16vec4; - /// Medium qualifier 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i16, mediump> mediump_i16vec1; - - /// Medium qualifier 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i16, mediump> mediump_i16vec2; - - /// Medium qualifier 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i16, mediump> mediump_i16vec3; - - /// Medium qualifier 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i16, mediump> mediump_i16vec4; - - - /// High qualifier 16 bit signed integer scalar type. - /// @see gtc_type_precision typedef vec<1, i16, highp> highp_i16vec1; - - /// High qualifier 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision typedef vec<2, i16, highp> highp_i16vec2; - - /// High qualifier 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision typedef vec<3, i16, highp> highp_i16vec3; - - /// High qualifier 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision typedef vec<4, i16, highp> highp_i16vec4; + typedef vec<1, i16, defaultp> i16vec1; + typedef vec<2, i16, defaultp> i16vec2; + typedef vec<3, i16, defaultp> i16vec3; + typedef vec<4, i16, defaultp> i16vec4; -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i16vec1 i16vec1; - typedef lowp_i16vec2 i16vec2; - typedef lowp_i16vec3 i16vec3; - typedef lowp_i16vec4 i16vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i16vec1 i16vec1; - typedef mediump_i16vec2 i16vec2; - typedef mediump_i16vec3 i16vec3; - typedef mediump_i16vec4 i16vec4; -#else - /// Default qualifier 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i16vec1 i16vec1; - - /// Default qualifier 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i16vec2 i16vec2; - - /// Default qualifier 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i16vec3 i16vec3; - - /// Default qualifier 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i16vec4 i16vec4; -#endif - - - /// Low qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i32, lowp> lowp_i32vec1; - - /// Low qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i32, lowp> lowp_i32vec2; - - /// Low qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i32, lowp> lowp_i32vec3; - - /// Low qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i32, lowp> lowp_i32vec4; - - - /// Medium qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i32, mediump> mediump_i32vec1; - - /// Medium qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i32, mediump> mediump_i32vec2; - - /// Medium qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i32, mediump> mediump_i32vec3; - - /// Medium qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i32, mediump> mediump_i32vec4; - - - /// High qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i32, highp> highp_i32vec1; - - /// High qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i32, highp> highp_i32vec2; - - /// High qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i32, highp> highp_i32vec3; - - /// High qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i32, highp> highp_i32vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i32vec1 i32vec1; - typedef lowp_i32vec2 i32vec2; - typedef lowp_i32vec3 i32vec3; - typedef lowp_i32vec4 i32vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i32vec1 i32vec1; - typedef mediump_i32vec2 i32vec2; - typedef mediump_i32vec3 i32vec3; - typedef mediump_i32vec4 i32vec4; -#else - /// Default qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i32vec1 i32vec1; - - /// Default qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i32vec2 i32vec2; - - /// Default qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i32vec3 i32vec3; - - /// Default qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i32vec4 i32vec4; -#endif - - - /// Low qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision typedef vec<1, i32, lowp> lowp_i32vec1; - - /// Low qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision typedef vec<2, i32, lowp> lowp_i32vec2; - - /// Low qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision typedef vec<3, i32, lowp> lowp_i32vec3; - - /// Low qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision typedef vec<4, i32, lowp> lowp_i32vec4; + typedef vec<1, i32, mediump> mediump_i32vec1; + typedef vec<2, i32, mediump> mediump_i32vec2; + typedef vec<3, i32, mediump> mediump_i32vec3; + typedef vec<4, i32, mediump> mediump_i32vec4; - /// Medium qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i32, mediump> mediump_i32vec1; - - /// Medium qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i32, mediump> mediump_i32vec2; - - /// Medium qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i32, mediump> mediump_i32vec3; - - /// Medium qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i32, mediump> mediump_i32vec4; - - - /// High qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision typedef vec<1, i32, highp> highp_i32vec1; - - /// High qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision typedef vec<2, i32, highp> highp_i32vec2; - - /// High qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision typedef vec<3, i32, highp> highp_i32vec3; - - /// High qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision typedef vec<4, i32, highp> highp_i32vec4; -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i32vec1 i32vec1; - typedef lowp_i32vec2 i32vec2; - typedef lowp_i32vec3 i32vec3; - typedef lowp_i32vec4 i32vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i32vec1 i32vec1; - typedef mediump_i32vec2 i32vec2; - typedef mediump_i32vec3 i32vec3; - typedef mediump_i32vec4 i32vec4; -#else - /// Default qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i32vec1 i32vec1; - - /// Default qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i32vec2 i32vec2; - - /// Default qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i32vec3 i32vec3; - - /// Default qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i32vec4 i32vec4; -#endif - - + typedef vec<1, i32, defaultp> i32vec1; + typedef vec<2, i32, defaultp> i32vec2; + typedef vec<3, i32, defaultp> i32vec3; + typedef vec<4, i32, defaultp> i32vec4; - /// Low qualifier 64 bit signed integer scalar type. - /// @see gtc_type_precision typedef vec<1, i64, lowp> lowp_i64vec1; - - /// Low qualifier 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision typedef vec<2, i64, lowp> lowp_i64vec2; - - /// Low qualifier 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision typedef vec<3, i64, lowp> lowp_i64vec3; - - /// Low qualifier 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision typedef vec<4, i64, lowp> lowp_i64vec4; + typedef vec<1, i64, mediump> mediump_i64vec1; + typedef vec<2, i64, mediump> mediump_i64vec2; + typedef vec<3, i64, mediump> mediump_i64vec3; + typedef vec<4, i64, mediump> mediump_i64vec4; - /// Medium qualifier 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i64, mediump> mediump_i64vec1; - - /// Medium qualifier 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i64, mediump> mediump_i64vec2; - - /// Medium qualifier 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i64, mediump> mediump_i64vec3; - - /// Medium qualifier 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i64, mediump> mediump_i64vec4; - - - /// High qualifier 64 bit signed integer scalar type. - /// @see gtc_type_precision typedef vec<1, i64, highp> highp_i64vec1; - - /// High qualifier 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision typedef vec<2, i64, highp> highp_i64vec2; - - /// High qualifier 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision typedef vec<3, i64, highp> highp_i64vec3; - - /// High qualifier 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision typedef vec<4, i64, highp> highp_i64vec4; -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_i64vec1 i64vec1; - typedef lowp_i64vec2 i64vec2; - typedef lowp_i64vec3 i64vec3; - typedef lowp_i64vec4 i64vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_i64vec1 i64vec1; - typedef mediump_i64vec2 i64vec2; - typedef mediump_i64vec3 i64vec3; - typedef mediump_i64vec4 i64vec4; -#else - /// Default qualifier 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef highp_i64vec1 i64vec1; - - /// Default qualifier 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_i64vec2 i64vec2; - - /// Default qualifier 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_i64vec3 i64vec3; - - /// Default qualifier 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_i64vec4 i64vec4; -#endif - - - ///////////////////////////// - // Unsigned int vector types - - /// Low qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_uint8; - - /// Low qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_uint16; - - /// Low qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_uint32; - - /// Low qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_uint64; - - - /// Low qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_uint8_t; - - /// Low qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_uint16_t; - - /// Low qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_uint32_t; - - /// Low qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_uint64_t; - - - /// Low qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_u8; - - /// Low qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_u16; - - /// Low qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_u32; - - /// Low qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_u64; - - - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_uint8; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_uint16; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_uint32; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_uint64; - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_uint8_t; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_uint16_t; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_uint32_t; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_uint64_t; - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_u8; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_u16; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_u32; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_u64; - - - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_uint8; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_uint16; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_uint32; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_uint64; - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_uint8_t; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_uint16_t; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_uint32_t; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_uint64_t; - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_u8; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_u16; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_u32; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_u64; - - - - /// 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 uint8; - - /// 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 uint16; - - /// 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 uint32; - - /// 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 uint64; - -#if GLM_HAS_EXTENDED_INTEGER_TYPE - using std::uint8_t; - using std::uint16_t; - using std::uint32_t; - using std::uint64_t; -#else - /// 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 uint8_t; - - /// 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 uint16_t; - - /// 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 uint32_t; - - /// 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 uint64_t; -#endif - - /// 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 u8; - - /// 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 u16; - - /// 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 u32; - - /// 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 u64; - - - - /// Low qualifier 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u8, lowp> lowp_u8vec1; - - /// Low qualifier 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u8, lowp> lowp_u8vec2; - - /// Low qualifier 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u8, lowp> lowp_u8vec3; - - /// Low qualifier 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u8, lowp> lowp_u8vec4; + typedef vec<1, i64, defaultp> i64vec1; + typedef vec<2, i64, defaultp> i64vec2; + typedef vec<3, i64, defaultp> i64vec3; + typedef vec<4, i64, defaultp> i64vec4; + + // Vector uint + + typedef vec<1, uint, lowp> lowp_uvec1; + typedef vec<2, uint, lowp> lowp_uvec2; + typedef vec<3, uint, lowp> lowp_uvec3; + typedef vec<4, uint, lowp> lowp_uvec4; + + typedef vec<1, uint, mediump> mediump_uvec1; + typedef vec<2, uint, mediump> mediump_uvec2; + typedef vec<3, uint, mediump> mediump_uvec3; + typedef vec<4, uint, mediump> mediump_uvec4; + + typedef vec<1, uint, highp> highp_uvec1; + typedef vec<2, uint, highp> highp_uvec2; + typedef vec<3, uint, highp> highp_uvec3; + typedef vec<4, uint, highp> highp_uvec4; + + typedef vec<1, uint, defaultp> uvec1; + typedef vec<2, uint, defaultp> uvec2; + typedef vec<3, uint, defaultp> uvec3; + typedef vec<4, uint, defaultp> uvec4; + + typedef vec<1, u8, lowp> lowp_u8vec1; + typedef vec<2, u8, lowp> lowp_u8vec2; + typedef vec<3, u8, lowp> lowp_u8vec3; + typedef vec<4, u8, lowp> lowp_u8vec4; + + typedef vec<1, u8, mediump> mediump_u8vec1; + typedef vec<2, u8, mediump> mediump_u8vec2; + typedef vec<3, u8, mediump> mediump_u8vec3; + typedef vec<4, u8, mediump> mediump_u8vec4; + + typedef vec<1, u8, highp> highp_u8vec1; + typedef vec<2, u8, highp> highp_u8vec2; + typedef vec<3, u8, highp> highp_u8vec3; + typedef vec<4, u8, highp> highp_u8vec4; + + typedef vec<1, u8, defaultp> u8vec1; + typedef vec<2, u8, defaultp> u8vec2; + typedef vec<3, u8, defaultp> u8vec3; + typedef vec<4, u8, defaultp> u8vec4; + typedef vec<1, u16, lowp> lowp_u16vec1; + typedef vec<2, u16, lowp> lowp_u16vec2; + typedef vec<3, u16, lowp> lowp_u16vec3; + typedef vec<4, u16, lowp> lowp_u16vec4; - /// Medium qualifier 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u8, mediump> mediump_u8vec1; + typedef vec<1, u16, mediump> mediump_u16vec1; + typedef vec<2, u16, mediump> mediump_u16vec2; + typedef vec<3, u16, mediump> mediump_u16vec3; + typedef vec<4, u16, mediump> mediump_u16vec4; - /// Medium qualifier 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u8, mediump> mediump_u8vec2; + typedef vec<1, u16, highp> highp_u16vec1; + typedef vec<2, u16, highp> highp_u16vec2; + typedef vec<3, u16, highp> highp_u16vec3; + typedef vec<4, u16, highp> highp_u16vec4; - /// Medium qualifier 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u8, mediump> mediump_u8vec3; + typedef vec<1, u16, defaultp> u16vec1; + typedef vec<2, u16, defaultp> u16vec2; + typedef vec<3, u16, defaultp> u16vec3; + typedef vec<4, u16, defaultp> u16vec4; - /// Medium qualifier 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u8, mediump> mediump_u8vec4; + typedef vec<1, u32, lowp> lowp_u32vec1; + typedef vec<2, u32, lowp> lowp_u32vec2; + typedef vec<3, u32, lowp> lowp_u32vec3; + typedef vec<4, u32, lowp> lowp_u32vec4; + typedef vec<1, u32, mediump> mediump_u32vec1; + typedef vec<2, u32, mediump> mediump_u32vec2; + typedef vec<3, u32, mediump> mediump_u32vec3; + typedef vec<4, u32, mediump> mediump_u32vec4; - /// High qualifier 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u8, highp> highp_u8vec1; + typedef vec<1, u32, highp> highp_u32vec1; + typedef vec<2, u32, highp> highp_u32vec2; + typedef vec<3, u32, highp> highp_u32vec3; + typedef vec<4, u32, highp> highp_u32vec4; - /// High qualifier 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u8, highp> highp_u8vec2; + typedef vec<1, u32, defaultp> u32vec1; + typedef vec<2, u32, defaultp> u32vec2; + typedef vec<3, u32, defaultp> u32vec3; + typedef vec<4, u32, defaultp> u32vec4; - /// High qualifier 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u8, highp> highp_u8vec3; + typedef vec<1, u64, lowp> lowp_u64vec1; + typedef vec<2, u64, lowp> lowp_u64vec2; + typedef vec<3, u64, lowp> lowp_u64vec3; + typedef vec<4, u64, lowp> lowp_u64vec4; - /// High qualifier 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u8, highp> highp_u8vec4; + typedef vec<1, u64, mediump> mediump_u64vec1; + typedef vec<2, u64, mediump> mediump_u64vec2; + typedef vec<3, u64, mediump> mediump_u64vec3; + typedef vec<4, u64, mediump> mediump_u64vec4; -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_u8vec1 u8vec1; - typedef lowp_u8vec2 u8vec2; - typedef lowp_u8vec3 u8vec3; - typedef lowp_u8vec4 u8vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_u8vec1 u8vec1; - typedef mediump_u8vec2 u8vec2; - typedef mediump_u8vec3 u8vec3; - typedef mediump_u8vec4 u8vec4; -#else - /// Default qualifier 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u8vec1 u8vec1; + typedef vec<1, u64, highp> highp_u64vec1; + typedef vec<2, u64, highp> highp_u64vec2; + typedef vec<3, u64, highp> highp_u64vec3; + typedef vec<4, u64, highp> highp_u64vec4; - /// Default qualifier 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u8vec2 u8vec2; + typedef vec<1, u64, defaultp> u64vec1; + typedef vec<2, u64, defaultp> u64vec2; + typedef vec<3, u64, defaultp> u64vec3; + typedef vec<4, u64, defaultp> u64vec4; + + // Vector float + + typedef vec<1, float, lowp> lowp_vec1; + typedef vec<2, float, lowp> lowp_vec2; + typedef vec<3, float, lowp> lowp_vec3; + typedef vec<4, float, lowp> lowp_vec4; + + typedef vec<1, float, mediump> mediump_vec1; + typedef vec<2, float, mediump> mediump_vec2; + typedef vec<3, float, mediump> mediump_vec3; + typedef vec<4, float, mediump> mediump_vec4; + + typedef vec<1, float, highp> highp_vec1; + typedef vec<2, float, highp> highp_vec2; + typedef vec<3, float, highp> highp_vec3; + typedef vec<4, float, highp> highp_vec4; + + typedef vec<1, float, defaultp> vec1; + typedef vec<2, float, defaultp> vec2; + typedef vec<3, float, defaultp> vec3; + typedef vec<4, float, defaultp> vec4; + + typedef vec<1, float, lowp> lowp_fvec1; + typedef vec<2, float, lowp> lowp_fvec2; + typedef vec<3, float, lowp> lowp_fvec3; + typedef vec<4, float, lowp> lowp_fvec4; + + typedef vec<1, float, mediump> mediump_fvec1; + typedef vec<2, float, mediump> mediump_fvec2; + typedef vec<3, float, mediump> mediump_fvec3; + typedef vec<4, float, mediump> mediump_fvec4; + + typedef vec<1, float, highp> highp_fvec1; + typedef vec<2, float, highp> highp_fvec2; + typedef vec<3, float, highp> highp_fvec3; + typedef vec<4, float, highp> highp_fvec4; + + typedef vec<1, f32, defaultp> fvec1; + typedef vec<2, f32, defaultp> fvec2; + typedef vec<3, f32, defaultp> fvec3; + typedef vec<4, f32, defaultp> fvec4; + + typedef vec<1, f32, lowp> lowp_f32vec1; + typedef vec<2, f32, lowp> lowp_f32vec2; + typedef vec<3, f32, lowp> lowp_f32vec3; + typedef vec<4, f32, lowp> lowp_f32vec4; + + typedef vec<1, f32, mediump> mediump_f32vec1; + typedef vec<2, f32, mediump> mediump_f32vec2; + typedef vec<3, f32, mediump> mediump_f32vec3; + typedef vec<4, f32, mediump> mediump_f32vec4; + + typedef vec<1, f32, highp> highp_f32vec1; + typedef vec<2, f32, highp> highp_f32vec2; + typedef vec<3, f32, highp> highp_f32vec3; + typedef vec<4, f32, highp> highp_f32vec4; + + typedef vec<1, f32, defaultp> f32vec1; + typedef vec<2, f32, defaultp> f32vec2; + typedef vec<3, f32, defaultp> f32vec3; + typedef vec<4, f32, defaultp> f32vec4; + + typedef vec<1, f64, lowp> lowp_dvec1; + typedef vec<2, f64, lowp> lowp_dvec2; + typedef vec<3, f64, lowp> lowp_dvec3; + typedef vec<4, f64, lowp> lowp_dvec4; + + typedef vec<1, f64, mediump> mediump_dvec1; + typedef vec<2, f64, mediump> mediump_dvec2; + typedef vec<3, f64, mediump> mediump_dvec3; + typedef vec<4, f64, mediump> mediump_dvec4; + + typedef vec<1, f64, highp> highp_dvec1; + typedef vec<2, f64, highp> highp_dvec2; + typedef vec<3, f64, highp> highp_dvec3; + typedef vec<4, f64, highp> highp_dvec4; + + typedef vec<1, f64, defaultp> dvec1; + typedef vec<2, f64, defaultp> dvec2; + typedef vec<3, f64, defaultp> dvec3; + typedef vec<4, f64, defaultp> dvec4; + + typedef vec<1, f64, lowp> lowp_f64vec1; + typedef vec<2, f64, lowp> lowp_f64vec2; + typedef vec<3, f64, lowp> lowp_f64vec3; + typedef vec<4, f64, lowp> lowp_f64vec4; + + typedef vec<1, f64, mediump> mediump_f64vec1; + typedef vec<2, f64, mediump> mediump_f64vec2; + typedef vec<3, f64, mediump> mediump_f64vec3; + typedef vec<4, f64, mediump> mediump_f64vec4; + + typedef vec<1, f64, highp> highp_f64vec1; + typedef vec<2, f64, highp> highp_f64vec2; + typedef vec<3, f64, highp> highp_f64vec3; + typedef vec<4, f64, highp> highp_f64vec4; + + typedef vec<1, f64, defaultp> f64vec1; + typedef vec<2, f64, defaultp> f64vec2; + typedef vec<3, f64, defaultp> f64vec3; + typedef vec<4, f64, defaultp> f64vec4; + + // Matrix NxN + + typedef mat<2, 2, f32, lowp> lowp_mat2; + typedef mat<3, 3, f32, lowp> lowp_mat3; + typedef mat<4, 4, f32, lowp> lowp_mat4; + + typedef mat<2, 2, f32, mediump> mediump_mat2; + typedef mat<3, 3, f32, mediump> mediump_mat3; + typedef mat<4, 4, f32, mediump> mediump_mat4; + + typedef mat<2, 2, f32, highp> highp_mat2; + typedef mat<3, 3, f32, highp> highp_mat3; + typedef mat<4, 4, f32, highp> highp_mat4; + + typedef mat<2, 2, f32, defaultp> mat2; + typedef mat<3, 3, f32, defaultp> mat3; + typedef mat<4, 4, f32, defaultp> mat4; + + typedef mat<2, 2, f32, lowp> lowp_fmat2; + typedef mat<3, 3, f32, lowp> lowp_fmat3; + typedef mat<4, 4, f32, lowp> lowp_fmat4; + + typedef mat<2, 2, f32, mediump> mediump_fmat2; + typedef mat<3, 3, f32, mediump> mediump_fmat3; + typedef mat<4, 4, f32, mediump> mediump_fmat4; + + typedef mat<2, 2, f32, highp> highp_fmat2; + typedef mat<3, 3, f32, highp> highp_fmat3; + typedef mat<4, 4, f32, highp> highp_fmat4; + + typedef mat<2, 2, f32, defaultp> fmat2; + typedef mat<3, 3, f32, defaultp> fmat3; + typedef mat<4, 4, f32, defaultp> fmat4; + + typedef mat<2, 2, f32, lowp> lowp_f32mat2; + typedef mat<3, 3, f32, lowp> lowp_f32mat3; + typedef mat<4, 4, f32, lowp> lowp_f32mat4; + + typedef mat<2, 2, f32, mediump> mediump_f32mat2; + typedef mat<3, 3, f32, mediump> mediump_f32mat3; + typedef mat<4, 4, f32, mediump> mediump_f32mat4; + + typedef mat<2, 2, f32, highp> highp_f32mat2; + typedef mat<3, 3, f32, highp> highp_f32mat3; + typedef mat<4, 4, f32, highp> highp_f32mat4; + + typedef mat<2, 2, f32, defaultp> f32mat2; + typedef mat<3, 3, f32, defaultp> f32mat3; + typedef mat<4, 4, f32, defaultp> f32mat4; + + typedef mat<2, 2, f64, lowp> lowp_dmat2; + typedef mat<3, 3, f64, lowp> lowp_dmat3; + typedef mat<4, 4, f64, lowp> lowp_dmat4; + + typedef mat<2, 2, f64, mediump> mediump_dmat2; + typedef mat<3, 3, f64, mediump> mediump_dmat3; + typedef mat<4, 4, f64, mediump> mediump_dmat4; + + typedef mat<2, 2, f64, highp> highp_dmat2; + typedef mat<3, 3, f64, highp> highp_dmat3; + typedef mat<4, 4, f64, highp> highp_dmat4; + + typedef mat<2, 2, f64, defaultp> dmat2; + typedef mat<3, 3, f64, defaultp> dmat3; + typedef mat<4, 4, f64, defaultp> dmat4; + + typedef mat<2, 2, f64, lowp> lowp_f64mat2; + typedef mat<3, 3, f64, lowp> lowp_f64mat3; + typedef mat<4, 4, f64, lowp> lowp_f64mat4; + + typedef mat<2, 2, f64, mediump> mediump_f64mat2; + typedef mat<3, 3, f64, mediump> mediump_f64mat3; + typedef mat<4, 4, f64, mediump> mediump_f64mat4; + + typedef mat<2, 2, f64, highp> highp_f64mat2; + typedef mat<3, 3, f64, highp> highp_f64mat3; + typedef mat<4, 4, f64, highp> highp_f64mat4; + + typedef mat<2, 2, f64, defaultp> f64mat2; + typedef mat<3, 3, f64, defaultp> f64mat3; + typedef mat<4, 4, f64, defaultp> f64mat4; + + // Matrix MxN + + typedef mat<2, 2, f32, lowp> lowp_mat2x2; + typedef mat<2, 3, f32, lowp> lowp_mat2x3; + typedef mat<2, 4, f32, lowp> lowp_mat2x4; + typedef mat<3, 2, f32, lowp> lowp_mat3x2; + typedef mat<3, 3, f32, lowp> lowp_mat3x3; + typedef mat<3, 4, f32, lowp> lowp_mat3x4; + typedef mat<4, 2, f32, lowp> lowp_mat4x2; + typedef mat<4, 3, f32, lowp> lowp_mat4x3; + typedef mat<4, 4, f32, lowp> lowp_mat4x4; + + typedef mat<2, 2, f32, mediump> mediump_mat2x2; + typedef mat<2, 3, f32, mediump> mediump_mat2x3; + typedef mat<2, 4, f32, mediump> mediump_mat2x4; + typedef mat<3, 2, f32, mediump> mediump_mat3x2; + typedef mat<3, 3, f32, mediump> mediump_mat3x3; + typedef mat<3, 4, f32, mediump> mediump_mat3x4; + typedef mat<4, 2, f32, mediump> mediump_mat4x2; + typedef mat<4, 3, f32, mediump> mediump_mat4x3; + typedef mat<4, 4, f32, mediump> mediump_mat4x4; + + typedef mat<2, 2, f32, highp> highp_mat2x2; + typedef mat<2, 3, f32, highp> highp_mat2x3; + typedef mat<2, 4, f32, highp> highp_mat2x4; + typedef mat<3, 2, f32, highp> highp_mat3x2; + typedef mat<3, 3, f32, highp> highp_mat3x3; + typedef mat<3, 4, f32, highp> highp_mat3x4; + typedef mat<4, 2, f32, highp> highp_mat4x2; + typedef mat<4, 3, f32, highp> highp_mat4x3; + typedef mat<4, 4, f32, highp> highp_mat4x4; + + typedef mat<2, 2, f32, defaultp> mat2x2; + typedef mat<2, 3, f32, defaultp> mat2x3; + typedef mat<2, 4, f32, defaultp> mat2x4; + typedef mat<3, 2, f32, defaultp> mat3x2; + typedef mat<3, 3, f32, defaultp> mat3x3; + typedef mat<3, 4, f32, defaultp> mat3x4; + typedef mat<4, 2, f32, defaultp> mat4x2; + typedef mat<4, 3, f32, defaultp> mat4x3; + typedef mat<4, 4, f32, defaultp> mat4x4; + + typedef mat<2, 2, f32, lowp> lowp_fmat2x2; + typedef mat<2, 3, f32, lowp> lowp_fmat2x3; + typedef mat<2, 4, f32, lowp> lowp_fmat2x4; + typedef mat<3, 2, f32, lowp> lowp_fmat3x2; + typedef mat<3, 3, f32, lowp> lowp_fmat3x3; + typedef mat<3, 4, f32, lowp> lowp_fmat3x4; + typedef mat<4, 2, f32, lowp> lowp_fmat4x2; + typedef mat<4, 3, f32, lowp> lowp_fmat4x3; + typedef mat<4, 4, f32, lowp> lowp_fmat4x4; + + typedef mat<2, 2, f32, mediump> mediump_fmat2x2; + typedef mat<2, 3, f32, mediump> mediump_fmat2x3; + typedef mat<2, 4, f32, mediump> mediump_fmat2x4; + typedef mat<3, 2, f32, mediump> mediump_fmat3x2; + typedef mat<3, 3, f32, mediump> mediump_fmat3x3; + typedef mat<3, 4, f32, mediump> mediump_fmat3x4; + typedef mat<4, 2, f32, mediump> mediump_fmat4x2; + typedef mat<4, 3, f32, mediump> mediump_fmat4x3; + typedef mat<4, 4, f32, mediump> mediump_fmat4x4; + + typedef mat<2, 2, f32, highp> highp_fmat2x2; + typedef mat<2, 3, f32, highp> highp_fmat2x3; + typedef mat<2, 4, f32, highp> highp_fmat2x4; + typedef mat<3, 2, f32, highp> highp_fmat3x2; + typedef mat<3, 3, f32, highp> highp_fmat3x3; + typedef mat<3, 4, f32, highp> highp_fmat3x4; + typedef mat<4, 2, f32, highp> highp_fmat4x2; + typedef mat<4, 3, f32, highp> highp_fmat4x3; + typedef mat<4, 4, f32, highp> highp_fmat4x4; + + typedef mat<2, 2, f32, defaultp> fmat2x2; + typedef mat<2, 3, f32, defaultp> fmat2x3; + typedef mat<2, 4, f32, defaultp> fmat2x4; + typedef mat<3, 2, f32, defaultp> fmat3x2; + typedef mat<3, 3, f32, defaultp> fmat3x3; + typedef mat<3, 4, f32, defaultp> fmat3x4; + typedef mat<4, 2, f32, defaultp> fmat4x2; + typedef mat<4, 3, f32, defaultp> fmat4x3; + typedef mat<4, 4, f32, defaultp> fmat4x4; + + typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; + typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; + typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; + typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; + typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; + typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; + typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; + typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; + typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; + + typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; + typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; + typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; + typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; + typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; + typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; + typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; + typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; + typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; + + typedef mat<2, 2, f32, highp> highp_f32mat2x2; + typedef mat<2, 3, f32, highp> highp_f32mat2x3; + typedef mat<2, 4, f32, highp> highp_f32mat2x4; + typedef mat<3, 2, f32, highp> highp_f32mat3x2; + typedef mat<3, 3, f32, highp> highp_f32mat3x3; + typedef mat<3, 4, f32, highp> highp_f32mat3x4; + typedef mat<4, 2, f32, highp> highp_f32mat4x2; + typedef mat<4, 3, f32, highp> highp_f32mat4x3; + typedef mat<4, 4, f32, highp> highp_f32mat4x4; + + typedef mat<2, 2, f32, defaultp> f32mat2x2; + typedef mat<2, 3, f32, defaultp> f32mat2x3; + typedef mat<2, 4, f32, defaultp> f32mat2x4; + typedef mat<3, 2, f32, defaultp> f32mat3x2; + typedef mat<3, 3, f32, defaultp> f32mat3x3; + typedef mat<3, 4, f32, defaultp> f32mat3x4; + typedef mat<4, 2, f32, defaultp> f32mat4x2; + typedef mat<4, 3, f32, defaultp> f32mat4x3; + typedef mat<4, 4, f32, defaultp> f32mat4x4; + + typedef mat<2, 2, double, lowp> lowp_dmat2x2; + typedef mat<2, 3, double, lowp> lowp_dmat2x3; + typedef mat<2, 4, double, lowp> lowp_dmat2x4; + typedef mat<3, 2, double, lowp> lowp_dmat3x2; + typedef mat<3, 3, double, lowp> lowp_dmat3x3; + typedef mat<3, 4, double, lowp> lowp_dmat3x4; + typedef mat<4, 2, double, lowp> lowp_dmat4x2; + typedef mat<4, 3, double, lowp> lowp_dmat4x3; + typedef mat<4, 4, double, lowp> lowp_dmat4x4; + + typedef mat<2, 2, double, mediump> mediump_dmat2x2; + typedef mat<2, 3, double, mediump> mediump_dmat2x3; + typedef mat<2, 4, double, mediump> mediump_dmat2x4; + typedef mat<3, 2, double, mediump> mediump_dmat3x2; + typedef mat<3, 3, double, mediump> mediump_dmat3x3; + typedef mat<3, 4, double, mediump> mediump_dmat3x4; + typedef mat<4, 2, double, mediump> mediump_dmat4x2; + typedef mat<4, 3, double, mediump> mediump_dmat4x3; + typedef mat<4, 4, double, mediump> mediump_dmat4x4; + + typedef mat<2, 2, double, highp> highp_dmat2x2; + typedef mat<2, 3, double, highp> highp_dmat2x3; + typedef mat<2, 4, double, highp> highp_dmat2x4; + typedef mat<3, 2, double, highp> highp_dmat3x2; + typedef mat<3, 3, double, highp> highp_dmat3x3; + typedef mat<3, 4, double, highp> highp_dmat3x4; + typedef mat<4, 2, double, highp> highp_dmat4x2; + typedef mat<4, 3, double, highp> highp_dmat4x3; + typedef mat<4, 4, double, highp> highp_dmat4x4; + + typedef mat<2, 2, double, defaultp> dmat2x2; + typedef mat<2, 3, double, defaultp> dmat2x3; + typedef mat<2, 4, double, defaultp> dmat2x4; + typedef mat<3, 2, double, defaultp> dmat3x2; + typedef mat<3, 3, double, defaultp> dmat3x3; + typedef mat<3, 4, double, defaultp> dmat3x4; + typedef mat<4, 2, double, defaultp> dmat4x2; + typedef mat<4, 3, double, defaultp> dmat4x3; + typedef mat<4, 4, double, defaultp> dmat4x4; + + typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; + typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; + typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; + typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; + typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; + typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; + typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; + typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; + typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; + + typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; + typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; + typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; + typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; + typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; + typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; + typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; + typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; + typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; + + typedef mat<2, 2, f64, highp> highp_f64mat2x2; + typedef mat<2, 3, f64, highp> highp_f64mat2x3; + typedef mat<2, 4, f64, highp> highp_f64mat2x4; + typedef mat<3, 2, f64, highp> highp_f64mat3x2; + typedef mat<3, 3, f64, highp> highp_f64mat3x3; + typedef mat<3, 4, f64, highp> highp_f64mat3x4; + typedef mat<4, 2, f64, highp> highp_f64mat4x2; + typedef mat<4, 3, f64, highp> highp_f64mat4x3; + typedef mat<4, 4, f64, highp> highp_f64mat4x4; + + typedef mat<2, 2, f64, defaultp> f64mat2x2; + typedef mat<2, 3, f64, defaultp> f64mat2x3; + typedef mat<2, 4, f64, defaultp> f64mat2x4; + typedef mat<3, 2, f64, defaultp> f64mat3x2; + typedef mat<3, 3, f64, defaultp> f64mat3x3; + typedef mat<3, 4, f64, defaultp> f64mat3x4; + typedef mat<4, 2, f64, defaultp> f64mat4x2; + typedef mat<4, 3, f64, defaultp> f64mat4x3; + typedef mat<4, 4, f64, defaultp> f64mat4x4; + + // Signed integer matrix MxN + + typedef mat<2, 2, int, lowp> lowp_imat2x2; + typedef mat<2, 3, int, lowp> lowp_imat2x3; + typedef mat<2, 4, int, lowp> lowp_imat2x4; + typedef mat<3, 2, int, lowp> lowp_imat3x2; + typedef mat<3, 3, int, lowp> lowp_imat3x3; + typedef mat<3, 4, int, lowp> lowp_imat3x4; + typedef mat<4, 2, int, lowp> lowp_imat4x2; + typedef mat<4, 3, int, lowp> lowp_imat4x3; + typedef mat<4, 4, int, lowp> lowp_imat4x4; + + typedef mat<2, 2, int, mediump> mediump_imat2x2; + typedef mat<2, 3, int, mediump> mediump_imat2x3; + typedef mat<2, 4, int, mediump> mediump_imat2x4; + typedef mat<3, 2, int, mediump> mediump_imat3x2; + typedef mat<3, 3, int, mediump> mediump_imat3x3; + typedef mat<3, 4, int, mediump> mediump_imat3x4; + typedef mat<4, 2, int, mediump> mediump_imat4x2; + typedef mat<4, 3, int, mediump> mediump_imat4x3; + typedef mat<4, 4, int, mediump> mediump_imat4x4; + + typedef mat<2, 2, int, highp> highp_imat2x2; + typedef mat<2, 3, int, highp> highp_imat2x3; + typedef mat<2, 4, int, highp> highp_imat2x4; + typedef mat<3, 2, int, highp> highp_imat3x2; + typedef mat<3, 3, int, highp> highp_imat3x3; + typedef mat<3, 4, int, highp> highp_imat3x4; + typedef mat<4, 2, int, highp> highp_imat4x2; + typedef mat<4, 3, int, highp> highp_imat4x3; + typedef mat<4, 4, int, highp> highp_imat4x4; + + typedef mat<2, 2, int, defaultp> imat2x2; + typedef mat<2, 3, int, defaultp> imat2x3; + typedef mat<2, 4, int, defaultp> imat2x4; + typedef mat<3, 2, int, defaultp> imat3x2; + typedef mat<3, 3, int, defaultp> imat3x3; + typedef mat<3, 4, int, defaultp> imat3x4; + typedef mat<4, 2, int, defaultp> imat4x2; + typedef mat<4, 3, int, defaultp> imat4x3; + typedef mat<4, 4, int, defaultp> imat4x4; + + + typedef mat<2, 2, int8, lowp> lowp_i8mat2x2; + typedef mat<2, 3, int8, lowp> lowp_i8mat2x3; + typedef mat<2, 4, int8, lowp> lowp_i8mat2x4; + typedef mat<3, 2, int8, lowp> lowp_i8mat3x2; + typedef mat<3, 3, int8, lowp> lowp_i8mat3x3; + typedef mat<3, 4, int8, lowp> lowp_i8mat3x4; + typedef mat<4, 2, int8, lowp> lowp_i8mat4x2; + typedef mat<4, 3, int8, lowp> lowp_i8mat4x3; + typedef mat<4, 4, int8, lowp> lowp_i8mat4x4; + + typedef mat<2, 2, int8, mediump> mediump_i8mat2x2; + typedef mat<2, 3, int8, mediump> mediump_i8mat2x3; + typedef mat<2, 4, int8, mediump> mediump_i8mat2x4; + typedef mat<3, 2, int8, mediump> mediump_i8mat3x2; + typedef mat<3, 3, int8, mediump> mediump_i8mat3x3; + typedef mat<3, 4, int8, mediump> mediump_i8mat3x4; + typedef mat<4, 2, int8, mediump> mediump_i8mat4x2; + typedef mat<4, 3, int8, mediump> mediump_i8mat4x3; + typedef mat<4, 4, int8, mediump> mediump_i8mat4x4; + + typedef mat<2, 2, int8, highp> highp_i8mat2x2; + typedef mat<2, 3, int8, highp> highp_i8mat2x3; + typedef mat<2, 4, int8, highp> highp_i8mat2x4; + typedef mat<3, 2, int8, highp> highp_i8mat3x2; + typedef mat<3, 3, int8, highp> highp_i8mat3x3; + typedef mat<3, 4, int8, highp> highp_i8mat3x4; + typedef mat<4, 2, int8, highp> highp_i8mat4x2; + typedef mat<4, 3, int8, highp> highp_i8mat4x3; + typedef mat<4, 4, int8, highp> highp_i8mat4x4; + + typedef mat<2, 2, int8, defaultp> i8mat2x2; + typedef mat<2, 3, int8, defaultp> i8mat2x3; + typedef mat<2, 4, int8, defaultp> i8mat2x4; + typedef mat<3, 2, int8, defaultp> i8mat3x2; + typedef mat<3, 3, int8, defaultp> i8mat3x3; + typedef mat<3, 4, int8, defaultp> i8mat3x4; + typedef mat<4, 2, int8, defaultp> i8mat4x2; + typedef mat<4, 3, int8, defaultp> i8mat4x3; + typedef mat<4, 4, int8, defaultp> i8mat4x4; + + + typedef mat<2, 2, int16, lowp> lowp_i16mat2x2; + typedef mat<2, 3, int16, lowp> lowp_i16mat2x3; + typedef mat<2, 4, int16, lowp> lowp_i16mat2x4; + typedef mat<3, 2, int16, lowp> lowp_i16mat3x2; + typedef mat<3, 3, int16, lowp> lowp_i16mat3x3; + typedef mat<3, 4, int16, lowp> lowp_i16mat3x4; + typedef mat<4, 2, int16, lowp> lowp_i16mat4x2; + typedef mat<4, 3, int16, lowp> lowp_i16mat4x3; + typedef mat<4, 4, int16, lowp> lowp_i16mat4x4; + + typedef mat<2, 2, int16, mediump> mediump_i16mat2x2; + typedef mat<2, 3, int16, mediump> mediump_i16mat2x3; + typedef mat<2, 4, int16, mediump> mediump_i16mat2x4; + typedef mat<3, 2, int16, mediump> mediump_i16mat3x2; + typedef mat<3, 3, int16, mediump> mediump_i16mat3x3; + typedef mat<3, 4, int16, mediump> mediump_i16mat3x4; + typedef mat<4, 2, int16, mediump> mediump_i16mat4x2; + typedef mat<4, 3, int16, mediump> mediump_i16mat4x3; + typedef mat<4, 4, int16, mediump> mediump_i16mat4x4; + + typedef mat<2, 2, int16, highp> highp_i16mat2x2; + typedef mat<2, 3, int16, highp> highp_i16mat2x3; + typedef mat<2, 4, int16, highp> highp_i16mat2x4; + typedef mat<3, 2, int16, highp> highp_i16mat3x2; + typedef mat<3, 3, int16, highp> highp_i16mat3x3; + typedef mat<3, 4, int16, highp> highp_i16mat3x4; + typedef mat<4, 2, int16, highp> highp_i16mat4x2; + typedef mat<4, 3, int16, highp> highp_i16mat4x3; + typedef mat<4, 4, int16, highp> highp_i16mat4x4; + + typedef mat<2, 2, int16, defaultp> i16mat2x2; + typedef mat<2, 3, int16, defaultp> i16mat2x3; + typedef mat<2, 4, int16, defaultp> i16mat2x4; + typedef mat<3, 2, int16, defaultp> i16mat3x2; + typedef mat<3, 3, int16, defaultp> i16mat3x3; + typedef mat<3, 4, int16, defaultp> i16mat3x4; + typedef mat<4, 2, int16, defaultp> i16mat4x2; + typedef mat<4, 3, int16, defaultp> i16mat4x3; + typedef mat<4, 4, int16, defaultp> i16mat4x4; + + + typedef mat<2, 2, int32, lowp> lowp_i32mat2x2; + typedef mat<2, 3, int32, lowp> lowp_i32mat2x3; + typedef mat<2, 4, int32, lowp> lowp_i32mat2x4; + typedef mat<3, 2, int32, lowp> lowp_i32mat3x2; + typedef mat<3, 3, int32, lowp> lowp_i32mat3x3; + typedef mat<3, 4, int32, lowp> lowp_i32mat3x4; + typedef mat<4, 2, int32, lowp> lowp_i32mat4x2; + typedef mat<4, 3, int32, lowp> lowp_i32mat4x3; + typedef mat<4, 4, int32, lowp> lowp_i32mat4x4; + + typedef mat<2, 2, int32, mediump> mediump_i32mat2x2; + typedef mat<2, 3, int32, mediump> mediump_i32mat2x3; + typedef mat<2, 4, int32, mediump> mediump_i32mat2x4; + typedef mat<3, 2, int32, mediump> mediump_i32mat3x2; + typedef mat<3, 3, int32, mediump> mediump_i32mat3x3; + typedef mat<3, 4, int32, mediump> mediump_i32mat3x4; + typedef mat<4, 2, int32, mediump> mediump_i32mat4x2; + typedef mat<4, 3, int32, mediump> mediump_i32mat4x3; + typedef mat<4, 4, int32, mediump> mediump_i32mat4x4; + + typedef mat<2, 2, int32, highp> highp_i32mat2x2; + typedef mat<2, 3, int32, highp> highp_i32mat2x3; + typedef mat<2, 4, int32, highp> highp_i32mat2x4; + typedef mat<3, 2, int32, highp> highp_i32mat3x2; + typedef mat<3, 3, int32, highp> highp_i32mat3x3; + typedef mat<3, 4, int32, highp> highp_i32mat3x4; + typedef mat<4, 2, int32, highp> highp_i32mat4x2; + typedef mat<4, 3, int32, highp> highp_i32mat4x3; + typedef mat<4, 4, int32, highp> highp_i32mat4x4; + + typedef mat<2, 2, int32, defaultp> i32mat2x2; + typedef mat<2, 3, int32, defaultp> i32mat2x3; + typedef mat<2, 4, int32, defaultp> i32mat2x4; + typedef mat<3, 2, int32, defaultp> i32mat3x2; + typedef mat<3, 3, int32, defaultp> i32mat3x3; + typedef mat<3, 4, int32, defaultp> i32mat3x4; + typedef mat<4, 2, int32, defaultp> i32mat4x2; + typedef mat<4, 3, int32, defaultp> i32mat4x3; + typedef mat<4, 4, int32, defaultp> i32mat4x4; + + + typedef mat<2, 2, int64, lowp> lowp_i64mat2x2; + typedef mat<2, 3, int64, lowp> lowp_i64mat2x3; + typedef mat<2, 4, int64, lowp> lowp_i64mat2x4; + typedef mat<3, 2, int64, lowp> lowp_i64mat3x2; + typedef mat<3, 3, int64, lowp> lowp_i64mat3x3; + typedef mat<3, 4, int64, lowp> lowp_i64mat3x4; + typedef mat<4, 2, int64, lowp> lowp_i64mat4x2; + typedef mat<4, 3, int64, lowp> lowp_i64mat4x3; + typedef mat<4, 4, int64, lowp> lowp_i64mat4x4; + + typedef mat<2, 2, int64, mediump> mediump_i64mat2x2; + typedef mat<2, 3, int64, mediump> mediump_i64mat2x3; + typedef mat<2, 4, int64, mediump> mediump_i64mat2x4; + typedef mat<3, 2, int64, mediump> mediump_i64mat3x2; + typedef mat<3, 3, int64, mediump> mediump_i64mat3x3; + typedef mat<3, 4, int64, mediump> mediump_i64mat3x4; + typedef mat<4, 2, int64, mediump> mediump_i64mat4x2; + typedef mat<4, 3, int64, mediump> mediump_i64mat4x3; + typedef mat<4, 4, int64, mediump> mediump_i64mat4x4; + + typedef mat<2, 2, int64, highp> highp_i64mat2x2; + typedef mat<2, 3, int64, highp> highp_i64mat2x3; + typedef mat<2, 4, int64, highp> highp_i64mat2x4; + typedef mat<3, 2, int64, highp> highp_i64mat3x2; + typedef mat<3, 3, int64, highp> highp_i64mat3x3; + typedef mat<3, 4, int64, highp> highp_i64mat3x4; + typedef mat<4, 2, int64, highp> highp_i64mat4x2; + typedef mat<4, 3, int64, highp> highp_i64mat4x3; + typedef mat<4, 4, int64, highp> highp_i64mat4x4; + + typedef mat<2, 2, int64, defaultp> i64mat2x2; + typedef mat<2, 3, int64, defaultp> i64mat2x3; + typedef mat<2, 4, int64, defaultp> i64mat2x4; + typedef mat<3, 2, int64, defaultp> i64mat3x2; + typedef mat<3, 3, int64, defaultp> i64mat3x3; + typedef mat<3, 4, int64, defaultp> i64mat3x4; + typedef mat<4, 2, int64, defaultp> i64mat4x2; + typedef mat<4, 3, int64, defaultp> i64mat4x3; + typedef mat<4, 4, int64, defaultp> i64mat4x4; + + + // Unsigned integer matrix MxN + + typedef mat<2, 2, uint, lowp> lowp_umat2x2; + typedef mat<2, 3, uint, lowp> lowp_umat2x3; + typedef mat<2, 4, uint, lowp> lowp_umat2x4; + typedef mat<3, 2, uint, lowp> lowp_umat3x2; + typedef mat<3, 3, uint, lowp> lowp_umat3x3; + typedef mat<3, 4, uint, lowp> lowp_umat3x4; + typedef mat<4, 2, uint, lowp> lowp_umat4x2; + typedef mat<4, 3, uint, lowp> lowp_umat4x3; + typedef mat<4, 4, uint, lowp> lowp_umat4x4; + + typedef mat<2, 2, uint, mediump> mediump_umat2x2; + typedef mat<2, 3, uint, mediump> mediump_umat2x3; + typedef mat<2, 4, uint, mediump> mediump_umat2x4; + typedef mat<3, 2, uint, mediump> mediump_umat3x2; + typedef mat<3, 3, uint, mediump> mediump_umat3x3; + typedef mat<3, 4, uint, mediump> mediump_umat3x4; + typedef mat<4, 2, uint, mediump> mediump_umat4x2; + typedef mat<4, 3, uint, mediump> mediump_umat4x3; + typedef mat<4, 4, uint, mediump> mediump_umat4x4; + + typedef mat<2, 2, uint, highp> highp_umat2x2; + typedef mat<2, 3, uint, highp> highp_umat2x3; + typedef mat<2, 4, uint, highp> highp_umat2x4; + typedef mat<3, 2, uint, highp> highp_umat3x2; + typedef mat<3, 3, uint, highp> highp_umat3x3; + typedef mat<3, 4, uint, highp> highp_umat3x4; + typedef mat<4, 2, uint, highp> highp_umat4x2; + typedef mat<4, 3, uint, highp> highp_umat4x3; + typedef mat<4, 4, uint, highp> highp_umat4x4; + + typedef mat<2, 2, uint, defaultp> umat2x2; + typedef mat<2, 3, uint, defaultp> umat2x3; + typedef mat<2, 4, uint, defaultp> umat2x4; + typedef mat<3, 2, uint, defaultp> umat3x2; + typedef mat<3, 3, uint, defaultp> umat3x3; + typedef mat<3, 4, uint, defaultp> umat3x4; + typedef mat<4, 2, uint, defaultp> umat4x2; + typedef mat<4, 3, uint, defaultp> umat4x3; + typedef mat<4, 4, uint, defaultp> umat4x4; + + + typedef mat<2, 2, uint8, lowp> lowp_u8mat2x2; + typedef mat<2, 3, uint8, lowp> lowp_u8mat2x3; + typedef mat<2, 4, uint8, lowp> lowp_u8mat2x4; + typedef mat<3, 2, uint8, lowp> lowp_u8mat3x2; + typedef mat<3, 3, uint8, lowp> lowp_u8mat3x3; + typedef mat<3, 4, uint8, lowp> lowp_u8mat3x4; + typedef mat<4, 2, uint8, lowp> lowp_u8mat4x2; + typedef mat<4, 3, uint8, lowp> lowp_u8mat4x3; + typedef mat<4, 4, uint8, lowp> lowp_u8mat4x4; + + typedef mat<2, 2, uint8, mediump> mediump_u8mat2x2; + typedef mat<2, 3, uint8, mediump> mediump_u8mat2x3; + typedef mat<2, 4, uint8, mediump> mediump_u8mat2x4; + typedef mat<3, 2, uint8, mediump> mediump_u8mat3x2; + typedef mat<3, 3, uint8, mediump> mediump_u8mat3x3; + typedef mat<3, 4, uint8, mediump> mediump_u8mat3x4; + typedef mat<4, 2, uint8, mediump> mediump_u8mat4x2; + typedef mat<4, 3, uint8, mediump> mediump_u8mat4x3; + typedef mat<4, 4, uint8, mediump> mediump_u8mat4x4; + + typedef mat<2, 2, uint8, highp> highp_u8mat2x2; + typedef mat<2, 3, uint8, highp> highp_u8mat2x3; + typedef mat<2, 4, uint8, highp> highp_u8mat2x4; + typedef mat<3, 2, uint8, highp> highp_u8mat3x2; + typedef mat<3, 3, uint8, highp> highp_u8mat3x3; + typedef mat<3, 4, uint8, highp> highp_u8mat3x4; + typedef mat<4, 2, uint8, highp> highp_u8mat4x2; + typedef mat<4, 3, uint8, highp> highp_u8mat4x3; + typedef mat<4, 4, uint8, highp> highp_u8mat4x4; + + typedef mat<2, 2, uint8, defaultp> u8mat2x2; + typedef mat<2, 3, uint8, defaultp> u8mat2x3; + typedef mat<2, 4, uint8, defaultp> u8mat2x4; + typedef mat<3, 2, uint8, defaultp> u8mat3x2; + typedef mat<3, 3, uint8, defaultp> u8mat3x3; + typedef mat<3, 4, uint8, defaultp> u8mat3x4; + typedef mat<4, 2, uint8, defaultp> u8mat4x2; + typedef mat<4, 3, uint8, defaultp> u8mat4x3; + typedef mat<4, 4, uint8, defaultp> u8mat4x4; + + + typedef mat<2, 2, uint16, lowp> lowp_u16mat2x2; + typedef mat<2, 3, uint16, lowp> lowp_u16mat2x3; + typedef mat<2, 4, uint16, lowp> lowp_u16mat2x4; + typedef mat<3, 2, uint16, lowp> lowp_u16mat3x2; + typedef mat<3, 3, uint16, lowp> lowp_u16mat3x3; + typedef mat<3, 4, uint16, lowp> lowp_u16mat3x4; + typedef mat<4, 2, uint16, lowp> lowp_u16mat4x2; + typedef mat<4, 3, uint16, lowp> lowp_u16mat4x3; + typedef mat<4, 4, uint16, lowp> lowp_u16mat4x4; + + typedef mat<2, 2, uint16, mediump> mediump_u16mat2x2; + typedef mat<2, 3, uint16, mediump> mediump_u16mat2x3; + typedef mat<2, 4, uint16, mediump> mediump_u16mat2x4; + typedef mat<3, 2, uint16, mediump> mediump_u16mat3x2; + typedef mat<3, 3, uint16, mediump> mediump_u16mat3x3; + typedef mat<3, 4, uint16, mediump> mediump_u16mat3x4; + typedef mat<4, 2, uint16, mediump> mediump_u16mat4x2; + typedef mat<4, 3, uint16, mediump> mediump_u16mat4x3; + typedef mat<4, 4, uint16, mediump> mediump_u16mat4x4; + + typedef mat<2, 2, uint16, highp> highp_u16mat2x2; + typedef mat<2, 3, uint16, highp> highp_u16mat2x3; + typedef mat<2, 4, uint16, highp> highp_u16mat2x4; + typedef mat<3, 2, uint16, highp> highp_u16mat3x2; + typedef mat<3, 3, uint16, highp> highp_u16mat3x3; + typedef mat<3, 4, uint16, highp> highp_u16mat3x4; + typedef mat<4, 2, uint16, highp> highp_u16mat4x2; + typedef mat<4, 3, uint16, highp> highp_u16mat4x3; + typedef mat<4, 4, uint16, highp> highp_u16mat4x4; + + typedef mat<2, 2, uint16, defaultp> u16mat2x2; + typedef mat<2, 3, uint16, defaultp> u16mat2x3; + typedef mat<2, 4, uint16, defaultp> u16mat2x4; + typedef mat<3, 2, uint16, defaultp> u16mat3x2; + typedef mat<3, 3, uint16, defaultp> u16mat3x3; + typedef mat<3, 4, uint16, defaultp> u16mat3x4; + typedef mat<4, 2, uint16, defaultp> u16mat4x2; + typedef mat<4, 3, uint16, defaultp> u16mat4x3; + typedef mat<4, 4, uint16, defaultp> u16mat4x4; + + + typedef mat<2, 2, uint32, lowp> lowp_u32mat2x2; + typedef mat<2, 3, uint32, lowp> lowp_u32mat2x3; + typedef mat<2, 4, uint32, lowp> lowp_u32mat2x4; + typedef mat<3, 2, uint32, lowp> lowp_u32mat3x2; + typedef mat<3, 3, uint32, lowp> lowp_u32mat3x3; + typedef mat<3, 4, uint32, lowp> lowp_u32mat3x4; + typedef mat<4, 2, uint32, lowp> lowp_u32mat4x2; + typedef mat<4, 3, uint32, lowp> lowp_u32mat4x3; + typedef mat<4, 4, uint32, lowp> lowp_u32mat4x4; + + typedef mat<2, 2, uint32, mediump> mediump_u32mat2x2; + typedef mat<2, 3, uint32, mediump> mediump_u32mat2x3; + typedef mat<2, 4, uint32, mediump> mediump_u32mat2x4; + typedef mat<3, 2, uint32, mediump> mediump_u32mat3x2; + typedef mat<3, 3, uint32, mediump> mediump_u32mat3x3; + typedef mat<3, 4, uint32, mediump> mediump_u32mat3x4; + typedef mat<4, 2, uint32, mediump> mediump_u32mat4x2; + typedef mat<4, 3, uint32, mediump> mediump_u32mat4x3; + typedef mat<4, 4, uint32, mediump> mediump_u32mat4x4; + + typedef mat<2, 2, uint32, highp> highp_u32mat2x2; + typedef mat<2, 3, uint32, highp> highp_u32mat2x3; + typedef mat<2, 4, uint32, highp> highp_u32mat2x4; + typedef mat<3, 2, uint32, highp> highp_u32mat3x2; + typedef mat<3, 3, uint32, highp> highp_u32mat3x3; + typedef mat<3, 4, uint32, highp> highp_u32mat3x4; + typedef mat<4, 2, uint32, highp> highp_u32mat4x2; + typedef mat<4, 3, uint32, highp> highp_u32mat4x3; + typedef mat<4, 4, uint32, highp> highp_u32mat4x4; + + typedef mat<2, 2, uint32, defaultp> u32mat2x2; + typedef mat<2, 3, uint32, defaultp> u32mat2x3; + typedef mat<2, 4, uint32, defaultp> u32mat2x4; + typedef mat<3, 2, uint32, defaultp> u32mat3x2; + typedef mat<3, 3, uint32, defaultp> u32mat3x3; + typedef mat<3, 4, uint32, defaultp> u32mat3x4; + typedef mat<4, 2, uint32, defaultp> u32mat4x2; + typedef mat<4, 3, uint32, defaultp> u32mat4x3; + typedef mat<4, 4, uint32, defaultp> u32mat4x4; + + + typedef mat<2, 2, uint64, lowp> lowp_u64mat2x2; + typedef mat<2, 3, uint64, lowp> lowp_u64mat2x3; + typedef mat<2, 4, uint64, lowp> lowp_u64mat2x4; + typedef mat<3, 2, uint64, lowp> lowp_u64mat3x2; + typedef mat<3, 3, uint64, lowp> lowp_u64mat3x3; + typedef mat<3, 4, uint64, lowp> lowp_u64mat3x4; + typedef mat<4, 2, uint64, lowp> lowp_u64mat4x2; + typedef mat<4, 3, uint64, lowp> lowp_u64mat4x3; + typedef mat<4, 4, uint64, lowp> lowp_u64mat4x4; + + typedef mat<2, 2, uint64, mediump> mediump_u64mat2x2; + typedef mat<2, 3, uint64, mediump> mediump_u64mat2x3; + typedef mat<2, 4, uint64, mediump> mediump_u64mat2x4; + typedef mat<3, 2, uint64, mediump> mediump_u64mat3x2; + typedef mat<3, 3, uint64, mediump> mediump_u64mat3x3; + typedef mat<3, 4, uint64, mediump> mediump_u64mat3x4; + typedef mat<4, 2, uint64, mediump> mediump_u64mat4x2; + typedef mat<4, 3, uint64, mediump> mediump_u64mat4x3; + typedef mat<4, 4, uint64, mediump> mediump_u64mat4x4; + + typedef mat<2, 2, uint64, highp> highp_u64mat2x2; + typedef mat<2, 3, uint64, highp> highp_u64mat2x3; + typedef mat<2, 4, uint64, highp> highp_u64mat2x4; + typedef mat<3, 2, uint64, highp> highp_u64mat3x2; + typedef mat<3, 3, uint64, highp> highp_u64mat3x3; + typedef mat<3, 4, uint64, highp> highp_u64mat3x4; + typedef mat<4, 2, uint64, highp> highp_u64mat4x2; + typedef mat<4, 3, uint64, highp> highp_u64mat4x3; + typedef mat<4, 4, uint64, highp> highp_u64mat4x4; + + typedef mat<2, 2, uint64, defaultp> u64mat2x2; + typedef mat<2, 3, uint64, defaultp> u64mat2x3; + typedef mat<2, 4, uint64, defaultp> u64mat2x4; + typedef mat<3, 2, uint64, defaultp> u64mat3x2; + typedef mat<3, 3, uint64, defaultp> u64mat3x3; + typedef mat<3, 4, uint64, defaultp> u64mat3x4; + typedef mat<4, 2, uint64, defaultp> u64mat4x2; + typedef mat<4, 3, uint64, defaultp> u64mat4x3; + typedef mat<4, 4, uint64, defaultp> u64mat4x4; + + // Quaternion + + typedef qua lowp_quat; + typedef qua mediump_quat; + typedef qua highp_quat; + typedef qua quat; + + typedef qua lowp_fquat; + typedef qua mediump_fquat; + typedef qua highp_fquat; + typedef qua fquat; + + typedef qua lowp_f32quat; + typedef qua mediump_f32quat; + typedef qua highp_f32quat; + typedef qua f32quat; + + typedef qua lowp_dquat; + typedef qua mediump_dquat; + typedef qua highp_dquat; + typedef qua dquat; + + typedef qua lowp_f64quat; + typedef qua mediump_f64quat; + typedef qua highp_f64quat; + typedef qua f64quat; +}//namespace glm - /// Default qualifier 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u8vec3 u8vec3; - /// Default qualifier 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u8vec4 u8vec4; -#endif - - - /// Low qualifier 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u16, lowp> lowp_u16vec1; - - /// Low qualifier 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u16, lowp> lowp_u16vec2; - - /// Low qualifier 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u16, lowp> lowp_u16vec3; - - /// Low qualifier 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u16, lowp> lowp_u16vec4; - - - /// Medium qualifier 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u16, mediump> mediump_u16vec1; - - /// Medium qualifier 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u16, mediump> mediump_u16vec2; - - /// Medium qualifier 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u16, mediump> mediump_u16vec3; - - /// Medium qualifier 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u16, mediump> mediump_u16vec4; - - - /// High qualifier 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u16, highp> highp_u16vec1; - - /// High qualifier 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u16, highp> highp_u16vec2; - - /// High qualifier 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u16, highp> highp_u16vec3; - - /// High qualifier 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u16, highp> highp_u16vec4; - - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_u16vec1 u16vec1; - typedef lowp_u16vec2 u16vec2; - typedef lowp_u16vec3 u16vec3; - typedef lowp_u16vec4 u16vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_u16vec1 u16vec1; - typedef mediump_u16vec2 u16vec2; - typedef mediump_u16vec3 u16vec3; - typedef mediump_u16vec4 u16vec4; -#else - /// Default qualifier 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u16vec1 u16vec1; - - /// Default qualifier 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u16vec2 u16vec2; - - /// Default qualifier 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u16vec3 u16vec3; - - /// Default qualifier 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u16vec4 u16vec4; -#endif - - - /// Low qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, lowp> lowp_u32vec1; - - /// Low qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, lowp> lowp_u32vec2; - - /// Low qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, lowp> lowp_u32vec3; - - /// Low qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, lowp> lowp_u32vec4; - - - /// Medium qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, mediump> mediump_u32vec1; - - /// Medium qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, mediump> mediump_u32vec2; - - /// Medium qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, mediump> mediump_u32vec3; - - /// Medium qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, mediump> mediump_u32vec4; - - - /// High qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, highp> highp_u32vec1; - - /// High qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, highp> highp_u32vec2; - - /// High qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, highp> highp_u32vec3; - - /// High qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, highp> highp_u32vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_u32vec1 u32vec1; - typedef lowp_u32vec2 u32vec2; - typedef lowp_u32vec3 u32vec3; - typedef lowp_u32vec4 u32vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_u32vec1 u32vec1; - typedef mediump_u32vec2 u32vec2; - typedef mediump_u32vec3 u32vec3; - typedef mediump_u32vec4 u32vec4; -#else - /// Default qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u32vec1 u32vec1; - - /// Default qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u32vec2 u32vec2; - - /// Default qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u32vec3 u32vec3; - - /// Default qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u32vec4 u32vec4; -#endif - - - /// Low qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, lowp> lowp_u32vec1; - - /// Low qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, lowp> lowp_u32vec2; - - /// Low qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, lowp> lowp_u32vec3; - - /// Low qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, lowp> lowp_u32vec4; - - - /// Medium qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, mediump> mediump_u32vec1; - - /// Medium qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, mediump> mediump_u32vec2; - - /// Medium qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, mediump> mediump_u32vec3; - - /// Medium qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, mediump> mediump_u32vec4; - - - /// High qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, highp> highp_u32vec1; - - /// High qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, highp> highp_u32vec2; - - /// High qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, highp> highp_u32vec3; - - /// High qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, highp> highp_u32vec4; - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_u32vec1 u32vec1; - typedef lowp_u32vec2 u32vec2; - typedef lowp_u32vec3 u32vec3; - typedef lowp_u32vec4 u32vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef mediump_u32vec1 u32vec1; - typedef mediump_u32vec2 u32vec2; - typedef mediump_u32vec3 u32vec3; - typedef mediump_u32vec4 u32vec4; -#else - /// Default qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u32vec1 u32vec1; - - /// Default qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u32vec2 u32vec2; - - /// Default qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u32vec3 u32vec3; - - /// Default qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u32vec4 u32vec4; -#endif - - - - /// Low qualifier 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u64, lowp> lowp_u64vec1; - - /// Low qualifier 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u64, lowp> lowp_u64vec2; - - /// Low qualifier 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u64, lowp> lowp_u64vec3; - - /// Low qualifier 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u64, lowp> lowp_u64vec4; - - - /// Medium qualifier 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u64, mediump> mediump_u64vec1; - - /// Medium qualifier 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u64, mediump> mediump_u64vec2; - - /// Medium qualifier 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u64, mediump> mediump_u64vec3; - - /// Medium qualifier 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u64, mediump> mediump_u64vec4; - - - /// High qualifier 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u64, highp> highp_u64vec1; - - /// High qualifier 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u64, highp> highp_u64vec2; - - /// High qualifier 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u64, highp> highp_u64vec3; - - /// High qualifier 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u64, highp> highp_u64vec4; - -#if(defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_u64vec1 u64vec1; - typedef lowp_u64vec2 u64vec2; - typedef lowp_u64vec3 u64vec3; - typedef lowp_u64vec4 u64vec4; -#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) - typedef mediump_u64vec1 u64vec1; - typedef mediump_u64vec2 u64vec2; - typedef mediump_u64vec3 u64vec3; - typedef mediump_u64vec4 u64vec4; -#else - /// Default qualifier 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef highp_u64vec1 u64vec1; - - /// Default qualifier 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef highp_u64vec2 u64vec2; - - /// Default qualifier 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef highp_u64vec3 u64vec3; - - /// Default qualifier 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef highp_u64vec4 u64vec4; -#endif - - - ////////////////////// - // Float vector types - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32_t; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64_t; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32_t; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64_t; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 lowp_float32_t; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 lowp_float64_t; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - - /// Medium 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 mediump_float32; - - /// Medium 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 mediump_float64; - - /// Medium 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 mediump_float32_t; - - /// Medium 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 mediump_float64_t; - - /// Medium 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 mediump_f32; - - /// Medium 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 mediump_f64; - - - /// High 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 highp_float32; - - /// High 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 highp_float64; - - /// High 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float32 highp_float32_t; - - /// High 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 highp_float64_t; - - /// High 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 highp_f32; - - /// High 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 highp_f64; - - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float32 float32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float64 float64; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float32_t float32_t; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float64_t float64_t; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_f32 f32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_f64 f64; - -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float32 float32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float64 float64; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float32 float32_t; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float64 float64_t; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float32 f32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float64 f64; - -#else//(defined(GLM_PRECISION_HIGHP_FLOAT)) - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float32 float32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float64 float64; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float32_t float32_t; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float64_t float64_t; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float32_t f32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float64_t f64; -#endif - - - /// Low single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, lowp> lowp_vec1; - - /// Low single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, float, lowp> lowp_vec2; - - /// Low single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, float, lowp> lowp_vec3; - - /// Low single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, float, lowp> lowp_vec4; - - /// Low single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, lowp> lowp_fvec1; - - /// Low single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, float, lowp> lowp_fvec2; - - /// Low single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, float, lowp> lowp_fvec3; - - /// Low single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, float, lowp> lowp_fvec4; - - - /// Medium single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, mediump> mediump_vec1; - - /// Medium Single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, float, mediump> mediump_vec2; - - /// Medium Single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, float, mediump> mediump_vec3; - - /// Medium Single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, float, mediump> mediump_vec4; - - /// Medium single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, mediump> mediump_fvec1; - - /// Medium Single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, float, mediump> mediump_fvec2; - - /// Medium Single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, float, mediump> mediump_fvec3; - - /// Medium Single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, float, mediump> mediump_fvec4; - - - /// High single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, highp> highp_vec1; - - /// High Single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, float, highp> highp_vec2; - - /// High Single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, float, highp> highp_vec3; - - /// High Single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, float, highp> highp_vec4; - - /// High single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, highp> highp_fvec1; - - /// High Single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, float, highp> highp_fvec2; - - /// High Single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, float, highp> highp_fvec3; - - /// High Single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, float, highp> highp_fvec4; - - - /// Low single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f32, lowp> lowp_f32vec1; - - /// Low single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, f32, lowp> lowp_f32vec2; - - /// Low single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, f32, lowp> lowp_f32vec3; - - /// Low single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, f32, lowp> lowp_f32vec4; - - /// Medium single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f32, mediump> mediump_f32vec1; - - /// Medium single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, f32, mediump> mediump_f32vec2; - - /// Medium single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, f32, mediump> mediump_f32vec3; - - /// Medium single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, f32, mediump> mediump_f32vec4; - - /// High single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f32, highp> highp_f32vec1; - - /// High single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f32, highp> highp_f32vec2; - - /// High single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f32, highp> highp_f32vec3; - - /// High single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f32, highp> highp_f32vec4; - - - /// Low double-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f64, lowp> lowp_f64vec1; - - /// Low double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f64, lowp> lowp_f64vec2; - - /// Low double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f64, lowp> lowp_f64vec3; - - /// Low double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f64, lowp> lowp_f64vec4; - - /// Medium double-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f64, mediump> mediump_f64vec1; - - /// Medium double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f64, mediump> mediump_f64vec2; - - /// Medium double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f64, mediump> mediump_f64vec3; - - /// Medium double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f64, mediump> mediump_f64vec4; - - /// High double-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f64, highp> highp_f64vec1; - - /// High double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f64, highp> highp_f64vec2; - - /// High double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f64, highp> highp_f64vec3; - - /// High double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f64, highp> highp_f64vec4; - - - ////////////////////// - // Float matrix types - - /// Low single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_f32 lowp_fmat1x1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, lowp> lowp_fmat2x2; - - /// Low single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, lowp> lowp_fmat2x3; - - /// Low single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, lowp> lowp_fmat2x4; - - /// Low single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, lowp> lowp_fmat3x2; - - /// Low single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, lowp> lowp_fmat3x3; - - /// Low single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, lowp> lowp_fmat3x4; - - /// Low single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, lowp> lowp_fmat4x2; - - /// Low single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, lowp> lowp_fmat4x3; - - /// Low single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, lowp> lowp_fmat4x4; - - /// Low single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_fmat1x1 lowp_fmat1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_fmat2x2 lowp_fmat2; - - /// Low single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_fmat3x3 lowp_fmat3; - - /// Low single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_fmat4x4 lowp_fmat4; - - - /// Medium single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_f32 mediump_fmat1x1; - - /// Medium single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, mediump> mediump_fmat2x2; - - /// Medium single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, mediump> mediump_fmat2x3; - - /// Medium single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, mediump> mediump_fmat2x4; - - /// Medium single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, mediump> mediump_fmat3x2; - - /// Medium single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, mediump> mediump_fmat3x3; - - /// Medium single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, mediump> mediump_fmat3x4; - - /// Medium single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, mediump> mediump_fmat4x2; - - /// Medium single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, mediump> mediump_fmat4x3; - - /// Medium single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, mediump> mediump_fmat4x4; - - /// Medium single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_fmat1x1 mediump_fmat1; - - /// Medium single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_fmat2x2 mediump_fmat2; - - /// Medium single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_fmat3x3 mediump_fmat3; - - /// Medium single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_fmat4x4 mediump_fmat4; - - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_f32 highp_fmat1x1; - - /// High single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, highp> highp_fmat2x2; - - /// High single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, highp> highp_fmat2x3; - - /// High single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, highp> highp_fmat2x4; - - /// High single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, highp> highp_fmat3x2; - - /// High single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, highp> highp_fmat3x3; - - /// High single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, highp> highp_fmat3x4; - - /// High single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, highp> highp_fmat4x2; - - /// High single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, highp> highp_fmat4x3; - - /// High single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, highp> highp_fmat4x4; - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_fmat1x1 highp_fmat1; - - /// High single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_fmat2x2 highp_fmat2; - - /// High single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_fmat3x3 highp_fmat3; - - /// High single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_fmat4x4 highp_fmat4; - - - /// Low single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 lowp_f32mat1x1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; - - /// Low single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; - - /// Low single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; - - /// Low single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; - - /// Low single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; - - /// Low single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; - - /// Low single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; - - /// Low single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; - - /// Low single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; - - /// Low single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 lowp_f32mat1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat2x2 lowp_f32mat2; - - /// Low single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat3x3 lowp_f32mat3; - - /// Low single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat4x4 lowp_f32mat4; - - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 mediump_f32mat1x1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; - - /// Medium single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; - - /// Medium single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; - - /// Medium single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; - - /// Medium single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; - - /// Medium single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; - - /// Medium single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; - - /// Medium single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; - - /// Medium single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; - - /// Medium single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 f32mat1; - - /// Medium single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat2x2 mediump_f32mat2; - - /// Medium single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat3x3 mediump_f32mat3; - - /// Medium single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat4x4 mediump_f32mat4; - - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 highp_f32mat1x1; - - /// High single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, highp> highp_f32mat2x2; - - /// High single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, highp> highp_f32mat2x3; - - /// High single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, highp> highp_f32mat2x4; - - /// High single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, highp> highp_f32mat3x2; - - /// High single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, highp> highp_f32mat3x3; - - /// High single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, highp> highp_f32mat3x4; - - /// High single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, highp> highp_f32mat4x2; - - /// High single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, highp> highp_f32mat4x3; - - /// High single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, highp> highp_f32mat4x4; - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 f32mat1; - - /// High single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x2 highp_f32mat2; - - /// High single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x3 highp_f32mat3; - - /// High single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x4 highp_f32mat4; - - - /// Low double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 lowp_f64mat1x1; - - /// Low double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; - - /// Low double-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; - - /// Low double-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; - - /// Low double-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; - - /// Low double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; - - /// Low double-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; - - /// Low double-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; - - /// Low double-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; - - /// Low double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; - - /// Low double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_f64mat1x1 lowp_f64mat1; - - /// Low double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat2x2 lowp_f64mat2; - - /// Low double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat3x3 lowp_f64mat3; - - /// Low double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat4x4 lowp_f64mat4; - - - /// Medium double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 Highp_f64mat1x1; - - /// Medium double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; - - /// Medium double-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; - - /// Medium double-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; - - /// Medium double-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; - - /// Medium double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; - - /// Medium double-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; - - /// Medium double-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; - - /// Medium double-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; - - /// Medium double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; - - /// Medium double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_f64mat1x1 mediump_f64mat1; - - /// Medium double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat2x2 mediump_f64mat2; - - /// Medium double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat3x3 mediump_f64mat3; - - /// Medium double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat4x4 mediump_f64mat4; - - /// High double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 highp_f64mat1x1; - - /// High double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f64, highp> highp_f64mat2x2; - - /// High double-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f64, highp> highp_f64mat2x3; - - /// High double-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f64, highp> highp_f64mat2x4; - - /// High double-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f64, highp> highp_f64mat3x2; - - /// High double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f64, highp> highp_f64mat3x3; - - /// High double-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f64, highp> highp_f64mat3x4; - - /// High double-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f64, highp> highp_f64mat4x2; - - /// High double-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f64, highp> highp_f64mat4x3; - - /// High double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f64, highp> highp_f64mat4x4; - - /// High double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_f64mat1x1 highp_f64mat1; - - /// High double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x2 highp_f64mat2; - - /// High double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x3 highp_f64mat3; - - /// High double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x4 highp_f64mat4; - - ////////////////////////// - // Quaternion types - - /// Low single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef tquat lowp_f32quat; - - /// Low double-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef tquat lowp_f64quat; - - /// Medium single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef tquat mediump_f32quat; - - /// Medium double-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef tquat mediump_f64quat; - - /// High single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef tquat highp_f32quat; - - /// High double-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef tquat highp_f64quat; - - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_f32vec1 fvec1; - typedef lowp_f32vec2 fvec2; - typedef lowp_f32vec3 fvec3; - typedef lowp_f32vec4 fvec4; - typedef lowp_f32mat2 fmat2; - typedef lowp_f32mat3 fmat3; - typedef lowp_f32mat4 fmat4; - typedef lowp_f32mat2x2 fmat2x2; - typedef lowp_f32mat3x2 fmat3x2; - typedef lowp_f32mat4x2 fmat4x2; - typedef lowp_f32mat2x3 fmat2x3; - typedef lowp_f32mat3x3 fmat3x3; - typedef lowp_f32mat4x3 fmat4x3; - typedef lowp_f32mat2x4 fmat2x4; - typedef lowp_f32mat3x4 fmat3x4; - typedef lowp_f32mat4x4 fmat4x4; - typedef lowp_f32quat fquat; - - typedef lowp_f32vec1 f32vec1; - typedef lowp_f32vec2 f32vec2; - typedef lowp_f32vec3 f32vec3; - typedef lowp_f32vec4 f32vec4; - typedef lowp_f32mat2 f32mat2; - typedef lowp_f32mat3 f32mat3; - typedef lowp_f32mat4 f32mat4; - typedef lowp_f32mat2x2 f32mat2x2; - typedef lowp_f32mat3x2 f32mat3x2; - typedef lowp_f32mat4x2 f32mat4x2; - typedef lowp_f32mat2x3 f32mat2x3; - typedef lowp_f32mat3x3 f32mat3x3; - typedef lowp_f32mat4x3 f32mat4x3; - typedef lowp_f32mat2x4 f32mat2x4; - typedef lowp_f32mat3x4 f32mat3x4; - typedef lowp_f32mat4x4 f32mat4x4; - typedef lowp_f32quat f32quat; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef mediump_f32vec1 fvec1; - typedef mediump_f32vec2 fvec2; - typedef mediump_f32vec3 fvec3; - typedef mediump_f32vec4 fvec4; - typedef mediump_f32mat2 fmat2; - typedef mediump_f32mat3 fmat3; - typedef mediump_f32mat4 fmat4; - typedef mediump_f32mat2x2 fmat2x2; - typedef mediump_f32mat3x2 fmat3x2; - typedef mediump_f32mat4x2 fmat4x2; - typedef mediump_f32mat2x3 fmat2x3; - typedef mediump_f32mat3x3 fmat3x3; - typedef mediump_f32mat4x3 fmat4x3; - typedef mediump_f32mat2x4 fmat2x4; - typedef mediump_f32mat3x4 fmat3x4; - typedef mediump_f32mat4x4 fmat4x4; - typedef mediump_f32quat fquat; - - typedef mediump_f32vec1 f32vec1; - typedef mediump_f32vec2 f32vec2; - typedef mediump_f32vec3 f32vec3; - typedef mediump_f32vec4 f32vec4; - typedef mediump_f32mat2 f32mat2; - typedef mediump_f32mat3 f32mat3; - typedef mediump_f32mat4 f32mat4; - typedef mediump_f32mat2x2 f32mat2x2; - typedef mediump_f32mat3x2 f32mat3x2; - typedef mediump_f32mat4x2 f32mat4x2; - typedef mediump_f32mat2x3 f32mat2x3; - typedef mediump_f32mat3x3 f32mat3x3; - typedef mediump_f32mat4x3 f32mat4x3; - typedef mediump_f32mat2x4 f32mat2x4; - typedef mediump_f32mat3x4 f32mat3x4; - typedef mediump_f32mat4x4 f32mat4x4; - typedef mediump_f32quat f32quat; -#else//if(defined(GLM_PRECISION_HIGHP_FLOAT)) - /// Default single-qualifier floating-point vector of 1 components. - /// @see gtc_type_precision - typedef highp_f32vec1 fvec1; - - /// Default single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef highp_f32vec2 fvec2; - - /// Default single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef highp_f32vec3 fvec3; - - /// Default single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef highp_f32vec4 fvec4; - - /// Default single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x2 fmat2x2; - - /// Default single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x3 fmat2x3; - - /// Default single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x4 fmat2x4; - - /// Default single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x2 fmat3x2; - - /// Default single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x3 fmat3x3; - - /// Default single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x4 fmat3x4; - - /// Default single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x2 fmat4x2; - - /// Default single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x3 fmat4x3; - - /// Default single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x4 fmat4x4; - - /// Default single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef fmat2x2 fmat2; - - /// Default single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef fmat3x3 fmat3; - - /// Default single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef fmat4x4 fmat4; - - /// Default single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef highp_fquat fquat; - - - - /// Default single-qualifier floating-point vector of 1 components. - /// @see gtc_type_precision - typedef highp_f32vec1 f32vec1; - - /// Default single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef highp_f32vec2 f32vec2; - - /// Default single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef highp_f32vec3 f32vec3; - - /// Default single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef highp_f32vec4 f32vec4; - - /// Default single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x2 f32mat2x2; - - /// Default single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x3 f32mat2x3; - - /// Default single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x4 f32mat2x4; - - /// Default single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x2 f32mat3x2; - - /// Default single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x3 f32mat3x3; - - /// Default single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x4 f32mat3x4; - - /// Default single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x2 f32mat4x2; - - /// Default single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x3 f32mat4x3; - - /// Default single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x4 f32mat4x4; - - /// Default single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef f32mat2x2 f32mat2; - - /// Default single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef f32mat3x3 f32mat3; - - /// Default single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef f32mat4x4 f32mat4; - - /// Default single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef highp_f32quat f32quat; -#endif - -#if(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_f64vec1 f64vec1; - typedef lowp_f64vec2 f64vec2; - typedef lowp_f64vec3 f64vec3; - typedef lowp_f64vec4 f64vec4; - typedef lowp_f64mat2 f64mat2; - typedef lowp_f64mat3 f64mat3; - typedef lowp_f64mat4 f64mat4; - typedef lowp_f64mat2x2 f64mat2x2; - typedef lowp_f64mat3x2 f64mat3x2; - typedef lowp_f64mat4x2 f64mat4x2; - typedef lowp_f64mat2x3 f64mat2x3; - typedef lowp_f64mat3x3 f64mat3x3; - typedef lowp_f64mat4x3 f64mat4x3; - typedef lowp_f64mat2x4 f64mat2x4; - typedef lowp_f64mat3x4 f64mat3x4; - typedef lowp_f64mat4x4 f64mat4x4; - typedef lowp_f64quat f64quat; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef mediump_f64vec1 f64vec1; - typedef mediump_f64vec2 f64vec2; - typedef mediump_f64vec3 f64vec3; - typedef mediump_f64vec4 f64vec4; - typedef mediump_f64mat2 f64mat2; - typedef mediump_f64mat3 f64mat3; - typedef mediump_f64mat4 f64mat4; - typedef mediump_f64mat2x2 f64mat2x2; - typedef mediump_f64mat3x2 f64mat3x2; - typedef mediump_f64mat4x2 f64mat4x2; - typedef mediump_f64mat2x3 f64mat2x3; - typedef mediump_f64mat3x3 f64mat3x3; - typedef mediump_f64mat4x3 f64mat4x3; - typedef mediump_f64mat2x4 f64mat2x4; - typedef mediump_f64mat3x4 f64mat3x4; - typedef mediump_f64mat4x4 f64mat4x4; - typedef mediump_f64quat f64quat; -#else - /// Default double-qualifier floating-point vector of 1 components. - /// @see gtc_type_precision - typedef highp_f64vec1 f64vec1; - - /// Default double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef highp_f64vec2 f64vec2; - - /// Default double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef highp_f64vec3 f64vec3; - - /// Default double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef highp_f64vec4 f64vec4; - - /// Default double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x2 f64mat2x2; - - /// Default double-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x3 f64mat2x3; - - /// Default double-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x4 f64mat2x4; - - /// Default double-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x2 f64mat3x2; - - /// Default double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x3 f64mat3x3; - - /// Default double-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x4 f64mat3x4; - - /// Default double-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x2 f64mat4x2; - - /// Default double-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x3 f64mat4x3; - - /// Default double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x4 f64mat4x4; - - /// Default double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef f64mat2x2 f64mat2; - - /// Default double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef f64mat3x3 f64mat3; - - /// Default double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef f64mat4x4 f64mat4; - - /// Default double-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef highp_f64quat f64quat; -#endif - -}//namespace glm diff --git a/vendor/glm/geometric.hpp b/vendor/glm/geometric.hpp old mode 100755 new mode 100644 index e0380830e0..ac857e69d4 --- a/vendor/glm/geometric.hpp +++ b/vendor/glm/geometric.hpp @@ -6,9 +6,9 @@ /// @defgroup core_func_geometric Geometric functions /// @ingroup core /// -/// Include to use these core features. -/// /// These operate on vectors as vectors, not component-wise. +/// +/// Include to use these core features. #pragma once @@ -29,7 +29,7 @@ namespace glm template GLM_FUNC_DECL T length(vec const& x); - /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). + /// Returns the distance between p0 and p1, i.e., length(p0 - p1). /// /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. /// @tparam T Floating-point scalar types. @@ -47,7 +47,7 @@ namespace glm /// @see GLSL dot man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - GLM_FUNC_DECL T dot(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR T dot(vec const& x, vec const& y); /// Returns the cross product of x and y. /// @@ -56,7 +56,7 @@ namespace glm /// @see GLSL cross man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - GLM_FUNC_DECL vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y); /// Returns a vector in the same direction as x but with length of 1. /// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error. diff --git a/vendor/glm/glm.cppm b/vendor/glm/glm.cppm new file mode 100644 index 0000000000..e468f410a3 --- /dev/null +++ b/vendor/glm/glm.cppm @@ -0,0 +1,2678 @@ +module; + +// #define GLM_GTC_INLINE_NAMESPACE to inline glm::gtc into glm +// #define GLM_EXT_INLINE_NAMESPACE to inline glm::ext into glm +// #define GLM_GTX_INLINE_NAMESPACE to inline glm::gtx into glm + +#include "./glm.hpp" +#include "./ext.hpp" + +export module glm; + +export namespace glm { + // Base types + using glm::qualifier; + using glm::precision; + using glm::vec; + using glm::mat; + using glm::qua; +# if GLM_HAS_TEMPLATE_ALIASES + using glm::tvec1; + using glm::tvec2; + using glm::tvec3; + using glm::tvec4; + using glm::tmat2x2; + using glm::tmat2x3; + using glm::tmat2x4; + using glm::tmat3x2; + using glm::tmat3x3; + using glm::tmat3x4; + using glm::tmat4x2; + using glm::tmat4x3; + using glm::tmat4x4; + using glm::tquat; +# endif + + using glm::int8; + using glm::int16; + using glm::int32; + using glm::int64; + using glm::uint8; + using glm::uint16; + using glm::uint32; + using glm::uint64; + using glm::lowp_i8; + using glm::mediump_i8; + using glm::highp_i8; + using glm::i8; + using glm::lowp_int8; + using glm::mediump_int8; + using glm::highp_int8; + using glm::lowp_int8_t; + using glm::mediump_int8_t; + using glm::highp_int8_t; + using glm::int8_t; + using glm::lowp_i16; + using glm::mediump_i16; + using glm::highp_i16; + using glm::i16; + using glm::lowp_int16; + using glm::mediump_int16; + using glm::highp_int16; + using glm::lowp_int16_t; + using glm::mediump_int16_t; + using glm::highp_int16_t; + using glm::int16_t; + using glm::lowp_i32; + using glm::mediump_i32; + using glm::highp_i32; + using glm::i32; + using glm::lowp_int32; + using glm::mediump_int32; + using glm::highp_int32; + using glm::lowp_int32_t; + using glm::mediump_int32_t; + using glm::highp_int32_t; + using glm::int32_t; + using glm::lowp_i64; + using glm::mediump_i64; + using glm::highp_i64; + using glm::i64; + using glm::lowp_int64; + using glm::mediump_int64; + using glm::highp_int64; + using glm::lowp_int64_t; + using glm::mediump_int64_t; + using glm::highp_int64_t; + using glm::int64_t; + using glm::uint; + using glm::lowp_u8; + using glm::mediump_u8; + using glm::highp_u8; + using glm::u8; + using glm::lowp_uint8; + using glm::mediump_uint8; + using glm::highp_uint8; + using glm::lowp_uint8_t; + using glm::mediump_uint8_t; + using glm::highp_uint8_t; + using glm::uint8_t; + using glm::lowp_u16; + using glm::mediump_u16; + using glm::highp_u16; + using glm::u16; + using glm::lowp_uint16; + using glm::mediump_uint16; + using glm::highp_uint16; + using glm::lowp_uint16_t; + using glm::mediump_uint16_t; + using glm::highp_uint16_t; + using glm::uint16_t; + using glm::lowp_u32; + using glm::mediump_u32; + using glm::highp_u32; + using glm::u32; + using glm::lowp_uint32; + using glm::mediump_uint32; + using glm::highp_uint32; + using glm::lowp_uint32_t; + using glm::mediump_uint32_t; + using glm::highp_uint32_t; + using glm::uint32_t; + using glm::lowp_u64; + using glm::mediump_u64; + using glm::highp_u64; + using glm::u64; + using glm::lowp_uint64; + using glm::mediump_uint64; + using glm::highp_uint64; + using glm::lowp_uint64_t; + using glm::mediump_uint64_t; + using glm::highp_uint64_t; + using glm::uint64_t; + using glm::lowp_f32; + using glm::mediump_f32; + using glm::highp_f32; + using glm::f32; + using glm::lowp_float32; + using glm::mediump_float32; + using glm::highp_float32; + using glm::float32; + using glm::lowp_float32_t; + using glm::mediump_float32_t; + using glm::highp_float32_t; + using glm::float32_t; + using glm::lowp_f64; + using glm::mediump_f64; + using glm::highp_f64; + using glm::f64; + using glm::lowp_float64; + using glm::mediump_float64; + using glm::highp_float64; + using glm::float64; + using glm::lowp_float64_t; + using glm::mediump_float64_t; + using glm::highp_float64_t; + using glm::float64_t; + using glm::lowp_bvec1; + using glm::lowp_bvec2; + using glm::lowp_bvec3; + using glm::lowp_bvec4; + using glm::mediump_bvec1; + using glm::mediump_bvec2; + using glm::mediump_bvec3; + using glm::mediump_bvec4; + using glm::highp_bvec1; + using glm::highp_bvec2; + using glm::highp_bvec3; + using glm::highp_bvec4; + using glm::bvec1; + using glm::bvec2; + using glm::bvec3; + using glm::bvec4; + using glm::lowp_ivec1; + using glm::lowp_ivec2; + using glm::lowp_ivec3; + using glm::lowp_ivec4; + using glm::mediump_ivec1; + using glm::mediump_ivec2; + using glm::mediump_ivec3; + using glm::mediump_ivec4; + using glm::highp_ivec1; + using glm::highp_ivec2; + using glm::highp_ivec3; + using glm::highp_ivec4; + using glm::ivec1; + using glm::ivec2; + using glm::ivec3; + using glm::ivec4; + using glm::lowp_i8vec1; + using glm::lowp_i8vec2; + using glm::lowp_i8vec3; + using glm::lowp_i8vec4; + using glm::mediump_i8vec1; + using glm::mediump_i8vec2; + using glm::mediump_i8vec3; + using glm::mediump_i8vec4; + using glm::highp_i8vec1; + using glm::highp_i8vec2; + using glm::highp_i8vec3; + using glm::highp_i8vec4; + using glm::i8vec1; + using glm::i8vec2; + using glm::i8vec3; + using glm::i8vec4; + using glm::lowp_i16vec1; + using glm::lowp_i16vec2; + using glm::lowp_i16vec3; + using glm::lowp_i16vec4; + using glm::mediump_i16vec1; + using glm::mediump_i16vec2; + using glm::mediump_i16vec3; + using glm::mediump_i16vec4; + using glm::highp_i16vec1; + using glm::highp_i16vec2; + using glm::highp_i16vec3; + using glm::highp_i16vec4; + using glm::i16vec1; + using glm::i16vec2; + using glm::i16vec3; + using glm::i16vec4; + using glm::lowp_i32vec1; + using glm::lowp_i32vec2; + using glm::lowp_i32vec3; + using glm::lowp_i32vec4; + using glm::mediump_i32vec1; + using glm::mediump_i32vec2; + using glm::mediump_i32vec3; + using glm::mediump_i32vec4; + using glm::highp_i32vec1; + using glm::highp_i32vec2; + using glm::highp_i32vec3; + using glm::highp_i32vec4; + using glm::i32vec1; + using glm::i32vec2; + using glm::i32vec3; + using glm::i32vec4; + using glm::lowp_i64vec1; + using glm::lowp_i64vec2; + using glm::lowp_i64vec3; + using glm::lowp_i64vec4; + using glm::mediump_i64vec1; + using glm::mediump_i64vec2; + using glm::mediump_i64vec3; + using glm::mediump_i64vec4; + using glm::highp_i64vec1; + using glm::highp_i64vec2; + using glm::highp_i64vec3; + using glm::highp_i64vec4; + using glm::i64vec1; + using glm::i64vec2; + using glm::i64vec3; + using glm::i64vec4; + using glm::lowp_uvec1; + using glm::lowp_uvec2; + using glm::lowp_uvec3; + using glm::lowp_uvec4; + using glm::mediump_uvec1; + using glm::mediump_uvec2; + using glm::mediump_uvec3; + using glm::mediump_uvec4; + using glm::highp_uvec1; + using glm::highp_uvec2; + using glm::highp_uvec3; + using glm::highp_uvec4; + using glm::uvec1; + using glm::uvec2; + using glm::uvec3; + using glm::uvec4; + using glm::lowp_u8vec1; + using glm::lowp_u8vec2; + using glm::lowp_u8vec3; + using glm::lowp_u8vec4; + using glm::mediump_u8vec1; + using glm::mediump_u8vec2; + using glm::mediump_u8vec3; + using glm::mediump_u8vec4; + using glm::highp_u8vec1; + using glm::highp_u8vec2; + using glm::highp_u8vec3; + using glm::highp_u8vec4; + using glm::u8vec1; + using glm::u8vec2; + using glm::u8vec3; + using glm::u8vec4; + using glm::lowp_u16vec1; + using glm::lowp_u16vec2; + using glm::lowp_u16vec3; + using glm::lowp_u16vec4; + using glm::mediump_u16vec1; + using glm::mediump_u16vec2; + using glm::mediump_u16vec3; + using glm::mediump_u16vec4; + using glm::highp_u16vec1; + using glm::highp_u16vec2; + using glm::highp_u16vec3; + using glm::highp_u16vec4; + using glm::u16vec1; + using glm::u16vec2; + using glm::u16vec3; + using glm::u16vec4; + using glm::lowp_u32vec1; + using glm::lowp_u32vec2; + using glm::lowp_u32vec3; + using glm::lowp_u32vec4; + using glm::mediump_u32vec1; + using glm::mediump_u32vec2; + using glm::mediump_u32vec3; + using glm::mediump_u32vec4; + using glm::highp_u32vec1; + using glm::highp_u32vec2; + using glm::highp_u32vec3; + using glm::highp_u32vec4; + using glm::u32vec1; + using glm::u32vec2; + using glm::u32vec3; + using glm::u32vec4; + using glm::lowp_u64vec1; + using glm::lowp_u64vec2; + using glm::lowp_u64vec3; + using glm::lowp_u64vec4; + using glm::mediump_u64vec1; + using glm::mediump_u64vec2; + using glm::mediump_u64vec3; + using glm::mediump_u64vec4; + using glm::highp_u64vec1; + using glm::highp_u64vec2; + using glm::highp_u64vec3; + using glm::highp_u64vec4; + using glm::u64vec1; + using glm::u64vec2; + using glm::u64vec3; + using glm::u64vec4; + using glm::lowp_vec1; + using glm::lowp_vec2; + using glm::lowp_vec3; + using glm::lowp_vec4; + using glm::mediump_vec1; + using glm::mediump_vec2; + using glm::mediump_vec3; + using glm::mediump_vec4; + using glm::highp_vec1; + using glm::highp_vec2; + using glm::highp_vec3; + using glm::highp_vec4; + using glm::vec1; + using glm::vec2; + using glm::vec3; + using glm::vec4; + using glm::lowp_fvec1; + using glm::lowp_fvec2; + using glm::lowp_fvec3; + using glm::lowp_fvec4; + using glm::mediump_fvec1; + using glm::mediump_fvec2; + using glm::mediump_fvec3; + using glm::mediump_fvec4; + using glm::highp_fvec1; + using glm::highp_fvec2; + using glm::highp_fvec3; + using glm::highp_fvec4; + using glm::fvec1; + using glm::fvec2; + using glm::fvec3; + using glm::fvec4; + using glm::lowp_f32vec1; + using glm::lowp_f32vec2; + using glm::lowp_f32vec3; + using glm::lowp_f32vec4; + using glm::mediump_f32vec1; + using glm::mediump_f32vec2; + using glm::mediump_f32vec3; + using glm::mediump_f32vec4; + using glm::highp_f32vec1; + using glm::highp_f32vec2; + using glm::highp_f32vec3; + using glm::highp_f32vec4; + using glm::f32vec1; + using glm::f32vec2; + using glm::f32vec3; + using glm::f32vec4; + using glm::lowp_dvec1; + using glm::lowp_dvec2; + using glm::lowp_dvec3; + using glm::lowp_dvec4; + using glm::mediump_dvec1; + using glm::mediump_dvec2; + using glm::mediump_dvec3; + using glm::mediump_dvec4; + using glm::highp_dvec1; + using glm::highp_dvec2; + using glm::highp_dvec3; + using glm::highp_dvec4; + using glm::dvec1; + using glm::dvec2; + using glm::dvec3; + using glm::dvec4; + using glm::lowp_f64vec1; + using glm::lowp_f64vec2; + using glm::lowp_f64vec3; + using glm::lowp_f64vec4; + using glm::mediump_f64vec1; + using glm::mediump_f64vec2; + using glm::mediump_f64vec3; + using glm::mediump_f64vec4; + using glm::highp_f64vec1; + using glm::highp_f64vec2; + using glm::highp_f64vec3; + using glm::highp_f64vec4; + using glm::f64vec1; + using glm::f64vec2; + using glm::f64vec3; + using glm::f64vec4; + using glm::lowp_mat2; + using glm::lowp_mat3; + using glm::lowp_mat4; + using glm::mediump_mat2; + using glm::mediump_mat3; + using glm::mediump_mat4; + using glm::highp_mat2; + using glm::highp_mat3; + using glm::highp_mat4; + using glm::mat2; + using glm::mat3; + using glm::mat4; + using glm::lowp_fmat2; + using glm::lowp_fmat3; + using glm::lowp_fmat4; + using glm::mediump_fmat2; + using glm::mediump_fmat3; + using glm::mediump_fmat4; + using glm::highp_fmat2; + using glm::highp_fmat3; + using glm::highp_fmat4; + using glm::fmat2; + using glm::fmat3; + using glm::fmat4; + using glm::lowp_f32mat2; + using glm::lowp_f32mat3; + using glm::lowp_f32mat4; + using glm::mediump_f32mat2; + using glm::mediump_f32mat3; + using glm::mediump_f32mat4; + using glm::highp_f32mat2; + using glm::highp_f32mat3; + using glm::highp_f32mat4; + using glm::f32mat2; + using glm::f32mat3; + using glm::f32mat4; + using glm::lowp_dmat2; + using glm::lowp_dmat3; + using glm::lowp_dmat4; + using glm::mediump_dmat2; + using glm::mediump_dmat3; + using glm::mediump_dmat4; + using glm::highp_dmat2; + using glm::highp_dmat3; + using glm::highp_dmat4; + using glm::dmat2; + using glm::dmat3; + using glm::dmat4; + using glm::lowp_f64mat2; + using glm::lowp_f64mat3; + using glm::lowp_f64mat4; + using glm::mediump_f64mat2; + using glm::mediump_f64mat3; + using glm::mediump_f64mat4; + using glm::highp_f64mat2; + using glm::highp_f64mat3; + using glm::highp_f64mat4; + using glm::f64mat2; + using glm::f64mat3; + using glm::f64mat4; + using glm::lowp_mat2x2; + using glm::lowp_mat2x3; + using glm::lowp_mat2x4; + using glm::lowp_mat3x2; + using glm::lowp_mat3x3; + using glm::lowp_mat3x4; + using glm::lowp_mat4x2; + using glm::lowp_mat4x3; + using glm::lowp_mat4x4; + using glm::mediump_mat2x2; + using glm::mediump_mat2x3; + using glm::mediump_mat2x4; + using glm::mediump_mat3x2; + using glm::mediump_mat3x3; + using glm::mediump_mat3x4; + using glm::mediump_mat4x2; + using glm::mediump_mat4x3; + using glm::mediump_mat4x4; + using glm::highp_mat2x2; + using glm::highp_mat2x3; + using glm::highp_mat2x4; + using glm::highp_mat3x2; + using glm::highp_mat3x3; + using glm::highp_mat3x4; + using glm::highp_mat4x2; + using glm::highp_mat4x3; + using glm::highp_mat4x4; + using glm::mat2x2; + using glm::mat2x3; + using glm::mat2x4; + using glm::mat3x2; + using glm::mat3x3; + using glm::mat3x4; + using glm::mat4x2; + using glm::mat4x3; + using glm::mat4x4; + using glm::lowp_fmat2x2; + using glm::lowp_fmat2x3; + using glm::lowp_fmat2x4; + using glm::lowp_fmat3x2; + using glm::lowp_fmat3x3; + using glm::lowp_fmat3x4; + using glm::lowp_fmat4x2; + using glm::lowp_fmat4x3; + using glm::lowp_fmat4x4; + using glm::mediump_fmat2x2; + using glm::mediump_fmat2x3; + using glm::mediump_fmat2x4; + using glm::mediump_fmat3x2; + using glm::mediump_fmat3x3; + using glm::mediump_fmat3x4; + using glm::mediump_fmat4x2; + using glm::mediump_fmat4x3; + using glm::mediump_fmat4x4; + using glm::highp_fmat2x2; + using glm::highp_fmat2x3; + using glm::highp_fmat2x4; + using glm::highp_fmat3x2; + using glm::highp_fmat3x3; + using glm::highp_fmat3x4; + using glm::highp_fmat4x2; + using glm::highp_fmat4x3; + using glm::highp_fmat4x4; + using glm::fmat2x2; + using glm::fmat2x3; + using glm::fmat2x4; + using glm::fmat3x2; + using glm::fmat3x3; + using glm::fmat3x4; + using glm::fmat4x2; + using glm::fmat4x3; + using glm::fmat4x4; + using glm::lowp_f32mat2x2; + using glm::lowp_f32mat2x3; + using glm::lowp_f32mat2x4; + using glm::lowp_f32mat3x2; + using glm::lowp_f32mat3x3; + using glm::lowp_f32mat3x4; + using glm::lowp_f32mat4x2; + using glm::lowp_f32mat4x3; + using glm::lowp_f32mat4x4; + + using glm::mediump_f32mat2x2; + using glm::mediump_f32mat2x3; + using glm::mediump_f32mat2x4; + using glm::mediump_f32mat3x2; + using glm::mediump_f32mat3x3; + using glm::mediump_f32mat3x4; + using glm::mediump_f32mat4x2; + using glm::mediump_f32mat4x3; + using glm::mediump_f32mat4x4; + using glm::highp_f32mat2x2; + using glm::highp_f32mat2x3; + using glm::highp_f32mat2x4; + using glm::highp_f32mat3x2; + using glm::highp_f32mat3x3; + using glm::highp_f32mat3x4; + using glm::highp_f32mat4x2; + using glm::highp_f32mat4x3; + using glm::highp_f32mat4x4; + using glm::f32mat2x2; + using glm::f32mat2x3; + using glm::f32mat2x4; + using glm::f32mat3x2; + using glm::f32mat3x3; + using glm::f32mat3x4; + using glm::f32mat4x2; + using glm::f32mat4x3; + using glm::f32mat4x4; + using glm::lowp_dmat2x2; + using glm::lowp_dmat2x3; + using glm::lowp_dmat2x4; + using glm::lowp_dmat3x2; + using glm::lowp_dmat3x3; + using glm::lowp_dmat3x4; + using glm::lowp_dmat4x2; + using glm::lowp_dmat4x3; + using glm::lowp_dmat4x4; + using glm::mediump_dmat2x2; + using glm::mediump_dmat2x3; + using glm::mediump_dmat2x4; + using glm::mediump_dmat3x2; + using glm::mediump_dmat3x3; + using glm::mediump_dmat3x4; + using glm::mediump_dmat4x2; + using glm::mediump_dmat4x3; + using glm::mediump_dmat4x4; + using glm::highp_dmat2x2; + using glm::highp_dmat2x3; + using glm::highp_dmat2x4; + using glm::highp_dmat3x2; + using glm::highp_dmat3x3; + using glm::highp_dmat3x4; + using glm::highp_dmat4x2; + using glm::highp_dmat4x3; + using glm::highp_dmat4x4; + using glm::dmat2x2; + using glm::dmat2x3; + using glm::dmat2x4; + using glm::dmat3x2; + using glm::dmat3x3; + using glm::dmat3x4; + using glm::dmat4x2; + using glm::dmat4x3; + using glm::dmat4x4; + using glm::lowp_f64mat2x2; + using glm::lowp_f64mat2x3; + using glm::lowp_f64mat2x4; + using glm::lowp_f64mat3x2; + using glm::lowp_f64mat3x3; + using glm::lowp_f64mat3x4; + using glm::lowp_f64mat4x2; + using glm::lowp_f64mat4x3; + using glm::lowp_f64mat4x4; + using glm::mediump_f64mat2x2; + using glm::mediump_f64mat2x3; + using glm::mediump_f64mat2x4; + using glm::mediump_f64mat3x2; + using glm::mediump_f64mat3x3; + using glm::mediump_f64mat3x4; + using glm::mediump_f64mat4x2; + using glm::mediump_f64mat4x3; + using glm::mediump_f64mat4x4; + using glm::highp_f64mat2x2; + using glm::highp_f64mat2x3; + using glm::highp_f64mat2x4; + using glm::highp_f64mat3x2; + using glm::highp_f64mat3x3; + using glm::highp_f64mat3x4; + using glm::highp_f64mat4x2; + using glm::highp_f64mat4x3; + using glm::highp_f64mat4x4; + using glm::f64mat2x2; + using glm::f64mat2x3; + using glm::f64mat2x4; + using glm::f64mat3x2; + using glm::f64mat3x3; + using glm::f64mat3x4; + using glm::f64mat4x2; + using glm::f64mat4x3; + using glm::f64mat4x4; + using glm::lowp_imat2x2; + using glm::lowp_imat2x3; + using glm::lowp_imat2x4; + using glm::lowp_imat3x2; + using glm::lowp_imat3x3; + using glm::lowp_imat3x4; + using glm::lowp_imat4x2; + using glm::lowp_imat4x3; + using glm::lowp_imat4x4; + using glm::mediump_imat2x2; + using glm::mediump_imat2x3; + using glm::mediump_imat2x4; + using glm::mediump_imat3x2; + using glm::mediump_imat3x3; + using glm::mediump_imat3x4; + using glm::mediump_imat4x2; + using glm::mediump_imat4x3; + using glm::mediump_imat4x4; + using glm::highp_imat2x2; + using glm::highp_imat2x3; + using glm::highp_imat2x4; + using glm::highp_imat3x2; + using glm::highp_imat3x3; + using glm::highp_imat3x4; + using glm::highp_imat4x2; + using glm::highp_imat4x3; + using glm::highp_imat4x4; + using glm::imat2x2; + using glm::imat2x3; + using glm::imat2x4; + using glm::imat3x2; + using glm::imat3x3; + using glm::imat3x4; + using glm::imat4x2; + using glm::imat4x3; + using glm::imat4x4; + using glm::lowp_i8mat2x2; + using glm::lowp_i8mat2x3; + using glm::lowp_i8mat2x4; + using glm::lowp_i8mat3x2; + using glm::lowp_i8mat3x3; + using glm::lowp_i8mat3x4; + using glm::lowp_i8mat4x2; + using glm::lowp_i8mat4x3; + using glm::lowp_i8mat4x4; + using glm::mediump_i8mat2x2; + using glm::mediump_i8mat2x3; + using glm::mediump_i8mat2x4; + using glm::mediump_i8mat3x2; + using glm::mediump_i8mat3x3; + using glm::mediump_i8mat3x4; + using glm::mediump_i8mat4x2; + using glm::mediump_i8mat4x3; + using glm::mediump_i8mat4x4; + using glm::highp_i8mat2x2; + using glm::highp_i8mat2x3; + using glm::highp_i8mat2x4; + using glm::highp_i8mat3x2; + using glm::highp_i8mat3x3; + using glm::highp_i8mat3x4; + using glm::highp_i8mat4x2; + using glm::highp_i8mat4x3; + using glm::highp_i8mat4x4; + using glm::i8mat2x2; + using glm::i8mat2x3; + using glm::i8mat2x4; + using glm::i8mat3x2; + using glm::i8mat3x3; + using glm::i8mat3x4; + using glm::i8mat4x2; + using glm::i8mat4x3; + using glm::i8mat4x4; + using glm::lowp_i16mat2x2; + using glm::lowp_i16mat2x3; + using glm::lowp_i16mat2x4; + using glm::lowp_i16mat3x2; + using glm::lowp_i16mat3x3; + using glm::lowp_i16mat3x4; + using glm::lowp_i16mat4x2; + using glm::lowp_i16mat4x3; + using glm::lowp_i16mat4x4; + using glm::mediump_i16mat2x2; + using glm::mediump_i16mat2x3; + using glm::mediump_i16mat2x4; + using glm::mediump_i16mat3x2; + using glm::mediump_i16mat3x3; + using glm::mediump_i16mat3x4; + using glm::mediump_i16mat4x2; + using glm::mediump_i16mat4x3; + using glm::mediump_i16mat4x4; + using glm::highp_i16mat2x2; + using glm::highp_i16mat2x3; + using glm::highp_i16mat2x4; + using glm::highp_i16mat3x2; + using glm::highp_i16mat3x3; + using glm::highp_i16mat3x4; + using glm::highp_i16mat4x2; + using glm::highp_i16mat4x3; + using glm::highp_i16mat4x4; + using glm::i16mat2x2; + using glm::i16mat2x3; + using glm::i16mat2x4; + using glm::i16mat3x2; + using glm::i16mat3x3; + using glm::i16mat3x4; + using glm::i16mat4x2; + using glm::i16mat4x3; + using glm::i16mat4x4; + using glm::lowp_i32mat2x2; + using glm::lowp_i32mat2x3; + using glm::lowp_i32mat2x4; + using glm::lowp_i32mat3x2; + using glm::lowp_i32mat3x3; + using glm::lowp_i32mat3x4; + using glm::lowp_i32mat4x2; + using glm::lowp_i32mat4x3; + using glm::lowp_i32mat4x4; + using glm::mediump_i32mat2x2; + using glm::mediump_i32mat2x3; + using glm::mediump_i32mat2x4; + using glm::mediump_i32mat3x2; + using glm::mediump_i32mat3x3; + using glm::mediump_i32mat3x4; + using glm::mediump_i32mat4x2; + using glm::mediump_i32mat4x3; + using glm::mediump_i32mat4x4; + using glm::highp_i32mat2x2; + using glm::highp_i32mat2x3; + using glm::highp_i32mat2x4; + using glm::highp_i32mat3x2; + using glm::highp_i32mat3x3; + using glm::highp_i32mat3x4; + using glm::highp_i32mat4x2; + using glm::highp_i32mat4x3; + using glm::highp_i32mat4x4; + using glm::i32mat2x2; + using glm::i32mat2x3; + using glm::i32mat2x4; + using glm::i32mat3x2; + using glm::i32mat3x3; + using glm::i32mat3x4; + using glm::i32mat4x2; + using glm::i32mat4x3; + using glm::i32mat4x4; + using glm::lowp_i64mat2x2; + using glm::lowp_i64mat2x3; + using glm::lowp_i64mat2x4; + using glm::lowp_i64mat3x2; + using glm::lowp_i64mat3x3; + using glm::lowp_i64mat3x4; + using glm::lowp_i64mat4x2; + using glm::lowp_i64mat4x3; + using glm::lowp_i64mat4x4; + using glm::mediump_i64mat2x2; + using glm::mediump_i64mat2x3; + using glm::mediump_i64mat2x4; + using glm::mediump_i64mat3x2; + using glm::mediump_i64mat3x3; + using glm::mediump_i64mat3x4; + using glm::mediump_i64mat4x2; + using glm::mediump_i64mat4x3; + using glm::mediump_i64mat4x4; + using glm::highp_i64mat2x2; + using glm::highp_i64mat2x3; + using glm::highp_i64mat2x4; + using glm::highp_i64mat3x2; + using glm::highp_i64mat3x3; + using glm::highp_i64mat3x4; + using glm::highp_i64mat4x2; + using glm::highp_i64mat4x3; + using glm::highp_i64mat4x4; + using glm::i64mat2x2; + using glm::i64mat2x3; + using glm::i64mat2x4; + using glm::i64mat3x2; + using glm::i64mat3x3; + using glm::i64mat3x4; + using glm::i64mat4x2; + using glm::i64mat4x3; + using glm::i64mat4x4; + using glm::lowp_umat2x2; + using glm::lowp_umat2x3; + using glm::lowp_umat2x4; + using glm::lowp_umat3x2; + using glm::lowp_umat3x3; + using glm::lowp_umat3x4; + using glm::lowp_umat4x2; + using glm::lowp_umat4x3; + using glm::lowp_umat4x4; + using glm::mediump_umat2x2; + using glm::mediump_umat2x3; + using glm::mediump_umat2x4; + using glm::mediump_umat3x2; + using glm::mediump_umat3x3; + using glm::mediump_umat3x4; + using glm::mediump_umat4x2; + using glm::mediump_umat4x3; + using glm::mediump_umat4x4; + using glm::highp_umat2x2; + using glm::highp_umat2x3; + using glm::highp_umat2x4; + using glm::highp_umat3x2; + using glm::highp_umat3x3; + using glm::highp_umat3x4; + using glm::highp_umat4x2; + using glm::highp_umat4x3; + using glm::highp_umat4x4; + using glm::umat2x2; + using glm::umat2x3; + using glm::umat2x4; + using glm::umat3x2; + using glm::umat3x3; + using glm::umat3x4; + using glm::umat4x2; + using glm::umat4x3; + using glm::umat4x4; + using glm::lowp_u8mat2x2; + using glm::lowp_u8mat2x3; + using glm::lowp_u8mat2x4; + using glm::lowp_u8mat3x2; + using glm::lowp_u8mat3x3; + using glm::lowp_u8mat3x4; + using glm::lowp_u8mat4x2; + using glm::lowp_u8mat4x3; + using glm::lowp_u8mat4x4; + using glm::mediump_u8mat2x2; + using glm::mediump_u8mat2x3; + using glm::mediump_u8mat2x4; + using glm::mediump_u8mat3x2; + using glm::mediump_u8mat3x3; + using glm::mediump_u8mat3x4; + using glm::mediump_u8mat4x2; + using glm::mediump_u8mat4x3; + using glm::mediump_u8mat4x4; + using glm::highp_u8mat2x2; + using glm::highp_u8mat2x3; + using glm::highp_u8mat2x4; + using glm::highp_u8mat3x2; + using glm::highp_u8mat3x3; + using glm::highp_u8mat3x4; + using glm::highp_u8mat4x2; + using glm::highp_u8mat4x3; + using glm::highp_u8mat4x4; + using glm::u8mat2x2; + using glm::u8mat2x3; + using glm::u8mat2x4; + using glm::u8mat3x2; + using glm::u8mat3x3; + using glm::u8mat3x4; + using glm::u8mat4x2; + using glm::u8mat4x3; + using glm::u8mat4x4; + using glm::lowp_u16mat2x2; + using glm::lowp_u16mat2x3; + using glm::lowp_u16mat2x4; + using glm::lowp_u16mat3x2; + using glm::lowp_u16mat3x3; + using glm::lowp_u16mat3x4; + using glm::lowp_u16mat4x2; + using glm::lowp_u16mat4x3; + using glm::lowp_u16mat4x4; + using glm::mediump_u16mat2x2; + using glm::mediump_u16mat2x3; + using glm::mediump_u16mat2x4; + using glm::mediump_u16mat3x2; + using glm::mediump_u16mat3x3; + using glm::mediump_u16mat3x4; + using glm::mediump_u16mat4x2; + using glm::mediump_u16mat4x3; + using glm::mediump_u16mat4x4; + using glm::highp_u16mat2x2; + using glm::highp_u16mat2x3; + using glm::highp_u16mat2x4; + using glm::highp_u16mat3x2; + using glm::highp_u16mat3x3; + using glm::highp_u16mat3x4; + using glm::highp_u16mat4x2; + using glm::highp_u16mat4x3; + using glm::highp_u16mat4x4; + using glm::u16mat2x2; + using glm::u16mat2x3; + using glm::u16mat2x4; + using glm::u16mat3x2; + using glm::u16mat3x3; + using glm::u16mat3x4; + using glm::u16mat4x2; + using glm::u16mat4x3; + using glm::u16mat4x4; + using glm::lowp_u32mat2x2; + using glm::lowp_u32mat2x3; + using glm::lowp_u32mat2x4; + using glm::lowp_u32mat3x2; + using glm::lowp_u32mat3x3; + using glm::lowp_u32mat3x4; + using glm::lowp_u32mat4x2; + using glm::lowp_u32mat4x3; + using glm::lowp_u32mat4x4; + using glm::mediump_u32mat2x2; + using glm::mediump_u32mat2x3; + using glm::mediump_u32mat2x4; + using glm::mediump_u32mat3x2; + using glm::mediump_u32mat3x3; + using glm::mediump_u32mat3x4; + using glm::mediump_u32mat4x2; + using glm::mediump_u32mat4x3; + using glm::mediump_u32mat4x4; + using glm::highp_u32mat2x2; + using glm::highp_u32mat2x3; + using glm::highp_u32mat2x4; + using glm::highp_u32mat3x2; + using glm::highp_u32mat3x3; + using glm::highp_u32mat3x4; + using glm::highp_u32mat4x2; + using glm::highp_u32mat4x3; + using glm::highp_u32mat4x4; + using glm::u32mat2x2; + using glm::u32mat2x3; + using glm::u32mat2x4; + using glm::u32mat3x2; + using glm::u32mat3x3; + using glm::u32mat3x4; + using glm::u32mat4x2; + using glm::u32mat4x3; + using glm::u32mat4x4; + using glm::lowp_u64mat2x2; + using glm::lowp_u64mat2x3; + using glm::lowp_u64mat2x4; + using glm::lowp_u64mat3x2; + using glm::lowp_u64mat3x3; + using glm::lowp_u64mat3x4; + using glm::lowp_u64mat4x2; + using glm::lowp_u64mat4x3; + using glm::lowp_u64mat4x4; + using glm::mediump_u64mat2x2; + using glm::mediump_u64mat2x3; + using glm::mediump_u64mat2x4; + using glm::mediump_u64mat3x2; + using glm::mediump_u64mat3x3; + using glm::mediump_u64mat3x4; + using glm::mediump_u64mat4x2; + using glm::mediump_u64mat4x3; + using glm::mediump_u64mat4x4; + using glm::highp_u64mat2x2; + using glm::highp_u64mat2x3; + using glm::highp_u64mat2x4; + using glm::highp_u64mat3x2; + using glm::highp_u64mat3x3; + using glm::highp_u64mat3x4; + using glm::highp_u64mat4x2; + using glm::highp_u64mat4x3; + using glm::highp_u64mat4x4; + using glm::u64mat2x2; + using glm::u64mat2x3; + using glm::u64mat2x4; + using glm::u64mat3x2; + using glm::u64mat3x3; + using glm::u64mat3x4; + using glm::u64mat4x2; + using glm::u64mat4x3; + using glm::u64mat4x4; + using glm::lowp_quat; + using glm::mediump_quat; + using glm::highp_quat; + using glm::quat; + using glm::lowp_fquat; + using glm::mediump_fquat; + using glm::highp_fquat; + using glm::fquat; + using glm::lowp_f32quat; + using glm::mediump_f32quat; + using glm::highp_f32quat; + using glm::f32quat; + using glm::lowp_dquat; + using glm::mediump_dquat; + using glm::highp_dquat; + using glm::dquat; + using glm::lowp_f64quat; + using glm::mediump_f64quat; + using glm::highp_f64quat; + using glm::f64quat; + + // Operators + using glm::operator+; + using glm::operator-; + using glm::operator*; + using glm::operator/; + using glm::operator%; + using glm::operator^; + using glm::operator&; + using glm::operator|; + using glm::operator~; + using glm::operator<<; + using glm::operator>>; + using glm::operator==; + using glm::operator!=; + using glm::operator&&; + using glm::operator||; + + // Core functions + using glm::abs; + using glm::acos; + using glm::acosh; + using glm::all; + using glm::any; + using glm::asin; + using glm::asinh; + using glm::atan; + using glm::atanh; + using glm::bitCount; + using glm::bitfieldExtract; + using glm::bitfieldInsert; + using glm::bitfieldReverse; + using glm::ceil; + using glm::clamp; + using glm::cos; + using glm::cosh; + using glm::cross; + using glm::degrees; + using glm::determinant; + using glm::distance; + using glm::dot; + using glm::equal; + using glm::exp; + using glm::exp2; + using glm::faceforward; + using glm::findLSB; + using glm::findMSB; + using glm::floatBitsToInt; + using glm::floatBitsToUint; + using glm::floor; + using glm::fma; + using glm::fract; + using glm::frexp; + using glm::greaterThan; + using glm::greaterThanEqual; + using glm::imulExtended; + using glm::intBitsToFloat; + using glm::inverse; + using glm::inversesqrt; + using glm::isinf; + using glm::isnan; + using glm::ldexp; + using glm::length; + using glm::lessThan; + using glm::lessThanEqual; + using glm::log; + using glm::log2; + using glm::matrixCompMult; + using glm::max; + using glm::min; + using glm::mix; + using glm::mod; + using glm::modf; + using glm::normalize; + using glm::notEqual; + using glm::not_; + using glm::outerProduct; + using glm::packDouble2x32; + using glm::packHalf2x16; + using glm::packSnorm2x16; + using glm::packSnorm4x8; + using glm::packUnorm2x16; + using glm::packUnorm4x8; + using glm::pow; + using glm::radians; + using glm::reflect; + using glm::refract; + using glm::round; + using glm::roundEven; + using glm::sign; + using glm::sin; + using glm::sinh; + using glm::smoothstep; + using glm::sqrt; + using glm::step; + using glm::tan; + using glm::tanh; + using glm::transpose; + using glm::trunc; + using glm::uaddCarry; + using glm::uintBitsToFloat; + using glm::umulExtended; + using glm::unpackDouble2x32; + using glm::unpackHalf2x16; + using glm::unpackSnorm2x16; + using glm::unpackSnorm4x8; + using glm::unpackUnorm2x16; + using glm::unpackUnorm4x8; + using glm::usubBorrow; + +# ifdef GLM_GTC_INLINE_NAMESPACE + inline +# endif + namespace gtc { +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + using glm::aligned_highp_vec1; + using glm::aligned_mediump_vec1; + using glm::aligned_lowp_vec1; + using glm::aligned_highp_dvec1; + using glm::aligned_mediump_dvec1; + using glm::aligned_lowp_dvec1; + using glm::aligned_highp_ivec1; + using glm::aligned_mediump_ivec1; + using glm::aligned_lowp_ivec1; + using glm::aligned_highp_uvec1; + using glm::aligned_mediump_uvec1; + using glm::aligned_lowp_uvec1; + using glm::aligned_highp_bvec1; + using glm::aligned_mediump_bvec1; + using glm::aligned_lowp_bvec1; + using glm::packed_highp_vec1; + using glm::packed_mediump_vec1; + using glm::packed_lowp_vec1; + using glm::packed_highp_dvec1; + using glm::packed_mediump_dvec1; + using glm::packed_lowp_dvec1; + using glm::packed_highp_ivec1; + using glm::packed_mediump_ivec1; + using glm::packed_lowp_ivec1; + using glm::packed_highp_uvec1; + using glm::packed_mediump_uvec1; + using glm::packed_lowp_uvec1; + using glm::packed_highp_bvec1; + using glm::packed_mediump_bvec1; + using glm::packed_lowp_bvec1; + using glm::aligned_highp_vec2; + using glm::aligned_mediump_vec2; + using glm::aligned_lowp_vec2; + using glm::aligned_highp_dvec2; + using glm::aligned_mediump_dvec2; + using glm::aligned_lowp_dvec2; + using glm::aligned_highp_ivec2; + using glm::aligned_mediump_ivec2; + using glm::aligned_lowp_ivec2; + using glm::aligned_highp_uvec2; + using glm::aligned_mediump_uvec2; + using glm::aligned_lowp_uvec2; + using glm::aligned_highp_bvec2; + using glm::aligned_mediump_bvec2; + using glm::aligned_lowp_bvec2; + using glm::packed_highp_vec2; + using glm::packed_mediump_vec2; + using glm::packed_lowp_vec2; + using glm::packed_highp_dvec2; + using glm::packed_mediump_dvec2; + using glm::packed_lowp_dvec2; + using glm::packed_highp_ivec2; + using glm::packed_mediump_ivec2; + using glm::packed_lowp_ivec2; + using glm::packed_highp_uvec2; + using glm::packed_mediump_uvec2; + using glm::packed_lowp_uvec2; + using glm::packed_highp_bvec2; + using glm::packed_mediump_bvec2; + using glm::packed_lowp_bvec2; + using glm::aligned_highp_vec3; + using glm::aligned_mediump_vec3; + using glm::aligned_lowp_vec3; + using glm::aligned_highp_dvec3; + using glm::aligned_mediump_dvec3; + using glm::aligned_lowp_dvec3; + using glm::aligned_highp_ivec3; + using glm::aligned_mediump_ivec3; + using glm::aligned_lowp_ivec3; + using glm::aligned_highp_uvec3; + using glm::aligned_mediump_uvec3; + using glm::aligned_lowp_uvec3; + using glm::aligned_highp_bvec3; + using glm::aligned_mediump_bvec3; + using glm::aligned_lowp_bvec3; + using glm::packed_highp_vec3; + using glm::packed_mediump_vec3; + using glm::packed_lowp_vec3; + using glm::packed_highp_dvec3; + using glm::packed_mediump_dvec3; + using glm::packed_lowp_dvec3; + using glm::packed_highp_ivec3; + using glm::packed_mediump_ivec3; + using glm::packed_lowp_ivec3; + using glm::packed_highp_uvec3; + using glm::packed_mediump_uvec3; + using glm::packed_lowp_uvec3; + using glm::packed_highp_bvec3; + using glm::packed_mediump_bvec3; + using glm::packed_lowp_bvec3; + using glm::aligned_highp_vec4; + using glm::aligned_mediump_vec4; + using glm::aligned_lowp_vec4; + using glm::aligned_highp_dvec4; + using glm::aligned_mediump_dvec4; + using glm::aligned_lowp_dvec4; + using glm::aligned_highp_ivec4; + using glm::aligned_mediump_ivec4; + using glm::aligned_lowp_ivec4; + using glm::aligned_highp_uvec4; + using glm::aligned_mediump_uvec4; + using glm::aligned_lowp_uvec4; + using glm::aligned_highp_bvec4; + using glm::aligned_mediump_bvec4; + using glm::aligned_lowp_bvec4; + using glm::packed_highp_vec4; + using glm::packed_mediump_vec4; + using glm::packed_lowp_vec4; + using glm::packed_highp_dvec4; + using glm::packed_mediump_dvec4; + using glm::packed_lowp_dvec4; + using glm::packed_highp_ivec4; + using glm::packed_mediump_ivec4; + using glm::packed_lowp_ivec4; + using glm::packed_highp_uvec4; + using glm::packed_mediump_uvec4; + using glm::packed_lowp_uvec4; + using glm::packed_highp_bvec4; + using glm::packed_mediump_bvec4; + using glm::packed_lowp_bvec4; + using glm::aligned_highp_mat2; + using glm::aligned_mediump_mat2; + using glm::aligned_lowp_mat2; + using glm::aligned_highp_dmat2; + using glm::aligned_mediump_dmat2; + using glm::aligned_lowp_dmat2; + using glm::packed_highp_mat2; + using glm::packed_mediump_mat2; + using glm::packed_lowp_mat2; + using glm::packed_highp_dmat2; + using glm::packed_mediump_dmat2; + using glm::packed_lowp_dmat2; + using glm::aligned_highp_mat3; + using glm::aligned_mediump_mat3; + using glm::aligned_lowp_mat3; + using glm::aligned_highp_dmat3; + using glm::aligned_mediump_dmat3; + using glm::aligned_lowp_dmat3; + using glm::packed_highp_mat3; + using glm::packed_mediump_mat3; + using glm::packed_lowp_mat3; + using glm::packed_highp_dmat3; + using glm::packed_mediump_dmat3; + using glm::packed_lowp_dmat3; + using glm::aligned_highp_mat4; + using glm::aligned_mediump_mat4; + using glm::aligned_lowp_mat4; + using glm::aligned_highp_dmat4; + using glm::aligned_mediump_dmat4; + using glm::aligned_lowp_dmat4; + using glm::packed_highp_mat4; + using glm::packed_mediump_mat4; + using glm::packed_lowp_mat4; + using glm::packed_highp_dmat4; + using glm::packed_mediump_dmat4; + using glm::packed_lowp_dmat4; + using glm::aligned_highp_mat2x2; + using glm::aligned_mediump_mat2x2; + using glm::aligned_lowp_mat2x2; + using glm::aligned_highp_dmat2x2; + using glm::aligned_mediump_dmat2x2; + using glm::aligned_lowp_dmat2x2; + using glm::packed_highp_mat2x2; + using glm::packed_mediump_mat2x2; + using glm::packed_lowp_mat2x2; + using glm::packed_highp_dmat2x2; + using glm::packed_mediump_dmat2x2; + using glm::packed_lowp_dmat2x2; + using glm::aligned_highp_mat2x3; + using glm::aligned_mediump_mat2x3; + using glm::aligned_lowp_mat2x3; + using glm::aligned_highp_dmat2x3; + using glm::aligned_mediump_dmat2x3; + using glm::aligned_lowp_dmat2x3; + using glm::packed_highp_mat2x3; + using glm::packed_mediump_mat2x3; + using glm::packed_lowp_mat2x3; + using glm::packed_highp_dmat2x3; + using glm::packed_mediump_dmat2x3; + using glm::packed_lowp_dmat2x3; + using glm::aligned_highp_mat2x4; + using glm::aligned_mediump_mat2x4; + using glm::aligned_lowp_mat2x4; + using glm::aligned_highp_dmat2x4; + using glm::aligned_mediump_dmat2x4; + using glm::aligned_lowp_dmat2x4; + using glm::packed_highp_mat2x4; + using glm::packed_mediump_mat2x4; + using glm::packed_lowp_mat2x4; + using glm::packed_highp_dmat2x4; + using glm::packed_mediump_dmat2x4; + using glm::packed_lowp_dmat2x4; + using glm::aligned_highp_mat3x2; + using glm::aligned_mediump_mat3x2; + using glm::aligned_lowp_mat3x2; + using glm::aligned_highp_dmat3x2; + using glm::aligned_mediump_dmat3x2; + using glm::aligned_lowp_dmat3x2; + using glm::packed_highp_mat3x2; + using glm::packed_mediump_mat3x2; + using glm::packed_lowp_mat3x2; + using glm::packed_highp_dmat3x2; + using glm::packed_mediump_dmat3x2; + using glm::packed_lowp_dmat3x2; + using glm::aligned_highp_mat3x3; + using glm::aligned_mediump_mat3x3; + using glm::aligned_lowp_mat3x3; + using glm::aligned_highp_dmat3x3; + using glm::aligned_mediump_dmat3x3; + using glm::aligned_lowp_dmat3x3; + using glm::packed_highp_mat3x3; + using glm::packed_mediump_mat3x3; + using glm::packed_lowp_mat3x3; + using glm::packed_highp_dmat3x3; + using glm::packed_mediump_dmat3x3; + using glm::packed_lowp_dmat3x3; + using glm::aligned_highp_mat3x4; + using glm::aligned_mediump_mat3x4; + using glm::aligned_lowp_mat3x4; + using glm::aligned_highp_dmat3x4; + using glm::aligned_mediump_dmat3x4; + using glm::aligned_lowp_dmat3x4; + using glm::packed_highp_mat3x4; + using glm::packed_mediump_mat3x4; + using glm::packed_lowp_mat3x4; + using glm::packed_highp_dmat3x4; + using glm::packed_mediump_dmat3x4; + using glm::packed_lowp_dmat3x4; + using glm::aligned_highp_mat4x2; + using glm::aligned_mediump_mat4x2; + using glm::aligned_lowp_mat4x2; + using glm::aligned_highp_dmat4x2; + using glm::aligned_mediump_dmat4x2; + using glm::aligned_lowp_dmat4x2; + using glm::packed_highp_mat4x2; + using glm::packed_mediump_mat4x2; + using glm::packed_lowp_mat4x2; + using glm::packed_highp_dmat4x2; + using glm::packed_mediump_dmat4x2; + using glm::packed_lowp_dmat4x2; + using glm::aligned_highp_mat4x3; + using glm::aligned_mediump_mat4x3; + using glm::aligned_lowp_mat4x3; + using glm::aligned_highp_dmat4x3; + using glm::aligned_mediump_dmat4x3; + using glm::aligned_lowp_dmat4x3; + using glm::packed_highp_mat4x3; + using glm::packed_mediump_mat4x3; + using glm::packed_lowp_mat4x3; + using glm::packed_highp_dmat4x3; + using glm::packed_mediump_dmat4x3; + using glm::packed_lowp_dmat4x3; + using glm::aligned_highp_mat4x4; + using glm::aligned_mediump_mat4x4; + using glm::aligned_lowp_mat4x4; + using glm::aligned_highp_dmat4x4; + using glm::aligned_mediump_dmat4x4; + using glm::aligned_lowp_dmat4x4; + using glm::packed_highp_mat4x4; + using glm::packed_mediump_mat4x4; + using glm::packed_lowp_mat4x4; + using glm::packed_highp_dmat4x4; + using glm::packed_mediump_dmat4x4; + using glm::packed_lowp_dmat4x4; +# if(defined(GLM_PRECISION_LOWP_FLOAT)) + using glm::aligned_vec1; + using glm::aligned_vec2; + using glm::aligned_vec3; + using glm::aligned_vec4; + using glm::packed_vec1; + using glm::packed_vec2; + using glm::packed_vec3; + using glm::packed_vec4; + using glm::aligned_mat2; + using glm::aligned_mat3; + using glm::aligned_mat4; + using glm::packed_mat2; + using glm::packed_mat3; + using glm::packed_mat4; + using glm::aligned_mat2x2; + using glm::aligned_mat2x3; + using glm::aligned_mat2x4; + using glm::aligned_mat3x2; + using glm::aligned_mat3x3; + using glm::aligned_mat3x4; + using glm::aligned_mat4x2; + using glm::aligned_mat4x3; + using glm::aligned_mat4x4; + using glm::packed_mat2x2; + using glm::packed_mat2x3; + using glm::packed_mat2x4; + using glm::packed_mat3x2; + using glm::packed_mat3x3; + using glm::packed_mat3x4; + using glm::packed_mat4x2; + using glm::packed_mat4x3; + using glm::packed_mat4x4; +# elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) + using glm::aligned_vec1; + using glm::aligned_vec2; + using glm::aligned_vec3; + using glm::aligned_vec4; + using glm::packed_vec1; + using glm::packed_vec2; + using glm::packed_vec3; + using glm::packed_vec4; + using glm::aligned_mat2; + using glm::aligned_mat3; + using glm::aligned_mat4; + using glm::packed_mat2; + using glm::packed_mat3; + using glm::packed_mat4; + using glm::aligned_mat2x2; + using glm::aligned_mat2x3; + using glm::aligned_mat2x4; + using glm::aligned_mat3x2; + using glm::aligned_mat3x3; + using glm::aligned_mat3x4; + using glm::aligned_mat4x2; + using glm::aligned_mat4x3; + using glm::aligned_mat4x4; + using glm::packed_mat2x2; + using glm::packed_mat2x3; + using glm::packed_mat2x4; + using glm::packed_mat3x2; + using glm::packed_mat3x3; + using glm::packed_mat3x4; + using glm::packed_mat4x2; + using glm::packed_mat4x3; + using glm::packed_mat4x4; +# else //defined(GLM_PRECISION_HIGHP_FLOAT) + using glm::aligned_vec1; + using glm::aligned_vec2; + using glm::aligned_vec3; + using glm::aligned_vec4; + using glm::packed_vec1; + using glm::packed_vec2; + using glm::packed_vec3; + using glm::packed_vec4; + using glm::aligned_mat2; + using glm::aligned_mat3; + using glm::aligned_mat4; + using glm::packed_mat2; + using glm::packed_mat3; + using glm::packed_mat4; + using glm::aligned_mat2x2; + using glm::aligned_mat2x3; + using glm::aligned_mat2x4; + using glm::aligned_mat3x2; + using glm::aligned_mat3x3; + using glm::aligned_mat3x4; + using glm::aligned_mat4x2; + using glm::aligned_mat4x3; + using glm::aligned_mat4x4; + using glm::packed_mat2x2; + using glm::packed_mat2x3; + using glm::packed_mat2x4; + using glm::packed_mat3x2; + using glm::packed_mat3x3; + using glm::packed_mat3x4; + using glm::packed_mat4x2; + using glm::packed_mat4x3; + using glm::packed_mat4x4; +# endif//GLM_PRECISION +# if(defined(GLM_PRECISION_LOWP_DOUBLE)) + using glm::aligned_dvec1; + using glm::aligned_dvec2; + using glm::aligned_dvec3; + using glm::aligned_dvec4; + using glm::packed_dvec1; + using glm::packed_dvec2; + using glm::packed_dvec3; + using glm::packed_dvec4; + using glm::aligned_dmat2; + using glm::aligned_dmat3; + using glm::aligned_dmat4; + using glm::packed_dmat2; + using glm::packed_dmat3; + using glm::packed_dmat4; + using glm::aligned_dmat2x2; + using glm::aligned_dmat2x3; + using glm::aligned_dmat2x4; + using glm::aligned_dmat3x2; + using glm::aligned_dmat3x3; + using glm::aligned_dmat3x4; + using glm::aligned_dmat4x2; + using glm::aligned_dmat4x3; + using glm::aligned_dmat4x4; + using glm::packed_dmat2x2; + using glm::packed_dmat2x3; + using glm::packed_dmat2x4; + using glm::packed_dmat3x2; + using glm::packed_dmat3x3; + using glm::packed_dmat3x4; + using glm::packed_dmat4x2; + using glm::packed_dmat4x3; + using glm::packed_dmat4x4; +# elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) + using glm::aligned_dvec1; + using glm::aligned_dvec2; + using glm::aligned_dvec3; + using glm::aligned_dvec4; + using glm::packed_dvec1; + using glm::packed_dvec2; + using glm::packed_dvec3; + using glm::packed_dvec4; + using glm::aligned_dmat2; + using glm::aligned_dmat3; + using glm::aligned_dmat4; + using glm::packed_dmat2; + using glm::packed_dmat3; + using glm::packed_dmat4; + using glm::aligned_dmat2x2; + using glm::aligned_dmat2x3; + using glm::aligned_dmat2x4; + using glm::aligned_dmat3x2; + using glm::aligned_dmat3x3; + using glm::aligned_dmat3x4; + using glm::aligned_dmat4x2; + using glm::aligned_dmat4x3; + using glm::aligned_dmat4x4; + using glm::packed_dmat2x2; + using glm::packed_dmat2x3; + using glm::packed_dmat2x4; + using glm::packed_dmat3x2; + using glm::packed_dmat3x3; + using glm::packed_dmat3x4; + using glm::packed_dmat4x2; + using glm::packed_dmat4x3; + using glm::packed_dmat4x4; +# else //defined(GLM_PRECISION_HIGHP_DOUBLE) + using glm::aligned_dvec1; + using glm::aligned_dvec2; + using glm::aligned_dvec3; + using glm::aligned_dvec4; + using glm::packed_dvec1; + using glm::packed_dvec2; + using glm::packed_dvec3; + using glm::packed_dvec4; + using glm::aligned_dmat2; + using glm::aligned_dmat3; + using glm::aligned_dmat4; + using glm::packed_dmat2; + using glm::packed_dmat3; + using glm::packed_dmat4; + using glm::aligned_dmat2x2; + using glm::aligned_dmat2x3; + using glm::aligned_dmat2x4; + using glm::aligned_dmat3x2; + using glm::aligned_dmat3x3; + using glm::aligned_dmat3x4; + using glm::aligned_dmat4x2; + using glm::aligned_dmat4x3; + using glm::aligned_dmat4x4; + using glm::packed_dmat2x2; + using glm::packed_dmat2x3; + using glm::packed_dmat2x4; + using glm::packed_dmat3x2; + using glm::packed_dmat3x3; + using glm::packed_dmat3x4; + using glm::packed_dmat4x2; + using glm::packed_dmat4x3; + using glm::packed_dmat4x4; +# endif//GLM_PRECISION +# if(defined(GLM_PRECISION_LOWP_INT)) + using glm::aligned_ivec1; + using glm::aligned_ivec2; + using glm::aligned_ivec3; + using glm::aligned_ivec4; +# elif(defined(GLM_PRECISION_MEDIUMP_INT)) + using glm::aligned_ivec1; + using glm::aligned_ivec2; + using glm::aligned_ivec3; + using glm::aligned_ivec4; +# else //defined(GLM_PRECISION_HIGHP_INT) + using glm::aligned_ivec1; + using glm::aligned_ivec2; + using glm::aligned_ivec3; + using glm::aligned_ivec4; + using glm::packed_ivec1; + using glm::packed_ivec2; + using glm::packed_ivec3; + using glm::packed_ivec4; +# endif//GLM_PRECISION +# if(defined(GLM_PRECISION_LOWP_UINT)) + using glm::aligned_uvec1; + using glm::aligned_uvec2; + using glm::aligned_uvec3; + using glm::aligned_uvec4; +# elif(defined(GLM_PRECISION_MEDIUMP_UINT)) + using glm::aligned_uvec1; + using glm::aligned_uvec2; + using glm::aligned_uvec3; + using glm::aligned_uvec4; +# else //defined(GLM_PRECISION_HIGHP_UINT) + using glm::aligned_uvec1; + using glm::aligned_uvec2; + using glm::aligned_uvec3; + using glm::aligned_uvec4; + using glm::packed_uvec1; + using glm::packed_uvec2; + using glm::packed_uvec3; + using glm::packed_uvec4; +# endif//GLM_PRECISION +# if(defined(GLM_PRECISION_LOWP_BOOL)) + using glm::aligned_bvec1; + using glm::aligned_bvec2; + using glm::aligned_bvec3; + using glm::aligned_bvec4; +# elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) + using glm::aligned_bvec1; + using glm::aligned_bvec2; + using glm::aligned_bvec3; + using glm::aligned_bvec4; +# else //defined(GLM_PRECISION_HIGHP_BOOL) + using glm::aligned_bvec1; + using glm::aligned_bvec2; + using glm::aligned_bvec3; + using glm::aligned_bvec4; + using glm::packed_bvec1; + using glm::packed_bvec2; + using glm::packed_bvec3; + using glm::packed_bvec4; +# endif//GLM_PRECISION +# endif + + + using glm::abs; + using glm::acos; + using glm::acosh; + using glm::acot; + using glm::acoth; + using glm::acsc; + using glm::acsch; + using glm::affineInverse; + using glm::all; + using glm::angle; + using glm::angleAxis; + using glm::any; + using glm::asec; + using glm::asech; + using glm::asin; + using glm::asinh; + using glm::atan; + using glm::atanh; + using glm::axis; + using glm::ballRand; + using glm::bitCount; + using glm::bitfieldDeinterleave; + using glm::bitfieldExtract; + using glm::bitfieldFillOne; + using glm::bitfieldFillZero; + using glm::bitfieldInsert; + using glm::bitfieldInterleave; + using glm::bitfieldReverse; + using glm::bitfieldRotateLeft; + using glm::bitfieldRotateRight; + using glm::ceil; + using glm::ceilMultiple; + using glm::ceilPowerOfTwo; + using glm::circularRand; + using glm::clamp; + using glm::column; + using glm::conjugate; + using glm::convertLinearToSRGB; + using glm::convertSRGBToLinear; + using glm::cos; + using glm::cos_one_over_two; + using glm::cosh; + using glm::cot; + using glm::coth; + using glm::cross; + using glm::csc; + using glm::csch; + using glm::degrees; + using glm::determinant; + using glm::diskRand; + using glm::distance; + using glm::dot; + using glm::e; + using glm::epsilon; + using glm::epsilonEqual; + using glm::epsilonNotEqual; + using glm::equal; + using glm::euler; + using glm::eulerAngles; + using glm::exp; + using glm::exp2; + using glm::faceforward; + using glm::fclamp; + using glm::findLSB; + using glm::findMSB; + using glm::floatBitsToInt; + using glm::floatBitsToUint; + using glm::float_distance; + using glm::floor; + using glm::floorMultiple; + using glm::floorPowerOfTwo; + using glm::fma; + using glm::fmax; + using glm::fmin; + using glm::four_over_pi; + using glm::fract; + using glm::frexp; + using glm::frustum; + using glm::frustumLH; + using glm::frustumLH_NO; + using glm::frustumLH_ZO; + using glm::frustumNO; + using glm::frustumRH; + using glm::frustumRH_NO; + using glm::frustumRH_ZO; + using glm::frustumZO; + using glm::gaussRand; + using glm::golden_ratio; + using glm::greaterThan; + using glm::greaterThanEqual; + using glm::half_pi; + using glm::identity; + using glm::imulExtended; + using glm::infinitePerspective; + using glm::infinitePerspectiveLH; + using glm::infinitePerspectiveRH; + using glm::intBitsToFloat; + using glm::inverse; + using glm::inverseTranspose; + using glm::inversesqrt; + using glm::iround; + using glm::isinf; + using glm::isnan; + using glm::ldexp; + using glm::length; + using glm::lerp; + using glm::lessThan; + using glm::lessThanEqual; + using glm::linearRand; + using glm::ln_ln_two; + using glm::ln_ten; + using glm::ln_two; + using glm::log; + using glm::log2; + using glm::lookAt; + using glm::lookAtLH; + using glm::lookAtRH; + using glm::make_mat2; + using glm::make_mat2x2; + using glm::make_mat2x3; + using glm::make_mat2x4; + using glm::make_mat3; + using glm::make_mat3x2; + using glm::make_mat3x3; + using glm::make_mat3x4; + using glm::make_mat4; + using glm::make_mat4x2; + using glm::make_mat4x3; + using glm::make_mat4x4; + using glm::make_quat; + using glm::make_vec1; + using glm::make_vec2; + using glm::make_vec3; + using glm::make_vec4; + using glm::mask; + using glm::mat3_cast; + using glm::mat4_cast; + using glm::matrixCompMult; + using glm::max; + using glm::min; + using glm::mirrorClamp; + using glm::mirrorRepeat; + using glm::mix; + using glm::mod; + using glm::modf; + using glm::next_float; + using glm::normalize; + using glm::notEqual; + using glm::not_; + using glm::one; + using glm::one_over_pi; + using glm::one_over_root_two; + using glm::one_over_two_pi; + using glm::ortho; + using glm::orthoLH; + using glm::orthoLH_NO; + using glm::orthoLH_ZO; + using glm::orthoNO; + using glm::orthoRH; + using glm::orthoRH_NO; + using glm::orthoRH_ZO; + using glm::orthoZO; + using glm::outerProduct; + using glm::packF2x11_1x10; + using glm::packF3x9_E1x5; + using glm::packHalf; + using glm::packHalf1x16; + using glm::packHalf4x16; + using glm::packI3x10_1x2; + using glm::packInt2x16; + using glm::packInt2x32; + using glm::packInt2x8; + using glm::packInt4x16; + using glm::packInt4x8; + using glm::packRGBM; + using glm::packSnorm; + using glm::packSnorm1x16; + using glm::packSnorm1x8; + using glm::packSnorm2x8; + using glm::packSnorm3x10_1x2; + using glm::packSnorm4x16; + using glm::packU3x10_1x2; + using glm::packUint2x16; + using glm::packUint2x32; + using glm::packUint2x8; + using glm::packUint4x16; + using glm::packUint4x8; + using glm::packUnorm; + using glm::packUnorm1x16; + using glm::packUnorm1x5_1x6_1x5; + using glm::packUnorm1x8; + using glm::packUnorm2x3_1x2; + using glm::packUnorm2x4; + using glm::packUnorm2x8; + using glm::packUnorm3x10_1x2; + using glm::packUnorm3x5_1x1; + using glm::packUnorm4x16; + using glm::packUnorm4x4; + using glm::perlin; + using glm::perspective; + using glm::perspectiveFov; + using glm::perspectiveFovLH; + using glm::perspectiveFovLH_NO; + using glm::perspectiveFovLH_ZO; + using glm::perspectiveFovNO; + using glm::perspectiveFovRH; + using glm::perspectiveFovRH_NO; + using glm::perspectiveFovRH_ZO; + using glm::perspectiveFovZO; + using glm::perspectiveLH; + using glm::perspectiveLH_NO; + using glm::perspectiveLH_ZO; + using glm::perspectiveNO; + using glm::perspectiveRH; + using glm::perspectiveRH_NO; + using glm::perspectiveRH_ZO; + using glm::perspectiveZO; + using glm::pi; + using glm::pickMatrix; + using glm::pitch; + using glm::pow; + using glm::prev_float; + using glm::project; + using glm::projectNO; + using glm::projectZO; + using glm::quarter_pi; + using glm::quatLookAt; + using glm::quatLookAtLH; + using glm::quatLookAtRH; + using glm::quat_cast; + using glm::radians; + using glm::reflect; + using glm::refract; + using glm::repeat; + using glm::roll; + using glm::root_five; + using glm::root_half_pi; + using glm::root_ln_four; + using glm::root_pi; + using glm::root_three; + using glm::root_two; + using glm::root_two_pi; + using glm::rotate; + using glm::round; + using glm::roundEven; + using glm::roundMultiple; + using glm::roundPowerOfTwo; + using glm::row; + using glm::scale; + using glm::sec; + using glm::sech; + using glm::sign; + using glm::simplex; + using glm::sin; + using glm::sinh; + using glm::slerp; + using glm::smoothstep; + using glm::sphericalRand; + using glm::sqrt; + using glm::step; + using glm::tan; + using glm::tanh; + using glm::third; + using glm::three_over_two_pi; + using glm::translate; + using glm::transpose; + using glm::trunc; + using glm::tweakedInfinitePerspective; + using glm::two_over_pi; + using glm::two_over_root_pi; + using glm::two_pi; + using glm::two_thirds; + using glm::uaddCarry; + using glm::uintBitsToFloat; + using glm::umulExtended; + using glm::unProject; + using glm::unProjectNO; + using glm::unProjectZO; + using glm::unpackF2x11_1x10; + using glm::unpackF3x9_E1x5; + using glm::unpackHalf; + using glm::unpackHalf1x16; + using glm::unpackHalf4x16; + using glm::unpackI3x10_1x2; + using glm::unpackInt2x16; + using glm::unpackInt2x32; + using glm::unpackInt2x8; + using glm::unpackInt4x16; + using glm::unpackInt4x8; + using glm::unpackRGBM; + using glm::unpackSnorm; + using glm::unpackSnorm1x16; + using glm::unpackSnorm1x8; + using glm::unpackSnorm2x8; + using glm::unpackSnorm3x10_1x2; + using glm::unpackSnorm4x16; + using glm::unpackU3x10_1x2; + using glm::unpackUint2x16; + using glm::unpackUint2x32; + using glm::unpackUint2x8; + using glm::unpackUint4x16; + using glm::unpackUint4x8; + using glm::unpackUnorm; + using glm::unpackUnorm1x16; + using glm::unpackUnorm1x5_1x6_1x5; + using glm::unpackUnorm1x8; + using glm::unpackUnorm2x3_1x2; + using glm::unpackUnorm2x4; + using glm::unpackUnorm2x8; + using glm::unpackUnorm3x10_1x2; + using glm::unpackUnorm3x5_1x1; + using glm::unpackUnorm4x16; + using glm::unpackUnorm4x4; + using glm::uround; + using glm::usubBorrow; + using glm::value_ptr; + using glm::yaw; + using glm::zero; + } + +# ifdef GLM_EXT_INLINE_NAMESPACE + inline +# endif + namespace ext { + using glm::abs; + using glm::acos; + using glm::acosh; + using glm::acot; + using glm::acoth; + using glm::acsc; + using glm::acsch; + using glm::all; + using glm::angle; + using glm::angleAxis; + using glm::any; + using glm::asec; + using glm::asech; + using glm::asin; + using glm::asinh; + using glm::atan; + using glm::atanh; + using glm::axis; + using glm::ceil; + using glm::clamp; + using glm::conjugate; + using glm::cos; + using glm::cos_one_over_two; + using glm::cosh; + using glm::cot; + using glm::coth; + using glm::cross; + using glm::csc; + using glm::csch; + using glm::degrees; + using glm::determinant; + using glm::distance; + using glm::dot; + using glm::e; + using glm::epsilon; + using glm::equal; + using glm::euler; + using glm::exp; + using glm::exp2; + using glm::faceforward; + using glm::fclamp; + using glm::findNSB; + using glm::floatBitsToInt; + using glm::floatBitsToUint; + using glm::floatDistance; + using glm::floor; + using glm::fma; + using glm::fmax; + using glm::fmin; + using glm::four_over_pi; + using glm::fract; + using glm::frexp; + using glm::frustum; + using glm::frustumLH; + using glm::frustumLH_NO; + using glm::frustumLH_ZO; + using glm::frustumNO; + using glm::frustumRH; + using glm::frustumRH_NO; + using glm::frustumRH_ZO; + using glm::frustumZO; + using glm::golden_ratio; + using glm::greaterThan; + using glm::greaterThanEqual; + using glm::half_pi; + using glm::identity; + using glm::infinitePerspective; + using glm::infinitePerspectiveLH; + using glm::infinitePerspectiveRH; + using glm::intBitsToFloat; + using glm::inverse; + using glm::inversesqrt; + using glm::iround; + using glm::isMultiple; + using glm::isPowerOfTwo; + using glm::isinf; + using glm::isnan; + using glm::ldexp; + using glm::length; + using glm::lerp; + using glm::lessThan; + using glm::lessThanEqual; + using glm::ln_ln_two; + using glm::ln_ten; + using glm::ln_two; + using glm::log; + using glm::log2; + using glm::lookAt; + using glm::lookAtLH; + using glm::lookAtRH; + using glm::matrixCompMult; + using glm::max; + using glm::min; + using glm::mirrorClamp; + using glm::mirrorRepeat; + using glm::mix; + using glm::mod; + using glm::modf; + using glm::nextFloat; + using glm::nextMultiple; + using glm::nextPowerOfTwo; + using glm::normalize; + using glm::notEqual; + using glm::not_; + using glm::one; + using glm::one_over_pi; + using glm::one_over_root_two; + using glm::one_over_two_pi; + using glm::ortho; + using glm::orthoLH; + using glm::orthoLH_NO; + using glm::orthoLH_ZO; + using glm::orthoNO; + using glm::orthoRH; + using glm::orthoRH_NO; + using glm::orthoRH_ZO; + using glm::orthoZO; + using glm::outerProduct; + using glm::perspective; + using glm::perspectiveFov; + using glm::perspectiveFovLH; + using glm::perspectiveFovLH_NO; + using glm::perspectiveFovLH_ZO; + using glm::perspectiveFovNO; + using glm::perspectiveFovRH; + using glm::perspectiveFovRH_NO; + using glm::perspectiveFovRH_ZO; + using glm::perspectiveFovZO; + using glm::perspectiveLH; + using glm::perspectiveLH_NO; + using glm::perspectiveLH_ZO; + using glm::perspectiveNO; + using glm::perspectiveRH; + using glm::perspectiveRH_NO; + using glm::perspectiveRH_ZO; + using glm::perspectiveZO; + using glm::pi; + using glm::pickMatrix; + using glm::pow; + using glm::prevFloat; + using glm::prevMultiple; + using glm::prevPowerOfTwo; + using glm::project; + using glm::projectNO; + using glm::projectZO; + using glm::quarter_pi; + using glm::radians; + using glm::reflect; + using glm::refract; + using glm::repeat; + using glm::root_five; + using glm::root_half_pi; + using glm::root_ln_four; + using glm::root_pi; + using glm::root_three; + using glm::root_two; + using glm::root_two_pi; + using glm::rotate; + using glm::round; + using glm::roundEven; + using glm::scale; + using glm::sec; + using glm::sech; + using glm::sign; + using glm::sin; + using glm::sinh; + using glm::slerp; + using glm::smoothstep; + using glm::sqrt; + using glm::step; + using glm::tan; + using glm::tanh; + using glm::third; + using glm::three_over_two_pi; + using glm::translate; + using glm::transpose; + using glm::trunc; + using glm::tweakedInfinitePerspective; + using glm::two_over_pi; + using glm::two_over_root_pi; + using glm::two_pi; + using glm::two_thirds; + using glm::uintBitsToFloat; + using glm::unProject; + using glm::unProjectNO; + using glm::unProjectZO; + using glm::uround; + using glm::zero; + } + +# ifdef GLM_ENABLE_EXPERIMENTAL +# ifdef GLM_GTX_INLINE_NAMESPACE + inline +# endif + namespace gtx { + using glm::io::order_type; + using glm::io::format_punct; + using glm::io::basic_state_saver; + using glm::io::basic_format_saver; + using glm::io::precision; + using glm::io::width; + using glm::io::delimeter; + using glm::io::order; + using glm::io::get_facet; + using glm::io::formatted; + using glm::io::unformatted; + using glm::io::operator<<; + using glm::operator<<; + using glm::tdualquat; + +# if !((GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)) + using glm::to_string; +# endif +# if GLM_HAS_TEMPLATE_ALIASES + using glm::operator*; + using glm::operator/; +# endif +# if GLM_HAS_RANGE_FOR + using glm::components; + using glm::begin; + using glm::end; +# endif + + using glm::abs; + using glm::acos; + using glm::acosh; + using glm::adjugate; + using glm::all; + using glm::angle; + using glm::angleAxis; + using glm::any; + using glm::areCollinear; + using glm::areOrthogonal; + using glm::areOrthonormal; + using glm::asin; + using glm::asinh; + using glm::associatedMax; + using glm::associatedMin; + using glm::atan; + using glm::atanh; + using glm::axis; + using glm::axisAngle; + using glm::axisAngleMatrix; + using glm::backEaseIn; + using glm::backEaseInOut; + using glm::backEaseOut; + using glm::bitCount; + using glm::bitfieldDeinterleave; + using glm::bitfieldExtract; + using glm::bitfieldFillOne; + using glm::bitfieldFillZero; + using glm::bitfieldInsert; + using glm::bitfieldInterleave; + using glm::bitfieldReverse; + using glm::bitfieldRotateLeft; + using glm::bitfieldRotateRight; + using glm::bounceEaseIn; + using glm::bounceEaseInOut; + using glm::bounceEaseOut; + using glm::catmullRom; + using glm::ceil; + using glm::circularEaseIn; + using glm::circularEaseInOut; + using glm::circularEaseOut; + using glm::clamp; + using glm::closeBounded; + using glm::closestPointOnLine; + using glm::colMajor2; + using glm::colMajor3; + using glm::colMajor4; + using glm::compAdd; + using glm::compMax; + using glm::compMin; + using glm::compMul; + using glm::compNormalize; + using glm::compScale; + using glm::computeCovarianceMatrix; + using glm::conjugate; + using glm::convertD65XYZToD50XYZ; + using glm::convertD65XYZToLinearSRGB; + using glm::convertLinearSRGBToD50XYZ; + using glm::convertLinearSRGBToD65XYZ; + using glm::cos; + using glm::cos_one_over_two; + using glm::cosh; + using glm::cross; + using glm::cubic; + using glm::cubicEaseIn; + using glm::cubicEaseInOut; + using glm::cubicEaseOut; + using glm::decompose; + using glm::degrees; + using glm::derivedEulerAngleX; + using glm::derivedEulerAngleY; + using glm::derivedEulerAngleZ; + using glm::determinant; + using glm::diagonal2x2; + using glm::diagonal2x3; + using glm::diagonal2x4; + using glm::diagonal3x2; + using glm::diagonal3x3; + using glm::diagonal3x4; + using glm::diagonal4x2; + using glm::diagonal4x3; + using glm::diagonal4x4; + using glm::distance; + using glm::distance2; + using glm::dot; + using glm::dual_quat_identity; + using glm::dualquat_cast; + using glm::e; + using glm::elasticEaseIn; + using glm::elasticEaseInOut; + using glm::elasticEaseOut; + using glm::epsilon; + using glm::epsilonEqual; + using glm::epsilonNotEqual; + using glm::equal; + using glm::euclidean; + using glm::euler; + using glm::eulerAngleX; + using glm::eulerAngleXY; + using glm::eulerAngleXYX; + using glm::eulerAngleXYZ; + using glm::eulerAngleXZ; + using glm::eulerAngleXZX; + using glm::eulerAngleXZY; + using glm::eulerAngleY; + using glm::eulerAngleYX; + using glm::eulerAngleYXY; + using glm::eulerAngleYXZ; + using glm::eulerAngleYZ; + using glm::eulerAngleYZX; + using glm::eulerAngleYZY; + using glm::eulerAngleZ; + using glm::eulerAngleZX; + using glm::eulerAngleZXY; + using glm::eulerAngleZXZ; + using glm::eulerAngleZY; + using glm::eulerAngleZYX; + using glm::eulerAngleZYZ; + using glm::eulerAngles; + using glm::exp; + using glm::exp2; + using glm::exponentialEaseIn; + using glm::exponentialEaseInOut; + using glm::exponentialEaseOut; + using glm::extend; + using glm::extractEulerAngleXYX; + using glm::extractEulerAngleXYZ; + using glm::extractEulerAngleXZX; + using glm::extractEulerAngleXZY; + using glm::extractEulerAngleYXY; + using glm::extractEulerAngleYXZ; + using glm::extractEulerAngleYZX; + using glm::extractEulerAngleYZY; + using glm::extractEulerAngleZXY; + using glm::extractEulerAngleZXZ; + using glm::extractEulerAngleZYX; + using glm::extractEulerAngleZYZ; + using glm::extractMatrixRotation; + using glm::extractRealComponent; + using glm::faceforward; + using glm::factorial; + using glm::fastAcos; + using glm::fastAsin; + using glm::fastAtan; + using glm::fastCos; + using glm::fastDistance; + using glm::fastExp; + using glm::fastExp2; + using glm::fastInverseSqrt; + using glm::fastLength; + using glm::fastLog; + using glm::fastLog2; + using glm::fastMix; + using glm::fastNormalize; + using glm::fastNormalizeDot; + using glm::fastPow; + using glm::fastSin; + using glm::fastSqrt; + using glm::fastTan; + using glm::fclamp; + using glm::findLSB; + using glm::findMSB; + using glm::fliplr; + using glm::flipud; + using glm::floatBitsToInt; + using glm::floatBitsToUint; + using glm::floor; + using glm::floor_log2; + using glm::fma; + using glm::fmax; + using glm::fmin; + using glm::fmod; + using glm::four_over_pi; + using glm::fract; + using glm::frexp; + using glm::frustum; + using glm::frustumLH; + using glm::frustumLH_NO; + using glm::frustumLH_ZO; + using glm::frustumNO; + using glm::frustumRH; + using glm::frustumRH_NO; + using glm::frustumRH_ZO; + using glm::frustumZO; + using glm::gauss; + using glm::golden_ratio; + using glm::greaterThan; + using glm::greaterThanEqual; + using glm::half_pi; + using glm::hermite; + using glm::highestBitValue; + using glm::hsvColor; + using glm::identity; + using glm::imulExtended; + using glm::infinitePerspective; + using glm::infinitePerspectiveLH; + using glm::infinitePerspectiveRH; + using glm::intBitsToFloat; + using glm::intermediate; + using glm::interpolate; + using glm::intersectLineSphere; + using glm::intersectLineTriangle; + using glm::intersectRayPlane; + using glm::intersectRaySphere; + using glm::intersectRayTriangle; + using glm::inverse; + using glm::inversesqrt; + using glm::iround; + using glm::isCompNull; + using glm::isIdentity; + using glm::isNormalized; + using glm::isNull; + using glm::isOrthogonal; + using glm::isdenormal; + using glm::isfinite; + using glm::isinf; + using glm::isnan; + using glm::l1Norm; + using glm::l2Norm; + using glm::lMaxNorm; + using glm::ldexp; + using glm::leftHanded; + using glm::length; + using glm::length2; + using glm::lerp; + using glm::lessThan; + using glm::lessThanEqual; + using glm::linearGradient; + using glm::linearInterpolation; + using glm::ln_ln_two; + using glm::ln_ten; + using glm::ln_two; + using glm::log; + using glm::log2; + using glm::lookAt; + using glm::lookAtLH; + using glm::lookAtRH; + using glm::lowestBitValue; + using glm::luminosity; + using glm::lxNorm; + using glm::make_mat2; + using glm::make_mat2x2; + using glm::make_mat2x3; + using glm::make_mat2x4; + using glm::make_mat3; + using glm::make_mat3x2; + using glm::make_mat3x3; + using glm::make_mat3x4; + using glm::make_mat4; + using glm::make_mat4x2; + using glm::make_mat4x3; + using glm::make_mat4x4; + using glm::make_quat; + using glm::make_vec1; + using glm::make_vec2; + using glm::make_vec3; + using glm::make_vec4; + using glm::mask; + using glm::mat2x4_cast; + using glm::mat3_cast; + using glm::mat3x4_cast; + using glm::mat4_cast; + using glm::matrixCompMult; + using glm::matrixCross3; + using glm::matrixCross4; + using glm::max; + using glm::min; + using glm::mirrorClamp; + using glm::mirrorRepeat; + using glm::mix; + using glm::mixedProduct; + using glm::mod; + using glm::modf; + using glm::nlz; + using glm::normalize; + using glm::normalizeDot; + using glm::notEqual; + using glm::not_; + using glm::YCoCg2rgb; + using glm::YCoCgR2rgb; + using glm::one; + using glm::one_over_pi; + using glm::one_over_root_two; + using glm::one_over_two_pi; + using glm::openBounded; + using glm::orientate2; + using glm::orientate3; + using glm::orientate4; + using glm::orientation; + using glm::orientedAngle; + using glm::ortho; + using glm::orthoLH; + using glm::orthoLH_NO; + using glm::orthoLH_ZO; + using glm::orthoNO; + using glm::orthoRH; + using glm::orthoRH_NO; + using glm::orthoRH_ZO; + using glm::orthoZO; + using glm::orthonormalize; + using glm::outerProduct; + using glm::packDouble2x32; + using glm::packHalf2x16; + using glm::packSnorm2x16; + using glm::packSnorm4x8; + using glm::packUnorm2x16; + using glm::packUnorm4x8; + using glm::perp; + using glm::perspective; + using glm::perspectiveFov; + using glm::perspectiveFovLH; + using glm::perspectiveFovLH_NO; + using glm::perspectiveFovLH_ZO; + using glm::perspectiveFovNO; + using glm::perspectiveFovRH; + using glm::perspectiveFovRH_NO; + using glm::perspectiveFovRH_ZO; + using glm::perspectiveFovZO; + using glm::perspectiveLH; + using glm::perspectiveLH_NO; + using glm::perspectiveLH_ZO; + using glm::perspectiveNO; + using glm::perspectiveRH; + using glm::perspectiveRH_NO; + using glm::perspectiveRH_ZO; + using glm::perspectiveZO; + using glm::pi; + using glm::pickMatrix; + using glm::pitch; + using glm::polar; + using glm::pow; + using glm::pow2; + using glm::pow3; + using glm::pow4; + using glm::powerOfTwoAbove; + using glm::powerOfTwoBelow; + using glm::powerOfTwoNearest; + using glm::proj; + using glm::proj2D; + using glm::proj3D; + using glm::project; + using glm::projectNO; + using glm::projectZO; + using glm::qr_decompose; + using glm::quadraticEaseIn; + using glm::quadraticEaseInOut; + using glm::quadraticEaseOut; + using glm::quarter_pi; + using glm::quarticEaseIn; + using glm::quarticEaseInOut; + using glm::quarticEaseOut; + using glm::quatLookAt; + using glm::quatLookAtLH; + using glm::quatLookAtRH; + using glm::quat_cast; + using glm::quat_identity; + using glm::quinticEaseIn; + using glm::quinticEaseInOut; + using glm::quinticEaseOut; + using glm::radialGradient; + using glm::radians; + using glm::recompose; + using glm::reflect; + using glm::refract; + using glm::repeat; + using glm::rgb2YCoCg; + using glm::rgb2YCoCgR; + using glm::rgbColor; + using glm::rightHanded; + using glm::roll; + using glm::root_five; + using glm::root_half_pi; + using glm::root_ln_four; + using glm::root_pi; + using glm::root_three; + using glm::root_two; + using glm::root_two_pi; + using glm::rotate; + using glm::rotateNormalizedAxis; + using glm::rotateX; + using glm::rotateY; + using glm::rotateZ; + using glm::rotation; + using glm::round; + using glm::roundEven; + using glm::rowMajor2; + using glm::rowMajor3; + using glm::rowMajor4; + using glm::rq_decompose; + using glm::saturation; + using glm::scale; + using glm::scaleBias; + using glm::shearX2D; + using glm::shearX3D; + using glm::shearY2D; + using glm::shearY3D; + using glm::shearZ3D; + using glm::shortMix; + using glm::sign; + using glm::sin; + using glm::sineEaseIn; + using glm::sineEaseInOut; + using glm::sineEaseOut; + using glm::sinh; + using glm::slerp; + using glm::smoothstep; + using glm::sortEigenvalues; + using glm::sqrt; + using glm::squad; + using glm::step; + using glm::tan; + using glm::tanh; + using glm::third; + using glm::three_over_two_pi; + using glm::toMat3; + using glm::toMat4; + using glm::toQuat; + using glm::translate; + using glm::transpose; + using glm::triangleNormal; + using glm::trunc; + using glm::tweakedInfinitePerspective; + using glm::two_over_pi; + using glm::two_over_root_pi; + using glm::two_pi; + using glm::two_thirds; + using glm::uaddCarry; + using glm::uintBitsToFloat; + using glm::umulExtended; + using glm::unProject; + using glm::unProjectNO; + using glm::unProjectZO; + using glm::unpackDouble2x32; + using glm::unpackHalf2x16; + using glm::unpackSnorm2x16; + using glm::unpackSnorm4x8; + using glm::unpackUnorm2x16; + using glm::unpackUnorm4x8; + using glm::uround; + using glm::usubBorrow; + using glm::value_ptr; + using glm::wrapAngle; + using glm::wxyz; + using glm::yaw; + using glm::yawPitchRoll; + using glm::zero; + } +# endif +} + +#if defined(_MSC_VER) // Workaround +// Partial template specialization doesn't need to be exported explicitly, but this may not work otherwise on MSVC. +export namespace std { + using std::hash; // See GLM_GTX_hash +} +#endif diff --git a/vendor/glm/glm.hpp b/vendor/glm/glm.hpp old mode 100755 new mode 100644 index cfd0ce275e..8b375459a7 --- a/vendor/glm/glm.hpp +++ b/vendor/glm/glm.hpp @@ -1,14 +1,17 @@ /// @ref core /// @file glm/glm.hpp /// +/// @mainpage OpenGL Mathematics (GLM) +/// - Website: glm.g-truc.net +/// - GLM API documentation +/// - GLM Manual +/// /// @defgroup core Core features /// /// @brief Features that implement in C++ the GLSL specification as closely as possible. /// -/// The GLM core consists of @ref core_types "C++ types that mirror GLSL types" and -/// C++ functions that mirror the GLSL functions. It also includes -/// @ref core_precision "a set of qualifier-based types" that can be used in the appropriate -/// functions. The C++ types are all based on a basic set of @ref core_template "template types". +/// The GLM core consists of C++ types that mirror GLSL types and +/// C++ functions that mirror the GLSL functions. /// /// The best documentation for GLM Core is the current GLSL specification, /// version 4.2 @@ -16,39 +19,54 @@ /// /// GLM core functionalities require to be included to be used. /// -/// @defgroup core_types Types /// -/// @brief The standard types defined by the specification. +/// @defgroup core_vector Vector types /// -/// These types are all typedefs of more generalized, template types. To see the definition -/// of these template types, go to @ref core_template. +/// Vector types of two to four components with an exhaustive set of operators. /// /// @ingroup core /// -/// @defgroup core_precision Precision types /// -/// @brief Non-GLSL types that are used to define qualifier-based types. +/// @defgroup core_vector_precision Vector types with precision qualifiers +/// +/// @brief Vector types with precision qualifiers which may result in various precision in term of ULPs /// -/// The GLSL language allows the user to define the qualifier of a particular variable. -/// In OpenGL's GLSL, these qualifier qualifiers have no effect; they are there for compatibility -/// with OpenGL ES's qualifier qualifiers, where they @em do have an effect. +/// GLSL allows defining qualifiers for particular variables. +/// With OpenGL's GLSL, these qualifiers have no effect; they are there for compatibility, +/// with OpenGL ES's GLSL, these qualifiers do have an effect. /// /// C++ has no language equivalent to qualifier qualifiers. So GLM provides the next-best thing: -/// a number of typedefs of the @ref core_template that use a particular qualifier. +/// a number of typedefs that use a particular qualifier. /// /// None of these types make any guarantees about the actual qualifier used. /// /// @ingroup core /// -/// @defgroup core_template Template types /// -/// @brief The generic template types used as the basis for the core types. +/// @defgroup core_matrix Matrix types +/// +/// Matrix types of with C columns and R rows where C and R are values between 2 to 4 included. +/// These types have exhaustive sets of operators. +/// +/// @ingroup core +/// +/// +/// @defgroup core_matrix_precision Matrix types with precision qualifiers +/// +/// @brief Matrix types with precision qualifiers which may result in various precision in term of ULPs /// -/// These types are all templates used to define the actual @ref core_types. -/// These templates are implementation details of GLM types and should not be used explicitly. +/// GLSL allows defining qualifiers for particular variables. +/// With OpenGL's GLSL, these qualifiers have no effect; they are there for compatibility, +/// with OpenGL ES's GLSL, these qualifiers do have an effect. +/// +/// C++ has no language equivalent to qualifier qualifiers. So GLM provides the next-best thing: +/// a number of typedefs that use a particular qualifier. +/// +/// None of these types make any guarantees about the actual qualifier used. /// /// @ingroup core /// +/// /// @defgroup ext Stable extensions /// /// @brief Additional features not specified by GLSL specification. @@ -58,6 +76,7 @@ /// Even if it's highly unrecommended, it's possible to include all the extensions at once by /// including . Otherwise, each extension needs to be included a specific file. /// +/// /// @defgroup gtc Recommended extensions /// /// @brief Additional features not specified by GLSL specification. @@ -67,6 +86,7 @@ /// Even if it's highly unrecommended, it's possible to include all the extensions at once by /// including . Otherwise, each extension needs to be included a specific file. /// +/// /// @defgroup gtx Experimental extensions /// /// @brief Experimental features not specified by GLSL specification. @@ -80,10 +100,6 @@ /// at once by including . Otherwise, each extension needs to be /// included a specific file. /// -/// @mainpage OpenGL Mathematics (GLM) -/// - Website: glm.g-truc.net -/// - GLM API documentation -/// - GLM Manual #include "detail/_fixes.hpp" @@ -98,11 +114,6 @@ #include #include "fwd.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED) -# define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED -# pragma message("GLM: Core library included") -#endif//GLM_MESSAGES - #include "vec2.hpp" #include "vec3.hpp" #include "vec4.hpp" diff --git a/vendor/glm/gtc/bitfield.hpp b/vendor/glm/gtc/bitfield.hpp old mode 100755 new mode 100644 index 9dcec53423..084fbe75ff --- a/vendor/glm/gtc/bitfield.hpp +++ b/vendor/glm/gtc/bitfield.hpp @@ -16,12 +16,14 @@ #pragma once // Dependencies +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" #include "../detail/qualifier.hpp" -#include "../detail/type_int.hpp" #include "../detail/_vectorize.hpp" +#include "type_precision.hpp" #include -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_bitfield extension included") #endif @@ -124,6 +126,18 @@ namespace glm /// @see gtc_bitfield GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y); + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint16 bitfieldInterleave(u8vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u8vec2 bitfieldDeinterleave(glm::uint16 x); + /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. /// The other bits are interleaved following the previous sequence. @@ -138,6 +152,18 @@ namespace glm /// @see gtc_bitfield GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y); + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(u16vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u16vec2 bitfieldDeinterleave(glm::uint32 x); + /// Interleaves the bits of x and y. /// The first bit is the first bit of x followed by the first bit of y. /// The other bits are interleaved following the previous sequence. @@ -152,6 +178,18 @@ namespace glm /// @see gtc_bitfield GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y); + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(u32vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u32vec2 bitfieldDeinterleave(glm::uint64 x); + /// Interleaves the bits of x, y and z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The other bits are interleaved following the previous sequence. diff --git a/vendor/glm/gtc/bitfield.inl b/vendor/glm/gtc/bitfield.inl old mode 100755 new mode 100644 index 97357408aa..cbfd3888ca --- a/vendor/glm/gtc/bitfield.inl +++ b/vendor/glm/gtc/bitfield.inl @@ -1,5 +1,4 @@ /// @ref gtc_bitfield -/// @file glm/gtc/bitfield.inl #include "../simd/integer.h" @@ -222,20 +221,29 @@ namespace detail } }//namespace detail +#if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wsign-compare" +#endif + template GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); - return Bits >= sizeof(genIUType) * 8 ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); + return Bits >= static_cast(sizeof(genIUType) * 8) ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); } +#if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +#endif + template GLM_FUNC_QUALIFIER vec mask(vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); - return detail::functor1::call(mask, v); + return detail::functor1::call(mask, v); } template @@ -324,6 +332,34 @@ namespace detail return detail::bitfieldInterleave(x, y); } + GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(u8vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER u8vec2 bitfieldDeinterleave(glm::uint16 x) + { + uint16 REG1(x); + uint16 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x5555); + REG2 = REG2 & static_cast(0x5555); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x3333); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x3333); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0xFFFF); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0xFFFF); + + return glm::u8vec2(REG1, REG2); + } + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int16 x, int16 y) { union sign16 @@ -350,6 +386,34 @@ namespace detail return detail::bitfieldInterleave(x, y); } + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(u16vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER glm::u16vec2 bitfieldDeinterleave(glm::uint32 x) + { + glm::uint32 REG1(x); + glm::uint32 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x55555555); + REG2 = REG2 & static_cast(0x55555555); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x33333333); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x33333333); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F0F0F); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F0F0F); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF00FF); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF00FF); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0x0000FFFF); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0x0000FFFF); + + return glm::u16vec2(REG1, REG2); + } + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y) { union sign32 @@ -376,6 +440,37 @@ namespace detail return detail::bitfieldInterleave(x, y); } + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(u32vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER glm::u32vec2 bitfieldDeinterleave(glm::uint64 x) + { + glm::uint64 REG1(x); + glm::uint64 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x5555555555555555ull); + REG2 = REG2 & static_cast(0x5555555555555555ull); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x3333333333333333ull); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x3333333333333333ull); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F0F0F0F0F0F0Full); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F0F0F0F0F0F0Full); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF00FF00FF00FFull); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF00FF00FF00FFull); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0x0000FFFF0000FFFFull); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0x0000FFFF0000FFFFull); + + REG1 = ((REG1 >> 16) | REG1) & static_cast(0x00000000FFFFFFFFull); + REG2 = ((REG2 >> 16) | REG2) & static_cast(0x00000000FFFFFFFFull); + + return glm::u32vec2(REG1, REG2); + } + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z) { union sign8 @@ -403,6 +498,11 @@ namespace detail return detail::bitfieldInterleave(x, y, z); } + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z) { union sign16 @@ -430,6 +530,11 @@ namespace detail return detail::bitfieldInterleave(x, y, z); } + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z) { union sign16 @@ -457,6 +562,11 @@ namespace detail return detail::bitfieldInterleave(x, y, z); } + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u32vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) { union sign8 @@ -485,6 +595,11 @@ namespace detail return detail::bitfieldInterleave(x, y, z, w); } + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec4 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); + } + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) { union sign16 @@ -512,4 +627,9 @@ namespace detail { return detail::bitfieldInterleave(x, y, z, w); } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec4 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); + } }//namespace glm diff --git a/vendor/glm/gtc/color_space.hpp b/vendor/glm/gtc/color_space.hpp old mode 100755 new mode 100644 index 56cbc8fc6c..cffd9f093f --- a/vendor/glm/gtc/color_space.hpp +++ b/vendor/glm/gtc/color_space.hpp @@ -21,7 +21,7 @@ #include "../vec4.hpp" #include -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_color_space extension included") #endif diff --git a/vendor/glm/gtc/color_space.inl b/vendor/glm/gtc/color_space.inl old mode 100755 new mode 100644 index 53241ac099..2a900044e9 --- a/vendor/glm/gtc/color_space.inl +++ b/vendor/glm/gtc/color_space.inl @@ -1,5 +1,4 @@ /// @ref gtc_color_space -/// @file glm/gtc/color_space.inl namespace glm{ namespace detail diff --git a/vendor/glm/gtc/constants.hpp b/vendor/glm/gtc/constants.hpp old mode 100755 new mode 100644 index f55f619038..6a1f37d30f --- a/vendor/glm/gtc/constants.hpp +++ b/vendor/glm/gtc/constants.hpp @@ -13,9 +13,9 @@ #pragma once // Dependencies -#include "../detail/setup.hpp" +#include "../ext/scalar_constants.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_constants extension included") #endif @@ -24,11 +24,6 @@ namespace glm /// @addtogroup gtc_constants /// @{ - /// Return the epsilon constant for floating point types. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); - /// Return 0. /// @see gtc_constants template @@ -39,15 +34,15 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR genType one(); - /// Return the pi constant. + /// Return pi * 2. /// @see gtc_constants template - GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); - /// Return pi * 2. + /// Return unit-circle circumference, or pi * 2. /// @see gtc_constants template - GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType tau(); /// Return square root of pi. /// @see gtc_constants diff --git a/vendor/glm/gtc/constants.inl b/vendor/glm/gtc/constants.inl old mode 100755 new mode 100644 index b1d277c4bf..e9d3776148 --- a/vendor/glm/gtc/constants.inl +++ b/vendor/glm/gtc/constants.inl @@ -1,16 +1,7 @@ /// @ref gtc_constants -/// @file glm/gtc/constants.inl - -#include namespace glm { - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() - { - return std::numeric_limits::epsilon(); - } - template GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero() { @@ -24,15 +15,15 @@ namespace glm } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() { - return genType(3.14159265358979323846264338327950288); + return genType(6.28318530717958647692528676655900576); } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType tau() { - return genType(6.28318530717958647692528676655900576); + return two_pi(); } template @@ -178,4 +169,5 @@ namespace glm { return genType(1.61803398874989484820458683436563811); } + } //namespace glm diff --git a/vendor/glm/gtc/epsilon.hpp b/vendor/glm/gtc/epsilon.hpp old mode 100755 new mode 100644 index dce03ef718..640439b11c --- a/vendor/glm/gtc/epsilon.hpp +++ b/vendor/glm/gtc/epsilon.hpp @@ -17,7 +17,7 @@ #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_epsilon extension included") #endif diff --git a/vendor/glm/gtc/epsilon.inl b/vendor/glm/gtc/epsilon.inl old mode 100755 new mode 100644 index 2478cabd95..508b9f8966 --- a/vendor/glm/gtc/epsilon.inl +++ b/vendor/glm/gtc/epsilon.inl @@ -1,11 +1,8 @@ /// @ref gtc_epsilon -/// @file glm/gtc/epsilon.inl // Dependency: -#include "quaternion.hpp" #include "../vector_relational.hpp" #include "../common.hpp" -#include "../detail/type_vec.hpp" namespace glm { @@ -68,14 +65,14 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonEqual(tquat const& x, tquat const& y, T const& epsilon) + GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonEqual(qua const& x, qua const& y, T const& epsilon) { vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); return lessThan(abs(v), vec<4, T, Q>(epsilon)); } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonNotEqual(tquat const& x, tquat const& y, T const& epsilon) + GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonNotEqual(qua const& x, qua const& y, T const& epsilon) { vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); diff --git a/vendor/glm/gtc/integer.hpp b/vendor/glm/gtc/integer.hpp old mode 100755 new mode 100644 index 1d28c32c1c..cff08dc85b --- a/vendor/glm/gtc/integer.hpp +++ b/vendor/glm/gtc/integer.hpp @@ -19,9 +19,11 @@ #include "../common.hpp" #include "../integer.hpp" #include "../exponential.hpp" +#include "../ext/scalar_common.hpp" +#include "../ext/vector_common.hpp" #include -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_integer extension included") #endif @@ -30,34 +32,10 @@ namespace glm /// @addtogroup gtc_integer /// @{ - /// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size. - /// @see gtc_integer - template - GLM_FUNC_DECL genIUType log2(genIUType x); - - /// Returns a value equal to the nearest integer to x. - /// The fraction 0.5 will round in a direction chosen by the - /// implementation, presumably the direction that is fastest. - /// - /// @param x The values of the argument must be greater or equal to zero. - /// @tparam T floating point scalar types. - /// - /// @see GLSL round man page - /// @see gtc_integer - template - GLM_FUNC_DECL vec iround(vec const& x); - - /// Returns a value equal to the nearest integer to x. - /// The fraction 0.5 will round in a direction chosen by the - /// implementation, presumably the direction that is fastest. - /// - /// @param x The values of the argument must be greater or equal to zero. - /// @tparam T floating point scalar types. - /// - /// @see GLSL round man page + /// Returns the log2 of x for integer values. Useful to compute mipmap count from the texture size. /// @see gtc_integer template - GLM_FUNC_DECL vec uround(vec const& x); + GLM_FUNC_DECL vec log2(vec const& v); /// @} } //namespace glm diff --git a/vendor/glm/gtc/integer.inl b/vendor/glm/gtc/integer.inl old mode 100755 new mode 100644 index 9d4b618538..5f66dfe2c0 --- a/vendor/glm/gtc/integer.inl +++ b/vendor/glm/gtc/integer.inl @@ -1,5 +1,4 @@ /// @ref gtc_integer -/// @file glm/gtc/integer.inl namespace glm{ namespace detail @@ -31,39 +30,4 @@ namespace detail }; # endif//GLM_HAS_BITSCAN_WINDOWS }//namespace detail - template - GLM_FUNC_QUALIFIER int iround(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); - assert(static_cast(0.0) <= x); - - return static_cast(x + static_cast(0.5)); - } - - template - GLM_FUNC_QUALIFIER vec iround(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); - assert(all(lessThanEqual(vec(0), x))); - - return vec(x + static_cast(0.5)); - } - - template - GLM_FUNC_QUALIFIER uint uround(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); - assert(static_cast(0.0) <= x); - - return static_cast(x + static_cast(0.5)); - } - - template - GLM_FUNC_QUALIFIER vec uround(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); - assert(all(lessThanEqual(vec(0), x))); - - return vec(x + static_cast(0.5)); - } }//namespace glm diff --git a/vendor/glm/gtc/matrix_access.hpp b/vendor/glm/gtc/matrix_access.hpp old mode 100755 new mode 100644 index 3a67cff6b4..4935ba755d --- a/vendor/glm/gtc/matrix_access.hpp +++ b/vendor/glm/gtc/matrix_access.hpp @@ -15,7 +15,7 @@ // Dependency: #include "../detail/setup.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_matrix_access extension included") #endif diff --git a/vendor/glm/gtc/matrix_access.inl b/vendor/glm/gtc/matrix_access.inl old mode 100755 new mode 100644 index 176136ab40..09fcc10d3d --- a/vendor/glm/gtc/matrix_access.inl +++ b/vendor/glm/gtc/matrix_access.inl @@ -1,5 +1,4 @@ /// @ref gtc_matrix_access -/// @file glm/gtc/matrix_access.inl namespace glm { diff --git a/vendor/glm/gtc/matrix_integer.hpp b/vendor/glm/gtc/matrix_integer.hpp old mode 100755 new mode 100644 index 59aec12eae..d7ebdc7192 --- a/vendor/glm/gtc/matrix_integer.hpp +++ b/vendor/glm/gtc/matrix_integer.hpp @@ -23,7 +23,7 @@ #include "../mat4x3.hpp" #include "../mat4x4.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_matrix_integer extension included") #endif @@ -329,159 +329,105 @@ namespace glm /// @see gtc_matrix_integer typedef mat<4, 4, uint, lowp> lowp_umat4x4; -#if(defined(GLM_PRECISION_HIGHP_INT)) - typedef highp_imat2 imat2; - typedef highp_imat3 imat3; - typedef highp_imat4 imat4; - typedef highp_imat2x2 imat2x2; - typedef highp_imat2x3 imat2x3; - typedef highp_imat2x4 imat2x4; - typedef highp_imat3x2 imat3x2; - typedef highp_imat3x3 imat3x3; - typedef highp_imat3x4 imat3x4; - typedef highp_imat4x2 imat4x2; - typedef highp_imat4x3 imat4x3; - typedef highp_imat4x4 imat4x4; -#elif(defined(GLM_PRECISION_LOWP_INT)) - typedef lowp_imat2 imat2; - typedef lowp_imat3 imat3; - typedef lowp_imat4 imat4; - typedef lowp_imat2x2 imat2x2; - typedef lowp_imat2x3 imat2x3; - typedef lowp_imat2x4 imat2x4; - typedef lowp_imat3x2 imat3x2; - typedef lowp_imat3x3 imat3x3; - typedef lowp_imat3x4 imat3x4; - typedef lowp_imat4x2 imat4x2; - typedef lowp_imat4x3 imat4x3; - typedef lowp_imat4x4 imat4x4; -#else //if(defined(GLM_PRECISION_MEDIUMP_INT)) + /// Signed integer 2x2 matrix. /// @see gtc_matrix_integer - typedef mediump_imat2 imat2; + typedef mat<2, 2, int, defaultp> imat2; /// Signed integer 3x3 matrix. /// @see gtc_matrix_integer - typedef mediump_imat3 imat3; + typedef mat<3, 3, int, defaultp> imat3; /// Signed integer 4x4 matrix. /// @see gtc_matrix_integer - typedef mediump_imat4 imat4; + typedef mat<4, 4, int, defaultp> imat4; /// Signed integer 2x2 matrix. /// @see gtc_matrix_integer - typedef mediump_imat2x2 imat2x2; + typedef mat<2, 2, int, defaultp> imat2x2; /// Signed integer 2x3 matrix. /// @see gtc_matrix_integer - typedef mediump_imat2x3 imat2x3; + typedef mat<2, 3, int, defaultp> imat2x3; /// Signed integer 2x4 matrix. /// @see gtc_matrix_integer - typedef mediump_imat2x4 imat2x4; + typedef mat<2, 4, int, defaultp> imat2x4; /// Signed integer 3x2 matrix. /// @see gtc_matrix_integer - typedef mediump_imat3x2 imat3x2; + typedef mat<3, 2, int, defaultp> imat3x2; /// Signed integer 3x3 matrix. /// @see gtc_matrix_integer - typedef mediump_imat3x3 imat3x3; + typedef mat<3, 3, int, defaultp> imat3x3; /// Signed integer 3x4 matrix. /// @see gtc_matrix_integer - typedef mediump_imat3x4 imat3x4; + typedef mat<3, 4, int, defaultp> imat3x4; /// Signed integer 4x2 matrix. /// @see gtc_matrix_integer - typedef mediump_imat4x2 imat4x2; + typedef mat<4, 2, int, defaultp> imat4x2; /// Signed integer 4x3 matrix. /// @see gtc_matrix_integer - typedef mediump_imat4x3 imat4x3; + typedef mat<4, 3, int, defaultp> imat4x3; /// Signed integer 4x4 matrix. /// @see gtc_matrix_integer - typedef mediump_imat4x4 imat4x4; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_HIGHP_UINT)) - typedef highp_umat2 umat2; - typedef highp_umat3 umat3; - typedef highp_umat4 umat4; - typedef highp_umat2x2 umat2x2; - typedef highp_umat2x3 umat2x3; - typedef highp_umat2x4 umat2x4; - typedef highp_umat3x2 umat3x2; - typedef highp_umat3x3 umat3x3; - typedef highp_umat3x4 umat3x4; - typedef highp_umat4x2 umat4x2; - typedef highp_umat4x3 umat4x3; - typedef highp_umat4x4 umat4x4; -#elif(defined(GLM_PRECISION_LOWP_UINT)) - typedef lowp_umat2 umat2; - typedef lowp_umat3 umat3; - typedef lowp_umat4 umat4; - typedef lowp_umat2x2 umat2x2; - typedef lowp_umat2x3 umat2x3; - typedef lowp_umat2x4 umat2x4; - typedef lowp_umat3x2 umat3x2; - typedef lowp_umat3x3 umat3x3; - typedef lowp_umat3x4 umat3x4; - typedef lowp_umat4x2 umat4x2; - typedef lowp_umat4x3 umat4x3; - typedef lowp_umat4x4 umat4x4; -#else //if(defined(GLM_PRECISION_MEDIUMP_UINT)) + typedef mat<4, 4, int, defaultp> imat4x4; + + /// Unsigned integer 2x2 matrix. /// @see gtc_matrix_integer - typedef mediump_umat2 umat2; + typedef mat<2, 2, uint, defaultp> umat2; /// Unsigned integer 3x3 matrix. /// @see gtc_matrix_integer - typedef mediump_umat3 umat3; + typedef mat<3, 3, uint, defaultp> umat3; /// Unsigned integer 4x4 matrix. /// @see gtc_matrix_integer - typedef mediump_umat4 umat4; + typedef mat<4, 4, uint, defaultp> umat4; /// Unsigned integer 2x2 matrix. /// @see gtc_matrix_integer - typedef mediump_umat2x2 umat2x2; + typedef mat<2, 2, uint, defaultp> umat2x2; /// Unsigned integer 2x3 matrix. /// @see gtc_matrix_integer - typedef mediump_umat2x3 umat2x3; + typedef mat<2, 3, uint, defaultp> umat2x3; /// Unsigned integer 2x4 matrix. /// @see gtc_matrix_integer - typedef mediump_umat2x4 umat2x4; + typedef mat<2, 4, uint, defaultp> umat2x4; /// Unsigned integer 3x2 matrix. /// @see gtc_matrix_integer - typedef mediump_umat3x2 umat3x2; + typedef mat<3, 2, uint, defaultp> umat3x2; /// Unsigned integer 3x3 matrix. /// @see gtc_matrix_integer - typedef mediump_umat3x3 umat3x3; + typedef mat<3, 3, uint, defaultp> umat3x3; /// Unsigned integer 3x4 matrix. /// @see gtc_matrix_integer - typedef mediump_umat3x4 umat3x4; + typedef mat<3, 4, uint, defaultp> umat3x4; /// Unsigned integer 4x2 matrix. /// @see gtc_matrix_integer - typedef mediump_umat4x2 umat4x2; + typedef mat<4, 2, uint, defaultp> umat4x2; /// Unsigned integer 4x3 matrix. /// @see gtc_matrix_integer - typedef mediump_umat4x3 umat4x3; + typedef mat<4, 3, uint, defaultp> umat4x3; /// Unsigned integer 4x4 matrix. /// @see gtc_matrix_integer - typedef mediump_umat4x4 umat4x4; -#endif//GLM_PRECISION + typedef mat<4, 4, uint, defaultp> umat4x4; /// @} }//namespace glm diff --git a/vendor/glm/gtc/matrix_inverse.hpp b/vendor/glm/gtc/matrix_inverse.hpp old mode 100755 new mode 100644 index 97e8d89b79..75d53f2023 --- a/vendor/glm/gtc/matrix_inverse.hpp +++ b/vendor/glm/gtc/matrix_inverse.hpp @@ -6,7 +6,7 @@ /// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse /// @ingroup gtc /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// /// Defines additional matrix inverting functions. @@ -19,7 +19,7 @@ #include "../mat3x3.hpp" #include "../mat4x4.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_matrix_inverse extension included") #endif @@ -31,7 +31,7 @@ namespace glm /// Fast matrix inverse for affine matrix. /// /// @param m Input matrix to invert. - /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate. + /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly inaccurate. /// @see gtc_matrix_inverse template GLM_FUNC_DECL genType affineInverse(genType const& m); @@ -39,7 +39,7 @@ namespace glm /// Compute the inverse transpose of a matrix. /// /// @param m Input matrix to invert transpose. - /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate. + /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly inaccurate. /// @see gtc_matrix_inverse template GLM_FUNC_DECL genType inverseTranspose(genType const& m); diff --git a/vendor/glm/gtc/matrix_inverse.inl b/vendor/glm/gtc/matrix_inverse.inl old mode 100755 new mode 100644 index 592e690a03..c004b9e146 --- a/vendor/glm/gtc/matrix_inverse.inl +++ b/vendor/glm/gtc/matrix_inverse.inl @@ -1,5 +1,4 @@ /// @ref gtc_matrix_inverse -/// @file glm/gtc/matrix_inverse.inl namespace glm { @@ -77,14 +76,13 @@ namespace glm T SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; T SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; T SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - T SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - T SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - T SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - T SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - T SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - T SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - T SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + T SubFactor11 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + T SubFactor12 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + T SubFactor13 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + T SubFactor14 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + T SubFactor15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + T SubFactor16 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + T SubFactor17 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; mat<4, 4, T, Q> Inverse; Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); @@ -99,13 +97,13 @@ namespace glm Inverse[2][0] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08); Inverse[2][1] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10); - Inverse[2][2] = + (m[0][0] * SubFactor11 - m[0][1] * SubFactor09 + m[0][3] * SubFactor12); - Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor12); + Inverse[2][2] = + (m[0][0] * SubFactor07 - m[0][1] * SubFactor09 + m[0][3] * SubFactor11); + Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor11); - Inverse[3][0] = - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15); - Inverse[3][1] = + (m[0][0] * SubFactor13 - m[0][2] * SubFactor16 + m[0][3] * SubFactor17); - Inverse[3][2] = - (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][3] * SubFactor18); - Inverse[3][3] = + (m[0][0] * SubFactor15 - m[0][1] * SubFactor17 + m[0][2] * SubFactor18); + Inverse[3][0] = - (m[0][1] * SubFactor12 - m[0][2] * SubFactor13 + m[0][3] * SubFactor14); + Inverse[3][1] = + (m[0][0] * SubFactor12 - m[0][2] * SubFactor15 + m[0][3] * SubFactor16); + Inverse[3][2] = - (m[0][0] * SubFactor13 - m[0][1] * SubFactor15 + m[0][3] * SubFactor17); + Inverse[3][3] = + (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][2] * SubFactor17); T Determinant = + m[0][0] * Inverse[0][0] diff --git a/vendor/glm/gtc/matrix_transform.hpp b/vendor/glm/gtc/matrix_transform.hpp old mode 100755 new mode 100644 index a9d5cd0d08..612418fa51 --- a/vendor/glm/gtc/matrix_transform.hpp +++ b/vendor/glm/gtc/matrix_transform.hpp @@ -25,703 +25,12 @@ #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" -#include "../gtc/constants.hpp" +#include "../ext/matrix_projection.hpp" +#include "../ext/matrix_clip_space.hpp" +#include "../ext/matrix_transform.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_matrix_transform extension included") #endif -namespace glm -{ - /// @addtogroup gtc_matrix_transform - /// @{ - - /// Builds a translation 4 * 4 matrix created from a vector of 3 components. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param v Coordinates of a translation vector. - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @code - /// #include - /// #include - /// ... - /// glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); - /// // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f - /// // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f - /// // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f - /// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f - /// @endcode - /// @see gtc_matrix_transform - /// @see - translate(mat<4, 4, T, Q> const& m, T x, T y, T z) - /// @see - translate(vec<3, T, Q> const& v) - /// @see glTranslate man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> translate( - mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); - - /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle. - /// - /// @param m Input matrix multiplied by this rotation matrix. - /// @param angle Rotation angle expressed in radians. - /// @param axis Rotation axis, recommended to be normalized. - /// @tparam T Value type used to build the matrix. Supported: half, float or double. - /// @see gtc_matrix_transform - /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) - /// @see - rotate(T angle, vec<3, T, Q> const& v) - /// @see glRotate man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> rotate( - mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& axis); - - /// Builds a scale 4 * 4 matrix created from 3 scalars. - /// - /// @param m Input matrix multiplied by this scale matrix. - /// @param v Ratio of scaling for each axis. - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - scale(mat<4, 4, T, Q> const& m, T x, T y, T z) - /// @see - scale(vec<3, T, Q> const& v) - /// @see glScale man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> scale( - mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); - - /// Creates a matrix for projecting two-dimensional coordinates onto the screen. - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top, T const& zNear, T const& zFar) - /// @see gluOrtho2D man page - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( - T left, T right, T bottom, T top); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_ZO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume using right-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_NO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_ZO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_NO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoZO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoNO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using the default handedness and default near and far clip planes definition. - /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - /// @see glOrtho man page - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a left handed frustum matrix. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_ZO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a left handed frustum matrix. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_NO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a right handed frustum matrix. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_ZO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a right handed frustum matrix. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_NO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumZO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumNO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a left handed frustum matrix. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a right handed frustum matrix. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a frustum matrix with default handedness, using the default handedness and default near and far clip planes definition. - /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see glFrustum man page - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum( - T left, T right, T bottom, T top, T near, T far); - - - /// Creates a matrix for a right handed, symetric perspective-view frustum. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_ZO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a right handed, symetric perspective-view frustum. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_NO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a left handed, symetric perspective-view frustum. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_ZO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a left handed, symetric perspective-view frustum. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_NO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveZO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveNO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a right handed, symetric perspective-view frustum. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a left handed, symetric perspective-view frustum. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a symetric perspective-view frustum based on the default handedness and default near and far clip planes definition. - /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @param fovy Specifies the field of view angle in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - /// @see gluPerspective man page - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective( - T fovy, T aspect, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_ZO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_NO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_ZO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_NO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovZO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovNO( - T fov, T width, T height, T near, T far); - - /// Builds a right handed perspective projection matrix based on a field of view. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH( - T fov, T width, T height, T near, T far); - - /// Builds a left handed perspective projection matrix based on a field of view. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view and the default handedness and default near and far clip planes definition. - /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov( - T fov, T width, T height, T near, T far); - - /// Creates a matrix for a left handed, symmetric perspective-view frustum with far plane at infinite. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH( - T fovy, T aspect, T near); - - /// Creates a matrix for a right handed, symmetric perspective-view frustum with far plane at infinite. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH( - T fovy, T aspect, T near); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective( - T fovy, T aspect, T near); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( - T fovy, T aspect, T near); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param ep Epsilon - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// @see gtc_matrix_transform - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( - T fovy, T aspect, T near, T ep); - - /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param obj Specify the object coordinates. - /// @param model Specifies the current modelview matrix - /// @param proj Specifies the current projection matrix - /// @param viewport Specifies the current viewport - /// @return Return the computed window coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - /// @see gluProject man page - template - GLM_FUNC_DECL vec<3, T, Q> projectZO( - vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param obj Specify the object coordinates. - /// @param model Specifies the current modelview matrix - /// @param proj Specifies the current projection matrix - /// @param viewport Specifies the current viewport - /// @return Return the computed window coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - /// @see gluProject man page - template - GLM_FUNC_DECL vec<3, T, Q> projectNO( - vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates using default near and far clip planes definition. - /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @param obj Specify the object coordinates. - /// @param model Specifies the current modelview matrix - /// @param proj Specifies the current projection matrix - /// @param viewport Specifies the current viewport - /// @return Return the computed window coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - /// @see gluProject man page - template - GLM_FUNC_DECL vec<3, T, Q> project( - vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param win Specify the window coordinates to be mapped. - /// @param model Specifies the modelview matrix - /// @param proj Specifies the projection matrix - /// @param viewport Specifies the viewport - /// @return Returns the computed object coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - /// @see gluUnProject man page - template - GLM_FUNC_DECL vec<3, T, Q> unProjectZO( - vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param win Specify the window coordinates to be mapped. - /// @param model Specifies the modelview matrix - /// @param proj Specifies the projection matrix - /// @param viewport Specifies the viewport - /// @return Returns the computed object coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - /// @see gluUnProject man page - template - GLM_FUNC_DECL vec<3, T, Q> unProjectNO( - vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using default near and far clip planes definition. - /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @param win Specify the window coordinates to be mapped. - /// @param model Specifies the modelview matrix - /// @param proj Specifies the projection matrix - /// @param viewport Specifies the viewport - /// @return Returns the computed object coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - /// @see gluUnProject man page - template - GLM_FUNC_DECL vec<3, T, Q> unProject( - vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Define a picking region - /// - /// @param center Specify the center of a picking region in window coordinates. - /// @param delta Specify the width and height, respectively, of the picking region in window coordinates. - /// @param viewport Rendering viewport - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// @see gtc_matrix_transform - /// @see gluPickMatrix man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> pickMatrix( - vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport); - - /// Build a right handed look at view matrix. - /// - /// @param eye Position of the camera - /// @param center Position where the camera is looking at - /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) - /// @see gtc_matrix_transform - /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - template - GLM_FUNC_DECL mat<4, 4, T, Q> lookAtRH( - vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); - - /// Build a left handed look at view matrix. - /// - /// @param eye Position of the camera - /// @param center Position where the camera is looking at - /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) - /// @see gtc_matrix_transform - /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - template - GLM_FUNC_DECL mat<4, 4, T, Q> lookAtLH( - vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); - - /// Build a look at view matrix based on the default handedness. - /// - /// @param eye Position of the camera - /// @param center Position where the camera is looking at - /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) - /// @see gtc_matrix_transform - /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - /// @see gluLookAt man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> lookAt( - vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); - - /// @} -}//namespace glm - #include "matrix_transform.inl" diff --git a/vendor/glm/gtc/matrix_transform.inl b/vendor/glm/gtc/matrix_transform.inl old mode 100755 new mode 100644 index 12623d79db..15b46bc9db --- a/vendor/glm/gtc/matrix_transform.inl +++ b/vendor/glm/gtc/matrix_transform.inl @@ -1,808 +1,3 @@ -/// @ref gtc_matrix_transform -/// @file glm/gtc/matrix_transform.inl - #include "../geometric.hpp" #include "../trigonometric.hpp" #include "../matrix.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) - { - mat<4, 4, T, Q> Result(m); - Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - - vec<3, T, Q> axis(normalize(v)); - vec<3, T, Q> temp((T(1) - c) * axis); - - mat<4, 4, T, Q> Rotate; - Rotate[0][0] = c + temp[0] * axis[0]; - Rotate[0][1] = temp[0] * axis[1] + s * axis[2]; - Rotate[0][2] = temp[0] * axis[2] - s * axis[1]; - - Rotate[1][0] = temp[1] * axis[0] - s * axis[2]; - Rotate[1][1] = c + temp[1] * axis[1]; - Rotate[1][2] = temp[1] * axis[2] + s * axis[0]; - - Rotate[2][0] = temp[2] * axis[0] + s * axis[1]; - Rotate[2][1] = temp[2] * axis[1] - s * axis[0]; - Rotate[2][2] = c + temp[2] * axis[2]; - - mat<4, 4, T, Q> Result; - Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; - Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; - Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; - Result[3] = m[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate_slow(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - mat<4, 4, T, Q> Result; - - vec<3, T, Q> axis = normalize(v); - - Result[0][0] = c + (static_cast(1) - c) * axis.x * axis.x; - Result[0][1] = (static_cast(1) - c) * axis.x * axis.y + s * axis.z; - Result[0][2] = (static_cast(1) - c) * axis.x * axis.z - s * axis.y; - Result[0][3] = static_cast(0); - - Result[1][0] = (static_cast(1) - c) * axis.y * axis.x - s * axis.z; - Result[1][1] = c + (static_cast(1) - c) * axis.y * axis.y; - Result[1][2] = (static_cast(1) - c) * axis.y * axis.z + s * axis.x; - Result[1][3] = static_cast(0); - - Result[2][0] = (static_cast(1) - c) * axis.z * axis.x + s * axis.y; - Result[2][1] = (static_cast(1) - c) * axis.z * axis.y - s * axis.x; - Result[2][2] = c + (static_cast(1) - c) * axis.z * axis.z; - Result[2][3] = static_cast(0); - - Result[3] = vec<4, T, Q>(0, 0, 0, 1); - return m * Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) - { - mat<4, 4, T, Q> Result; - Result[0] = m[0] * v[0]; - Result[1] = m[1] * v[1]; - Result[2] = m[2] * v[2]; - Result[3] = m[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale_slow(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) - { - mat<4, 4, T, Q> Result(T(1)); - Result[0][0] = v.x; - Result[1][1] = v.y; - Result[2][2] = v.z; - return m * Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top) - { - mat<4, 4, T, defaultp> Result(static_cast(1)); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) - { - mat<4, 4, T, defaultp> Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = static_cast(1) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - zNear / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_NO(T left, T right, T bottom, T top, T zNear, T zFar) - { - mat<4, 4, T, defaultp> Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = static_cast(2) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - (zFar + zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) - { - mat<4, 4, T, defaultp> Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = - static_cast(1) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - zNear / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_NO(T left, T right, T bottom, T top, T zNear, T zFar) - { - mat<4, 4, T, defaultp> Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = - static_cast(2) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - (zFar + zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoZO(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# else - return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoNO(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# else - return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# else - return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# else - return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE - return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE - return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) - { - mat<4, 4, T, defaultp> Result(0); - Result[0][0] = (static_cast(2) * nearVal) / (right - left); - Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = farVal / (farVal - nearVal); - Result[2][3] = static_cast(1); - Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) - { - mat<4, 4, T, defaultp> Result(0); - Result[0][0] = (static_cast(2) * nearVal) / (right - left); - Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = (farVal + nearVal) / (farVal - nearVal); - Result[2][3] = static_cast(1); - Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) - { - mat<4, 4, T, defaultp> Result(0); - Result[0][0] = (static_cast(2) * nearVal) / (right - left); - Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = farVal / (nearVal - farVal); - Result[2][3] = static_cast(-1); - Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) - { - mat<4, 4, T, defaultp> Result(0); - Result[0][0] = (static_cast(2) * nearVal) / (right - left); - Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = - (farVal + nearVal) / (farVal - nearVal); - Result[2][3] = static_cast(-1); - Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumZO(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# else - return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumNO(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# else - return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# else - return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# else - return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# elif GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE - return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE - return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_ZO(T fovy, T aspect, T zNear, T zFar) - { - assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - - T const tanHalfFovy = tan(fovy / static_cast(2)); - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast(1) / (tanHalfFovy); - Result[2][2] = zFar / (zNear - zFar); - Result[2][3] = - static_cast(1); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_NO(T fovy, T aspect, T zNear, T zFar) - { - assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - - T const tanHalfFovy = tan(fovy / static_cast(2)); - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast(1) / (tanHalfFovy); - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[2][3] = - static_cast(1); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_ZO(T fovy, T aspect, T zNear, T zFar) - { - assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - - T const tanHalfFovy = tan(fovy / static_cast(2)); - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast(1) / (tanHalfFovy); - Result[2][2] = zFar / (zFar - zNear); - Result[2][3] = static_cast(1); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_NO(T fovy, T aspect, T zNear, T zFar) - { - assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - - T const tanHalfFovy = tan(fovy / static_cast(2)); - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast(1) / (tanHalfFovy); - Result[2][2] = (zFar + zNear) / (zFar - zNear); - Result[2][3] = static_cast(1); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveZO(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# else - return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveNO(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# else - return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# else - return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# else - return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE - return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE - return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_ZO(T fov, T width, T height, T zNear, T zFar) - { - assert(width > static_cast(0)); - assert(height > static_cast(0)); - assert(fov > static_cast(0)); - - T const rad = fov; - T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = zFar / (zNear - zFar); - Result[2][3] = - static_cast(1); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_NO(T fov, T width, T height, T zNear, T zFar) - { - assert(width > static_cast(0)); - assert(height > static_cast(0)); - assert(fov > static_cast(0)); - - T const rad = fov; - T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[2][3] = - static_cast(1); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_ZO(T fov, T width, T height, T zNear, T zFar) - { - assert(width > static_cast(0)); - assert(height > static_cast(0)); - assert(fov > static_cast(0)); - - T const rad = fov; - T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = zFar / (zFar - zNear); - Result[2][3] = static_cast(1); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_NO(T fov, T width, T height, T zNear, T zFar) - { - assert(width > static_cast(0)); - assert(height > static_cast(0)); - assert(fov > static_cast(0)); - - T const rad = fov; - T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = (zFar + zNear) / (zFar - zNear); - Result[2][3] = static_cast(1); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovZO(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# else - return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovNO(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# else - return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# else - return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# else - return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE - return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# elif GLM_COORDINATE_SYSTEM == GLM_RIGHT_HANDED && GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_NEGATIVE_ONE_TO_ONE - return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear) - { - T const range = tan(fovy / static_cast(2)) * zNear; - T const left = -range * aspect; - T const right = range * aspect; - T const bottom = -range; - T const top = range; - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = (static_cast(2) * zNear) / (right - left); - Result[1][1] = (static_cast(2) * zNear) / (top - bottom); - Result[2][2] = - static_cast(1); - Result[2][3] = - static_cast(1); - Result[3][2] = - static_cast(2) * zNear; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear) - { - T const range = tan(fovy / static_cast(2)) * zNear; - T const left = -range * aspect; - T const right = range * aspect; - T const bottom = -range; - T const top = range; - - mat<4, 4, T, defaultp> Result(T(0)); - Result[0][0] = (static_cast(2) * zNear) / (right - left); - Result[1][1] = (static_cast(2) * zNear) / (top - bottom); - Result[2][2] = static_cast(1); - Result[2][3] = static_cast(1); - Result[3][2] = - static_cast(2) * zNear; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return infinitePerspectiveLH(fovy, aspect, zNear); -# else - return infinitePerspectiveRH(fovy, aspect, zNear); -# endif - } - - // Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep) - { - T const range = tan(fovy / static_cast(2)) * zNear; - T const left = -range * aspect; - T const right = range * aspect; - T const bottom = -range; - T const top = range; - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = (static_cast(2) * zNear) / (right - left); - Result[1][1] = (static_cast(2) * zNear) / (top - bottom); - Result[2][2] = ep - static_cast(1); - Result[2][3] = static_cast(-1); - Result[3][2] = (ep - static_cast(2)) * zNear; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear) - { - return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon()); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> projectZO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { - vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); - tmp = model * tmp; - tmp = proj * tmp; - - tmp /= tmp.w; - tmp.x = tmp.x * static_cast(0.5) + static_cast(0.5); - tmp.y = tmp.y * static_cast(0.5) + static_cast(0.5); - - tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); - tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); - - return vec<3, T, Q>(tmp); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> projectNO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { - vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); - tmp = model * tmp; - tmp = proj * tmp; - - tmp /= tmp.w; - tmp = tmp * static_cast(0.5) + static_cast(0.5); - tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); - tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); - - return vec<3, T, Q>(tmp); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> project(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return projectZO(obj, model, proj, viewport); -# else - return projectNO(obj, model, proj, viewport); -# endif - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectZO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { - mat<4, 4, T, Q> Inverse = inverse(proj * model); - - vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); - tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); - tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); - tmp.x = tmp.x * static_cast(2) - static_cast(1); - tmp.y = tmp.y * static_cast(2) - static_cast(1); - - vec<4, T, Q> obj = Inverse * tmp; - obj /= obj.w; - - return vec<3, T, Q>(obj); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectNO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { - mat<4, 4, T, Q> Inverse = inverse(proj * model); - - vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); - tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); - tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); - tmp = tmp * static_cast(2) - static_cast(1); - - vec<4, T, Q> obj = Inverse * tmp; - obj /= obj.w; - - return vec<3, T, Q>(obj); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> unProject(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { -# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE - return unProjectZO(win, model, proj, viewport); -# else - return unProjectNO(win, model, proj, viewport); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> pickMatrix(vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport) - { - assert(delta.x > static_cast(0) && delta.y > static_cast(0)); - mat<4, 4, T, Q> Result(static_cast(1)); - - if(!(delta.x > static_cast(0) && delta.y > static_cast(0))) - return Result; // Error - - vec<3, T, Q> Temp( - (static_cast(viewport[2]) - static_cast(2) * (center.x - static_cast(viewport[0]))) / delta.x, - (static_cast(viewport[3]) - static_cast(2) * (center.y - static_cast(viewport[1]))) / delta.y, - static_cast(0)); - - // Translate and scale the picked region to the entire window - Result = translate(Result, Temp); - return scale(Result, vec<3, T, Q>(static_cast(viewport[2]) / delta.x, static_cast(viewport[3]) / delta.y, static_cast(1))); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtRH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) - { - vec<3, T, Q> const f(normalize(center - eye)); - vec<3, T, Q> const s(normalize(cross(f, up))); - vec<3, T, Q> const u(cross(s, f)); - - mat<4, 4, T, Q> Result(1); - Result[0][0] = s.x; - Result[1][0] = s.y; - Result[2][0] = s.z; - Result[0][1] = u.x; - Result[1][1] = u.y; - Result[2][1] = u.z; - Result[0][2] =-f.x; - Result[1][2] =-f.y; - Result[2][2] =-f.z; - Result[3][0] =-dot(s, eye); - Result[3][1] =-dot(u, eye); - Result[3][2] = dot(f, eye); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtLH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) - { - vec<3, T, Q> const f(normalize(center - eye)); - vec<3, T, Q> const s(normalize(cross(up, f))); - vec<3, T, Q> const u(cross(f, s)); - - mat<4, 4, T, Q> Result(1); - Result[0][0] = s.x; - Result[1][0] = s.y; - Result[2][0] = s.z; - Result[0][1] = u.x; - Result[1][1] = u.y; - Result[2][1] = u.z; - Result[0][2] = f.x; - Result[1][2] = f.y; - Result[2][2] = f.z; - Result[3][0] = -dot(s, eye); - Result[3][1] = -dot(u, eye); - Result[3][2] = -dot(f, eye); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAt(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return lookAtLH(eye, center, up); -# else - return lookAtRH(eye, center, up); -# endif - } -}//namespace glm diff --git a/vendor/glm/gtc/noise.hpp b/vendor/glm/gtc/noise.hpp old mode 100755 new mode 100644 index 7b1ca40d46..ab1772e781 --- a/vendor/glm/gtc/noise.hpp +++ b/vendor/glm/gtc/noise.hpp @@ -27,7 +27,7 @@ #include "../vec3.hpp" #include "../vec4.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_noise extension included") #endif diff --git a/vendor/glm/gtc/noise.inl b/vendor/glm/gtc/noise.inl old mode 100755 new mode 100644 index 00a80ab029..d381a8bc7d --- a/vendor/glm/gtc/noise.inl +++ b/vendor/glm/gtc/noise.inl @@ -1,13 +1,12 @@ /// @ref gtc_noise -/// @file glm/gtc/noise.inl /// // Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": -// https://github.com/ashima/webgl-noise +// https://github.com/stegu/webgl-noise // Following Stefan Gustavson's paper "Simplex noise demystified": -// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf +// https://itn-web.it.liu.se/~stegu76/simplexnoise/simplexnoise.pdf namespace glm{ -namespace gtc +namespace detail { template GLM_FUNC_QUALIFIER vec<4, T, Q> grad4(T const& j, vec<4, T, Q> const& ip) @@ -18,7 +17,7 @@ namespace gtc pXYZ = pXYZ + (vec<3, T, Q>(s) * T(2) - T(1)) * s.w; return vec<4, T, Q>(pXYZ, pW); } -}//namespace gtc +}//namespace detail // Classic Perlin noise template @@ -733,8 +732,8 @@ namespace gtc T const F4 = static_cast(0.309016994374947451); // First corner - vec<4, T, Q> i = floor(v + dot(v, vec4(F4))); - vec<4, T, Q> x0 = v - i + dot(i, vec4(C.x)); + vec<4, T, Q> i = floor(v + dot(v, vec<4, T, Q>(F4))); + vec<4, T, Q> x0 = v - i + dot(i, vec<4, T, Q>(C.x)); // Other corners @@ -782,11 +781,11 @@ namespace gtc // 7*7*6 = 294, which is close to the ring size 17*17 = 289. vec<4, T, Q> ip = vec<4, T, Q>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); - vec<4, T, Q> p0 = gtc::grad4(j0, ip); - vec<4, T, Q> p1 = gtc::grad4(j1.x, ip); - vec<4, T, Q> p2 = gtc::grad4(j1.y, ip); - vec<4, T, Q> p3 = gtc::grad4(j1.z, ip); - vec<4, T, Q> p4 = gtc::grad4(j1.w, ip); + vec<4, T, Q> p0 = detail::grad4(j0, ip); + vec<4, T, Q> p1 = detail::grad4(j1.x, ip); + vec<4, T, Q> p2 = detail::grad4(j1.y, ip); + vec<4, T, Q> p3 = detail::grad4(j1.z, ip); + vec<4, T, Q> p4 = detail::grad4(j1.w, ip); // Normalise gradients vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); diff --git a/vendor/glm/gtc/packing.hpp b/vendor/glm/gtc/packing.hpp old mode 100755 new mode 100644 index 96070c2484..8e416b3fe1 --- a/vendor/glm/gtc/packing.hpp +++ b/vendor/glm/gtc/packing.hpp @@ -15,8 +15,9 @@ // Dependency: #include "type_precision.hpp" +#include "../ext/vector_packing.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_packing extension included") #endif @@ -601,7 +602,7 @@ namespace glm - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i8vec2 unpackInt2x8(int16 p) @@ -625,7 +626,7 @@ namespace glm /// @see uint16 packInt2x8(u8vec2 const& v) GLM_FUNC_DECL u8vec2 unpackUint2x8(uint16 p); - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i8vec4 unpackInt4x8(int32 p) @@ -649,7 +650,7 @@ namespace glm /// @see uint32 packUint4x8(u8vec2 const& v) GLM_FUNC_DECL u8vec4 unpackUint4x8(uint32 p); - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i16vec2 unpackInt2x16(int p) @@ -661,7 +662,7 @@ namespace glm /// @see int packInt2x16(i16vec2 const& v) GLM_FUNC_DECL i16vec2 unpackInt2x16(int p); - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i16vec4 unpackInt4x16(int64 p) @@ -697,7 +698,7 @@ namespace glm /// @see uint64 packUint4x16(u16vec4 const& v) GLM_FUNC_DECL u16vec4 unpackUint4x16(uint64 p); - /// Convert each component from an integer vector into a packed unsigned integer. + /// Convert each component from an integer vector into a packed integer. /// /// @see gtc_packing /// @see i32vec2 unpackInt2x32(int p) @@ -721,7 +722,6 @@ namespace glm /// @see int packUint2x16(u32vec2 const& v) GLM_FUNC_DECL u32vec2 unpackUint2x32(uint64 p); - /// @} }// namespace glm diff --git a/vendor/glm/gtc/packing.inl b/vendor/glm/gtc/packing.inl old mode 100755 new mode 100644 index c12c14098e..30462bc535 --- a/vendor/glm/gtc/packing.inl +++ b/vendor/glm/gtc/packing.inl @@ -1,12 +1,13 @@ /// @ref gtc_packing -/// @file glm/gtc/packing.inl +#include "../ext/scalar_relational.hpp" +#include "../ext/vector_relational.hpp" #include "../common.hpp" -#include "../vector_relational.hpp" #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" #include "../detail/type_half.hpp" +#include "type_ptr.hpp" #include #include @@ -179,9 +180,16 @@ namespace detail // return ((floatTo11bit(x) & ((1 << 11) - 1)) << 0) | ((floatTo11bit(y) & ((1 << 11) - 1)) << 11) | ((floatTo10bit(z) & ((1 << 10) - 1)) << 22); // } +#if GLM_SILENT_WARNINGS == GLM_ENABLE +# if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# endif +#endif + union u3u3u2 { - struct + struct Data { uint x : 3; uint y : 3; @@ -192,7 +200,7 @@ namespace detail union u4u4 { - struct + struct Data { uint x : 4; uint y : 4; @@ -202,7 +210,7 @@ namespace detail union u4u4u4u4 { - struct + struct Data { uint x : 4; uint y : 4; @@ -214,7 +222,7 @@ namespace detail union u5u6u5 { - struct + struct Data { uint x : 5; uint y : 6; @@ -225,7 +233,7 @@ namespace detail union u5u5u5u1 { - struct + struct Data { uint x : 5; uint y : 5; @@ -235,9 +243,15 @@ namespace detail uint16 pack; }; +#if GLM_SILENT_WARNINGS == GLM_ENABLE +# if defined(__clang__) +# pragma clang diagnostic pop +# endif +#endif + union u10u10u10u2 { - struct + struct Data { uint x : 10; uint y : 10; @@ -249,7 +263,7 @@ namespace detail union i10i10i10i2 { - struct + struct Data { int x : 10; int y : 10; @@ -261,7 +275,7 @@ namespace detail union u9u9u9e5 { - struct + struct Data { uint x : 9; uint y : 9; @@ -282,14 +296,14 @@ namespace detail { int16 const Unpack(detail::toFloat16(v.x)); u16vec1 Packed; - memcpy(&Packed, &Unpack, sizeof(Packed)); + memcpy(value_ptr(Packed), &Unpack, sizeof(Packed)); return Packed; } GLM_FUNC_QUALIFIER static vec<1, float, Q> unpack(vec<1, uint16, Q> const& v) { i16vec1 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); + memcpy(value_ptr(Unpack), value_ptr(v), sizeof(Unpack)); return vec<1, float, Q>(detail::toFloat32(v.x)); } }; @@ -301,14 +315,14 @@ namespace detail { vec<2, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y)); u16vec2 Packed; - memcpy(&Packed, &Unpack, sizeof(Packed)); + memcpy(value_ptr(Packed), value_ptr(Unpack), sizeof(Packed)); return Packed; } GLM_FUNC_QUALIFIER static vec<2, float, Q> unpack(vec<2, uint16, Q> const& v) { i16vec2 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); + memcpy(value_ptr(Unpack), value_ptr(v), sizeof(Unpack)); return vec<2, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y)); } }; @@ -320,14 +334,14 @@ namespace detail { vec<3, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z)); u16vec3 Packed; - memcpy(&Packed, &Unpack, sizeof(Packed)); + memcpy(value_ptr(Packed), value_ptr(Unpack), sizeof(Packed)); return Packed; } GLM_FUNC_QUALIFIER static vec<3, float, Q> unpack(vec<3, uint16, Q> const& v) { i16vec3 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &v, sizeof(Unpack)); return vec<3, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z)); } }; @@ -339,15 +353,15 @@ namespace detail { vec<4, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w)); u16vec4 Packed; - memcpy(&Packed, &Unpack, sizeof(Packed)); + memcpy(value_ptr(Packed), value_ptr(Unpack), sizeof(Packed)); return Packed; } GLM_FUNC_QUALIFIER static vec<4, float, Q> unpack(vec<4, uint16, Q> const& v) { i16vec4 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<4, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w)); + memcpy(value_ptr(Unpack), &v, sizeof(Unpack)); + return vec<4, float, Q>(detail::toFloat32(Unpack.x), detail::toFloat32(Unpack.y), detail::toFloat32(Unpack.z), detail::toFloat32(Unpack.w)); } }; }//namespace detail @@ -375,7 +389,7 @@ namespace detail GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p) { u8vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return vec2(Unpack) * float(0.0039215686274509803921568627451); // 1 / 255 } @@ -400,14 +414,14 @@ namespace detail { i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f)); uint16 Packed = 0; - memcpy(&Packed, &Topack, sizeof(Packed)); + memcpy(&Packed, value_ptr(Topack), sizeof(Packed)); return Packed; } GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p) { i8vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return clamp( vec2(Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f -1.0f, 1.0f); @@ -435,7 +449,7 @@ namespace detail GLM_FUNC_QUALIFIER vec4 unpackUnorm4x16(uint64 p) { u16vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return vec4(Unpack) * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 } @@ -460,14 +474,14 @@ namespace detail { i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); uint64 Packed = 0; - memcpy(&Packed, &Topack, sizeof(Packed)); + memcpy(&Packed, value_ptr(Topack), sizeof(Packed)); return Packed; } GLM_FUNC_QUALIFIER vec4 unpackSnorm4x16(uint64 p) { i16vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return clamp( vec4(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, -1.0f, 1.0f); @@ -496,14 +510,14 @@ namespace detail detail::toFloat16(v.z), detail::toFloat16(v.w)); uint64 Packed = 0; - memcpy(&Packed, &Unpack, sizeof(Packed)); + memcpy(&Packed, value_ptr(Unpack), sizeof(Packed)); return Packed; } GLM_FUNC_QUALIFIER glm::vec4 unpackHalf4x16(uint64 v) { i16vec4 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &v, sizeof(Unpack)); return vec4( detail::toFloat32(Unpack.x), detail::toFloat32(Unpack.y), @@ -620,7 +634,7 @@ namespace detail float const ExpSharedP = max(-15.f - 1.f, floor(log2(MaxColor))) + 1.0f + 15.f; float const MaxShared = floor(MaxColor / pow(2.0f, (ExpSharedP - 15.f - 9.f)) + 0.5f); - float const ExpShared = detail::compute_equal::call(MaxShared, pow(2.0f, 9.0f)) ? ExpSharedP + 1.0f : ExpSharedP; + float const ExpShared = equal(MaxShared, pow(2.0f, 9.0f), epsilon()) ? ExpSharedP + 1.0f : ExpSharedP; uvec3 const ColorComp(floor(Color / pow(2.f, (ExpShared - 15.f - 9.f)) + 0.5f)); @@ -637,7 +651,7 @@ namespace detail detail::u9u9u9e5 Unpack; Unpack.pack = v; - return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * pow(2.0f, Unpack.data.w - 15.f - 9.f); + return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * pow(2.0f, static_cast(Unpack.data.w) - 15.f - 9.f); } // Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html @@ -683,7 +697,7 @@ namespace detail GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); + return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); } template @@ -805,7 +819,7 @@ namespace detail GLM_FUNC_QUALIFIER i8vec2 unpackInt2x8(int16 p) { i8vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -819,7 +833,7 @@ namespace detail GLM_FUNC_QUALIFIER u8vec2 unpackUint2x8(uint16 p) { u8vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -833,7 +847,7 @@ namespace detail GLM_FUNC_QUALIFIER i8vec4 unpackInt4x8(int32 p) { i8vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -847,7 +861,7 @@ namespace detail GLM_FUNC_QUALIFIER u8vec4 unpackUint4x8(uint32 p) { u8vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -861,7 +875,7 @@ namespace detail GLM_FUNC_QUALIFIER i16vec2 unpackInt2x16(int p) { i16vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -875,7 +889,7 @@ namespace detail GLM_FUNC_QUALIFIER i16vec4 unpackInt4x16(int64 p) { i16vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -889,7 +903,7 @@ namespace detail GLM_FUNC_QUALIFIER u16vec2 unpackUint2x16(uint p) { u16vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -903,7 +917,7 @@ namespace detail GLM_FUNC_QUALIFIER u16vec4 unpackUint4x16(uint64 p) { u16vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -917,7 +931,7 @@ namespace detail GLM_FUNC_QUALIFIER i32vec2 unpackInt2x32(int64 p) { i32vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } @@ -931,7 +945,7 @@ namespace detail GLM_FUNC_QUALIFIER u32vec2 unpackUint2x32(uint64 p) { u32vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); + memcpy(value_ptr(Unpack), &p, sizeof(Unpack)); return Unpack; } }//namespace glm diff --git a/vendor/glm/gtc/quaternion.hpp b/vendor/glm/gtc/quaternion.hpp old mode 100755 new mode 100644 index 25f741cc1d..314449ebd9 --- a/vendor/glm/gtc/quaternion.hpp +++ b/vendor/glm/gtc/quaternion.hpp @@ -14,13 +14,24 @@ #pragma once // Dependency: -#include "../mat3x3.hpp" -#include "../mat4x4.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" #include "../gtc/constants.hpp" - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#include "../gtc/matrix_transform.hpp" +#include "../ext/vector_relational.hpp" +#include "../ext/quaternion_common.hpp" +#include "../ext/quaternion_float.hpp" +#include "../ext/quaternion_float_precision.hpp" +#include "../ext/quaternion_double.hpp" +#include "../ext/quaternion_double_precision.hpp" +#include "../ext/quaternion_relational.hpp" +#include "../ext/quaternion_geometric.hpp" +#include "../ext/quaternion_trigonometric.hpp" +#include "../ext/quaternion_transform.hpp" +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat4x4.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_quaternion extension included") #endif @@ -29,243 +40,6 @@ namespace glm /// @addtogroup gtc_quaternion /// @{ - template - struct tquat - { - // -- Implementation detail -- - - typedef tquat type; - typedef T value_type; - - // -- Data -- - -# if GLM_HAS_ALIGNED_TYPE -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# endif -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -# pragma clang diagnostic ignored "-Wnested-anon-types" -# endif - - union - { - struct { T x, y, z, w;}; - typename detail::storage::value>::type data; - }; - -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# endif -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# endif -# else - T x, y, z, w; -# endif - - // -- Component accesses -- - - typedef length_t length_type; - /// Return the count of components of a quaternion - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} - - GLM_FUNC_DECL T & operator[](length_type i); - GLM_FUNC_DECL T const& operator[](length_type i) const; - - // -- Implicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat const& q) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat const& q); - - // -- Explicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR tquat(T s, vec<3, T, Q> const& v); - GLM_FUNC_DECL GLM_CONSTEXPR tquat(T w, T x, T y, T z); - - // -- Conversion constructors -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tquat const& q); - - /// Explicit conversion operators -# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>(); - GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>(); -# endif - - /// Create a quaternion from two normalized axis - /// - /// @param u A first normalized axis - /// @param v A second normalized axis - /// @see gtc_quaternion - /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors - GLM_FUNC_DECL tquat(vec<3, T, Q> const& u, vec<3, T, Q> const& v); - - /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. - GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, Q> const& eulerAngles); - GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<3, 3, T, Q> const& q); - GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<4, 4, T, Q> const& q); - - // -- Unary arithmetic operators -- - - GLM_FUNC_DECL tquat & operator=(tquat const& q) GLM_DEFAULT; - - template - GLM_FUNC_DECL tquat & operator=(tquat const& q); - template - GLM_FUNC_DECL tquat & operator+=(tquat const& q); - template - GLM_FUNC_DECL tquat & operator-=(tquat const& q); - template - GLM_FUNC_DECL tquat & operator*=(tquat const& q); - template - GLM_FUNC_DECL tquat & operator*=(U s); - template - GLM_FUNC_DECL tquat & operator/=(U s); - }; - - // -- Unary bit operators -- - - template - GLM_FUNC_DECL tquat operator+(tquat const& q); - - template - GLM_FUNC_DECL tquat operator-(tquat const& q); - - // -- Binary operators -- - - template - GLM_FUNC_DECL tquat operator+(tquat const& q, tquat const& p); - - template - GLM_FUNC_DECL tquat operator-(tquat const& q, tquat const& p); - - template - GLM_FUNC_DECL tquat operator*(tquat const& q, tquat const& p); - - template - GLM_FUNC_DECL vec<3, T, Q> operator*(tquat const& q, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tquat const& q); - - template - GLM_FUNC_DECL vec<4, T, Q> operator*(tquat const& q, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tquat const& q); - - template - GLM_FUNC_DECL tquat operator*(tquat const& q, T const& s); - - template - GLM_FUNC_DECL tquat operator*(T const& s, tquat const& q); - - template - GLM_FUNC_DECL tquat operator/(tquat const& q, T const& s); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(tquat const& q1, tquat const& q2); - - template - GLM_FUNC_DECL bool operator!=(tquat const& q1, tquat const& q2); - - /// Returns the length of the quaternion. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL T length(tquat const& q); - - /// Returns the normalized quaternion. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat normalize(tquat const& q); - - /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL T dot(tquat const& x, tquat const& y); - - /// Spherical linear interpolation of two quaternions. - /// The interpolation is oriented and the rotation is performed at constant speed. - /// For short path spherical linear interpolation, use the slerp function. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// @tparam T Floating-point scalar types. - /// - /// @see - slerp(tquat const& x, tquat const& y, T const& a) - /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat mix(tquat const& x, tquat const& y, T a); - - /// Linear interpolation of two quaternions. - /// The interpolation is oriented. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat lerp(tquat const& x, tquat const& y, T a); - - /// Spherical linear interpolation of two quaternions. - /// The interpolation always take the short path and the rotation is performed at constant speed. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat slerp(tquat const& x, tquat const& y, T a); - - /// Returns the q conjugate. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat conjugate(tquat const& q); - - /// Returns the q inverse. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat inverse(tquat const& q); - - /// Rotates a quaternion from a vector of 3 components axis and an angle. - /// - /// @param q Source orientation - /// @param angle Angle expressed in radians. - /// @param axis Axis of the rotation - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat rotate(tquat const& q, T const& angle, vec<3, T, Q> const& axis); - /// Returns euler angles, pitch as x, yaw as y, roll as z. /// The result is expressed in radians. /// @@ -273,7 +47,7 @@ namespace glm /// /// @see gtc_quaternion template - GLM_FUNC_DECL vec<3, T, Q> eulerAngles(tquat const& x); + GLM_FUNC_DECL vec<3, T, Q> eulerAngles(qua const& x); /// Returns roll value of euler angles expressed in radians. /// @@ -281,7 +55,7 @@ namespace glm /// /// @see gtc_quaternion template - GLM_FUNC_DECL T roll(tquat const& x); + GLM_FUNC_DECL T roll(qua const& x); /// Returns pitch value of euler angles expressed in radians. /// @@ -289,7 +63,7 @@ namespace glm /// /// @see gtc_quaternion template - GLM_FUNC_DECL T pitch(tquat const& x); + GLM_FUNC_DECL T pitch(qua const& x); /// Returns yaw value of euler angles expressed in radians. /// @@ -297,7 +71,7 @@ namespace glm /// /// @see gtc_quaternion template - GLM_FUNC_DECL T yaw(tquat const& x); + GLM_FUNC_DECL T yaw(qua const& x); /// Converts a quaternion to a 3 * 3 matrix. /// @@ -305,7 +79,7 @@ namespace glm /// /// @see gtc_quaternion template - GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(tquat const& x); + GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(qua const& x); /// Converts a quaternion to a 4 * 4 matrix. /// @@ -313,7 +87,7 @@ namespace glm /// /// @see gtc_quaternion template - GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(tquat const& x); + GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(qua const& x); /// Converts a pure rotation 3 * 3 matrix to a quaternion. /// @@ -321,7 +95,7 @@ namespace glm /// /// @see gtc_quaternion template - GLM_FUNC_DECL tquat quat_cast(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL qua quat_cast(mat<3, 3, T, Q> const& x); /// Converts a pure rotation 4 * 4 matrix to a quaternion. /// @@ -329,108 +103,70 @@ namespace glm /// /// @see gtc_quaternion template - GLM_FUNC_DECL tquat quat_cast(mat<4, 4, T, Q> const& x); - - /// Returns the quaternion rotation angle. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL T angle(tquat const& x); - - /// Returns the q rotation axis. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<3, T, Q> axis(tquat const& x); - - /// Build a quaternion from an angle and a normalized axis. - /// - /// @param angle Angle expressed in radians. - /// @param axis Axis of the quaternion, must be normalized. - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL tquat angleAxis(T const& angle, vec<3, T, Q> const& axis); + GLM_FUNC_DECL qua quat_cast(mat<4, 4, T, Q> const& x); /// Returns the component-wise comparison result of x < y. /// - /// @tparam T Floating-point scalar types. + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum /// - /// @see gtc_quaternion + /// @see ext_quaternion_relational template - GLM_FUNC_DECL vec<4, bool, Q> lessThan(tquat const& x, tquat const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> lessThan(qua const& x, qua const& y); /// Returns the component-wise comparison of result x <= y. /// - /// @tparam T Floating-point scalar types. + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum /// - /// @see gtc_quaternion + /// @see ext_quaternion_relational template - GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(tquat const& x, tquat const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> lessThanEqual(qua const& x, qua const& y); /// Returns the component-wise comparison of result x > y. /// - /// @tparam T Floating-point scalar types. + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum /// - /// @see gtc_quaternion + /// @see ext_quaternion_relational template - GLM_FUNC_DECL vec<4, bool, Q> greaterThan(tquat const& x, tquat const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> greaterThan(qua const& x, qua const& y); /// Returns the component-wise comparison of result x >= y. /// - /// @tparam T Floating-point scalar types. + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum /// - /// @see gtc_quaternion + /// @see ext_quaternion_relational template - GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(tquat const& x, tquat const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y); - /// Returns the component-wise comparison of result x == y. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<4, bool, Q> equal(tquat const& x, tquat const& y); - - /// Returns the component-wise comparison of result x != y. - /// - /// @tparam T Floating-point scalar types. + /// Build a look at quaternion based on the default handedness. /// - /// @see gtc_quaternion + /// @param direction Desired forward direction. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template - GLM_FUNC_DECL vec<4, bool, Q> notEqual(tquat const& x, tquat const& y); + GLM_FUNC_DECL qua quatLookAt( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); - /// Returns true if x holds a NaN (not a number) - /// representation in the underlying implementation's set of - /// floating point representations. Returns false otherwise, - /// including for implementations with no NaN - /// representations. - /// - /// /!\ When using compiler fast math, this function may fail. + /// Build a right-handed look at quaternion. /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion + /// @param direction Desired forward direction onto which the -z-axis gets mapped. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template - GLM_FUNC_DECL vec<4, bool, Q> isnan(tquat const& x); + GLM_FUNC_DECL qua quatLookAtRH( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); - /// Returns true if x holds a positive infinity or negative - /// infinity representation in the underlying implementation's - /// set of floating point representations. Returns false - /// otherwise, including for implementations with no infinity - /// representations. + /// Build a left-handed look at quaternion. /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion + /// @param direction Desired forward direction onto which the +z-axis gets mapped. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). template - GLM_FUNC_DECL vec<4, bool, Q> isinf(tquat const& x); - + GLM_FUNC_DECL qua quatLookAtLH( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); /// @} } //namespace glm diff --git a/vendor/glm/gtc/quaternion.inl b/vendor/glm/gtc/quaternion.inl old mode 100755 new mode 100644 index df4a5f7ead..ea159f2988 --- a/vendor/glm/gtc/quaternion.inl +++ b/vendor/glm/gtc/quaternion.inl @@ -1,622 +1,50 @@ -/// @ref gtc_quaternion -/// @file glm/gtc/quaternion.inl - #include "../trigonometric.hpp" #include "../geometric.hpp" #include "../exponential.hpp" -#include "../detail/compute_vector_relational.hpp" #include "epsilon.hpp" #include -namespace glm{ -namespace detail +namespace glm { - template - struct compute_dot, T, Aligned> - { - static GLM_FUNC_QUALIFIER T call(tquat const& a, tquat const& b) - { - vec<4, T, Q> tmp(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); - return (tmp.x + tmp.y) + (tmp.z + tmp.w); - } - }; - - template - struct compute_quat_add - { - static tquat call(tquat const& q, tquat const& p) - { - return tquat(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); - } - }; - - template - struct compute_quat_sub - { - static tquat call(tquat const& q, tquat const& p) - { - return tquat(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); - } - }; - - template - struct compute_quat_mul_scalar - { - static tquat call(tquat const& q, T s) - { - return tquat(q.w * s, q.x * s, q.y * s, q.z * s); - } - }; - - template - struct compute_quat_div_scalar - { - static tquat call(tquat const& q, T s) - { - return tquat(q.w / s, q.x / s, q.y / s, q.z / s); - } - }; - - template - struct compute_quat_mul_vec4 - { - static vec<4, T, Q> call(tquat const& q, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); - } - }; -}//namespace detail - - // -- Component accesses -- - - template - GLM_FUNC_QUALIFIER T & tquat::operator[](typename tquat::length_type i) - { - assert(i >= 0 && i < this->length()); - return (&x)[i]; - } - - template - GLM_FUNC_QUALIFIER T const& tquat::operator[](typename tquat::length_type i) const - { - assert(i >= 0 && i < this->length()); - return (&x)[i]; - } - - // -- Implicit basic constructors -- - -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat() -# ifdef GLM_FORCE_CTOR_INIT - : x(0), y(0), z(0), w(1) -# endif - {} -# endif - -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) - : x(q.x), y(q.y), z(q.z), w(q.w) - {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) - : x(q.x), y(q.y), z(q.z), w(q.w) - {} - - // -- Explicit basic constructors -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T s, vec<3, T, Q> const& v) - : x(v.x), y(v.y), z(v.z), w(s) - {} - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T _w, T _x, T _y, T _z) - : x(_x), y(_y), z(_z), w(_w) - {} - - // -- Conversion constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(tquat const& q) - : x(static_cast(q.x)) - , y(static_cast(q.y)) - , z(static_cast(q.z)) - , w(static_cast(q.w)) - {} - - //template - //GLM_FUNC_QUALIFIER tquat::tquat - //( - // valType const& pitch, - // valType const& yaw, - // valType const& roll - //) - //{ - // vec<3, valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5)); - // vec<3, valType> c = glm::cos(eulerAngle * valType(0.5)); - // vec<3, valType> s = glm::sin(eulerAngle * valType(0.5)); - // - // this->w = c.x * c.y * c.z + s.x * s.y * s.z; - // this->x = s.x * c.y * c.z - c.x * s.y * s.z; - // this->y = c.x * s.y * c.z + s.x * c.y * s.z; - // this->z = c.x * c.y * s.z - s.x * s.y * c.z; - //} - - template - GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, Q> const& u, vec<3, T, Q> const& v) - { - T norm_u_norm_v = sqrt(dot(u, u) * dot(v, v)); - T real_part = norm_u_norm_v + dot(u, v); - vec<3, T, Q> t; - - if(real_part < static_cast(1.e-6f) * norm_u_norm_v) - { - // If u and v are exactly opposite, rotate 180 degrees - // around an arbitrary orthogonal axis. Axis normalisation - // can happen later, when we normalise the quaternion. - real_part = static_cast(0); - t = abs(u.x) > abs(u.z) ? vec<3, T, Q>(-u.y, u.x, static_cast(0)) : vec<3, T, Q>(static_cast(0), -u.z, u.y); - } - else - { - // Otherwise, build quaternion the standard way. - t = cross(u, v); - } - - *this = normalize(tquat(real_part, t.x, t.y, t.z)); - } - - template - GLM_FUNC_QUALIFIER tquat::tquat(vec<3, T, Q> const& eulerAngle) - { - vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5)); - vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5)); - - this->w = c.x * c.y * c.z + s.x * s.y * s.z; - this->x = s.x * c.y * c.z - c.x * s.y * s.z; - this->y = c.x * s.y * c.z + s.x * c.y * s.z; - this->z = c.x * c.y * s.z - s.x * s.y * c.z; - } - - template - GLM_FUNC_QUALIFIER tquat::tquat(mat<3, 3, T, Q> const& m) - { - *this = quat_cast(m); - } - - template - GLM_FUNC_QUALIFIER tquat::tquat(mat<4, 4, T, Q> const& m) - { - *this = quat_cast(m); - } - -# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS template - GLM_FUNC_QUALIFIER tquat::operator mat<3, 3, T, Q>() + GLM_FUNC_QUALIFIER vec<3, T, Q> eulerAngles(qua const& x) { - return mat3_cast(*this); - } - - template - GLM_FUNC_QUALIFIER tquat::operator mat<4, 4, T, Q>() - { - return mat4_cast(*this); - } -# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - - template - GLM_FUNC_QUALIFIER tquat conjugate(tquat const& q) - { - return tquat(q.w, -q.x, -q.y, -q.z); - } - - template - GLM_FUNC_QUALIFIER tquat inverse(tquat const& q) - { - return conjugate(q) / dot(q, q); - } - - // -- Unary arithmetic operators -- - -# if !GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const& q) - { - this->w = q.w; - this->x = q.x; - this->y = q.y; - this->z = q.z; - return *this; - } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - - template - template - GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const& q) - { - this->w = static_cast(q.w); - this->x = static_cast(q.x); - this->y = static_cast(q.y); - this->z = static_cast(q.z); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER tquat & tquat::operator+=(tquat const& q) - { - return (*this = detail::compute_quat_add::value>::call(*this, tquat(q))); - } - - template - template - GLM_FUNC_QUALIFIER tquat & tquat::operator-=(tquat const& q) - { - return (*this = detail::compute_quat_sub::value>::call(*this, tquat(q))); - } - - template - template - GLM_FUNC_QUALIFIER tquat & tquat::operator*=(tquat const& r) - { - tquat const p(*this); - tquat const q(r); - - this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z; - this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y; - this->y = p.w * q.y + p.y * q.w + p.z * q.x - p.x * q.z; - this->z = p.w * q.z + p.z * q.w + p.x * q.y - p.y * q.x; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER tquat & tquat::operator*=(U s) - { - return (*this = detail::compute_quat_mul_scalar::value>::call(*this, static_cast(s))); - } - - template - template - GLM_FUNC_QUALIFIER tquat & tquat::operator/=(U s) - { - return (*this = detail::compute_quat_div_scalar::value>::call(*this, static_cast(s))); - } - - // -- Unary bit operators -- - - template - GLM_FUNC_QUALIFIER tquat operator+(tquat const& q) - { - return q; - } - - template - GLM_FUNC_QUALIFIER tquat operator-(tquat const& q) - { - return tquat(-q.w, -q.x, -q.y, -q.z); - } - - // -- Binary operators -- - - template - GLM_FUNC_QUALIFIER tquat operator+(tquat const& q, tquat const& p) - { - return tquat(q) += p; - } - - template - GLM_FUNC_QUALIFIER tquat operator-(tquat const& q, tquat const& p) - { - return tquat(q) -= p; - } - - template - GLM_FUNC_QUALIFIER tquat operator*(tquat const& q, tquat const& p) - { - return tquat(q) *= p; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(tquat const& q, vec<3, T, Q> const& v) - { - vec<3, T, Q> const QuatVector(q.x, q.y, q.z); - vec<3, T, Q> const uv(glm::cross(QuatVector, v)); - vec<3, T, Q> const uuv(glm::cross(QuatVector, uv)); - - return v + ((uv * q.w) + uuv) * static_cast(2); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, tquat const& q) - { - return glm::inverse(q) * v; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(tquat const& q, vec<4, T, Q> const& v) - { - return detail::compute_quat_mul_vec4::value>::call(q, v); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, tquat const& q) - { - return glm::inverse(q) * v; - } - - template - GLM_FUNC_QUALIFIER tquat operator*(tquat const& q, T const& s) - { - return tquat( - q.w * s, q.x * s, q.y * s, q.z * s); - } - - template - GLM_FUNC_QUALIFIER tquat operator*(T const& s, tquat const& q) - { - return q * s; - } - - template - GLM_FUNC_QUALIFIER tquat operator/(tquat const& q, T const& s) - { - return tquat( - q.w / s, q.x / s, q.y / s, q.z / s); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(tquat const& q1, tquat const& q2) - { - return all(epsilonEqual(q1, q2, epsilon())); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(tquat const& q1, tquat const& q2) - { - return any(epsilonNotEqual(q1, q2, epsilon())); - } - - // -- Operations -- - - template - GLM_FUNC_QUALIFIER T dot(tquat const& x, tquat const& y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); - return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); - } - - template - GLM_FUNC_QUALIFIER T length(tquat const& q) - { - return glm::sqrt(dot(q, q)); - } - - template - GLM_FUNC_QUALIFIER tquat normalize(tquat const& q) - { - T len = length(q); - if(len <= T(0)) // Problem - return tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); - T oneOverLen = T(1) / len; - return tquat(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); - } - - template - GLM_FUNC_QUALIFIER tquat cross(tquat const& q1, tquat const& q2) - { - return tquat( - q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, - q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, - q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, - q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); - } -/* - // (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle)) - template - GLM_FUNC_QUALIFIER tquat mix(tquat const& x, tquat const& y, T const& a) - { - if(a <= T(0)) return x; - if(a >= T(1)) return y; - - float fCos = dot(x, y); - tquat y2(y); //BUG!!! tquat y2; - if(fCos < T(0)) - { - y2 = -y; - fCos = -fCos; - } - - //if(fCos > 1.0f) // problem - float k0, k1; - if(fCos > T(0.9999)) - { - k0 = T(1) - a; - k1 = T(0) + a; //BUG!!! 1.0f + a; - } - else - { - T fSin = sqrt(T(1) - fCos * fCos); - T fAngle = atan(fSin, fCos); - T fOneOverSin = static_cast(1) / fSin; - k0 = sin((T(1) - a) * fAngle) * fOneOverSin; - k1 = sin((T(0) + a) * fAngle) * fOneOverSin; - } - - return tquat( - k0 * x.w + k1 * y2.w, - k0 * x.x + k1 * y2.x, - k0 * x.y + k1 * y2.y, - k0 * x.z + k1 * y2.z); - } - - template - GLM_FUNC_QUALIFIER tquat mix2 - ( - tquat const& x, - tquat const& y, - T const& a - ) - { - bool flip = false; - if(a <= static_cast(0)) return x; - if(a >= static_cast(1)) return y; - - T cos_t = dot(x, y); - if(cos_t < T(0)) - { - cos_t = -cos_t; - flip = true; - } - - T alpha(0), beta(0); - - if(T(1) - cos_t < 1e-7) - beta = static_cast(1) - alpha; - else - { - T theta = acos(cos_t); - T sin_t = sin(theta); - beta = sin(theta * (T(1) - alpha)) / sin_t; - alpha = sin(alpha * theta) / sin_t; - } - - if(flip) - alpha = -alpha; - - return normalize(beta * x + alpha * y); - } -*/ - - template - GLM_FUNC_QUALIFIER tquat mix(tquat const& x, tquat const& y, T a) - { - T cosTheta = dot(x, y); - - // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator - if(cosTheta > T(1) - epsilon()) - { - // Linear interpolation - return tquat( - mix(x.w, y.w, a), - mix(x.x, y.x, a), - mix(x.y, y.y, a), - mix(x.z, y.z, a)); - } - else - { - // Essential Mathematics, page 467 - T angle = acos(cosTheta); - return (sin((T(1) - a) * angle) * x + sin(a * angle) * y) / sin(angle); - } - } - - template - GLM_FUNC_QUALIFIER tquat lerp(tquat const& x, tquat const& y, T a) - { - // Lerp is only defined in [0, 1] - assert(a >= static_cast(0)); - assert(a <= static_cast(1)); - - return x * (T(1) - a) + (y * a); - } - - template - GLM_FUNC_QUALIFIER tquat slerp(tquat const& x, tquat const& y, T a) - { - tquat z = y; - - T cosTheta = dot(x, y); - - // If cosTheta < 0, the interpolation will take the long way around the sphere. - // To fix this, one quat must be negated. - if (cosTheta < T(0)) - { - z = -y; - cosTheta = -cosTheta; - } - - // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator - if(cosTheta > T(1) - epsilon()) - { - // Linear interpolation - return tquat( - mix(x.w, z.w, a), - mix(x.x, z.x, a), - mix(x.y, z.y, a), - mix(x.z, z.z, a)); - } - else - { - // Essential Mathematics, page 467 - T angle = acos(cosTheta); - return (sin((T(1) - a) * angle) * x + sin(a * angle) * z) / sin(angle); - } + return vec<3, T, Q>(pitch(x), yaw(x), roll(x)); } template - GLM_FUNC_QUALIFIER tquat rotate(tquat const& q, T const& angle, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER T roll(qua const& q) { - vec<3, T, Q> Tmp = v; - - // Axis of rotation must be normalised - T len = glm::length(Tmp); - if(abs(len - T(1)) > T(0.001)) - { - T oneOverLen = static_cast(1) / len; - Tmp.x *= oneOverLen; - Tmp.y *= oneOverLen; - Tmp.z *= oneOverLen; - } + T const y = static_cast(2) * (q.x * q.y + q.w * q.z); + T const x = q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z; - T const AngleRad(angle); - T const Sin = sin(AngleRad * T(0.5)); + if(all(equal(vec<2, T, Q>(x, y), vec<2, T, Q>(0), epsilon()))) //avoid atan2(0,0) - handle singularity - Matiis + return static_cast(0); - return q * tquat(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); - //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); + return static_cast(atan(y, x)); } template - GLM_FUNC_QUALIFIER vec<3, T, Q> eulerAngles(tquat const& x) - { - return vec<3, T, Q>(pitch(x), yaw(x), roll(x)); - } - - template - GLM_FUNC_QUALIFIER T roll(tquat const& q) - { - return static_cast(atan(static_cast(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z)); - } - - template - GLM_FUNC_QUALIFIER T pitch(tquat const& q) + GLM_FUNC_QUALIFIER T pitch(qua const& q) { //return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)); - const T y = static_cast(2) * (q.y * q.z + q.w * q.x); - const T x = q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z; + T const y = static_cast(2) * (q.y * q.z + q.w * q.x); + T const x = q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z; - if(detail::compute_equal::call(y, static_cast(0)) && detail::compute_equal::call(x, static_cast(0))) //avoid atan2(0,0) - handle singularity - Matiis - return static_cast(static_cast(2) * atan(q.x,q.w)); + if(all(equal(vec<2, T, Q>(x, y), vec<2, T, Q>(0), epsilon()))) //avoid atan2(0,0) - handle singularity - Matiis + return static_cast(static_cast(2) * atan(q.x, q.w)); - return static_cast(atan(y,x)); + return static_cast(atan(y, x)); } template - GLM_FUNC_QUALIFIER T yaw(tquat const& q) + GLM_FUNC_QUALIFIER T yaw(qua const& q) { return asin(clamp(static_cast(-2) * (q.x * q.z - q.w * q.y), static_cast(-1), static_cast(1))); } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat3_cast(tquat const& q) + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat3_cast(qua const& q) { mat<3, 3, T, Q> Result(T(1)); T qxx(q.x * q.x); @@ -644,13 +72,13 @@ namespace detail } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat4_cast(tquat const& q) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat4_cast(qua const& q) { return mat<4, 4, T, Q>(mat3_cast(q)); } template - GLM_FUNC_QUALIFIER tquat quat_cast(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER qua quat_cast(mat<3, 3, T, Q> const& m) { T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; @@ -681,128 +109,100 @@ namespace detail switch(biggestIndex) { case 0: - return tquat(biggestVal, (m[1][2] - m[2][1]) * mult, (m[2][0] - m[0][2]) * mult, (m[0][1] - m[1][0]) * mult); + return qua::wxyz(biggestVal, (m[1][2] - m[2][1]) * mult, (m[2][0] - m[0][2]) * mult, (m[0][1] - m[1][0]) * mult); case 1: - return tquat((m[1][2] - m[2][1]) * mult, biggestVal, (m[0][1] + m[1][0]) * mult, (m[2][0] + m[0][2]) * mult); + return qua::wxyz((m[1][2] - m[2][1]) * mult, biggestVal, (m[0][1] + m[1][0]) * mult, (m[2][0] + m[0][2]) * mult); case 2: - return tquat((m[2][0] - m[0][2]) * mult, (m[0][1] + m[1][0]) * mult, biggestVal, (m[1][2] + m[2][1]) * mult); + return qua::wxyz((m[2][0] - m[0][2]) * mult, (m[0][1] + m[1][0]) * mult, biggestVal, (m[1][2] + m[2][1]) * mult); case 3: - return tquat((m[0][1] - m[1][0]) * mult, (m[2][0] + m[0][2]) * mult, (m[1][2] + m[2][1]) * mult, biggestVal); + return qua::wxyz((m[0][1] - m[1][0]) * mult, (m[2][0] + m[0][2]) * mult, (m[1][2] + m[2][1]) * mult, biggestVal); default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity. assert(false); - return tquat(1, 0, 0, 0); + return qua::wxyz(1, 0, 0, 0); } } template - GLM_FUNC_QUALIFIER tquat quat_cast(mat<4, 4, T, Q> const& m4) + GLM_FUNC_QUALIFIER qua quat_cast(mat<4, 4, T, Q> const& m4) { return quat_cast(mat<3, 3, T, Q>(m4)); } template - GLM_FUNC_QUALIFIER T angle(tquat const& x) - { - return acos(x.w) * static_cast(2); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> axis(tquat const& x) - { - T tmp1 = static_cast(1) - x.w * x.w; - if(tmp1 <= static_cast(0)) - return vec<3, T, Q>(0, 0, 1); - T tmp2 = static_cast(1) / sqrt(tmp1); - return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); - } - - template - GLM_FUNC_QUALIFIER tquat angleAxis(T const& angle, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> lessThan(qua const& x, qua const& y) { - tquat Result; - - T const a(angle); - T const s = glm::sin(a * static_cast(0.5)); - - Result.w = glm::cos(a * static_cast(0.5)); - Result.x = v.x * s; - Result.y = v.y * s; - Result.z = v.z * s; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThan(tquat const& x, tquat const& y) - { - vec<4, bool, Q> Result; + vec<4, bool, Q> Result(false, false, false, false); for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] < y[i]; return Result; } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThanEqual(tquat const& x, tquat const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> lessThanEqual(qua const& x, qua const& y) { - vec<4, bool, Q> Result; + vec<4, bool, Q> Result(false, false, false, false); for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] <= y[i]; return Result; } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThan(tquat const& x, tquat const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> greaterThan(qua const& x, qua const& y) { - vec<4, bool, Q> Result; + vec<4, bool, Q> Result(false, false, false, false); for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] > y[i]; return Result; } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThanEqual(tquat const& x, tquat const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y) { - vec<4, bool, Q> Result; + vec<4, bool, Q> Result(false, false, false, false); for(length_t i = 0; i < x.length(); ++i) Result[i] = x[i] >= y[i]; return Result; } - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(tquat const& x, tquat const& y) - { - vec<4, bool, Q> Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = detail::compute_equal::call(x[i], y[i]); - return Result; - } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(tquat const& x, tquat const& y) + GLM_FUNC_QUALIFIER qua quatLookAt(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) { - vec<4, bool, Q> Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = !detail::compute_equal::call(x[i], y[i]); - return Result; +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return quatLookAtLH(direction, up); +# else + return quatLookAtRH(direction, up); +# endif } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(tquat const& q) + GLM_FUNC_QUALIFIER qua quatLookAtRH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + mat<3, 3, T, Q> Result; - return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); + Result[2] = -direction; + vec<3, T, Q> const& Right = cross(up, Result[2]); + Result[0] = Right * inversesqrt(max(static_cast(0.00001), dot(Right, Right))); + Result[1] = cross(Result[2], Result[0]); + + return quat_cast(Result); } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(tquat const& q) + GLM_FUNC_QUALIFIER qua quatLookAtLH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + mat<3, 3, T, Q> Result; + + Result[2] = direction; + vec<3, T, Q> const& Right = cross(up, Result[2]); + Result[0] = Right * inversesqrt(max(static_cast(0.00001), dot(Right, Right))); + Result[1] = cross(Result[2], Result[0]); - return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w)); + return quat_cast(Result); } }//namespace glm -#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_ALIGNED_TYPE +#if GLM_CONFIG_SIMD == GLM_ENABLE # include "quaternion_simd.inl" #endif diff --git a/vendor/glm/gtc/quaternion_simd.inl b/vendor/glm/gtc/quaternion_simd.inl old mode 100755 new mode 100644 index 06ca7b7bea..e69de29bb2 --- a/vendor/glm/gtc/quaternion_simd.inl +++ b/vendor/glm/gtc/quaternion_simd.inl @@ -1,198 +0,0 @@ -/// @ref core -/// @file glm/gtc/quaternion_simd.inl - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -namespace glm{ -namespace detail -{ -/* - template - struct compute_quat_mul - { - static tquat call(tquat const& q1, tquat const& q2) - { - // SSE2 STATS: 11 shuffle, 8 mul, 8 add - // SSE4 STATS: 3 shuffle, 4 mul, 4 dpps - - __m128 const mul0 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(0, 1, 2, 3))); - __m128 const mul1 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(1, 0, 3, 2))); - __m128 const mul2 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(2, 3, 0, 1))); - __m128 const mul3 = _mm_mul_ps(q1.Data, q2.Data); - -# if GLM_ARCH & GLM_ARCH_SSE41_BIT - __m128 const add0 = _mm_dp_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f), 0xff); - __m128 const add1 = _mm_dp_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f), 0xff); - __m128 const add2 = _mm_dp_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f), 0xff); - __m128 const add3 = _mm_dp_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f), 0xff); -# else - __m128 const mul4 = _mm_mul_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f)); - __m128 const add0 = _mm_add_ps(mul0, _mm_movehl_ps(mul4, mul4)); - __m128 const add4 = _mm_add_ss(add0, _mm_shuffle_ps(add0, add0, 1)); - - __m128 const mul5 = _mm_mul_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f)); - __m128 const add1 = _mm_add_ps(mul1, _mm_movehl_ps(mul5, mul5)); - __m128 const add5 = _mm_add_ss(add1, _mm_shuffle_ps(add1, add1, 1)); - - __m128 const mul6 = _mm_mul_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f)); - __m128 const add2 = _mm_add_ps(mul6, _mm_movehl_ps(mul6, mul6)); - __m128 const add6 = _mm_add_ss(add2, _mm_shuffle_ps(add2, add2, 1)); - - __m128 const mul7 = _mm_mul_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f)); - __m128 const add3 = _mm_add_ps(mul3, _mm_movehl_ps(mul7, mul7)); - __m128 const add7 = _mm_add_ss(add3, _mm_shuffle_ps(add3, add3, 1)); - #endif - - // This SIMD code is a politically correct way of doing this, but in every test I've tried it has been slower than - // the final code below. I'll keep this here for reference - maybe somebody else can do something better... - // - //__m128 xxyy = _mm_shuffle_ps(add4, add5, _MM_SHUFFLE(0, 0, 0, 0)); - //__m128 zzww = _mm_shuffle_ps(add6, add7, _MM_SHUFFLE(0, 0, 0, 0)); - // - //return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0)); - - tquat Result; - _mm_store_ss(&Result.x, add4); - _mm_store_ss(&Result.y, add5); - _mm_store_ss(&Result.z, add6); - _mm_store_ss(&Result.w, add7); - return Result; - } - }; -*/ - - template - struct compute_dot, float, true> - { - static GLM_FUNC_QUALIFIER float call(tquat const& x, tquat const& y) - { - return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); - } - }; - - template - struct compute_quat_add - { - static tquat call(tquat const& q, tquat const& p) - { - tquat Result; - Result.data = _mm_add_ps(q.data, p.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_add - { - static tquat call(tquat const& a, tquat const& b) - { - tquat Result; - Result.data = _mm256_add_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_quat_sub - { - static tquat call(tquat const& q, tquat const& p) - { - vec<4, float, Q> Result; - Result.data = _mm_sub_ps(q.data, p.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_sub - { - static tquat call(tquat const& a, tquat const& b) - { - tquat Result; - Result.data = _mm256_sub_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_quat_mul_scalar - { - static tquat call(tquat const& q, float s) - { - vec<4, float, Q> Result; - Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s)); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_mul_scalar - { - static tquat call(tquat const& q, double s) - { - tquat Result; - Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s)); - return Result; - } - }; -# endif - - template - struct compute_quat_div_scalar - { - static tquat call(tquat const& q, float s) - { - vec<4, float, Q> Result; - Result.data = _mm_div_ps(q.data, _mm_set_ps1(s)); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_div_scalar - { - static tquat call(tquat const& q, double s) - { - tquat Result; - Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s)); - return Result; - } - }; -# endif - - template - struct compute_quat_mul_vec4 - { - static vec<4, float, Q> call(tquat const& q, vec<4, float, Q> const& v) - { - __m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2)); - - __m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0)); - __m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 uuv = _mm_sub_ps(_mm_mul_ps(q_swp0, uv_swp1), _mm_mul_ps(q_swp1, uv_swp0)); - - __m128 const two = _mm_set1_ps(2.0f); - uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two)); - uuv = _mm_mul_ps(uuv, two); - - vec<4, float, Q> Result; - Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv)); - return Result; - } - }; -}//namespace detail -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - diff --git a/vendor/glm/gtc/random.hpp b/vendor/glm/gtc/random.hpp old mode 100755 new mode 100644 index 9156e43468..c6485bf1da --- a/vendor/glm/gtc/random.hpp +++ b/vendor/glm/gtc/random.hpp @@ -14,10 +14,11 @@ #pragma once // Dependency: -#include "../vec2.hpp" -#include "../vec3.hpp" +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/qualifier.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_random extension included") #endif @@ -51,25 +52,25 @@ namespace glm template GLM_FUNC_DECL genType gaussRand(genType Mean, genType Deviation); - /// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius + /// Generate a random 2D vector which coordinates are regularly distributed on a circle of a given radius /// /// @see gtc_random template GLM_FUNC_DECL vec<2, T, defaultp> circularRand(T Radius); - /// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius + /// Generate a random 3D vector which coordinates are regularly distributed on a sphere of a given radius /// /// @see gtc_random template GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(T Radius); - /// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius + /// Generate a random 2D vector which coordinates are regularly distributed within the area of a disk of a given radius /// /// @see gtc_random template GLM_FUNC_DECL vec<2, T, defaultp> diskRand(T Radius); - /// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius + /// Generate a random 3D vector which coordinates are regularly distributed within the volume of a ball of a given radius /// /// @see gtc_random template diff --git a/vendor/glm/gtc/random.inl b/vendor/glm/gtc/random.inl old mode 100755 new mode 100644 index 5301c59c64..5724368135 --- a/vendor/glm/gtc/random.inl +++ b/vendor/glm/gtc/random.inl @@ -1,10 +1,7 @@ -/// @ref gtc_random -/// @file glm/gtc/random.inl - #include "../geometric.hpp" #include "../exponential.hpp" #include "../trigonometric.hpp" -#include "../ext/vec1.hpp" +#include "../detail/type_vec1.hpp" #include #include #include @@ -25,7 +22,7 @@ namespace detail GLM_FUNC_QUALIFIER static vec<1, uint8, P> call() { return vec<1, uint8, P>( - std::rand() % std::numeric_limits::max()); + static_cast(std::rand() % std::numeric_limits::max())); } }; @@ -72,7 +69,7 @@ namespace detail { return (vec(compute_rand::call()) << static_cast(8)) | - (vec(compute_rand::call()) << static_cast(0)); + (vec(compute_rand::call())); } }; @@ -83,7 +80,7 @@ namespace detail { return (vec(compute_rand::call()) << static_cast(16)) | - (vec(compute_rand::call()) << static_cast(0)); + (vec(compute_rand::call())); } }; @@ -94,7 +91,7 @@ namespace detail { return (vec(compute_rand::call()) << static_cast(32)) | - (vec(compute_rand::call()) << static_cast(0)); + (vec(compute_rand::call())); } }; @@ -231,18 +228,20 @@ namespace detail w = x1 * x1 + x2 * x2; } while(w > genType(1)); - return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean; + return static_cast(x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean); } template GLM_FUNC_QUALIFIER vec gaussRand(vec const& Mean, vec const& Deviation) { - return detail::functor2::call(gaussRand, Mean, Deviation); + return detail::functor2::call(gaussRand, Mean, Deviation); } template GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius) { + assert(Radius > static_cast(0)); + vec<2, T, defaultp> Result(T(0)); T LenRadius(T(0)); @@ -261,6 +260,8 @@ namespace detail template GLM_FUNC_QUALIFIER vec<3, T, defaultp> ballRand(T Radius) { + assert(Radius > static_cast(0)); + vec<3, T, defaultp> Result(T(0)); T LenRadius(T(0)); @@ -279,6 +280,8 @@ namespace detail template GLM_FUNC_QUALIFIER vec<2, T, defaultp> circularRand(T Radius) { + assert(Radius > static_cast(0)); + T a = linearRand(T(0), static_cast(6.283185307179586476925286766559)); return vec<2, T, defaultp>(glm::cos(a), glm::sin(a)) * Radius; } @@ -286,6 +289,8 @@ namespace detail template GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius) { + assert(Radius > static_cast(0)); + T theta = linearRand(T(0), T(6.283185307179586476925286766559f)); T phi = std::acos(linearRand(T(-1.0f), T(1.0f))); diff --git a/vendor/glm/gtc/reciprocal.hpp b/vendor/glm/gtc/reciprocal.hpp old mode 100755 new mode 100644 index 1a2e516980..4d0fc91ca6 --- a/vendor/glm/gtc/reciprocal.hpp +++ b/vendor/glm/gtc/reciprocal.hpp @@ -15,121 +15,10 @@ // Dependencies #include "../detail/setup.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_reciprocal extension included") #endif -namespace glm -{ - /// @addtogroup gtc_reciprocal - /// @{ +#include "../ext/scalar_reciprocal.hpp" +#include "../ext/vector_reciprocal.hpp" - /// Secant function. - /// hypotenuse / adjacent or 1 / cos(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType sec(genType angle); - - /// Cosecant function. - /// hypotenuse / opposite or 1 / sin(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType csc(genType angle); - - /// Cotangent function. - /// adjacent / opposite or 1 / tan(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType cot(genType angle); - - /// Inverse secant function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType asec(genType x); - - /// Inverse cosecant function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType acsc(genType x); - - /// Inverse cotangent function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType acot(genType x); - - /// Secant hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType sech(genType angle); - - /// Cosecant hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType csch(genType angle); - - /// Cotangent hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType coth(genType angle); - - /// Inverse secant hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType asech(genType x); - - /// Inverse cosecant hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType acsch(genType x); - - /// Inverse cotangent hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType acoth(genType x); - - /// @} -}//namespace glm - -#include "reciprocal.inl" diff --git a/vendor/glm/gtc/reciprocal.inl b/vendor/glm/gtc/reciprocal.inl deleted file mode 100755 index b0a8a7d98f..0000000000 --- a/vendor/glm/gtc/reciprocal.inl +++ /dev/null @@ -1,192 +0,0 @@ -/// @ref gtc_reciprocal -/// @file glm/gtc/reciprocal.inl - -#include "../trigonometric.hpp" -#include - -namespace glm -{ - // sec - template - GLM_FUNC_QUALIFIER genType sec(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point values"); - return genType(1) / glm::cos(angle); - } - - template - GLM_FUNC_QUALIFIER vec sec(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point inputs"); - return detail::functor1::call(sec, x); - } - - // csc - template - GLM_FUNC_QUALIFIER genType csc(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point values"); - return genType(1) / glm::sin(angle); - } - - template - GLM_FUNC_QUALIFIER vec csc(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point inputs"); - return detail::functor1::call(csc, x); - } - - // cot - template - GLM_FUNC_QUALIFIER genType cot(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point values"); - - genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); - return glm::tan(pi_over_2 - angle); - } - - template - GLM_FUNC_QUALIFIER vec cot(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point inputs"); - return detail::functor1::call(cot, x); - } - - // asec - template - GLM_FUNC_QUALIFIER genType asec(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point values"); - return acos(genType(1) / x); - } - - template - GLM_FUNC_QUALIFIER vec asec(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point inputs"); - return detail::functor1::call(asec, x); - } - - // acsc - template - GLM_FUNC_QUALIFIER genType acsc(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point values"); - return asin(genType(1) / x); - } - - template - GLM_FUNC_QUALIFIER vec acsc(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point inputs"); - return detail::functor1::call(acsc, x); - } - - // acot - template - GLM_FUNC_QUALIFIER genType acot(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point values"); - - genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); - return pi_over_2 - atan(x); - } - - template - GLM_FUNC_QUALIFIER vec acot(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point inputs"); - return detail::functor1::call(acot, x); - } - - // sech - template - GLM_FUNC_QUALIFIER genType sech(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point values"); - return genType(1) / glm::cosh(angle); - } - - template - GLM_FUNC_QUALIFIER vec sech(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point inputs"); - return detail::functor1::call(sech, x); - } - - // csch - template - GLM_FUNC_QUALIFIER genType csch(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point values"); - return genType(1) / glm::sinh(angle); - } - - template - GLM_FUNC_QUALIFIER vec csch(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point inputs"); - return detail::functor1::call(csch, x); - } - - // coth - template - GLM_FUNC_QUALIFIER genType coth(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point values"); - return glm::cosh(angle) / glm::sinh(angle); - } - - template - GLM_FUNC_QUALIFIER vec coth(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point inputs"); - return detail::functor1::call(coth, x); - } - - // asech - template - GLM_FUNC_QUALIFIER genType asech(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point values"); - return acosh(genType(1) / x); - } - - template - GLM_FUNC_QUALIFIER vec asech(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point inputs"); - return detail::functor1::call(asech, x); - } - - // acsch - template - GLM_FUNC_QUALIFIER genType acsch(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point values"); - return asinh(genType(1) / x); - } - - template - GLM_FUNC_QUALIFIER vec acsch(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point inputs"); - return detail::functor1::call(acsch, x); - } - - // acoth - template - GLM_FUNC_QUALIFIER genType acoth(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point values"); - return atanh(genType(1) / x); - } - - template - GLM_FUNC_QUALIFIER vec acoth(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point inputs"); - return detail::functor1::call(acoth, x); - } -}//namespace glm diff --git a/vendor/glm/gtc/round.hpp b/vendor/glm/gtc/round.hpp old mode 100755 new mode 100644 index d8d04c3ef2..56edbbca30 --- a/vendor/glm/gtc/round.hpp +++ b/vendor/glm/gtc/round.hpp @@ -21,8 +21,8 @@ #include "../common.hpp" #include -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_integer extension included") +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_round extension included") #endif namespace glm @@ -30,22 +30,6 @@ namespace glm /// @addtogroup gtc_round /// @{ - /// Return true if the value is a power of two number. - /// - /// @see gtc_round - template - GLM_FUNC_DECL bool isPowerOfTwo(genIUType v); - - /// Return true if the value is a power of two number. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec isPowerOfTwo(vec const& v); - /// Return the power of two number which value is just higher the input value, /// round up to a power of two. /// @@ -98,32 +82,6 @@ namespace glm template GLM_FUNC_DECL vec roundPowerOfTwo(vec const& v); - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @see gtc_round - template - GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple); - - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec isMultiple(vec const& v, T Multiple); - - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec isMultiple(vec const& v, vec const& Multiple); - /// Higher multiple number of Source. /// /// @tparam genType Floating-point or integer scalar or vector types. diff --git a/vendor/glm/gtc/round.inl b/vendor/glm/gtc/round.inl old mode 100755 new mode 100644 index d4e93929ad..48411e41dc --- a/vendor/glm/gtc/round.inl +++ b/vendor/glm/gtc/round.inl @@ -1,164 +1,13 @@ /// @ref gtc_round -/// @file glm/gtc/round.inl #include "../integer.hpp" +#include "../ext/vector_integer.hpp" namespace glm{ namespace detail { - template - struct compute_ceilShift - { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T) - { - return v; - } - }; - - template - struct compute_ceilShift - { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T Shift) - { - return v | (v >> Shift); - } - }; - - template - struct compute_ceilPowerOfTwo - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); - - vec const Sign(sign(x)); - - vec v(abs(x)); - - v = v - static_cast(1); - v = v | (v >> static_cast(1)); - v = v | (v >> static_cast(2)); - v = v | (v >> static_cast(4)); - v = compute_ceilShift= 2>::call(v, 8); - v = compute_ceilShift= 4>::call(v, 16); - v = compute_ceilShift= 8>::call(v, 32); - return (v + static_cast(1)) * Sign; - } - }; - - template - struct compute_ceilPowerOfTwo - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); - - vec v(x); - - v = v - static_cast(1); - v = v | (v >> static_cast(1)); - v = v | (v >> static_cast(2)); - v = v | (v >> static_cast(4)); - v = compute_ceilShift= 2>::call(v, 8); - v = compute_ceilShift= 4>::call(v, 16); - v = compute_ceilShift= 8>::call(v, 32); - return v + static_cast(1); - } - }; - - template - struct compute_ceilMultiple{}; - - template<> - struct compute_ceilMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source > genType(0)) - return Source + (Multiple - std::fmod(Source, Multiple)); - else - return Source + std::fmod(-Source, Multiple); - } - }; - - template<> - struct compute_ceilMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - genType Tmp = Source - genType(1); - return Tmp + (Multiple - (Tmp % Multiple)); - } - }; - - template<> - struct compute_ceilMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source > genType(0)) - { - genType Tmp = Source - genType(1); - return Tmp + (Multiple - (Tmp % Multiple)); - } - else - return Source + (-Source % Multiple); - } - }; - template - struct compute_floorMultiple{}; - - template<> - struct compute_floorMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - std::fmod(Source, Multiple); - else - return Source - std::fmod(Source, Multiple) - Multiple; - } - }; - - template<> - struct compute_floorMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; - - template<> - struct compute_floorMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; - - template - struct compute_roundMultiple{}; + struct compute_roundMultiple {}; template<> struct compute_roundMultiple @@ -166,7 +15,7 @@ namespace detail template GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) { - if(Source >= genType(0)) + if (Source >= genType(0)) return Source - std::fmod(Source, Multiple); else { @@ -182,7 +31,7 @@ namespace detail template GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) { - if(Source >= genType(0)) + if (Source >= genType(0)) return Source - Source % Multiple; else { @@ -198,7 +47,7 @@ namespace detail template GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) { - if(Source >= genType(0)) + if (Source >= genType(0)) return Source - Source % Multiple; else { @@ -209,23 +58,6 @@ namespace detail }; }//namespace detail - //////////////// - // isPowerOfTwo - - template - GLM_FUNC_QUALIFIER bool isPowerOfTwo(genType Value) - { - genType const Result = glm::abs(Value); - return !(Result & (Result - 1)); - } - - template - GLM_FUNC_QUALIFIER vec isPowerOfTwo(vec const& Value) - { - vec const Result(abs(Value)); - return equal(Result & (Result - 1), vec(0)); - } - ////////////////// // ceilPowerOfTwo @@ -253,7 +85,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec floorPowerOfTwo(vec const& v) { - return detail::functor1::call(floorPowerOfTwo, v); + return detail::functor1::call(floorPowerOfTwo, v); } /////////////////// @@ -273,28 +105,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec roundPowerOfTwo(vec const& v) { - return detail::functor1::call(roundPowerOfTwo, v); - } - - //////////////// - // isMultiple - - template - GLM_FUNC_QUALIFIER bool isMultiple(genType Value, genType Multiple) - { - return isMultiple(vec<1, genType>(Value), vec<1, genType>(Multiple)).x; - } - - template - GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, T Multiple) - { - return (Value % Multiple) == vec(0); - } - - template - GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, vec const& Multiple) - { - return (Value % Multiple) == vec(0); + return detail::functor1::call(roundPowerOfTwo, v); } ////////////////////// @@ -309,7 +120,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec ceilMultiple(vec const& Source, vec const& Multiple) { - return detail::functor2::call(ceilMultiple, Source, Multiple); + return detail::functor2::call(ceilMultiple, Source, Multiple); } ////////////////////// @@ -324,7 +135,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec floorMultiple(vec const& Source, vec const& Multiple) { - return detail::functor2::call(floorMultiple, Source, Multiple); + return detail::functor2::call(floorMultiple, Source, Multiple); } ////////////////////// @@ -339,6 +150,6 @@ namespace detail template GLM_FUNC_QUALIFIER vec roundMultiple(vec const& Source, vec const& Multiple) { - return detail::functor2::call(roundMultiple, Source, Multiple); + return detail::functor2::call(roundMultiple, Source, Multiple); } }//namespace glm diff --git a/vendor/glm/gtc/type_aligned.hpp b/vendor/glm/gtc/type_aligned.hpp old mode 100755 new mode 100644 index 7e51ce196d..9b6bf73667 --- a/vendor/glm/gtc/type_aligned.hpp +++ b/vendor/glm/gtc/type_aligned.hpp @@ -12,17 +12,28 @@ #pragma once -#if !GLM_HAS_ALIGNED_TYPE -# error "GLM: Aligned types are not supported on this platform" +#if (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) +# error "GLM: Aligned gentypes require to enable C++ language extensions. Define GLM_FORCE_ALIGNED_GENTYPES before including GLM headers to use aligned types." #endif -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_type_aligned extension included") #endif +#include "../mat4x4.hpp" +#include "../mat4x3.hpp" +#include "../mat4x2.hpp" +#include "../mat3x4.hpp" +#include "../mat3x3.hpp" +#include "../mat3x2.hpp" +#include "../mat2x4.hpp" +#include "../mat2x3.hpp" +#include "../mat2x2.hpp" +#include "../gtc/quaternion.hpp" +#include "../gtc/vec1.hpp" #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" -#include "../gtc/vec1.hpp" namespace glm { @@ -397,6 +408,500 @@ namespace glm /// 4 components vector tightly packed in memory of bool values. typedef vec<4, bool, packed_lowp> packed_lowp_bvec4; + // -- *mat2 -- + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_highp> packed_highp_mat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_highp> packed_highp_dmat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2; + + // -- *mat3 -- + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_highp> packed_highp_mat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_highp> packed_highp_dmat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3; + + // -- *mat4 -- + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_highp> packed_highp_mat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_highp> packed_highp_dmat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4; + + // -- *mat2x2 -- + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2x2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2x2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_highp> packed_highp_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_highp> packed_highp_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2x2; + + // -- *mat2x3 -- + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_highp> aligned_highp_mat2x3; + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_mediump> aligned_mediump_mat2x3; + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_lowp> aligned_lowp_mat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_highp> aligned_highp_dmat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_mediump> aligned_mediump_dmat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_lowp> aligned_lowp_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_highp> packed_highp_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_mediump> packed_mediump_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_lowp> packed_lowp_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_highp> packed_highp_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_mediump> packed_mediump_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_lowp> packed_lowp_dmat2x3; + + // -- *mat2x4 -- + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_highp> aligned_highp_mat2x4; + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_mediump> aligned_mediump_mat2x4; + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_lowp> aligned_lowp_mat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_highp> aligned_highp_dmat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_mediump> aligned_mediump_dmat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_lowp> aligned_lowp_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_highp> packed_highp_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_mediump> packed_mediump_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_lowp> packed_lowp_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_highp> packed_highp_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_mediump> packed_mediump_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_lowp> packed_lowp_dmat2x4; + + // -- *mat3x2 -- + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_highp> aligned_highp_mat3x2; + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_mediump> aligned_mediump_mat3x2; + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_lowp> aligned_lowp_mat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_highp> aligned_highp_dmat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_mediump> aligned_mediump_dmat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_lowp> aligned_lowp_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_highp> packed_highp_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_mediump> packed_mediump_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_lowp> packed_lowp_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_highp> packed_highp_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_mediump> packed_mediump_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_lowp> packed_lowp_dmat3x2; + + // -- *mat3x3 -- + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3x3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3x3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_highp> packed_highp_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_highp> packed_highp_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3x3; + + // -- *mat3x4 -- + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_highp> aligned_highp_mat3x4; + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_mediump> aligned_mediump_mat3x4; + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_lowp> aligned_lowp_mat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_highp> aligned_highp_dmat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_mediump> aligned_mediump_dmat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_lowp> aligned_lowp_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_highp> packed_highp_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_mediump> packed_mediump_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_lowp> packed_lowp_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_highp> packed_highp_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_mediump> packed_mediump_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_lowp> packed_lowp_dmat3x4; + + // -- *mat4x2 -- + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_highp> aligned_highp_mat4x2; + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_mediump> aligned_mediump_mat4x2; + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_lowp> aligned_lowp_mat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_highp> aligned_highp_dmat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_mediump> aligned_mediump_dmat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_lowp> aligned_lowp_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_highp> packed_highp_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_mediump> packed_mediump_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_lowp> packed_lowp_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_highp> packed_highp_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_mediump> packed_mediump_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_lowp> packed_lowp_dmat4x2; + + // -- *mat4x3 -- + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_highp> aligned_highp_mat4x3; + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_mediump> aligned_mediump_mat4x3; + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_lowp> aligned_lowp_mat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_highp> aligned_highp_dmat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_mediump> aligned_mediump_dmat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_lowp> aligned_lowp_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_highp> packed_highp_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_mediump> packed_mediump_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_lowp> packed_lowp_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_highp> packed_highp_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_mediump> packed_mediump_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_lowp> packed_lowp_dmat4x3; + + // -- *mat4x4 -- + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4x4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4x4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_highp> packed_highp_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_highp> packed_highp_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4x4; + + // -- *quat -- + + /// quaternion aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua aligned_highp_quat; + + /// quaternion aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef qua aligned_mediump_quat; + + /// quaternion aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef qua aligned_lowp_quat; + + /// quaternion aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua aligned_highp_dquat; + + /// quaternion aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef qua aligned_mediump_dquat; + + /// quaternion aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef qua aligned_lowp_dquat; + + /// quaternion tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua packed_highp_quat; + + /// quaternion tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef qua packed_mediump_quat; + + /// quaternion tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef qua packed_lowp_quat; + + /// quaternion tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua packed_highp_dquat; + + /// quaternion tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef qua packed_mediump_dquat; + + /// quaternion tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef qua packed_lowp_dquat; + // -- default -- #if(defined(GLM_PRECISION_LOWP_FLOAT)) @@ -408,6 +913,35 @@ namespace glm typedef packed_lowp_vec2 packed_vec2; typedef packed_lowp_vec3 packed_vec3; typedef packed_lowp_vec4 packed_vec4; + + typedef aligned_lowp_mat2 aligned_mat2; + typedef aligned_lowp_mat3 aligned_mat3; + typedef aligned_lowp_mat4 aligned_mat4; + typedef packed_lowp_mat2 packed_mat2; + typedef packed_lowp_mat3 packed_mat3; + typedef packed_lowp_mat4 packed_mat4; + + typedef aligned_lowp_mat2x2 aligned_mat2x2; + typedef aligned_lowp_mat2x3 aligned_mat2x3; + typedef aligned_lowp_mat2x4 aligned_mat2x4; + typedef aligned_lowp_mat3x2 aligned_mat3x2; + typedef aligned_lowp_mat3x3 aligned_mat3x3; + typedef aligned_lowp_mat3x4 aligned_mat3x4; + typedef aligned_lowp_mat4x2 aligned_mat4x2; + typedef aligned_lowp_mat4x3 aligned_mat4x3; + typedef aligned_lowp_mat4x4 aligned_mat4x4; + typedef packed_lowp_mat2x2 packed_mat2x2; + typedef packed_lowp_mat2x3 packed_mat2x3; + typedef packed_lowp_mat2x4 packed_mat2x4; + typedef packed_lowp_mat3x2 packed_mat3x2; + typedef packed_lowp_mat3x3 packed_mat3x3; + typedef packed_lowp_mat3x4 packed_mat3x4; + typedef packed_lowp_mat4x2 packed_mat4x2; + typedef packed_lowp_mat4x3 packed_mat4x3; + typedef packed_lowp_mat4x4 packed_mat4x4; + + typedef aligned_lowp_quat aligned_quat; + typedef packed_lowp_quat packed_quat; #elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) typedef aligned_mediump_vec1 aligned_vec1; typedef aligned_mediump_vec2 aligned_vec2; @@ -417,6 +951,35 @@ namespace glm typedef packed_mediump_vec2 packed_vec2; typedef packed_mediump_vec3 packed_vec3; typedef packed_mediump_vec4 packed_vec4; + + typedef aligned_mediump_mat2 aligned_mat2; + typedef aligned_mediump_mat3 aligned_mat3; + typedef aligned_mediump_mat4 aligned_mat4; + typedef packed_mediump_mat2 packed_mat2; + typedef packed_mediump_mat3 packed_mat3; + typedef packed_mediump_mat4 packed_mat4; + + typedef aligned_mediump_mat2x2 aligned_mat2x2; + typedef aligned_mediump_mat2x3 aligned_mat2x3; + typedef aligned_mediump_mat2x4 aligned_mat2x4; + typedef aligned_mediump_mat3x2 aligned_mat3x2; + typedef aligned_mediump_mat3x3 aligned_mat3x3; + typedef aligned_mediump_mat3x4 aligned_mat3x4; + typedef aligned_mediump_mat4x2 aligned_mat4x2; + typedef aligned_mediump_mat4x3 aligned_mat4x3; + typedef aligned_mediump_mat4x4 aligned_mat4x4; + typedef packed_mediump_mat2x2 packed_mat2x2; + typedef packed_mediump_mat2x3 packed_mat2x3; + typedef packed_mediump_mat2x4 packed_mat2x4; + typedef packed_mediump_mat3x2 packed_mat3x2; + typedef packed_mediump_mat3x3 packed_mat3x3; + typedef packed_mediump_mat3x4 packed_mat3x4; + typedef packed_mediump_mat4x2 packed_mat4x2; + typedef packed_mediump_mat4x3 packed_mat4x3; + typedef packed_mediump_mat4x4 packed_mat4x4; + + typedef aligned_mediump_quat aligned_quat; + typedef packed_mediump_quat packed_quat; #else //defined(GLM_PRECISION_HIGHP_FLOAT) /// 1 component vector aligned in memory of single-precision floating-point numbers. typedef aligned_highp_vec1 aligned_vec1; @@ -428,7 +991,7 @@ namespace glm typedef aligned_highp_vec3 aligned_vec3; /// 4 components vector aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_vec4 aligned_vec4; + typedef aligned_highp_vec4 aligned_vec4; /// 1 component vector tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_vec1 packed_vec1; @@ -441,6 +1004,84 @@ namespace glm /// 4 components vector tightly packed in memory of single-precision floating-point numbers. typedef packed_highp_vec4 packed_vec4; + + /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2 aligned_mat2; + + /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3 aligned_mat3; + + /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4 aligned_mat4; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2 packed_mat2; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3 packed_mat3; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4 packed_mat4; + + /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x2 aligned_mat2x2; + + /// 2 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x3 aligned_mat2x3; + + /// 2 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x4 aligned_mat2x4; + + /// 3 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x2 aligned_mat3x2; + + /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x3 aligned_mat3x3; + + /// 3 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x4 aligned_mat3x4; + + /// 4 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x2 aligned_mat4x2; + + /// 4 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x3 aligned_mat4x3; + + /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x4 aligned_mat4x4; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x2 packed_mat2x2; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x3 packed_mat2x3; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x4 packed_mat2x4; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x2 packed_mat3x2; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x3 packed_mat3x3; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x4 packed_mat3x4; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x2 packed_mat4x2; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x3 packed_mat4x3; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x4 packed_mat4x4; + + /// quaternion tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_quat aligned_quat; + + /// quaternion tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_quat packed_quat; #endif//GLM_PRECISION #if(defined(GLM_PRECISION_LOWP_DOUBLE)) @@ -452,6 +1093,35 @@ namespace glm typedef packed_lowp_dvec2 packed_dvec2; typedef packed_lowp_dvec3 packed_dvec3; typedef packed_lowp_dvec4 packed_dvec4; + + typedef aligned_lowp_dmat2 aligned_dmat2; + typedef aligned_lowp_dmat3 aligned_dmat3; + typedef aligned_lowp_dmat4 aligned_dmat4; + typedef packed_lowp_dmat2 packed_dmat2; + typedef packed_lowp_dmat3 packed_dmat3; + typedef packed_lowp_dmat4 packed_dmat4; + + typedef aligned_lowp_dmat2x2 aligned_dmat2x2; + typedef aligned_lowp_dmat2x3 aligned_dmat2x3; + typedef aligned_lowp_dmat2x4 aligned_dmat2x4; + typedef aligned_lowp_dmat3x2 aligned_dmat3x2; + typedef aligned_lowp_dmat3x3 aligned_dmat3x3; + typedef aligned_lowp_dmat3x4 aligned_dmat3x4; + typedef aligned_lowp_dmat4x2 aligned_dmat4x2; + typedef aligned_lowp_dmat4x3 aligned_dmat4x3; + typedef aligned_lowp_dmat4x4 aligned_dmat4x4; + typedef packed_lowp_dmat2x2 packed_dmat2x2; + typedef packed_lowp_dmat2x3 packed_dmat2x3; + typedef packed_lowp_dmat2x4 packed_dmat2x4; + typedef packed_lowp_dmat3x2 packed_dmat3x2; + typedef packed_lowp_dmat3x3 packed_dmat3x3; + typedef packed_lowp_dmat3x4 packed_dmat3x4; + typedef packed_lowp_dmat4x2 packed_dmat4x2; + typedef packed_lowp_dmat4x3 packed_dmat4x3; + typedef packed_lowp_dmat4x4 packed_dmat4x4; + + typedef aligned_lowp_dquat aligned_dquat; + typedef packed_lowp_dquat packed_dquat; #elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) typedef aligned_mediump_dvec1 aligned_dvec1; typedef aligned_mediump_dvec2 aligned_dvec2; @@ -461,6 +1131,35 @@ namespace glm typedef packed_mediump_dvec2 packed_dvec2; typedef packed_mediump_dvec3 packed_dvec3; typedef packed_mediump_dvec4 packed_dvec4; + + typedef aligned_mediump_dmat2 aligned_dmat2; + typedef aligned_mediump_dmat3 aligned_dmat3; + typedef aligned_mediump_dmat4 aligned_dmat4; + typedef packed_mediump_dmat2 packed_dmat2; + typedef packed_mediump_dmat3 packed_dmat3; + typedef packed_mediump_dmat4 packed_dmat4; + + typedef aligned_mediump_dmat2x2 aligned_dmat2x2; + typedef aligned_mediump_dmat2x3 aligned_dmat2x3; + typedef aligned_mediump_dmat2x4 aligned_dmat2x4; + typedef aligned_mediump_dmat3x2 aligned_dmat3x2; + typedef aligned_mediump_dmat3x3 aligned_dmat3x3; + typedef aligned_mediump_dmat3x4 aligned_dmat3x4; + typedef aligned_mediump_dmat4x2 aligned_dmat4x2; + typedef aligned_mediump_dmat4x3 aligned_dmat4x3; + typedef aligned_mediump_dmat4x4 aligned_dmat4x4; + typedef packed_mediump_dmat2x2 packed_dmat2x2; + typedef packed_mediump_dmat2x3 packed_dmat2x3; + typedef packed_mediump_dmat2x4 packed_dmat2x4; + typedef packed_mediump_dmat3x2 packed_dmat3x2; + typedef packed_mediump_dmat3x3 packed_dmat3x3; + typedef packed_mediump_dmat3x4 packed_dmat3x4; + typedef packed_mediump_dmat4x2 packed_dmat4x2; + typedef packed_mediump_dmat4x3 packed_dmat4x3; + typedef packed_mediump_dmat4x4 packed_dmat4x4; + + typedef aligned_mediump_dquat aligned_dquat; + typedef packed_mediump_dquat packed_dquat; #else //defined(GLM_PRECISION_HIGHP_DOUBLE) /// 1 component vector aligned in memory of double-precision floating-point numbers. typedef aligned_highp_dvec1 aligned_dvec1; @@ -485,6 +1184,84 @@ namespace glm /// 4 components vector tightly packed in memory of double-precision floating-point numbers. typedef packed_highp_dvec4 packed_dvec4; + + /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2 aligned_dmat2; + + /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3 aligned_dmat3; + + /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4 aligned_dmat4; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2 packed_dmat2; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3 packed_dmat3; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4 packed_dmat4; + + /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x2 aligned_dmat2x2; + + /// 2 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x3 aligned_dmat2x3; + + /// 2 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x4 aligned_dmat2x4; + + /// 3 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x2 aligned_dmat3x2; + + /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x3 aligned_dmat3x3; + + /// 3 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x4 aligned_dmat3x4; + + /// 4 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x2 aligned_dmat4x2; + + /// 4 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x3 aligned_dmat4x3; + + /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x4 aligned_dmat4x4; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x2 packed_dmat2x2; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x3 packed_dmat2x3; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x4 packed_dmat2x4; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x2 packed_dmat3x2; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x3 packed_dmat3x3; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x4 packed_dmat3x4; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x2 packed_dmat4x2; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x3 packed_dmat4x3; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x4 packed_dmat4x4; + + /// quaternion tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dquat aligned_dquat; + + /// quaternion tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dquat packed_dquat; #endif//GLM_PRECISION #if(defined(GLM_PRECISION_LOWP_INT)) @@ -521,7 +1298,6 @@ namespace glm /// 4 components vector tightly packed in memory of signed integer numbers. typedef packed_highp_ivec4 packed_ivec4; - #endif//GLM_PRECISION // -- Unsigned integer definition -- diff --git a/vendor/glm/gtc/type_precision.hpp b/vendor/glm/gtc/type_precision.hpp old mode 100755 new mode 100644 index a4524fe6ce..775e2f484d --- a/vendor/glm/gtc/type_precision.hpp +++ b/vendor/glm/gtc/type_precision.hpp @@ -10,29 +10,36 @@ /// Include to use the features of this extension. /// /// Defines specific C++-based qualifier types. -/// -/// @ref core_precision defines types based on GLSL's qualifier qualifiers. This -/// extension defines types based on explicitly-sized C++ data types. #pragma once // Dependency: #include "../gtc/quaternion.hpp" #include "../gtc/vec1.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../mat2x2.hpp" -#include "../mat2x3.hpp" -#include "../mat2x4.hpp" -#include "../mat3x2.hpp" -#include "../mat3x3.hpp" -#include "../mat3x4.hpp" -#include "../mat4x2.hpp" -#include "../mat4x3.hpp" -#include "../mat4x4.hpp" - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#include "../ext/vector_int1_sized.hpp" +#include "../ext/vector_int2_sized.hpp" +#include "../ext/vector_int3_sized.hpp" +#include "../ext/vector_int4_sized.hpp" +#include "../ext/scalar_int_sized.hpp" +#include "../ext/vector_uint1_sized.hpp" +#include "../ext/vector_uint2_sized.hpp" +#include "../ext/vector_uint3_sized.hpp" +#include "../ext/vector_uint4_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/type_vec2.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" +#include "../detail/type_mat2x2.hpp" +#include "../detail/type_mat2x3.hpp" +#include "../detail/type_mat2x4.hpp" +#include "../detail/type_mat3x2.hpp" +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat3x4.hpp" +#include "../detail/type_mat4x2.hpp" +#include "../detail/type_mat4x3.hpp" +#include "../detail/type_mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_type_precision extension included") #endif @@ -189,22 +196,6 @@ namespace glm typedef detail::int64 highp_i64; - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 int8; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 int16; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 int32; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 int64; - #if GLM_HAS_EXTENDED_INTEGER_TYPE using std::int8_t; using std::int16_t; @@ -244,75 +235,6 @@ namespace glm /// @see gtc_type_precision typedef detail::int64 i64; - - /// 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i8, defaultp> i8vec1; - - /// 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i8, defaultp> i8vec2; - - /// 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i8, defaultp> i8vec3; - - /// 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i8, defaultp> i8vec4; - - - /// 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i16, defaultp> i16vec1; - - /// 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i16, defaultp> i16vec2; - - /// 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i16, defaultp> i16vec3; - - /// 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i16, defaultp> i16vec4; - - - /// 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i32, defaultp> i32vec1; - - /// 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i32, defaultp> i32vec2; - - /// 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i32, defaultp> i32vec3; - - /// 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i32, defaultp> i32vec4; - - - /// 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i64, defaultp> i64vec1; - - /// 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i64, defaultp> i64vec2; - - /// 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i64, defaultp> i64vec3; - - /// 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i64, defaultp> i64vec4; - - ///////////////////////////// // Unsigned int vector types @@ -460,22 +382,6 @@ namespace glm /// @see gtc_type_precision typedef detail::uint64 highp_u64; - /// Default qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 uint8; - - /// Default qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 uint16; - - /// Default qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 uint32; - - /// Default qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 uint64; - #if GLM_HAS_EXTENDED_INTEGER_TYPE using std::uint8_t; using std::uint16_t; @@ -517,347 +423,1668 @@ namespace glm - /// Default qualifier 8 bit unsigned integer scalar type. + + + ////////////////////// + // Float vector types + + /// Single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<1, u8, defaultp> u8vec1; + typedef float float32; - /// Default qualifier 8 bit unsigned integer vector of 2 components type. + /// Double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<2, u8, defaultp> u8vec2; + typedef double float64; - /// Default qualifier 8 bit unsigned integer vector of 3 components type. + /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<3, u8, defaultp> u8vec3; + typedef float32 lowp_float32; - /// Default qualifier 8 bit unsigned integer vector of 4 components type. + /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<4, u8, defaultp> u8vec4; + typedef float64 lowp_float64; + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32_t; - /// Default qualifier 16 bit unsigned integer scalar type. + /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<1, u16, defaultp> u16vec1; + typedef float64 lowp_float64_t; - /// Default qualifier 16 bit unsigned integer vector of 2 components type. + /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<2, u16, defaultp> u16vec2; + typedef float32 lowp_f32; - /// Default qualifier 16 bit unsigned integer vector of 3 components type. + /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<3, u16, defaultp> u16vec3; + typedef float64 lowp_f64; - /// Default qualifier 16 bit unsigned integer vector of 4 components type. + /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<4, u16, defaultp> u16vec4; + typedef float32 lowp_float32; + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64; - /// Default qualifier 32 bit unsigned integer scalar type. + /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<1, u32, defaultp> u32vec1; + typedef float32 lowp_float32_t; - /// Default qualifier 32 bit unsigned integer vector of 2 components type. + /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<2, u32, defaultp> u32vec2; + typedef float64 lowp_float64_t; - /// Default qualifier 32 bit unsigned integer vector of 3 components type. + /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<3, u32, defaultp> u32vec3; + typedef float32 lowp_f32; - /// Default qualifier 32 bit unsigned integer vector of 4 components type. + /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<4, u32, defaultp> u32vec4; + typedef float64 lowp_f64; - /// Default qualifier 64 bit unsigned integer scalar type. + /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<1, u64, defaultp> u64vec1; + typedef float32 lowp_float32; - /// Default qualifier 64 bit unsigned integer vector of 2 components type. + /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<2, u64, defaultp> u64vec2; + typedef float64 lowp_float64; - /// Default qualifier 64 bit unsigned integer vector of 3 components type. + /// Low 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<3, u64, defaultp> u64vec3; + typedef float32 lowp_float32_t; - /// Default qualifier 64 bit unsigned integer vector of 4 components type. + /// Low 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<4, u64, defaultp> u64vec4; + typedef float64 lowp_float64_t; + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_f32; - ////////////////////// - // Float vector types + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_f64; - /// 32 bit single-qualifier floating-point scalar. + + /// Medium 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef detail::float32 float32; + typedef float32 mediump_float32; - /// 32 bit single-qualifier floating-point scalar. + /// Medium 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef detail::float32 float32_t; + typedef float64 mediump_float64; - /// 32 bit single-qualifier floating-point scalar. + /// Medium 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef float32 f32; + typedef float32 mediump_float32_t; -# ifndef GLM_FORCE_SINGLE_ONLY - /// 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 float64; + /// Medium 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 mediump_float64_t; - /// 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef detail::float64 float64_t; + /// Medium 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 mediump_f32; - /// 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 f64; -# endif//GLM_FORCE_SINGLE_ONLY + /// Medium 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 mediump_f64; - /// Single-qualifier floating-point vector of 1 component. + + /// High 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<1, float, defaultp> fvec1; + typedef float32 highp_float32; - /// Single-qualifier floating-point vector of 2 components. + /// High 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<2, float, defaultp> fvec2; + typedef float64 highp_float64; - /// Single-qualifier floating-point vector of 3 components. + /// High 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<3, float, defaultp> fvec3; + typedef float32 highp_float32_t; - /// Single-qualifier floating-point vector of 4 components. + /// High 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<4, float, defaultp> fvec4; + typedef float64 highp_float64_t; + /// High 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 highp_f32; - /// Single-qualifier floating-point vector of 1 component. + /// High 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<1, f32, defaultp> f32vec1; + typedef float64 highp_f64; - /// Single-qualifier floating-point vector of 2 components. + +#if(defined(GLM_PRECISION_LOWP_FLOAT)) + /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<2, f32, defaultp> f32vec2; + typedef lowp_float32_t float32_t; - /// Single-qualifier floating-point vector of 3 components. + /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<3, f32, defaultp> f32vec3; + typedef lowp_float64_t float64_t; - /// Single-qualifier floating-point vector of 4 components. + /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef vec<4, f32, defaultp> f32vec4; + typedef lowp_f32 f32; -# ifndef GLM_FORCE_SINGLE_ONLY - /// Double-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f64, defaultp> f64vec1; + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_f64 f64; - /// Double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f64, defaultp> f64vec2; +#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float32 float32_t; - /// Double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f64, defaultp> f64vec3; + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float64 float64_t; - /// Double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f64, defaultp> f64vec4; -# endif//GLM_FORCE_SINGLE_ONLY + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float32 f32; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float64 f64; +#else//(defined(GLM_PRECISION_HIGHP_FLOAT)) - ////////////////////// - // Float matrix types + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float32_t float32_t; - /// Single-qualifier floating-point 1x1 matrix. + /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - //typedef detail::tmat1x1 fmat1; + typedef highp_float64_t float64_t; - /// Single-qualifier floating-point 2x2 matrix. + /// Default 32 bit single-qualifier floating-point scalar. /// @see gtc_type_precision - typedef mat<2, 2, f32, defaultp> fmat2; + typedef highp_float32_t f32; - /// Single-qualifier floating-point 3x3 matrix. + /// Default 64 bit double-qualifier floating-point scalar. /// @see gtc_type_precision - typedef mat<3, 3, f32, defaultp> fmat3; + typedef highp_float64_t f64; +#endif - /// Single-qualifier floating-point 4x4 matrix. + + /// Low single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<4, 4, f32, defaultp> fmat4; + typedef vec<1, float, lowp> lowp_fvec1; + /// Low single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, float, lowp> lowp_fvec2; - /// Single-qualifier floating-point 1x1 matrix. + /// Low single-qualifier floating-point vector of 3 components. /// @see gtc_type_precision - //typedef f32 fmat1x1; + typedef vec<3, float, lowp> lowp_fvec3; - /// Single-qualifier floating-point 2x2 matrix. + /// Low single-qualifier floating-point vector of 4 components. /// @see gtc_type_precision - typedef mat<2, 2, f32, defaultp> fmat2x2; + typedef vec<4, float, lowp> lowp_fvec4; - /// Single-qualifier floating-point 2x3 matrix. + + /// Medium single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<2, 3, f32, defaultp> fmat2x3; + typedef vec<1, float, mediump> mediump_fvec1; - /// Single-qualifier floating-point 2x4 matrix. + /// Medium Single-qualifier floating-point vector of 2 components. /// @see gtc_type_precision - typedef mat<2, 4, f32, defaultp> fmat2x4; + typedef vec<2, float, mediump> mediump_fvec2; - /// Single-qualifier floating-point 3x2 matrix. + /// Medium Single-qualifier floating-point vector of 3 components. /// @see gtc_type_precision - typedef mat<3, 2, f32, defaultp> fmat3x2; + typedef vec<3, float, mediump> mediump_fvec3; - /// Single-qualifier floating-point 3x3 matrix. + /// Medium Single-qualifier floating-point vector of 4 components. /// @see gtc_type_precision - typedef mat<3, 3, f32, defaultp> fmat3x3; + typedef vec<4, float, mediump> mediump_fvec4; - /// Single-qualifier floating-point 3x4 matrix. + + /// High single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<3, 4, f32, defaultp> fmat3x4; + typedef vec<1, float, highp> highp_fvec1; - /// Single-qualifier floating-point 4x2 matrix. + /// High Single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, float, highp> highp_fvec2; + + /// High Single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, float, highp> highp_fvec3; + + /// High Single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, float, highp> highp_fvec4; + + + /// Low single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<4, 2, f32, defaultp> fmat4x2; + typedef vec<1, f32, lowp> lowp_f32vec1; - /// Single-qualifier floating-point 4x3 matrix. + /// Low single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, f32, lowp> lowp_f32vec2; + + /// Low single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, f32, lowp> lowp_f32vec3; + + /// Low single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, f32, lowp> lowp_f32vec4; + + /// Medium single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<4, 3, f32, defaultp> fmat4x3; + typedef vec<1, f32, mediump> mediump_f32vec1; - /// Single-qualifier floating-point 4x4 matrix. + /// Medium single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, f32, mediump> mediump_f32vec2; + + /// Medium single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, f32, mediump> mediump_f32vec3; + + /// Medium single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, f32, mediump> mediump_f32vec4; + + /// High single-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<4, 4, f32, defaultp> fmat4x4; + typedef vec<1, f32, highp> highp_f32vec1; + /// High single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f32, highp> highp_f32vec2; - /// Single-qualifier floating-point 1x1 matrix. + /// High single-qualifier floating-point vector of 3 components. /// @see gtc_type_precision - //typedef detail::tmat1x1 f32mat1; + typedef vec<3, f32, highp> highp_f32vec3; - /// Single-qualifier floating-point 2x2 matrix. + /// High single-qualifier floating-point vector of 4 components. /// @see gtc_type_precision - typedef mat<2, 2, f32, defaultp> f32mat2; + typedef vec<4, f32, highp> highp_f32vec4; - /// Single-qualifier floating-point 3x3 matrix. + + /// Low double-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<3, 3, f32, defaultp> f32mat3; + typedef vec<1, f64, lowp> lowp_f64vec1; - /// Single-qualifier floating-point 4x4 matrix. + /// Low double-qualifier floating-point vector of 2 components. /// @see gtc_type_precision - typedef mat<4, 4, f32, defaultp> f32mat4; + typedef vec<2, f64, lowp> lowp_f64vec2; + /// Low double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, lowp> lowp_f64vec3; - /// Single-qualifier floating-point 1x1 matrix. + /// Low double-qualifier floating-point vector of 4 components. /// @see gtc_type_precision - //typedef f32 f32mat1x1; + typedef vec<4, f64, lowp> lowp_f64vec4; - /// Single-qualifier floating-point 2x2 matrix. + /// Medium double-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<2, 2, f32, defaultp> f32mat2x2; + typedef vec<1, f64, mediump> mediump_f64vec1; - /// Single-qualifier floating-point 2x3 matrix. + /// Medium double-qualifier floating-point vector of 2 components. /// @see gtc_type_precision - typedef mat<2, 3, f32, defaultp> f32mat2x3; + typedef vec<2, f64, mediump> mediump_f64vec2; - /// Single-qualifier floating-point 2x4 matrix. + /// Medium double-qualifier floating-point vector of 3 components. /// @see gtc_type_precision - typedef mat<2, 4, f32, defaultp> f32mat2x4; + typedef vec<3, f64, mediump> mediump_f64vec3; - /// Single-qualifier floating-point 3x2 matrix. + /// Medium double-qualifier floating-point vector of 4 components. /// @see gtc_type_precision - typedef mat<3, 2, f32, defaultp> f32mat3x2; + typedef vec<4, f64, mediump> mediump_f64vec4; - /// Single-qualifier floating-point 3x3 matrix. + /// High double-qualifier floating-point vector of 1 component. /// @see gtc_type_precision - typedef mat<3, 3, f32, defaultp> f32mat3x3; + typedef vec<1, f64, highp> highp_f64vec1; - /// Single-qualifier floating-point 3x4 matrix. + /// High double-qualifier floating-point vector of 2 components. /// @see gtc_type_precision - typedef mat<3, 4, f32, defaultp> f32mat3x4; + typedef vec<2, f64, highp> highp_f64vec2; - /// Single-qualifier floating-point 4x2 matrix. + /// High double-qualifier floating-point vector of 3 components. /// @see gtc_type_precision - typedef mat<4, 2, f32, defaultp> f32mat4x2; + typedef vec<3, f64, highp> highp_f64vec3; - /// Single-qualifier floating-point 4x3 matrix. + /// High double-qualifier floating-point vector of 4 components. /// @see gtc_type_precision - typedef mat<4, 3, f32, defaultp> f32mat4x3; + typedef vec<4, f64, highp> highp_f64vec4; - /// Single-qualifier floating-point 4x4 matrix. + + + ////////////////////// + // Float matrix types + + /// Low single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision - typedef mat<4, 4, f32, defaultp> f32mat4x4; + //typedef lowp_f32 lowp_fmat1x1; + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, lowp> lowp_fmat2x2; -# ifndef GLM_FORCE_SINGLE_ONLY + /// Low single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, lowp> lowp_fmat2x3; - /// Double-qualifier floating-point 1x1 matrix. + /// Low single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision - //typedef detail::tmat1x1 f64mat1; + typedef mat<2, 4, f32, lowp> lowp_fmat2x4; - /// Double-qualifier floating-point 2x2 matrix. + /// Low single-qualifier floating-point 3x2 matrix. /// @see gtc_type_precision - typedef mat<2, 2, f64, defaultp> f64mat2; + typedef mat<3, 2, f32, lowp> lowp_fmat3x2; - /// Double-qualifier floating-point 3x3 matrix. + /// Low single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision - typedef mat<3, 3, f64, defaultp> f64mat3; + typedef mat<3, 3, f32, lowp> lowp_fmat3x3; - /// Double-qualifier floating-point 4x4 matrix. + /// Low single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision - typedef mat<4, 4, f64, defaultp> f64mat4; + typedef mat<3, 4, f32, lowp> lowp_fmat3x4; + /// Low single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, lowp> lowp_fmat4x2; - /// Double-qualifier floating-point 1x1 matrix. + /// Low single-qualifier floating-point 4x3 matrix. /// @see gtc_type_precision - //typedef f64 f64mat1x1; + typedef mat<4, 3, f32, lowp> lowp_fmat4x3; - /// Double-qualifier floating-point 2x2 matrix. + /// Low single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision - typedef mat<2, 2, f64, defaultp> f64mat2x2; + typedef mat<4, 4, f32, lowp> lowp_fmat4x4; - /// Double-qualifier floating-point 2x3 matrix. + /// Low single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision - typedef mat<2, 3, f64, defaultp> f64mat2x3; + //typedef lowp_fmat1x1 lowp_fmat1; - /// Double-qualifier floating-point 2x4 matrix. + /// Low single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision - typedef mat<2, 4, f64, defaultp> f64mat2x4; + typedef lowp_fmat2x2 lowp_fmat2; - /// Double-qualifier floating-point 3x2 matrix. + /// Low single-qualifier floating-point 3x3 matrix. /// @see gtc_type_precision - typedef mat<3, 2, f64, defaultp> f64mat3x2; + typedef lowp_fmat3x3 lowp_fmat3; - /// Double-qualifier floating-point 3x3 matrix. + /// Low single-qualifier floating-point 4x4 matrix. /// @see gtc_type_precision - typedef mat<3, 3, f64, defaultp> f64mat3x3; + typedef lowp_fmat4x4 lowp_fmat4; - /// Double-qualifier floating-point 3x4 matrix. + + /// Medium single-qualifier floating-point 1x1 matrix. /// @see gtc_type_precision - typedef mat<3, 4, f64, defaultp> f64mat3x4; + //typedef mediump_f32 mediump_fmat1x1; - /// Double-qualifier floating-point 4x2 matrix. + /// Medium single-qualifier floating-point 2x2 matrix. /// @see gtc_type_precision - typedef mat<4, 2, f64, defaultp> f64mat4x2; + typedef mat<2, 2, f32, mediump> mediump_fmat2x2; - /// Double-qualifier floating-point 4x3 matrix. + /// Medium single-qualifier floating-point 2x3 matrix. /// @see gtc_type_precision - typedef mat<4, 3, f64, defaultp> f64mat4x3; + typedef mat<2, 3, f32, mediump> mediump_fmat2x3; - /// Double-qualifier floating-point 4x4 matrix. + /// Medium single-qualifier floating-point 2x4 matrix. /// @see gtc_type_precision - typedef mat<4, 4, f64, defaultp> f64mat4x4; + typedef mat<2, 4, f32, mediump> mediump_fmat2x4; -# endif//GLM_FORCE_SINGLE_ONLY + /// Medium single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, mediump> mediump_fmat3x2; - ////////////////////////// - // Quaternion types + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, mediump> mediump_fmat3x3; - /// Single-qualifier floating-point quaternion. + /// Medium single-qualifier floating-point 3x4 matrix. /// @see gtc_type_precision - typedef tquat f32quat; + typedef mat<3, 4, f32, mediump> mediump_fmat3x4; -# ifndef GLM_FORCE_SINGLE_ONLY + /// Medium single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, mediump> mediump_fmat4x2; + + /// Medium single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, mediump> mediump_fmat4x3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, mediump> mediump_fmat4x4; + + /// Medium single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef mediump_fmat1x1 mediump_fmat1; + + /// Medium single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_fmat2x2 mediump_fmat2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_fmat3x3 mediump_fmat3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_fmat4x4 mediump_fmat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_f32 highp_fmat1x1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, highp> highp_fmat2x2; + + /// High single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, highp> highp_fmat2x3; + + /// High single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, highp> highp_fmat2x4; + + /// High single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, highp> highp_fmat3x2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, highp> highp_fmat3x3; + + /// High single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, highp> highp_fmat3x4; + + /// High single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, highp> highp_fmat4x2; + + /// High single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, highp> highp_fmat4x3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, highp> highp_fmat4x4; + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_fmat1x1 highp_fmat1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_fmat2x2 highp_fmat2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_fmat3x3 highp_fmat3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_fmat4x4 highp_fmat4; + + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 lowp_f32mat1x1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; + + /// Low single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; + + /// Low single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; + + /// Low single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; + + /// Low single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; + + /// Low single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; + + /// Low single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 lowp_f32mat1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat2x2 lowp_f32mat2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat3x3 lowp_f32mat3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat4x4 lowp_f32mat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 mediump_f32mat1x1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; + + /// Medium single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; + + /// Medium single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; + + /// Medium single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; + + /// Medium single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; + + /// Medium single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; + + /// Medium single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; + + /// Medium single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// Medium single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat2x2 mediump_f32mat2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat3x3 mediump_f32mat3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat4x4 mediump_f32mat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 highp_f32mat1x1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, highp> highp_f32mat2x2; + + /// High single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, highp> highp_f32mat2x3; + + /// High single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, highp> highp_f32mat2x4; + + /// High single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, highp> highp_f32mat3x2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, highp> highp_f32mat3x3; + + /// High single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, highp> highp_f32mat3x4; + + /// High single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, highp> highp_f32mat4x2; + + /// High single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, highp> highp_f32mat4x3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, highp> highp_f32mat4x4; + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_f32mat2x2 highp_f32mat2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_f32mat3x3 highp_f32mat3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_f32mat4x4 highp_f32mat4; + + + /// Low double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 lowp_f64mat1x1; + + /// Low double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; + + /// Low double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; + + /// Low double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; + + /// Low double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; + + /// Low double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; + + /// Low double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; + + /// Low double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; + + /// Low double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; + + /// Low double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; + + /// Low double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef lowp_f64mat1x1 lowp_f64mat1; + + /// Low double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat2x2 lowp_f64mat2; + + /// Low double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat3x3 lowp_f64mat3; + + /// Low double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat4x4 lowp_f64mat4; + + + /// Medium double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 Highp_f64mat1x1; + + /// Medium double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; + + /// Medium double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; + + /// Medium double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; + + /// Medium double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; + + /// Medium double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; + + /// Medium double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; + + /// Medium double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; + + /// Medium double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; + + /// Medium double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; + + /// Medium double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef mediump_f64mat1x1 mediump_f64mat1; + + /// Medium double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat2x2 mediump_f64mat2; + + /// Medium double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat3x3 mediump_f64mat3; + + /// Medium double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat4x4 mediump_f64mat4; + + /// High double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 highp_f64mat1x1; + + /// High double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, highp> highp_f64mat2x2; + + /// High double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, highp> highp_f64mat2x3; + + /// High double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, highp> highp_f64mat2x4; + + /// High double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, highp> highp_f64mat3x2; + + /// High double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, highp> highp_f64mat3x3; + + /// High double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, highp> highp_f64mat3x4; + + /// High double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, highp> highp_f64mat4x2; + + /// High double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, highp> highp_f64mat4x3; + + /// High double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, highp> highp_f64mat4x4; + + /// High double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_f64mat1x1 highp_f64mat1; + + /// High double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_f64mat2x2 highp_f64mat2; + + /// High double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_f64mat3x3 highp_f64mat3; + + /// High double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_f64mat4x4 highp_f64mat4; + + + ///////////////////////////// + // Signed int vector types + + /// Low qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, lowp> lowp_ivec1; + + /// Low qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, lowp> lowp_ivec2; + + /// Low qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, lowp> lowp_ivec3; + + /// Low qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, lowp> lowp_ivec4; + + + /// Medium qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, mediump> mediump_ivec1; + + /// Medium qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, mediump> mediump_ivec2; + + /// Medium qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, mediump> mediump_ivec3; + + /// Medium qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, mediump> mediump_ivec4; + + + /// High qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, highp> highp_ivec1; + + /// High qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, highp> highp_ivec2; + + /// High qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, highp> highp_ivec3; + + /// High qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, highp> highp_ivec4; + + + /// Low qualifier 8 bit signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, i8, lowp> lowp_i8vec1; + + /// Low qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, lowp> lowp_i8vec2; + + /// Low qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, lowp> lowp_i8vec3; + + /// Low qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, lowp> lowp_i8vec4; + + + /// Medium qualifier 8 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i8, mediump> mediump_i8vec1; + + /// Medium qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, mediump> mediump_i8vec2; + + /// Medium qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, mediump> mediump_i8vec3; + + /// Medium qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, mediump> mediump_i8vec4; + + + /// High qualifier 8 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i8, highp> highp_i8vec1; + + /// High qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, highp> highp_i8vec2; + + /// High qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, highp> highp_i8vec3; + + /// High qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, highp> highp_i8vec4; + + + /// Low qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, lowp> lowp_i16vec1; + + /// Low qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, lowp> lowp_i16vec2; + + /// Low qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, lowp> lowp_i16vec3; + + /// Low qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, lowp> lowp_i16vec4; + + + /// Medium qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, mediump> mediump_i16vec1; + + /// Medium qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, mediump> mediump_i16vec2; + + /// Medium qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, mediump> mediump_i16vec3; + + /// Medium qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, mediump> mediump_i16vec4; + + + /// High qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, highp> highp_i16vec1; + + /// High qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, highp> highp_i16vec2; + + /// High qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, highp> highp_i16vec3; + + /// High qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, highp> highp_i16vec4; + + + /// Low qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, lowp> lowp_i32vec1; + + /// Low qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, lowp> lowp_i32vec2; + + /// Low qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, lowp> lowp_i32vec3; + + /// Low qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, lowp> lowp_i32vec4; + + + /// Medium qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, mediump> mediump_i32vec1; + + /// Medium qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, mediump> mediump_i32vec2; + + /// Medium qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, mediump> mediump_i32vec3; + + /// Medium qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, mediump> mediump_i32vec4; + + + /// High qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, highp> highp_i32vec1; + + /// High qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, highp> highp_i32vec2; + + /// High qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, highp> highp_i32vec3; + + /// High qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, highp> highp_i32vec4; + + + /// Low qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, lowp> lowp_i64vec1; + + /// Low qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, lowp> lowp_i64vec2; + + /// Low qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, lowp> lowp_i64vec3; + + /// Low qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, lowp> lowp_i64vec4; + + + /// Medium qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, mediump> mediump_i64vec1; + + /// Medium qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, mediump> mediump_i64vec2; + + /// Medium qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, mediump> mediump_i64vec3; + + /// Medium qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, mediump> mediump_i64vec4; + + + /// High qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, highp> highp_i64vec1; + + /// High qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, highp> highp_i64vec2; + + /// High qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, highp> highp_i64vec3; + + /// High qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, highp> highp_i64vec4; + + + ///////////////////////////// + // Unsigned int vector types + + /// Low qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, lowp> lowp_uvec1; + + /// Low qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, lowp> lowp_uvec2; + + /// Low qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, lowp> lowp_uvec3; + + /// Low qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, lowp> lowp_uvec4; + + + /// Medium qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, mediump> mediump_uvec1; + + /// Medium qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, mediump> mediump_uvec2; + + /// Medium qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, mediump> mediump_uvec3; + + /// Medium qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, mediump> mediump_uvec4; + + + /// High qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, highp> highp_uvec1; + + /// High qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, highp> highp_uvec2; + + /// High qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, highp> highp_uvec3; + + /// High qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, highp> highp_uvec4; + + + /// Low qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, lowp> lowp_u8vec1; + + /// Low qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, lowp> lowp_u8vec2; + + /// Low qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, lowp> lowp_u8vec3; + + /// Low qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, lowp> lowp_u8vec4; + + + /// Medium qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, mediump> mediump_u8vec1; + + /// Medium qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, mediump> mediump_u8vec2; + + /// Medium qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, mediump> mediump_u8vec3; + + /// Medium qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, mediump> mediump_u8vec4; + + + /// High qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, highp> highp_u8vec1; + + /// High qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, highp> highp_u8vec2; + + /// High qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, highp> highp_u8vec3; + + /// High qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, highp> highp_u8vec4; + + + /// Low qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, lowp> lowp_u16vec1; + + /// Low qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, lowp> lowp_u16vec2; + + /// Low qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, lowp> lowp_u16vec3; + + /// Low qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, lowp> lowp_u16vec4; + + + /// Medium qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, mediump> mediump_u16vec1; + + /// Medium qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, mediump> mediump_u16vec2; + + /// Medium qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, mediump> mediump_u16vec3; + + /// Medium qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, mediump> mediump_u16vec4; + + + /// High qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, highp> highp_u16vec1; + + /// High qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, highp> highp_u16vec2; + + /// High qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, highp> highp_u16vec3; + + /// High qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, highp> highp_u16vec4; + + + /// Low qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, lowp> lowp_u32vec1; + + /// Low qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, lowp> lowp_u32vec2; + + /// Low qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, lowp> lowp_u32vec3; + + /// Low qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, lowp> lowp_u32vec4; + + + /// Medium qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, mediump> mediump_u32vec1; + + /// Medium qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, mediump> mediump_u32vec2; + + /// Medium qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, mediump> mediump_u32vec3; + + /// Medium qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, mediump> mediump_u32vec4; + + + /// High qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, highp> highp_u32vec1; + + /// High qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, highp> highp_u32vec2; + + /// High qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, highp> highp_u32vec3; + + /// High qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, highp> highp_u32vec4; + + + /// Low qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, lowp> lowp_u64vec1; + + /// Low qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, lowp> lowp_u64vec2; + + /// Low qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, lowp> lowp_u64vec3; + + /// Low qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, lowp> lowp_u64vec4; + + + /// Medium qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, mediump> mediump_u64vec1; + + /// Medium qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, mediump> mediump_u64vec2; + + /// Medium qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, mediump> mediump_u64vec3; + + /// Medium qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, mediump> mediump_u64vec4; + + + /// High qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, highp> highp_u64vec1; + + /// High qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, highp> highp_u64vec2; + + /// High qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, highp> highp_u64vec3; + + /// High qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, highp> highp_u64vec4; + + + ////////////////////// + // Float vector types + + /// 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 float32_t; + + /// 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 f32; + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 float64_t; + + /// 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 f64; +# endif//GLM_FORCE_SINGLE_ONLY + + /// Single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, defaultp> fvec1; + + /// Single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, float, defaultp> fvec2; + + /// Single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, float, defaultp> fvec3; + + /// Single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, float, defaultp> fvec4; + + + /// Single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, defaultp> f32vec1; + + /// Single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f32, defaultp> f32vec2; + + /// Single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f32, defaultp> f32vec3; + + /// Single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f32, defaultp> f32vec4; + +# ifndef GLM_FORCE_SINGLE_ONLY + /// Double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, defaultp> f64vec1; + + /// Double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, defaultp> f64vec2; + + /// Double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, defaultp> f64vec3; + + /// Double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, defaultp> f64vec4; +# endif//GLM_FORCE_SINGLE_ONLY + + + ////////////////////// + // Float matrix types + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 fmat1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> fmat2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> fmat3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> fmat4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 fmat1x1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> fmat2x2; + + /// Single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, defaultp> fmat2x3; + + /// Single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, defaultp> fmat2x4; + + /// Single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, defaultp> fmat3x2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> fmat3x3; + + /// Single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, defaultp> fmat3x4; + + /// Single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, defaultp> fmat4x2; + + /// Single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, defaultp> fmat4x3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> fmat4x4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> f32mat2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> f32mat3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> f32mat4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 f32mat1x1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> f32mat2x2; + + /// Single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, defaultp> f32mat2x3; + + /// Single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, defaultp> f32mat2x4; + + /// Single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, defaultp> f32mat3x2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> f32mat3x3; + + /// Single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, defaultp> f32mat3x4; + + /// Single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, defaultp> f32mat4x2; + + /// Single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, defaultp> f32mat4x3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> f32mat4x4; + + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f64mat1; + + /// Double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, defaultp> f64mat2; + + /// Double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, defaultp> f64mat3; + + /// Double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, defaultp> f64mat4; + + + /// Double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 f64mat1x1; + + /// Double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, defaultp> f64mat2x2; + + /// Double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, defaultp> f64mat2x3; + + /// Double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, defaultp> f64mat2x4; + + /// Double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, defaultp> f64mat3x2; + + /// Double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, defaultp> f64mat3x3; + + /// Double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, defaultp> f64mat3x4; + + /// Double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, defaultp> f64mat4x2; + + /// Double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, defaultp> f64mat4x3; + + /// Double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, defaultp> f64mat4x4; + +# endif//GLM_FORCE_SINGLE_ONLY + + ////////////////////////// + // Quaternion types + + /// Single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua f32quat; + + /// Low single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua lowp_f32quat; + + /// Low double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua lowp_f64quat; + + /// Medium single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua mediump_f32quat; + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Medium double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua mediump_f64quat; + + /// High single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua highp_f32quat; + + /// High double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua highp_f64quat; /// Double-qualifier floating-point quaternion. /// @see gtc_type_precision - typedef tquat f64quat; + typedef qua f64quat; # endif//GLM_FORCE_SINGLE_ONLY diff --git a/vendor/glm/gtc/type_precision.inl b/vendor/glm/gtc/type_precision.inl old mode 100755 new mode 100644 index cbfd4d859e..ae8091206b --- a/vendor/glm/gtc/type_precision.inl +++ b/vendor/glm/gtc/type_precision.inl @@ -1,5 +1,4 @@ -/// @ref gtc_swizzle -/// @file glm/gtc/swizzle.inl +/// @ref gtc_precision namespace glm { diff --git a/vendor/glm/gtc/type_ptr.hpp b/vendor/glm/gtc/type_ptr.hpp old mode 100755 new mode 100644 index 5c15cc4096..d7e625aa59 --- a/vendor/glm/gtc/type_ptr.hpp +++ b/vendor/glm/gtc/type_ptr.hpp @@ -11,8 +11,7 @@ /// /// Handles the interaction between pointers and vector, matrix types. /// -/// This extension defines an overloaded function, glm::value_ptr, which -/// takes any of the \ref core_template "core template types". It returns +/// This extension defines an overloaded function, glm::value_ptr. It returns /// a pointer to the memory layout of the object. Matrix types store their values /// in column-major order. /// @@ -51,7 +50,7 @@ #include "../mat4x4.hpp" #include -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_type_ptr extension included") #endif @@ -223,7 +222,7 @@ namespace glm /// Build a quaternion from a pointer. /// @see gtc_type_ptr template - GLM_FUNC_DECL tquat make_quat(T const * const ptr); + GLM_FUNC_DECL qua make_quat(T const * const ptr); /// @} }//namespace glm diff --git a/vendor/glm/gtc/type_ptr.inl b/vendor/glm/gtc/type_ptr.inl old mode 100755 new mode 100644 index 7a9e21ec7f..4e9ed72f97 --- a/vendor/glm/gtc/type_ptr.inl +++ b/vendor/glm/gtc/type_ptr.inl @@ -1,5 +1,4 @@ /// @ref gtc_type_ptr -/// @file glm/gtc/type_ptr.inl #include @@ -8,6 +7,18 @@ namespace glm /// @addtogroup gtc_type_ptr /// @{ + template + GLM_FUNC_QUALIFIER T const* value_ptr(vec<1, T, Q> const& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<1, T, Q>& v) + { + return &(v.x); + } + template GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, Q> const& v) { @@ -153,109 +164,109 @@ namespace glm } template - GLM_FUNC_QUALIFIER T const * value_ptr(tquat const& q) + GLM_FUNC_QUALIFIER T const * value_ptr(qua const& q) { return &(q[0]); } template - GLM_FUNC_QUALIFIER T* value_ptr(tquat& q) + GLM_FUNC_QUALIFIER T* value_ptr(qua& q) { return &(q[0]); } template - inline vec<1, T, Q> make_vec1(vec<1, T, Q> const& v) + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<1, T, Q> const& v) { return v; } template - inline vec<1, T, Q> make_vec1(vec<2, T, Q> const& v) + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<2, T, Q> const& v) { return vec<1, T, Q>(v); } template - inline vec<1, T, Q> make_vec1(vec<3, T, Q> const& v) + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<3, T, Q> const& v) { return vec<1, T, Q>(v); } template - inline vec<1, T, Q> make_vec1(vec<4, T, Q> const& v) + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<4, T, Q> const& v) { return vec<1, T, Q>(v); } template - inline vec<2, T, Q> make_vec2(vec<1, T, Q> const& v) + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<1, T, Q> const& v) { return vec<2, T, Q>(v.x, static_cast(0)); } template - inline vec<2, T, Q> make_vec2(vec<2, T, Q> const& v) + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<2, T, Q> const& v) { return v; } template - inline vec<2, T, Q> make_vec2(vec<3, T, Q> const& v) + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<3, T, Q> const& v) { return vec<2, T, Q>(v); } template - inline vec<2, T, Q> make_vec2(vec<4, T, Q> const& v) + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<4, T, Q> const& v) { return vec<2, T, Q>(v); } template - inline vec<3, T, Q> make_vec3(vec<1, T, Q> const& v) + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<1, T, Q> const& v) { return vec<3, T, Q>(v.x, static_cast(0), static_cast(0)); } template - inline vec<3, T, Q> make_vec3(vec<2, T, Q> const& v) + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<2, T, Q> const& v) { return vec<3, T, Q>(v.x, v.y, static_cast(0)); } template - inline vec<3, T, Q> make_vec3(vec<3, T, Q> const& v) + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<3, T, Q> const& v) { return v; } template - inline vec<3, T, Q> make_vec3(vec<4, T, Q> const& v) + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<4, T, Q> const& v) { return vec<3, T, Q>(v); } template - inline vec<4, T, Q> make_vec4(vec<1, T, Q> const& v) + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<1, T, Q> const& v) { return vec<4, T, Q>(v.x, static_cast(0), static_cast(0), static_cast(1)); } template - inline vec<4, T, Q> make_vec4(vec<2, T, Q> const& v) + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<2, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, static_cast(0), static_cast(1)); } template - inline vec<4, T, Q> make_vec4(vec<3, T, Q> const& v) + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<3, T, Q> const& v) { return vec<4, T, Q>(v.x, v.y, v.z, static_cast(1)); } template - inline vec<4, T, Q> make_vec4(vec<4, T, Q> const& v) + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<4, T, Q> const& v) { return v; } @@ -375,10 +386,10 @@ namespace glm } template - GLM_FUNC_QUALIFIER tquat make_quat(T const *const ptr) + GLM_FUNC_QUALIFIER qua make_quat(T const *const ptr) { - tquat Result; - memcpy(value_ptr(Result), ptr, sizeof(tquat)); + qua Result; + memcpy(value_ptr(Result), ptr, sizeof(qua)); return Result; } diff --git a/vendor/glm/gtc/ulp.hpp b/vendor/glm/gtc/ulp.hpp old mode 100755 new mode 100644 index 4ed48d5688..7b918f0fa7 --- a/vendor/glm/gtc/ulp.hpp +++ b/vendor/glm/gtc/ulp.hpp @@ -17,10 +17,10 @@ // Dependencies #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" -#include "../detail/type_int.hpp" -#include "../detail/compute_vector_relational.hpp" +#include "../detail/_vectorize.hpp" +#include "../ext/scalar_int_sized.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_ulp extension included") #endif @@ -30,36 +30,126 @@ namespace glm /// @{ /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// /// @see gtc_ulp template - GLM_FUNC_DECL genType next_float(genType const& x); + GLM_FUNC_DECL genType next_float(genType x); /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// /// @see gtc_ulp template - GLM_FUNC_DECL genType prev_float(genType const& x); + GLM_FUNC_DECL genType prev_float(genType x); /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// /// @see gtc_ulp template - GLM_FUNC_DECL genType next_float(genType const& x, uint const& Distance); + GLM_FUNC_DECL genType next_float(genType x, int ULPs); /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// /// @see gtc_ulp template - GLM_FUNC_DECL genType prev_float(genType const& x, uint const& Distance); + GLM_FUNC_DECL genType prev_float(genType x, int ULPs); - /// Return the distance in the number of ULP between 2 scalars. + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// /// @see gtc_ulp - template - GLM_FUNC_DECL uint float_distance(T const& x, T const& y); + GLM_FUNC_DECL int float_distance(float x, float y); - /// Return the distance in the number of ULP between 2 vectors. + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// /// @see gtc_ulp - template - GLM_FUNC_DECL vec<2, uint, Q> float_distance(vec<2, T, Q> const& x, vec<2, T, Q> const& y); + GLM_FUNC_DECL int64 float_distance(double x, double y); + + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x, int ULPs); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x, vec const& ULPs); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x, vec const& ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec float_distance(vec const& x, vec const& y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec float_distance(vec const& x, vec const& y); /// @} -}// namespace glm +}//namespace glm #include "ulp.inl" diff --git a/vendor/glm/gtc/ulp.inl b/vendor/glm/gtc/ulp.inl old mode 100755 new mode 100644 index 620be36cc1..836c84b4a2 --- a/vendor/glm/gtc/ulp.inl +++ b/vendor/glm/gtc/ulp.inl @@ -1,339 +1,173 @@ /// @ref gtc_ulp -/// @file glm/gtc/ulp.inl -/// -/// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -/// -/// Developed at SunPro, a Sun Microsystems, Inc. business. -/// Permission to use, copy, modify, and distribute this -/// software is freely granted, provided that this notice -/// is preserved. -#include "../detail/type_int.hpp" -#include "epsilon.hpp" -#include -#include -#include - -#if(GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(push) -# pragma warning(disable : 4127) -#endif - -typedef union -{ - float value; - /* FIXME: Assumes 32 bit int. */ - unsigned int word; -} ieee_float_shape_type; - -typedef union -{ - double value; - struct - { - glm::detail::int32 lsw; - glm::detail::int32 msw; - } parts; -} ieee_double_shape_type; - -#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ - do { \ - ieee_double_shape_type ew_u; \ - ew_u.value = (d); \ - (ix0) = ew_u.parts.msw; \ - (ix1) = ew_u.parts.lsw; \ - } while (0) - -#define GLM_GET_FLOAT_WORD(i,d) \ - do { \ - ieee_float_shape_type gf_u; \ - gf_u.value = (d); \ - (i) = gf_u.word; \ - } while (0) - -#define GLM_SET_FLOAT_WORD(d,i) \ - do { \ - ieee_float_shape_type sf_u; \ - sf_u.word = (i); \ - (d) = sf_u.value; \ - } while (0) - -#define GLM_INSERT_WORDS(d,ix0,ix1) \ - do { \ - ieee_double_shape_type iw_u; \ - iw_u.parts.msw = (ix0); \ - iw_u.parts.lsw = (ix1); \ - (d) = iw_u.value; \ - } while (0) - -namespace glm{ -namespace detail -{ - GLM_FUNC_QUALIFIER float nextafterf(float x, float y) - { - volatile float t; - glm::detail::int32 hx, hy, ix, iy; - - GLM_GET_FLOAT_WORD(hx, x); - GLM_GET_FLOAT_WORD(hy, y); - ix = hx&0x7fffffff; // |x| - iy = hy&0x7fffffff; // |y| - - if((ix>0x7f800000) || // x is nan - (iy>0x7f800000)) // y is nan - return x+y; - if(compute_equal::call(x, y)) - return y; // x=y, return y - if(ix==0) - { // x == 0 - GLM_SET_FLOAT_WORD(x,(hy&0x80000000)|1);// return +-minsubnormal - t = x*x; - if(detail::compute_equal::call(t, x)) - return t; - else - return x; // raise underflow flag - } - if(hx>=0) - { // x > 0 - if(hx>hy) // x > y, x -= ulp - hx -= 1; - else // x < y, x += ulp - hx += 1; - } - else - { // x < 0 - if(hy>=0||hx>hy) // x < y, x -= ulp - hx -= 1; - else // x > y, x += ulp - hx += 1; - } - hy = hx&0x7f800000; - if(hy>=0x7f800000) - return x+x; // overflow - if(hy<0x00800000) // underflow - { - t = x*x; - if(!detail::compute_equal::call(t, x)) - { // raise underflow flag - GLM_SET_FLOAT_WORD(y,hx); - return y; - } - } - GLM_SET_FLOAT_WORD(x,hx); - return x; - } - - GLM_FUNC_QUALIFIER double nextafter(double x, double y) - { - volatile double t; - glm::detail::int32 hx, hy, ix, iy; - glm::detail::uint32 lx, ly; - - GLM_EXTRACT_WORDS(hx, lx, x); - GLM_EXTRACT_WORDS(hy, ly, y); - ix = hx & 0x7fffffff; // |x| - iy = hy & 0x7fffffff; // |y| - - if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || // x is nan - ((iy>=0x7ff00000)&&((iy-0x7ff00000)|ly)!=0)) // y is nan - return x+y; - if(detail::compute_equal::call(x, y)) - return y; // x=y, return y - if((ix|lx)==0) - { // x == 0 - GLM_INSERT_WORDS(x, hy & 0x80000000, 1); // return +-minsubnormal - t = x*x; - if(detail::compute_equal::call(t, x)) - return t; - else - return x; // raise underflow flag - } - if(hx>=0) { // x > 0 - if(hx>hy||((hx==hy)&&(lx>ly))) { // x > y, x -= ulp - if(lx==0) hx -= 1; - lx -= 1; - } else { // x < y, x += ulp - lx += 1; - if(lx==0) hx += 1; - } - } else { // x < 0 - if(hy>=0||hx>hy||((hx==hy)&&(lx>ly))){// x < y, x -= ulp - if(lx==0) hx -= 1; - lx -= 1; - } else { // x > y, x += ulp - lx += 1; - if(lx==0) hx += 1; - } - } - hy = hx&0x7ff00000; - if(hy>=0x7ff00000) - return x+x; // overflow - if(hy<0x00100000) - { // underflow - t = x*x; - if(!detail::compute_equal::call(t, x)) - { // raise underflow flag - GLM_INSERT_WORDS(y,hx,lx); - return y; - } - } - GLM_INSERT_WORDS(x,hx,lx); - return x; - } -}//namespace detail -}//namespace glm - -#if(GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(pop) -#endif +#include "../ext/scalar_ulp.hpp" namespace glm { template<> - GLM_FUNC_QUALIFIER float next_float(float const& x) + GLM_FUNC_QUALIFIER float next_float(float x) { # if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::max()); + return std::nextafter(x, std::numeric_limits::max()); # elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafterf(x, FLT_MAX); + return detail::nextafterf(x, FLT_MAX); # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafterf(x, FLT_MAX); + return __builtin_nextafterf(x, FLT_MAX); # else - return nextafterf(x, FLT_MAX); + return nextafterf(x, FLT_MAX); # endif } template<> - GLM_FUNC_QUALIFIER double next_float(double const& x) + GLM_FUNC_QUALIFIER double next_float(double x) { # if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::max()); + return std::nextafter(x, std::numeric_limits::max()); # elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafter(x, std::numeric_limits::max()); + return detail::nextafter(x, std::numeric_limits::max()); # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafter(x, FLT_MAX); + return __builtin_nextafter(x, DBL_MAX); # else - return nextafter(x, DBL_MAX); + return nextafter(x, DBL_MAX); # endif } - template - GLM_FUNC_QUALIFIER vec next_float(vec const& x) + template + GLM_FUNC_QUALIFIER T next_float(T x, int ULPs) { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = next_float(x[i]); - return Result; + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'next_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for (int i = 0; i < ULPs; ++i) + temp = next_float(temp); + return temp; } - GLM_FUNC_QUALIFIER float prev_float(float const& x) + GLM_FUNC_QUALIFIER float prev_float(float x) { # if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::min()); + return std::nextafter(x, std::numeric_limits::min()); # elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafterf(x, FLT_MIN); + return detail::nextafterf(x, FLT_MIN); # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafterf(x, FLT_MIN); + return __builtin_nextafterf(x, FLT_MIN); # else - return nextafterf(x, FLT_MIN); + return nextafterf(x, FLT_MIN); # endif } - GLM_FUNC_QUALIFIER double prev_float(double const& x) + GLM_FUNC_QUALIFIER double prev_float(double x) { # if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::min()); + return std::nextafter(x, std::numeric_limits::min()); # elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return _nextafter(x, DBL_MIN); + return _nextafter(x, DBL_MIN); # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafter(x, DBL_MIN); + return __builtin_nextafter(x, DBL_MIN); # else - return nextafter(x, DBL_MIN); + return nextafter(x, DBL_MIN); # endif } + template + GLM_FUNC_QUALIFIER T prev_float(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'prev_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for (int i = 0; i < ULPs; ++i) + temp = prev_float(temp); + return temp; + } + + GLM_FUNC_QUALIFIER int float_distance(float x, float y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + + GLM_FUNC_QUALIFIER int64 float_distance(double x, double y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + template - GLM_FUNC_QUALIFIER vec prev_float(vec const& x) + GLM_FUNC_QUALIFIER vec next_float(vec const& x) { vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = prev_float(x[i]); + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i]); return Result; } - template - GLM_FUNC_QUALIFIER T next_float(T const& x, uint const& ulps) + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x, int ULPs) { - T temp = x; - for(uint i = 0; i < ulps; ++i) - temp = next_float(temp); - return temp; + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i], ULPs); + return Result; } template - GLM_FUNC_QUALIFIER vec next_float(vec const& x, vec const& ulps) + GLM_FUNC_QUALIFIER vec next_float(vec const& x, vec const& ULPs) { vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = next_float(x[i], ulps[i]); + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i], ULPs[i]); return Result; } - template - GLM_FUNC_QUALIFIER T prev_float(T const& x, uint const& ulps) + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x) { - T temp = x; - for(uint i = 0; i < ulps; ++i) - temp = prev_float(temp); - return temp; + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i]); + return Result; } template - GLM_FUNC_QUALIFIER vec prev_float(vec const& x, vec const& ulps) + GLM_FUNC_QUALIFIER vec prev_float(vec const& x, int ULPs) { vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = prev_float(x[i], ulps[i]); + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i], ULPs); return Result; } - template - GLM_FUNC_QUALIFIER uint float_distance(T const& x, T const& y) + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x, vec const& ULPs) { - uint ulp = 0; - - if(x < y) - { - T temp = x; - while(glm::epsilonNotEqual(temp, y, glm::epsilon()))// && ulp < std::numeric_limits::max()) - { - ++ulp; - temp = next_float(temp); - } - } - else if(y < x) - { - T temp = y; - while(glm::epsilonNotEqual(temp, x, glm::epsilon()))// && ulp < std::numeric_limits::max()) - { - ++ulp; - temp = next_float(temp); - } - } - else // == - { - - } + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i], ULPs[i]); + return Result; + } - return ulp; + template + GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = float_distance(x[i], y[i]); + return Result; } - template - GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) + template + GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = float_distance(x[i], y[i]); return Result; } }//namespace glm + diff --git a/vendor/glm/gtc/vec1.hpp b/vendor/glm/gtc/vec1.hpp old mode 100755 new mode 100644 index 44da3abdbe..63697a2157 --- a/vendor/glm/gtc/vec1.hpp +++ b/vendor/glm/gtc/vec1.hpp @@ -13,10 +13,18 @@ #pragma once // Dependency: -#include "../ext/vec1.hpp" +#include "../ext/vector_bool1.hpp" +#include "../ext/vector_bool1_precision.hpp" +#include "../ext/vector_float1.hpp" +#include "../ext/vector_float1_precision.hpp" +#include "../ext/vector_double1.hpp" +#include "../ext/vector_double1_precision.hpp" +#include "../ext/vector_int1.hpp" +#include "../ext/vector_int1_sized.hpp" +#include "../ext/vector_uint1.hpp" +#include "../ext/vector_uint1_sized.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_vec1 extension included") #endif -#include "vec1.inl" diff --git a/vendor/glm/gtc/vec1.inl b/vendor/glm/gtc/vec1.inl deleted file mode 100755 index 5a6627c172..0000000000 --- a/vendor/glm/gtc/vec1.inl +++ /dev/null @@ -1,2 +0,0 @@ -/// @ref gtc_vec1 -/// @file glm/gtc/vec1.inl diff --git a/vendor/glm/gtx/associated_min_max.hpp b/vendor/glm/gtx/associated_min_max.hpp old mode 100755 new mode 100644 index 42ac2eba48..435230d277 --- a/vendor/glm/gtx/associated_min_max.hpp +++ b/vendor/glm/gtx/associated_min_max.hpp @@ -9,7 +9,7 @@ /// /// Include to use the features of this extension. /// -/// @brief Min and max functions that return associated values not the compared onces. +/// @brief Min and max functions that return associated values not the compared ones. #pragma once @@ -17,10 +17,8 @@ #include "../glm.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL -# error "GLM: GTX_associated_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +# error "GLM: GLM_GTX_associated_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_associated_min_max extension included") #endif @@ -31,13 +29,13 @@ namespace glm /// Minimum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max - template + template GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b); /// Minimum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max template - GLM_FUNC_DECL vec<2, U, Q> associatedMin( + GLM_FUNC_DECL vec associatedMin( vec const& x, vec const& a, vec const& y, vec const& b); @@ -115,7 +113,7 @@ namespace glm /// Maximum comparison between 2 variables and returns 2 associated variable values /// @see gtx_associated_min_max template - GLM_FUNC_DECL vec<2, U, Q> associatedMax( + GLM_FUNC_DECL vec associatedMax( vec const& x, vec const& a, vec const& y, vec const& b); diff --git a/vendor/glm/gtx/associated_min_max.inl b/vendor/glm/gtx/associated_min_max.inl old mode 100755 new mode 100644 index d0666cc949..f09f5bb74c --- a/vendor/glm/gtx/associated_min_max.inl +++ b/vendor/glm/gtx/associated_min_max.inl @@ -1,17 +1,16 @@ /// @ref gtx_associated_min_max -/// @file glm/gtx/associated_min_max.inl namespace glm{ // Min comparison between 2 variables -template +template GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b) { return x < y ? a : b; } template -GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMin +GLM_FUNC_QUALIFIER vec associatedMin ( vec const& x, vec const& a, vec const& y, vec const& b @@ -87,7 +86,7 @@ GLM_FUNC_QUALIFIER U associatedMin ) { T Test1 = min(x, y); - T Test2 = min(z, w);; + T Test2 = min(z, w); U Result1 = x < y ? a : b; U Result2 = z < w ? c : d; U Result = Test1 < Test2 ? Result1 : Result2; @@ -153,7 +152,7 @@ GLM_FUNC_QUALIFIER vec associatedMin for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]);; + T Test2 = min(z[i], w[i]); U Result1 = x[i] < y[i] ? a : b; U Result2 = z[i] < w[i] ? c : d; Result[i] = Test1 < Test2 ? Result1 : Result2; @@ -170,7 +169,7 @@ GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b) // Max comparison between 2 variables template -GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMax +GLM_FUNC_QUALIFIER vec associatedMax ( vec const& x, vec const& a, vec const& y, vec const& b @@ -279,7 +278,7 @@ GLM_FUNC_QUALIFIER U associatedMax ) { T Test1 = max(x, y); - T Test2 = max(z, w);; + T Test2 = max(z, w); U Result1 = x > y ? a : b; U Result2 = z > w ? c : d; U Result = Test1 > Test2 ? Result1 : Result2; @@ -345,7 +344,7 @@ GLM_FUNC_QUALIFIER vec associatedMax for(length_t i = 0, n = Result.length(); i < n; ++i) { T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]);; + T Test2 = max(z[i], w[i]); U Result1 = x[i] > y[i] ? a : b; U Result2 = z[i] > w[i] ? c : d; Result[i] = Test1 > Test2 ? Result1 : Result2; diff --git a/vendor/glm/gtx/bit.hpp b/vendor/glm/gtx/bit.hpp old mode 100755 new mode 100644 index 2eb4c26533..2f6b3f6644 --- a/vendor/glm/gtx/bit.hpp +++ b/vendor/glm/gtx/bit.hpp @@ -17,10 +17,8 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_bit is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTX_bit extension is deprecated, include GLM_GTC_bitfield and GLM_GTC_integer instead") +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_bit extension included") #endif namespace glm diff --git a/vendor/glm/gtx/bit.inl b/vendor/glm/gtx/bit.inl old mode 100755 new mode 100644 index 277aeaa6cd..621b626240 --- a/vendor/glm/gtx/bit.inl +++ b/vendor/glm/gtx/bit.inl @@ -1,5 +1,4 @@ /// @ref gtx_bit -/// @file glm/gtx/bit.inl namespace glm { @@ -22,7 +21,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec highestBitValue(vec const& v) { - return detail::functor1::call(highestBitValue, v); + return detail::functor1::call(highestBitValue, v); } /////////////////// @@ -37,7 +36,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec lowestBitValue(vec const& v) { - return detail::functor1::call(lowestBitValue, v); + return detail::functor1::call(lowestBitValue, v); } /////////////////// @@ -52,7 +51,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec powerOfTwoAbove(vec const& v) { - return detail::functor1::call(powerOfTwoAbove, v); + return detail::functor1::call(powerOfTwoAbove, v); } /////////////////// @@ -67,7 +66,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec powerOfTwoBelow(vec const& v) { - return detail::functor1::call(powerOfTwoBelow, v); + return detail::functor1::call(powerOfTwoBelow, v); } ///////////////////// @@ -87,7 +86,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec powerOfTwoNearest(vec const& v) { - return detail::functor1::call(powerOfTwoNearest, v); + return detail::functor1::call(powerOfTwoNearest, v); } }//namespace glm diff --git a/vendor/glm/gtx/closest_point.hpp b/vendor/glm/gtx/closest_point.hpp old mode 100755 new mode 100644 index a78829994d..a248e4b593 --- a/vendor/glm/gtx/closest_point.hpp +++ b/vendor/glm/gtx/closest_point.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_closest_point extension included") #endif diff --git a/vendor/glm/gtx/closest_point.inl b/vendor/glm/gtx/closest_point.inl old mode 100755 new mode 100644 index 26d1e3822d..0a39b042b8 --- a/vendor/glm/gtx/closest_point.inl +++ b/vendor/glm/gtx/closest_point.inl @@ -1,5 +1,4 @@ /// @ref gtx_closest_point -/// @file glm/gtx/closest_point.inl namespace glm { diff --git a/vendor/glm/gtx/color_encoding.hpp b/vendor/glm/gtx/color_encoding.hpp old mode 100755 new mode 100644 index b57b3beb7d..4769e0abcb --- a/vendor/glm/gtx/color_encoding.hpp +++ b/vendor/glm/gtx/color_encoding.hpp @@ -19,7 +19,9 @@ #include "../vec3.hpp" #include -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#ifndef GLM_ENABLE_EXPERIMENTAL +# error "GLM: GLM_GTC_color_encoding is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_color_encoding extension included") #endif diff --git a/vendor/glm/gtx/color_encoding.inl b/vendor/glm/gtx/color_encoding.inl old mode 100755 new mode 100644 index 8dca67b928..e50fa3efa4 --- a/vendor/glm/gtx/color_encoding.inl +++ b/vendor/glm/gtx/color_encoding.inl @@ -1,5 +1,4 @@ /// @ref gtx_color_encoding -/// @file glm/gtx/color_encoding.inl namespace glm { diff --git a/vendor/glm/gtx/color_space.hpp b/vendor/glm/gtx/color_space.hpp old mode 100755 new mode 100644 index 9e95eb39f8..c39a1f47de --- a/vendor/glm/gtx/color_space.hpp +++ b/vendor/glm/gtx/color_space.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_color_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_color_space extension included") #endif diff --git a/vendor/glm/gtx/color_space.inl b/vendor/glm/gtx/color_space.inl old mode 100755 new mode 100644 index ff82395bff..ba29f751b9 --- a/vendor/glm/gtx/color_space.inl +++ b/vendor/glm/gtx/color_space.inl @@ -1,5 +1,7 @@ /// @ref gtx_color_space -/// @file glm/gtx/color_space.inl + +#include "../ext/scalar_relational.hpp" +#include "../ext/scalar_constants.hpp" namespace glm { @@ -9,7 +11,7 @@ namespace glm vec<3, T, Q> hsv = hsvColor; vec<3, T, Q> rgbColor; - if(hsv.y == static_cast(0)) + if(equal(hsv.y, static_cast(0), epsilon())) // achromatic (grey) rgbColor = vec<3, T, Q>(hsv.z); else @@ -64,21 +66,21 @@ namespace glm GLM_FUNC_QUALIFIER vec<3, T, Q> hsvColor(const vec<3, T, Q>& rgbColor) { vec<3, T, Q> hsv = rgbColor; - float Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b); - float Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b); - float Delta = Max - Min; + T Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b); + T Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b); + T Delta = Max - Min; hsv.z = Max; - if(Max != static_cast(0)) + if(!equal(Max, static_cast(0), epsilon())) { hsv.y = Delta / hsv.z; T h = static_cast(0); - if(rgbColor.r == Max) + if(equal(rgbColor.r, Max, epsilon())) // between yellow & magenta h = static_cast(0) + T(60) * (rgbColor.g - rgbColor.b) / Delta; - else if(rgbColor.g == Max) + else if(equal(rgbColor.g, Max, epsilon())) // between cyan & yellow h = static_cast(120) + T(60) * (rgbColor.b - rgbColor.r) / Delta; else diff --git a/vendor/glm/gtx/color_space_YCoCg.hpp b/vendor/glm/gtx/color_space_YCoCg.hpp old mode 100755 new mode 100644 index e82cbd8b69..a41803750e --- a/vendor/glm/gtx/color_space_YCoCg.hpp +++ b/vendor/glm/gtx/color_space_YCoCg.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_color_space_YCoCg is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") #endif diff --git a/vendor/glm/gtx/color_space_YCoCg.inl b/vendor/glm/gtx/color_space_YCoCg.inl old mode 100755 new mode 100644 index 105a576521..83ba857c08 --- a/vendor/glm/gtx/color_space_YCoCg.inl +++ b/vendor/glm/gtx/color_space_YCoCg.inl @@ -1,5 +1,4 @@ /// @ref gtx_color_space_YCoCg -/// @file glm/gtx/color_space_YCoCg.inl namespace glm { diff --git a/vendor/glm/gtx/common.hpp b/vendor/glm/gtx/common.hpp old mode 100755 new mode 100644 index 6eadf48cba..283f947b9d --- a/vendor/glm/gtx/common.hpp +++ b/vendor/glm/gtx/common.hpp @@ -20,9 +20,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_common is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_common extension included") #endif diff --git a/vendor/glm/gtx/common.inl b/vendor/glm/gtx/common.inl old mode 100755 new mode 100644 index 158eabe4c8..4651e35c8a --- a/vendor/glm/gtx/common.inl +++ b/vendor/glm/gtx/common.inl @@ -1,5 +1,4 @@ /// @ref gtx_common -/// @file glm/gtx/common.inl #include #include "../gtc/epsilon.hpp" @@ -13,7 +12,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) { - return detail::functor2::call(std::fmod, a, b); + return detail::functor2::call(TFmod(), a, b); } }; @@ -30,7 +29,7 @@ namespace detail template GLM_FUNC_QUALIFIER bool isdenormal(T const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs"); # if GLM_HAS_CXX11_STL return std::fpclassify(x) == FP_SUBNORMAL; @@ -45,7 +44,7 @@ namespace detail vec<1, T, Q> const& x ) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs"); return typename vec<1, T, Q>::bool_type( isdenormal(x.x)); @@ -57,7 +56,7 @@ namespace detail vec<2, T, Q> const& x ) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs"); return typename vec<2, T, Q>::bool_type( isdenormal(x.x), @@ -70,7 +69,7 @@ namespace detail vec<3, T, Q> const& x ) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs"); return typename vec<3, T, Q>::bool_type( isdenormal(x.x), @@ -84,7 +83,7 @@ namespace detail vec<4, T, Q> const& x ) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs"); return typename vec<4, T, Q>::bool_type( isdenormal(x.x), diff --git a/vendor/glm/gtx/compatibility.hpp b/vendor/glm/gtx/compatibility.hpp old mode 100755 new mode 100644 index e5b60399ef..376f8a0bd1 --- a/vendor/glm/gtx/compatibility.hpp +++ b/vendor/glm/gtx/compatibility.hpp @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_compatibility is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_compatibility extension included") #endif @@ -47,21 +45,22 @@ namespace glm template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, const vec<3, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, const vec<4, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) template GLM_FUNC_QUALIFIER vec<2, T, Q> saturate(const vec<2, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) template GLM_FUNC_QUALIFIER vec<3, T, Q> saturate(const vec<3, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) template GLM_FUNC_QUALIFIER vec<4, T, Q> saturate(const vec<4, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, Q> atan2(const vec<2, T, Q>& x, const vec<2, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<3, T, Q> atan2(const vec<3, T, Q>& x, const vec<3, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, Q> atan2(const vec<4, T, Q>& x, const vec<4, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER T atan2(T y, T x){return atan(y, x);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> atan2(const vec<2, T, Q>& y, const vec<2, T, Q>& x){return atan(y, x);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> atan2(const vec<3, T, Q>& y, const vec<3, T, Q>& x){return atan(y, x);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> atan2(const vec<4, T, Q>& y, const vec<4, T, Q>& x){return atan(y, x);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) template GLM_FUNC_DECL bool isfinite(genType const& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) template GLM_FUNC_DECL vec<1, bool, Q> isfinite(const vec<1, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) template GLM_FUNC_DECL vec<2, bool, Q> isfinite(const vec<2, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) template GLM_FUNC_DECL vec<3, bool, Q> isfinite(const vec<3, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) template GLM_FUNC_DECL vec<4, bool, Q> isfinite(const vec<4, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<4, bool, Q> isfinite(const qua& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension) typedef vec<2, bool, highp> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) diff --git a/vendor/glm/gtx/compatibility.inl b/vendor/glm/gtx/compatibility.inl old mode 100755 new mode 100644 index 11affa1c11..3e1571bcb8 --- a/vendor/glm/gtx/compatibility.inl +++ b/vendor/glm/gtx/compatibility.inl @@ -1,6 +1,3 @@ -/// @ref gtx_compatibility -/// @file glm/gtx/compatibility.inl - #include namespace glm @@ -13,7 +10,7 @@ namespace glm # if GLM_HAS_CXX11_STL return std::isfinite(x) != 0; # elif GLM_COMPILER & GLM_COMPILER_VC - return _finite(x); + return _finite(x) != 0; # elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID return _isfinite(x) != 0; # else @@ -62,4 +59,15 @@ namespace glm isfinite(x.w)); } + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isfinite( + qua const& x) + { + return vec<4, bool, Q>( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z), + isfinite(x.w)); + } + }//namespace glm diff --git a/vendor/glm/gtx/component_wise.hpp b/vendor/glm/gtx/component_wise.hpp old mode 100755 new mode 100644 index 6ed7d55970..b1caaa2744 --- a/vendor/glm/gtx/component_wise.hpp +++ b/vendor/glm/gtx/component_wise.hpp @@ -20,9 +20,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_component_wise is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_component_wise extension included") #endif @@ -63,6 +61,16 @@ namespace glm template GLM_FUNC_DECL typename genType::value_type compMax(genType const& v); + /// Find the minimum float between single vector components. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type fcompMin(genType const& v); + + /// Find the maximum float between single vector components. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type fcompMax(genType const& v); + /// @} }//namespace glm diff --git a/vendor/glm/gtx/component_wise.inl b/vendor/glm/gtx/component_wise.inl old mode 100755 new mode 100644 index 8ca0ca9863..a2eac83fbf --- a/vendor/glm/gtx/component_wise.inl +++ b/vendor/glm/gtx/component_wise.inl @@ -1,7 +1,8 @@ /// @ref gtx_component_wise -/// @file glm/gtx/component_wise.inl +#include "../ext/scalar_common.hpp" #include +#include namespace glm{ namespace detail @@ -15,8 +16,8 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& v) { - floatType const Min = static_cast(std::numeric_limits::min()); - floatType const Max = static_cast(std::numeric_limits::max()); + floatType const Min = static_cast((std::numeric_limits::min)()); + floatType const Max = static_cast((std::numeric_limits::max)()); return (vec(v) - Min) / (Max - Min) * static_cast(2) - static_cast(1); } }; @@ -26,7 +27,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& v) { - return vec(v) / static_cast(std::numeric_limits::max()); + return vec(v) / static_cast((std::numeric_limits::max)()); } }; @@ -48,7 +49,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& v) { - floatType const Max = static_cast(std::numeric_limits::max()) + static_cast(0.5); + floatType const Max = static_cast((std::numeric_limits::max)()) + static_cast(0.5); vec const Scaled(v * Max); vec const Result(Scaled - static_cast(0.5)); return Result; @@ -60,7 +61,7 @@ namespace detail { GLM_FUNC_QUALIFIER static vec call(vec const& v) { - return vec(vec(v) * static_cast(std::numeric_limits::max())); + return vec(vec(v) * static_cast((std::numeric_limits::max)())); } }; @@ -125,4 +126,22 @@ namespace detail Result = max(Result, v[i]); return Result; } + + template + GLM_FUNC_QUALIFIER T fcompMin(vec const& v) + { + T Result(v[0]); + for(length_t i = 1, n = v.length(); i < n; ++i) + Result = fmin(Result, v[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER T fcompMax(vec const& v) + { + T Result(v[0]); + for(length_t i = 1, n = v.length(); i < n; ++i) + Result = fmax(Result, v[i]); + return Result; + } }//namespace glm diff --git a/vendor/glm/gtx/dual_quaternion.hpp b/vendor/glm/gtx/dual_quaternion.hpp old mode 100755 new mode 100644 index 55445144d5..04a60706ef --- a/vendor/glm/gtx/dual_quaternion.hpp +++ b/vendor/glm/gtx/dual_quaternion.hpp @@ -22,9 +22,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_dual_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_dual_quaternion extension included") #endif @@ -39,11 +37,11 @@ namespace glm // -- Implementation detail -- typedef T value_type; - typedef glm::tquat part_type; + typedef qua part_type; // -- Data -- - glm::tquat real, dual; + qua real, dual; // -- Component accesses -- @@ -56,35 +54,35 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d); + GLM_CTOR_DECL tdualquat(tdualquat const& d); // -- Explicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& real); - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& orientation, vec<3, T, Q> const& translation); - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat const& real, tquat const& dual); + GLM_CTOR_DECL tdualquat(qua const& real); + GLM_CTOR_DECL tdualquat(qua const& orientation, vec<3, T, Q> const& translation); + GLM_CTOR_DECL tdualquat(qua const& real, qua const& dual); // -- Conversion constructors -- template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat const& q); + GLM_CTOR_DECL GLM_EXPLICIT tdualquat(tdualquat const& q); - GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<2, 4, T, Q> const& holder_mat); - GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<3, 4, T, Q> const& aug_mat); + GLM_CTOR_DECL GLM_EXPLICIT tdualquat(mat<2, 4, T, Q> const& holder_mat); + GLM_CTOR_DECL GLM_EXPLICIT tdualquat(mat<3, 4, T, Q> const& aug_mat); // -- Unary arithmetic operators -- - GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL tdualquat & operator=(tdualquat const& m) GLM_DEFAULT; template - GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m); + GLM_FUNC_DISCARD_DECL tdualquat & operator=(tdualquat const& m); template - GLM_FUNC_DECL tdualquat & operator*=(U s); + GLM_FUNC_DISCARD_DECL tdualquat & operator*=(U s); template - GLM_FUNC_DECL tdualquat & operator/=(U s); + GLM_FUNC_DISCARD_DECL tdualquat & operator/=(U s); }; // -- Unary bit operators -- diff --git a/vendor/glm/gtx/dual_quaternion.inl b/vendor/glm/gtx/dual_quaternion.inl old mode 100755 new mode 100644 index 5c82b882b4..3a04160e3a --- a/vendor/glm/gtx/dual_quaternion.inl +++ b/vendor/glm/gtx/dual_quaternion.inl @@ -1,5 +1,4 @@ /// @ref gtx_dual_quaternion -/// @file glm/gtx/dual_quaternion.inl #include "../geometric.hpp" #include @@ -24,23 +23,21 @@ namespace glm // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() -# ifdef GLM_FORCE_CTOR_INIT - : real(tquat()) - , dual(tquat(0, 0, 0, 0)) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE + : real(qua()) + , dual(qua::wxyz(0, 0, 0, 0)) # endif {} -# endif -# if !GLM_HAS_DEFAULTED_FUNCTIONS template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) : real(d.real) , dual(d.dual) {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template @@ -52,21 +49,21 @@ namespace glm // -- Explicit basic constructors -- template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& r) - : real(r), dual(tquat(0, 0, 0, 0)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r) + : real(r), dual(qua::wxyz(0, 0, 0, 0)) {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& q, vec<3, T, Q> const& p) - : real(q), dual( + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& q, vec<3, T, Q> const& p) + : real(q), dual(qua::wxyz( T(-0.5) * ( p.x*q.x + p.y*q.y + p.z*q.z), T(+0.5) * ( p.x*q.w + p.y*q.z - p.z*q.y), T(+0.5) * (-p.x*q.z + p.y*q.w + p.z*q.x), - T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w)) + T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w))) {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tquat const& r, tquat const& d) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r, qua const& d) : real(r), dual(d) {} @@ -80,28 +77,28 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tdualquat::tdualquat(mat<2, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(mat<2, 4, T, Q> const& m) { *this = dualquat_cast(m); } template - GLM_FUNC_QUALIFIER tdualquat::tdualquat(mat<3, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(mat<3, 4, T, Q> const& m) { *this = dualquat_cast(m); } // -- Unary arithmetic operators -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) + GLM_DEFAULTED_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) { this->real = q.real; this->dual = q.dual; return *this; } -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif template template @@ -222,8 +219,8 @@ namespace glm GLM_FUNC_QUALIFIER tdualquat dual_quat_identity() { return tdualquat( - tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)), - tquat(static_cast(0), static_cast(0), static_cast(0), static_cast(0))); + qua::wxyz(static_cast(1), static_cast(0), static_cast(0), static_cast(0)), + qua::wxyz(static_cast(0), static_cast(0), static_cast(0), static_cast(0))); } template @@ -247,8 +244,8 @@ namespace glm template GLM_FUNC_QUALIFIER tdualquat inverse(tdualquat const& q) { - const glm::tquat real = conjugate(q.real); - const glm::tquat dual = conjugate(q.dual); + const glm::qua real = conjugate(q.real); + const glm::qua dual = conjugate(q.dual); return tdualquat(real, dual + (real * (-2.0f * dot(real,dual)))); } @@ -261,9 +258,9 @@ namespace glm template GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x) { - tquat r = x.real / length2(x.real); + qua r = x.real / length2(x.real); - tquat const rr(r.w * x.real.w, r.x * x.real.x, r.y * x.real.y, r.z * x.real.z); + qua const rr(r.w * x.real.w, r.x * x.real.x, r.y * x.real.y, r.z * x.real.z); r *= static_cast(2); T const xy = r.x * x.real.y; @@ -298,14 +295,14 @@ namespace glm GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<2, 4, T, Q> const& x) { return tdualquat( - tquat( x[0].w, x[0].x, x[0].y, x[0].z ), - tquat( x[1].w, x[1].x, x[1].y, x[1].z )); + qua::wxyz( x[0].w, x[0].x, x[0].y, x[0].z ), + qua::wxyz( x[1].w, x[1].x, x[1].y, x[1].z )); } template GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<3, 4, T, Q> const& x) { - tquat real; + qua real; T const trace = x[0].x + x[1].y + x[2].z; if(trace > static_cast(0)) @@ -345,7 +342,7 @@ namespace glm real.w = (x[1].x - x[0].y) * invr; } - tquat dual; + qua dual; dual.x = static_cast(0.5) * ( x[0].w * real.w + x[1].w * real.z - x[2].w * real.y); dual.y = static_cast(0.5) * (-x[0].w * real.z + x[1].w * real.w + x[2].w * real.x); dual.z = static_cast(0.5) * ( x[0].w * real.y - x[1].w * real.x + x[2].w * real.w); diff --git a/vendor/glm/gtx/easing.hpp b/vendor/glm/gtx/easing.hpp old mode 100755 new mode 100644 index 913ca702cb..50ed9037b1 --- a/vendor/glm/gtx/easing.hpp +++ b/vendor/glm/gtx/easing.hpp @@ -9,7 +9,7 @@ /// /// Include to use the features of this extension. /// -/// Easing functions for animations and transitons +/// Easing functions for animations and transitions /// All functions take a parameter x in the range [0.0,1.0] /// /// Based on the AHEasing project of Warren Moore (https://github.com/warrenm/AHEasing) @@ -19,15 +19,11 @@ // Dependency: #include "../glm.hpp" #include "../gtc/constants.hpp" -#include "../detail/setup.hpp" #include "../detail/qualifier.hpp" -#include "../detail/type_int.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_easing is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_easing extension included") #endif diff --git a/vendor/glm/gtx/easing.inl b/vendor/glm/gtx/easing.inl old mode 100755 new mode 100644 index b6d7886f6a..b599c30664 --- a/vendor/glm/gtx/easing.inl +++ b/vendor/glm/gtx/easing.inl @@ -1,5 +1,4 @@ /// @ref gtx_easing -/// @file glm/gtx/easing.inl #include @@ -426,7 +425,7 @@ namespace glm{ if(a < static_cast(0.5)) { - return static_cast(0.5) * (one() - bounceEaseOut(a * static_cast(2))); + return static_cast(0.5) * (one() - bounceEaseOut(one() - a * static_cast(2))); } else { diff --git a/vendor/glm/gtx/euler_angles.hpp b/vendor/glm/gtx/euler_angles.hpp old mode 100755 new mode 100644 index dccc621e5c..5d67d8eb54 --- a/vendor/glm/gtx/euler_angles.hpp +++ b/vendor/glm/gtx/euler_angles.hpp @@ -20,9 +20,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_euler_angles is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_euler_angles extension included") #endif @@ -236,7 +234,7 @@ namespace glm /// Extracts the (X * Y * Z) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, T & t1, T & t2, T & t3); @@ -244,7 +242,7 @@ namespace glm /// Extracts the (Y * X * Z) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -252,7 +250,7 @@ namespace glm /// Extracts the (X * Z * X) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -260,7 +258,7 @@ namespace glm /// Extracts the (X * Y * X) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -268,7 +266,7 @@ namespace glm /// Extracts the (Y * X * Y) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -276,7 +274,7 @@ namespace glm /// Extracts the (Y * Z * Y) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -284,7 +282,7 @@ namespace glm /// Extracts the (Z * Y * Z) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -292,7 +290,7 @@ namespace glm /// Extracts the (Z * X * Z) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -300,7 +298,7 @@ namespace glm /// Extracts the (X * Z * Y) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -308,7 +306,7 @@ namespace glm /// Extracts the (Y * Z * X) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -316,7 +314,7 @@ namespace glm /// Extracts the (Z * Y * X) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); @@ -324,7 +322,7 @@ namespace glm /// Extracts the (Z * X * Y) Euler angles from the rotation matrix M /// @see gtx_euler_angles template - GLM_FUNC_DECL void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, + GLM_FUNC_DISCARD_DECL void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, T & t1, T & t2, T & t3); diff --git a/vendor/glm/gtx/euler_angles.inl b/vendor/glm/gtx/euler_angles.inl old mode 100755 new mode 100644 index 8a289d8fa2..85f22b902e --- a/vendor/glm/gtx/euler_angles.inl +++ b/vendor/glm/gtx/euler_angles.inl @@ -1,5 +1,4 @@ /// @ref gtx_euler_angles -/// @file glm/gtx/euler_angles.inl #include "compatibility.hpp" // glm::atan2 @@ -666,13 +665,13 @@ namespace glm mat<3, 3, T, defaultp> Result; Result[0][0] = c; Result[0][1] = s; - Result[0][2] = 0.0f; + Result[0][2] = T(0.0); Result[1][0] = -s; Result[1][1] = c; - Result[1][2] = 0.0f; - Result[2][0] = 0.0f; - Result[2][1] = 0.0f; - Result[2][2] = 1.0f; + Result[1][2] = T(0.0); + Result[2][0] = T(0.0); + Result[2][1] = T(0.0); + Result[2][2] = T(1.0); return Result; } @@ -695,17 +694,17 @@ namespace glm } template - GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, + GLM_FUNC_QUALIFIER void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, T & t1, T & t2, T & t3) { - float T1 = glm::atan2(M[2][1], M[2][2]); - float C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]); - float T2 = glm::atan2(-M[2][0], C2); - float S1 = glm::sin(T1); - float C1 = glm::cos(T1); - float T3 = glm::atan2(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]); + T T1 = glm::atan2(M[2][1], M[2][2]); + T C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]); + T T2 = glm::atan2(-M[2][0], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]); t1 = -T1; t2 = -T2; t3 = -T3; @@ -717,12 +716,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[2][0], M[2][2]); + T T1 = glm::atan2(M[2][0], M[2][2]); T C2 = glm::sqrt(M[0][1]*M[0][1] + M[1][1]*M[1][1]); - T T2 = glm::atan2(-M[2][1], C2); + T T2 = glm::atan2(-M[2][1], C2); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[1][2] - C1*M[1][0], C1*M[0][0] - S1*M[0][2]); + T T3 = glm::atan2(S1*M[1][2] - C1*M[1][0], C1*M[0][0] - S1*M[0][2]); t1 = T1; t2 = T2; t3 = T3; @@ -734,12 +733,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[0][2], M[0][1]); + T T1 = glm::atan2(M[0][2], M[0][1]); T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); - T T2 = glm::atan2(S2, M[0][0]); + T T2 = glm::atan2(S2, M[0][0]); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(C1*M[1][2] - S1*M[1][1], C1*M[2][2] - S1*M[2][1]); + T T3 = glm::atan2(C1*M[1][2] - S1*M[1][1], C1*M[2][2] - S1*M[2][1]); t1 = T1; t2 = T2; t3 = T3; @@ -751,12 +750,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[0][1], -M[0][2]); + T T1 = glm::atan2(M[0][1], -M[0][2]); T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); - T T2 = glm::atan2(S2, M[0][0]); + T T2 = glm::atan2(S2, M[0][0]); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(-C1*M[2][1] - S1*M[2][2], C1*M[1][1] + S1*M[1][2]); + T T3 = glm::atan2(-C1*M[2][1] - S1*M[2][2], C1*M[1][1] + S1*M[1][2]); t1 = T1; t2 = T2; t3 = T3; @@ -768,12 +767,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[1][0], M[1][2]); + T T1 = glm::atan2(M[1][0], M[1][2]); T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); - T T2 = glm::atan2(S2, M[1][1]); + T T2 = glm::atan2(S2, M[1][1]); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(C1*M[2][0] - S1*M[2][2], C1*M[0][0] - S1*M[0][2]); + T T3 = glm::atan2(C1*M[2][0] - S1*M[2][2], C1*M[0][0] - S1*M[0][2]); t1 = T1; t2 = T2; t3 = T3; @@ -785,12 +784,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[1][2], -M[1][0]); + T T1 = glm::atan2(M[1][2], -M[1][0]); T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); - T T2 = glm::atan2(S2, M[1][1]); + T T2 = glm::atan2(S2, M[1][1]); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(-S1*M[0][0] - C1*M[0][2], S1*M[2][0] + C1*M[2][2]); + T T3 = glm::atan2(-S1*M[0][0] - C1*M[0][2], S1*M[2][0] + C1*M[2][2]); t1 = T1; t2 = T2; t3 = T3; @@ -802,12 +801,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[2][1], M[2][0]); + T T1 = glm::atan2(M[2][1], M[2][0]); T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); - T T2 = glm::atan2(S2, M[2][2]); + T T2 = glm::atan2(S2, M[2][2]); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(C1*M[0][1] - S1*M[0][0], C1*M[1][1] - S1*M[1][0]); + T T3 = glm::atan2(C1*M[0][1] - S1*M[0][0], C1*M[1][1] - S1*M[1][0]); t1 = T1; t2 = T2; t3 = T3; @@ -819,12 +818,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[2][0], -M[2][1]); + T T1 = glm::atan2(M[2][0], -M[2][1]); T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); - T T2 = glm::atan2(S2, M[2][2]); + T T2 = glm::atan2(S2, M[2][2]); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(-C1*M[1][0] - S1*M[1][1], C1*M[0][0] + S1*M[0][1]); + T T3 = glm::atan2(-C1*M[1][0] - S1*M[1][1], C1*M[0][0] + S1*M[0][1]); t1 = T1; t2 = T2; t3 = T3; @@ -836,12 +835,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[1][2], M[1][1]); + T T1 = glm::atan2(M[1][2], M[1][1]); T C2 = glm::sqrt(M[0][0]*M[0][0] + M[2][0]*M[2][0]); - T T2 = glm::atan2(-M[1][0], C2); + T T2 = glm::atan2(-M[1][0], C2); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[0][1] - C1*M[0][2], C1*M[2][2] - S1*M[2][1]); + T T3 = glm::atan2(S1*M[0][1] - C1*M[0][2], C1*M[2][2] - S1*M[2][1]); t1 = T1; t2 = T2; t3 = T3; @@ -853,12 +852,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(-M[0][2], M[0][0]); + T T1 = glm::atan2(-M[0][2], M[0][0]); T C2 = glm::sqrt(M[1][1]*M[1][1] + M[2][1]*M[2][1]); - T T2 = glm::atan2(M[0][1], C2); + T T2 = glm::atan2(M[0][1], C2); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[1][0] + C1*M[1][2], S1*M[2][0] + C1*M[2][2]); + T T3 = glm::atan2(S1*M[1][0] + C1*M[1][2], S1*M[2][0] + C1*M[2][2]); t1 = T1; t2 = T2; t3 = T3; @@ -870,12 +869,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(M[0][1], M[0][0]); + T T1 = glm::atan2(M[0][1], M[0][0]); T C2 = glm::sqrt(M[1][2]*M[1][2] + M[2][2]*M[2][2]); - T T2 = glm::atan2(-M[0][2], C2); + T T2 = glm::atan2(-M[0][2], C2); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[2][0] - C1*M[2][1], C1*M[1][1] - S1*M[1][0]); + T T3 = glm::atan2(S1*M[2][0] - C1*M[2][1], C1*M[1][1] - S1*M[1][0]); t1 = T1; t2 = T2; t3 = T3; @@ -887,12 +886,12 @@ namespace glm T & t2, T & t3) { - T T1 = glm::atan2(-M[1][0], M[1][1]); + T T1 = glm::atan2(-M[1][0], M[1][1]); T C2 = glm::sqrt(M[0][2]*M[0][2] + M[2][2]*M[2][2]); - T T2 = glm::atan2(M[1][2], C2); + T T2 = glm::atan2(M[1][2], C2); T S1 = glm::sin(T1); T C1 = glm::cos(T1); - T T3 = glm::atan2(C1*M[2][0] + S1*M[2][1], C1*M[0][0] + S1*M[0][1]); + T T3 = glm::atan2(C1*M[2][0] + S1*M[2][1], C1*M[0][0] + S1*M[0][1]); t1 = T1; t2 = T2; t3 = T3; diff --git a/vendor/glm/gtx/extend.hpp b/vendor/glm/gtx/extend.hpp old mode 100755 new mode 100644 index c456faebb7..46bf5e7059 --- a/vendor/glm/gtx/extend.hpp +++ b/vendor/glm/gtx/extend.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_extend extension included") #endif diff --git a/vendor/glm/gtx/extend.inl b/vendor/glm/gtx/extend.inl old mode 100755 new mode 100644 index 9371ee60f3..32128eb209 --- a/vendor/glm/gtx/extend.inl +++ b/vendor/glm/gtx/extend.inl @@ -1,5 +1,4 @@ /// @ref gtx_extend -/// @file glm/gtx/extend.inl namespace glm { diff --git a/vendor/glm/gtx/extended_min_max.hpp b/vendor/glm/gtx/extended_min_max.hpp old mode 100755 new mode 100644 index b061bc82d9..e1b722fe49 --- a/vendor/glm/gtx/extended_min_max.hpp +++ b/vendor/glm/gtx/extended_min_max.hpp @@ -3,10 +3,10 @@ /// /// @see core (dependence) /// -/// @defgroup gtx_extended_min_max GLM_GTX_extented_min_max +/// @defgroup gtx_extended_min_max GLM_GTX_extended_min_max /// @ingroup gtx /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// /// Min and max functions for 3 to 4 parameters. @@ -14,13 +14,12 @@ // Dependency: #include "../glm.hpp" +#include "../ext/vector_common.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL -# error "GLM: GLM_GTX_extented_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTX_extented_min_max extension included") +# error "GLM: GLM_GTX_extended_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_extended_min_max extension included") #endif namespace glm @@ -130,96 +129,6 @@ namespace glm C const& z, C const& w); - /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see gtx_extented_min_max - template - GLM_FUNC_DECL genType fmin(genType x, genType y); - - /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtx_extented_min_max - /// @see std::fmin documentation - template - GLM_FUNC_DECL vec fmin(vec const& x, T y); - - /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtx_extented_min_max - /// @see std::fmin documentation - template - GLM_FUNC_DECL vec fmin(vec const& x, vec const& y); - - /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam genType Floating-point; scalar or vector types. - /// - /// @see gtx_extented_min_max - /// @see std::fmax documentation - template - GLM_FUNC_DECL genType fmax(genType x, genType y); - - /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtx_extented_min_max - /// @see std::fmax documentation - template - GLM_FUNC_DECL vec fmax(vec const& x, T y); - - /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtx_extented_min_max - /// @see std::fmax documentation - template - GLM_FUNC_DECL vec fmax(vec const& x, vec const& y); - - /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see gtx_extented_min_max - template - GLM_FUNC_DECL genType fclamp(genType x, genType minVal, genType maxVal); - - /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtx_extented_min_max - template - GLM_FUNC_DECL vec fclamp(vec const& x, T minVal, T maxVal); - - /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtx_extented_min_max - template - GLM_FUNC_DECL vec fclamp(vec const& x, vec const& minVal, vec const& maxVal); - - /// @} }//namespace glm diff --git a/vendor/glm/gtx/extended_min_max.inl b/vendor/glm/gtx/extended_min_max.inl old mode 100755 new mode 100644 index ac3dd646fa..de5998fadd --- a/vendor/glm/gtx/extended_min_max.inl +++ b/vendor/glm/gtx/extended_min_max.inl @@ -1,5 +1,4 @@ /// @ref gtx_extended_min_max -/// @file glm/gtx/extended_min_max.inl namespace glm { @@ -136,84 +135,4 @@ namespace glm { return glm::max(glm::max(x, y), glm::max(z, w)); } - - // fmin -# if GLM_HAS_CXX11_STL - using std::fmin; -# else - template - GLM_FUNC_QUALIFIER genType fmin(genType x, genType y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); - - if (isnan(x)) - return y; - if (isnan(y)) - return x; - - return min(x, y); - } -# endif - - template - GLM_FUNC_QUALIFIER vec fmin(vec const& a, T b) - { - return detail::functor2::call(fmin, a, vec(b)); - } - - template - GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b) - { - return detail::functor2::call(fmin, a, b); - } - - // fmax -# if GLM_HAS_CXX11_STL - using std::fmax; -# else - template - GLM_FUNC_QUALIFIER genType fmax(genType x, genType y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); - - if (isnan(x)) - return y; - if (isnan(y)) - return x; - - return max(x, y); - } -# endif - - template - GLM_FUNC_QUALIFIER vec fmax(vec const& a, T b) - { - return detail::functor2::call(fmax, a, vec(b)); - } - - template - GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b) - { - return detail::functor2::call(fmax, a, b); - } - - // fclamp - template - GLM_FUNC_QUALIFIER genType fclamp(genType x, genType minVal, genType maxVal) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fclamp' only accept floating-point or integer inputs"); - return fmin(fmax(x, minVal), maxVal); - } - - template - GLM_FUNC_QUALIFIER vec fclamp(vec const& x, T minVal, T maxVal) - { - return fmin(fmax(x, vec(minVal)), vec(maxVal)); - } - - template - GLM_FUNC_QUALIFIER vec fclamp(vec const& x, vec const& minVal, vec const& maxVal) - { - return fmin(fmax(x, minVal), maxVal); - } }//namespace glm diff --git a/vendor/glm/gtx/exterior_product.hpp b/vendor/glm/gtx/exterior_product.hpp old mode 100755 new mode 100644 index 4223b65156..1979acc847 --- a/vendor/glm/gtx/exterior_product.hpp +++ b/vendor/glm/gtx/exterior_product.hpp @@ -17,7 +17,9 @@ #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#ifndef GLM_ENABLE_EXPERIMENTAL +# error "GLM: GLM_GTX_exterior_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_exterior_product extension included") #endif @@ -33,7 +35,7 @@ namespace glm /// /// @see Exterior product template - GLM_FUNC_DECL T cross(vec<2, T, Q> const& v, vec<2, T, Q> const& u); + GLM_FUNC_DECL GLM_CONSTEXPR T cross(vec<2, T, Q> const& v, vec<2, T, Q> const& u); /// @} } //namespace glm diff --git a/vendor/glm/gtx/exterior_product.inl b/vendor/glm/gtx/exterior_product.inl old mode 100755 new mode 100644 index b4b36341f4..690085d6f6 --- a/vendor/glm/gtx/exterior_product.inl +++ b/vendor/glm/gtx/exterior_product.inl @@ -1,5 +1,4 @@ -/// @ref core -/// @file glm/detail/func_geometric.inl +/// @ref gtx_exterior_product #include @@ -9,9 +8,9 @@ namespace detail template struct compute_cross_vec2 { - GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cross' accepts only floating-point inputs"); return v.x * u.y - u.x * v.y; } @@ -19,7 +18,7 @@ namespace detail }//namespace detail template - GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) { return detail::compute_cross_vec2::value>::call(x, y); } diff --git a/vendor/glm/gtx/fast_exponential.hpp b/vendor/glm/gtx/fast_exponential.hpp old mode 100755 new mode 100644 index 2d4918e7c7..9fae32521f --- a/vendor/glm/gtx/fast_exponential.hpp +++ b/vendor/glm/gtx/fast_exponential.hpp @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_fast_exponential is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_fast_exponential extension included") #endif diff --git a/vendor/glm/gtx/fast_exponential.inl b/vendor/glm/gtx/fast_exponential.inl old mode 100755 new mode 100644 index 9dfb1091c2..5b1174246b --- a/vendor/glm/gtx/fast_exponential.inl +++ b/vendor/glm/gtx/fast_exponential.inl @@ -1,5 +1,4 @@ /// @ref gtx_fast_exponential -/// @file glm/gtx/fast_exponential.inl namespace glm { @@ -84,7 +83,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec fastExp(vec const& x) { - return detail::functor1::call(fastExp, x); + return detail::functor1::call(fastExp, x); } // fastLog @@ -106,32 +105,32 @@ namespace glm template GLM_FUNC_QUALIFIER vec fastLog(vec const& x) { - return detail::functor1::call(fastLog, x); + return detail::functor1::call(fastLog, x); } //fastExp2, ln2 = 0.69314718055994530941723212145818f template GLM_FUNC_QUALIFIER genType fastExp2(genType x) { - return fastExp(0.69314718055994530941723212145818f * x); + return fastExp(static_cast(0.69314718055994530941723212145818) * x); } template GLM_FUNC_QUALIFIER vec fastExp2(vec const& x) { - return detail::functor1::call(fastExp2, x); + return detail::functor1::call(fastExp2, x); } // fastLog2, ln2 = 0.69314718055994530941723212145818f template GLM_FUNC_QUALIFIER genType fastLog2(genType x) { - return fastLog(x) / 0.69314718055994530941723212145818f; + return fastLog(x) / static_cast(0.69314718055994530941723212145818); } template GLM_FUNC_QUALIFIER vec fastLog2(vec const& x) { - return detail::functor1::call(fastLog2, x); + return detail::functor1::call(fastLog2, x); } }//namespace glm diff --git a/vendor/glm/gtx/fast_square_root.hpp b/vendor/glm/gtx/fast_square_root.hpp old mode 100755 new mode 100644 index 9e15cb0d5b..80729dbda4 --- a/vendor/glm/gtx/fast_square_root.hpp +++ b/vendor/glm/gtx/fast_square_root.hpp @@ -21,9 +21,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_fast_square_root is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_fast_square_root extension included") #endif @@ -84,7 +82,13 @@ namespace glm /// /// @see gtx_fast_square_root extension. template - GLM_FUNC_DECL genType fastNormalize(genType const& x); + GLM_FUNC_DECL genType fastNormalize(genType x); + + /// Faster than the common normalize function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL vec fastNormalize(vec const& x); /// @} }// namespace glm diff --git a/vendor/glm/gtx/fast_square_root.inl b/vendor/glm/gtx/fast_square_root.inl old mode 100755 new mode 100644 index e9889878a3..60fdb7a5ac --- a/vendor/glm/gtx/fast_square_root.inl +++ b/vendor/glm/gtx/fast_square_root.inl @@ -1,5 +1,4 @@ /// @ref gtx_fast_square_root -/// @file glm/gtx/fast_square_root.inl namespace glm { @@ -7,7 +6,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType fastSqrt(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastSqrt' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastSqrt' only accept floating-point input"); return genType(1) / fastInverseSqrt(x); } @@ -15,19 +14,14 @@ namespace glm template GLM_FUNC_QUALIFIER vec fastSqrt(vec const& x) { - return detail::functor1::call(fastSqrt, x); + return detail::functor1::call(fastSqrt, x); } // fastInversesqrt template GLM_FUNC_QUALIFIER genType fastInverseSqrt(genType x) { -# ifdef __CUDACC__ // Wordaround for a CUDA compiler bug up to CUDA6 - vec<1, T, Q> tmp(detail::compute_inversesqrt::value>::call(vec<1, genType, lowp>(x))); - return tmp.x; -# else - return detail::compute_inversesqrt<1, genType, lowp, detail::is_aligned::value>::call(vec<1, genType, lowp>(x)).x; -# endif + return detail::compute_inversesqrt<1, genType, lowp, detail::is_aligned::value>::call(vec<1, genType, lowp>(x)).x; } template @@ -40,7 +34,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType fastLength(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastLength' only accept floating-point inputs"); return abs(x); } @@ -48,7 +42,7 @@ namespace glm template GLM_FUNC_QUALIFIER T fastLength(vec const& x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastLength' only accept floating-point inputs"); return fastSqrt(dot(x, x)); } diff --git a/vendor/glm/gtx/fast_trigonometry.hpp b/vendor/glm/gtx/fast_trigonometry.hpp old mode 100755 new mode 100644 index 4ec87c36da..93acab5fff --- a/vendor/glm/gtx/fast_trigonometry.hpp +++ b/vendor/glm/gtx/fast_trigonometry.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_fast_trigonometry is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_fast_trigonometry extension included") #endif diff --git a/vendor/glm/gtx/fast_trigonometry.inl b/vendor/glm/gtx/fast_trigonometry.inl old mode 100755 new mode 100644 index a733160bc4..1a710cbcd0 --- a/vendor/glm/gtx/fast_trigonometry.inl +++ b/vendor/glm/gtx/fast_trigonometry.inl @@ -1,5 +1,4 @@ /// @ref gtx_fast_trigonometry -/// @file glm/gtx/fast_trigonometry.inl namespace glm{ namespace detail @@ -24,7 +23,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec cos_52s(vec const& x) { - return detail::functor1::call(cos_52s, x); + return detail::functor1::call(cos_52s, x); } }//namespace detail @@ -38,7 +37,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec wrapAngle(vec const& x) { - return detail::functor1::call(wrapAngle, x); + return detail::functor1::call(wrapAngle, x); } // cos @@ -60,7 +59,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec fastCos(vec const& x) { - return detail::functor1::call(fastCos, x); + return detail::functor1::call(fastCos, x); } // sin @@ -73,7 +72,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec fastSin(vec const& x) { - return detail::functor1::call(fastSin, x); + return detail::functor1::call(fastSin, x); } // tan @@ -86,7 +85,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec fastTan(vec const& x) { - return detail::functor1::call(fastTan, x); + return detail::functor1::call(fastTan, x); } // asin @@ -99,7 +98,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec fastAsin(vec const& x) { - return detail::functor1::call(fastAsin, x); + return detail::functor1::call(fastAsin, x); } // acos @@ -112,7 +111,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec fastAcos(vec const& x) { - return detail::functor1::call(fastAcos, x); + return detail::functor1::call(fastAcos, x); } // atan @@ -126,7 +125,7 @@ namespace detail template GLM_FUNC_QUALIFIER vec fastAtan(vec const& y, vec const& x) { - return detail::functor2::call(fastAtan, y, x); + return detail::functor2::call(fastAtan, y, x); } template @@ -138,6 +137,6 @@ namespace detail template GLM_FUNC_QUALIFIER vec fastAtan(vec const& x) { - return detail::functor1::call(fastAtan, x); + return detail::functor1::call(fastAtan, x); } }//namespace glm diff --git a/vendor/glm/gtx/float_notmalize.inl b/vendor/glm/gtx/float_normalize.inl old mode 100755 new mode 100644 similarity index 88% rename from vendor/glm/gtx/float_notmalize.inl rename to vendor/glm/gtx/float_normalize.inl index bceab10e42..8cdbc5aaa9 --- a/vendor/glm/gtx/float_notmalize.inl +++ b/vendor/glm/gtx/float_normalize.inl @@ -1,5 +1,4 @@ /// @ref gtx_float_normalize -/// @file glm/gtx/float_normalize.inl #include diff --git a/vendor/glm/gtx/functions.hpp b/vendor/glm/gtx/functions.hpp old mode 100755 new mode 100644 index 98b50d8b7f..df68a0d74d --- a/vendor/glm/gtx/functions.hpp +++ b/vendor/glm/gtx/functions.hpp @@ -18,7 +18,9 @@ #include "../detail/qualifier.hpp" #include "../detail/type_vec2.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#ifndef GLM_ENABLE_EXPERIMENTAL +# error "GLM: GLM_GTX_functions is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_functions extension included") #endif diff --git a/vendor/glm/gtx/functions.inl b/vendor/glm/gtx/functions.inl old mode 100755 new mode 100644 index ac1e1129b1..29cbb20b80 --- a/vendor/glm/gtx/functions.inl +++ b/vendor/glm/gtx/functions.inl @@ -1,5 +1,4 @@ /// @ref gtx_functions -/// @file glm/gtx/functions.inl #include "../exponential.hpp" diff --git a/vendor/glm/gtx/gradient_paint.hpp b/vendor/glm/gtx/gradient_paint.hpp old mode 100755 new mode 100644 index 2713cec00a..5656445dfe --- a/vendor/glm/gtx/gradient_paint.hpp +++ b/vendor/glm/gtx/gradient_paint.hpp @@ -19,9 +19,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_gradient_paint is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_gradient_paint extension included") #endif diff --git a/vendor/glm/gtx/gradient_paint.inl b/vendor/glm/gtx/gradient_paint.inl old mode 100755 new mode 100644 index e2e92b5968..4c495e62cb --- a/vendor/glm/gtx/gradient_paint.inl +++ b/vendor/glm/gtx/gradient_paint.inl @@ -1,5 +1,4 @@ /// @ref gtx_gradient_paint -/// @file glm/gtx/gradient_paint.inl namespace glm { diff --git a/vendor/glm/gtx/handed_coordinate_space.hpp b/vendor/glm/gtx/handed_coordinate_space.hpp old mode 100755 new mode 100644 index 1d0d41044b..7c2aada016 --- a/vendor/glm/gtx/handed_coordinate_space.hpp +++ b/vendor/glm/gtx/handed_coordinate_space.hpp @@ -6,7 +6,7 @@ /// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space /// @ingroup gtx /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// /// To know if a set of three basis vectors defines a right or left-handed coordinate system. @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_handed_coordinate_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") #endif diff --git a/vendor/glm/gtx/handed_coordinate_space.inl b/vendor/glm/gtx/handed_coordinate_space.inl old mode 100755 new mode 100644 index 163924552b..e43c17bd31 --- a/vendor/glm/gtx/handed_coordinate_space.inl +++ b/vendor/glm/gtx/handed_coordinate_space.inl @@ -1,5 +1,4 @@ /// @ref gtx_handed_coordinate_space -/// @file glm/gtx/handed_coordinate_space.inl namespace glm { diff --git a/vendor/glm/gtx/hash.hpp b/vendor/glm/gtx/hash.hpp old mode 100755 new mode 100644 index 3196be7ef0..a2ac98923f --- a/vendor/glm/gtx/hash.hpp +++ b/vendor/glm/gtx/hash.hpp @@ -12,12 +12,14 @@ #pragma once -#ifndef GLM_ENABLE_EXPERIMENTAL -# error "GLM: GLM_GTX_hash is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#if defined(GLM_FORCE_MESSAGES) && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_hash is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_hash extension included") +# endif #endif -#include - #include "../vec2.hpp" #include "../vec3.hpp" #include "../vec4.hpp" @@ -38,101 +40,117 @@ #include "../mat4x3.hpp" #include "../mat4x4.hpp" -#if !GLM_HAS_CXX11_STL -# error "GLM_GTX_hash requires C++11 standard library support" +#if defined(_MSC_VER) + // MSVC uses _MSVC_LANG instead of __cplusplus + #if _MSVC_LANG < 201103L + #pragma message("GLM_GTX_hash requires C++11 standard library support") + #endif +#elif defined(__GNUC__) || defined(__clang__) + // GNU and Clang use __cplusplus + #if __cplusplus < 201103L + #pragma message("GLM_GTX_hash requires C++11 standard library support") + #endif +#else + #error "Unknown compiler" #endif +#if GLM_LANG & GLM_LANG_CXX11 +#define GLM_GTX_hash 1 +#include + namespace std { template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::vec<1, T, Q> const& v) const; + GLM_FUNC_DECL size_t operator()(glm::vec<1, T, Q> const& v) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::vec<2, T, Q> const& v) const; + GLM_FUNC_DECL size_t operator()(glm::vec<2, T, Q> const& v) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::vec<3, T, Q> const& v) const; + GLM_FUNC_DECL size_t operator()(glm::vec<3, T, Q> const& v) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::vec<4, T, Q> const& v) const; + GLM_FUNC_DECL size_t operator()(glm::vec<4, T, Q> const& v) const GLM_NOEXCEPT; }; template - struct hash> + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::tquat const& q) const; + GLM_FUNC_DECL size_t operator()(glm::qua const& q) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::tdualquat const& q) const; + GLM_FUNC_DECL size_t operator()(glm::tdualquat const& q) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 2, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<2, 2, T,Q> const& m) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 3, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<2, 3, T,Q> const& m) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 4, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<2, 4, T,Q> const& m) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 2, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<3, 2, T,Q> const& m) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 3, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<3, 3, T,Q> const& m) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 4, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<3, 4, T,Q> const& m) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 2, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<4, 2, T,Q> const& m) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 3, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<4, 3, T,Q> const& m) const GLM_NOEXCEPT; }; template - struct hash > + struct hash > { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 4, T,Q> const& m) const; + GLM_FUNC_DECL size_t operator()(glm::mat<4, 4, T,Q> const& m) const GLM_NOEXCEPT; }; } // namespace std #include "hash.inl" + +#endif //GLM_LANG & GLM_LANG_CXX11 diff --git a/vendor/glm/gtx/hash.inl b/vendor/glm/gtx/hash.inl old mode 100755 new mode 100644 index 32e7f123a8..bcadfe53e5 --- a/vendor/glm/gtx/hash.inl +++ b/vendor/glm/gtx/hash.inl @@ -1,14 +1,4 @@ /// @ref gtx_hash -/// @file glm/gtx/hash.inl -/// -/// @see core (dependence) -/// -/// @defgroup gtx_hash GLM_GTX_hash -/// @ingroup gtx -/// -/// @brief Add std::hash support for glm types -/// -/// need to be included to use the features of this extension. namespace glm { namespace detail @@ -23,14 +13,14 @@ namespace detail namespace std { template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<1, T, Q> const& v) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::vec<1, T, Q> const& v) const GLM_NOEXCEPT { hash hasher; return hasher(v.x); } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<2, T, Q> const& v) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::vec<2, T, Q> const& v) const GLM_NOEXCEPT { size_t seed = 0; hash hasher; @@ -40,7 +30,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<3, T, Q> const& v) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::vec<3, T, Q> const& v) const GLM_NOEXCEPT { size_t seed = 0; hash hasher; @@ -51,7 +41,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<4, T, Q> const& v) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::vec<4, T, Q> const& v) const GLM_NOEXCEPT { size_t seed = 0; hash hasher; @@ -63,7 +53,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tquat const& q) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::qua const& q) const GLM_NOEXCEPT { size_t seed = 0; hash hasher; @@ -75,50 +65,50 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tdualquat const& q) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::tdualquat const& q) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(q.real)); glm::detail::hash_combine(seed, hasher(q.dual)); return seed; } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 2, T, Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<2, 2, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); return seed; } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 3, T, Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<2, 3, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); return seed; } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 4, T, Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<2, 4, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); return seed; } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 2, T, Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<3, 2, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); glm::detail::hash_combine(seed, hasher(m[2])); @@ -126,10 +116,10 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 3, T, Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<3, 3, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); glm::detail::hash_combine(seed, hasher(m[2])); @@ -137,10 +127,10 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 4, T, Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<3, 4, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); glm::detail::hash_combine(seed, hasher(m[2])); @@ -148,10 +138,10 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 2, T,Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<4, 2, T,Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); glm::detail::hash_combine(seed, hasher(m[2])); @@ -160,10 +150,10 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 3, T,Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<4, 3, T,Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); glm::detail::hash_combine(seed, hasher(m[2])); @@ -172,10 +162,10 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 4, T, Q> const& m) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::mat<4, 4, T, Q> const& m) const GLM_NOEXCEPT { size_t seed = 0; - hash> hasher; + hash > hasher; glm::detail::hash_combine(seed, hasher(m[0])); glm::detail::hash_combine(seed, hasher(m[1])); glm::detail::hash_combine(seed, hasher(m[2])); diff --git a/vendor/glm/gtx/integer.hpp b/vendor/glm/gtx/integer.hpp old mode 100755 new mode 100644 index 7b8020934c..2b168302df --- a/vendor/glm/gtx/integer.hpp +++ b/vendor/glm/gtx/integer.hpp @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_integer is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_integer extension included") #endif diff --git a/vendor/glm/gtx/integer.inl b/vendor/glm/gtx/integer.inl old mode 100755 new mode 100644 index c9fcb4e1b0..eb5df30cfc --- a/vendor/glm/gtx/integer.inl +++ b/vendor/glm/gtx/integer.inl @@ -1,5 +1,4 @@ /// @ref gtx_integer -/// @file glm/gtx/integer.inl namespace glm { @@ -66,7 +65,7 @@ namespace detail // mod GLM_FUNC_QUALIFIER int mod(int x, int y) { - return x - y * (x / y); + return ((x % y) + y) % y; } // factorial (!12 max, integer only) @@ -142,13 +141,13 @@ namespace detail return x - y * (x / y); } -#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC)) +//#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC)) GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) { - return 31u - findMSB(x); + return 31u - static_cast(findMSB(x)); } - +/* #else // Hackers Delight: http://www.hackersdelight.org/HDcode/nlz.c.txt @@ -182,5 +181,5 @@ namespace detail } #endif//(GLM_COMPILER) - +*/ }//namespace glm diff --git a/vendor/glm/gtx/intersect.hpp b/vendor/glm/gtx/intersect.hpp old mode 100755 new mode 100644 index cc7f929271..c7aec6f223 --- a/vendor/glm/gtx/intersect.hpp +++ b/vendor/glm/gtx/intersect.hpp @@ -23,9 +23,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_closest_point extension included") #endif @@ -66,7 +64,7 @@ namespace glm template GLM_FUNC_DECL bool intersectRaySphere( genType const& rayStarting, genType const& rayNormalizedDirection, - genType const& sphereCenter, typename genType::value_type const sphereRadiusSquered, + genType const& sphereCenter, typename genType::value_type const sphereRadiusSquared, typename genType::value_type & intersectionDistance); //! Compute the intersection of a ray and a sphere. diff --git a/vendor/glm/gtx/intersect.inl b/vendor/glm/gtx/intersect.inl old mode 100755 new mode 100644 index d10d65b25c..925a903d4a --- a/vendor/glm/gtx/intersect.inl +++ b/vendor/glm/gtx/intersect.inl @@ -1,5 +1,4 @@ /// @ref gtx_intersect -/// @file glm/gtx/intersect.inl namespace glm { @@ -14,10 +13,13 @@ namespace glm typename genType::value_type d = glm::dot(dir, planeNormal); typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - if(d < -Epsilon) + if(glm::abs(d) > Epsilon) // if dir and planeNormal are not perpendicular { - intersectionDistance = glm::dot(planeOrig - orig, planeNormal) / d; - return true; + typename genType::value_type const tmp_intersectionDistance = glm::dot(planeOrig - orig, planeNormal) / d; + if (tmp_intersectionDistance > static_cast(0)) { // allow only intersections + intersectionDistance = tmp_intersectionDistance; + return true; + } } return false; @@ -41,41 +43,41 @@ namespace glm // if determinant is near zero, ray lies in plane of triangle T const det = glm::dot(edge1, p); - vec<3, T, Q> qvec; + vec<3, T, Q> Perpendicular(0); - if(det > std::numeric_limits::epsilon()) + if (det > static_cast(0)) { // calculate distance from vert0 to ray origin - vec<3, T, Q> const tvec = orig - vert0; + vec<3, T, Q> const dist = orig - vert0; // calculate U parameter and test bounds - baryPosition.x = glm::dot(tvec, p); + baryPosition.x = glm::dot(dist, p); if(baryPosition.x < static_cast(0) || baryPosition.x > det) return false; // prepare to test V parameter - qvec = glm::cross(tvec, edge1); + Perpendicular = glm::cross(dist, edge1); // calculate V parameter and test bounds - baryPosition.y = glm::dot(dir, qvec); + baryPosition.y = glm::dot(dir, Perpendicular); if((baryPosition.y < static_cast(0)) || ((baryPosition.x + baryPosition.y) > det)) return false; } - else if(det < -std::numeric_limits::epsilon()) + else if(det < static_cast(0)) { // calculate distance from vert0 to ray origin - vec<3, T, Q> const tvec = orig - vert0; + vec<3, T, Q> const dist = orig - vert0; // calculate U parameter and test bounds - baryPosition.x = glm::dot(tvec, p); + baryPosition.x = glm::dot(dist, p); if((baryPosition.x > static_cast(0)) || (baryPosition.x < det)) return false; // prepare to test V parameter - qvec = glm::cross(tvec, edge1); + Perpendicular = glm::cross(dist, edge1); // calculate V parameter and test bounds - baryPosition.y = glm::dot(dir, qvec); + baryPosition.y = glm::dot(dir, Perpendicular); if((baryPosition.y > static_cast(0)) || (baryPosition.x + baryPosition.y < det)) return false; } @@ -85,39 +87,12 @@ namespace glm T inv_det = static_cast(1) / det; // calculate distance, ray intersects triangle - distance = glm::dot(edge2, qvec) * inv_det; + distance = glm::dot(edge2, Perpendicular) * inv_det; baryPosition *= inv_det; return true; } -/* - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - if(a < Epsilon && a > -Epsilon) - return false; - - typename genType::value_type f = typename genType::value_type(1.0f) / a; - - genType s = orig - v0; - baryPosition.x = f * glm::dot(s, p); - if(baryPosition.x < typename genType::value_type(0.0f)) - return false; - if(baryPosition.x > typename genType::value_type(1.0f)) - return false; - - genType q = glm::cross(s, e1); - baryPosition.y = f * glm::dot(dir, q); - if(baryPosition.y < typename genType::value_type(0.0f)) - return false; - if(baryPosition.y + baryPosition.x > typename genType::value_type(1.0f)) - return false; - - baryPosition.z = f * glm::dot(e2, q); - - return baryPosition.z >= typename genType::value_type(0.0f); - } -*/ - template GLM_FUNC_QUALIFIER bool intersectLineTriangle ( @@ -131,27 +106,27 @@ namespace glm genType edge1 = vert1 - vert0; genType edge2 = vert2 - vert0; - genType pvec = cross(dir, edge2); + genType Perpendicular = cross(dir, edge2); - float det = dot(edge1, pvec); + typename genType::value_type det = dot(edge1, Perpendicular); if (det > -Epsilon && det < Epsilon) return false; - float inv_det = typename genType::value_type(1) / det; + typename genType::value_type inv_det = typename genType::value_type(1) / det; - genType tvec = orig - vert0; + genType Tangent = orig - vert0; - position.y = dot(tvec, pvec) * inv_det; + position.y = dot(Tangent, Perpendicular) * inv_det; if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1)) return false; - genType qvec = cross(tvec, edge1); + genType Cotangent = cross(Tangent, edge1); - position.z = dot(dir, qvec) * inv_det; + position.z = dot(dir, Cotangent) * inv_det; if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1)) return false; - position.x = dot(edge2, qvec) * inv_det; + position.x = dot(edge2, Cotangent) * inv_det; return true; } @@ -160,7 +135,7 @@ namespace glm GLM_FUNC_QUALIFIER bool intersectRaySphere ( genType const& rayStarting, genType const& rayNormalizedDirection, - genType const& sphereCenter, const typename genType::value_type sphereRadiusSquered, + genType const& sphereCenter, const typename genType::value_type sphereRadiusSquared, typename genType::value_type & intersectionDistance ) { @@ -168,11 +143,11 @@ namespace glm genType diff = sphereCenter - rayStarting; typename genType::value_type t0 = dot(diff, rayNormalizedDirection); typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; - if( dSquared > sphereRadiusSquered ) + if( dSquared > sphereRadiusSquared ) { return false; } - typename genType::value_type t1 = sqrt( sphereRadiusSquered - dSquared ); + typename genType::value_type t1 = sqrt( sphereRadiusSquared - dSquared ); intersectionDistance = t0 > t1 + Epsilon ? t0 - t1 : t0 + t1; return intersectionDistance > Epsilon; } diff --git a/vendor/glm/gtx/io.hpp b/vendor/glm/gtx/io.hpp old mode 100755 new mode 100644 index 93db75a3b0..5afc8ccf79 --- a/vendor/glm/gtx/io.hpp +++ b/vendor/glm/gtx/io.hpp @@ -25,10 +25,15 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_io is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_io extension included") #endif -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTX_io extension included") +#if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wshorten-64-to-32" +# pragma clang diagnostic ignored "-Wglobal-constructors" #endif #include // std::basic_ostream<> (fwd) @@ -63,8 +68,8 @@ namespace glm char_type newline; order_type order; - GLM_FUNC_DECL explicit format_punct(size_t a = 0); - GLM_FUNC_DECL explicit format_punct(format_punct const&); + GLM_FUNC_DISCARD_DECL explicit format_punct(size_t a = 0); + GLM_FUNC_DISCARD_DECL explicit format_punct(format_punct const&); }; template > @@ -72,8 +77,8 @@ namespace glm public: - GLM_FUNC_DECL explicit basic_state_saver(std::basic_ios&); - GLM_FUNC_DECL ~basic_state_saver(); + GLM_FUNC_DISCARD_DECL explicit basic_state_saver(std::basic_ios&); + GLM_FUNC_DISCARD_DECL ~basic_state_saver(); private: @@ -101,8 +106,8 @@ namespace glm { public: - GLM_FUNC_DECL explicit basic_format_saver(std::basic_ios&); - GLM_FUNC_DECL ~basic_format_saver(); + GLM_FUNC_DISCARD_DECL explicit basic_format_saver(std::basic_ios&); + GLM_FUNC_DISCARD_DECL ~basic_format_saver(); private: @@ -118,14 +123,14 @@ namespace glm { unsigned value; - GLM_FUNC_DECL explicit precision(unsigned); + GLM_FUNC_DISCARD_DECL explicit precision(unsigned); }; struct width { unsigned value; - GLM_FUNC_DECL explicit width(unsigned); + GLM_FUNC_DISCARD_DECL explicit width(unsigned); }; template @@ -133,14 +138,14 @@ namespace glm { CTy value[3]; - GLM_FUNC_DECL explicit delimeter(CTy /* left */, CTy /* right */, CTy /* separator */ = ','); + GLM_FUNC_DISCARD_DECL explicit delimeter(CTy /* left */, CTy /* right */, CTy /* separator */ = ','); }; struct order { order_type value; - GLM_FUNC_DECL explicit order(order_type); + GLM_FUNC_DISCARD_DECL explicit order(order_type); }; // functions, inlined (inline) @@ -150,7 +155,7 @@ namespace glm template std::basic_ios& formatted(std::basic_ios&); template - std::basic_ios& unformattet(std::basic_ios&); + std::basic_ios& unformatted(std::basic_ios&); template std::basic_ostream& operator<<(std::basic_ostream&, precision const&); @@ -163,39 +168,43 @@ namespace glm }//namespace io template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, tquat const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, qua const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<1, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<1, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<2, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<2, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<3, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<3, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<4, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<4, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 2, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 2, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 3, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 3, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 4, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 4, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 2, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 2, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 3, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 3, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 4, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 4, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 2, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 2, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 3, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 3, T, Q> const&); template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 4, T, Q> const&); + GLM_FUNC_DISCARD_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 4, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream & operator<<(std::basic_ostream &, + template + GLM_FUNC_DISCARD_DECL std::basic_ostream & operator<<(std::basic_ostream &, std::pair const, mat<4, 4, T, Q> const> const&); /// @} }//namespace glm +#if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +#endif + #include "io.inl" diff --git a/vendor/glm/gtx/io.inl b/vendor/glm/gtx/io.inl old mode 100755 new mode 100644 index edb76bf5d6..185a6bb72f --- a/vendor/glm/gtx/io.inl +++ b/vendor/glm/gtx/io.inl @@ -1,5 +1,4 @@ /// @ref gtx_io -/// @file glm/gtx/io.inl /// @author Jan P Springer (regnirpsj@gmail.com) #include // std::fixed, std::setfill<>, std::setprecision, std::right, std::setw @@ -7,6 +6,13 @@ #include "../gtc/matrix_access.hpp" // glm::col, glm::row #include "../gtx/type_trait.hpp" // glm::type<> +#if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wshorten-64-to-32" +# pragma clang diagnostic ignored "-Wglobal-constructors" +#endif + namespace glm{ namespace io { @@ -168,11 +174,11 @@ namespace detail { io::basic_state_saver const bss(os); - os << std::fixed << std::right << std::setprecision(fmt.precision) << std::setfill(fmt.space) << fmt.delim_left; + os << std::fixed << std::right << std::setprecision(static_cast(fmt.precision)) << std::setfill(fmt.space) << fmt.delim_left; for(length_t i(0); i < components; ++i) { - os << std::setw(fmt.width) << a[i]; + os << std::setw(static_cast(fmt.width)) << a[i]; if(components-1 != i) os << fmt.separator; } @@ -196,7 +202,7 @@ namespace detail }//namespace detail template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, tquat const& a) + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, qua const& a) { return detail::print_vector_on(os, a); } @@ -388,6 +394,7 @@ namespace detail switch(fmt.order) { + default: case io::column_major: { for(length_t i(0); i < rows; ++i) @@ -439,3 +446,8 @@ namespace detail return detail::print_matrix_pair_on(os, a); } }//namespace glm + +#if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +#endif + diff --git a/vendor/glm/gtx/iteration.hpp b/vendor/glm/gtx/iteration.hpp new file mode 100644 index 0000000000..c63af87a21 --- /dev/null +++ b/vendor/glm/gtx/iteration.hpp @@ -0,0 +1,87 @@ +/// @ref gtx_iteration +/// @file glm/gtx/iteration.hpp +/// +/// @defgroup gtx_iteration GLM_GTX_iteration +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines begin and end for vectors, matrices and quaternions useful for range based for loop construct + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" + +#ifndef GLM_ENABLE_EXPERIMENTAL +# error "GLM: GLM_GTX_iteration is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_iteration extension included") +#endif + +#include + +namespace glm +{ + /// @addtogroup gtx_iteration + /// @{ + template + GLM_FUNC_DECL GLM_CONSTEXPR T* begin(vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR T* begin(mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR T* begin(qua& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR const T* begin(const vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR const T* begin(const mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR const T* begin(const qua& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR T* end(vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR T* end(mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR T* end(qua& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR const T* end(const vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR const T* end(const mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR const T* end(const qua& q); + + // Reverse iteration + // rbegin,rend + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rbegin(vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rbegin(mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rbegin(qua& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rbegin(const vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rbegin(const mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rbegin(const qua& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rend(vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rend(mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rend(qua& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rend(const vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rend(const mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR std::reverse_iterator rend(const qua& q); + + + /// @} +}//namespace glm + +#include "iteration.inl" diff --git a/vendor/glm/gtx/iteration.inl b/vendor/glm/gtx/iteration.inl new file mode 100644 index 0000000000..be0894007f --- /dev/null +++ b/vendor/glm/gtx/iteration.inl @@ -0,0 +1,116 @@ +namespace glm +{ + /* + namespace details { + template + struct known_length_iterator; + } + */ + + /// @addtogroup gtx_iteration + /// @{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T* begin(vec& v) { + return &v.x; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T* begin(mat& m) { + return &m[0].x; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T* begin(qua& q) { + return &q[0]; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR const T* begin(const vec& v) { + return &v.x; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR const T* begin(const mat& m) { + return &m[0].x; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR const T* begin(const qua& q) { + return &q[0]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T* end(vec& v) { + return (&v.x) + L; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T* end(mat& m) { + return (&m[0].x) + C*R; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T* end(qua& q) { + return (&q[0]) + 4; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR const T* end(const vec& v) { + return (&v.x) + L; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR const T* end(const mat& m) { + return (&m[0].x) + C*R; + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR const T* end(const qua& q) { + return (&q[0]) + 4; + } + + // Reverse iteration + // rbegin,rend + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rbegin(vec& v) { + return std::reverse_iterator(end(v)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rbegin(mat& m) { + return std::reverse_iterator(end(m)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rbegin(qua& q) { + return std::reverse_iterator(end(q)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rbegin(const vec& v) { + return std::reverse_iterator(end(v)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rbegin(const mat& m) { + return std::reverse_iterator(end(m)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rbegin(const qua& q) { + return std::reverse_iterator(end(q)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rend(vec& v) { + return std::reverse_iterator(begin(v)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rend(mat& m) { + return std::reverse_iterator(begin(m)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rend(qua& q) { + return std::reverse_iterator(begin(q)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rend(const vec& v) { + return std::reverse_iterator(begin(v)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rend(const mat& m) { + return std::reverse_iterator(begin(m)); + } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR std::reverse_iterator rend(const qua& q) { + return std::reverse_iterator(begin(q)); + } + + + /// @} +}//namespace glm diff --git a/vendor/glm/gtx/log_base.hpp b/vendor/glm/gtx/log_base.hpp old mode 100755 new mode 100644 index e873e35610..915c7a4a05 --- a/vendor/glm/gtx/log_base.hpp +++ b/vendor/glm/gtx/log_base.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_log_base is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_log_base extension included") #endif diff --git a/vendor/glm/gtx/log_base.inl b/vendor/glm/gtx/log_base.inl old mode 100755 new mode 100644 index 981bacc7fc..4bbb8e895a --- a/vendor/glm/gtx/log_base.inl +++ b/vendor/glm/gtx/log_base.inl @@ -1,12 +1,10 @@ /// @ref gtx_log_base -/// @file glm/gtx/log_base.inl namespace glm { template GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base) { - assert(!detail::compute_equal::call(x, static_cast(0))); return glm::log(x) / glm::log(base); } diff --git a/vendor/glm/gtx/matrix_cross_product.hpp b/vendor/glm/gtx/matrix_cross_product.hpp old mode 100755 new mode 100644 index dfad8c1bdb..882a1d760d --- a/vendor/glm/gtx/matrix_cross_product.hpp +++ b/vendor/glm/gtx/matrix_cross_product.hpp @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_matrix_cross_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_matrix_cross_product extension included") #endif diff --git a/vendor/glm/gtx/matrix_cross_product.inl b/vendor/glm/gtx/matrix_cross_product.inl old mode 100755 new mode 100644 index d8ec11f984..3a153977cf --- a/vendor/glm/gtx/matrix_cross_product.inl +++ b/vendor/glm/gtx/matrix_cross_product.inl @@ -1,5 +1,4 @@ /// @ref gtx_matrix_cross_product -/// @file glm/gtx/matrix_cross_product.inl namespace glm { diff --git a/vendor/glm/gtx/matrix_decompose.hpp b/vendor/glm/gtx/matrix_decompose.hpp old mode 100755 new mode 100644 index 85bb2892ec..19ac8a8b7d --- a/vendor/glm/gtx/matrix_decompose.hpp +++ b/vendor/glm/gtx/matrix_decompose.hpp @@ -22,9 +22,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_matrix_decompose is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_matrix_decompose extension included") #endif @@ -36,9 +34,15 @@ namespace glm /// Decomposes a model matrix to translations, rotation and scale components /// @see gtx_matrix_decompose template - GLM_FUNC_DECL bool decompose( + GLM_FUNC_DISCARD_DECL bool decompose( mat<4, 4, T, Q> const& modelMatrix, - vec<3, T, Q> & scale, tquat & orientation, vec<3, T, Q> & translation, vec<3, T, Q> & skew, vec<4, T, Q> & perspective); + vec<3, T, Q> & scale, qua & orientation, vec<3, T, Q> & translation, vec<3, T, Q> & skew, vec<4, T, Q> & perspective); + + // Recomposes a model matrix from a previously-decomposed matrix + template + GLM_FUNC_DISCARD_DECL mat<4, 4, T, Q> recompose( + vec<3, T, Q> const& scale, qua const& orientation, vec<3, T, Q> const& translation, + vec<3, T, Q> const& skew, vec<4, T, Q> const& perspective); /// @} }//namespace glm diff --git a/vendor/glm/gtx/matrix_decompose.inl b/vendor/glm/gtx/matrix_decompose.inl old mode 100755 new mode 100644 index 02a5accc39..1b587e2a1b --- a/vendor/glm/gtx/matrix_decompose.inl +++ b/vendor/glm/gtx/matrix_decompose.inl @@ -1,8 +1,8 @@ /// @ref gtx_matrix_decompose -/// @file glm/gtx/matrix_decompose.inl #include "../gtc/constants.hpp" #include "../gtc/epsilon.hpp" +#include "../gtx/transform.hpp" namespace glm{ namespace detail @@ -30,7 +30,7 @@ namespace detail // Decomposes the mode matrix to translations,rotation scale components template - GLM_FUNC_QUALIFIER bool decompose(mat<4, 4, T, Q> const& ModelMatrix, vec<3, T, Q> & Scale, tquat & Orientation, vec<3, T, Q> & Translation, vec<3, T, Q> & Skew, vec<4, T, Q> & Perspective) + GLM_FUNC_QUALIFIER bool decompose(mat<4, 4, T, Q> const& ModelMatrix, vec<3, T, Q> & Scale, qua & Orientation, vec<3, T, Q> & Translation, vec<3, T, Q> & Skew, vec<4, T, Q> & Perspective) { mat<4, 4, T, Q> LocalMatrix(ModelMatrix); @@ -154,7 +154,7 @@ namespace detail // } int i, j, k = 0; - float root, trace = Row[0].x + Row[1].y + Row[2].z; + T root, trace = Row[0].x + Row[1].y + Row[2].z; if(trace > static_cast(0)) { root = sqrt(trace + static_cast(1.0)); @@ -173,15 +173,62 @@ namespace detail j = Next[i]; k = Next[j]; +# ifdef GLM_FORCE_QUAT_DATA_WXYZ + int off = 1; +# else + int off = 0; +# endif + root = sqrt(Row[i][i] - Row[j][j] - Row[k][k] + static_cast(1.0)); - Orientation[i] = static_cast(0.5) * root; + Orientation[i + off] = static_cast(0.5) * root; root = static_cast(0.5) / root; - Orientation[j] = root * (Row[i][j] + Row[j][i]); - Orientation[k] = root * (Row[i][k] + Row[k][i]); + Orientation[j + off] = root * (Row[i][j] + Row[j][i]); + Orientation[k + off] = root * (Row[i][k] + Row[k][i]); Orientation.w = root * (Row[j][k] - Row[k][j]); } // End if <= 0 return true; } + + // Recomposes a model matrix from a previously-decomposed matrix + // http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp + // https://stackoverflow.com/a/75573092/1047040 + template + GLM_FUNC_DECL mat<4, 4, T, Q> recompose( + vec<3, T, Q> const& scale, qua const& orientation, vec<3, T, Q> const& translation, + vec<3, T, Q> const& skew, vec<4, T, Q> const& perspective) + { + glm::mat4 m = glm::mat4(1.f); + + m[0][3] = perspective.x; + m[1][3] = perspective.y; + m[2][3] = perspective.z; + m[3][3] = perspective.w; + + m *= glm::translate(translation); + m *= glm::mat4_cast(orientation); + + if (abs(skew.x) > static_cast(0)) { + glm::mat4 tmp(1.f); + tmp[2][1] = skew.x; + m *= tmp; + } + + if (abs(skew.y) > static_cast(0)) { + glm::mat4 tmp(1.f); + tmp[2][0] = skew.y; + m *= tmp; + } + + if (abs(skew.z) > static_cast(0)) { + glm::mat4 tmp(1.f); + tmp[1][0] = skew.z; + m *= tmp; + } + + m *= glm::scale(scale); + + return m; + } }//namespace glm diff --git a/vendor/glm/gtx/matrix_factorisation.hpp b/vendor/glm/gtx/matrix_factorisation.hpp old mode 100755 new mode 100644 index e30a77460b..dc32847b62 --- a/vendor/glm/gtx/matrix_factorisation.hpp +++ b/vendor/glm/gtx/matrix_factorisation.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_matrix_factorisation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_matrix_factorisation extension included") #endif @@ -52,7 +50,7 @@ namespace glm /// /// From GLM_GTX_matrix_factorisation extension. template - GLM_FUNC_DECL void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r); + GLM_FUNC_DISCARD_DECL void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r); /// Performs RQ factorisation of a matrix. /// Returns 2 matrices, r and q, such that r is an upper triangular matrix, the rows of q are orthonormal and span the same subspace than those of the input matrix, and r*q=in. @@ -61,7 +59,7 @@ namespace glm /// /// From GLM_GTX_matrix_factorisation extension. template - GLM_FUNC_DECL void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q); + GLM_FUNC_DISCARD_DECL void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q); /// @} } diff --git a/vendor/glm/gtx/matrix_factorisation.inl b/vendor/glm/gtx/matrix_factorisation.inl old mode 100755 new mode 100644 index f0d9560c0c..6f1683c007 --- a/vendor/glm/gtx/matrix_factorisation.inl +++ b/vendor/glm/gtx/matrix_factorisation.inl @@ -1,5 +1,4 @@ /// @ref gtx_matrix_factorisation -/// @file glm/gtx/matrix_factorisation.inl namespace glm { @@ -29,7 +28,7 @@ namespace glm GLM_FUNC_QUALIFIER void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r) { // Uses modified Gram-Schmidt method - // Source: https://en.wikipedia.org/wiki/Gram–Schmidt_process + // Source: https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process // And https://en.wikipedia.org/wiki/QR_decomposition //For all the linearly independs columns of the input... @@ -65,8 +64,8 @@ namespace glm { // From https://en.wikipedia.org/wiki/QR_decomposition: // The RQ decomposition transforms a matrix A into the product of an upper triangular matrix R (also known as right-triangular) and an orthogonal matrix Q. The only difference from QR decomposition is the order of these matrices. - // QR decomposition is Gram–Schmidt orthogonalization of columns of A, started from the first column. - // RQ decomposition is Gram–Schmidt orthogonalization of rows of A, started from the last row. + // QR decomposition is Gram-Schmidt orthogonalization of columns of A, started from the first column. + // RQ decomposition is Gram-Schmidt orthogonalization of rows of A, started from the last row. mat tin = transpose(in); tin = fliplr(tin); diff --git a/vendor/glm/gtx/matrix_interpolation.hpp b/vendor/glm/gtx/matrix_interpolation.hpp old mode 100755 new mode 100644 index 89c4596cd5..e2767c83e9 --- a/vendor/glm/gtx/matrix_interpolation.hpp +++ b/vendor/glm/gtx/matrix_interpolation.hpp @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_matrix_interpolation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_matrix_interpolation extension included") #endif @@ -32,32 +30,27 @@ namespace glm /// Get the axis and angle of the rotation from a matrix. /// From GLM_GTX_matrix_interpolation extension. template - GLM_FUNC_DECL void axisAngle( - mat<4, 4, T, Q> const& mat, - vec<3, T, Q> & axis, - T & angle); + GLM_FUNC_DISCARD_DECL void axisAngle( + mat<4, 4, T, Q> const& Mat, vec<3, T, Q> & Axis, T & Angle); /// Build a matrix from axis and angle. /// From GLM_GTX_matrix_interpolation extension. template GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix( - vec<3, T, Q> const& axis, - T const angle); + vec<3, T, Q> const& Axis, T const Angle); /// Extracts the rotation part of a matrix. /// From GLM_GTX_matrix_interpolation extension. template GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation( - mat<4, 4, T, Q> const& mat); + mat<4, 4, T, Q> const& Mat); /// Build a interpolation of 4 * 4 matrixes. /// From GLM_GTX_matrix_interpolation extension. /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. template GLM_FUNC_DECL mat<4, 4, T, Q> interpolate( - mat<4, 4, T, Q> const& m1, - mat<4, 4, T, Q> const& m2, - T const delta); + mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const Delta); /// @} }//namespace glm diff --git a/vendor/glm/gtx/matrix_interpolation.inl b/vendor/glm/gtx/matrix_interpolation.inl old mode 100755 new mode 100644 index 1f2915a469..f4ba3a6f3a --- a/vendor/glm/gtx/matrix_interpolation.inl +++ b/vendor/glm/gtx/matrix_interpolation.inl @@ -1,33 +1,43 @@ /// @ref gtx_matrix_interpolation -/// @file glm/gtx/matrix_interpolation.hpp -#include "../gtc/constants.hpp" +#include "../ext/scalar_constants.hpp" + +#include namespace glm { template - GLM_FUNC_QUALIFIER void axisAngle(mat<4, 4, T, Q> const& mat, vec<3, T, Q> & axis, T & angle) + GLM_FUNC_QUALIFIER void axisAngle(mat<4, 4, T, Q> const& m, vec<3, T, Q>& axis, T& angle) { - T epsilon = static_cast(0.01); - T epsilon2 = static_cast(0.1); + T const epsilon = + std::numeric_limits::epsilon() * static_cast(1e2); + + bool const nearSymmetrical = + abs(m[1][0] - m[0][1]) < epsilon && + abs(m[2][0] - m[0][2]) < epsilon && + abs(m[2][1] - m[1][2]) < epsilon; - if((abs(mat[1][0] - mat[0][1]) < epsilon) && (abs(mat[2][0] - mat[0][2]) < epsilon) && (abs(mat[2][1] - mat[1][2]) < epsilon)) + if(nearSymmetrical) { - if ((abs(mat[1][0] + mat[0][1]) < epsilon2) && (abs(mat[2][0] + mat[0][2]) < epsilon2) && (abs(mat[2][1] + mat[1][2]) < epsilon2) && (abs(mat[0][0] + mat[1][1] + mat[2][2] - static_cast(3.0)) < epsilon2)) + bool const nearIdentity = + abs(m[1][0] + m[0][1]) < epsilon && + abs(m[2][0] + m[0][2]) < epsilon && + abs(m[2][1] + m[1][2]) < epsilon && + abs(m[0][0] + m[1][1] + m[2][2] - T(3.0)) < epsilon; + if (nearIdentity) { angle = static_cast(0.0); - axis.x = static_cast(1.0); - axis.y = static_cast(0.0); - axis.z = static_cast(0.0); + axis = vec<3, T, Q>( + static_cast(1.0), static_cast(0.0), static_cast(0.0)); return; } - angle = static_cast(3.1415926535897932384626433832795); - T xx = (mat[0][0] + static_cast(1.0)) * static_cast(0.5); - T yy = (mat[1][1] + static_cast(1.0)) * static_cast(0.5); - T zz = (mat[2][2] + static_cast(1.0)) * static_cast(0.5); - T xy = (mat[1][0] + mat[0][1]) * static_cast(0.25); - T xz = (mat[2][0] + mat[0][2]) * static_cast(0.25); - T yz = (mat[2][1] + mat[1][2]) * static_cast(0.25); + angle = pi(); + T xx = (m[0][0] + static_cast(1.0)) * static_cast(0.5); + T yy = (m[1][1] + static_cast(1.0)) * static_cast(0.5); + T zz = (m[2][2] + static_cast(1.0)) * static_cast(0.5); + T xy = (m[1][0] + m[0][1]) * static_cast(0.25); + T xz = (m[2][0] + m[0][2]) * static_cast(0.25); + T yz = (m[2][1] + m[1][2]) * static_cast(0.25); if((xx > yy) && (xx > zz)) { if(xx < epsilon) @@ -75,17 +85,23 @@ namespace glm } return; } - T s = sqrt((mat[2][1] - mat[1][2]) * (mat[2][1] - mat[1][2]) + (mat[2][0] - mat[0][2]) * (mat[2][0] - mat[0][2]) + (mat[1][0] - mat[0][1]) * (mat[1][0] - mat[0][1])); - if (glm::abs(s) < T(0.001)) - s = static_cast(1); - T const angleCos = (mat[0][0] + mat[1][1] + mat[2][2] - static_cast(1)) * static_cast(0.5); - if(angleCos - static_cast(1) < epsilon) - angle = pi() * static_cast(0.25); + + T const angleCos = (m[0][0] + m[1][1] + m[2][2] - static_cast(1)) * static_cast(0.5); + if(angleCos >= static_cast(1.0)) + { + angle = static_cast(0.0); + } + else if (angleCos <= static_cast(-1.0)) + { + angle = pi(); + } else + { angle = acos(angleCos); - axis.x = (mat[1][2] - mat[2][1]) / s; - axis.y = (mat[2][0] - mat[0][2]) / s; - axis.z = (mat[0][1] - mat[1][0]) / s; + } + + axis = glm::normalize(glm::vec<3, T, Q>( + m[1][2] - m[2][1], m[2][0] - m[0][2], m[0][1] - m[1][0])); } template diff --git a/vendor/glm/gtx/matrix_major_storage.hpp b/vendor/glm/gtx/matrix_major_storage.hpp old mode 100755 new mode 100644 index 3b922dfe6f..f5185786cd --- a/vendor/glm/gtx/matrix_major_storage.hpp +++ b/vendor/glm/gtx/matrix_major_storage.hpp @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_matrix_major_storage is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_matrix_major_storage extension included") #endif diff --git a/vendor/glm/gtx/matrix_major_storage.inl b/vendor/glm/gtx/matrix_major_storage.inl old mode 100755 new mode 100644 index 8b1b1a8337..279dd3433d --- a/vendor/glm/gtx/matrix_major_storage.inl +++ b/vendor/glm/gtx/matrix_major_storage.inl @@ -1,5 +1,4 @@ /// @ref gtx_matrix_major_storage -/// @file glm/gtx/matrix_major_storage.hpp namespace glm { diff --git a/vendor/glm/gtx/matrix_operation.hpp b/vendor/glm/gtx/matrix_operation.hpp old mode 100755 new mode 100644 index bce938bb46..07ed8e843d --- a/vendor/glm/gtx/matrix_operation.hpp +++ b/vendor/glm/gtx/matrix_operation.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_matrix_operation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_matrix_operation extension included") #endif @@ -82,6 +80,21 @@ namespace glm GLM_FUNC_DECL mat<4, 4, T, Q> diagonal4x4( vec<4, T, Q> const& v); + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m); + + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m); + + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m); + /// @} }//namespace glm diff --git a/vendor/glm/gtx/matrix_operation.inl b/vendor/glm/gtx/matrix_operation.inl old mode 100755 new mode 100644 index da1aab85ab..a4f4a85000 --- a/vendor/glm/gtx/matrix_operation.inl +++ b/vendor/glm/gtx/matrix_operation.inl @@ -1,5 +1,4 @@ /// @ref gtx_matrix_operation -/// @file glm/gtx/matrix_operation.inl namespace glm { @@ -115,4 +114,63 @@ namespace glm Result[1][1] = v[1]; return Result; } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + +m[1][1], -m[0][1], + -m[1][0], +m[0][0]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m) + { + T const m00 = determinant(mat<2, 2, T, Q>(m[1][1], m[2][1], m[1][2], m[2][2])); + T const m01 = determinant(mat<2, 2, T, Q>(m[0][1], m[2][1], m[0][2], m[2][2])); + T const m02 = determinant(mat<2, 2, T, Q>(m[0][1], m[1][1], m[0][2], m[1][2])); + + T const m10 = determinant(mat<2, 2, T, Q>(m[1][0], m[2][0], m[1][2], m[2][2])); + T const m11 = determinant(mat<2, 2, T, Q>(m[0][0], m[2][0], m[0][2], m[2][2])); + T const m12 = determinant(mat<2, 2, T, Q>(m[0][0], m[1][0], m[0][2], m[1][2])); + + T const m20 = determinant(mat<2, 2, T, Q>(m[1][0], m[2][0], m[1][1], m[2][1])); + T const m21 = determinant(mat<2, 2, T, Q>(m[0][0], m[2][0], m[0][1], m[2][1])); + T const m22 = determinant(mat<2, 2, T, Q>(m[0][0], m[1][0], m[0][1], m[1][1])); + + return mat<3, 3, T, Q>( + +m00, -m01, +m02, + -m10, +m11, -m12, + +m20, -m21, +m22); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m) + { + T const m00 = determinant(mat<3, 3, T, Q>(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3])); + T const m01 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3])); + T const m02 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3])); + T const m03 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2])); + + T const m10 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3])); + T const m11 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3])); + T const m12 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3])); + T const m13 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2])); + + T const m20 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], m[3][3])); + T const m21 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], m[3][3])); + T const m22 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], m[3][3])); + T const m23 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], m[3][2])); + + T const m30 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3])); + T const m31 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3])); + T const m32 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3])); + T const m33 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2])); + + return mat<4, 4, T, Q>( + +m00, -m10, +m20, -m30, + -m01, +m11, -m21, +m31, + +m02, -m12, +m22, -m32, + -m03, +m13, -m23, +m33); + } }//namespace glm diff --git a/vendor/glm/gtx/matrix_query.hpp b/vendor/glm/gtx/matrix_query.hpp old mode 100755 new mode 100644 index 4f7e855c39..de8c65593d --- a/vendor/glm/gtx/matrix_query.hpp +++ b/vendor/glm/gtx/matrix_query.hpp @@ -20,9 +20,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_matrix_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_matrix_query extension included") #endif diff --git a/vendor/glm/gtx/matrix_query.inl b/vendor/glm/gtx/matrix_query.inl old mode 100755 new mode 100644 index 38b520f143..dc3ec8453b --- a/vendor/glm/gtx/matrix_query.inl +++ b/vendor/glm/gtx/matrix_query.inl @@ -1,5 +1,4 @@ /// @ref gtx_matrix_query -/// @file glm/gtx/matrix_query.inl namespace glm { @@ -34,13 +33,13 @@ namespace glm GLM_FUNC_QUALIFIER bool isIdentity(mat const& m, T const& epsilon) { bool result = true; - for(length_t i = 0; result && i < m[0].length() ; ++i) + for(length_t i = 0; result && i < m.length(); ++i) { - for(length_t j = 0; result && j < i ; ++j) + for(length_t j = 0; result && j < glm::min(i, m[0].length()); ++j) result = abs(m[i][j]) <= epsilon; - if(result) + if(result && i < m[0].length()) result = abs(m[i][i] - 1) <= epsilon; - for(length_t j = i + 1; result && j < m.length(); ++j) + for(length_t j = i + 1; result && j < m[0].length(); ++j) result = abs(m[i][j]) <= epsilon; } return result; @@ -98,16 +97,22 @@ namespace glm GLM_FUNC_QUALIFIER bool isOrthogonal(mat const& m, T const& epsilon) { bool result = true; - for(length_t i(0); result && i < m.length() - 1; ++i) - for(length_t j(i + 1); result && j < m.length(); ++j) - result = areOrthogonal(m[i], m[j], epsilon); + for(length_t i(0); result && i < m.length(); ++i) + { + result = isNormalized(m[i], epsilon); + for(length_t j(i + 1); result && j < m.length(); ++j) + result = abs(dot(m[i], m[j])) <= epsilon; + } if(result) { mat tmp = transpose(m); - for(length_t i(0); result && i < m.length() - 1 ; ++i) - for(length_t j(i + 1); result && j < m.length(); ++j) - result = areOrthogonal(tmp[i], tmp[j], epsilon); + for(length_t i(0); result && i < m.length(); ++i) + { + result = isNormalized(tmp[i], epsilon); + for(length_t j(i + 1); result && j < m.length(); ++j) + result = abs(dot(tmp[i], tmp[j])) <= epsilon; + } } return result; } diff --git a/vendor/glm/gtx/matrix_transform_2d.hpp b/vendor/glm/gtx/matrix_transform_2d.hpp old mode 100755 new mode 100644 index 56c9bb8962..deb8da2dc6 --- a/vendor/glm/gtx/matrix_transform_2d.hpp +++ b/vendor/glm/gtx/matrix_transform_2d.hpp @@ -19,9 +19,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_matrix_transform_2d is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_matrix_transform_2d extension included") #endif diff --git a/vendor/glm/gtx/matrix_transform_2d.inl b/vendor/glm/gtx/matrix_transform_2d.inl old mode 100755 new mode 100644 index 9ae83d94a9..a68d24dc98 --- a/vendor/glm/gtx/matrix_transform_2d.inl +++ b/vendor/glm/gtx/matrix_transform_2d.inl @@ -1,5 +1,4 @@ /// @ref gtx_matrix_transform_2d -/// @file glm/gtc/matrix_transform_2d.inl /// @author Miguel Ãngel Pérez Martínez #include "../trigonometric.hpp" diff --git a/vendor/glm/gtx/mixed_product.hpp b/vendor/glm/gtx/mixed_product.hpp old mode 100755 new mode 100644 index f1ed6e087a..a091274cbb --- a/vendor/glm/gtx/mixed_product.hpp +++ b/vendor/glm/gtx/mixed_product.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_mixed_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_mixed_product extension included") #endif diff --git a/vendor/glm/gtx/mixed_product.inl b/vendor/glm/gtx/mixed_product.inl old mode 100755 new mode 100644 index 01e94ecb35..e5cdbdb49a --- a/vendor/glm/gtx/mixed_product.inl +++ b/vendor/glm/gtx/mixed_product.inl @@ -1,5 +1,4 @@ /// @ref gtx_mixed_product -/// @file glm/gtx/mixed_product.inl namespace glm { diff --git a/vendor/glm/gtx/norm.hpp b/vendor/glm/gtx/norm.hpp old mode 100755 new mode 100644 index 2f106d87af..ba6958bf55 --- a/vendor/glm/gtx/norm.hpp +++ b/vendor/glm/gtx/norm.hpp @@ -3,6 +3,7 @@ /// /// @see core (dependence) /// @see gtx_quaternion (dependence) +/// @see gtx_component_wise (dependence) /// /// @defgroup gtx_norm GLM_GTX_norm /// @ingroup gtx @@ -15,13 +16,11 @@ // Dependency: #include "../geometric.hpp" -#include "../gtx/quaternion.hpp" +#include "../gtx/component_wise.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_norm is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_norm extension included") #endif @@ -70,6 +69,16 @@ namespace glm template GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, unsigned int Depth); + //! Returns the LMax norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + //! Returns the LMax norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x); + /// @} }//namespace glm diff --git a/vendor/glm/gtx/norm.inl b/vendor/glm/gtx/norm.inl old mode 100755 new mode 100644 index 7bd64e870f..4a9f796451 --- a/vendor/glm/gtx/norm.inl +++ b/vendor/glm/gtx/norm.inl @@ -1,5 +1,4 @@ /// @ref gtx_norm -/// @file glm/gtx/norm.inl #include "../detail/qualifier.hpp" @@ -19,28 +18,28 @@ namespace detail template GLM_FUNC_QUALIFIER genType length2(genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'length2' accepts only floating-point inputs"); return x * x; } template GLM_FUNC_QUALIFIER T length2(vec const& v) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'length2' accepts only floating-point inputs"); return detail::compute_length2::value>::call(v); } template GLM_FUNC_QUALIFIER T distance2(T p0, T p1) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'distance2' accepts only floating-point inputs"); return length2(p1 - p0); } template GLM_FUNC_QUALIFIER T distance2(vec const& p0, vec const& p1) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'distance2' accepts only floating-point inputs"); return length2(p1 - p0); } @@ -72,13 +71,25 @@ namespace detail template GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth) { - return pow(pow(y.x - x.x, T(Depth)) + pow(y.y - x.y, T(Depth)) + pow(y.z - x.z, T(Depth)), T(1) / T(Depth)); + return pow(pow(abs(y.x - x.x), T(Depth)) + pow(abs(y.y - x.y), T(Depth)) + pow(abs(y.z - x.z), T(Depth)), T(1) / T(Depth)); } template GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& v, unsigned int Depth) { - return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth)); + return pow(pow(abs(v.x), T(Depth)) + pow(abs(v.y), T(Depth)) + pow(abs(v.z), T(Depth)), T(1) / T(Depth)); + } + + template + GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + return compMax(abs(b - a)); + } + + template + GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& v) + { + return compMax(abs(v)); } }//namespace glm diff --git a/vendor/glm/gtx/normal.hpp b/vendor/glm/gtx/normal.hpp old mode 100755 new mode 100644 index 03dbffe8ec..8b3a4b54b3 --- a/vendor/glm/gtx/normal.hpp +++ b/vendor/glm/gtx/normal.hpp @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_normal is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_normal extension included") #endif diff --git a/vendor/glm/gtx/normal.inl b/vendor/glm/gtx/normal.inl old mode 100755 new mode 100644 index bcd74e5d10..74f9fc9945 --- a/vendor/glm/gtx/normal.inl +++ b/vendor/glm/gtx/normal.inl @@ -1,5 +1,4 @@ /// @ref gtx_normal -/// @file glm/gtx/normal.inl namespace glm { diff --git a/vendor/glm/gtx/normalize_dot.hpp b/vendor/glm/gtx/normalize_dot.hpp old mode 100755 new mode 100644 index 86048e705d..04a6b08a98 --- a/vendor/glm/gtx/normalize_dot.hpp +++ b/vendor/glm/gtx/normalize_dot.hpp @@ -7,7 +7,7 @@ /// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot /// @ingroup gtx /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// /// Dot product of vectors that need to be normalize with a single square root. @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_normalize_dot is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_normalize_dot extension included") #endif diff --git a/vendor/glm/gtx/normalize_dot.inl b/vendor/glm/gtx/normalize_dot.inl old mode 100755 new mode 100644 index 8b88860e05..7bcd9a534a --- a/vendor/glm/gtx/normalize_dot.inl +++ b/vendor/glm/gtx/normalize_dot.inl @@ -1,5 +1,4 @@ /// @ref gtx_normalize_dot -/// @file glm/gtx/normalize_dot.inl namespace glm { diff --git a/vendor/glm/gtx/number_precision.hpp b/vendor/glm/gtx/number_precision.hpp old mode 100755 new mode 100644 index 3f4bee1f90..5b9663ed74 --- a/vendor/glm/gtx/number_precision.hpp +++ b/vendor/glm/gtx/number_precision.hpp @@ -20,32 +20,17 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_number_precision is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_number_precision extension included") #endif namespace glm{ -namespace gtx -{ ///////////////////////////// // Unsigned int vector types /// @addtogroup gtx_number_precision /// @{ - typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - - ////////////////////// - // Float vector types - - typedef f32 f32vec1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f64 f64vec1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) - ////////////////////// // Float matrix types @@ -55,7 +40,5 @@ namespace gtx typedef f64 f64mat1x1; //!< \brief Double-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) /// @} -}//namespace gtx }//namespace glm -#include "number_precision.inl" diff --git a/vendor/glm/gtx/number_precision.inl b/vendor/glm/gtx/number_precision.inl deleted file mode 100755 index b54cf66b30..0000000000 --- a/vendor/glm/gtx/number_precision.inl +++ /dev/null @@ -1,7 +0,0 @@ -/// @ref gtx_number_precision -/// @file glm/gtx/number_precision.inl - -namespace glm -{ - -} diff --git a/vendor/glm/gtx/optimum_pow.hpp b/vendor/glm/gtx/optimum_pow.hpp old mode 100755 new mode 100644 index eb09f1c371..ac34e7e1ff --- a/vendor/glm/gtx/optimum_pow.hpp +++ b/vendor/glm/gtx/optimum_pow.hpp @@ -17,14 +17,11 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_optimum_pow is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_optimum_pow extension included") #endif -namespace glm{ -namespace gtx +namespace glm { /// @addtogroup gtx_optimum_pow /// @{ @@ -48,7 +45,6 @@ namespace gtx GLM_FUNC_DECL genType pow4(genType const& x); /// @} -}//namespace gtx }//namespace glm #include "optimum_pow.inl" diff --git a/vendor/glm/gtx/optimum_pow.inl b/vendor/glm/gtx/optimum_pow.inl old mode 100755 new mode 100644 index 78b729f7b2..a26c19c18b --- a/vendor/glm/gtx/optimum_pow.inl +++ b/vendor/glm/gtx/optimum_pow.inl @@ -1,5 +1,4 @@ /// @ref gtx_optimum_pow -/// @file glm/gtx/optimum_pow.inl namespace glm { diff --git a/vendor/glm/gtx/orthonormalize.hpp b/vendor/glm/gtx/orthonormalize.hpp old mode 100755 new mode 100644 index 48b157f9a0..801b7558a4 --- a/vendor/glm/gtx/orthonormalize.hpp +++ b/vendor/glm/gtx/orthonormalize.hpp @@ -20,9 +20,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_orthonormalize is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_orthonormalize extension included") #endif diff --git a/vendor/glm/gtx/orthonormalize.inl b/vendor/glm/gtx/orthonormalize.inl old mode 100755 new mode 100644 index c65db11b12..cb553ba621 --- a/vendor/glm/gtx/orthonormalize.inl +++ b/vendor/glm/gtx/orthonormalize.inl @@ -1,5 +1,4 @@ /// @ref gtx_orthonormalize -/// @file glm/gtx/orthonormalize.inl namespace glm { diff --git a/vendor/glm/gtx/pca.hpp b/vendor/glm/gtx/pca.hpp new file mode 100644 index 0000000000..26f9aecdf1 --- /dev/null +++ b/vendor/glm/gtx/pca.hpp @@ -0,0 +1,112 @@ +/// @ref gtx_pca +/// @file glm/gtx/pca.hpp +/// +/// @see core (dependence) +/// @see ext_scalar_relational (dependence) +/// +/// @defgroup gtx_pca GLM_GTX_pca +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Implements functions required for fundamental 'princple component analysis' in 2D, 3D, and 4D: +/// 1) Computing a covariance matrics from a list of _relative_ position vectors +/// 2) Compute the eigenvalues and eigenvectors of the covariance matrics +/// This is useful, e.g., to compute an object-aligned bounding box from vertices of an object. +/// https://en.wikipedia.org/wiki/Principal_component_analysis +/// +/// Example: +/// ``` +/// std::vector ptData; +/// // ... fill ptData with some point data, e.g. vertices +/// +/// glm::dvec3 center = computeCenter(ptData); +/// +/// glm::dmat3 covarMat = glm::computeCovarianceMatrix(ptData.data(), ptData.size(), center); +/// +/// glm::dvec3 evals; +/// glm::dmat3 evecs; +/// int evcnt = glm::findEigenvaluesSymReal(covarMat, evals, evecs); +/// +/// if(evcnt != 3) +/// // ... error handling +/// +/// glm::sortEigenvalues(evals, evecs); +/// +/// // ... now evecs[0] points in the direction (symmetric) of the largest spatial distribution within ptData +/// ``` + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../ext/scalar_relational.hpp" + +#ifndef GLM_ENABLE_EXPERIMENTAL +# error "GLM: GLM_GTX_pca is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_pca extension included") +#endif + +namespace glm { + /// @addtogroup gtx_pca + /// @{ + + /// Compute a covariance matrix form an array of relative coordinates `v` (e.g., relative to the center of gravity of the object) + /// @param v Points to a memory holding `n` times vectors + /// @param n Number of points in v + template + GLM_INLINE mat computeCovarianceMatrix(vec const* v, size_t n); + + /// Compute a covariance matrix form an array of absolute coordinates `v` and a precomputed center of gravity `c` + /// @param v Points to a memory holding `n` times vectors + /// @param n Number of points in v + /// @param c Precomputed center of gravity + template + GLM_INLINE mat computeCovarianceMatrix(vec const* v, size_t n, vec const& c); + + /// Compute a covariance matrix form a pair of iterators `b` (begin) and `e` (end) of a container with relative coordinates (e.g., relative to the center of gravity of the object) + /// Dereferencing an iterator of type I must yield a `vec<D, T, Q%gt;` + template + GLM_FUNC_DECL mat computeCovarianceMatrix(I const& b, I const& e); + + /// Compute a covariance matrix form a pair of iterators `b` (begin) and `e` (end) of a container with absolute coordinates and a precomputed center of gravity `c` + /// Dereferencing an iterator of type I must yield a `vec<D, T, Q%gt;` + template + GLM_FUNC_DECL mat computeCovarianceMatrix(I const& b, I const& e, vec const& c); + + /// Assuming the provided covariance matrix `covarMat` is symmetric and real-valued, this function find the `D` Eigenvalues of the matrix, and also provides the corresponding Eigenvectors. + /// Note: the data in `outEigenvalues` and `outEigenvectors` are in matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. + /// This is a numeric implementation to find the Eigenvalues, using 'QL decomposition` (variant of QR decomposition: https://en.wikipedia.org/wiki/QR_decomposition). + /// + /// @param[in] covarMat A symmetric, real-valued covariance matrix, e.g. computed from computeCovarianceMatrix + /// @param[out] outEigenvalues Vector to receive the found eigenvalues + /// @param[out] outEigenvectors Matrix to receive the found eigenvectors corresponding to the found eigenvalues, as column vectors + /// @return The number of eigenvalues found, usually D if the precondition of the covariance matrix is met. + template + GLM_FUNC_DECL unsigned int findEigenvaluesSymReal + ( + mat const& covarMat, + vec& outEigenvalues, + mat& outEigenvectors + ); + + /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. + /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. + template + GLM_FUNC_DISCARD_DECL void sortEigenvalues(vec<2, T, Q>& eigenvalues, mat<2, 2, T, Q>& eigenvectors); + + /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. + /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. + template + GLM_FUNC_DISCARD_DECL void sortEigenvalues(vec<3, T, Q>& eigenvalues, mat<3, 3, T, Q>& eigenvectors); + + /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. + /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. + template + GLM_FUNC_DISCARD_DECL void sortEigenvalues(vec<4, T, Q>& eigenvalues, mat<4, 4, T, Q>& eigenvectors); + + /// @} +}//namespace glm + +#include "pca.inl" diff --git a/vendor/glm/gtx/pca.inl b/vendor/glm/gtx/pca.inl new file mode 100644 index 0000000000..1780ace4f0 --- /dev/null +++ b/vendor/glm/gtx/pca.inl @@ -0,0 +1,342 @@ +/// @ref gtx_pca + +#ifndef GLM_HAS_CXX11_STL +#include +#endif +#include + +namespace glm { + + + template + GLM_FUNC_QUALIFIER mat computeCovarianceMatrix(vec const* v, size_t n) + { + return computeCovarianceMatrix const*>(v, v + n); + } + + + template + GLM_FUNC_QUALIFIER mat computeCovarianceMatrix(vec const* v, size_t n, vec const& c) + { + return computeCovarianceMatrix const*>(v, v + n, c); + } + + + template + GLM_FUNC_QUALIFIER mat computeCovarianceMatrix(I const& b, I const& e) + { + glm::mat m(0); + + size_t cnt = 0; + for(I i = b; i != e; i++) + { + vec const& v = *i; + for(length_t x = 0; x < D; ++x) + for(length_t y = 0; y < D; ++y) + m[x][y] += static_cast(v[x] * v[y]); + cnt++; + } + if(cnt > 0) + m /= static_cast(cnt); + + return m; + } + + + template + GLM_FUNC_QUALIFIER mat computeCovarianceMatrix(I const& b, I const& e, vec const& c) + { + glm::mat m(0); + glm::vec v; + + size_t cnt = 0; + for(I i = b; i != e; i++) + { + v = *i - c; + for(length_t x = 0; x < D; ++x) + for(length_t y = 0; y < D; ++y) + m[x][y] += static_cast(v[x] * v[y]); + cnt++; + } + if(cnt > 0) + m /= static_cast(cnt); + + return m; + } + + namespace _internal_ + { + + template + GLM_FUNC_QUALIFIER static T transferSign(T const& v, T const& s) + { + return ((s) >= 0 ? glm::abs(v) : -glm::abs(v)); + } + + template + GLM_FUNC_QUALIFIER static T pythag(T const& a, T const& b) { + static const T epsilon = static_cast(0.0000001); + T absa = glm::abs(a); + T absb = glm::abs(b); + if(absa > absb) { + absb /= absa; + absb *= absb; + return absa * glm::sqrt(static_cast(1) + absb); + } + if(glm::equal(absb, 0, epsilon)) return static_cast(0); + absa /= absb; + absa *= absa; + return absb * glm::sqrt(static_cast(1) + absa); + } + + } + + template + GLM_FUNC_QUALIFIER unsigned int findEigenvaluesSymReal + ( + mat const& covarMat, + vec& outEigenvalues, + mat& outEigenvectors + ) + { + using _internal_::transferSign; + using _internal_::pythag; + + T a[D * D]; // matrix -- input and workspace for algorithm (will be changed inplace) + T d[D]; // diagonal elements + T e[D]; // off-diagonal elements + + for(length_t r = 0; r < D; r++) + for(length_t c = 0; c < D; c++) + a[(r) * D + (c)] = covarMat[c][r]; + + // 1. Householder reduction. + length_t l, k, j, i; + T scale, hh, h, g, f; + static const T epsilon = static_cast(0.0000001); + + for(i = D; i >= 2; i--) + { + l = i - 1; + h = scale = 0; + if(l > 1) + { + for(k = 1; k <= l; k++) + { + scale += glm::abs(a[(i - 1) * D + (k - 1)]); + } + if(glm::equal(scale, 0, epsilon)) + { + e[i - 1] = a[(i - 1) * D + (l - 1)]; + } + else + { + for(k = 1; k <= l; k++) + { + a[(i - 1) * D + (k - 1)] /= scale; + h += a[(i - 1) * D + (k - 1)] * a[(i - 1) * D + (k - 1)]; + } + f = a[(i - 1) * D + (l - 1)]; + g = ((f >= 0) ? -glm::sqrt(h) : glm::sqrt(h)); + e[i - 1] = scale * g; + h -= f * g; + a[(i - 1) * D + (l - 1)] = f - g; + f = 0; + for(j = 1; j <= l; j++) + { + a[(j - 1) * D + (i - 1)] = a[(i - 1) * D + (j - 1)] / h; + g = 0; + for(k = 1; k <= j; k++) + { + g += a[(j - 1) * D + (k - 1)] * a[(i - 1) * D + (k - 1)]; + } + for(k = j + 1; k <= l; k++) + { + g += a[(k - 1) * D + (j - 1)] * a[(i - 1) * D + (k - 1)]; + } + e[j - 1] = g / h; + f += e[j - 1] * a[(i - 1) * D + (j - 1)]; + } + hh = f / (h + h); + for(j = 1; j <= l; j++) + { + f = a[(i - 1) * D + (j - 1)]; + e[j - 1] = g = e[j - 1] - hh * f; + for(k = 1; k <= j; k++) + { + a[(j - 1) * D + (k - 1)] -= (f * e[k - 1] + g * a[(i - 1) * D + (k - 1)]); + } + } + } + } + else + { + e[i - 1] = a[(i - 1) * D + (l - 1)]; + } + d[i - 1] = h; + } + d[0] = 0; + e[0] = 0; + for(i = 1; i <= D; i++) + { + l = i - 1; + if(!glm::equal(d[i - 1], 0, epsilon)) + { + for(j = 1; j <= l; j++) + { + g = 0; + for(k = 1; k <= l; k++) + { + g += a[(i - 1) * D + (k - 1)] * a[(k - 1) * D + (j - 1)]; + } + for(k = 1; k <= l; k++) + { + a[(k - 1) * D + (j - 1)] -= g * a[(k - 1) * D + (i - 1)]; + } + } + } + d[i - 1] = a[(i - 1) * D + (i - 1)]; + a[(i - 1) * D + (i - 1)] = 1; + for(j = 1; j <= l; j++) + { + a[(j - 1) * D + (i - 1)] = a[(i - 1) * D + (j - 1)] = 0; + } + } + + // 2. Calculation of eigenvalues and eigenvectors (QL algorithm) + length_t m, iter; + T s, r, p, dd, c, b; + const length_t MAX_ITER = 30; + + for(i = 2; i <= D; i++) + { + e[i - 2] = e[i - 1]; + } + e[D - 1] = 0; + + for(l = 1; l <= D; l++) + { + iter = 0; + do + { + for(m = l; m <= D - 1; m++) + { + dd = glm::abs(d[m - 1]) + glm::abs(d[m - 1 + 1]); + if(glm::equal(glm::abs(e[m - 1]) + dd, dd, epsilon)) + break; + } + if(m != l) + { + if(iter++ == MAX_ITER) + { + return 0; // Too many iterations in FindEigenvalues + } + g = (d[l - 1 + 1] - d[l - 1]) / (2 * e[l - 1]); + r = pythag(g, 1); + g = d[m - 1] - d[l - 1] + e[l - 1] / (g + transferSign(r, g)); + s = c = 1; + p = 0; + for(i = m - 1; i >= l; i--) + { + f = s * e[i - 1]; + b = c * e[i - 1]; + e[i - 1 + 1] = r = pythag(f, g); + if(glm::equal(r, 0, epsilon)) + { + d[i - 1 + 1] -= p; + e[m - 1] = 0; + break; + } + s = f / r; + c = g / r; + g = d[i - 1 + 1] - p; + r = (d[i - 1] - g) * s + 2 * c * b; + d[i - 1 + 1] = g + (p = s * r); + g = c * r - b; + for(k = 1; k <= D; k++) + { + f = a[(k - 1) * D + (i - 1 + 1)]; + a[(k - 1) * D + (i - 1 + 1)] = s * a[(k - 1) * D + (i - 1)] + c * f; + a[(k - 1) * D + (i - 1)] = c * a[(k - 1) * D + (i - 1)] - s * f; + } + } + if(glm::equal(r, 0, epsilon) && (i >= l)) + continue; + d[l - 1] -= p; + e[l - 1] = g; + e[m - 1] = 0; + } + } while(m != l); + } + + // 3. output + for(i = 0; i < D; i++) + outEigenvalues[i] = d[i]; + for(i = 0; i < D; i++) + for(j = 0; j < D; j++) + outEigenvectors[i][j] = a[(j) * D + (i)]; + + return D; + } + + template + GLM_FUNC_QUALIFIER void sortEigenvalues(vec<2, T, Q>& eigenvalues, mat<2, 2, T, Q>& eigenvectors) + { + if (eigenvalues[0] < eigenvalues[1]) + { + std::swap(eigenvalues[0], eigenvalues[1]); + std::swap(eigenvectors[0], eigenvectors[1]); + } + } + + template + GLM_FUNC_QUALIFIER void sortEigenvalues(vec<3, T, Q>& eigenvalues, mat<3, 3, T, Q>& eigenvectors) + { + if (eigenvalues[0] < eigenvalues[1]) + { + std::swap(eigenvalues[0], eigenvalues[1]); + std::swap(eigenvectors[0], eigenvectors[1]); + } + if (eigenvalues[0] < eigenvalues[2]) + { + std::swap(eigenvalues[0], eigenvalues[2]); + std::swap(eigenvectors[0], eigenvectors[2]); + } + if (eigenvalues[1] < eigenvalues[2]) + { + std::swap(eigenvalues[1], eigenvalues[2]); + std::swap(eigenvectors[1], eigenvectors[2]); + } + } + + template + GLM_FUNC_QUALIFIER void sortEigenvalues(vec<4, T, Q>& eigenvalues, mat<4, 4, T, Q>& eigenvectors) + { + if (eigenvalues[0] < eigenvalues[2]) + { + std::swap(eigenvalues[0], eigenvalues[2]); + std::swap(eigenvectors[0], eigenvectors[2]); + } + if (eigenvalues[1] < eigenvalues[3]) + { + std::swap(eigenvalues[1], eigenvalues[3]); + std::swap(eigenvectors[1], eigenvectors[3]); + } + if (eigenvalues[0] < eigenvalues[1]) + { + std::swap(eigenvalues[0], eigenvalues[1]); + std::swap(eigenvectors[0], eigenvectors[1]); + } + if (eigenvalues[2] < eigenvalues[3]) + { + std::swap(eigenvalues[2], eigenvalues[3]); + std::swap(eigenvectors[2], eigenvectors[3]); + } + if (eigenvalues[1] < eigenvalues[2]) + { + std::swap(eigenvalues[1], eigenvalues[2]); + std::swap(eigenvectors[1], eigenvectors[2]); + } + } + +}//namespace glm diff --git a/vendor/glm/gtx/perpendicular.hpp b/vendor/glm/gtx/perpendicular.hpp old mode 100755 new mode 100644 index 35601ac723..4087ab04a7 --- a/vendor/glm/gtx/perpendicular.hpp +++ b/vendor/glm/gtx/perpendicular.hpp @@ -19,9 +19,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_perpendicular is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_perpendicular extension included") #endif diff --git a/vendor/glm/gtx/perpendicular.inl b/vendor/glm/gtx/perpendicular.inl old mode 100755 new mode 100644 index 3b99eed87b..1e72f33423 --- a/vendor/glm/gtx/perpendicular.inl +++ b/vendor/glm/gtx/perpendicular.inl @@ -1,5 +1,4 @@ /// @ref gtx_perpendicular -/// @file glm/gtx/perpendicular.inl namespace glm { diff --git a/vendor/glm/gtx/polar_coordinates.hpp b/vendor/glm/gtx/polar_coordinates.hpp old mode 100755 new mode 100644 index b8421db418..c27aacfe61 --- a/vendor/glm/gtx/polar_coordinates.hpp +++ b/vendor/glm/gtx/polar_coordinates.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_polar_coordinates is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_polar_coordinates extension included") #endif @@ -28,7 +26,7 @@ namespace glm /// @addtogroup gtx_polar_coordinates /// @{ - /// Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude. + /// Convert Euclidean to Polar coordinates, x is the latitude, y the longitude and z the xz distance. /// /// @see gtx_polar_coordinates template diff --git a/vendor/glm/gtx/polar_coordinates.inl b/vendor/glm/gtx/polar_coordinates.inl old mode 100755 new mode 100644 index cd1f357cc2..371c8dddeb --- a/vendor/glm/gtx/polar_coordinates.inl +++ b/vendor/glm/gtx/polar_coordinates.inl @@ -1,5 +1,4 @@ /// @ref gtx_polar_coordinates -/// @file glm/gtx/polar_coordinates.inl namespace glm { diff --git a/vendor/glm/gtx/projection.hpp b/vendor/glm/gtx/projection.hpp old mode 100755 new mode 100644 index 9a24abf9af..a438f396e6 --- a/vendor/glm/gtx/projection.hpp +++ b/vendor/glm/gtx/projection.hpp @@ -17,9 +17,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_projection is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_projection extension included") #endif @@ -30,6 +28,9 @@ namespace glm /// Projects x on Normal. /// + /// @param[in] x A vector to project + /// @param[in] Normal A normal that doesn't need to be of unit length. + /// /// @see gtx_projection template GLM_FUNC_DECL genType proj(genType const& x, genType const& Normal); diff --git a/vendor/glm/gtx/projection.inl b/vendor/glm/gtx/projection.inl old mode 100755 new mode 100644 index 90950f8bd8..f23f884fb9 --- a/vendor/glm/gtx/projection.inl +++ b/vendor/glm/gtx/projection.inl @@ -1,5 +1,4 @@ /// @ref gtx_projection -/// @file glm/gtx/projection.inl namespace glm { diff --git a/vendor/glm/gtx/quaternion.hpp b/vendor/glm/gtx/quaternion.hpp old mode 100755 new mode 100644 index 7310d087e3..f51c521cc3 --- a/vendor/glm/gtx/quaternion.hpp +++ b/vendor/glm/gtx/quaternion.hpp @@ -9,7 +9,7 @@ /// /// Include to use the features of this extension. /// -/// Extented quaternion types and functions +/// Extended quaternion types and functions #pragma once @@ -17,13 +17,12 @@ #include "../glm.hpp" #include "../gtc/constants.hpp" #include "../gtc/quaternion.hpp" +#include "../ext/quaternion_exponential.hpp" #include "../gtx/norm.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_quaternion extension included") #endif @@ -36,80 +35,58 @@ namespace glm /// /// @see gtx_quaternion template - GLM_FUNC_DECL tquat quat_identity(); + GLM_FUNC_DECL GLM_CONSTEXPR qua quat_identity(); /// Compute a cross product between a quaternion and a vector. /// /// @see gtx_quaternion template - GLM_FUNC_DECL vec<3, T, Q> cross( - tquat const& q, + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross( + qua const& q, vec<3, T, Q> const& v); //! Compute a cross product between a vector and a quaternion. /// /// @see gtx_quaternion template - GLM_FUNC_DECL vec<3, T, Q> cross( + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross( vec<3, T, Q> const& v, - tquat const& q); + qua const& q); //! Compute a point on a path according squad equation. //! q1 and q2 are control points; s1 and s2 are intermediate control points. /// /// @see gtx_quaternion template - GLM_FUNC_DECL tquat squad( - tquat const& q1, - tquat const& q2, - tquat const& s1, - tquat const& s2, + GLM_FUNC_DECL qua squad( + qua const& q1, + qua const& q2, + qua const& s1, + qua const& s2, T const& h); //! Returns an intermediate control point for squad interpolation. /// /// @see gtx_quaternion template - GLM_FUNC_DECL tquat intermediate( - tquat const& prev, - tquat const& curr, - tquat const& next); - - //! Returns a exp of a quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat exp( - tquat const& q); - - //! Returns a log of a quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat log( - tquat const& q); - - /// Returns x raised to the y power. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL tquat pow( - tquat const& x, - T const& y); + GLM_FUNC_DECL qua intermediate( + qua const& prev, + qua const& curr, + qua const& next); //! Returns quarternion square root. /// /// @see gtx_quaternion //template - //tquat sqrt( - // tquat const& q); + //qua sqrt( + // qua const& q); //! Rotates a 3 components vector by a quaternion. /// /// @see gtx_quaternion template GLM_FUNC_DECL vec<3, T, Q> rotate( - tquat const& q, + qua const& q, vec<3, T, Q> const& v); /// Rotates a 4 components vector by a quaternion. @@ -117,7 +94,7 @@ namespace glm /// @see gtx_quaternion template GLM_FUNC_DECL vec<4, T, Q> rotate( - tquat const& q, + qua const& q, vec<4, T, Q> const& v); /// Extract the real component of a quaternion. @@ -125,96 +102,69 @@ namespace glm /// @see gtx_quaternion template GLM_FUNC_DECL T extractRealComponent( - tquat const& q); + qua const& q); /// Converts a quaternion to a 3 * 3 matrix. /// /// @see gtx_quaternion template - GLM_FUNC_DECL mat<3, 3, T, Q> toMat3( - tquat const& x){return mat3_cast(x);} + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> toMat3( + qua const& x){return mat3_cast(x);} /// Converts a quaternion to a 4 * 4 matrix. /// /// @see gtx_quaternion template - GLM_FUNC_DECL mat<4, 4, T, Q> toMat4( - tquat const& x){return mat4_cast(x);} + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> toMat4( + qua const& x){return mat4_cast(x);} /// Converts a 3 * 3 matrix to a quaternion. /// /// @see gtx_quaternion template - GLM_FUNC_DECL tquat toQuat( + GLM_FUNC_QUALIFIER qua toQuat( mat<3, 3, T, Q> const& x){return quat_cast(x);} /// Converts a 4 * 4 matrix to a quaternion. /// /// @see gtx_quaternion template - GLM_FUNC_DECL tquat toQuat( + GLM_FUNC_QUALIFIER qua toQuat( mat<4, 4, T, Q> const& x){return quat_cast(x);} /// Quaternion interpolation using the rotation short path. /// /// @see gtx_quaternion template - GLM_FUNC_DECL tquat shortMix( - tquat const& x, - tquat const& y, + GLM_FUNC_DECL qua shortMix( + qua const& x, + qua const& y, T const& a); /// Quaternion normalized linear interpolation. /// /// @see gtx_quaternion template - GLM_FUNC_DECL tquat fastMix( - tquat const& x, - tquat const& y, + GLM_FUNC_DECL qua fastMix( + qua const& x, + qua const& y, T const& a); /// Compute the rotation between two vectors. - /// param orig vector, needs to be normalized - /// param dest vector, needs to be normalized + /// @param orig vector, needs to be normalized + /// @param dest vector, needs to be normalized /// /// @see gtx_quaternion template - GLM_FUNC_DECL tquat rotation( + GLM_FUNC_DECL qua rotation( vec<3, T, Q> const& orig, vec<3, T, Q> const& dest); - /// Build a look at quaternion based on the default handedness. - /// - /// @param direction Desired forward direction. Needs to be normalized. - /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL tquat quatLookAt( - vec<3, T, Q> const& direction, - vec<3, T, Q> const& up); - - /// Build a right-handed look at quaternion. - /// - /// @param direction Desired forward direction onto which the -z-axis gets mapped. Needs to be normalized. - /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL tquat quatLookAtRH( - vec<3, T, Q> const& direction, - vec<3, T, Q> const& up); - - /// Build a left-handed look at quaternion. - /// - /// @param direction Desired forward direction onto which the +z-axis gets mapped. Needs to be normalized. - /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL tquat quatLookAtLH( - vec<3, T, Q> const& direction, - vec<3, T, Q> const& up); - /// Returns the squared length of x. /// /// @see gtx_quaternion template - GLM_FUNC_DECL T length2(tquat const& q); + GLM_FUNC_DECL GLM_CONSTEXPR T length2(qua const& q); /// @} }//namespace glm diff --git a/vendor/glm/gtx/quaternion.inl b/vendor/glm/gtx/quaternion.inl old mode 100755 new mode 100644 index fde7a8fb56..5e18899a71 --- a/vendor/glm/gtx/quaternion.inl +++ b/vendor/glm/gtx/quaternion.inl @@ -1,5 +1,4 @@ /// @ref gtx_quaternion -/// @file glm/gtx/quaternion.inl #include #include "../gtc/constants.hpp" @@ -7,120 +6,61 @@ namespace glm { template - GLM_FUNC_QUALIFIER tquat quat_identity() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua quat_identity() { - return tquat(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + return qua::wxyz(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); } template - GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& v, tquat const& q) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& v, qua const& q) { return inverse(q) * v; } template - GLM_FUNC_QUALIFIER vec<3, T, Q> cross(tquat const& q, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> cross(qua const& q, vec<3, T, Q> const& v) { return q * v; } template - GLM_FUNC_QUALIFIER tquat squad + GLM_FUNC_QUALIFIER qua squad ( - tquat const& q1, - tquat const& q2, - tquat const& s1, - tquat const& s2, + qua const& q1, + qua const& q2, + qua const& s1, + qua const& s2, T const& h) { return mix(mix(q1, q2, h), mix(s1, s2, h), static_cast(2) * (static_cast(1) - h) * h); } template - GLM_FUNC_QUALIFIER tquat intermediate + GLM_FUNC_QUALIFIER qua intermediate ( - tquat const& prev, - tquat const& curr, - tquat const& next + qua const& prev, + qua const& curr, + qua const& next ) { - tquat invQuat = inverse(curr); - return exp((log(next + invQuat) + log(prev + invQuat)) / static_cast(-4)) * curr; + qua invQuat = inverse(curr); + return exp((log(next * invQuat) + log(prev * invQuat)) / static_cast(-4)) * curr; } template - GLM_FUNC_QUALIFIER tquat exp(tquat const& q) - { - vec<3, T, Q> u(q.x, q.y, q.z); - T const Angle = glm::length(u); - if (Angle < epsilon()) - return tquat(); - - vec<3, T, Q> const v(u / Angle); - return tquat(cos(Angle), sin(Angle) * v); - } - - template - GLM_FUNC_QUALIFIER tquat log(tquat const& q) - { - vec<3, T, Q> u(q.x, q.y, q.z); - T Vec3Len = length(u); - - if (Vec3Len < epsilon()) - { - if(q.w > static_cast(0)) - return tquat(log(q.w), static_cast(0), static_cast(0), static_cast(0)); - else if(q.w < static_cast(0)) - return tquat(log(-q.w), pi(), static_cast(0), static_cast(0)); - else - return tquat(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); - } - else - { - T t = atan(Vec3Len, T(q.w)) / Vec3Len; - T QuatLen2 = Vec3Len * Vec3Len + q.w * q.w; - return tquat(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); - } - } - - template - GLM_FUNC_QUALIFIER tquat pow(tquat const& x, T const& y) - { - //Raising to the power of 0 should yield 1 - //Needed to prevent a division by 0 error later on - if(y > -epsilon() && y < epsilon()) - return tquat(1,0,0,0); - - //To deal with non-unit quaternions - T magnitude = sqrt(x.x * x.x + x.y * x.y + x.z * x.z + x.w *x.w); - - //Equivalent to raising a real number to a power - //Needed to prevent a division by 0 error later on - if(abs(x.w / magnitude) > static_cast(1) - epsilon() && abs(x.w / magnitude) < static_cast(1) + epsilon()) - return tquat(pow(x.w, y),0,0,0); - - T Angle = acos(x.w / magnitude); - T NewAngle = Angle * y; - T Div = sin(NewAngle) / sin(Angle); - T Mag = pow(magnitude, y - static_cast(1)); - - return tquat(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rotate(tquat const& q, vec<3, T, Q> const& v) + GLM_FUNC_QUALIFIER vec<3, T, Q> rotate(qua const& q, vec<3, T, Q> const& v) { return q * v; } template - GLM_FUNC_QUALIFIER vec<4, T, Q> rotate(tquat const& q, vec<4, T, Q> const& v) + GLM_FUNC_QUALIFIER vec<4, T, Q> rotate(qua const& q, vec<4, T, Q> const& v) { return q * v; } template - GLM_FUNC_QUALIFIER T extractRealComponent(tquat const& q) + GLM_FUNC_QUALIFIER T extractRealComponent(qua const& q) { T w = static_cast(1) - q.x * q.x - q.y * q.y - q.z * q.z; if(w < T(0)) @@ -130,19 +70,19 @@ namespace glm } template - GLM_FUNC_QUALIFIER T length2(tquat const& q) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T length2(qua const& q) { return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; } template - GLM_FUNC_QUALIFIER tquat shortMix(tquat const& x, tquat const& y, T const& a) + GLM_FUNC_QUALIFIER qua shortMix(qua const& x, qua const& y, T const& a) { if(a <= static_cast(0)) return x; if(a >= static_cast(1)) return y; T fCos = dot(x, y); - tquat y2(y); //BUG!!! tquat y2; + qua y2(y); //BUG!!! qua y2; if(fCos < static_cast(0)) { y2 = -y; @@ -165,7 +105,7 @@ namespace glm k1 = sin((static_cast(0) + a) * fAngle) * fOneOverSin; } - return tquat( + return qua::wxyz( k0 * x.w + k1 * y2.w, k0 * x.x + k1 * y2.x, k0 * x.y + k1 * y2.y, @@ -173,13 +113,13 @@ namespace glm } template - GLM_FUNC_QUALIFIER tquat fastMix(tquat const& x, tquat const& y, T const& a) + GLM_FUNC_QUALIFIER qua fastMix(qua const& x, qua const& y, T const& a) { return glm::normalize(x * (static_cast(1) - a) + (y * a)); } template - GLM_FUNC_QUALIFIER tquat rotation(vec<3, T, Q> const& orig, vec<3, T, Q> const& dest) + GLM_FUNC_QUALIFIER qua rotation(vec<3, T, Q> const& orig, vec<3, T, Q> const& dest) { T cosTheta = dot(orig, dest); vec<3, T, Q> rotationAxis; @@ -210,45 +150,10 @@ namespace glm T s = sqrt((T(1) + cosTheta) * static_cast(2)); T invs = static_cast(1) / s; - return tquat( + return qua::wxyz( s * static_cast(0.5f), rotationAxis.x * invs, rotationAxis.y * invs, rotationAxis.z * invs); } - - template - GLM_FUNC_QUALIFIER tquat quatLookAt(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) - { -# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED - return quatLookAtLH(direction, up); -# else - return quatLookAtRH(direction, up); -# endif - } - - template - GLM_FUNC_QUALIFIER tquat quatLookAtRH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) - { - mat<3, 3, T, Q> Result; - - Result[2] = -direction; - Result[0] = normalize(cross(up, Result[2])); - Result[1] = cross(Result[2], Result[0]); - - return quat_cast(Result); - } - - template - GLM_FUNC_QUALIFIER tquat quatLookAtLH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) - { - mat<3, 3, T, Q> Result; - - Result[2] = direction; - Result[0] = normalize(cross(up, Result[2])); - Result[1] = cross(Result[2], Result[0]); - - return quat_cast(Result); - } - }//namespace glm diff --git a/vendor/glm/gtx/range.hpp b/vendor/glm/gtx/range.hpp old mode 100755 new mode 100644 index 38c5713a60..50c5e57be6 --- a/vendor/glm/gtx/range.hpp +++ b/vendor/glm/gtx/range.hpp @@ -17,10 +17,8 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_range is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if !GLM_HAS_RANGE_FOR -# error "GLM_GTX_range requires C++11 suppport or 'range for'" +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_range extension included") #endif #include "../gtc/type_ptr.hpp" diff --git a/vendor/glm/gtx/raw_data.hpp b/vendor/glm/gtx/raw_data.hpp old mode 100755 new mode 100644 index f377c4ead4..3bc27b98dd --- a/vendor/glm/gtx/raw_data.hpp +++ b/vendor/glm/gtx/raw_data.hpp @@ -13,14 +13,12 @@ #pragma once // Dependencies +#include "../ext/scalar_uint_sized.hpp" #include "../detail/setup.hpp" -#include "../detail/type_int.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_raw_data is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_raw_data extension included") #endif diff --git a/vendor/glm/gtx/raw_data.inl b/vendor/glm/gtx/raw_data.inl old mode 100755 new mode 100644 index 29af1481e1..c740317d33 --- a/vendor/glm/gtx/raw_data.inl +++ b/vendor/glm/gtx/raw_data.inl @@ -1,2 +1,2 @@ /// @ref gtx_raw_data -/// @file glm/gtx/raw_data.inl + diff --git a/vendor/glm/gtx/rotate_normalized_axis.hpp b/vendor/glm/gtx/rotate_normalized_axis.hpp old mode 100755 new mode 100644 index 3ac482c864..02c3f5c7e4 --- a/vendor/glm/gtx/rotate_normalized_axis.hpp +++ b/vendor/glm/gtx/rotate_normalized_axis.hpp @@ -21,9 +21,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_rotate_normalized_axis is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") #endif @@ -57,8 +55,8 @@ namespace glm /// /// @see gtx_rotate_normalized_axis template - GLM_FUNC_DECL tquat rotateNormalizedAxis( - tquat const& q, + GLM_FUNC_DECL qua rotateNormalizedAxis( + qua const& q, T const& angle, vec<3, T, Q> const& axis); diff --git a/vendor/glm/gtx/rotate_normalized_axis.inl b/vendor/glm/gtx/rotate_normalized_axis.inl old mode 100755 new mode 100644 index 66e091030d..352a56cb17 --- a/vendor/glm/gtx/rotate_normalized_axis.inl +++ b/vendor/glm/gtx/rotate_normalized_axis.inl @@ -1,5 +1,4 @@ /// @ref gtx_rotate_normalized_axis -/// @file glm/gtx/rotate_normalized_axis.inl namespace glm { @@ -41,9 +40,9 @@ namespace glm } template - GLM_FUNC_QUALIFIER tquat rotateNormalizedAxis + GLM_FUNC_QUALIFIER qua rotateNormalizedAxis ( - tquat const& q, + qua const& q, T const& angle, vec<3, T, Q> const& v ) @@ -53,7 +52,7 @@ namespace glm T const AngleRad(angle); T const Sin = sin(AngleRad * T(0.5)); - return q * tquat(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + return q * qua::wxyz(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); } }//namespace glm diff --git a/vendor/glm/gtx/rotate_vector.hpp b/vendor/glm/gtx/rotate_vector.hpp old mode 100755 new mode 100644 index 2ad909dbc5..b7345bf41e --- a/vendor/glm/gtx/rotate_vector.hpp +++ b/vendor/glm/gtx/rotate_vector.hpp @@ -14,14 +14,14 @@ #pragma once // Dependency: -#include "../glm.hpp" #include "../gtx/transform.hpp" +#include "../gtc/epsilon.hpp" +#include "../ext/vector_relational.hpp" +#include "../glm.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_rotate_vector is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_rotate_vector extension included") #endif diff --git a/vendor/glm/gtx/rotate_vector.inl b/vendor/glm/gtx/rotate_vector.inl old mode 100755 new mode 100644 index 5183d37d4a..f8136e765e --- a/vendor/glm/gtx/rotate_vector.inl +++ b/vendor/glm/gtx/rotate_vector.inl @@ -1,5 +1,4 @@ /// @ref gtx_rotate_vector -/// @file glm/gtx/rotate_vector.inl namespace glm { @@ -177,8 +176,8 @@ namespace glm vec<3, T, Q> const& Up ) { - if(all(equal(Normal, Up))) - return mat<4, 4, T, Q>(T(1)); + if(all(equal(Normal, Up, epsilon()))) + return mat<4, 4, T, Q>(static_cast(1)); vec<3, T, Q> RotationAxis = cross(Up, Normal); T Angle = acos(dot(Normal, Up)); diff --git a/vendor/glm/gtx/scalar_multiplication.hpp b/vendor/glm/gtx/scalar_multiplication.hpp old mode 100755 new mode 100644 index b73edf676a..97df000035 --- a/vendor/glm/gtx/scalar_multiplication.hpp +++ b/vendor/glm/gtx/scalar_multiplication.hpp @@ -1,7 +1,10 @@ -/// @ref gtx +/// @ref gtx_scalar_multiplication /// @file glm/gtx/scalar_multiplication.hpp /// @author Joshua Moerman /// +/// @defgroup gtx_scalar_multiplication GLM_GTX_scalar_multiplication +/// @ingroup gtx +/// /// Include to use the features of this extension. /// /// Enables scalar multiplication for all types @@ -18,10 +21,8 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_scalar_multiplication is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if !GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC) -# error "GLM_GTX_scalar_multiplication requires C++11 support or alias templates and if not support for GCC" +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_scalar_multiplication extension included") #endif #include "../vec2.hpp" @@ -32,6 +33,9 @@ namespace glm { + /// @addtogroup gtx_scalar_multiplication + /// @{ + template using return_type_scalar_multiplication = typename std::enable_if< !std::is_same::value // T may not be a float @@ -54,7 +58,7 @@ namespace glm template \ return_type_scalar_multiplication \ operator/(Vec lh, T const& s){ \ - return lh *= 1.0f / s; \ + return lh *= 1.0f / static_cast(s); \ } GLM_IMPLEMENT_SCAL_MULT(vec2) @@ -72,4 +76,5 @@ GLM_IMPLEMENT_SCAL_MULT(mat4x3) GLM_IMPLEMENT_SCAL_MULT(mat4) #undef GLM_IMPLEMENT_SCAL_MULT + /// @} } // namespace glm diff --git a/vendor/glm/gtx/scalar_relational.hpp b/vendor/glm/gtx/scalar_relational.hpp old mode 100755 new mode 100644 index 7fc8c1cca2..e8409329b6 --- a/vendor/glm/gtx/scalar_relational.hpp +++ b/vendor/glm/gtx/scalar_relational.hpp @@ -16,11 +16,9 @@ #include "../glm.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL -# error "GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTX_extend extension included") +# error "GLM: GLM_GTX_scalar_relational is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_scalar_relational extension included") #endif namespace glm diff --git a/vendor/glm/gtx/scalar_relational.inl b/vendor/glm/gtx/scalar_relational.inl old mode 100755 new mode 100644 index 8da7236211..c2a121cff9 --- a/vendor/glm/gtx/scalar_relational.inl +++ b/vendor/glm/gtx/scalar_relational.inl @@ -1,5 +1,4 @@ /// @ref gtx_scalar_relational -/// @file glm/gtx/scalar_relational.inl namespace glm { @@ -50,7 +49,7 @@ namespace glm T const& y ) { - return detail::compute_equal::call(x, y); + return detail::compute_equal::is_iec559>::call(x, y); } template @@ -60,7 +59,7 @@ namespace glm T const& y ) { - return !detail::compute_equal::call(x, y); + return !detail::compute_equal::is_iec559>::call(x, y); } GLM_FUNC_QUALIFIER bool any diff --git a/vendor/glm/gtx/spline.hpp b/vendor/glm/gtx/spline.hpp old mode 100755 new mode 100644 index f080fece24..8df5584913 --- a/vendor/glm/gtx/spline.hpp +++ b/vendor/glm/gtx/spline.hpp @@ -18,9 +18,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_spline is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_spline extension included") #endif diff --git a/vendor/glm/gtx/spline.inl b/vendor/glm/gtx/spline.inl old mode 100755 new mode 100644 index ca7b439e4e..c3fd056562 --- a/vendor/glm/gtx/spline.inl +++ b/vendor/glm/gtx/spline.inl @@ -1,5 +1,4 @@ /// @ref gtx_spline -/// @file glm/gtx/spline.inl namespace glm { diff --git a/vendor/glm/gtx/std_based_type.hpp b/vendor/glm/gtx/std_based_type.hpp old mode 100755 new mode 100644 index 55a2f0742c..864885de7a --- a/vendor/glm/gtx/std_based_type.hpp +++ b/vendor/glm/gtx/std_based_type.hpp @@ -19,9 +19,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_std_based_type is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_std_based_type extension included") #endif diff --git a/vendor/glm/gtx/std_based_type.inl b/vendor/glm/gtx/std_based_type.inl old mode 100755 new mode 100644 index ca431a33a4..9c34bdb6e0 --- a/vendor/glm/gtx/std_based_type.inl +++ b/vendor/glm/gtx/std_based_type.inl @@ -1,5 +1,4 @@ /// @ref gtx_std_based_type -/// @file glm/gtx/std_based_type.inl namespace glm { diff --git a/vendor/glm/gtx/string_cast.hpp b/vendor/glm/gtx/string_cast.hpp old mode 100755 new mode 100644 index 4b4e280fcc..2958edc469 --- a/vendor/glm/gtx/string_cast.hpp +++ b/vendor/glm/gtx/string_cast.hpp @@ -11,8 +11,6 @@ /// Include to use the features of this extension. /// /// Setup strings for GLM type values -/// -/// This extension is not supported with CUDA #pragma once @@ -23,16 +21,11 @@ #include "../gtx/dual_quaternion.hpp" #include #include +#include #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if(GLM_COMPILER & GLM_COMPILER_CUDA) -# error "GLM_GTX_string_cast is not supported on CUDA compiler" -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_string_cast extension included") #endif diff --git a/vendor/glm/gtx/string_cast.inl b/vendor/glm/gtx/string_cast.inl old mode 100755 new mode 100644 index e237e8e540..875f2be3c1 --- a/vendor/glm/gtx/string_cast.inl +++ b/vendor/glm/gtx/string_cast.inl @@ -1,5 +1,4 @@ /// @ref gtx_string_cast -/// @file glm/gtx/string_cast.inl #include #include @@ -19,24 +18,29 @@ namespace detail typedef double value_type; }; - GLM_FUNC_QUALIFIER std::string format(const char* msg, ...) - { + GLM_FUNC_QUALIFIER std::string format(const char* message, ...) { std::size_t const STRING_BUFFER(4096); - char text[STRING_BUFFER]; + + assert(message != NULL); + assert(strlen(message) < STRING_BUFFER); + + char buffer[STRING_BUFFER]; va_list list; - if(msg == GLM_NULLPTR) - return std::string(); +#if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wformat-nonliteral" +#endif - va_start(list, msg); -# if(GLM_COMPILER & GLM_COMPILER_VC) - vsprintf_s(text, STRING_BUFFER, msg, list); -# else// - vsprintf(text, msg, list); -# endif// + va_start(list, message); + vsnprintf(buffer, STRING_BUFFER, message, list); va_end(list); - return std::string(text); +#if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +#endif + + return buffer; } static const char* LabelTrue = "true"; @@ -440,9 +444,9 @@ namespace detail template - struct compute_to_string > + struct compute_to_string > { - GLM_FUNC_QUALIFIER static std::string call(tquat const& x) + GLM_FUNC_QUALIFIER static std::string call(qua const& q) { char const * PrefixStr = prefix::value(); char const * LiteralStr = literal::is_iec559>::value(); @@ -451,10 +455,10 @@ namespace detail LiteralStr, LiteralStr, LiteralStr, LiteralStr)); return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[3]), - static_cast::value_type>(x[0]), - static_cast::value_type>(x[1]), - static_cast::value_type>(x[2])); + static_cast::value_type>(q.w), + static_cast::value_type>(q.x), + static_cast::value_type>(q.y), + static_cast::value_type>(q.z)); } }; @@ -467,17 +471,18 @@ namespace detail char const * LiteralStr = literal::is_iec559>::value(); std::string FormatStr(detail::format("%sdualquat((%s, {%s, %s, %s}), (%s, {%s, %s, %s}))", PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, LiteralStr, LiteralStr, LiteralStr, LiteralStr)); return detail::format(FormatStr.c_str(), - static_cast::value_type>(x.real[3]), - static_cast::value_type>(x.real[0]), - static_cast::value_type>(x.real[1]), - static_cast::value_type>(x.real[2]), - static_cast::value_type>(x.dual[3]), - static_cast::value_type>(x.dual[0]), - static_cast::value_type>(x.dual[1]), - static_cast::value_type>(x.dual[2])); + static_cast::value_type>(x.real.w), + static_cast::value_type>(x.real.x), + static_cast::value_type>(x.real.y), + static_cast::value_type>(x.real.z), + static_cast::value_type>(x.dual.w), + static_cast::value_type>(x.dual.x), + static_cast::value_type>(x.dual.y), + static_cast::value_type>(x.dual.z)); } }; diff --git a/vendor/glm/gtx/structured_bindings.hpp b/vendor/glm/gtx/structured_bindings.hpp new file mode 100644 index 0000000000..8475007cab --- /dev/null +++ b/vendor/glm/gtx/structured_bindings.hpp @@ -0,0 +1,92 @@ +/// @ref gtx_structured_bindings +/// @file glm/gtx/structured_bindings.hpp +/// +/// @defgroup gtx_structured_bindings GLM_GTX_structured_bindings +/// @ingroup gtx +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/quaternion.hpp" + +#ifdef __cpp_structured_bindings +#if __cpp_structured_bindings >= 201606L +#include +#include +namespace std { + template + struct tuple_size> { + static constexpr size_t value = L; + }; + template + struct tuple_size> { + static constexpr size_t value = C; + }; + template + struct tuple_size> { + static constexpr size_t value = 4; + }; + template + struct tuple_element> + { + GLM_STATIC_ASSERT(I < L,"Index out of bounds"); + typedef T type; + }; + template + struct tuple_element> + { + GLM_STATIC_ASSERT(I < C, "Index out of bounds"); + typedef glm::vec type; + }; + template + struct tuple_element> + { + GLM_STATIC_ASSERT(I < 4, "Index out of bounds"); + typedef T type; + }; + +} +#endif +#endif + +#ifndef GLM_ENABLE_EXPERIMENTAL +# error "GLM: GLM_GTX_iteration is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_io extension included") +#endif + +namespace glm +{ + /// @addtogroup gtx_structured_bindings + /// @{ + + template + GLM_FUNC_DECL GLM_CONSTEXPR T& get(vec& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR T const& get(vec const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec& get(mat& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec const& get(mat const& m); + + template + GLM_FUNC_DECL GLM_CONSTEXPR T& get(qua& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR T const& get(qua const& q); + +#if GLM_HAS_RVALUE_REFERENCES + template + GLM_FUNC_DECL GLM_CONSTEXPR T get(vec const&& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec get(mat const&& m); + template + GLM_FUNC_DECL GLM_CONSTEXPR T get(qua const&& q); +#endif + /// @} +}//namespace glm + +#include "structured_bindings.inl" diff --git a/vendor/glm/gtx/structured_bindings.inl b/vendor/glm/gtx/structured_bindings.inl new file mode 100644 index 0000000000..54d613bd33 --- /dev/null +++ b/vendor/glm/gtx/structured_bindings.inl @@ -0,0 +1,55 @@ +namespace glm +{ + template + GLM_CONSTEXPR T& get(vec& v) { + GLM_STATIC_ASSERT(I < L, "Index out of bounds"); + return v[I]; + } + template + GLM_CONSTEXPR T const& get(vec const& v) { + GLM_STATIC_ASSERT(I < L, "Index out of bounds"); + return v[I]; + } + + template + GLM_CONSTEXPR vec& get(mat& m) { + GLM_STATIC_ASSERT(I < C, "Index out of bounds"); + return m[I]; + } + template + GLM_CONSTEXPR vec const& get(mat const& m) { + GLM_STATIC_ASSERT(I < C, "Index out of bounds"); + return m[I]; + } + + template + GLM_CONSTEXPR T& get(qua& q) { + GLM_STATIC_ASSERT(I < 4, "Index out of bounds"); + return q[I]; + } + template + GLM_CONSTEXPR T const& get(qua const& q) { + GLM_STATIC_ASSERT(I < 4, "Index out of bounds"); + return q[I]; + } + +#if GLM_HAS_RVALUE_REFERENCES + template + GLM_CONSTEXPR T get(vec const&& v) + { + GLM_STATIC_ASSERT(I < L, "Index out of bounds"); + return v[I]; + } + template + GLM_CONSTEXPR vec get(mat const&& m) { + GLM_STATIC_ASSERT(I < C, "Index out of bounds"); + return m[I]; + } + template + GLM_CONSTEXPR T get(qua const&& q) { + GLM_STATIC_ASSERT(I < 4, "Index out of bounds"); + return q[I]; + } +#endif +}//namespace glm + diff --git a/vendor/glm/gtx/texture.hpp b/vendor/glm/gtx/texture.hpp old mode 100755 new mode 100644 index 312bf39860..608c6ad03f --- a/vendor/glm/gtx/texture.hpp +++ b/vendor/glm/gtx/texture.hpp @@ -19,9 +19,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_texture is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_texture extension included") #endif diff --git a/vendor/glm/gtx/texture.inl b/vendor/glm/gtx/texture.inl old mode 100755 new mode 100644 index 7c124f2278..a77d4344d1 --- a/vendor/glm/gtx/texture.inl +++ b/vendor/glm/gtx/texture.inl @@ -1,5 +1,4 @@ /// @ref gtx_texture -/// @file glm/gtx/texture.inl namespace glm { @@ -12,7 +11,7 @@ namespace glm template inline T levels(T Extent) { - return vec<1, T, defaultp>(Extent).x; + return levels(vec<1, T, defaultp>(Extent)); } }//namespace glm diff --git a/vendor/glm/gtx/transform.hpp b/vendor/glm/gtx/transform.hpp old mode 100755 new mode 100644 index c4467bd1a3..9707b5041b --- a/vendor/glm/gtx/transform.hpp +++ b/vendor/glm/gtx/transform.hpp @@ -21,9 +21,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_transform is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_transform extension included") #endif diff --git a/vendor/glm/gtx/transform.inl b/vendor/glm/gtx/transform.inl old mode 100755 new mode 100644 index 56bfc902af..48ee6801b6 --- a/vendor/glm/gtx/transform.inl +++ b/vendor/glm/gtx/transform.inl @@ -1,5 +1,4 @@ /// @ref gtx_transform -/// @file glm/gtx/transform.inl namespace glm { diff --git a/vendor/glm/gtx/transform2.hpp b/vendor/glm/gtx/transform2.hpp old mode 100755 new mode 100644 index 2966cce36e..3a8fa87c09 --- a/vendor/glm/gtx/transform2.hpp +++ b/vendor/glm/gtx/transform2.hpp @@ -19,9 +19,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_transform2 is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_transform2 extension included") #endif @@ -59,9 +57,15 @@ namespace glm // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 // - dot(PointOnPlane, normal) * OnPlaneVector 1 - // Reflect functions seem to don't work - //template mat<3, 3, T, Q> reflect2D(const mat<3, 3, T, Q> & m, const vec<3, T, Q>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) - //template mat<4, 4, T, Q> reflect3D(const mat<4, 4, T, Q> & m, const vec<3, T, Q>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + //! Reflects a matrix on an arbitrary plane. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> reflect2D(mat<3, 3, T, Q> const& m, vec<2, T, Q> const& normal, T distance); + + //! Reflects a matrix on an arbitrary plane. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> reflect3D(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& normal, T distance); //! Build planar projection matrix along normal axis. //! From GLM_GTX_transform2 extension. diff --git a/vendor/glm/gtx/transform2.inl b/vendor/glm/gtx/transform2.inl old mode 100755 new mode 100644 index 59091eb5bd..5c38ee7f59 --- a/vendor/glm/gtx/transform2.inl +++ b/vendor/glm/gtx/transform2.inl @@ -1,5 +1,4 @@ /// @ref gtx_transform2 -/// @file glm/gtx/transform2.inl namespace glm { @@ -47,31 +46,34 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> reflect2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal) + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> reflect2D(mat<3, 3, T, Q> const& m, vec<2, T, Q> const& normal, T distance) { mat<3, 3, T, Q> r(static_cast(1)); r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; - r[0][1] = -static_cast(2) * normal.x * normal.y; + r[0][1] = -static_cast(2) * normal.y * normal.x; r[1][0] = -static_cast(2) * normal.x * normal.y; r[1][1] = static_cast(1) - static_cast(2) * normal.y * normal.y; + r[2][0] = -static_cast(2) * normal.x * distance; + r[2][1] = -static_cast(2) * normal.y * distance; return m * r; } template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> reflect3D(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& normal) + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> reflect3D(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& normal, T distance) { mat<4, 4, T, Q> r(static_cast(1)); r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; - r[0][1] = -static_cast(2) * normal.x * normal.y; - r[0][2] = -static_cast(2) * normal.x * normal.z; - + r[0][1] = -static_cast(2) * normal.y * normal.x; + r[0][2] = -static_cast(2) * normal.z * normal.x; r[1][0] = -static_cast(2) * normal.x * normal.y; r[1][1] = static_cast(1) - static_cast(2) * normal.y * normal.y; - r[1][2] = -static_cast(2) * normal.y * normal.z; - + r[1][2] = -static_cast(2) * normal.z * normal.y; r[2][0] = -static_cast(2) * normal.x * normal.z; r[2][1] = -static_cast(2) * normal.y * normal.z; r[2][2] = static_cast(1) - static_cast(2) * normal.z * normal.z; + r[3][0] = -static_cast(2) * normal.x * distance; + r[3][1] = -static_cast(2) * normal.y * distance; + r[3][2] = -static_cast(2) * normal.z * distance; return m * r; } @@ -120,7 +122,7 @@ namespace glm template GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias) { - return m * scaleBias(scale, bias); + return m * scaleBias(scale, bias); } }//namespace glm diff --git a/vendor/glm/gtx/type_aligned.hpp b/vendor/glm/gtx/type_aligned.hpp old mode 100755 new mode 100644 index fdfadd4745..ec40935847 --- a/vendor/glm/gtx/type_aligned.hpp +++ b/vendor/glm/gtx/type_aligned.hpp @@ -10,19 +10,16 @@ /// Include to use the features of this extension. /// /// Defines aligned types. -/// -/// @ref core_precision defines aligned types. #pragma once // Dependency: #include "../gtc/type_precision.hpp" +#include "../gtc/quaternion.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL -# error "GLM: GLM_GTX_type_aligned is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_type_aligned is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_type_aligned extension included") #endif @@ -959,7 +956,7 @@ namespace glm /// Single-qualifier floating-point aligned quaternion. /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fquat, aligned_fquat, 16); + GLM_ALIGNED_TYPEDEF(quat, aligned_fquat, 16); /// Double-qualifier floating-point aligned quaternion. /// @see gtx_type_aligned diff --git a/vendor/glm/gtx/type_aligned.inl b/vendor/glm/gtx/type_aligned.inl old mode 100755 new mode 100644 index 83202dff4e..54c1b818b6 --- a/vendor/glm/gtx/type_aligned.inl +++ b/vendor/glm/gtx/type_aligned.inl @@ -1,5 +1,4 @@ /// @ref gtc_type_aligned -/// @file glm/gtc/type_aligned.inl namespace glm { diff --git a/vendor/glm/gtx/type_trait.hpp b/vendor/glm/gtx/type_trait.hpp old mode 100755 new mode 100644 index 637bbd1938..17ddbad1b8 --- a/vendor/glm/gtx/type_trait.hpp +++ b/vendor/glm/gtx/type_trait.hpp @@ -14,6 +14,8 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_type_trait is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_type_trait extension included") #endif // Dependency: @@ -21,10 +23,6 @@ #include "../gtc/quaternion.hpp" #include "../gtx/dual_quaternion.hpp" -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTX_type_trait extension included") -#endif - namespace glm { /// @addtogroup gtx_type_trait @@ -62,7 +60,7 @@ namespace glm }; template - struct type > + struct type > { static bool const is_vec = false; static bool const is_mat = false; diff --git a/vendor/glm/gtx/type_trait.inl b/vendor/glm/gtx/type_trait.inl old mode 100755 new mode 100644 index 1cdf33224f..045de959cc --- a/vendor/glm/gtx/type_trait.inl +++ b/vendor/glm/gtx/type_trait.inl @@ -1,5 +1,4 @@ /// @ref gtx_type_trait -/// @file glm/gtx/type_trait.inl namespace glm { @@ -42,13 +41,13 @@ namespace glm // tquat template - bool const type >::is_vec; + bool const type >::is_vec; template - bool const type >::is_mat; + bool const type >::is_mat; template - bool const type >::is_quat; + bool const type >::is_quat; template - length_t const type >::components; + length_t const type >::components; // tdualquat template diff --git a/vendor/glm/gtx/vec_swizzle.hpp b/vendor/glm/gtx/vec_swizzle.hpp old mode 100755 new mode 100644 index daebac384e..bce96e8b41 --- a/vendor/glm/gtx/vec_swizzle.hpp +++ b/vendor/glm/gtx/vec_swizzle.hpp @@ -16,2763 +16,2754 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_vec_swizzle is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_vec_swizzle extension included") #endif namespace glm { + /// @addtogroup gtx_vec_swizzle + /// @{ + // xx template - GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<1, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xx(const glm::vec<1, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.x); } template - GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xx(const glm::vec<2, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.x); } template - GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xx(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.x); } template - GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xx(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.x); } // xy template - GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xy(const glm::vec<2, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.y); } template - GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xy(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.y); } template - GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xy(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.y); } // xz template - GLM_INLINE glm::vec<2, T, Q> xz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xz(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.z); } template - GLM_INLINE glm::vec<2, T, Q> xz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xz(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.z); } // xw template - GLM_INLINE glm::vec<2, T, Q> xw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> xw(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.x, v.w); } // yx template - GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yx(const glm::vec<2, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.x); } template - GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yx(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.x); } template - GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yx(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.x); } // yy template - GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yy(const glm::vec<2, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.y); } template - GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yy(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.y); } template - GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yy(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.y); } // yz template - GLM_INLINE glm::vec<2, T, Q> yz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yz(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.z); } template - GLM_INLINE glm::vec<2, T, Q> yz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yz(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.z); } // yw template - GLM_INLINE glm::vec<2, T, Q> yw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> yw(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.y, v.w); } // zx template - GLM_INLINE glm::vec<2, T, Q> zx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zx(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.z, v.x); } template - GLM_INLINE glm::vec<2, T, Q> zx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zx(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.z, v.x); } // zy template - GLM_INLINE glm::vec<2, T, Q> zy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zy(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.z, v.y); } template - GLM_INLINE glm::vec<2, T, Q> zy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zy(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.z, v.y); } // zz template - GLM_INLINE glm::vec<2, T, Q> zz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zz(const glm::vec<3, T, Q> &v) { return glm::vec<2, T, Q>(v.z, v.z); } template - GLM_INLINE glm::vec<2, T, Q> zz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zz(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.z, v.z); } // zw template - GLM_INLINE glm::vec<2, T, Q> zw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> zw(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.z, v.w); } // wx template - GLM_INLINE glm::vec<2, T, Q> wx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> wx(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.w, v.x); } // wy template - GLM_INLINE glm::vec<2, T, Q> wy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> wy(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.w, v.y); } // wz template - GLM_INLINE glm::vec<2, T, Q> wz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> wz(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.w, v.z); } // ww template - GLM_INLINE glm::vec<2, T, Q> ww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<2, T, Q> ww(const glm::vec<4, T, Q> &v) { return glm::vec<2, T, Q>(v.w, v.w); } // xxx template - GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<1, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxx(const glm::vec<1, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.x); } template - GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxx(const glm::vec<2, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.x); } template - GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.x); } template - GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.x); } // xxy template - GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxy(const glm::vec<2, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.y); } template - GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.y); } template - GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.y); } // xxz template - GLM_INLINE glm::vec<3, T, Q> xxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.z); } template - GLM_INLINE glm::vec<3, T, Q> xxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.z); } // xxw template - GLM_INLINE glm::vec<3, T, Q> xxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xxw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.x, v.w); } // xyx template - GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyx(const glm::vec<2, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.y, v.x); } template - GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.y, v.x); } template - GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.y, v.x); } // xyy template - GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyy(const glm::vec<2, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.y, v.y); } template - GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.y, v.y); } template - GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.y, v.y); } // xyz template - GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.y, v.z); } // xyw template - GLM_INLINE glm::vec<3, T, Q> xyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xyw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.y, v.w); } // xzx template - GLM_INLINE glm::vec<3, T, Q> xzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.z, v.x); } template - GLM_INLINE glm::vec<3, T, Q> xzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.z, v.x); } // xzy template - GLM_INLINE glm::vec<3, T, Q> xzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.z, v.y); } template - GLM_INLINE glm::vec<3, T, Q> xzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.z, v.y); } // xzz template - GLM_INLINE glm::vec<3, T, Q> xzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.z, v.z); } template - GLM_INLINE glm::vec<3, T, Q> xzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.z, v.z); } // xzw template - GLM_INLINE glm::vec<3, T, Q> xzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xzw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.z, v.w); } // xwx template - GLM_INLINE glm::vec<3, T, Q> xwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xwx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.w, v.x); } // xwy template - GLM_INLINE glm::vec<3, T, Q> xwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xwy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.w, v.y); } // xwz template - GLM_INLINE glm::vec<3, T, Q> xwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xwz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.w, v.z); } // xww template - GLM_INLINE glm::vec<3, T, Q> xww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> xww(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.x, v.w, v.w); } // yxx template - GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxx(const glm::vec<2, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.x); } template - GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.x); } template - GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.x); } // yxy template - GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxy(const glm::vec<2, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.y); } template - GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.y); } template - GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.y); } // yxz template - GLM_INLINE glm::vec<3, T, Q> yxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.z); } template - GLM_INLINE glm::vec<3, T, Q> yxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.z); } // yxw template - GLM_INLINE glm::vec<3, T, Q> yxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yxw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.x, v.w); } // yyx template - GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyx(const glm::vec<2, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.x); } template - GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.x); } template - GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.x); } // yyy template - GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyy(const glm::vec<2, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.y); } template - GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.y); } template - GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.y); } // yyz template - GLM_INLINE glm::vec<3, T, Q> yyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.z); } template - GLM_INLINE glm::vec<3, T, Q> yyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.z); } // yyw template - GLM_INLINE glm::vec<3, T, Q> yyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yyw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.y, v.w); } // yzx template - GLM_INLINE glm::vec<3, T, Q> yzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.z, v.x); } template - GLM_INLINE glm::vec<3, T, Q> yzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.z, v.x); } // yzy template - GLM_INLINE glm::vec<3, T, Q> yzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.z, v.y); } template - GLM_INLINE glm::vec<3, T, Q> yzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.z, v.y); } // yzz template - GLM_INLINE glm::vec<3, T, Q> yzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.z, v.z); } template - GLM_INLINE glm::vec<3, T, Q> yzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.z, v.z); } // yzw template - GLM_INLINE glm::vec<3, T, Q> yzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yzw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.z, v.w); } // ywx template - GLM_INLINE glm::vec<3, T, Q> ywx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> ywx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.w, v.x); } // ywy template - GLM_INLINE glm::vec<3, T, Q> ywy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> ywy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.w, v.y); } // ywz template - GLM_INLINE glm::vec<3, T, Q> ywz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> ywz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.w, v.z); } // yww template - GLM_INLINE glm::vec<3, T, Q> yww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> yww(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.y, v.w, v.w); } // zxx template - GLM_INLINE glm::vec<3, T, Q> zxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.x, v.x); } template - GLM_INLINE glm::vec<3, T, Q> zxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.x, v.x); } // zxy template - GLM_INLINE glm::vec<3, T, Q> zxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.x, v.y); } template - GLM_INLINE glm::vec<3, T, Q> zxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.x, v.y); } // zxz template - GLM_INLINE glm::vec<3, T, Q> zxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.x, v.z); } template - GLM_INLINE glm::vec<3, T, Q> zxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.x, v.z); } // zxw template - GLM_INLINE glm::vec<3, T, Q> zxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zxw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.x, v.w); } // zyx template - GLM_INLINE glm::vec<3, T, Q> zyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.y, v.x); } template - GLM_INLINE glm::vec<3, T, Q> zyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.y, v.x); } // zyy template - GLM_INLINE glm::vec<3, T, Q> zyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.y, v.y); } template - GLM_INLINE glm::vec<3, T, Q> zyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.y, v.y); } // zyz template - GLM_INLINE glm::vec<3, T, Q> zyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.y, v.z); } template - GLM_INLINE glm::vec<3, T, Q> zyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.y, v.z); } // zyw template - GLM_INLINE glm::vec<3, T, Q> zyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zyw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.y, v.w); } // zzx template - GLM_INLINE glm::vec<3, T, Q> zzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzx(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.z, v.x); } template - GLM_INLINE glm::vec<3, T, Q> zzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.z, v.x); } // zzy template - GLM_INLINE glm::vec<3, T, Q> zzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzy(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.z, v.y); } template - GLM_INLINE glm::vec<3, T, Q> zzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.z, v.y); } // zzz template - GLM_INLINE glm::vec<3, T, Q> zzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzz(const glm::vec<3, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.z, v.z); } template - GLM_INLINE glm::vec<3, T, Q> zzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.z, v.z); } // zzw template - GLM_INLINE glm::vec<3, T, Q> zzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zzw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.z, v.w); } // zwx template - GLM_INLINE glm::vec<3, T, Q> zwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zwx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.w, v.x); } // zwy template - GLM_INLINE glm::vec<3, T, Q> zwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zwy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.w, v.y); } // zwz template - GLM_INLINE glm::vec<3, T, Q> zwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zwz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.w, v.z); } // zww template - GLM_INLINE glm::vec<3, T, Q> zww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> zww(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.z, v.w, v.w); } // wxx template - GLM_INLINE glm::vec<3, T, Q> wxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wxx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.x, v.x); } // wxy template - GLM_INLINE glm::vec<3, T, Q> wxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wxy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.x, v.y); } // wxz template - GLM_INLINE glm::vec<3, T, Q> wxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wxz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.x, v.z); } // wxw template - GLM_INLINE glm::vec<3, T, Q> wxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wxw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.x, v.w); } // wyx template - GLM_INLINE glm::vec<3, T, Q> wyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wyx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.y, v.x); } // wyy template - GLM_INLINE glm::vec<3, T, Q> wyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wyy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.y, v.y); } // wyz template - GLM_INLINE glm::vec<3, T, Q> wyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wyz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.y, v.z); } // wyw template - GLM_INLINE glm::vec<3, T, Q> wyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wyw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.y, v.w); } // wzx template - GLM_INLINE glm::vec<3, T, Q> wzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wzx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.z, v.x); } // wzy template - GLM_INLINE glm::vec<3, T, Q> wzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wzy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.z, v.y); } // wzz template - GLM_INLINE glm::vec<3, T, Q> wzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wzz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.z, v.z); } // wzw template - GLM_INLINE glm::vec<3, T, Q> wzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wzw(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.z, v.w); } // wwx template - GLM_INLINE glm::vec<3, T, Q> wwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wwx(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.w, v.x); } // wwy template - GLM_INLINE glm::vec<3, T, Q> wwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wwy(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.w, v.y); } // wwz template - GLM_INLINE glm::vec<3, T, Q> wwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> wwz(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.w, v.z); } // www template - GLM_INLINE glm::vec<3, T, Q> www(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<3, T, Q> www(const glm::vec<4, T, Q> &v) { return glm::vec<3, T, Q>(v.w, v.w, v.w); } // xxxx template - GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<1, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxx(const glm::vec<1, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxx(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); } // xxxy template - GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxy(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); } // xxxz template - GLM_INLINE glm::vec<4, T, Q> xxxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> xxxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); } // xxxw template - GLM_INLINE glm::vec<4, T, Q> xxxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.x, v.w); } // xxyx template - GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyx(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); } // xxyy template - GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyy(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); } // xxyz template - GLM_INLINE glm::vec<4, T, Q> xxyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> xxyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); } // xxyw template - GLM_INLINE glm::vec<4, T, Q> xxyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.y, v.w); } // xxzx template - GLM_INLINE glm::vec<4, T, Q> xxzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xxzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); } // xxzy template - GLM_INLINE glm::vec<4, T, Q> xxzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xxzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); } // xxzz template - GLM_INLINE glm::vec<4, T, Q> xxzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); } template - GLM_INLINE glm::vec<4, T, Q> xxzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); } // xxzw template - GLM_INLINE glm::vec<4, T, Q> xxzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.z, v.w); } // xxwx template - GLM_INLINE glm::vec<4, T, Q> xxwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.w, v.x); } // xxwy template - GLM_INLINE glm::vec<4, T, Q> xxwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.w, v.y); } // xxwz template - GLM_INLINE glm::vec<4, T, Q> xxwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.w, v.z); } // xxww template - GLM_INLINE glm::vec<4, T, Q> xxww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xxww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.x, v.w, v.w); } // xyxx template - GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxx(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); } // xyxy template - GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxy(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); } // xyxz template - GLM_INLINE glm::vec<4, T, Q> xyxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> xyxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); } // xyxw template - GLM_INLINE glm::vec<4, T, Q> xyxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.x, v.w); } // xyyx template - GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyx(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); } // xyyy template - GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyy(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); } // xyyz template - GLM_INLINE glm::vec<4, T, Q> xyyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> xyyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); } // xyyw template - GLM_INLINE glm::vec<4, T, Q> xyyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.y, v.w); } // xyzx template - GLM_INLINE glm::vec<4, T, Q> xyzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xyzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); } // xyzy template - GLM_INLINE glm::vec<4, T, Q> xyzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xyzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); } - // xyzz - template - GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); - } // xyzw template - GLM_INLINE glm::vec<4, T, Q> xyzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.z, v.w); } // xywx template - GLM_INLINE glm::vec<4, T, Q> xywx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xywx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.w, v.x); } // xywy template - GLM_INLINE glm::vec<4, T, Q> xywy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xywy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.w, v.y); } // xywz template - GLM_INLINE glm::vec<4, T, Q> xywz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xywz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.w, v.z); } // xyww template - GLM_INLINE glm::vec<4, T, Q> xyww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xyww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.y, v.w, v.w); } // xzxx template - GLM_INLINE glm::vec<4, T, Q> xzxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xzxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); } // xzxy template - GLM_INLINE glm::vec<4, T, Q> xzxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xzxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); } // xzxz template - GLM_INLINE glm::vec<4, T, Q> xzxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> xzxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); } // xzxw template - GLM_INLINE glm::vec<4, T, Q> xzxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.x, v.w); } // xzyx template - GLM_INLINE glm::vec<4, T, Q> xzyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xzyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); } // xzyy template - GLM_INLINE glm::vec<4, T, Q> xzyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xzyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); } // xzyz template - GLM_INLINE glm::vec<4, T, Q> xzyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> xzyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); } // xzyw template - GLM_INLINE glm::vec<4, T, Q> xzyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.y, v.w); } // xzzx template - GLM_INLINE glm::vec<4, T, Q> xzzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> xzzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); } // xzzy template - GLM_INLINE glm::vec<4, T, Q> xzzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> xzzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); } // xzzz template - GLM_INLINE glm::vec<4, T, Q> xzzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); } template - GLM_INLINE glm::vec<4, T, Q> xzzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); } // xzzw template - GLM_INLINE glm::vec<4, T, Q> xzzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.z, v.w); } // xzwx template - GLM_INLINE glm::vec<4, T, Q> xzwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.w, v.x); } // xzwy template - GLM_INLINE glm::vec<4, T, Q> xzwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.w, v.y); } // xzwz template - GLM_INLINE glm::vec<4, T, Q> xzwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.w, v.z); } // xzww template - GLM_INLINE glm::vec<4, T, Q> xzww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xzww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.z, v.w, v.w); } // xwxx template - GLM_INLINE glm::vec<4, T, Q> xwxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.x, v.x); } // xwxy template - GLM_INLINE glm::vec<4, T, Q> xwxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.x, v.y); } // xwxz template - GLM_INLINE glm::vec<4, T, Q> xwxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.x, v.z); } // xwxw template - GLM_INLINE glm::vec<4, T, Q> xwxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.x, v.w); } // xwyx template - GLM_INLINE glm::vec<4, T, Q> xwyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.y, v.x); } // xwyy template - GLM_INLINE glm::vec<4, T, Q> xwyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.y, v.y); } // xwyz template - GLM_INLINE glm::vec<4, T, Q> xwyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.y, v.z); } // xwyw template - GLM_INLINE glm::vec<4, T, Q> xwyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.y, v.w); } // xwzx template - GLM_INLINE glm::vec<4, T, Q> xwzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.z, v.x); } // xwzy template - GLM_INLINE glm::vec<4, T, Q> xwzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.z, v.y); } // xwzz template - GLM_INLINE glm::vec<4, T, Q> xwzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.z, v.z); } // xwzw template - GLM_INLINE glm::vec<4, T, Q> xwzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.z, v.w); } // xwwx template - GLM_INLINE glm::vec<4, T, Q> xwwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.w, v.x); } // xwwy template - GLM_INLINE glm::vec<4, T, Q> xwwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.w, v.y); } // xwwz template - GLM_INLINE glm::vec<4, T, Q> xwwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.w, v.z); } // xwww template - GLM_INLINE glm::vec<4, T, Q> xwww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> xwww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.x, v.w, v.w, v.w); } // yxxx template - GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxx(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); } // yxxy template - GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxy(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); } // yxxz template - GLM_INLINE glm::vec<4, T, Q> yxxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yxxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); } // yxxw template - GLM_INLINE glm::vec<4, T, Q> yxxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.x, v.w); } // yxyx template - GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyx(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); } // yxyy template - GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyy(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); } // yxyz template - GLM_INLINE glm::vec<4, T, Q> yxyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yxyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); } // yxyw template - GLM_INLINE glm::vec<4, T, Q> yxyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.y, v.w); } // yxzx template - GLM_INLINE glm::vec<4, T, Q> yxzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yxzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); } // yxzy template - GLM_INLINE glm::vec<4, T, Q> yxzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yxzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); } // yxzz template - GLM_INLINE glm::vec<4, T, Q> yxzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yxzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); } // yxzw template - GLM_INLINE glm::vec<4, T, Q> yxzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.z, v.w); } // yxwx template - GLM_INLINE glm::vec<4, T, Q> yxwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.w, v.x); } // yxwy template - GLM_INLINE glm::vec<4, T, Q> yxwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.w, v.y); } // yxwz template - GLM_INLINE glm::vec<4, T, Q> yxwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.w, v.z); } // yxww template - GLM_INLINE glm::vec<4, T, Q> yxww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yxww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.x, v.w, v.w); } // yyxx template - GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxx(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); } // yyxy template - GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxy(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); } // yyxz template - GLM_INLINE glm::vec<4, T, Q> yyxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yyxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); } // yyxw template - GLM_INLINE glm::vec<4, T, Q> yyxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.x, v.w); } // yyyx template - GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyx(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); } // yyyy template - GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<2, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyy(const glm::vec<2, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); } // yyyz template - GLM_INLINE glm::vec<4, T, Q> yyyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yyyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); } // yyyw template - GLM_INLINE glm::vec<4, T, Q> yyyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.y, v.w); } // yyzx template - GLM_INLINE glm::vec<4, T, Q> yyzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yyzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); } // yyzy template - GLM_INLINE glm::vec<4, T, Q> yyzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yyzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); } // yyzz template - GLM_INLINE glm::vec<4, T, Q> yyzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yyzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); } // yyzw template - GLM_INLINE glm::vec<4, T, Q> yyzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.z, v.w); } // yywx template - GLM_INLINE glm::vec<4, T, Q> yywx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yywx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.w, v.x); } // yywy template - GLM_INLINE glm::vec<4, T, Q> yywy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yywy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.w, v.y); } // yywz template - GLM_INLINE glm::vec<4, T, Q> yywz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yywz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.w, v.z); } // yyww template - GLM_INLINE glm::vec<4, T, Q> yyww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yyww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.y, v.w, v.w); } // yzxx template - GLM_INLINE glm::vec<4, T, Q> yzxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yzxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); } // yzxy template - GLM_INLINE glm::vec<4, T, Q> yzxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yzxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); } // yzxz template - GLM_INLINE glm::vec<4, T, Q> yzxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yzxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); } // yzxw template - GLM_INLINE glm::vec<4, T, Q> yzxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.x, v.w); } // yzyx template - GLM_INLINE glm::vec<4, T, Q> yzyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yzyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); } // yzyy template - GLM_INLINE glm::vec<4, T, Q> yzyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yzyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); } // yzyz template - GLM_INLINE glm::vec<4, T, Q> yzyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yzyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); } // yzyw template - GLM_INLINE glm::vec<4, T, Q> yzyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.y, v.w); } // yzzx template - GLM_INLINE glm::vec<4, T, Q> yzzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> yzzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); } // yzzy template - GLM_INLINE glm::vec<4, T, Q> yzzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> yzzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); } // yzzz template - GLM_INLINE glm::vec<4, T, Q> yzzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); } template - GLM_INLINE glm::vec<4, T, Q> yzzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); } // yzzw template - GLM_INLINE glm::vec<4, T, Q> yzzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.z, v.w); } // yzwx template - GLM_INLINE glm::vec<4, T, Q> yzwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.w, v.x); } // yzwy template - GLM_INLINE glm::vec<4, T, Q> yzwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.w, v.y); } // yzwz template - GLM_INLINE glm::vec<4, T, Q> yzwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.w, v.z); } // yzww template - GLM_INLINE glm::vec<4, T, Q> yzww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> yzww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.z, v.w, v.w); } // ywxx template - GLM_INLINE glm::vec<4, T, Q> ywxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.x, v.x); } // ywxy template - GLM_INLINE glm::vec<4, T, Q> ywxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.x, v.y); } // ywxz template - GLM_INLINE glm::vec<4, T, Q> ywxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.x, v.z); } // ywxw template - GLM_INLINE glm::vec<4, T, Q> ywxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.x, v.w); } // ywyx template - GLM_INLINE glm::vec<4, T, Q> ywyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.y, v.x); } // ywyy template - GLM_INLINE glm::vec<4, T, Q> ywyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.y, v.y); } // ywyz template - GLM_INLINE glm::vec<4, T, Q> ywyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.y, v.z); } // ywyw template - GLM_INLINE glm::vec<4, T, Q> ywyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.y, v.w); } // ywzx template - GLM_INLINE glm::vec<4, T, Q> ywzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.z, v.x); } // ywzy template - GLM_INLINE glm::vec<4, T, Q> ywzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.z, v.y); } // ywzz template - GLM_INLINE glm::vec<4, T, Q> ywzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.z, v.z); } // ywzw template - GLM_INLINE glm::vec<4, T, Q> ywzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.z, v.w); } // ywwx template - GLM_INLINE glm::vec<4, T, Q> ywwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.w, v.x); } // ywwy template - GLM_INLINE glm::vec<4, T, Q> ywwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.w, v.y); } // ywwz template - GLM_INLINE glm::vec<4, T, Q> ywwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.w, v.z); } // ywww template - GLM_INLINE glm::vec<4, T, Q> ywww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> ywww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.y, v.w, v.w, v.w); } // zxxx template - GLM_INLINE glm::vec<4, T, Q> zxxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zxxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); } // zxxy template - GLM_INLINE glm::vec<4, T, Q> zxxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zxxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); } // zxxz template - GLM_INLINE glm::vec<4, T, Q> zxxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zxxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); } // zxxw template - GLM_INLINE glm::vec<4, T, Q> zxxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.x, v.w); } // zxyx template - GLM_INLINE glm::vec<4, T, Q> zxyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zxyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); } // zxyy template - GLM_INLINE glm::vec<4, T, Q> zxyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zxyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); } // zxyz template - GLM_INLINE glm::vec<4, T, Q> zxyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zxyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); } // zxyw template - GLM_INLINE glm::vec<4, T, Q> zxyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.y, v.w); } // zxzx template - GLM_INLINE glm::vec<4, T, Q> zxzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zxzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); } // zxzy template - GLM_INLINE glm::vec<4, T, Q> zxzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zxzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); } // zxzz template - GLM_INLINE glm::vec<4, T, Q> zxzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zxzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); } // zxzw template - GLM_INLINE glm::vec<4, T, Q> zxzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.z, v.w); } // zxwx template - GLM_INLINE glm::vec<4, T, Q> zxwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.w, v.x); } // zxwy template - GLM_INLINE glm::vec<4, T, Q> zxwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.w, v.y); } // zxwz template - GLM_INLINE glm::vec<4, T, Q> zxwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.w, v.z); } // zxww template - GLM_INLINE glm::vec<4, T, Q> zxww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zxww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.x, v.w, v.w); } // zyxx template - GLM_INLINE glm::vec<4, T, Q> zyxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zyxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); } // zyxy template - GLM_INLINE glm::vec<4, T, Q> zyxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zyxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); } // zyxz template - GLM_INLINE glm::vec<4, T, Q> zyxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zyxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); } // zyxw template - GLM_INLINE glm::vec<4, T, Q> zyxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.x, v.w); } // zyyx template - GLM_INLINE glm::vec<4, T, Q> zyyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zyyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); } // zyyy template - GLM_INLINE glm::vec<4, T, Q> zyyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zyyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); } // zyyz template - GLM_INLINE glm::vec<4, T, Q> zyyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zyyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); } // zyyw template - GLM_INLINE glm::vec<4, T, Q> zyyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.y, v.w); } // zyzx template - GLM_INLINE glm::vec<4, T, Q> zyzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zyzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); } // zyzy template - GLM_INLINE glm::vec<4, T, Q> zyzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zyzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); } // zyzz template - GLM_INLINE glm::vec<4, T, Q> zyzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zyzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); } // zyzw template - GLM_INLINE glm::vec<4, T, Q> zyzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.z, v.w); } // zywx template - GLM_INLINE glm::vec<4, T, Q> zywx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zywx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.w, v.x); } // zywy template - GLM_INLINE glm::vec<4, T, Q> zywy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zywy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.w, v.y); } // zywz template - GLM_INLINE glm::vec<4, T, Q> zywz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zywz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.w, v.z); } // zyww template - GLM_INLINE glm::vec<4, T, Q> zyww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zyww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.y, v.w, v.w); } // zzxx template - GLM_INLINE glm::vec<4, T, Q> zzxx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zzxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); } // zzxy template - GLM_INLINE glm::vec<4, T, Q> zzxy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zzxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); } // zzxz template - GLM_INLINE glm::vec<4, T, Q> zzxz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zzxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); } // zzxw template - GLM_INLINE glm::vec<4, T, Q> zzxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.x, v.w); } // zzyx template - GLM_INLINE glm::vec<4, T, Q> zzyx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zzyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); } // zzyy template - GLM_INLINE glm::vec<4, T, Q> zzyy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zzyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); } // zzyz template - GLM_INLINE glm::vec<4, T, Q> zzyz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zzyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); } // zzyw template - GLM_INLINE glm::vec<4, T, Q> zzyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.y, v.w); } // zzzx template - GLM_INLINE glm::vec<4, T, Q> zzzx(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzx(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); } template - GLM_INLINE glm::vec<4, T, Q> zzzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); } // zzzy template - GLM_INLINE glm::vec<4, T, Q> zzzy(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzy(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); } template - GLM_INLINE glm::vec<4, T, Q> zzzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); } // zzzz template - GLM_INLINE glm::vec<4, T, Q> zzzz(const glm::vec<3, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzz(const glm::vec<3, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); } template - GLM_INLINE glm::vec<4, T, Q> zzzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); } // zzzw template - GLM_INLINE glm::vec<4, T, Q> zzzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.z, v.w); } // zzwx template - GLM_INLINE glm::vec<4, T, Q> zzwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.w, v.x); } // zzwy template - GLM_INLINE glm::vec<4, T, Q> zzwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.w, v.y); } // zzwz template - GLM_INLINE glm::vec<4, T, Q> zzwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.w, v.z); } // zzww template - GLM_INLINE glm::vec<4, T, Q> zzww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zzww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.z, v.w, v.w); } // zwxx template - GLM_INLINE glm::vec<4, T, Q> zwxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.x, v.x); } // zwxy template - GLM_INLINE glm::vec<4, T, Q> zwxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.x, v.y); } // zwxz template - GLM_INLINE glm::vec<4, T, Q> zwxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.x, v.z); } // zwxw template - GLM_INLINE glm::vec<4, T, Q> zwxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.x, v.w); } // zwyx template - GLM_INLINE glm::vec<4, T, Q> zwyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.y, v.x); } // zwyy template - GLM_INLINE glm::vec<4, T, Q> zwyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.y, v.y); } // zwyz template - GLM_INLINE glm::vec<4, T, Q> zwyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.y, v.z); } // zwyw template - GLM_INLINE glm::vec<4, T, Q> zwyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.y, v.w); } // zwzx template - GLM_INLINE glm::vec<4, T, Q> zwzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.z, v.x); } // zwzy template - GLM_INLINE glm::vec<4, T, Q> zwzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.z, v.y); } // zwzz template - GLM_INLINE glm::vec<4, T, Q> zwzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.z, v.z); } // zwzw template - GLM_INLINE glm::vec<4, T, Q> zwzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.z, v.w); } // zwwx template - GLM_INLINE glm::vec<4, T, Q> zwwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.w, v.x); } // zwwy template - GLM_INLINE glm::vec<4, T, Q> zwwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.w, v.y); } // zwwz template - GLM_INLINE glm::vec<4, T, Q> zwwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.w, v.z); } // zwww template - GLM_INLINE glm::vec<4, T, Q> zwww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> zwww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.z, v.w, v.w, v.w); } // wxxx template - GLM_INLINE glm::vec<4, T, Q> wxxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.x, v.x); } // wxxy template - GLM_INLINE glm::vec<4, T, Q> wxxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.x, v.y); } // wxxz template - GLM_INLINE glm::vec<4, T, Q> wxxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.x, v.z); } // wxxw template - GLM_INLINE glm::vec<4, T, Q> wxxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.x, v.w); } // wxyx template - GLM_INLINE glm::vec<4, T, Q> wxyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.y, v.x); } // wxyy template - GLM_INLINE glm::vec<4, T, Q> wxyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.y, v.y); } // wxyz template - GLM_INLINE glm::vec<4, T, Q> wxyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.y, v.z); } // wxyw template - GLM_INLINE glm::vec<4, T, Q> wxyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.y, v.w); } // wxzx template - GLM_INLINE glm::vec<4, T, Q> wxzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.z, v.x); } // wxzy template - GLM_INLINE glm::vec<4, T, Q> wxzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.z, v.y); } // wxzz template - GLM_INLINE glm::vec<4, T, Q> wxzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.z, v.z); } // wxzw template - GLM_INLINE glm::vec<4, T, Q> wxzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.z, v.w); } // wxwx template - GLM_INLINE glm::vec<4, T, Q> wxwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.w, v.x); } // wxwy template - GLM_INLINE glm::vec<4, T, Q> wxwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.w, v.y); } // wxwz template - GLM_INLINE glm::vec<4, T, Q> wxwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.w, v.z); } // wxww template - GLM_INLINE glm::vec<4, T, Q> wxww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wxww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.x, v.w, v.w); } // wyxx template - GLM_INLINE glm::vec<4, T, Q> wyxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.x, v.x); } // wyxy template - GLM_INLINE glm::vec<4, T, Q> wyxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.x, v.y); } // wyxz template - GLM_INLINE glm::vec<4, T, Q> wyxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.x, v.z); } // wyxw template - GLM_INLINE glm::vec<4, T, Q> wyxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.x, v.w); } // wyyx template - GLM_INLINE glm::vec<4, T, Q> wyyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.y, v.x); } // wyyy template - GLM_INLINE glm::vec<4, T, Q> wyyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.y, v.y); } // wyyz template - GLM_INLINE glm::vec<4, T, Q> wyyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.y, v.z); } // wyyw template - GLM_INLINE glm::vec<4, T, Q> wyyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.y, v.w); } // wyzx template - GLM_INLINE glm::vec<4, T, Q> wyzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.z, v.x); } // wyzy template - GLM_INLINE glm::vec<4, T, Q> wyzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.z, v.y); } // wyzz template - GLM_INLINE glm::vec<4, T, Q> wyzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.z, v.z); } // wyzw template - GLM_INLINE glm::vec<4, T, Q> wyzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.z, v.w); } // wywx template - GLM_INLINE glm::vec<4, T, Q> wywx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wywx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.w, v.x); } // wywy template - GLM_INLINE glm::vec<4, T, Q> wywy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wywy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.w, v.y); } // wywz template - GLM_INLINE glm::vec<4, T, Q> wywz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wywz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.w, v.z); } // wyww template - GLM_INLINE glm::vec<4, T, Q> wyww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wyww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.y, v.w, v.w); } // wzxx template - GLM_INLINE glm::vec<4, T, Q> wzxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.x, v.x); } // wzxy template - GLM_INLINE glm::vec<4, T, Q> wzxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.x, v.y); } // wzxz template - GLM_INLINE glm::vec<4, T, Q> wzxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.x, v.z); } // wzxw template - GLM_INLINE glm::vec<4, T, Q> wzxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.x, v.w); } // wzyx template - GLM_INLINE glm::vec<4, T, Q> wzyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.y, v.x); } // wzyy template - GLM_INLINE glm::vec<4, T, Q> wzyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.y, v.y); } // wzyz template - GLM_INLINE glm::vec<4, T, Q> wzyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.y, v.z); } // wzyw template - GLM_INLINE glm::vec<4, T, Q> wzyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.y, v.w); } // wzzx template - GLM_INLINE glm::vec<4, T, Q> wzzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.z, v.x); } // wzzy template - GLM_INLINE glm::vec<4, T, Q> wzzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.z, v.y); } // wzzz template - GLM_INLINE glm::vec<4, T, Q> wzzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.z, v.z); } // wzzw template - GLM_INLINE glm::vec<4, T, Q> wzzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.z, v.w); } // wzwx template - GLM_INLINE glm::vec<4, T, Q> wzwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.w, v.x); } // wzwy template - GLM_INLINE glm::vec<4, T, Q> wzwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.w, v.y); } // wzwz template - GLM_INLINE glm::vec<4, T, Q> wzwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.w, v.z); } // wzww template - GLM_INLINE glm::vec<4, T, Q> wzww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wzww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.z, v.w, v.w); } // wwxx template - GLM_INLINE glm::vec<4, T, Q> wwxx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwxx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.x, v.x); } // wwxy template - GLM_INLINE glm::vec<4, T, Q> wwxy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwxy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.x, v.y); } // wwxz template - GLM_INLINE glm::vec<4, T, Q> wwxz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwxz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.x, v.z); } // wwxw template - GLM_INLINE glm::vec<4, T, Q> wwxw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwxw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.x, v.w); } // wwyx template - GLM_INLINE glm::vec<4, T, Q> wwyx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwyx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.y, v.x); } // wwyy template - GLM_INLINE glm::vec<4, T, Q> wwyy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwyy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.y, v.y); } // wwyz template - GLM_INLINE glm::vec<4, T, Q> wwyz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwyz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.y, v.z); } // wwyw template - GLM_INLINE glm::vec<4, T, Q> wwyw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwyw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.y, v.w); } // wwzx template - GLM_INLINE glm::vec<4, T, Q> wwzx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwzx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.z, v.x); } // wwzy template - GLM_INLINE glm::vec<4, T, Q> wwzy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwzy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.z, v.y); } // wwzz template - GLM_INLINE glm::vec<4, T, Q> wwzz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwzz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.z, v.z); } // wwzw template - GLM_INLINE glm::vec<4, T, Q> wwzw(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwzw(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.z, v.w); } // wwwx template - GLM_INLINE glm::vec<4, T, Q> wwwx(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwwx(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.w, v.x); } // wwwy template - GLM_INLINE glm::vec<4, T, Q> wwwy(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwwy(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.w, v.y); } // wwwz template - GLM_INLINE glm::vec<4, T, Q> wwwz(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwwz(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.w, v.z); } // wwww template - GLM_INLINE glm::vec<4, T, Q> wwww(const glm::vec<4, T, Q> &v) { + GLM_FUNC_QUALIFIER glm::vec<4, T, Q> wwww(const glm::vec<4, T, Q> &v) { return glm::vec<4, T, Q>(v.w, v.w, v.w, v.w); } -} + /// @} +}//namespace glm diff --git a/vendor/glm/gtx/vector_angle.hpp b/vendor/glm/gtx/vector_angle.hpp old mode 100755 new mode 100644 index 401a47eb86..9ff41279b3 --- a/vendor/glm/gtx/vector_angle.hpp +++ b/vendor/glm/gtx/vector_angle.hpp @@ -22,9 +22,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_vector_angle is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_vector_angle extension included") #endif diff --git a/vendor/glm/gtx/vector_angle.inl b/vendor/glm/gtx/vector_angle.inl old mode 100755 new mode 100644 index 38f8b8ca09..11e1a21837 --- a/vendor/glm/gtx/vector_angle.inl +++ b/vendor/glm/gtx/vector_angle.inl @@ -1,5 +1,4 @@ /// @ref gtx_vector_angle -/// @file glm/gtx/vector_angle.inl namespace glm { @@ -17,18 +16,19 @@ namespace glm template GLM_FUNC_QUALIFIER T angle(vec const& x, vec const& y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'angle' only accept floating-point inputs"); return acos(clamp(dot(x, y), T(-1), T(1))); } - //! \todo epsilon is hard coded to 0.01 template GLM_FUNC_QUALIFIER T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'orientedAngle' only accept floating-point inputs"); T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); - if(all(epsilonEqual(y, glm::rotate(x, Angle), T(0.0001)))) + T const partialCross = x.x * y.y - y.x * x.y; + + if (partialCross > T(0)) return Angle; else return -Angle; @@ -37,7 +37,7 @@ namespace glm template GLM_FUNC_QUALIFIER T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'orientedAngle' only accept floating-point inputs"); T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); return mix(Angle, -Angle, dot(ref, cross(x, y)) < T(0)); diff --git a/vendor/glm/gtx/vector_query.hpp b/vendor/glm/gtx/vector_query.hpp old mode 100755 new mode 100644 index 52ba57b1cf..ab52df0f20 --- a/vendor/glm/gtx/vector_query.hpp +++ b/vendor/glm/gtx/vector_query.hpp @@ -8,7 +8,7 @@ /// /// Include to use the features of this extension. /// -/// Query informations of vector types +/// Query information of vector types #pragma once @@ -19,9 +19,7 @@ #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_vector_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_vector_query extension included") #endif diff --git a/vendor/glm/gtx/vector_query.inl b/vendor/glm/gtx/vector_query.inl old mode 100755 new mode 100644 index 0d8cddcf3f..d1a5c9be46 --- a/vendor/glm/gtx/vector_query.inl +++ b/vendor/glm/gtx/vector_query.inl @@ -1,5 +1,4 @@ /// @ref gtx_vector_query -/// @file glm/gtx/vector_query.inl #include diff --git a/vendor/glm/gtx/wrap.hpp b/vendor/glm/gtx/wrap.hpp old mode 100755 new mode 100644 index 2c4b55df77..b7ac5af263 --- a/vendor/glm/gtx/wrap.hpp +++ b/vendor/glm/gtx/wrap.hpp @@ -14,13 +14,13 @@ // Dependency: #include "../glm.hpp" +#include "../ext/scalar_common.hpp" +#include "../ext/vector_common.hpp" #include "../gtc/vec1.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_wrap is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." -#endif - -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_wrap extension included") #endif @@ -29,26 +29,6 @@ namespace glm /// @addtogroup gtx_wrap /// @{ - /// Simulate GL_CLAMP OpenGL wrap mode - /// @see gtx_wrap extension. - template - GLM_FUNC_DECL genType clamp(genType const& Texcoord); - - /// Simulate GL_REPEAT OpenGL wrap mode - /// @see gtx_wrap extension. - template - GLM_FUNC_DECL genType repeat(genType const& Texcoord); - - /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode - /// @see gtx_wrap extension. - template - GLM_FUNC_DECL genType mirrorClamp(genType const& Texcoord); - - /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode - /// @see gtx_wrap extension. - template - GLM_FUNC_DECL genType mirrorRepeat(genType const& Texcoord); - /// @} }// namespace glm diff --git a/vendor/glm/gtx/wrap.inl b/vendor/glm/gtx/wrap.inl old mode 100755 new mode 100644 index 83e350f195..4be3b4c38a --- a/vendor/glm/gtx/wrap.inl +++ b/vendor/glm/gtx/wrap.inl @@ -1,58 +1,6 @@ /// @ref gtx_wrap -/// @file glm/gtx/wrap.inl namespace glm { - template - GLM_FUNC_QUALIFIER vec clamp(vec const& Texcoord) - { - return glm::clamp(Texcoord, vec(0), vec(1)); - } - template - GLM_FUNC_QUALIFIER genType clamp(genType const& Texcoord) - { - return clamp(vec<1, genType, defaultp>(Texcoord)).x; - } - - template - GLM_FUNC_QUALIFIER vec repeat(vec const& Texcoord) - { - return glm::fract(Texcoord); - } - - template - GLM_FUNC_QUALIFIER genType repeat(genType const& Texcoord) - { - return repeat(vec<1, genType, defaultp>(Texcoord)).x; - } - - template - GLM_FUNC_QUALIFIER vec mirrorClamp(vec const& Texcoord) - { - return glm::fract(glm::abs(Texcoord)); - } - - template - GLM_FUNC_QUALIFIER genType mirrorClamp(genType const& Texcoord) - { - return mirrorClamp(vec<1, genType, defaultp>(Texcoord)).x; - } - - template - GLM_FUNC_QUALIFIER vec mirrorRepeat(vec const& Texcoord) - { - vec const Abs = glm::abs(Texcoord); - vec const Clamp = glm::mod(glm::floor(Abs), vec(2)); - vec const Floor = glm::floor(Abs); - vec const Rest = Abs - Floor; - vec const Mirror = Clamp + Rest; - return mix(Rest, vec(1) - Rest, glm::greaterThanEqual(Mirror, vec(1))); - } - - template - GLM_FUNC_QUALIFIER genType mirrorRepeat(genType const& Texcoord) - { - return mirrorRepeat(vec<1, genType, defaultp>(Texcoord)).x; - } }//namespace glm diff --git a/vendor/glm/integer.hpp b/vendor/glm/integer.hpp old mode 100755 new mode 100644 index fca4e69600..36c67bec79 --- a/vendor/glm/integer.hpp +++ b/vendor/glm/integer.hpp @@ -6,15 +6,16 @@ /// @defgroup core_func_integer Integer functions /// @ingroup core /// -/// Include to use these core features. +/// Provides GLSL functions on integer types /// /// These all operate component-wise. The description is per component. /// The notation [a, b] means the set of bits from bit-number a through bit-number /// b, inclusive. The lowest-order bit is bit 0. +/// +/// Include to use these core features. #pragma once -#include "detail/setup.hpp" #include "detail/qualifier.hpp" #include "common.hpp" #include "vector_relational.hpp" @@ -61,7 +62,7 @@ namespace glm /// @see GLSL umulExtended man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL void umulExtended( + GLM_FUNC_DISCARD_DECL void umulExtended( vec const& x, vec const& y, vec & msb, @@ -76,7 +77,7 @@ namespace glm /// @see GLSL imulExtended man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - GLM_FUNC_DECL void imulExtended( + GLM_FUNC_DISCARD_DECL void imulExtended( vec const& x, vec const& y, vec & msb, diff --git a/vendor/glm/mat2x2.hpp b/vendor/glm/mat2x2.hpp old mode 100755 new mode 100644 index 057466d4fe..96bec96b9a --- a/vendor/glm/mat2x2.hpp +++ b/vendor/glm/mat2x2.hpp @@ -1,54 +1,9 @@ /// @ref core /// @file glm/mat2x2.hpp -#include "detail/setup.hpp" - #pragma once +#include "./ext/matrix_double2x2.hpp" +#include "./ext/matrix_double2x2_precision.hpp" +#include "./ext/matrix_float2x2.hpp" +#include "./ext/matrix_float2x2_precision.hpp" -#include "detail/type_mat2x2.hpp" - -namespace glm -{ - /// 2 columns of 2 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, lowp> lowp_mat2; - - /// 2 columns of 2 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, mediump> mediump_mat2; - - /// 2 columns of 2 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, highp> highp_mat2; - - /// 2 columns of 2 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, lowp> lowp_mat2x2; - - /// 2 columns of 2 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, mediump> mediump_mat2x2; - - /// 2 columns of 2 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, highp> highp_mat2x2; - -}//namespace glm diff --git a/vendor/glm/mat2x3.hpp b/vendor/glm/mat2x3.hpp old mode 100755 new mode 100644 index bf0170f4a0..d68dc25eda --- a/vendor/glm/mat2x3.hpp +++ b/vendor/glm/mat2x3.hpp @@ -1,34 +1,9 @@ /// @ref core /// @file glm/mat2x3.hpp -#include "detail/setup.hpp" - #pragma once - -#include "detail/type_mat2x3.hpp" - -namespace glm -{ - /// 2 columns of 3 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, lowp> lowp_mat2x3; - - /// 2 columns of 3 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, mediump> mediump_mat2x3; - - /// 2 columns of 3 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, highp> highp_mat2x3; - -}//namespace glm +#include "./ext/matrix_double2x3.hpp" +#include "./ext/matrix_double2x3_precision.hpp" +#include "./ext/matrix_float2x3.hpp" +#include "./ext/matrix_float2x3_precision.hpp" diff --git a/vendor/glm/mat2x4.hpp b/vendor/glm/mat2x4.hpp old mode 100755 new mode 100644 index d3c813dc68..b04b7387b1 --- a/vendor/glm/mat2x4.hpp +++ b/vendor/glm/mat2x4.hpp @@ -1,33 +1,9 @@ /// @ref core /// @file glm/mat2x4.hpp -#include "detail/setup.hpp" - #pragma once +#include "./ext/matrix_double2x4.hpp" +#include "./ext/matrix_double2x4_precision.hpp" +#include "./ext/matrix_float2x4.hpp" +#include "./ext/matrix_float2x4_precision.hpp" -#include "detail/type_mat2x4.hpp" - -namespace glm -{ - /// 2 columns of 4 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, lowp> lowp_mat2x4; - - /// 2 columns of 4 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, mediump> mediump_mat2x4; - - /// 2 columns of 4 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, highp> highp_mat2x4; - -}//namespace glm diff --git a/vendor/glm/mat3x2.hpp b/vendor/glm/mat3x2.hpp old mode 100755 new mode 100644 index 4500769757..c85315372d --- a/vendor/glm/mat3x2.hpp +++ b/vendor/glm/mat3x2.hpp @@ -1,33 +1,9 @@ /// @ref core /// @file glm/mat3x2.hpp -#include "detail/setup.hpp" - #pragma once +#include "./ext/matrix_double3x2.hpp" +#include "./ext/matrix_double3x2_precision.hpp" +#include "./ext/matrix_float3x2.hpp" +#include "./ext/matrix_float3x2_precision.hpp" -#include "detail/type_mat3x2.hpp" - -namespace glm -{ - /// 3 columns of 2 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, lowp> lowp_mat3x2; - - /// 3 columns of 2 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, mediump> mediump_mat3x2; - - /// 3 columns of 2 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, highp> highp_mat3x2; - -}//namespace diff --git a/vendor/glm/mat3x3.hpp b/vendor/glm/mat3x3.hpp old mode 100755 new mode 100644 index 586d1f0dc3..fd4fa31cde --- a/vendor/glm/mat3x3.hpp +++ b/vendor/glm/mat3x3.hpp @@ -1,54 +1,8 @@ /// @ref core /// @file glm/mat3x3.hpp -#include "detail/setup.hpp" - #pragma once - -#include "detail/type_mat3x3.hpp" - -namespace glm -{ - /// 3 columns of 3 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, lowp> lowp_mat3; - - /// 3 columns of 3 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, mediump> mediump_mat3; - - /// 3 columns of 3 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, highp> highp_mat3; - - /// 3 columns of 3 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, lowp> lowp_mat3x3; - - /// 3 columns of 3 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, mediump> mediump_mat3x3; - - /// 3 columns of 3 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, highp> highp_mat3x3; - -}//namespace glm +#include "./ext/matrix_double3x3.hpp" +#include "./ext/matrix_double3x3_precision.hpp" +#include "./ext/matrix_float3x3.hpp" +#include "./ext/matrix_float3x3_precision.hpp" diff --git a/vendor/glm/mat3x4.hpp b/vendor/glm/mat3x4.hpp old mode 100755 new mode 100644 index d1294aeabf..6342bf5b99 --- a/vendor/glm/mat3x4.hpp +++ b/vendor/glm/mat3x4.hpp @@ -1,33 +1,8 @@ /// @ref core /// @file glm/mat3x4.hpp -#include "detail/setup.hpp" - #pragma once - -#include "detail/type_mat3x4.hpp" - -namespace glm -{ - /// 3 columns of 4 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, lowp> lowp_mat3x4; - - /// 3 columns of 4 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, mediump> mediump_mat3x4; - - /// 3 columns of 4 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, highp> highp_mat3x4; - -}//namespace glm +#include "./ext/matrix_double3x4.hpp" +#include "./ext/matrix_double3x4_precision.hpp" +#include "./ext/matrix_float3x4.hpp" +#include "./ext/matrix_float3x4_precision.hpp" diff --git a/vendor/glm/mat4x2.hpp b/vendor/glm/mat4x2.hpp old mode 100755 new mode 100644 index c6f8758d48..e013e46b9c --- a/vendor/glm/mat4x2.hpp +++ b/vendor/glm/mat4x2.hpp @@ -1,33 +1,9 @@ /// @ref core /// @file glm/mat4x2.hpp -#include "detail/setup.hpp" - #pragma once +#include "./ext/matrix_double4x2.hpp" +#include "./ext/matrix_double4x2_precision.hpp" +#include "./ext/matrix_float4x2.hpp" +#include "./ext/matrix_float4x2_precision.hpp" -#include "detail/type_mat4x2.hpp" - -namespace glm -{ - /// 4 columns of 2 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, lowp> lowp_mat4x2; - - /// 4 columns of 2 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, mediump> mediump_mat4x2; - - /// 4 columns of 2 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, highp> highp_mat4x2; - -}//namespace glm diff --git a/vendor/glm/mat4x3.hpp b/vendor/glm/mat4x3.hpp old mode 100755 new mode 100644 index 88014935c8..205725abd2 --- a/vendor/glm/mat4x3.hpp +++ b/vendor/glm/mat4x3.hpp @@ -1,33 +1,8 @@ /// @ref core /// @file glm/mat4x3.hpp -#include "detail/setup.hpp" - #pragma once - -#include "detail/type_mat4x3.hpp" - -namespace glm -{ - /// 4 columns of 3 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, lowp> lowp_mat4x3; - - /// 4 columns of 3 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, mediump> mediump_mat4x3; - - /// 4 columns of 3 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, highp> highp_mat4x3; - -}//namespace glm +#include "./ext/matrix_double4x3.hpp" +#include "./ext/matrix_double4x3_precision.hpp" +#include "./ext/matrix_float4x3.hpp" +#include "./ext/matrix_float4x3_precision.hpp" diff --git a/vendor/glm/mat4x4.hpp b/vendor/glm/mat4x4.hpp old mode 100755 new mode 100644 index f3019f2aee..3515f7f370 --- a/vendor/glm/mat4x4.hpp +++ b/vendor/glm/mat4x4.hpp @@ -1,54 +1,9 @@ /// @ref core /// @file glm/mat4x4.hpp -#include "detail/setup.hpp" - #pragma once +#include "./ext/matrix_double4x4.hpp" +#include "./ext/matrix_double4x4_precision.hpp" +#include "./ext/matrix_float4x4.hpp" +#include "./ext/matrix_float4x4_precision.hpp" -#include "detail/type_mat4x4.hpp" - -namespace glm -{ - /// 4 columns of 4 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, lowp> lowp_mat4; - - /// 4 columns of 4 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, mediump> mediump_mat4; - - /// 4 columns of 4 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, highp> highp_mat4; - - /// 4 columns of 4 components matrix of low qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, lowp> lowp_mat4x4; - - /// 4 columns of 4 components matrix of medium qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, mediump> mediump_mat4x4; - - /// 4 columns of 4 components matrix of high qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, highp> highp_mat4x4; - -}//namespace glm diff --git a/vendor/glm/matrix.hpp b/vendor/glm/matrix.hpp old mode 100755 new mode 100644 index 437e3884f9..4584c92c3c --- a/vendor/glm/matrix.hpp +++ b/vendor/glm/matrix.hpp @@ -6,20 +6,15 @@ /// @defgroup core_func_matrix Matrix functions /// @ingroup core /// -/// Include to use these core features. +/// Provides GLSL matrix functions. /// -/// For each of the following built-in matrix functions, there is both a -/// single-qualifier floating point version, where all arguments and return values -/// are single qualifier, and a double-qualifier floating version, where all -/// arguments and return values are double qualifier. Only the single-qualifier -/// floating point version is shown. +/// Include to use these core features. #pragma once // Dependencies #include "detail/qualifier.hpp" #include "detail/setup.hpp" -#include "detail/type_mat.hpp" #include "vec2.hpp" #include "vec3.hpp" #include "vec4.hpp" @@ -34,63 +29,65 @@ #include "mat4x4.hpp" namespace glm { - namespace detail +namespace detail +{ + template + struct outerProduct_trait{}; + + template + struct outerProduct_trait<2, 2, T, Q> + { + typedef mat<2, 2, T, Q> type; + }; + + template + struct outerProduct_trait<2, 3, T, Q> + { + typedef mat<3, 2, T, Q> type; + }; + + template + struct outerProduct_trait<2, 4, T, Q> + { + typedef mat<4, 2, T, Q> type; + }; + + template + struct outerProduct_trait<3, 2, T, Q> + { + typedef mat<2, 3, T, Q> type; + }; + + template + struct outerProduct_trait<3, 3, T, Q> + { + typedef mat<3, 3, T, Q> type; + }; + + template + struct outerProduct_trait<3, 4, T, Q> + { + typedef mat<4, 3, T, Q> type; + }; + + template + struct outerProduct_trait<4, 2, T, Q> + { + typedef mat<2, 4, T, Q> type; + }; + + template + struct outerProduct_trait<4, 3, T, Q> + { + typedef mat<3, 4, T, Q> type; + }; + + template + struct outerProduct_trait<4, 4, T, Q> { - template - struct outerProduct_trait<2, 2, T, Q> - { - typedef mat<2, 2, T, Q> type; - }; - - template - struct outerProduct_trait<2, 3, T, Q> - { - typedef mat<3, 2, T, Q> type; - }; - - template - struct outerProduct_trait<2, 4, T, Q> - { - typedef mat<4, 2, T, Q> type; - }; - - template - struct outerProduct_trait<3, 2, T, Q> - { - typedef mat<2, 3, T, Q> type; - }; - - template - struct outerProduct_trait<3, 3, T, Q> - { - typedef mat<3, 3, T, Q> type; - }; - - template - struct outerProduct_trait<3, 4, T, Q> - { - typedef mat<4, 3, T, Q> type; - }; - - template - struct outerProduct_trait<4, 2, T, Q> - { - typedef mat<2, 4, T, Q> type; - }; - - template - struct outerProduct_trait<4, 3, T, Q> - { - typedef mat<3, 4, T, Q> type; - }; - - template - struct outerProduct_trait<4, 4, T, Q> - { - typedef mat<4, 4, T, Q> type; - }; - - }//namespace detail + typedef mat<4, 4, T, Q> type; + }; +}//namespace detail /// @addtogroup core_func_matrix /// @{ @@ -100,7 +97,7 @@ namespace glm { /// /// @tparam C Integer between 1 and 4 included that qualify the number a column /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types + /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see GLSL matrixCompMult man page @@ -114,7 +111,7 @@ namespace glm { /// /// @tparam C Integer between 1 and 4 included that qualify the number a column /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types + /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see GLSL outerProduct man page @@ -126,7 +123,7 @@ namespace glm { /// /// @tparam C Integer between 1 and 4 included that qualify the number a column /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types + /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see GLSL transpose man page @@ -138,7 +135,7 @@ namespace glm { /// /// @tparam C Integer between 1 and 4 included that qualify the number a column /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types + /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see GLSL determinant man page @@ -150,7 +147,7 @@ namespace glm { /// /// @tparam C Integer between 1 and 4 included that qualify the number a column /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types + /// @tparam T Floating-point scalar types /// @tparam Q Value from qualifier enum /// /// @see GLSL inverse man page diff --git a/vendor/glm/packing.hpp b/vendor/glm/packing.hpp old mode 100755 new mode 100644 index c509fbfc13..ca83ac1dec --- a/vendor/glm/packing.hpp +++ b/vendor/glm/packing.hpp @@ -7,14 +7,17 @@ /// @defgroup core_func_packing Floating-Point Pack and Unpack Functions /// @ingroup core /// -/// Include to use these core features. +/// Provides GLSL functions to pack and unpack half, single and double-precision floating point values into more compact integer types. /// /// These functions do not operate component-wise, rather as described in each case. +/// +/// Include to use these core features. #pragma once -#include "detail/type_vec2.hpp" -#include "detail/type_vec4.hpp" +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float4.hpp" namespace glm { diff --git a/vendor/glm/simd/common.h b/vendor/glm/simd/common.h old mode 100755 new mode 100644 index 78ff4d23d2..c11338a69a --- a/vendor/glm/simd/common.h +++ b/vendor/glm/simd/common.h @@ -7,52 +7,52 @@ #if GLM_ARCH & GLM_ARCH_SSE2_BIT -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_add(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_add(glm_f32vec4 a, glm_f32vec4 b) { return _mm_add_ps(a, b); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_add(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_add(glm_f32vec4 a, glm_f32vec4 b) { return _mm_add_ss(a, b); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sub(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sub(glm_f32vec4 a, glm_f32vec4 b) { return _mm_sub_ps(a, b); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_sub(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sub(glm_f32vec4 a, glm_f32vec4 b) { return _mm_sub_ss(a, b); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mul(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_mul(glm_f32vec4 a, glm_f32vec4 b) { return _mm_mul_ps(a, b); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_mul(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_mul(glm_f32vec4 a, glm_f32vec4 b) { return _mm_mul_ss(a, b); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_div(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_div(glm_f32vec4 a, glm_f32vec4 b) { return _mm_div_ps(a, b); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_div(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_div(glm_f32vec4 a, glm_f32vec4 b) { return _mm_div_ss(a, b); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_div_lowp(glm_vec4 a, glm_vec4 b) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_div_lowp(glm_f32vec4 a, glm_f32vec4 b) { return glm_vec4_mul(a, _mm_rcp_ps(b)); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_swizzle_xyzw(glm_vec4 a) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_swizzle_xyzw(glm_f32vec4 a) { # if GLM_ARCH & GLM_ARCH_AVX2_BIT return _mm_permute_ps(a, _MM_SHUFFLE(3, 2, 1, 0)); @@ -61,25 +61,34 @@ GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_swizzle_xyzw(glm_vec4 a) # endif } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_fma(glm_vec4 a, glm_vec4 b, glm_vec4 c) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) { -# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) +# ifdef GLM_FORCE_FMA return _mm_fmadd_ss(a, b, c); # else return _mm_add_ss(_mm_mul_ss(a, b), c); # endif } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_fma(glm_vec4 a, glm_vec4 b, glm_vec4 c) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) { -# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) +# ifdef GLM_FORCE_FMA return _mm_fmadd_ps(a, b, c); # else return glm_vec4_add(glm_vec4_mul(a, b), c); # endif } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_abs(glm_vec4 x) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4d_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) +{ +# ifdef GLM_FORCE_FMA + return _mm_fmadd_ps(a, b, c); +# else + return glm_vec4_add(glm_vec4_mul(a, b), c); +# endif +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_abs(glm_f32vec4 x) { return _mm_and_ps(x, _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF))); } @@ -103,7 +112,7 @@ GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sign(glm_vec4 x) glm_vec4 const cmp1 = _mm_cmpgt_ps(x, zro0); glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(-1.0f)); glm_vec4 const and1 = _mm_and_ps(cmp1, _mm_set1_ps(1.0f)); - glm_vec4 const or0 = _mm_or_ps(and0, and1);; + glm_vec4 const or0 = _mm_or_ps(and0, and1); return or0; } @@ -206,7 +215,7 @@ GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_smoothstep(glm_vec4 edge0, glm_vec4 edge1, { glm_vec4 const sub0 = glm_vec4_sub(x, edge0); glm_vec4 const sub1 = glm_vec4_sub(edge1, edge0); - glm_vec4 const div0 = glm_vec4_sub(sub0, sub1); + glm_vec4 const div0 = glm_vec4_div(sub0, sub1); glm_vec4 const clp0 = glm_vec4_clamp(div0, _mm_setzero_ps(), _mm_set1_ps(1.0f)); glm_vec4 const mul0 = glm_vec4_mul(_mm_set1_ps(2.0f), clp0); glm_vec4 const sub2 = glm_vec4_sub(_mm_set1_ps(3.0f), mul0); diff --git a/vendor/glm/simd/exponential.h b/vendor/glm/simd/exponential.h old mode 100755 new mode 100644 index 4eb0fb7474..bc351d0119 --- a/vendor/glm/simd/exponential.h +++ b/vendor/glm/simd/exponential.h @@ -7,12 +7,12 @@ #if GLM_ARCH & GLM_ARCH_SSE2_BIT -GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_sqrt_lowp(glm_vec4 x) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sqrt_lowp(glm_f32vec4 x) { return _mm_mul_ss(_mm_rsqrt_ss(x), x); } -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sqrt_lowp(glm_vec4 x) +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sqrt_lowp(glm_f32vec4 x) { return _mm_mul_ps(_mm_rsqrt_ps(x), x); } diff --git a/vendor/glm/simd/geometric.h b/vendor/glm/simd/geometric.h old mode 100755 new mode 100644 index 07d7cbcc42..afbe590e86 --- a/vendor/glm/simd/geometric.h +++ b/vendor/glm/simd/geometric.h @@ -102,17 +102,23 @@ GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_reflect(glm_vec4 I, glm_vec4 N) GLM_FUNC_QUALIFIER __m128 glm_vec4_refract(glm_vec4 I, glm_vec4 N, glm_vec4 eta) { - glm_vec4 const dot0 = glm_vec4_dot(N, I); - glm_vec4 const mul0 = _mm_mul_ps(eta, eta); - glm_vec4 const mul1 = _mm_mul_ps(dot0, dot0); - glm_vec4 const sub0 = _mm_sub_ps(_mm_set1_ps(1.0f), mul0); - glm_vec4 const sub1 = _mm_sub_ps(_mm_set1_ps(1.0f), mul1); - glm_vec4 const mul2 = _mm_mul_ps(sub0, sub1); - - if(_mm_movemask_ps(_mm_cmplt_ss(mul2, _mm_set1_ps(0.0f))) == 0) + // k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)); + // if (k < 0.0) + // R = genType(0.0); // or genDType(0.0) + // else + // R = eta * I - (eta * dot(N, I) + sqrt(k)) * N; + + glm_vec4 const dot0 = glm_vec4_dot(N, I); // dot(N, I) + glm_vec4 const mul0 = _mm_mul_ps(eta, eta); // eta * eta + glm_vec4 const mul1 = _mm_mul_ps(dot0, dot0); // dot(N, I) * dot(N, I) + glm_vec4 const sub1 = _mm_sub_ps(_mm_set1_ps(1.0f), mul1); // (1.0 - dot(N, I) * dot(N, I)) + glm_vec4 const mul2 = _mm_mul_ps(mul0, sub1); // eta * eta * (1.0 - dot(N, I) * dot(N, I)) + glm_vec4 const sub0 = _mm_sub_ps(_mm_set1_ps(1.0f), mul2); // 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I)) + + if(_mm_movemask_ps(_mm_cmplt_ss(sub0, _mm_set1_ps(0.0f))) == 0) return _mm_set1_ps(0.0f); - glm_vec4 const sqt0 = _mm_sqrt_ps(mul2); + glm_vec4 const sqt0 = _mm_sqrt_ps(sub0); glm_vec4 const mad0 = glm_vec4_fma(eta, dot0, sqt0); glm_vec4 const mul4 = _mm_mul_ps(mad0, N); glm_vec4 const mul5 = _mm_mul_ps(eta, I); diff --git a/vendor/glm/simd/integer.h b/vendor/glm/simd/integer.h old mode 100755 new mode 100644 diff --git a/vendor/glm/simd/matrix.h b/vendor/glm/simd/matrix.h old mode 100755 new mode 100644 index b6c42ea4c1..8f9461c8b9 --- a/vendor/glm/simd/matrix.h +++ b/vendor/glm/simd/matrix.h @@ -166,6 +166,18 @@ GLM_FUNC_QUALIFIER void glm_mat4_transpose(glm_vec4 const in[4], glm_vec4 out[4] out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD); } +GLM_FUNC_QUALIFIER void glm_mat3_transpose(glm_vec4 const in[3], glm_vec4 out[3]) +{ + __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44); + __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE); + __m128 tmp1 = _mm_shuffle_ps(in[2], in[2], 0x44); + __m128 tmp3 = _mm_shuffle_ps(in[2], in[2], 0xEE); + + out[0] = _mm_shuffle_ps(tmp0, tmp1, 0x88); + out[1] = _mm_shuffle_ps(tmp0, tmp1, 0xDD); + out[2] = _mm_shuffle_ps(tmp2, tmp3, 0x88); +} + GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant_highp(glm_vec4 const in[4]) { __m128 Fac0; diff --git a/vendor/glm/simd/neon.h b/vendor/glm/simd/neon.h new file mode 100644 index 0000000000..fc86e62d88 --- /dev/null +++ b/vendor/glm/simd/neon.h @@ -0,0 +1,155 @@ +/// @ref simd_neon +/// @file glm/simd/neon.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_NEON_BIT +#include + +namespace glm { + namespace neon { + static inline float32x4_t dupq_lane(float32x4_t vsrc, int lane) { + switch(lane) { + default: assert(false); //Unreachable code executed! +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + case 0: return vdupq_laneq_f32(vsrc, 0); + case 1: return vdupq_laneq_f32(vsrc, 1); + case 2: return vdupq_laneq_f32(vsrc, 2); + case 3: return vdupq_laneq_f32(vsrc, 3); +#else + case 0: return vdupq_n_f32(vgetq_lane_f32(vsrc, 0)); + case 1: return vdupq_n_f32(vgetq_lane_f32(vsrc, 1)); + case 2: return vdupq_n_f32(vgetq_lane_f32(vsrc, 2)); + case 3: return vdupq_n_f32(vgetq_lane_f32(vsrc, 3)); +#endif + } + return vdupq_n_f32(0.0f); + } + + static inline float32x2_t dup_lane(float32x4_t vsrc, int lane) { + switch(lane) { + default: assert(false); //Unreachable code executed! +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + case 0: return vdup_laneq_f32(vsrc, 0); + case 1: return vdup_laneq_f32(vsrc, 1); + case 2: return vdup_laneq_f32(vsrc, 2); + case 3: return vdup_laneq_f32(vsrc, 3); +#else + case 0: return vdup_n_f32(vgetq_lane_f32(vsrc, 0)); + case 1: return vdup_n_f32(vgetq_lane_f32(vsrc, 1)); + case 2: return vdup_n_f32(vgetq_lane_f32(vsrc, 2)); + case 3: return vdup_n_f32(vgetq_lane_f32(vsrc, 3)); +#endif + } + return vdup_n_f32(0.0f); + } + + static inline float32x4_t copy_lane(float32x4_t vdst, int dlane, float32x4_t vsrc, int slane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + switch(dlane) { + default: + case 0: + switch(slane) { + default: assert(false); //Unreachable code executed! + case 0: return vcopyq_laneq_f32(vdst, 0, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 0, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 0, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 0, vsrc, 3); + } + break; + case 1: + switch(slane) { + default: assert(false); //Unreachable code executed! + case 0: return vcopyq_laneq_f32(vdst, 1, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 1, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 1, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 1, vsrc, 3); + } + break; + case 2: + switch(slane) { + default: assert(false); //Unreachable code executed! + case 0: return vcopyq_laneq_f32(vdst, 2, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 2, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 2, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 2, vsrc, 3); + } + break; + case 3: + switch(slane) { + default: assert(false); //Unreachable code executed! + case 0: return vcopyq_laneq_f32(vdst, 3, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 3, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 3, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 3, vsrc, 3); + } + break; + } +#else + + float l; + switch(slane) { + default: assert(false); //Unreachable code executed! + case 0: l = vgetq_lane_f32(vsrc, 0); break; + case 1: l = vgetq_lane_f32(vsrc, 1); break; + case 2: l = vgetq_lane_f32(vsrc, 2); break; + case 3: l = vgetq_lane_f32(vsrc, 3); break; + } + switch(dlane) { + default: assert(false); //Unreachable code executed! + case 0: return vsetq_lane_f32(l, vdst, 0); + case 1: return vsetq_lane_f32(l, vdst, 1); + case 2: return vsetq_lane_f32(l, vdst, 2); + case 3: return vsetq_lane_f32(l, vdst, 3); + } +#endif + return vdupq_n_f32(0.0f); + } + + static inline float32x4_t mul_lane(float32x4_t v, float32x4_t vlane, int lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + switch(lane) { + default: assert(false); return vdupq_n_f32(0.0f); //Unreachable code executed! + case 0: return vmulq_laneq_f32(v, vlane, 0); break; + case 1: return vmulq_laneq_f32(v, vlane, 1); break; + case 2: return vmulq_laneq_f32(v, vlane, 2); break; + case 3: return vmulq_laneq_f32(v, vlane, 3); break; + } +#else + return vmulq_f32(v, dupq_lane(vlane, lane)); +#endif + } + + static inline float32x4_t madd_lane(float32x4_t acc, float32x4_t v, float32x4_t vlane, int lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT +#ifdef GLM_CONFIG_FORCE_FMA +# define FMADD_LANE(acc, x, y, L) do { asm volatile ("fmla %0.4s, %1.4s, %2.4s" : "+w"(acc) : "w"(x), "w"(dup_lane(y, L))); } while(0) +#else +# define FMADD_LANE(acc, x, y, L) do { acc = vmlaq_laneq_f32(acc, x, y, L); } while(0) +#endif + + switch(lane) { + case 0: + FMADD_LANE(acc, v, vlane, 0); + return acc; + case 1: + FMADD_LANE(acc, v, vlane, 1); + return acc; + case 2: + FMADD_LANE(acc, v, vlane, 2); + return acc; + case 3: + FMADD_LANE(acc, v, vlane, 3); + return acc; + default: + assert(false); //Unreachable code executed! + } + return vdupq_n_f32(0.0f); +# undef FMADD_LANE +#else + return vaddq_f32(acc, vmulq_f32(v, dupq_lane(vlane, lane))); +#endif + } + } //namespace neon +} // namespace glm +#endif // GLM_ARCH & GLM_ARCH_NEON_BIT diff --git a/vendor/glm/simd/packing.h b/vendor/glm/simd/packing.h old mode 100755 new mode 100644 diff --git a/vendor/glm/simd/platform.h b/vendor/glm/simd/platform.h old mode 100755 new mode 100644 index b92c9bb6a6..a318b098f9 --- a/vendor/glm/simd/platform.h +++ b/vendor/glm/simd/platform.h @@ -1,6 +1,3 @@ -/// @ref simd -/// @file glm/simd/platform.h - #pragma once /////////////////////////////////////////////////////////////////////////////////// @@ -42,34 +39,6 @@ # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN #endif// -// Report platform detection -#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_PLATFORM_DISPLAYED) -# define GLM_MESSAGE_PLATFORM_DISPLAYED -# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) -# pragma message("GLM: QNX platform detected") -//# elif(GLM_PLATFORM & GLM_PLATFORM_IOS) -//# pragma message("GLM: iOS platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) -# pragma message("GLM: Apple platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) -# pragma message("GLM: WinCE platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) -# pragma message("GLM: Windows platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) -# pragma message("GLM: Native Client detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) -# pragma message("GLM: Android platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) -# pragma message("GLM: Linux platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) -# pragma message("GLM: UNIX platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) -# pragma message("GLM: platform unknown") -# else -# pragma message("GLM: platform not detected") -# endif -#endif//GLM_MESSAGES - /////////////////////////////////////////////////////////////////////////////////// // Compiler @@ -81,13 +50,23 @@ #define GLM_COMPILER_INTEL15 0x00100050 #define GLM_COMPILER_INTEL16 0x00100060 #define GLM_COMPILER_INTEL17 0x00100070 +#define GLM_COMPILER_INTEL18 0x00100080 +#define GLM_COMPILER_INTEL19 0x00100090 +#define GLM_COMPILER_INTEL21 0x001000A0 // Visual C++ defines #define GLM_COMPILER_VC 0x01000000 -#define GLM_COMPILER_VC12 0x010000B0 -#define GLM_COMPILER_VC14 0x010000C0 -#define GLM_COMPILER_VC15 0x010000D0 -#define GLM_COMPILER_VC16 0x010000E0 +#define GLM_COMPILER_VC12 0x01000001 // Visual Studio 2013 +#define GLM_COMPILER_VC14 0x01000002 // Visual Studio 2015 +#define GLM_COMPILER_VC15 0x01000003 // Visual Studio 2017 +#define GLM_COMPILER_VC15_3 0x01000004 +#define GLM_COMPILER_VC15_5 0x01000005 +#define GLM_COMPILER_VC15_6 0x01000006 +#define GLM_COMPILER_VC15_7 0x01000007 +#define GLM_COMPILER_VC15_8 0x01000008 +#define GLM_COMPILER_VC15_9 0x01000009 +#define GLM_COMPILER_VC16 0x0100000A // Visual Studio 2019 +#define GLM_COMPILER_VC17 0x0100000B // Visual Studio 2022 // GCC defines #define GLM_COMPILER_GCC 0x02000000 @@ -97,14 +76,22 @@ #define GLM_COMPILER_GCC49 0x02000100 #define GLM_COMPILER_GCC5 0x02000200 #define GLM_COMPILER_GCC6 0x02000300 +#define GLM_COMPILER_GCC61 0x02000800 #define GLM_COMPILER_GCC7 0x02000400 #define GLM_COMPILER_GCC8 0x02000500 +#define GLM_COMPILER_GCC9 0x02000600 +#define GLM_COMPILER_GCC10 0x02000700 +#define GLM_COMPILER_GCC11 0x02000800 +#define GLM_COMPILER_GCC12 0x02000900 +#define GLM_COMPILER_GCC13 0x02000A00 +#define GLM_COMPILER_GCC14 0x02000B00 // CUDA #define GLM_COMPILER_CUDA 0x10000000 -#define GLM_COMPILER_CUDA70 0x100000A0 -#define GLM_COMPILER_CUDA75 0x100000B0 -#define GLM_COMPILER_CUDA80 0x100000C0 +#define GLM_COMPILER_CUDA75 0x10000001 +#define GLM_COMPILER_CUDA80 0x10000002 +#define GLM_COMPILER_CUDA90 0x10000004 +#define GLM_COMPILER_CUDA_RTC 0x10000100 // Clang #define GLM_COMPILER_CLANG 0x20000000 @@ -114,9 +101,25 @@ #define GLM_COMPILER_CLANG37 0x20000080 #define GLM_COMPILER_CLANG38 0x20000090 #define GLM_COMPILER_CLANG39 0x200000A0 -#define GLM_COMPILER_CLANG40 0x200000B0 -#define GLM_COMPILER_CLANG41 0x200000C0 -#define GLM_COMPILER_CLANG42 0x200000D0 +#define GLM_COMPILER_CLANG4 0x200000B0 +#define GLM_COMPILER_CLANG5 0x200000C0 +#define GLM_COMPILER_CLANG6 0x200000D0 +#define GLM_COMPILER_CLANG7 0x200000E0 +#define GLM_COMPILER_CLANG8 0x200000F0 +#define GLM_COMPILER_CLANG9 0x20000100 +#define GLM_COMPILER_CLANG10 0x20000200 +#define GLM_COMPILER_CLANG11 0x20000300 +#define GLM_COMPILER_CLANG12 0x20000400 +#define GLM_COMPILER_CLANG13 0x20000500 +#define GLM_COMPILER_CLANG14 0x20000600 +#define GLM_COMPILER_CLANG15 0x20000700 +#define GLM_COMPILER_CLANG16 0x20000800 +#define GLM_COMPILER_CLANG17 0x20000900 +#define GLM_COMPILER_CLANG18 0x20000A00 +#define GLM_COMPILER_CLANG19 0x20000B00 + +// HIP +#define GLM_COMPILER_HIP 0x40000000 // Build model #define GLM_MODEL_32 0x00000010 @@ -127,16 +130,22 @@ # define GLM_COMPILER GLM_COMPILER_UNKNOWN #elif defined(__INTEL_COMPILER) -# if (__INTEL_COMPILER < 1400) -# error "GLM requires ICC 2013 SP1 or newer" -# elif __INTEL_COMPILER == 1400 -# define GLM_COMPILER GLM_COMPILER_INTEL14 -# elif __INTEL_COMPILER == 1500 -# define GLM_COMPILER GLM_COMPILER_INTEL15 -# elif __INTEL_COMPILER == 1600 -# define GLM_COMPILER GLM_COMPILER_INTEL16 +# if __INTEL_COMPILER >= 2021 +# define GLM_COMPILER GLM_COMPILER_INTEL21 +# elif __INTEL_COMPILER >= 1900 +# define GLM_COMPILER GLM_COMPILER_INTEL19 +# elif __INTEL_COMPILER >= 1800 +# define GLM_COMPILER GLM_COMPILER_INTEL18 # elif __INTEL_COMPILER >= 1700 # define GLM_COMPILER GLM_COMPILER_INTEL17 +# elif __INTEL_COMPILER >= 1600 +# define GLM_COMPILER GLM_COMPILER_INTEL16 +# elif __INTEL_COMPILER >= 1500 +# define GLM_COMPILER GLM_COMPILER_INTEL15 +# elif __INTEL_COMPILER >= 1400 +# define GLM_COMPILER GLM_COMPILER_INTEL14 +# elif __INTEL_COMPILER < 1400 +# error "GLM requires ICC 2013 SP1 or newer" # endif // CUDA @@ -144,16 +153,22 @@ # if !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA) # include // make sure version is defined since nvcc does not define it itself! # endif -# if CUDA_VERSION < 7000 -# error "GLM requires CUDA 7.0 or higher" -# elif (CUDA_VERSION >= 7000 && CUDA_VERSION < 7500) -# define GLM_COMPILER GLM_COMPILER_CUDA70 -# elif (CUDA_VERSION >= 7500 && CUDA_VERSION < 8000) -# define GLM_COMPILER GLM_COMPILER_CUDA75 -# elif (CUDA_VERSION >= 8000) +# if defined(__CUDACC_RTC__) +# define GLM_COMPILER GLM_COMPILER_CUDA_RTC +# elif CUDA_VERSION >= 8000 # define GLM_COMPILER GLM_COMPILER_CUDA80 +# elif CUDA_VERSION >= 7500 +# define GLM_COMPILER GLM_COMPILER_CUDA75 +# elif CUDA_VERSION >= 7000 +# define GLM_COMPILER GLM_COMPILER_CUDA70 +# elif CUDA_VERSION < 7000 +# error "GLM requires CUDA 7.0 or higher" # endif +// HIP +#elif defined(__HIP__) +# define GLM_COMPILER GLM_COMPILER_HIP + // Clang #elif defined(__clang__) # if defined(__apple_build_version__) @@ -182,48 +197,100 @@ # elif __clang_major__ == 3 && __clang_minor__ >= 9 # define GLM_COMPILER GLM_COMPILER_CLANG39 # elif __clang_major__ == 4 && __clang_minor__ == 0 -# define GLM_COMPILER GLM_COMPILER_CLANG40 -# elif __clang_major__ == 4 && __clang_minor__ == 1 -# define GLM_COMPILER GLM_COMPILER_CLANG41 -# elif __clang_major__ == 4 && __clang_minor__ >= 2 -# define GLM_COMPILER GLM_COMPILER_CLANG42 -# elif __clang_major__ >= 4 -# define GLM_COMPILER GLM_COMPILER_CLANG42 +# define GLM_COMPILER GLM_COMPILER_CLANG4 +# elif __clang_major__ == 5 +# define GLM_COMPILER GLM_COMPILER_CLANG5 +# elif __clang_major__ == 6 +# define GLM_COMPILER GLM_COMPILER_CLANG6 +# elif __clang_major__ == 7 +# define GLM_COMPILER GLM_COMPILER_CLANG7 +# elif __clang_major__ == 8 +# define GLM_COMPILER GLM_COMPILER_CLANG8 +# elif __clang_major__ == 9 +# define GLM_COMPILER GLM_COMPILER_CLANG9 +# elif __clang_major__ == 10 +# define GLM_COMPILER GLM_COMPILER_CLANG10 +# elif __clang_major__ == 11 +# define GLM_COMPILER GLM_COMPILER_CLANG11 +# elif __clang_major__ == 12 +# define GLM_COMPILER GLM_COMPILER_CLANG12 +# elif __clang_major__ == 13 +# define GLM_COMPILER GLM_COMPILER_CLANG13 +# elif __clang_major__ == 14 +# define GLM_COMPILER GLM_COMPILER_CLANG14 +# elif __clang_major__ == 15 +# define GLM_COMPILER GLM_COMPILER_CLANG15 +# elif __clang_major__ == 16 +# define GLM_COMPILER GLM_COMPILER_CLANG16 +# elif __clang_major__ == 17 +# define GLM_COMPILER GLM_COMPILER_CLANG17 +# elif __clang_major__ == 18 +# define GLM_COMPILER GLM_COMPILER_CLANG18 +# elif __clang_major__ >= 19 +# define GLM_COMPILER GLM_COMPILER_CLANG19 # endif # endif // Visual C++ #elif defined(_MSC_VER) -# if _MSC_VER < 1800 -# error "GLM requires Visual C++ 12 - 2013 or higher" -# elif _MSC_VER == 1800 -# define GLM_COMPILER GLM_COMPILER_VC12 -# elif _MSC_VER == 1900 -# define GLM_COMPILER GLM_COMPILER_VC14 +# if _MSC_VER >= 1930 +# define GLM_COMPILER GLM_COMPILER_VC17 +# elif _MSC_VER >= 1920 +# define GLM_COMPILER GLM_COMPILER_VC16 +# elif _MSC_VER >= 1916 +# define GLM_COMPILER GLM_COMPILER_VC15_9 +# elif _MSC_VER >= 1915 +# define GLM_COMPILER GLM_COMPILER_VC15_8 +# elif _MSC_VER >= 1914 +# define GLM_COMPILER GLM_COMPILER_VC15_7 +# elif _MSC_VER >= 1913 +# define GLM_COMPILER GLM_COMPILER_VC15_6 +# elif _MSC_VER >= 1912 +# define GLM_COMPILER GLM_COMPILER_VC15_5 +# elif _MSC_VER >= 1911 +# define GLM_COMPILER GLM_COMPILER_VC15_3 # elif _MSC_VER >= 1910 # define GLM_COMPILER GLM_COMPILER_VC15 +# elif _MSC_VER >= 1900 +# define GLM_COMPILER GLM_COMPILER_VC14 +# elif _MSC_VER >= 1800 +# define GLM_COMPILER GLM_COMPILER_VC12 +# elif _MSC_VER < 1800 +# error "GLM requires Visual C++ 12 - 2013 or higher" # endif//_MSC_VER // G++ #elif defined(__GNUC__) || defined(__MINGW32__) -# if ((__GNUC__ == 4) && (__GNUC_MINOR__ < 6)) || (__GNUC__ < 4) -# error "GLM requires GCC 4.7 or higher" -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6) -# define GLM_COMPILER (GLM_COMPILER_GCC46) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 7) -# define GLM_COMPILER (GLM_COMPILER_GCC47) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) -# define GLM_COMPILER (GLM_COMPILER_GCC48) -# elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) -# define GLM_COMPILER (GLM_COMPILER_GCC49) -# elif (__GNUC__ == 5) -# define GLM_COMPILER (GLM_COMPILER_GCC5) -# elif (__GNUC__ == 6) -# define GLM_COMPILER (GLM_COMPILER_GCC6) -# elif (__GNUC__ == 7) -# define GLM_COMPILER (GLM_COMPILER_GCC7) -# elif (__GNUC__ >= 8) -# define GLM_COMPILER (GLM_COMPILER_GCC8) +# if __GNUC__ >= 14 +# define GLM_COMPILER GLM_COMPILER_GCC14 +# elif __GNUC__ >= 13 +# define GLM_COMPILER GLM_COMPILER_GCC13 +# elif __GNUC__ >= 12 +# define GLM_COMPILER GLM_COMPILER_GCC12 +# elif __GNUC__ >= 11 +# define GLM_COMPILER GLM_COMPILER_GCC11 +# elif __GNUC__ >= 10 +# define GLM_COMPILER GLM_COMPILER_GCC10 +# elif __GNUC__ >= 9 +# define GLM_COMPILER GLM_COMPILER_GCC9 +# elif __GNUC__ >= 8 +# define GLM_COMPILER GLM_COMPILER_GCC8 +# elif __GNUC__ >= 7 +# define GLM_COMPILER GLM_COMPILER_GCC7 +# elif __GNUC__ >= 6 +# define GLM_COMPILER GLM_COMPILER_GCC6 +# elif __GNUC__ >= 5 +# define GLM_COMPILER GLM_COMPILER_GCC5 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 +# define GLM_COMPILER GLM_COMPILER_GCC49 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 8 +# define GLM_COMPILER GLM_COMPILER_GCC48 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 7 +# define GLM_COMPILER GLM_COMPILER_GCC47 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 6 +# define GLM_COMPILER GLM_COMPILER_GCC46 +# elif ((__GNUC__ == 4) && (__GNUC_MINOR__ < 6)) || (__GNUC__ < 4) +# error "GLM requires GCC 4.6 or higher" # endif #else @@ -237,66 +304,77 @@ /////////////////////////////////////////////////////////////////////////////////// // Instruction sets -// User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2 - -#define GLM_ARCH_X86_BIT 0x00000001 -#define GLM_ARCH_SSE2_BIT 0x00000002 -#define GLM_ARCH_SSE3_BIT 0x00000004 -#define GLM_ARCH_SSSE3_BIT 0x00000008 -#define GLM_ARCH_SSE41_BIT 0x00000010 -#define GLM_ARCH_SSE42_BIT 0x00000020 -#define GLM_ARCH_AVX_BIT 0x00000040 -#define GLM_ARCH_AVX2_BIT 0x00000080 -#define GLM_ARCH_AVX512_BIT 0x00000200 // Skylake subset -#define GLM_ARCH_ARM_BIT 0x00000400 -#define GLM_ARCH_NEON_BIT 0x00000800 -#define GLM_ARCH_MIPS_BIT 0x00010000 -#define GLM_ARCH_PPC_BIT 0x01000000 - -#define GLM_ARCH_PURE (0x00000000) +// User defines: GLM_FORCE_PURE GLM_FORCE_INTRINSICS GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2 + +#define GLM_ARCH_MIPS_BIT (0x10000000) +#define GLM_ARCH_PPC_BIT (0x20000000) +#define GLM_ARCH_ARM_BIT (0x40000000) +#define GLM_ARCH_ARMV8_BIT (0x01000000) +#define GLM_ARCH_X86_BIT (0x80000000) + +#define GLM_ARCH_SIMD_BIT (0x00001000) + +#define GLM_ARCH_NEON_BIT (0x00000001) +#define GLM_ARCH_SSE_BIT (0x00000002) +#define GLM_ARCH_SSE2_BIT (0x00000004) +#define GLM_ARCH_SSE3_BIT (0x00000008) +#define GLM_ARCH_SSSE3_BIT (0x00000010) +#define GLM_ARCH_SSE41_BIT (0x00000020) +#define GLM_ARCH_SSE42_BIT (0x00000040) +#define GLM_ARCH_AVX_BIT (0x00000080) +#define GLM_ARCH_AVX2_BIT (0x00000100) + +#define GLM_ARCH_UNKNOWN (0) #define GLM_ARCH_X86 (GLM_ARCH_X86_BIT) -#define GLM_ARCH_SSE2 (GLM_ARCH_SSE2_BIT | GLM_ARCH_X86) +#define GLM_ARCH_SSE (GLM_ARCH_SSE_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_X86) +#define GLM_ARCH_SSE2 (GLM_ARCH_SSE2_BIT | GLM_ARCH_SSE) #define GLM_ARCH_SSE3 (GLM_ARCH_SSE3_BIT | GLM_ARCH_SSE2) #define GLM_ARCH_SSSE3 (GLM_ARCH_SSSE3_BIT | GLM_ARCH_SSE3) #define GLM_ARCH_SSE41 (GLM_ARCH_SSE41_BIT | GLM_ARCH_SSSE3) #define GLM_ARCH_SSE42 (GLM_ARCH_SSE42_BIT | GLM_ARCH_SSE41) #define GLM_ARCH_AVX (GLM_ARCH_AVX_BIT | GLM_ARCH_SSE42) #define GLM_ARCH_AVX2 (GLM_ARCH_AVX2_BIT | GLM_ARCH_AVX) -#define GLM_ARCH_AVX512 (GLM_ARCH_AVX512_BIT | GLM_ARCH_AVX2) // Skylake subset #define GLM_ARCH_ARM (GLM_ARCH_ARM_BIT) -#define GLM_ARCH_NEON (GLM_ARCH_NEON_BIT | GLM_ARCH_ARM) +#define GLM_ARCH_ARMV8 (GLM_ARCH_NEON_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_ARM | GLM_ARCH_ARMV8_BIT) +#define GLM_ARCH_NEON (GLM_ARCH_NEON_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_ARM) #define GLM_ARCH_MIPS (GLM_ARCH_MIPS_BIT) #define GLM_ARCH_PPC (GLM_ARCH_PPC_BIT) -#if defined(GLM_FORCE_PURE) -# define GLM_ARCH GLM_ARCH_PURE -#elif defined(GLM_FORCE_MIPS) -# define GLM_ARCH (GLM_ARCH_MIPS) -#elif defined(GLM_FORCE_PPC) -# define GLM_ARCH (GLM_ARCH_PPC) +#if defined(GLM_FORCE_ARCH_UNKNOWN) || defined(GLM_FORCE_PURE) +# define GLM_ARCH GLM_ARCH_UNKNOWN #elif defined(GLM_FORCE_NEON) -# define GLM_ARCH (GLM_ARCH_NEON) -#elif defined(GLM_FORCE_AVX512) -# define GLM_ARCH (GLM_ARCH_AVX512) +# if __ARM_ARCH >= 8 +# define GLM_ARCH (GLM_ARCH_ARMV8) +# else +# define GLM_ARCH (GLM_ARCH_NEON) +# endif +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_AVX2) # define GLM_ARCH (GLM_ARCH_AVX2) +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_AVX) # define GLM_ARCH (GLM_ARCH_AVX) +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE42) # define GLM_ARCH (GLM_ARCH_SSE42) +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE41) # define GLM_ARCH (GLM_ARCH_SSE41) +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSSE3) # define GLM_ARCH (GLM_ARCH_SSSE3) +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE3) # define GLM_ARCH (GLM_ARCH_SSE3) +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE2) # define GLM_ARCH (GLM_ARCH_SSE2) -#elif (GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) -// This is Skylake set of instruction set -# if defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512CD__) && defined(__AVX512VL__) && defined(__AVX512DQ__) -# define GLM_ARCH (GLM_ARCH_AVX512) -# elif defined(__AVX2__) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE) +# define GLM_ARCH (GLM_ARCH_SSE) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_INTRINSICS) && !defined(GLM_FORCE_XYZW_ONLY) +# if defined(__AVX2__) # define GLM_ARCH (GLM_ARCH_AVX2) # elif defined(__AVX__) # define GLM_ARCH (GLM_ARCH_AVX) @@ -308,50 +386,35 @@ # define GLM_ARCH (GLM_ARCH_SSSE3) # elif defined(__SSE3__) # define GLM_ARCH (GLM_ARCH_SSE3) -# elif defined(__SSE2__) +# elif defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86_FP) # define GLM_ARCH (GLM_ARCH_SSE2) -# elif defined(__i386__) || defined(__x86_64__) +# elif defined(__i386__) # define GLM_ARCH (GLM_ARCH_X86) +# elif defined(__ARM_ARCH) && (__ARM_ARCH >= 8) +# define GLM_ARCH (GLM_ARCH_ARMV8) # elif defined(__ARM_NEON) # define GLM_ARCH (GLM_ARCH_ARM | GLM_ARCH_NEON) -# elif defined(__arm__ ) +# elif defined(__arm__ ) || defined(_M_ARM) # define GLM_ARCH (GLM_ARCH_ARM) # elif defined(__mips__ ) # define GLM_ARCH (GLM_ARCH_MIPS) -# elif defined(__powerpc__ ) +# elif defined(__powerpc__ ) || defined(_M_PPC) # define GLM_ARCH (GLM_ARCH_PPC) # else -# define GLM_ARCH (GLM_ARCH_PURE) +# define GLM_ARCH (GLM_ARCH_UNKNOWN) # endif -#elif (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) -# if defined(_M_ARM) +#else +# if defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86) || defined(__i386__) +# define GLM_ARCH (GLM_ARCH_X86) +# elif defined(__arm__) || defined(_M_ARM) # define GLM_ARCH (GLM_ARCH_ARM) -# elif defined(__AVX2__) -# define GLM_ARCH (GLM_ARCH_AVX2) -# elif defined(__AVX__) -# define GLM_ARCH (GLM_ARCH_AVX) -# elif defined(_M_X64) -# define GLM_ARCH (GLM_ARCH_SSE2) -# elif defined(_M_IX86_FP) -# if _M_IX86_FP >= 2 -# define GLM_ARCH (GLM_ARCH_SSE2) -# else -# define GLM_ARCH (GLM_ARCH_PURE) -# endif -# elif defined(_M_PPC) +# elif defined(__powerpc__) || defined(_M_PPC) # define GLM_ARCH (GLM_ARCH_PPC) +# elif defined(__mips__) +# define GLM_ARCH (GLM_ARCH_MIPS) # else -# define GLM_ARCH (GLM_ARCH_PURE) +# define GLM_ARCH (GLM_ARCH_UNKNOWN) # endif -#else -# define GLM_ARCH GLM_ARCH_PURE -#endif - -// With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is -// that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems. -// To fix, we just explicitly include intrin.h here. -#if defined(__MINGW64__) && (GLM_ARCH != GLM_ARCH_PURE) -# include #endif #if GLM_ARCH & GLM_ARCH_AVX2_BIT @@ -371,19 +434,36 @@ # include #elif GLM_ARCH & GLM_ARCH_SSE2_BIT # include +#elif GLM_ARCH & GLM_ARCH_NEON_BIT +# include "neon.h" #endif//GLM_ARCH #if GLM_ARCH & GLM_ARCH_SSE2_BIT - typedef __m128 glm_vec4; - typedef __m128i glm_ivec4; - typedef __m128i glm_uvec4; + typedef __m128 glm_f32vec4; + typedef __m128i glm_i32vec4; + typedef __m128i glm_u32vec4; + typedef __m128d glm_f64vec2; + typedef __m128i glm_i64vec2; + typedef __m128i glm_u64vec2; + + typedef glm_f32vec4 glm_vec4; + typedef glm_i32vec4 glm_ivec4; + typedef glm_u32vec4 glm_uvec4; + typedef glm_f64vec2 glm_dvec2; #endif #if GLM_ARCH & GLM_ARCH_AVX_BIT - typedef __m256d glm_dvec4; + typedef __m256d glm_f64vec4; + typedef glm_f64vec4 glm_dvec4; #endif #if GLM_ARCH & GLM_ARCH_AVX2_BIT - typedef __m256i glm_i64vec4; - typedef __m256i glm_u64vec4; + typedef __m256i glm_i64vec4; + typedef __m256i glm_u64vec4; +#endif + +#if GLM_ARCH & GLM_ARCH_NEON_BIT + typedef float32x4_t glm_f32vec4; + typedef int32x4_t glm_i32vec4; + typedef uint32x4_t glm_u32vec4; #endif diff --git a/vendor/glm/simd/trigonometric.h b/vendor/glm/simd/trigonometric.h old mode 100755 new mode 100644 diff --git a/vendor/glm/simd/vector_relational.h b/vendor/glm/simd/vector_relational.h old mode 100755 new mode 100644 diff --git a/vendor/glm/trigonometric.hpp b/vendor/glm/trigonometric.hpp old mode 100755 new mode 100644 index 15caadb6e5..51d49c132b --- a/vendor/glm/trigonometric.hpp +++ b/vendor/glm/trigonometric.hpp @@ -6,13 +6,15 @@ /// @defgroup core_func_trigonometric Angle and Trigonometry Functions /// @ingroup core /// -/// Include to use these core features. -/// /// Function parameters specified as angle are assumed to be in units of radians. /// In no case will any of these functions result in a divide by zero error. If /// the divisor of a ratio is 0, then results will be undefined. /// /// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. +/// +/// @see ext_vector_trigonometric #pragma once @@ -94,7 +96,7 @@ namespace glm template GLM_FUNC_DECL vec asin(vec const& x); - /// Arc cosine. Returns an angle whose sine is x. + /// Arc cosine. Returns an angle whose cosine is x. /// The range of values returned by this function is [0, PI]. /// Results are undefined if |x| > 1. /// diff --git a/vendor/glm/vec2.hpp b/vendor/glm/vec2.hpp old mode 100755 new mode 100644 index 8f5bf60147..cd4e0708e1 --- a/vendor/glm/vec2.hpp +++ b/vendor/glm/vec2.hpp @@ -1,8 +1,14 @@ /// @ref core /// @file glm/vec2.hpp -#include "detail/setup.hpp" - #pragma once - -#include "detail/type_vec2.hpp" +#include "./ext/vector_bool2.hpp" +#include "./ext/vector_bool2_precision.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float2_precision.hpp" +#include "./ext/vector_double2.hpp" +#include "./ext/vector_double2_precision.hpp" +#include "./ext/vector_int2.hpp" +#include "./ext/vector_int2_sized.hpp" +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_uint2_sized.hpp" diff --git a/vendor/glm/vec3.hpp b/vendor/glm/vec3.hpp old mode 100755 new mode 100644 index d2aedd1b2e..f5a927dbe4 --- a/vendor/glm/vec3.hpp +++ b/vendor/glm/vec3.hpp @@ -1,8 +1,14 @@ /// @ref core /// @file glm/vec3.hpp -#include "detail/setup.hpp" - #pragma once - -#include "detail/type_vec3.hpp" +#include "./ext/vector_bool3.hpp" +#include "./ext/vector_bool3_precision.hpp" +#include "./ext/vector_float3.hpp" +#include "./ext/vector_float3_precision.hpp" +#include "./ext/vector_double3.hpp" +#include "./ext/vector_double3_precision.hpp" +#include "./ext/vector_int3.hpp" +#include "./ext/vector_int3_sized.hpp" +#include "./ext/vector_uint3.hpp" +#include "./ext/vector_uint3_sized.hpp" diff --git a/vendor/glm/vec4.hpp b/vendor/glm/vec4.hpp old mode 100755 new mode 100644 index 428b54153a..c6ea9f1ff4 --- a/vendor/glm/vec4.hpp +++ b/vendor/glm/vec4.hpp @@ -1,8 +1,15 @@ /// @ref core /// @file glm/vec4.hpp -#include "detail/setup.hpp" - #pragma once +#include "./ext/vector_bool4.hpp" +#include "./ext/vector_bool4_precision.hpp" +#include "./ext/vector_float4.hpp" +#include "./ext/vector_float4_precision.hpp" +#include "./ext/vector_double4.hpp" +#include "./ext/vector_double4_precision.hpp" +#include "./ext/vector_int4.hpp" +#include "./ext/vector_int4_sized.hpp" +#include "./ext/vector_uint4.hpp" +#include "./ext/vector_uint4_sized.hpp" -#include "detail/type_vec4.hpp" diff --git a/vendor/glm/vector_relational.hpp b/vendor/glm/vector_relational.hpp old mode 100755 new mode 100644 index ed996710b9..a0fe17eb70 --- a/vendor/glm/vector_relational.hpp +++ b/vendor/glm/vector_relational.hpp @@ -6,14 +6,16 @@ /// @defgroup core_func_vector_relational Vector Relational Functions /// @ingroup core /// -/// Include to use these core features. -/// /// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to /// operate on scalars and produce scalar Boolean results. For vector results, /// use the following built-in functions. /// /// In all cases, the sizes of all the input and return vectors for any particular /// call must match. +/// +/// Include to use these core features. +/// +/// @see ext_vector_relational #pragma once @@ -33,7 +35,7 @@ namespace glm /// @see GLSL lessThan man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL vec lessThan(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec lessThan(vec const& x, vec const& y); /// Returns the component-wise comparison of result x <= y. /// @@ -43,7 +45,7 @@ namespace glm /// @see GLSL lessThanEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL vec lessThanEqual(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec lessThanEqual(vec const& x, vec const& y); /// Returns the component-wise comparison of result x > y. /// @@ -53,7 +55,7 @@ namespace glm /// @see GLSL greaterThan man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL vec greaterThan(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec greaterThan(vec const& x, vec const& y); /// Returns the component-wise comparison of result x >= y. /// @@ -63,7 +65,7 @@ namespace glm /// @see GLSL greaterThanEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL vec greaterThanEqual(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec greaterThanEqual(vec const& x, vec const& y); /// Returns the component-wise comparison of result x == y. /// @@ -73,7 +75,7 @@ namespace glm /// @see GLSL equal man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL vec equal(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y); /// Returns the component-wise comparison of result x != y. /// @@ -83,7 +85,7 @@ namespace glm /// @see GLSL notEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL vec notEqual(vec const& x, vec const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y); /// Returns true if any component of x is true. /// @@ -92,7 +94,7 @@ namespace glm /// @see GLSL any man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL bool any(vec const& v); + GLM_FUNC_DECL GLM_CONSTEXPR bool any(vec const& v); /// Returns true if all components of x are true. /// @@ -101,7 +103,7 @@ namespace glm /// @see GLSL all man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL bool all(vec const& v); + GLM_FUNC_DECL GLM_CONSTEXPR bool all(vec const& v); /// Returns the component-wise logical complement of x. /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. @@ -111,7 +113,7 @@ namespace glm /// @see GLSL not man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - GLM_FUNC_DECL vec not_(vec const& v); + GLM_FUNC_DECL GLM_CONSTEXPR vec not_(vec const& v); /// @} }//namespace glm