From 8d888a704afadbd40907951dba461de470a3efbf Mon Sep 17 00:00:00 2001 From: Mark Fine Date: Thu, 15 Aug 2024 17:42:42 +0000 Subject: [PATCH] ARCore Android SDK v1.45.0 --- libraries/include/arcore_c_api.h | 40 +- samples/augmented_faces_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/augmented_image_c/app/build.gradle | 4 +- samples/augmented_image_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/cloud_anchor_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/computervision_c/app/build.gradle | 4 +- samples/computervision_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/geospatial_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/hardwarebuffer_c/app/build.gradle | 4 +- samples/hardwarebuffer_java/app/build.gradle | 4 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/hello_ar_c/app/build.gradle | 4 +- samples/hello_ar_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/hello_ar_kotlin/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/hello_ar_vulkan_c/app/build.gradle | 4 +- samples/hello_eis_kotlin/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/ml_kotlin/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + .../app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/raw_depth_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + .../recording_playback_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + samples/semantics_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + .../HelloSemanticsActivity.java | 6 +- samples/shared_camera_java/app/build.gradle | 2 +- .../java/common/helpers/SnackbarHelper.java | 5 + third_party/glm/common.hpp | 18 +- third_party/glm/detail/_swizzle.hpp | 10 +- third_party/glm/detail/_swizzle_func.hpp | 12 +- third_party/glm/detail/compute_common.hpp | 6 +- .../glm/detail/compute_vector_decl.hpp | 190 +++ third_party/glm/detail/func_common.inl | 124 +- third_party/glm/detail/func_exponential.inl | 8 +- third_party/glm/detail/func_geometric.inl | 16 +- third_party/glm/detail/func_integer.inl | 26 +- third_party/glm/detail/func_integer_simd.inl | 6 +- third_party/glm/detail/func_matrix.inl | 89 +- third_party/glm/detail/func_matrix_simd.inl | 11 +- third_party/glm/detail/func_trigonometric.inl | 16 +- third_party/glm/detail/qualifier.hpp | 1 - third_party/glm/detail/setup.hpp | 231 ++-- third_party/glm/detail/type_half.inl | 2 +- third_party/glm/detail/type_mat2x2.hpp | 106 +- third_party/glm/detail/type_mat2x2.inl | 84 +- third_party/glm/detail/type_mat2x3.hpp | 92 +- third_party/glm/detail/type_mat2x3.inl | 70 +- third_party/glm/detail/type_mat2x4.hpp | 92 +- third_party/glm/detail/type_mat2x4.inl | 70 +- third_party/glm/detail/type_mat3x2.hpp | 92 +- third_party/glm/detail/type_mat3x2.inl | 68 +- third_party/glm/detail/type_mat3x3.hpp | 104 +- third_party/glm/detail/type_mat3x3.inl | 80 +- third_party/glm/detail/type_mat3x4.hpp | 92 +- third_party/glm/detail/type_mat3x4.inl | 68 +- third_party/glm/detail/type_mat4x2.hpp | 92 +- third_party/glm/detail/type_mat4x2.inl | 68 +- third_party/glm/detail/type_mat4x3.hpp | 92 +- third_party/glm/detail/type_mat4x3.inl | 118 +- third_party/glm/detail/type_mat4x4.hpp | 106 +- third_party/glm/detail/type_mat4x4.inl | 148 +-- third_party/glm/detail/type_quat.hpp | 81 +- third_party/glm/detail/type_quat.inl | 48 +- third_party/glm/detail/type_quat_simd.inl | 68 +- third_party/glm/detail/type_vec1.hpp | 66 +- third_party/glm/detail/type_vec1.inl | 12 +- third_party/glm/detail/type_vec2.hpp | 99 +- third_party/glm/detail/type_vec2.inl | 14 +- third_party/glm/detail/type_vec3.hpp | 118 +- third_party/glm/detail/type_vec3.inl | 14 +- third_party/glm/detail/type_vec4.hpp | 135 +-- third_party/glm/detail/type_vec4.inl | 22 +- third_party/glm/detail/type_vec4_simd.inl | 935 +++++++-------- third_party/glm/detail/type_vec_simd.inl | 1032 +++++++++++++++++ third_party/glm/exponential.hpp | 2 +- third_party/glm/ext.hpp | 16 +- third_party/glm/ext/_matrix_vectorize.hpp | 128 ++ third_party/glm/ext/matrix_clip_space.hpp | 42 +- third_party/glm/ext/matrix_clip_space.inl | 60 +- third_party/glm/ext/matrix_common.hpp | 5 +- third_party/glm/ext/matrix_common.inl | 18 + third_party/glm/ext/matrix_float3x2.hpp | 2 +- third_party/glm/ext/matrix_integer.hpp | 91 ++ third_party/glm/ext/matrix_integer.inl | 38 + third_party/glm/ext/matrix_relational.inl | 20 +- third_party/glm/ext/matrix_transform.hpp | 35 +- third_party/glm/ext/matrix_transform.inl | 65 +- third_party/glm/ext/matrix_uint2x3.hpp | 2 +- third_party/glm/ext/matrix_uint2x4_sized.hpp | 2 +- third_party/glm/ext/matrix_uint3x2.hpp | 2 +- third_party/glm/ext/quaternion_common.hpp | 6 +- third_party/glm/ext/quaternion_common.inl | 28 +- .../glm/ext/quaternion_exponential.inl | 20 +- third_party/glm/ext/quaternion_geometric.hpp | 6 +- third_party/glm/ext/quaternion_geometric.inl | 12 +- third_party/glm/ext/quaternion_transform.inl | 2 +- .../glm/ext/quaternion_trigonometric.hpp | 2 + .../glm/ext/quaternion_trigonometric.inl | 5 +- third_party/glm/ext/scalar_common.hpp | 24 + third_party/glm/ext/scalar_common.inl | 32 +- third_party/glm/ext/scalar_constants.inl | 4 +- third_party/glm/ext/scalar_integer.inl | 4 +- third_party/glm/ext/scalar_reciprocal.hpp | 135 +++ third_party/glm/ext/scalar_reciprocal.inl | 107 ++ third_party/glm/ext/scalar_relational.hpp | 3 + third_party/glm/ext/scalar_ulp.hpp | 3 + third_party/glm/ext/scalar_ulp.inl | 19 +- third_party/glm/ext/vector_common.hpp | 24 + third_party/glm/ext/vector_common.inl | 26 +- third_party/glm/ext/vector_integer.inl | 4 +- third_party/glm/ext/vector_reciprocal.hpp | 135 +++ third_party/glm/ext/vector_reciprocal.inl | 105 ++ third_party/glm/ext/vector_relational.inl | 2 +- third_party/glm/ext/vector_ulp.hpp | 3 + third_party/glm/ext/vector_ulp.inl | 16 +- third_party/glm/fwd.hpp | 120 +- third_party/glm/geometric.hpp | 6 +- third_party/glm/glm.hpp | 51 +- third_party/glm/gtc/bitfield.inl | 9 + third_party/glm/gtc/constants.hpp | 7 +- third_party/glm/gtc/constants.inl | 6 + third_party/glm/gtc/integer.hpp | 30 +- third_party/glm/gtc/integer.inl | 35 - third_party/glm/gtc/matrix_inverse.hpp | 6 +- third_party/glm/gtc/noise.inl | 14 +- third_party/glm/gtc/packing.inl | 35 +- third_party/glm/gtc/quaternion.hpp | 8 +- third_party/glm/gtc/quaternion.inl | 34 +- third_party/glm/gtc/random.hpp | 8 +- third_party/glm/gtc/random.inl | 2 +- third_party/glm/gtc/reciprocal.hpp | 115 +- third_party/glm/gtc/reciprocal.inl | 191 --- third_party/glm/gtc/type_ptr.hpp | 4 +- third_party/glm/gtc/type_ptr.inl | 32 +- third_party/glm/gtc/ulp.hpp | 3 + third_party/glm/gtc/ulp.inl | 4 +- third_party/glm/gtx/associated_min_max.hpp | 18 +- third_party/glm/gtx/associated_min_max.inl | 6 +- third_party/glm/gtx/bit.hpp | 10 +- third_party/glm/gtx/closest_point.hpp | 10 +- third_party/glm/gtx/color_encoding.hpp | 10 +- third_party/glm/gtx/color_space.hpp | 10 +- third_party/glm/gtx/color_space.inl | 17 +- third_party/glm/gtx/color_space_YCoCg.hpp | 10 +- third_party/glm/gtx/common.hpp | 10 +- third_party/glm/gtx/common.inl | 10 +- third_party/glm/gtx/compatibility.hpp | 20 +- third_party/glm/gtx/component_wise.hpp | 20 +- third_party/glm/gtx/component_wise.inl | 20 + third_party/glm/gtx/dual_quaternion.hpp | 36 +- third_party/glm/gtx/dual_quaternion.inl | 22 +- third_party/glm/gtx/easing.hpp | 12 +- third_party/glm/gtx/easing.inl | 2 +- third_party/glm/gtx/euler_angles.hpp | 34 +- third_party/glm/gtx/euler_angles.inl | 84 +- third_party/glm/gtx/extend.hpp | 10 +- third_party/glm/gtx/extended_min_max.hpp | 14 +- third_party/glm/gtx/exterior_product.hpp | 12 +- third_party/glm/gtx/exterior_product.inl | 6 +- third_party/glm/gtx/fast_exponential.hpp | 10 +- third_party/glm/gtx/fast_exponential.inl | 4 +- third_party/glm/gtx/fast_square_root.hpp | 18 +- third_party/glm/gtx/fast_square_root.inl | 6 +- third_party/glm/gtx/fast_trigonometry.hpp | 10 +- third_party/glm/gtx/float_normalize.inl | 13 + third_party/glm/gtx/functions.hpp | 10 +- third_party/glm/gtx/gradient_paint.hpp | 10 +- .../glm/gtx/handed_coordinate_space.hpp | 12 +- third_party/glm/gtx/hash.hpp | 76 +- third_party/glm/gtx/hash.inl | 59 +- third_party/glm/gtx/integer.hpp | 10 +- third_party/glm/gtx/integer.inl | 8 +- third_party/glm/gtx/intersect.hpp | 12 +- third_party/glm/gtx/intersect.inl | 22 +- third_party/glm/gtx/io.hpp | 75 +- third_party/glm/gtx/io.inl | 16 +- third_party/glm/gtx/log_base.hpp | 10 +- third_party/glm/gtx/matrix_cross_product.hpp | 10 +- third_party/glm/gtx/matrix_decompose.hpp | 18 +- third_party/glm/gtx/matrix_decompose.inl | 54 +- third_party/glm/gtx/matrix_factorisation.hpp | 14 +- third_party/glm/gtx/matrix_factorisation.inl | 6 +- third_party/glm/gtx/matrix_interpolation.hpp | 12 +- third_party/glm/gtx/matrix_interpolation.inl | 53 +- third_party/glm/gtx/matrix_major_storage.hpp | 10 +- third_party/glm/gtx/matrix_operation.hpp | 10 +- third_party/glm/gtx/matrix_operation.inl | 14 +- third_party/glm/gtx/matrix_query.hpp | 10 +- third_party/glm/gtx/matrix_query.inl | 26 +- third_party/glm/gtx/matrix_transform_2d.hpp | 10 +- third_party/glm/gtx/mixed_product.hpp | 10 +- third_party/glm/gtx/norm.hpp | 10 +- third_party/glm/gtx/norm.inl | 8 +- third_party/glm/gtx/normal.hpp | 10 +- third_party/glm/gtx/normalize_dot.hpp | 12 +- third_party/glm/gtx/number_precision.hpp | 25 +- third_party/glm/gtx/number_precision.inl | 6 - third_party/glm/gtx/optimum_pow.hpp | 14 +- third_party/glm/gtx/orthonormalize.hpp | 10 +- third_party/glm/gtx/pca.hpp | 112 ++ third_party/glm/gtx/pca.inl | 343 ++++++ third_party/glm/gtx/perpendicular.hpp | 10 +- third_party/glm/gtx/polar_coordinates.hpp | 10 +- third_party/glm/gtx/projection.hpp | 10 +- third_party/glm/gtx/quaternion.hpp | 24 +- third_party/glm/gtx/quaternion.inl | 10 +- third_party/glm/gtx/range.hpp | 10 +- third_party/glm/gtx/raw_data.hpp | 10 +- .../glm/gtx/rotate_normalized_axis.hpp | 10 +- .../glm/gtx/rotate_normalized_axis.inl | 2 +- third_party/glm/gtx/rotate_vector.hpp | 10 +- third_party/glm/gtx/scalar_multiplication.hpp | 19 +- third_party/glm/gtx/scalar_relational.hpp | 10 +- third_party/glm/gtx/spline.hpp | 10 +- third_party/glm/gtx/std_based_type.hpp | 10 +- third_party/glm/gtx/string_cast.hpp | 17 +- third_party/glm/gtx/string_cast.inl | 29 +- third_party/glm/gtx/texture.hpp | 10 +- third_party/glm/gtx/transform.hpp | 10 +- third_party/glm/gtx/transform2.hpp | 10 +- third_party/glm/gtx/transform2.inl | 2 +- third_party/glm/gtx/type_aligned.hpp | 10 +- third_party/glm/gtx/type_trait.hpp | 10 +- third_party/glm/gtx/vec_swizzle.hpp | 984 ++++++++-------- third_party/glm/gtx/vector_angle.hpp | 10 +- third_party/glm/gtx/vector_angle.inl | 11 +- third_party/glm/gtx/vector_query.hpp | 12 +- third_party/glm/gtx/wrap.hpp | 10 +- third_party/glm/integer.hpp | 4 +- third_party/glm/manual.md | 331 +++--- third_party/glm/matrix.hpp | 10 +- third_party/glm/readme.md | 475 +++++--- third_party/glm/simd/common.h | 67 +- third_party/glm/simd/exponential.h | 10 +- third_party/glm/simd/geometric.h | 24 +- third_party/glm/simd/integer.h | 4 +- third_party/glm/simd/matrix.h | 164 ++- third_party/glm/simd/neon.h | 306 ++--- third_party/glm/simd/platform.h | 383 +++--- third_party/glm/trigonometric.hpp | 2 +- 250 files changed, 7345 insertions(+), 4506 deletions(-) create mode 100644 third_party/glm/detail/compute_vector_decl.hpp create mode 100644 third_party/glm/detail/type_vec_simd.inl create mode 100644 third_party/glm/ext/_matrix_vectorize.hpp create mode 100644 third_party/glm/ext/matrix_integer.hpp create mode 100644 third_party/glm/ext/matrix_integer.inl create mode 100644 third_party/glm/ext/scalar_reciprocal.hpp create mode 100644 third_party/glm/ext/scalar_reciprocal.inl create mode 100644 third_party/glm/ext/vector_reciprocal.hpp create mode 100644 third_party/glm/ext/vector_reciprocal.inl delete mode 100644 third_party/glm/gtc/reciprocal.inl create mode 100644 third_party/glm/gtx/float_normalize.inl delete mode 100644 third_party/glm/gtx/number_precision.inl create mode 100644 third_party/glm/gtx/pca.hpp create mode 100644 third_party/glm/gtx/pca.inl diff --git a/libraries/include/arcore_c_api.h b/libraries/include/arcore_c_api.h index 9b74c82da7..d0cff3d198 100644 --- a/libraries/include/arcore_c_api.h +++ b/libraries/include/arcore_c_api.h @@ -1331,6 +1331,15 @@ AR_DEFINE_ENUM(ArFocusMode){/// Focus is fixed. /// Auto-focus is enabled. AR_FOCUS_MODE_AUTO = 1}; +/// @ingroup ArConfig +/// Selects the desired behavior of the camera flash subsystem. See the documentation +/// page for more information on using the device's flash. +AR_DEFINE_ENUM(ArFlashMode){/// Flash is off. + AR_FLASH_MODE_OFF = 0, + /// Flash is on. + AR_FLASH_MODE_TORCH = 2}; + /// @ingroup ArConfig /// Describes the behavior of the Electronic Image Stabilization (EIS) API. When /// enabled, EIS smoothes the camera feed and helps correct video shakes in the @@ -2504,6 +2513,33 @@ void ArConfig_getFocusMode(const ArSession *session, ArConfig *config, ArFocusMode *focus_mode); +/// @ingroup ArConfig +/// Gets the current camera flash mode set on this config object. +/// +/// @param[in] session The ARCore session. +/// @param[in] config The configuration object. +/// @param[inout] out_flash_mode The current camera flash mode. +void ArConfig_getFlashMode(const ArSession *session, + const ArConfig *config, + ArFlashMode *out_flash_mode); + +/// @ingroup ArConfig +/// Sets the camera flash mode. +/// +/// See @c ::ArFlashMode for available options. The default flash +/// mode is @c #AR_FLASH_MODE_OFF. Note, on devices where camera flash hardware +/// is not supported, calling this function will do nothing. +/// See the documentation +/// page for more information on how to query device flash capability. +/// +/// @param[in] session The ARCore session. +/// @param[in] config The configuration object. +/// @param[in] flash_mode The desired camera flash mode. +void ArConfig_setFlashMode(const ArSession *session, + ArConfig *config, + ArFlashMode flash_mode); + /// @ingroup ArConfig /// Gets the camera image stabilization mode set on this config /// object. @@ -7675,7 +7711,7 @@ typedef struct ArImageMetadata_const_entry { /// The tag identifying the entry. uint32_t tag; /// The data type of this metadata entry. Determines which data pointer in the - /// @c union below is valid. + /// @c union below is valid. See @c ACAMERA_TYPE_* enum values in the NDK. uint8_t type; /// Count of elements (NOT count of bytes) in this metadata entry. uint32_t count; @@ -7728,7 +7764,7 @@ void ArImageMetadata_getAllKeys(const ArSession *session, /// Get a metadata entry for the provided @c ::ArImageMetadata and tag. /// /// The returned @p out_metadata_entry remains valid until the provided @p -/// image_metadata is released via @c ::ArFrame_acquireImageMetadata. +/// image_metadata is released via @c ::ArImageMetadata_release. /// /// @param[in] session The ARCore session. /// @param[in] image_metadata @c ::ArImageMetadata struct obtained from diff --git a/samples/augmented_faces_java/app/build.gradle b/samples/augmented_faces_java/app/build.gradle index 8486d040d3..5f155610c6 100644 --- a/samples/augmented_faces_java/app/build.gradle +++ b/samples/augmented_faces_java/app/build.gradle @@ -41,7 +41,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/augmented_faces_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/augmented_image_c/app/build.gradle b/samples/augmented_image_c/app/build.gradle index dc47f9281f..f5ffb81bfb 100644 --- a/samples/augmented_image_c/app/build.gradle +++ b/samples/augmented_image_c/app/build.gradle @@ -68,8 +68,8 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' - natives 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' + natives 'com.google.ar:core:1.45.0' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.1.0' diff --git a/samples/augmented_image_java/app/build.gradle b/samples/augmented_image_java/app/build.gradle index 8de766a773..21acb7e1a2 100644 --- a/samples/augmented_image_java/app/build.gradle +++ b/samples/augmented_image_java/app/build.gradle @@ -41,7 +41,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/augmented_image_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/cloud_anchor_java/app/build.gradle b/samples/cloud_anchor_java/app/build.gradle index 96b20303c4..7eff627159 100644 --- a/samples/cloud_anchor_java/app/build.gradle +++ b/samples/cloud_anchor_java/app/build.gradle @@ -41,7 +41,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/computervision_c/app/build.gradle b/samples/computervision_c/app/build.gradle index f5727ec7ab..f77f3f369f 100644 --- a/samples/computervision_c/app/build.gradle +++ b/samples/computervision_c/app/build.gradle @@ -68,8 +68,8 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' - natives 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' + natives 'com.google.ar:core:1.45.0' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.1.0' diff --git a/samples/computervision_java/app/build.gradle b/samples/computervision_java/app/build.gradle index ed8494f456..393f657524 100644 --- a/samples/computervision_java/app/build.gradle +++ b/samples/computervision_java/app/build.gradle @@ -41,7 +41,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/geospatial_java/app/build.gradle b/samples/geospatial_java/app/build.gradle index 9045a78eb0..349c68cf5f 100644 --- a/samples/geospatial_java/app/build.gradle +++ b/samples/geospatial_java/app/build.gradle @@ -41,7 +41,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' implementation 'com.google.android.gms:play-services-location:19.0.1' implementation 'com.google.android.gms:play-services-auth:19.0.0' diff --git a/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/hardwarebuffer_c/app/build.gradle b/samples/hardwarebuffer_c/app/build.gradle index acccc2f700..d06f8d9d3c 100644 --- a/samples/hardwarebuffer_c/app/build.gradle +++ b/samples/hardwarebuffer_c/app/build.gradle @@ -70,8 +70,8 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' - natives 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' + natives 'com.google.ar:core:1.45.0' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.1.0' diff --git a/samples/hardwarebuffer_java/app/build.gradle b/samples/hardwarebuffer_java/app/build.gradle index 4476dd6fa0..5296a6051d 100644 --- a/samples/hardwarebuffer_java/app/build.gradle +++ b/samples/hardwarebuffer_java/app/build.gradle @@ -66,8 +66,8 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' - natives 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' + natives 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/hello_ar_c/app/build.gradle b/samples/hello_ar_c/app/build.gradle index 25bd561066..e5711524cb 100644 --- a/samples/hello_ar_c/app/build.gradle +++ b/samples/hello_ar_c/app/build.gradle @@ -68,8 +68,8 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' - natives 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' + natives 'com.google.ar:core:1.45.0' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.1.0' diff --git a/samples/hello_ar_java/app/build.gradle b/samples/hello_ar_java/app/build.gradle index 7674997f13..ccd567456d 100644 --- a/samples/hello_ar_java/app/build.gradle +++ b/samples/hello_ar_java/app/build.gradle @@ -41,7 +41,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/hello_ar_kotlin/app/build.gradle b/samples/hello_ar_kotlin/app/build.gradle index 3d6cf522ad..deab2aad14 100644 --- a/samples/hello_ar_kotlin/app/build.gradle +++ b/samples/hello_ar_kotlin/app/build.gradle @@ -45,7 +45,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/hello_ar_vulkan_c/app/build.gradle b/samples/hello_ar_vulkan_c/app/build.gradle index 9264f94822..5bc4a20ff2 100644 --- a/samples/hello_ar_vulkan_c/app/build.gradle +++ b/samples/hello_ar_vulkan_c/app/build.gradle @@ -69,8 +69,8 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' - natives 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' + natives 'com.google.ar:core:1.45.0' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.1.0' diff --git a/samples/hello_eis_kotlin/app/build.gradle b/samples/hello_eis_kotlin/app/build.gradle index d86b883835..09e0c49858 100644 --- a/samples/hello_eis_kotlin/app/build.gradle +++ b/samples/hello_eis_kotlin/app/build.gradle @@ -45,7 +45,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/ml_kotlin/app/build.gradle b/samples/ml_kotlin/app/build.gradle index 7f54a29e7a..c2aa524288 100644 --- a/samples/ml_kotlin/app/build.gradle +++ b/samples/ml_kotlin/app/build.gradle @@ -69,7 +69,7 @@ dependencies { implementation 'com.google.mlkit:object-detection-custom:16.3.1' // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/persistent_cloud_anchor_java/app/build.gradle b/samples/persistent_cloud_anchor_java/app/build.gradle index a227a774b0..d228b32d67 100644 --- a/samples/persistent_cloud_anchor_java/app/build.gradle +++ b/samples/persistent_cloud_anchor_java/app/build.gradle @@ -45,7 +45,7 @@ repositories { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/persistent_cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/persistent_cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/persistent_cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/persistent_cloud_anchor_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/raw_depth_java/app/build.gradle b/samples/raw_depth_java/app/build.gradle index b4f9068c8a..962cc3020e 100644 --- a/samples/raw_depth_java/app/build.gradle +++ b/samples/raw_depth_java/app/build.gradle @@ -42,7 +42,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/raw_depth_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/raw_depth_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/raw_depth_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/raw_depth_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/recording_playback_java/app/build.gradle b/samples/recording_playback_java/app/build.gradle index c728e4d24c..16c95bd69f 100644 --- a/samples/recording_playback_java/app/build.gradle +++ b/samples/recording_playback_java/app/build.gradle @@ -41,7 +41,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/semantics_java/app/build.gradle b/samples/semantics_java/app/build.gradle index 9df67b4ebc..602bfbb3d1 100644 --- a/samples/semantics_java/app/build.gradle +++ b/samples/semantics_java/app/build.gradle @@ -41,7 +41,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/hellosemantics/HelloSemanticsActivity.java b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/hellosemantics/HelloSemanticsActivity.java index 6585d445db..53ea620618 100644 --- a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/hellosemantics/HelloSemanticsActivity.java +++ b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/hellosemantics/HelloSemanticsActivity.java @@ -333,10 +333,10 @@ public void onDrawFrame(SampleRender render) { message = TrackingStateHelper.getTrackingFailureReasonString(camera); } } - if (message == null) { - messageSnackbarHelper.hide(this); - } else { + if (message != null && !message.isEmpty()) { messageSnackbarHelper.showMessage(this, message); + } else if (messageSnackbarHelper.isDurationIndefinite()) { + messageSnackbarHelper.hide(this); } // -- Draw background diff --git a/samples/shared_camera_java/app/build.gradle b/samples/shared_camera_java/app/build.gradle index 97b2fd86f5..7564a133e4 100644 --- a/samples/shared_camera_java/app/build.gradle +++ b/samples/shared_camera_java/app/build.gradle @@ -42,7 +42,7 @@ android { dependencies { // ARCore (Google Play Services for AR) library. - implementation 'com.google.ar:core:1.44.0' + implementation 'com.google.ar:core:1.45.0' // Obj - a simple Wavefront OBJ file loader // https://github.com/javagl/Obj diff --git a/samples/shared_camera_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java b/samples/shared_camera_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java index cc493013ee..d251ec9683 100644 --- a/samples/shared_camera_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java +++ b/samples/shared_camera_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/SnackbarHelper.java @@ -92,6 +92,11 @@ public void setMaxLines(int lines) { maxLines = lines; } + /** Returns whether the snackbar is currently being shown with an indefinite duration. */ + public boolean isDurationIndefinite() { + return isShowing() && messageSnackbar.getDuration() == Snackbar.LENGTH_INDEFINITE; + } + /** * Sets the view that will be used to find a suitable parent view to hold the Snackbar view. * diff --git a/third_party/glm/common.hpp b/third_party/glm/common.hpp index 0328dc91ee..badaf0f522 100644 --- a/third_party/glm/common.hpp +++ b/third_party/glm/common.hpp @@ -51,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. /// @@ -291,7 +291,7 @@ namespace glm /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT. /// /// @code - /// #include + /// #include "third_party/glm/latest/glm/glm.hpp" /// ... /// float a; /// bool b; @@ -306,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. /// @@ -404,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 @@ -424,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 @@ -446,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. @@ -470,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. diff --git a/third_party/glm/detail/_swizzle.hpp b/third_party/glm/detail/_swizzle.hpp index 87896ef4f6..e1f57ccb77 100644 --- a/third_party/glm/detail/_swizzle.hpp +++ b/third_party/glm/detail/_swizzle.hpp @@ -8,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 @@ -113,12 +113,12 @@ namespace detail _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]); @@ -147,7 +147,7 @@ namespace detail 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]); diff --git a/third_party/glm/detail/_swizzle_func.hpp b/third_party/glm/detail/_swizzle_func.hpp index d93c6afd5b..a264ae9eff 100644 --- a/third_party/glm/detail/_swizzle_func.hpp +++ b/third_party/glm/detail/_swizzle_func.hpp @@ -1,40 +1,40 @@ #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/third_party/glm/detail/compute_common.hpp b/third_party/glm/detail/compute_common.hpp index cc24b9e62f..83362bc7b3 100644 --- a/third_party/glm/detail/compute_common.hpp +++ b/third_party/glm/detail/compute_common.hpp @@ -16,7 +16,7 @@ namespace detail GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) { GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || std::numeric_limits::is_signed, + 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; @@ -24,11 +24,11 @@ namespace detail } }; -#if GLM_COMPILER & GLM_COMPILER_CUDA +#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) template<> struct compute_abs { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x) + GLM_FUNC_QUALIFIER static float call(float x) { return fabsf(x); } diff --git a/third_party/glm/detail/compute_vector_decl.hpp b/third_party/glm/detail/compute_vector_decl.hpp new file mode 100644 index 0000000000..00d7de5e1d --- /dev/null +++ b/third_party/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; i < L; ++i) + b = b && detail::compute_equal::is_iec559>::call(v1.x, v2.x); + 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/third_party/glm/detail/func_common.inl b/third_party/glm/detail/func_common.inl index 4b5f14410f..f8584c9e87 100644 --- a/third_party/glm/detail/func_common.inl +++ b/third_party/glm/detail/func_common.inl @@ -16,7 +16,7 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType min(genType x, genType y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'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; } @@ -24,7 +24,7 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType max(genType x, genType y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'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; } @@ -44,7 +44,7 @@ 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))); } @@ -57,7 +57,7 @@ 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); } @@ -80,9 +80,9 @@ namespace detail template struct compute_mix_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x, vec const& y, vec const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_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) * (static_cast(1) - a) + vec(y) * a); } @@ -91,9 +91,9 @@ namespace detail template struct compute_mix_vector { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; @@ -103,9 +103,9 @@ namespace detail template struct compute_mix_scalar { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x, vec const& y, U const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_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) * (static_cast(1) - a) + vec(y) * a); } @@ -114,7 +114,7 @@ namespace detail template struct compute_mix_scalar { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, bool const& a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x, vec const& y, bool const& a) { return a ? y : x; } @@ -123,9 +123,9 @@ namespace detail template struct compute_mix { - GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(T const& x, T const& y, U const& a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_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) * (static_cast(1) - a) + static_cast(y) * a); } @@ -134,7 +134,7 @@ namespace detail template struct compute_mix { - GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, bool const& a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(T const& x, T const& y, bool const& a) { return a ? y : x; } @@ -143,7 +143,7 @@ namespace detail template struct compute_sign { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x) { return vec(glm::lessThan(vec(0), x)) - vec(glm::lessThan(x, vec(0))); } @@ -153,7 +153,7 @@ namespace detail template struct compute_sign { - GLM_FUNC_QUALIFIER static vec call(vec const& x) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x) { T const Shift(static_cast(sizeof(T) * 8 - 1)); vec const y(vec::type, Q>(-x) >> typename detail::make_unsigned::type(Shift)); @@ -213,7 +213,7 @@ 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); } }; @@ -259,7 +259,7 @@ 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_CONFIG_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"); vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); } @@ -281,10 +281,10 @@ 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, @@ -292,10 +292,10 @@ namespace detail } 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); @@ -306,21 +306,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); } @@ -329,7 +329,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))); } @@ -339,7 +339,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); @@ -370,7 +370,7 @@ 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"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs"); return detail::functor1::call(roundEven, x); } @@ -379,7 +379,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); } @@ -393,7 +393,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); } @@ -401,7 +401,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; @@ -426,7 +426,7 @@ namespace detail 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); } @@ -476,7 +476,7 @@ namespace detail template 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, "'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)); } @@ -490,7 +490,7 @@ namespace detail template 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, "'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)); } @@ -504,38 +504,38 @@ namespace detail template 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, "'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 GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'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 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, "'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); } @@ -563,7 +563,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_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); @@ -587,7 +587,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); @@ -601,7 +601,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); @@ -612,9 +612,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; @@ -626,7 +626,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); @@ -642,7 +642,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 @@ -654,15 +654,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 { @@ -678,10 +678,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 { @@ -697,10 +697,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 { @@ -716,10 +716,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 { @@ -751,7 +751,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'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); } @@ -759,9 +759,9 @@ namespace detail template GLM_FUNC_QUALIFIER vec frexp(vec const& v, vec& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'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; @@ -770,7 +770,7 @@ namespace detail template GLM_FUNC_QUALIFIER genType ldexp(genType const& x, int const& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'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); } @@ -778,9 +778,9 @@ namespace detail template GLM_FUNC_QUALIFIER vec ldexp(vec const& v, vec const& exp) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'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; diff --git a/third_party/glm/detail/func_exponential.inl b/third_party/glm/detail/func_exponential.inl index 2040d41f8a..2efcdc60ad 100644 --- a/third_party/glm/detail/func_exponential.inl +++ b/third_party/glm/detail/func_exponential.inl @@ -25,7 +25,7 @@ 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); } @@ -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); } @@ -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,7 +141,7 @@ 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 diff --git a/third_party/glm/detail/func_geometric.inl b/third_party/glm/detail/func_geometric.inl index 9cde28fed1..404c99056a 100644 --- a/third_party/glm/detail/func_geometric.inl +++ b/third_party/glm/detail/func_geometric.inl @@ -28,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; } @@ -37,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; @@ -47,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; @@ -57,7 +57,7 @@ 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); @@ -67,7 +67,7 @@ namespace detail 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"); @@ -157,14 +157,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); @@ -172,7 +172,7 @@ 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); } diff --git a/third_party/glm/detail/func_integer.inl b/third_party/glm/detail/func_integer.inl index 091e1e0c20..67177a0559 100644 --- a/third_party/glm/detail/func_integer.inl +++ b/third_party/glm/detail/func_integer.inl @@ -9,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 @@ -270,10 +272,15 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); - T const Mask = static_cast(detail::mask(Bits) << Offset); + 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 genIUType bitfieldReverse(genIUType x) @@ -298,6 +305,10 @@ namespace detail return x; } +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif + // bitCount template GLM_FUNC_QUALIFIER int bitCount(genIUType x) @@ -317,7 +328,7 @@ namespace detail # 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)); @@ -362,10 +373,19 @@ 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_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/third_party/glm/detail/func_integer_simd.inl b/third_party/glm/detail/func_integer_simd.inl index 8be6c9ce4d..5600c84993 100644 --- a/third_party/glm/detail/func_integer_simd.inl +++ b/third_party/glm/detail/func_integer_simd.inl @@ -14,11 +14,11 @@ namespace detail __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); @@ -35,7 +35,7 @@ namespace detail __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); diff --git a/third_party/glm/detail/func_matrix.inl b/third_party/glm/detail/func_matrix.inl index d980c6d388..081761f35b 100644 --- a/third_party/glm/detail/func_matrix.inl +++ b/third_party/glm/detail/func_matrix.inl @@ -9,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{}; @@ -24,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]; @@ -38,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]; @@ -54,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]; @@ -72,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]; @@ -88,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]; @@ -109,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]; @@ -131,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]; @@ -149,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]; @@ -171,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]; @@ -195,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{}; @@ -243,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{}; @@ -355,33 +408,25 @@ namespace detail template GLM_FUNC_QUALIFIER mat matrixCompMult(mat const& x, mat const& y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_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_CONFIG_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_CONFIG_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_CONFIG_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 diff --git a/third_party/glm/detail/func_matrix_simd.inl b/third_party/glm/detail/func_matrix_simd.inl index f67ac66ae2..b9bb4615de 100644 --- a/third_party/glm/detail/func_matrix_simd.inl +++ b/third_party/glm/detail/func_matrix_simd.inl @@ -18,9 +18,9 @@ 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; } }; @@ -121,8 +121,10 @@ namespace glm { } #endif // CXX11 +namespace detail +{ template - struct detail::compute_inverse<4, 4, float, Q, true> + 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) { @@ -245,5 +247,6 @@ namespace glm { return r; } }; +}//namespace detail }//namespace glm #endif diff --git a/third_party/glm/detail/func_trigonometric.inl b/third_party/glm/detail/func_trigonometric.inl index e129dceac5..9e6d9cfb1c 100644 --- a/third_party/glm/detail/func_trigonometric.inl +++ b/third_party/glm/detail/func_trigonometric.inl @@ -8,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); } @@ -23,7 +23,7 @@ namespace glm 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); } @@ -83,15 +83,15 @@ namespace glm 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; @@ -136,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)); } @@ -155,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); @@ -176,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; diff --git a/third_party/glm/detail/qualifier.hpp b/third_party/glm/detail/qualifier.hpp index b6c9df0ce0..a6c96cca5c 100644 --- a/third_party/glm/detail/qualifier.hpp +++ b/third_party/glm/detail/qualifier.hpp @@ -144,7 +144,6 @@ namespace detail typedef glm_u64vec2 type; }; # endif - # if (GLM_ARCH & GLM_ARCH_AVX_BIT) template<> struct storage<4, double, true> diff --git a/third_party/glm/detail/setup.hpp b/third_party/glm/detail/setup.hpp index 2c01e02fb4..76ad60985f 100644 --- a/third_party/glm/detail/setup.hpp +++ b/third_party/glm/detail/setup.hpp @@ -3,14 +3,24 @@ #include #include -#define GLM_VERSION_MAJOR 0 -#define GLM_VERSION_MINOR 9 -#define GLM_VERSION_PATCH 9 -#define GLM_VERSION_REVISION 8 -#define GLM_VERSION 998 -#define GLM_VERSION_MESSAGE "GLM: version 0.9.9.8" +#define GLM_VERSION_MAJOR 1 +#define GLM_VERSION_MINOR 0 +#define GLM_VERSION_PATCH 1 +#define GLM_VERSION_REVISION 0 // Deprecated +#define GLM_VERSION 1000 // Deprecated +#define GLM_VERSION_MESSAGE "GLM: version 1.0.1" -#define GLM_SETUP_INCLUDED GLM_VERSION +#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 + +#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) /////////////////////////////////////////////////////////////////////////////////// // Active states @@ -58,7 +68,7 @@ #define GLM_LANG_CXX11_FLAG (1 << 4) #define GLM_LANG_CXX14_FLAG (1 << 5) #define GLM_LANG_CXX17_FLAG (1 << 6) -#define GLM_LANG_CXX2A_FLAG (1 << 7) +#define GLM_LANG_CXX20_FLAG (1 << 7) #define GLM_LANG_CXXMS_FLAG (1 << 8) #define GLM_LANG_CXXGNU_FLAG (1 << 9) @@ -68,7 +78,7 @@ #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_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_CXX2A (GLM_LANG_CXX17 | GLM_LANG_CXX2A_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 @@ -82,8 +92,8 @@ #if (defined(GLM_FORCE_CXX_UNKNOWN)) # define GLM_LANG 0 -#elif defined(GLM_FORCE_CXX2A) -# define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) +#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) @@ -116,10 +126,10 @@ # endif # if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L -# define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) +# 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 == 201500L || GLM_LANG_PLATFORM == 201402L +# 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) @@ -142,6 +152,10 @@ // 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) # define GLM_HAS_CXX11_STL 0 +#elif (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)) # define GLM_HAS_CXX11_STL 1 @@ -165,7 +179,8 @@ #else # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC)))) + ((GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N1988 @@ -175,7 +190,8 @@ # 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_CLANG))) + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP))) #endif // N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm @@ -187,7 +203,8 @@ # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((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_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf @@ -198,7 +215,8 @@ #else # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ (GLM_COMPILER & GLM_COMPILER_VC) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA))) + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP))) #endif // N2346 @@ -210,7 +228,8 @@ # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((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 @@ -221,7 +240,8 @@ #else # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((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 @@ -233,7 +253,8 @@ # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((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 @@ -245,7 +266,8 @@ # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ ((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 @@ -257,7 +279,8 @@ # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((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 @@ -269,7 +292,8 @@ # define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((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_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf @@ -315,6 +339,13 @@ # define GLM_IF_CONSTEXPR if #endif +// [nodiscard] +#if GLM_LANG & GLM_LANG_CXX17_FLAG +# define GLM_NODISCARD [[nodiscard]] +#else +# define GLM_NODISCARD +#endif + // #if GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_ASSIGNABLE 1 @@ -333,7 +364,8 @@ #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 // @@ -345,6 +377,18 @@ # 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 @@ -408,9 +452,23 @@ /////////////////////////////////////////////////////////////////////////////////// // 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 @@ -419,11 +477,11 @@ #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 @@ -435,9 +493,27 @@ # 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 GLM_CUDA_FUNC_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 @@ -447,16 +523,12 @@ #define GLM_SWIZZLE_OPERATOR 1 #define GLM_SWIZZLE_FUNCTION 2 -#if defined(GLM_FORCE_XYZW_ONLY) -# undef GLM_FORCE_SWIZZLE -#endif - #if defined(GLM_SWIZZLE) # pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.") # define GLM_FORCE_SWIZZLE #endif -#if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) +#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 @@ -475,6 +547,17 @@ # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE #endif +/////////////////////////////////////////////////////////////////////////////////// +// Allows using any scaler as float + +// #define GLM_FORCE_UNRESTRICTED_FLOAT + +#ifdef GLM_FORCE_UNRESTRICTED_FLOAT +# define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_ENABLE +#else +# define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_DISABLE +#endif + /////////////////////////////////////////////////////////////////////////////////// // Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM // to use a clip space between 0 to 1. @@ -512,9 +595,15 @@ # define GLM_DEPRECATED __declspec(deprecated) # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) -# define GLM_DEPRECATED __attribute__((__deprecated__)) +# if GLM_LANG & GLM_LANG_CXX14_FLAG +// BEGIN GOOGLE MODIFICATION +# define GLM_DEPRECATED [[deprecated]] +# else +# define GLM_DEPRECATED __attribute__((__deprecated__)) +# endif +// END GOOGLE MODIFICATION # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) -#elif GLM_COMPILER & GLM_COMPILER_CUDA +#elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) # define GLM_DEPRECATED # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) #else @@ -530,48 +619,6 @@ # define GLM_EXPLICIT #endif -/////////////////////////////////////////////////////////////////////////////////// -// SYCL - -#if GLM_COMPILER==GLM_COMPILER_SYCL - -#include -#include - -namespace glm { -namespace std { - // Import SYCL's functions into the namespace glm::std to force their usages. - // It's important to use the math built-in function (sin, exp, ...) - // of SYCL instead the std ones. - using namespace cl::sycl; - - /////////////////////////////////////////////////////////////////////////////// - // Import some "harmless" std's stuffs used by glm into - // the new glm::std namespace. - template - using numeric_limits = ::std::numeric_limits; - - using ::std::size_t; - - using ::std::uint8_t; - using ::std::uint16_t; - using ::std::uint32_t; - using ::std::uint64_t; - - using ::std::int8_t; - using ::std::int16_t; - using ::std::int32_t; - using ::std::int64_t; - - using ::std::make_unsigned; - /////////////////////////////////////////////////////////////////////////////// -} //namespace std -} //namespace glm - -#endif - -/////////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////////// // 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 @@ -582,8 +629,10 @@ namespace std { #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 @@ -810,7 +859,7 @@ namespace detail /////////////////////////////////////////////////////////////////////////////////// // Configure the use of defaulted function -#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE +#if GLM_HAS_DEFAULTED_FUNCTIONS # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE # define GLM_DEFAULT = default #else @@ -818,6 +867,14 @@ namespace detail # 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 @@ -847,10 +904,10 @@ namespace detail /////////////////////////////////////////////////////////////////////////////////// // Silent warnings -#ifdef GLM_FORCE_SILENT_WARNINGS -# define GLM_SILENT_WARNINGS GLM_ENABLE -#else +#ifdef GLM_FORCE_WARNINGS # define GLM_SILENT_WARNINGS GLM_DISABLE +#else +# define GLM_SILENT_WARNINGS GLM_ENABLE #endif /////////////////////////////////////////////////////////////////////////////////// @@ -929,9 +986,9 @@ namespace detail # pragma message (GLM_STR(GLM_VERSION_MESSAGE)) // Report C++ language -# if (GLM_LANG & GLM_LANG_CXX2A_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 2A with extensions") -# elif (GLM_LANG & GLM_LANG_CXX2A_FLAG) +# 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") @@ -964,6 +1021,8 @@ namespace detail // 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 diff --git a/third_party/glm/detail/type_half.inl b/third_party/glm/detail/type_half.inl index b0723e362d..5d239cf22c 100644 --- a/third_party/glm/detail/type_half.inl +++ b/third_party/glm/detail/type_half.inl @@ -6,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; } diff --git a/third_party/glm/detail/type_mat2x2.hpp b/third_party/glm/detail/type_mat2x2.hpp index 033908f449..82e9f66cd5 100644 --- a/third_party/glm/detail/type_mat2x2.hpp +++ b/third_party/glm/detail/type_mat2x2.hpp @@ -27,149 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v1, col_type const& v2); // -- Conversions -- template - GLM_FUNC_DECL GLM_CONSTEXPR mat( + GLM_CTOR_DECL mat( U const& x1, V const& y1, M const& x2, N const& y2); template - GLM_FUNC_DECL GLM_CONSTEXPR 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 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 mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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); 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/third_party/glm/detail/type_mat2x2.inl b/third_party/glm/detail/type_mat2x2.inl index fe5d1aa313..afb2b31e59 100644 --- a/third_party/glm/detail/type_mat2x2.inl +++ b/third_party/glm/detail/type_mat2x2.inl @@ -4,9 +4,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -22,7 +22,7 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) # if GLM_HAS_INITIALIZER_LISTS - : value{m[0], m[1]} + : value{col_type(m[0]), col_type(m[1])} # endif { # if !GLM_HAS_INITIALIZER_LISTS @@ -217,16 +217,16 @@ namespace glm // -- 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 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_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]; } @@ -234,7 +234,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]; @@ -243,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; @@ -252,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]; @@ -261,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; @@ -270,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]; @@ -279,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; @@ -288,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; @@ -304,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); } @@ -312,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]; @@ -320,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]; @@ -328,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; @@ -336,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; @@ -346,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], @@ -362,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, @@ -370,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, @@ -378,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], @@ -386,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, @@ -394,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], @@ -402,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], @@ -410,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, @@ -418,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, @@ -426,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 @@ -438,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 @@ -450,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], @@ -460,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], @@ -472,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], @@ -486,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, @@ -494,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], @@ -502,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; @@ -523,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/third_party/glm/detail/type_mat2x3.hpp b/third_party/glm/detail/type_mat2x3.hpp index d6596e469b..b65d1c5c46 100644 --- a/third_party/glm/detail/type_mat2x3.hpp +++ b/third_party/glm/detail/type_mat2x3.hpp @@ -28,130 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1); // -- Conversions -- template - GLM_FUNC_DECL GLM_CONSTEXPR mat( + GLM_CTOR_DECL mat( X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2); template - GLM_FUNC_DECL GLM_CONSTEXPR 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 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 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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-=(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/third_party/glm/detail/type_mat2x3.inl b/third_party/glm/detail/type_mat2x3.inl index 5fec17e5db..345ac8ac65 100644 --- a/third_party/glm/detail/type_mat2x3.inl +++ b/third_party/glm/detail/type_mat2x3.inl @@ -2,9 +2,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -20,7 +20,7 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) # if GLM_HAS_INITIALIZER_LISTS - : value{m.value[0], m.value[1]} + : value{col_type(m[0]), col_type(m[1])} # endif { # if !GLM_HAS_INITIALIZER_LISTS @@ -217,16 +217,16 @@ namespace glm // -- 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 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_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]; } @@ -234,7 +234,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]; @@ -243,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; @@ -252,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]; @@ -261,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; @@ -270,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]; @@ -279,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; @@ -288,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; @@ -298,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]; @@ -306,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]; @@ -314,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; @@ -322,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; @@ -332,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], @@ -348,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, @@ -356,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], @@ -364,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, @@ -372,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], @@ -380,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, @@ -388,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, @@ -396,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) @@ -408,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) @@ -419,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], @@ -431,7 +431,7 @@ 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) + 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) { T SrcA00 = m1[0][0]; T SrcA01 = m1[0][1]; @@ -461,7 +461,7 @@ namespace glm } 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], @@ -479,7 +479,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, @@ -487,7 +487,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], @@ -497,13 +497,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/third_party/glm/detail/type_mat2x4.hpp b/third_party/glm/detail/type_mat2x4.hpp index ff03e215e5..7ca43e59a1 100644 --- a/third_party/glm/detail/type_mat2x4.hpp +++ b/third_party/glm/detail/type_mat2x4.hpp @@ -28,20 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1); @@ -50,110 +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 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 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 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 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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-=(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/third_party/glm/detail/type_mat2x4.inl b/third_party/glm/detail/type_mat2x4.inl index b6d2b9ddfd..1c182c9ddf 100644 --- a/third_party/glm/detail/type_mat2x4.inl +++ b/third_party/glm/detail/type_mat2x4.inl @@ -2,9 +2,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -20,7 +20,7 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) # if GLM_HAS_INITIALIZER_LISTS - : value{m[0], m[1]} + : value{col_type(m[0]), col_type(m[1])} # endif { # if !GLM_HAS_INITIALIZER_LISTS @@ -219,16 +219,16 @@ namespace glm // -- 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 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_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]; } @@ -236,7 +236,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]; @@ -245,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; @@ -254,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]; @@ -263,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; @@ -272,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]; @@ -281,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; @@ -290,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; @@ -300,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]; @@ -308,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]; @@ -316,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; @@ -324,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; @@ -334,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], @@ -350,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, @@ -358,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], @@ -366,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, @@ -374,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], @@ -382,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, @@ -390,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, @@ -398,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, @@ -408,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], @@ -416,7 +416,7 @@ 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) + 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) { T SrcA00 = m1[0][0]; T SrcA01 = m1[0][1]; @@ -457,7 +457,7 @@ namespace glm } 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], @@ -471,7 +471,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], @@ -489,7 +489,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, @@ -497,7 +497,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], @@ -507,13 +507,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/third_party/glm/detail/type_mat3x2.hpp b/third_party/glm/detail/type_mat3x2.hpp index e16658131f..0249befd4e 100644 --- a/third_party/glm/detail/type_mat3x2.hpp +++ b/third_party/glm/detail/type_mat3x2.hpp @@ -28,21 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -53,13 +53,13 @@ namespace glm typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> - GLM_FUNC_DECL GLM_CONSTEXPR mat( + GLM_CTOR_DECL mat( X1 x1, Y1 y1, X2 x2, Y2 y2, X3 x3, Y3 y3); template - GLM_FUNC_DECL GLM_CONSTEXPR mat( + GLM_CTOR_DECL mat( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3); @@ -67,98 +67,98 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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-=(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/third_party/glm/detail/type_mat3x2.inl b/third_party/glm/detail/type_mat3x2.inl index b4b948b726..cd9f46ccc6 100644 --- a/third_party/glm/detail/type_mat3x2.inl +++ b/third_party/glm/detail/type_mat3x2.inl @@ -2,9 +2,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -236,16 +236,16 @@ namespace glm // -- 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 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_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]; } @@ -253,7 +253,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]; @@ -263,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; @@ -273,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]; @@ -283,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; @@ -293,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]; @@ -303,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; @@ -313,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; @@ -324,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]; @@ -333,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]; @@ -342,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; @@ -350,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; @@ -360,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], @@ -377,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, @@ -386,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], @@ -395,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, @@ -404,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], @@ -413,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, @@ -422,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, @@ -431,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, @@ -439,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], @@ -448,7 +448,7 @@ 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]; @@ -473,7 +473,7 @@ namespace glm } 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], @@ -485,7 +485,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], @@ -499,7 +499,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, @@ -508,7 +508,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], @@ -519,13 +519,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/third_party/glm/detail/type_mat3x3.hpp b/third_party/glm/detail/type_mat3x3.hpp index 3174872eb7..e4cbbdceda 100644 --- a/third_party/glm/detail/type_mat3x3.hpp +++ b/third_party/glm/detail/type_mat3x3.hpp @@ -27,21 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -52,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 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 mat( + GLM_CTOR_DECL mat( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3); @@ -66,109 +66,109 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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); 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 -- @@ -176,7 +176,7 @@ namespace glm 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/third_party/glm/detail/type_mat3x3.inl b/third_party/glm/detail/type_mat3x3.inl index 1ddaf99d58..a9b633ae2b 100644 --- a/third_party/glm/detail/type_mat3x3.inl +++ b/third_party/glm/detail/type_mat3x3.inl @@ -4,9 +4,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -238,16 +238,16 @@ namespace glm // -- 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 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_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]; } @@ -255,7 +255,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]; @@ -265,7 +265,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; @@ -275,7 +275,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]; @@ -285,7 +285,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; @@ -295,7 +295,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]; @@ -305,7 +305,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; @@ -315,14 +315,14 @@ 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 = *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; @@ -332,7 +332,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); } @@ -340,7 +340,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]; @@ -349,7 +349,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]; @@ -358,7 +358,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; @@ -366,7 +366,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; @@ -376,13 +376,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], @@ -393,7 +393,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, @@ -402,7 +402,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, @@ -411,7 +411,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], @@ -420,7 +420,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, @@ -429,7 +429,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], @@ -438,7 +438,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], @@ -447,7 +447,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, @@ -456,7 +456,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, @@ -465,7 +465,7 @@ 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, @@ -474,7 +474,7 @@ namespace glm } 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, @@ -483,7 +483,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) { T const SrcA00 = m1[0][0]; T const SrcA01 = m1[0][1]; @@ -519,7 +519,7 @@ namespace glm } 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], @@ -531,7 +531,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], @@ -549,7 +549,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, @@ -558,7 +558,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], @@ -567,19 +567,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; @@ -594,7 +594,7 @@ namespace glm } 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/third_party/glm/detail/type_mat3x4.hpp b/third_party/glm/detail/type_mat3x4.hpp index 6e40b90305..f9913d271e 100644 --- a/third_party/glm/detail/type_mat3x4.hpp +++ b/third_party/glm/detail/type_mat3x4.hpp @@ -28,21 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2); @@ -53,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 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 mat( + GLM_CTOR_DECL mat( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3); @@ -67,98 +67,98 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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-=(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/third_party/glm/detail/type_mat3x4.inl b/third_party/glm/detail/type_mat3x4.inl index 6ee416cfd6..209e9d90b5 100644 --- a/third_party/glm/detail/type_mat3x4.inl +++ b/third_party/glm/detail/type_mat3x4.inl @@ -2,9 +2,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -242,16 +242,16 @@ namespace glm // -- 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 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_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]; } @@ -259,7 +259,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]; @@ -269,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; @@ -279,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]; @@ -289,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; @@ -299,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]; @@ -309,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; @@ -319,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; @@ -330,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]; @@ -339,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]; @@ -348,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; @@ -356,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; @@ -366,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], @@ -383,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, @@ -392,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], @@ -401,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, @@ -410,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], @@ -419,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, @@ -428,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, @@ -437,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 @@ -451,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 @@ -464,7 +464,7 @@ 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) + 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) { const T SrcA00 = m1[0][0]; const T SrcA01 = m1[0][1]; @@ -513,7 +513,7 @@ namespace glm } 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], @@ -527,7 +527,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], @@ -545,7 +545,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, @@ -554,7 +554,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], @@ -565,13 +565,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/third_party/glm/detail/type_mat4x2.hpp b/third_party/glm/detail/type_mat4x2.hpp index 8d34352711..7057d4ce17 100644 --- a/third_party/glm/detail/type_mat4x2.hpp +++ b/third_party/glm/detail/type_mat4x2.hpp @@ -28,22 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -56,14 +56,14 @@ namespace glm typename X1, typename Y1, typename X2, typename Y2, typename X3, typename Y3> - GLM_FUNC_DECL GLM_CONSTEXPR mat( + GLM_CTOR_DECL mat( X0 x0, Y0 y0, X1 x1, Y1 y1, X2 x2, Y2 y2, X3 x3, Y3 y3); template - GLM_FUNC_DECL GLM_CONSTEXPR mat( + GLM_CTOR_DECL mat( vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3, @@ -72,98 +72,98 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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-=(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/third_party/glm/detail/type_mat4x2.inl b/third_party/glm/detail/type_mat4x2.inl index 419c80c42c..2b9b617a30 100644 --- a/third_party/glm/detail/type_mat4x2.inl +++ b/third_party/glm/detail/type_mat4x2.inl @@ -2,9 +2,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -255,16 +255,16 @@ namespace glm // -- 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 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_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]; } @@ -272,7 +272,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]; @@ -283,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; @@ -294,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]; @@ -305,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; @@ -316,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]; @@ -327,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; @@ -338,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; @@ -350,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]; @@ -360,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]; @@ -370,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; @@ -378,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; @@ -388,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], @@ -406,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, @@ -416,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], @@ -426,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, @@ -436,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], @@ -446,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, @@ -456,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, @@ -466,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, @@ -474,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], @@ -484,7 +484,7 @@ 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) + 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) { T const SrcA00 = m1[0][0]; T const SrcA01 = m1[0][1]; @@ -513,7 +513,7 @@ namespace glm } 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], @@ -525,7 +525,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], @@ -539,7 +539,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, @@ -549,7 +549,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], @@ -561,13 +561,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/third_party/glm/detail/type_mat4x3.hpp b/third_party/glm/detail/type_mat4x3.hpp index 16e4270518..52a38d871f 100644 --- a/third_party/glm/detail/type_mat4x3.hpp +++ b/third_party/glm/detail/type_mat4x3.hpp @@ -28,22 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T const& x); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -56,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 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 mat( + GLM_CTOR_DECL mat( vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, @@ -72,98 +72,98 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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-=(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/third_party/glm/detail/type_mat4x3.inl b/third_party/glm/detail/type_mat4x3.inl index 11b1ee35d8..8430bc07a4 100644 --- a/third_party/glm/detail/type_mat4x3.inl +++ b/third_party/glm/detail/type_mat4x3.inl @@ -2,9 +2,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -34,7 +34,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -255,16 +255,16 @@ namespace glm // -- 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 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_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]; } @@ -272,7 +272,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]; @@ -283,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; @@ -294,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]; @@ -305,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; @@ -316,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]; @@ -327,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; @@ -338,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; @@ -350,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]; @@ -360,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]; @@ -370,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; @@ -378,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; @@ -388,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], @@ -406,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], @@ -426,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], @@ -446,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) @@ -478,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) @@ -491,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], @@ -503,7 +503,7 @@ 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) + 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) { T const SrcA00 = m1[0][0]; T const SrcA01 = m1[0][1]; @@ -545,7 +545,7 @@ namespace glm } 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], @@ -563,35 +563,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/third_party/glm/detail/type_mat4x4.hpp b/third_party/glm/detail/type_mat4x4.hpp index 3517f9f527..ad7597b8e2 100644 --- a/third_party/glm/detail/type_mat4x4.hpp +++ b/third_party/glm/detail/type_mat4x4.hpp @@ -27,22 +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 GLM_CONSTEXPR 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 mat() GLM_DEFAULT; + GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; template - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat(T const& x); - GLM_FUNC_DECL GLM_CONSTEXPR 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 mat( + GLM_CTOR_DECL mat( col_type const& v0, col_type const& v1, col_type const& v2, @@ -55,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 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 mat( + GLM_CTOR_DECL mat( vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, @@ -71,117 +71,117 @@ namespace glm // -- Matrix conversions -- template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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 -- 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); 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/third_party/glm/detail/type_mat4x4.inl b/third_party/glm/detail/type_mat4x4.inl index e38b87f77e..116731d747 100644 --- a/third_party/glm/detail/type_mat4x4.inl +++ b/third_party/glm/detail/type_mat4x4.inl @@ -4,9 +4,9 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -36,7 +36,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -286,16 +286,16 @@ namespace glm // -- 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 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_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]; } @@ -303,7 +303,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) { //memcpy could be faster //memcpy(&this->value, &m.value, 16 * sizeof(valType)); @@ -316,7 +316,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; @@ -327,7 +327,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]; @@ -338,7 +338,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; @@ -349,7 +349,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]; @@ -360,7 +360,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; @@ -371,14 +371,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; @@ -389,7 +389,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); } @@ -397,7 +397,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]; @@ -407,7 +407,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]; @@ -417,7 +417,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; @@ -425,7 +425,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; @@ -435,13 +435,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], @@ -453,27 +453,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], @@ -483,27 +483,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], @@ -513,27 +513,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 @@ -581,7 +581,7 @@ 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 @@ -595,7 +595,7 @@ namespace glm } 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], @@ -609,7 +609,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], @@ -627,7 +627,7 @@ namespace glm } 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) { typename mat<4, 4, T, Q>::col_type const SrcA0 = m1[0]; typename mat<4, 4, T, Q>::col_type const SrcA1 = m1[1]; @@ -648,39 +648,39 @@ 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 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; @@ -689,13 +689,13 @@ 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]); } diff --git a/third_party/glm/detail/type_quat.hpp b/third_party/glm/detail/type_quat.hpp index 0e60bc33c4..1b41e15602 100644 --- a/third_party/glm/detail/type_quat.hpp +++ b/third_party/glm/detail/type_quat.hpp @@ -15,16 +15,6 @@ namespace glm { - template - struct qua - { - // -- Implementation detail -- - - typedef qua type; - typedef T value_type; - - // -- Data -- - # if GLM_SILENT_WARNINGS == GLM_ENABLE # if GLM_COMPILER & GLM_COMPILER_GCC # pragma GCC diagnostic push @@ -39,6 +29,16 @@ namespace glm # endif # endif + template + struct qua + { + // -- Implementation detail -- + + typedef qua type; + typedef T value_type; + + // -- Data -- + # if GLM_LANG & GLM_LANG_CXXMS_FLAG union { @@ -56,16 +56,6 @@ namespace glm # else T x, y, z, w; # 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 -- @@ -80,20 +70,27 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR qua() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR qua(qua const& q) GLM_DEFAULT; + 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_FUNC_DECL GLM_CONSTEXPR qua(qua const& q); + GLM_CTOR_DECL qua(qua const& q); // -- Explicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR qua(T s, vec<3, T, Q> const& v); - GLM_FUNC_DECL GLM_CONSTEXPR qua(T w, T x, T y, T z); + 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_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(qua const& q); + GLM_CTOR_DECL GLM_EXPLICIT qua(qua const& q); /// Explicit conversion operators # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS @@ -107,31 +104,41 @@ namespace glm /// @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 qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v); + 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_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(vec<3, T, Q> const& eulerAngles); - GLM_FUNC_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q> const& q); - GLM_FUNC_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q> const& q); + 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_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator=(qua const& q); template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator+=(qua const& q); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator+=(qua const& q); template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator-=(qua const& q); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator-=(qua const& q); template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator*=(qua const& q); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator*=(qua const& q); template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator*=(U s); template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator/=(U s); + 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 diff --git a/third_party/glm/detail/type_quat.inl b/third_party/glm/detail/type_quat.inl index 67b9310ac2..6a8f9871bc 100644 --- a/third_party/glm/detail/type_quat.inl +++ b/third_party/glm/detail/type_quat.inl @@ -1,5 +1,6 @@ #include "../trigonometric.hpp" #include "../exponential.hpp" +#include "../ext/quaternion_common.hpp" #include "../ext/quaternion_geometric.hpp" #include @@ -27,7 +28,7 @@ namespace detail { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) { - return qua(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); + return qua::wxyz(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); } }; @@ -36,7 +37,7 @@ namespace detail { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) { - return qua(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); + return qua::wxyz(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); } }; @@ -45,7 +46,7 @@ namespace detail { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) { - return qua(q.w * s, q.x * s, q.y * s, q.z * s); + return qua::wxyz(q.w * s, q.x * s, q.y * s, q.z * s); } }; @@ -54,7 +55,7 @@ namespace detail { GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) { - return qua(q.w / s, q.x / s, q.y / s, q.z / s); + return qua::wxyz(q.w / s, q.x / s, q.y / s, q.z / s); } }; @@ -73,7 +74,7 @@ namespace detail template GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua::operator[](typename qua::length_type i) { - assert(i >= 0 && i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); # ifdef GLM_FORCE_QUAT_DATA_WXYZ return (&w)[i]; # else @@ -84,7 +85,7 @@ namespace detail template GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua::operator[](typename qua::length_type i) const { - assert(i >= 0 && i < this->length()); + GLM_ASSERT_LENGTH(i, this->length()); # ifdef GLM_FORCE_QUAT_DATA_WXYZ return (&w)[i]; # else @@ -94,9 +95,9 @@ namespace detail // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua() + 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) @@ -105,9 +106,11 @@ namespace detail # endif # endif {} +# endif +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) + 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 @@ -138,7 +141,11 @@ namespace detail {} 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 @@ -146,6 +153,15 @@ namespace detail # 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 @@ -197,7 +213,7 @@ namespace detail t = cross(u, v); } - *this = normalize(qua(real_part, t.x, t.y, t.z)); + *this = normalize(qua::wxyz(real_part, t.x, t.y, t.z)); } template @@ -213,13 +229,13 @@ namespace detail } template - GLM_FUNC_QUALIFIER qua::qua(mat<3, 3, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(mat<3, 3, T, Q> const& m) { *this = quat_cast(m); } template - GLM_FUNC_QUALIFIER qua::qua(mat<4, 4, T, Q> const& m) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(mat<4, 4, T, Q> const& m) { *this = quat_cast(m); } @@ -242,7 +258,7 @@ namespace detail # if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) { this->w = q.w; this->x = q.x; @@ -316,7 +332,7 @@ namespace detail template GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q) { - return qua(-q.w, -q.x, -q.y, -q.z); + return qua::wxyz(-q.w, -q.x, -q.y, -q.z); } // -- Binary operators -- @@ -370,7 +386,7 @@ namespace detail template GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, T const& s) { - return qua( + return qua::wxyz( q.w * s, q.x * s, q.y * s, q.z * s); } @@ -383,7 +399,7 @@ namespace detail template GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator/(qua const& q, T const& s) { - return qua( + return qua::wxyz( q.w / s, q.x / s, q.y / s, q.z / s); } diff --git a/third_party/glm/detail/type_quat_simd.inl b/third_party/glm/detail/type_quat_simd.inl index 3333e59f1c..fa6da19832 100644 --- a/third_party/glm/detail/type_quat_simd.inl +++ b/third_party/glm/detail/type_quat_simd.inl @@ -14,10 +14,10 @@ namespace detail // 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); + __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); @@ -89,7 +89,7 @@ namespace detail { static qua call(qua const& q, qua const& p) { - vec<4, float, Q> Result; + qua Result; Result.data = _mm_sub_ps(q.data, p.data); return Result; } @@ -161,28 +161,48 @@ namespace detail { static vec<4, float, Q> call(qua 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; +# 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/third_party/glm/detail/type_vec1.hpp b/third_party/glm/detail/type_vec1.hpp index 51163f14bc..0cc7b5d4c9 100644 --- a/third_party/glm/detail/type_vec1.hpp +++ b/third_party/glm/detail/type_vec1.hpp @@ -92,36 +92,36 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR 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 vec(vec<1, T, P> const& v); + GLM_CTOR_DECL vec(vec<1, T, P> const& v); // -- Explicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + 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_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); + 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_FUNC_DECL GLM_CONSTEXPR 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 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 GLM_EXPLICIT vec(vec<1, U, P> const& v); + GLM_CTOR_DECL GLM_EXPLICIT vec(vec<1, U, P> const& v); // -- Swizzle constructors -- /* # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<1, T, Q, E0, -1,-2,-3> const& that) + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec(detail::_swizzle<1, T, Q, E0, -1,-2,-3> const& that) { *this = that(); } @@ -129,60 +129,60 @@ namespace glm */ // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT; template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v); // -- Increment and decrement operators -- - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--(); + 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_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v); }; // -- Unary operators -- diff --git a/third_party/glm/detail/type_vec1.inl b/third_party/glm/detail/type_vec1.inl index c5883cebc9..18411e7f76 100644 --- a/third_party/glm/detail/type_vec1.inl +++ b/third_party/glm/detail/type_vec1.inl @@ -6,16 +6,18 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec() + 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 +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -77,7 +79,7 @@ namespace glm # if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; @@ -234,7 +236,7 @@ namespace glm template 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; } diff --git a/third_party/glm/detail/type_vec2.hpp b/third_party/glm/detail/type_vec2.hpp index 52ef408e5d..2ddfb435a5 100644 --- a/third_party/glm/detail/type_vec2.hpp +++ b/third_party/glm/detail/type_vec2.hpp @@ -40,6 +40,9 @@ namespace glm # 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 { @@ -91,48 +94,48 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR 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 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 explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y); + GLM_CTOR_DECL explicit vec(T scalar); + GLM_CTOR_DECL vec(T x, T y); // -- Conversion constructors -- template - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + 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 vec(A x, B y); + GLM_CTOR_DECL vec(A x, B y); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, B y); + GLM_CTOR_DECL vec(vec<1, A, Q> const& x, B y); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, vec<1, B, Q> const& y); + GLM_CTOR_DECL vec(A x, vec<1, B, Q> const& y); template - GLM_FUNC_DECL GLM_CONSTEXPR 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 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 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 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_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template - GLM_FUNC_DECL GLM_CONSTEXPR 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(); } @@ -140,80 +143,80 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator++(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator--(); + 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 GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & 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 GLM_CONSTEXPR vec<2, T, Q> & 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 -- diff --git a/third_party/glm/detail/type_vec2.inl b/third_party/glm/detail/type_vec2.inl index 8e65d6bb9e..e8408997f2 100644 --- a/third_party/glm/detail/type_vec2.inl +++ b/third_party/glm/detail/type_vec2.inl @@ -6,16 +6,18 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec() + 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 +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -103,7 +105,7 @@ namespace glm template 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()); + GLM_ASSERT_LENGTH(i, this->length()); switch(i) { default: @@ -117,7 +119,7 @@ namespace glm template 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()); + GLM_ASSERT_LENGTH(i, this->length()); switch(i) { default: @@ -132,7 +134,7 @@ namespace glm # if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; diff --git a/third_party/glm/detail/type_vec3.hpp b/third_party/glm/detail/type_vec3.hpp index d83cde678f..4bf8395d31 100644 --- a/third_party/glm/detail/type_vec3.hpp +++ b/third_party/glm/detail/type_vec3.hpp @@ -32,6 +32,7 @@ namespace glm # 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 @@ -43,6 +44,9 @@ namespace glm # 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 { @@ -95,77 +99,77 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR 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 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 explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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 -- template - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + 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 vec(X x, Y y, Z z); + GLM_CTOR_DECL vec(X x, Y y, Z z); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z); + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z); + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z); + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z); + GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _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_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); template - GLM_FUNC_DECL GLM_CONSTEXPR 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, 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 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 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 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 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 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 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_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template - GLM_FUNC_DECL GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR 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()); } @@ -173,80 +177,80 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> 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 vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator++(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--(); + 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 GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & 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 GLM_CONSTEXPR vec<3, T, Q> & 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 -- diff --git a/third_party/glm/detail/type_vec3.inl b/third_party/glm/detail/type_vec3.inl index 6532c9e6e0..4e44047bac 100644 --- a/third_party/glm/detail/type_vec3.inl +++ b/third_party/glm/detail/type_vec3.inl @@ -6,16 +6,18 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec() + 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 +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -167,7 +169,7 @@ namespace glm template 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()); + GLM_ASSERT_LENGTH(i, this->length()); switch(i) { default: @@ -183,7 +185,7 @@ namespace glm template 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()); + GLM_ASSERT_LENGTH(i, this->length()); switch(i) { default: @@ -200,7 +202,7 @@ namespace glm # if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; diff --git a/third_party/glm/detail/type_vec4.hpp b/third_party/glm/detail/type_vec4.hpp index 4a36434673..15f122f968 100644 --- a/third_party/glm/detail/type_vec4.hpp +++ b/third_party/glm/detail/type_vec4.hpp @@ -40,6 +40,9 @@ namespace glm # 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 { @@ -94,151 +97,151 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR 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 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 explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR 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_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + 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 vec(X _x, Y _y, Z _z, W _w); + GLM_CTOR_DECL vec(X _x, Y _y, Z _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w); + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w); + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w); + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w); + GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w); + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); + 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_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w); + GLM_CTOR_DECL vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); + GLM_CTOR_DECL vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); + 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_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + GLM_CTOR_DECL vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + 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_FUNC_DECL GLM_CONSTEXPR vec(X _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, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); template - GLM_FUNC_DECL GLM_CONSTEXPR 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(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 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 vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _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 vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _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 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, 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 vec(A _x, vec<2, B, P> const& _yz, C _w); + 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 vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w); + 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_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + 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_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + 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_FUNC_DECL GLM_CONSTEXPR vec(A _x, B _y, vec<2, C, P> const& _zw); + 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_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw); + 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_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); + 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_FUNC_DECL GLM_CONSTEXPR 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<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 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 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 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 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 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 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_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR template - GLM_FUNC_DECL GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR 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, -1> const& v, T const& w) { *this = vec<4, T, Q>(v(), w); } template - GLM_FUNC_DECL GLM_CONSTEXPR 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, -1> const& v) { *this = vec<4, T, Q>(x, v()); } @@ -246,39 +249,39 @@ namespace glm // -- Unary arithmetic operators -- - GLM_FUNC_DECL GLM_CONSTEXPR 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 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 GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar); template - GLM_FUNC_DECL GLM_CONSTEXPR 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR vec<4, T, Q> & operator++(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--(); + 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); @@ -333,7 +336,7 @@ namespace glm // -- Binary operators -- template - GLM_FUNC_DECL GLM_CONSTEXPR 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 GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); @@ -348,7 +351,7 @@ namespace glm 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); @@ -363,7 +366,7 @@ namespace glm 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); @@ -378,7 +381,7 @@ namespace glm 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 GLM_CONSTEXPR 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 GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); diff --git a/third_party/glm/detail/type_vec4.inl b/third_party/glm/detail/type_vec4.inl index 3c212d98bb..d48fae758e 100644 --- a/third_party/glm/detail/type_vec4.inl +++ b/third_party/glm/detail/type_vec4.inl @@ -129,16 +129,18 @@ namespace detail // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec() + 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 +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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 @@ -476,7 +478,7 @@ namespace detail template 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()); + GLM_ASSERT_LENGTH(i, this->length()); switch(i) { default: @@ -494,7 +496,7 @@ namespace detail template 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()); + GLM_ASSERT_LENGTH(i, this->length()); switch(i) { default: @@ -513,7 +515,7 @@ namespace detail # if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; @@ -801,7 +803,7 @@ namespace detail // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; } @@ -831,7 +833,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; } @@ -861,7 +863,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; } @@ -891,7 +893,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR 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; } diff --git a/third_party/glm/detail/type_vec4_simd.inl b/third_party/glm/detail/type_vec4_simd.inl index 29559b5350..816ef45bf0 100644 --- a/third_party/glm/detail/type_vec4_simd.inl +++ b/third_party/glm/detail/type_vec4_simd.inl @@ -1,348 +1,348 @@ #if GLM_ARCH & GLM_ARCH_SSE2_BIT -namespace glm{ -namespace detail -{ -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - template - struct _swizzle_base1<4, float, Q, E0,E1,E2,E3, true> : public _swizzle_base0 +namespace glm { + namespace detail { - GLM_FUNC_QUALIFIER vec<4, float, Q> operator ()() const +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + struct _swizzle_base1<4, float, Q, E0, E1, E2, E3, true> : public _swizzle_base0 { - __m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer); + GLM_FUNC_QUALIFIER vec<4, float, Q> operator ()() const + { + __m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer); - vec<4, float, Q> Result; + 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, int, Q, E0,E1,E2,E3, true> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, int, Q> operator ()() const - { - __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); - - vec<4, int, Q> Result; - Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); - return Result; - } - }; - - template - struct _swizzle_base1<4, uint, Q, E0,E1,E2,E3, true> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, uint, Q> operator ()() const - { - __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); - - vec<4, uint, Q> Result; - Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); - return Result; - } - }; + return Result; + } + }; + + template + struct _swizzle_base1<4, int, Q, E0, E1, E2, E3, true> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, int, Q> operator ()() const + { + __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); + + vec<4, int, Q> Result; + Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); + return Result; + } + }; + + template + struct _swizzle_base1<4, uint, Q, E0, E1, E2, E3, true> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, uint, Q> operator ()() const + { + __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); + + vec<4, uint, Q> 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_vec4_add - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + template + struct compute_vec4_add { - vec<4, float, Q> Result; - Result.data = _mm_add_ps(a.data, b.data); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_sub { - vec<4, float, Q> Result; - Result.data = _mm_sub_ps(a.data, b.data); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_mul { - vec<4, float, Q> Result; - Result.data = _mm_mul_ps(a.data, b.data); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_div { - vec<4, float, Q> Result; - Result.data = _mm_div_ps(a.data, b.data); - return Result; - } - }; + 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; - } - }; +# 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) + template<> + struct compute_vec4_div { - vec<4, float, aligned_lowp> Result; - Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data)); - return Result; - } - }; + 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) + template + struct compute_vec4_and { - vec<4, T, Q> Result; - Result.data = _mm_and_si128(a.data, b.data); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_or { - vec<4, T, Q> Result; - Result.data = _mm_or_si128(a.data, b.data); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_xor { - vec<4, T, Q> Result; - Result.data = _mm_xor_si128(a.data, b.data); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_shift_left { - vec<4, T, Q> Result; - Result.data = _mm_sll_epi32(a.data, b.data); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_shift_right { - vec<4, T, Q> Result; - Result.data = _mm_srl_epi32(a.data, b.data); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_bitwise_not { - vec<4, T, Q> Result; - Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1)); - return Result; - } - }; + 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; - } - }; + 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) + template + struct compute_vec4_equal { - return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0; - } - }; + 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; + } + }; # if GLM_ARCH & GLM_ARCH_SSE41_BIT - template - struct compute_vec4_equal - { - static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> 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; - } - }; + template + struct compute_vec4_equal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> 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_vec4_nequal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + template + struct compute_vec4_nequal { - return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0; - } - }; + 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; + } + }; # if GLM_ARCH & GLM_ARCH_SSE41_BIT - template - struct compute_vec4_nequal - { - static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> 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) != 0; - } - }; + template + struct compute_vec4_nequal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> 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) != 0; + } + }; # endif -}//namespace detail + }//namespace detail template<> GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : @@ -464,209 +464,222 @@ namespace detail #if GLM_ARCH & GLM_ARCH_NEON_BIT namespace glm { -namespace detail { - - 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 = vaddq_f32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_add - { - static - vec<4, uint, Q> - call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) - { - vec<4, uint, Q> Result; - Result.data = vaddq_u32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_add - { - static - vec<4, int, Q> - call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) - { - vec<4, uint, Q> Result; - Result.data = vaddq_s32(a.data, b.data); - return Result; - } - }; - - 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 = vsubq_f32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_sub - { - static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) - { - vec<4, uint, Q> Result; - Result.data = vsubq_u32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_sub - { - static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) - { - vec<4, int, Q> Result; - Result.data = vsubq_s32(a.data, b.data); - return Result; - } - }; - - 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 = vmulq_f32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_mul - { - static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) - { - vec<4, uint, Q> Result; - Result.data = vmulq_u32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_mul - { - static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) - { - vec<4, int, Q> Result; - Result.data = vmulq_s32(a.data, b.data); - return Result; - } - }; - - 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 = vdivq_f32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_equal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - uint32x4_t cmp = vceqq_f32(v1.data, v2.data); + namespace detail { + + 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 = vaddq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_add + { + static + vec<4, uint, Q> + call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vaddq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_add + { + static + vec<4, int, Q> + call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, int, Q> Result; + Result.data = vaddq_s32(a.data, b.data); + return Result; + } + }; + + 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 = vsubq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_sub + { + static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vsubq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_sub + { + static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, int, Q> Result; + Result.data = vsubq_s32(a.data, b.data); + return Result; + } + }; + + 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 = vmulq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_mul + { + static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vmulq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_mul + { + static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, int, Q> Result; + Result.data = vmulq_s32(a.data, b.data); + return Result; + } + }; + + 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; #if GLM_ARCH & GLM_ARCH_ARMV8_BIT - cmp = vpminq_u32(cmp, cmp); - cmp = vpminq_u32(cmp, cmp); - uint32_t r = cmp[0]; + Result.data = vdivq_f32(a.data, b.data); #else - uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); - cmpx2 = vpmin_u32(cmpx2, cmpx2); - uint32_t r = cmpx2[0]; + /* 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 r == ~0u; - } - }; + return Result; + } + }; - template - struct compute_vec4_equal - { - static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + template + struct compute_vec4_equal { - uint32x4_t cmp = vceqq_u32(v1.data, v2.data); + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> 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]; + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; #else - uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); - cmpx2 = vpmin_u32(cmpx2, cmpx2); - uint32_t r = cmpx2[0]; + 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; - } - }; + return r == ~0u; + } + }; - template - struct compute_vec4_equal - { - static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + template + struct compute_vec4_equal { - uint32x4_t cmp = vceqq_s32(v1.data, v2.data); + static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> 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]; + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; #else - uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); - cmpx2 = vpmin_u32(cmpx2, cmpx2); - uint32_t r = cmpx2[0]; + 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; - } - }; + return r == ~0u; + } + }; - template - struct compute_vec4_nequal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - return !compute_vec4_equal::call(v1, v2); - } - }; - - template - struct compute_vec4_nequal - { - static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + template + struct compute_vec4_equal { - return !compute_vec4_equal::call(v1, v2); - } - }; - - template - struct compute_vec4_nequal - { - static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) - { - return !compute_vec4_equal::call(v1, v2); - } - }; - -}//namespace detail + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> 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_vec4_nequal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + + template + struct compute_vec4_nequal + { + static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + + template + struct compute_vec4_nequal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + + }//namespace detail #if !GLM_CONFIG_XYZW_ONLY template<> diff --git a/third_party/glm/detail/type_vec_simd.inl b/third_party/glm/detail/type_vec_simd.inl new file mode 100644 index 0000000000..566abec3e6 --- /dev/null +++ b/third_party/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/third_party/glm/exponential.hpp b/third_party/glm/exponential.hpp index f8fb886f6e..1614f7695d 100644 --- a/third_party/glm/exponential.hpp +++ b/third_party/glm/exponential.hpp @@ -35,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/third_party/glm/ext.hpp b/third_party/glm/ext.hpp index 3249fb991c..f9ac3699d8 100644 --- a/third_party/glm/ext.hpp +++ b/third_party/glm/ext.hpp @@ -111,6 +111,7 @@ #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" @@ -120,6 +121,7 @@ #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" @@ -198,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" @@ -210,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" @@ -225,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/third_party/glm/ext/_matrix_vectorize.hpp b/third_party/glm/ext/_matrix_vectorize.hpp new file mode 100644 index 0000000000..0d08117ed1 --- /dev/null +++ b/third_party/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/third_party/glm/ext/matrix_clip_space.hpp b/third_party/glm/ext/matrix_clip_space.hpp index c3874f2f8d..43579b8eee 100644 --- a/third_party/glm/ext/matrix_clip_space.hpp +++ b/third_party/glm/ext/matrix_clip_space.hpp @@ -53,7 +53,7 @@ namespace glm 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. + /// 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 @@ -63,7 +63,7 @@ namespace glm 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. + /// 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 @@ -136,7 +136,7 @@ namespace glm 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. + /// 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 @@ -144,7 +144,7 @@ namespace glm 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. + /// 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 @@ -152,7 +152,7 @@ namespace glm 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. + /// 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 @@ -160,7 +160,7 @@ namespace glm 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. + /// 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 @@ -184,7 +184,7 @@ namespace glm 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. + /// 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) /// @@ -193,7 +193,7 @@ namespace glm 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. + /// 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) /// @@ -212,7 +212,7 @@ namespace glm T left, T right, T bottom, T top, T near, T far); - /// Creates a matrix for a right handed, symetric perspective-view frustum. + /// 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. @@ -225,7 +225,7 @@ namespace glm 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. + /// 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. @@ -238,7 +238,7 @@ namespace glm 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. + /// 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. @@ -251,7 +251,7 @@ namespace glm 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. + /// 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. @@ -264,7 +264,7 @@ namespace glm 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. + /// 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. @@ -277,7 +277,7 @@ namespace glm 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. + /// 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. @@ -290,7 +290,7 @@ namespace glm 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. + /// 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) /// @@ -304,7 +304,7 @@ namespace glm 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. + /// 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) /// @@ -318,7 +318,7 @@ namespace glm 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. + /// 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. @@ -416,7 +416,7 @@ namespace glm 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. + /// 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) /// @@ -431,7 +431,7 @@ namespace glm 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. + /// 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) /// @@ -460,7 +460,7 @@ namespace glm 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. + /// 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). @@ -471,7 +471,7 @@ namespace glm 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. + /// 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). diff --git a/third_party/glm/ext/matrix_clip_space.inl b/third_party/glm/ext/matrix_clip_space.inl index 7e4df33004..27fb6a13f7 100644 --- a/third_party/glm/ext/matrix_clip_space.inl +++ b/third_party/glm/ext/matrix_clip_space.inl @@ -125,8 +125,8 @@ namespace glm 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][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); @@ -139,8 +139,8 @@ namespace glm 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][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); @@ -483,7 +483,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear) + 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; @@ -499,9 +499,27 @@ namespace glm 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(T fovy, T aspect, T zNear) + 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; @@ -518,13 +536,35 @@ namespace glm 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> infinitePerspective(T fovy, T aspect, T zNear) { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return infinitePerspectiveLH(fovy, aspect, zNear); -# else - return infinitePerspectiveRH(fovy, aspect, 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 } diff --git a/third_party/glm/ext/matrix_common.hpp b/third_party/glm/ext/matrix_common.hpp index 05c37991c5..6bb3d06e7e 100644 --- a/third_party/glm/ext/matrix_common.hpp +++ b/third_party/glm/ext/matrix_common.hpp @@ -16,7 +16,7 @@ #include "../detail/_fixes.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_transform extension included") +# pragma message("GLM: GLM_EXT_matrix_common extension included") #endif namespace glm @@ -30,6 +30,9 @@ namespace glm 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 diff --git a/third_party/glm/ext/matrix_common.inl b/third_party/glm/ext/matrix_common.inl index 9d508485b8..1be422202e 100644 --- a/third_party/glm/ext/matrix_common.inl +++ b/third_party/glm/ext/matrix_common.inl @@ -1,5 +1,7 @@ #include "../matrix.hpp" +#include "_matrix_vectorize.hpp" + namespace glm { template @@ -13,4 +15,20 @@ namespace glm { 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/third_party/glm/ext/matrix_float3x2.hpp b/third_party/glm/ext/matrix_float3x2.hpp index d39dd2fedd..280d0a3e97 100644 --- a/third_party/glm/ext/matrix_float3x2.hpp +++ b/third_party/glm/ext/matrix_float3x2.hpp @@ -6,7 +6,7 @@ namespace glm { - /// @addtogroup core + /// @addtogroup core_matrix /// @{ /// 3 columns of 2 components matrix of single-precision floating-point numbers. diff --git a/third_party/glm/ext/matrix_integer.hpp b/third_party/glm/ext/matrix_integer.hpp new file mode 100644 index 0000000000..7d7dfc5a5b --- /dev/null +++ b/third_party/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/third_party/glm/ext/matrix_integer.inl b/third_party/glm/ext/matrix_integer.inl new file mode 100644 index 0000000000..8b377ce2a8 --- /dev/null +++ b/third_party/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/third_party/glm/ext/matrix_relational.inl b/third_party/glm/ext/matrix_relational.inl index b2b875309d..9cd42b772b 100644 --- a/third_party/glm/ext/matrix_relational.inl +++ b/third_party/glm/ext/matrix_relational.inl @@ -10,7 +10,10 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b) { - return equal(a, b, static_cast(0)); + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i])); + return Result; } template @@ -29,15 +32,18 @@ namespace glm } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b) { - return notEqual(x, y, static_cast(0)); + 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& x, mat const& y, T Epsilon) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, T Epsilon) { - return notEqual(x, y, vec(Epsilon)); + return notEqual(a, b, vec(Epsilon)); } template @@ -65,9 +71,9 @@ namespace glm } template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, int MaxULPs) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, int MaxULPs) { - return notEqual(x, y, vec(MaxULPs)); + return notEqual(a, b, vec(MaxULPs)); } template diff --git a/third_party/glm/ext/matrix_transform.hpp b/third_party/glm/ext/matrix_transform.hpp index cbd187efd8..13f7a428b2 100644 --- a/third_party/glm/ext/matrix_transform.hpp +++ b/third_party/glm/ext/matrix_transform.hpp @@ -47,8 +47,8 @@ namespace glm /// @tparam Q A value from qualifier enum /// /// @code - /// #include - /// #include + /// #include "third_party/glm/latest/glm/glm.hpp" + /// #include "third_party/glm/latest/glm/gtc/matrix_transform.hpp" /// ... /// 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 @@ -61,7 +61,7 @@ namespace glm /// @see - translate(vec<3, T, Q> const& v) /// @see glTranslate man page template - GLM_FUNC_DECL mat<4, 4, T, Q> translate( + 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. @@ -95,7 +95,34 @@ namespace glm GLM_FUNC_DECL mat<4, 4, T, Q> scale( mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); - /// Build a right handed look at view matrix. + /// 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 diff --git a/third_party/glm/ext/matrix_transform.inl b/third_party/glm/ext/matrix_transform.inl index a415157e0d..029ef0fb5d 100644 --- a/third_party/glm/ext/matrix_transform.inl +++ b/third_party/glm/ext/matrix_transform.inl @@ -7,7 +7,7 @@ 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) + 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]; @@ -95,6 +95,60 @@ namespace glm 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) { @@ -144,9 +198,10 @@ namespace glm 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) { - GLM_IF_CONSTEXPR(GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) - return lookAtLH(eye, center, up); - else - return lookAtRH(eye, center, 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/third_party/glm/ext/matrix_uint2x3.hpp b/third_party/glm/ext/matrix_uint2x3.hpp index 7de62f6ff5..f496c531a0 100644 --- a/third_party/glm/ext/matrix_uint2x3.hpp +++ b/third_party/glm/ext/matrix_uint2x3.hpp @@ -3,7 +3,7 @@ /// /// @see core (dependence) /// -/// @defgroup ext_matrix_int2x3 GLM_EXT_matrix_uint2x3 +/// @defgroup ext_matrix_uint2x3 GLM_EXT_matrix_uint2x3 /// @ingroup ext /// /// Include to use the features of this extension. diff --git a/third_party/glm/ext/matrix_uint2x4_sized.hpp b/third_party/glm/ext/matrix_uint2x4_sized.hpp index 5cb8e546fe..5c55547ff7 100644 --- a/third_party/glm/ext/matrix_uint2x4_sized.hpp +++ b/third_party/glm/ext/matrix_uint2x4_sized.hpp @@ -1,5 +1,5 @@ /// @ref ext_matrix_uint2x4_sized -/// @file glm/ext/matrixu_uint2x4_sized.hpp +/// @file glm/ext/matrix_uint2x4_sized.hpp /// /// @see core (dependence) /// diff --git a/third_party/glm/ext/matrix_uint3x2.hpp b/third_party/glm/ext/matrix_uint3x2.hpp index 47f48737cc..55a9bed688 100644 --- a/third_party/glm/ext/matrix_uint3x2.hpp +++ b/third_party/glm/ext/matrix_uint3x2.hpp @@ -3,7 +3,7 @@ /// /// @see core (dependence) /// -/// @defgroup ext_matrix_int3x2 GLM_EXT_matrix_uint3x2 +/// @defgroup ext_matrix_uint3x2 GLM_EXT_matrix_uint3x2 /// @ingroup ext /// /// Include to use the features of this extension. diff --git a/third_party/glm/ext/quaternion_common.hpp b/third_party/glm/ext/quaternion_common.hpp index f519d55918..f738692a47 100644 --- a/third_party/glm/ext/quaternion_common.hpp +++ b/third_party/glm/ext/quaternion_common.hpp @@ -62,7 +62,7 @@ namespace glm /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum template - GLM_FUNC_DECL qua lerp(qua const& x, qua const& y, T a); + 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. @@ -96,14 +96,14 @@ namespace glm /// @tparam T A floating-point scalar type /// @tparam Q A value from qualifier enum template - GLM_FUNC_DECL qua conjugate(qua const& q); + 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 qua inverse(qua const& q); + 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 diff --git a/third_party/glm/ext/quaternion_common.inl b/third_party/glm/ext/quaternion_common.inl index 0e4a3bb2a3..ad171f9d4b 100644 --- a/third_party/glm/ext/quaternion_common.inl +++ b/third_party/glm/ext/quaternion_common.inl @@ -3,7 +3,7 @@ namespace glm template GLM_FUNC_QUALIFIER qua mix(qua const& x, qua const& y, T a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mix' only accept floating-point inputs"); T const cosTheta = dot(x, y); @@ -11,7 +11,7 @@ namespace glm if(cosTheta > static_cast(1) - epsilon()) { // Linear interpolation - return qua( + return qua::wxyz( mix(x.w, y.w, a), mix(x.x, y.x, a), mix(x.y, y.y, a), @@ -26,9 +26,9 @@ namespace glm } template - GLM_FUNC_QUALIFIER qua lerp(qua const& x, qua const& y, T a) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua lerp(qua const& x, qua const& y, T a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'lerp' only accept floating-point inputs"); + 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)); @@ -40,7 +40,7 @@ namespace glm template GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'slerp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs"); qua z = y; @@ -58,7 +58,7 @@ namespace glm if(cosTheta > static_cast(1) - epsilon()) { // Linear interpolation - return qua( + return qua::wxyz( mix(x.w, z.w, a), mix(x.x, z.x, a), mix(x.y, z.y, a), @@ -75,7 +75,7 @@ namespace glm template GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a, S k) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'slerp' only accept floating-point inputs"); + 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; @@ -94,7 +94,7 @@ namespace glm if (cosTheta > static_cast(1) - epsilon()) { // Linear interpolation - return qua( + return qua::wxyz( mix(x.w, z.w, a), mix(x.x, z.x, a), mix(x.y, z.y, a), @@ -104,19 +104,19 @@ namespace glm { // Graphics Gems III, page 96 T angle = acos(cosTheta); - T phi = angle + k * glm::pi(); + T phi = angle + static_cast(k) * glm::pi(); return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle); } } template - GLM_FUNC_QUALIFIER qua conjugate(qua const& q) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua conjugate(qua const& q) { - return qua(q.w, -q.x, -q.y, -q.z); + return qua::wxyz(q.w, -q.x, -q.y, -q.z); } template - GLM_FUNC_QUALIFIER qua inverse(qua const& q) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua inverse(qua const& q) { return conjugate(q) / dot(q, q); } @@ -124,7 +124,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(qua const& q) { - 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"); return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); } @@ -132,7 +132,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(qua const& q) { - 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"); return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w)); } diff --git a/third_party/glm/ext/quaternion_exponential.inl b/third_party/glm/ext/quaternion_exponential.inl index 8456c00aff..8a9d774b39 100644 --- a/third_party/glm/ext/quaternion_exponential.inl +++ b/third_party/glm/ext/quaternion_exponential.inl @@ -23,17 +23,17 @@ namespace glm if (Vec3Len < epsilon()) { if(q.w > static_cast(0)) - return qua(log(q.w), static_cast(0), static_cast(0), 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(log(-q.w), pi(), static_cast(0), static_cast(0)); + return qua::wxyz(log(-q.w), pi(), static_cast(0), static_cast(0)); else - return qua(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); + 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(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); + return qua::wxyz(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); } } @@ -43,7 +43,7 @@ namespace glm //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(1,0,0,0); + 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); @@ -56,9 +56,13 @@ namespace glm //Prevent a division by 0 error later on T VectorMagnitude = x.x * x.x + x.y * x.y + x.z * x.z; - if (glm::abs(VectorMagnitude - static_cast(0)) < glm::epsilon()) { + //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(pow(x.w, y), 0, 0, 0); + return qua::wxyz(pow(x.w, y), 0, 0, 0); } Angle = asin(sqrt(VectorMagnitude) / magnitude); @@ -72,7 +76,7 @@ namespace glm T NewAngle = Angle * y; T Div = sin(NewAngle) / sin(Angle); T Mag = pow(magnitude, y - static_cast(1)); - return qua(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); + return qua::wxyz(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); } template diff --git a/third_party/glm/ext/quaternion_geometric.hpp b/third_party/glm/ext/quaternion_geometric.hpp index 6d98bbe93f..6a2403fd28 100644 --- a/third_party/glm/ext/quaternion_geometric.hpp +++ b/third_party/glm/ext/quaternion_geometric.hpp @@ -8,7 +8,7 @@ /// /// Include to use the features of this extension. /// -/// @see core_geometric +/// @see core_func_geometric /// @see ext_quaternion_float /// @see ext_quaternion_double @@ -53,7 +53,7 @@ namespace glm /// /// @see ext_quaternion_geometric template - GLM_FUNC_DECL T dot(qua const& x, qua const& y); + GLM_FUNC_DECL GLM_CONSTEXPR T dot(qua const& x, qua const& y); /// Compute a cross product. /// @@ -62,7 +62,7 @@ namespace glm /// /// @see ext_quaternion_geometric template - GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2); + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua cross(qua const& q1, qua const& q2); /// @} } //namespace glm diff --git a/third_party/glm/ext/quaternion_geometric.inl b/third_party/glm/ext/quaternion_geometric.inl index e155ac5218..88dc4d63de 100644 --- a/third_party/glm/ext/quaternion_geometric.inl +++ b/third_party/glm/ext/quaternion_geometric.inl @@ -1,9 +1,9 @@ namespace glm { template - GLM_FUNC_QUALIFIER T dot(qua const& x, qua const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(qua const& x, qua const& y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); + 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); } @@ -18,15 +18,15 @@ namespace glm { T len = length(q); if(len <= static_cast(0)) // Problem - return qua(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)); T oneOverLen = static_cast(1) / len; - return qua(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); + return qua::wxyz(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); } template - GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua cross(qua const& q1, qua const& q2) { - return qua( + 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, diff --git a/third_party/glm/ext/quaternion_transform.inl b/third_party/glm/ext/quaternion_transform.inl index b87ecb65d9..7e773fbd26 100644 --- a/third_party/glm/ext/quaternion_transform.inl +++ b/third_party/glm/ext/quaternion_transform.inl @@ -18,7 +18,7 @@ namespace glm T const AngleRad(angle); T const Sin = sin(AngleRad * static_cast(0.5)); - return q * qua(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); } }//namespace glm diff --git a/third_party/glm/ext/quaternion_trigonometric.hpp b/third_party/glm/ext/quaternion_trigonometric.hpp index 76cea27add..574a704795 100644 --- a/third_party/glm/ext/quaternion_trigonometric.hpp +++ b/third_party/glm/ext/quaternion_trigonometric.hpp @@ -35,6 +35,8 @@ namespace glm /// 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 diff --git a/third_party/glm/ext/quaternion_trigonometric.inl b/third_party/glm/ext/quaternion_trigonometric.inl index 06b7c4c3c9..896449aa6e 100644 --- a/third_party/glm/ext/quaternion_trigonometric.inl +++ b/third_party/glm/ext/quaternion_trigonometric.inl @@ -7,7 +7,10 @@ namespace glm { if (abs(x.w) > cos_one_over_two()) { - return asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast(2); + 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); diff --git a/third_party/glm/ext/scalar_common.hpp b/third_party/glm/ext/scalar_common.hpp index aa5a180797..df04b6b809 100644 --- a/third_party/glm/ext/scalar_common.hpp +++ b/third_party/glm/ext/scalar_common.hpp @@ -151,6 +151,30 @@ namespace glm 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 diff --git a/third_party/glm/ext/scalar_common.inl b/third_party/glm/ext/scalar_common.inl index 7d9207afcc..3d09fef0cb 100644 --- a/third_party/glm/ext/scalar_common.inl +++ b/third_party/glm/ext/scalar_common.inl @@ -30,7 +30,7 @@ namespace glm template GLM_FUNC_QUALIFIER T fmin(T a, T b) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmin' only accept floating-point input"); if (isnan(a)) return b; @@ -41,7 +41,7 @@ namespace glm template GLM_FUNC_QUALIFIER T fmin(T a, T b, T c) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + 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); @@ -55,7 +55,7 @@ namespace glm template GLM_FUNC_QUALIFIER T fmin(T a, T b, T c, T d) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + 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); @@ -75,7 +75,7 @@ namespace glm template GLM_FUNC_QUALIFIER T fmax(T a, T b) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmax' only accept floating-point input"); if (isnan(a)) return b; @@ -86,7 +86,7 @@ namespace glm template GLM_FUNC_QUALIFIER T fmax(T a, T b, T c) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + 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); @@ -100,7 +100,7 @@ namespace glm template GLM_FUNC_QUALIFIER T fmax(T a, T b, T c, T d) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + 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); @@ -117,7 +117,7 @@ namespace glm 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"); + 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); } @@ -149,4 +149,22 @@ namespace glm 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/third_party/glm/ext/scalar_constants.inl b/third_party/glm/ext/scalar_constants.inl index b475adf83b..b928e5118b 100644 --- a/third_party/glm/ext/scalar_constants.inl +++ b/third_party/glm/ext/scalar_constants.inl @@ -5,14 +5,14 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'epsilon' only accepts floating-point inputs"); + 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, "'pi' only accepts floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'pi' only accepts floating-point inputs"); return static_cast(3.14159265358979323846264338327950288); } diff --git a/third_party/glm/ext/scalar_integer.inl b/third_party/glm/ext/scalar_integer.inl index efba960097..d416197e86 100644 --- a/third_party/glm/ext/scalar_integer.inl +++ b/third_party/glm/ext/scalar_integer.inl @@ -26,7 +26,7 @@ namespace detail { 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"); + 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)); @@ -48,7 +48,7 @@ namespace detail { 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"); + GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); vec v(x); diff --git a/third_party/glm/ext/scalar_reciprocal.hpp b/third_party/glm/ext/scalar_reciprocal.hpp new file mode 100644 index 0000000000..1c7b81dde0 --- /dev/null +++ b/third_party/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/third_party/glm/ext/scalar_reciprocal.inl b/third_party/glm/ext/scalar_reciprocal.inl new file mode 100644 index 0000000000..0cd5f87b4e --- /dev/null +++ b/third_party/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/third_party/glm/ext/scalar_relational.hpp b/third_party/glm/ext/scalar_relational.hpp index 3076a5e63f..e84df17868 100644 --- a/third_party/glm/ext/scalar_relational.hpp +++ b/third_party/glm/ext/scalar_relational.hpp @@ -23,6 +23,9 @@ namespace glm { + /// @addtogroup ext_scalar_relational + /// @{ + /// Returns the component-wise comparison of |x - y| < epsilon. /// True if this expression is satisfied. /// diff --git a/third_party/glm/ext/scalar_ulp.hpp b/third_party/glm/ext/scalar_ulp.hpp index 941ada3e8c..6344d95bf2 100644 --- a/third_party/glm/ext/scalar_ulp.hpp +++ b/third_party/glm/ext/scalar_ulp.hpp @@ -26,6 +26,9 @@ namespace glm { + /// @addtogroup ext_scalar_ulp + /// @{ + /// Return the next ULP value(s) after the input value(s). /// /// @tparam genType A floating-point scalar type. diff --git a/third_party/glm/ext/scalar_ulp.inl b/third_party/glm/ext/scalar_ulp.inl index 308df15068..716528d0cf 100644 --- a/third_party/glm/ext/scalar_ulp.inl +++ b/third_party/glm/ext/scalar_ulp.inl @@ -10,9 +10,14 @@ #include #include -#if(GLM_COMPILER & GLM_COMPILER_VC) +#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 @@ -44,13 +49,13 @@ typedef union do { \ ieee_float_shape_type gf_u; \ gf_u.value = (d); \ - (i) = gf_u.word; \ + (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 = (i); \ + sf_u.word = static_cast(i); \ (d) = sf_u.value; \ } while (0) @@ -182,8 +187,10 @@ namespace detail }//namespace detail }//namespace glm -#if(GLM_COMPILER & GLM_COMPILER_VC) +#if GLM_COMPILER & GLM_COMPILER_VC # pragma warning(pop) +#elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop #endif namespace glm @@ -219,7 +226,7 @@ namespace glm template GLM_FUNC_QUALIFIER T nextFloat(T x, int ULPs) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'next_float' only accept floating-point input"); + 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; @@ -257,7 +264,7 @@ namespace glm template GLM_FUNC_QUALIFIER T prevFloat(T x, int ULPs) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'prev_float' only accept floating-point input"); + 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; diff --git a/third_party/glm/ext/vector_common.hpp b/third_party/glm/ext/vector_common.hpp index 521ec01e76..c0a2858cc2 100644 --- a/third_party/glm/ext/vector_common.hpp +++ b/third_party/glm/ext/vector_common.hpp @@ -198,6 +198,30 @@ namespace glm 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 diff --git a/third_party/glm/ext/vector_common.inl b/third_party/glm/ext/vector_common.inl index e2747be7b2..67817fc554 100644 --- a/third_party/glm/ext/vector_common.inl +++ b/third_party/glm/ext/vector_common.inl @@ -5,28 +5,28 @@ 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, "'min' only accept floating-point or integer inputs"); + 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, "'min' only accept floating-point or integer inputs"); + 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, "'max' only accept floating-point or integer inputs"); + 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, "'max' only accept floating-point or integer inputs"); + 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)); } @@ -126,4 +126,22 @@ namespace glm 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/third_party/glm/ext/vector_integer.inl b/third_party/glm/ext/vector_integer.inl index 939ff5e2ac..cefb132e23 100644 --- a/third_party/glm/ext/vector_integer.inl +++ b/third_party/glm/ext/vector_integer.inl @@ -32,7 +32,7 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); - return (Value % Multiple) == vec(0); + return equal(Value % Multiple, vec(0)); } template @@ -40,7 +40,7 @@ namespace glm { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); - return (Value % Multiple) == vec(0); + return equal(Value % Multiple, vec(0)); } template diff --git a/third_party/glm/ext/vector_reciprocal.hpp b/third_party/glm/ext/vector_reciprocal.hpp new file mode 100644 index 0000000000..84d67662f2 --- /dev/null +++ b/third_party/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/third_party/glm/ext/vector_reciprocal.inl b/third_party/glm/ext/vector_reciprocal.inl new file mode 100644 index 0000000000..b85102a2f5 --- /dev/null +++ b/third_party/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/third_party/glm/ext/vector_relational.inl b/third_party/glm/ext/vector_relational.inl index 7a39ab5089..8c50b2ff2a 100644 --- a/third_party/glm/ext/vector_relational.inl +++ b/third_party/glm/ext/vector_relational.inl @@ -10,7 +10,7 @@ namespace glm { return equal(x, y, vec(Epsilon)); } - + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& Epsilon) { diff --git a/third_party/glm/ext/vector_ulp.hpp b/third_party/glm/ext/vector_ulp.hpp index 6210396b87..7c539bbf88 100644 --- a/third_party/glm/ext/vector_ulp.hpp +++ b/third_party/glm/ext/vector_ulp.hpp @@ -25,6 +25,9 @@ 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 diff --git a/third_party/glm/ext/vector_ulp.inl b/third_party/glm/ext/vector_ulp.inl index 91565ce510..d3c7648826 100644 --- a/third_party/glm/ext/vector_ulp.inl +++ b/third_party/glm/ext/vector_ulp.inl @@ -3,7 +3,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec nextFloat(vec const& x) { - vec Result; + vec Result(0); for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = nextFloat(x[i]); return Result; @@ -12,7 +12,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, int ULPs) { - vec Result; + vec Result(0); for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = nextFloat(x[i], ULPs); return Result; @@ -21,7 +21,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, vec const& ULPs) { - vec Result; + vec Result(0); for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = nextFloat(x[i], ULPs[i]); return Result; @@ -30,7 +30,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec prevFloat(vec const& x) { - vec Result; + vec Result(0); for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = prevFloat(x[i]); return Result; @@ -39,7 +39,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, int ULPs) { - vec Result; + vec Result(0); for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = prevFloat(x[i], ULPs); return Result; @@ -48,7 +48,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, vec const& ULPs) { - vec Result; + vec Result(0); for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = prevFloat(x[i], ULPs[i]); return Result; @@ -57,7 +57,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) { - vec Result; + vec Result(0); for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = floatDistance(x[i], y[i]); return Result; @@ -66,7 +66,7 @@ namespace glm template GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) { - vec Result; + vec Result(0); for(length_t i = 0, n = Result.length(); i < n; ++i) Result[i] = floatDistance(x[i], y[i]); return Result; diff --git a/third_party/glm/fwd.hpp b/third_party/glm/fwd.hpp index 89177f46ca..9c2e5eafa4 100644 --- a/third_party/glm/fwd.hpp +++ b/third_party/glm/fwd.hpp @@ -620,13 +620,13 @@ namespace glm typedef mat<4, 4, f32, highp> highp_mat4x4; typedef mat<2, 2, f32, defaultp> mat2x2; - typedef mat<3, 2, f32, defaultp> mat3x2; - typedef mat<4, 2, f32, defaultp> mat4x2; typedef mat<2, 3, f32, defaultp> mat2x3; - typedef mat<3, 3, f32, defaultp> mat3x3; - typedef mat<4, 3, f32, defaultp> mat4x3; 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; @@ -660,13 +660,13 @@ namespace glm typedef mat<4, 4, f32, highp> highp_fmat4x4; typedef mat<2, 2, f32, defaultp> fmat2x2; - typedef mat<3, 2, f32, defaultp> fmat3x2; - typedef mat<4, 2, f32, defaultp> fmat4x2; typedef mat<2, 3, f32, defaultp> fmat2x3; - typedef mat<3, 3, f32, defaultp> fmat3x3; - typedef mat<4, 3, f32, defaultp> fmat4x3; 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; @@ -700,13 +700,13 @@ namespace glm typedef mat<4, 4, f32, highp> highp_f32mat4x4; typedef mat<2, 2, f32, defaultp> f32mat2x2; - typedef mat<3, 2, f32, defaultp> f32mat3x2; - typedef mat<4, 2, f32, defaultp> f32mat4x2; typedef mat<2, 3, f32, defaultp> f32mat2x3; - typedef mat<3, 3, f32, defaultp> f32mat3x3; - typedef mat<4, 3, f32, defaultp> f32mat4x3; 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; @@ -740,13 +740,13 @@ namespace glm typedef mat<4, 4, double, highp> highp_dmat4x4; typedef mat<2, 2, double, defaultp> dmat2x2; - typedef mat<3, 2, double, defaultp> dmat3x2; - typedef mat<4, 2, double, defaultp> dmat4x2; typedef mat<2, 3, double, defaultp> dmat2x3; - typedef mat<3, 3, double, defaultp> dmat3x3; - typedef mat<4, 3, double, defaultp> dmat4x3; 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; @@ -780,13 +780,13 @@ namespace glm typedef mat<4, 4, f64, highp> highp_f64mat4x4; typedef mat<2, 2, f64, defaultp> f64mat2x2; - typedef mat<3, 2, f64, defaultp> f64mat3x2; - typedef mat<4, 2, f64, defaultp> f64mat4x2; typedef mat<2, 3, f64, defaultp> f64mat2x3; - typedef mat<3, 3, f64, defaultp> f64mat3x3; - typedef mat<4, 3, f64, defaultp> f64mat4x3; 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 @@ -822,13 +822,13 @@ namespace glm typedef mat<4, 4, int, highp> highp_imat4x4; typedef mat<2, 2, int, defaultp> imat2x2; - typedef mat<3, 2, int, defaultp> imat3x2; - typedef mat<4, 2, int, defaultp> imat4x2; typedef mat<2, 3, int, defaultp> imat2x3; - typedef mat<3, 3, int, defaultp> imat3x3; - typedef mat<4, 3, int, defaultp> imat4x3; 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; @@ -863,13 +863,13 @@ namespace glm typedef mat<4, 4, int8, highp> highp_i8mat4x4; typedef mat<2, 2, int8, defaultp> i8mat2x2; - typedef mat<3, 2, int8, defaultp> i8mat3x2; - typedef mat<4, 2, int8, defaultp> i8mat4x2; typedef mat<2, 3, int8, defaultp> i8mat2x3; - typedef mat<3, 3, int8, defaultp> i8mat3x3; - typedef mat<4, 3, int8, defaultp> i8mat4x3; 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; @@ -904,13 +904,13 @@ namespace glm typedef mat<4, 4, int16, highp> highp_i16mat4x4; typedef mat<2, 2, int16, defaultp> i16mat2x2; - typedef mat<3, 2, int16, defaultp> i16mat3x2; - typedef mat<4, 2, int16, defaultp> i16mat4x2; typedef mat<2, 3, int16, defaultp> i16mat2x3; - typedef mat<3, 3, int16, defaultp> i16mat3x3; - typedef mat<4, 3, int16, defaultp> i16mat4x3; 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; @@ -945,13 +945,13 @@ namespace glm typedef mat<4, 4, int32, highp> highp_i32mat4x4; typedef mat<2, 2, int32, defaultp> i32mat2x2; - typedef mat<3, 2, int32, defaultp> i32mat3x2; - typedef mat<4, 2, int32, defaultp> i32mat4x2; typedef mat<2, 3, int32, defaultp> i32mat2x3; - typedef mat<3, 3, int32, defaultp> i32mat3x3; - typedef mat<4, 3, int32, defaultp> i32mat4x3; 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; @@ -986,13 +986,13 @@ namespace glm typedef mat<4, 4, int64, highp> highp_i64mat4x4; typedef mat<2, 2, int64, defaultp> i64mat2x2; - typedef mat<3, 2, int64, defaultp> i64mat3x2; - typedef mat<4, 2, int64, defaultp> i64mat4x2; typedef mat<2, 3, int64, defaultp> i64mat2x3; - typedef mat<3, 3, int64, defaultp> i64mat3x3; - typedef mat<4, 3, int64, defaultp> i64mat4x3; 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; @@ -1029,13 +1029,13 @@ namespace glm typedef mat<4, 4, uint, highp> highp_umat4x4; typedef mat<2, 2, uint, defaultp> umat2x2; - typedef mat<3, 2, uint, defaultp> umat3x2; - typedef mat<4, 2, uint, defaultp> umat4x2; typedef mat<2, 3, uint, defaultp> umat2x3; - typedef mat<3, 3, uint, defaultp> umat3x3; - typedef mat<4, 3, uint, defaultp> umat4x3; 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; @@ -1070,13 +1070,13 @@ namespace glm typedef mat<4, 4, uint8, highp> highp_u8mat4x4; typedef mat<2, 2, uint8, defaultp> u8mat2x2; - typedef mat<3, 2, uint8, defaultp> u8mat3x2; - typedef mat<4, 2, uint8, defaultp> u8mat4x2; typedef mat<2, 3, uint8, defaultp> u8mat2x3; - typedef mat<3, 3, uint8, defaultp> u8mat3x3; - typedef mat<4, 3, uint8, defaultp> u8mat4x3; 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; @@ -1111,13 +1111,13 @@ namespace glm typedef mat<4, 4, uint16, highp> highp_u16mat4x4; typedef mat<2, 2, uint16, defaultp> u16mat2x2; - typedef mat<3, 2, uint16, defaultp> u16mat3x2; - typedef mat<4, 2, uint16, defaultp> u16mat4x2; typedef mat<2, 3, uint16, defaultp> u16mat2x3; - typedef mat<3, 3, uint16, defaultp> u16mat3x3; - typedef mat<4, 3, uint16, defaultp> u16mat4x3; 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; @@ -1152,13 +1152,13 @@ namespace glm typedef mat<4, 4, uint32, highp> highp_u32mat4x4; typedef mat<2, 2, uint32, defaultp> u32mat2x2; - typedef mat<3, 2, uint32, defaultp> u32mat3x2; - typedef mat<4, 2, uint32, defaultp> u32mat4x2; typedef mat<2, 3, uint32, defaultp> u32mat2x3; - typedef mat<3, 3, uint32, defaultp> u32mat3x3; - typedef mat<4, 3, uint32, defaultp> u32mat4x3; 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; @@ -1193,13 +1193,13 @@ namespace glm typedef mat<4, 4, uint64, highp> highp_u64mat4x4; typedef mat<2, 2, uint64, defaultp> u64mat2x2; - typedef mat<3, 2, uint64, defaultp> u64mat3x2; - typedef mat<4, 2, uint64, defaultp> u64mat4x2; typedef mat<2, 3, uint64, defaultp> u64mat2x3; - typedef mat<3, 3, uint64, defaultp> u64mat3x3; - typedef mat<4, 3, uint64, defaultp> u64mat4x3; 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 diff --git a/third_party/glm/geometric.hpp b/third_party/glm/geometric.hpp index c068a3cbdb..ac857e69d4 100644 --- a/third_party/glm/geometric.hpp +++ b/third_party/glm/geometric.hpp @@ -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/third_party/glm/glm.hpp b/third_party/glm/glm.hpp index 69c1f3a654..8b375459a7 100644 --- a/third_party/glm/glm.hpp +++ b/third_party/glm/glm.hpp @@ -1,6 +1,11 @@ /// @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. @@ -95,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" @@ -111,26 +112,26 @@ #include #include #include -#include "fwd.hpp" // IWYU pragma: export +#include "fwd.hpp" -#include "vec2.hpp" // IWYU pragma: export -#include "vec3.hpp" // IWYU pragma: export -#include "vec4.hpp" // IWYU pragma: export -#include "mat2x2.hpp" // IWYU pragma: export -#include "mat2x3.hpp" // IWYU pragma: export -#include "mat2x4.hpp" // IWYU pragma: export -#include "mat3x2.hpp" // IWYU pragma: export -#include "mat3x3.hpp" // IWYU pragma: export -#include "mat3x4.hpp" // IWYU pragma: export -#include "mat4x2.hpp" // IWYU pragma: export -#include "mat4x3.hpp" // IWYU pragma: export -#include "mat4x4.hpp" // IWYU pragma: export +#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" -#include "trigonometric.hpp" // IWYU pragma: export -#include "exponential.hpp" // IWYU pragma: export -#include "common.hpp" // IWYU pragma: export -#include "packing.hpp" // IWYU pragma: export -#include "geometric.hpp" // IWYU pragma: export -#include "matrix.hpp" // IWYU pragma: export -#include "vector_relational.hpp" // IWYU pragma: export -#include "integer.hpp" // IWYU pragma: export +#include "trigonometric.hpp" +#include "exponential.hpp" +#include "common.hpp" +#include "packing.hpp" +#include "geometric.hpp" +#include "matrix.hpp" +#include "vector_relational.hpp" +#include "integer.hpp" diff --git a/third_party/glm/gtc/bitfield.inl b/third_party/glm/gtc/bitfield.inl index 06cf1889cd..e7a0b4f722 100644 --- a/third_party/glm/gtc/bitfield.inl +++ b/third_party/glm/gtc/bitfield.inl @@ -221,6 +221,11 @@ 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) { @@ -229,6 +234,10 @@ namespace detail return Bits >= 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) { diff --git a/third_party/glm/gtc/constants.hpp b/third_party/glm/gtc/constants.hpp index aaf282a89f..6a1f37d30f 100644 --- a/third_party/glm/gtc/constants.hpp +++ b/third_party/glm/gtc/constants.hpp @@ -13,7 +13,7 @@ #pragma once // Dependencies -#include "../ext/scalar_constants.hpp" // IWYU pragma: export +#include "../ext/scalar_constants.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_constants extension included") @@ -39,6 +39,11 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); + /// Return unit-circle circumference, or pi * 2. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType tau(); + /// Return square root of pi. /// @see gtc_constants template diff --git a/third_party/glm/gtc/constants.inl b/third_party/glm/gtc/constants.inl index bb98c6bff9..e9d3776148 100644 --- a/third_party/glm/gtc/constants.inl +++ b/third_party/glm/gtc/constants.inl @@ -20,6 +20,12 @@ namespace glm return genType(6.28318530717958647692528676655900576); } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType tau() + { + return two_pi(); + } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() { diff --git a/third_party/glm/gtc/integer.hpp b/third_party/glm/gtc/integer.hpp index 64ce10bb1b..cff08dc85b 100644 --- a/third_party/glm/gtc/integer.hpp +++ b/third_party/glm/gtc/integer.hpp @@ -19,6 +19,8 @@ #include "../common.hpp" #include "../integer.hpp" #include "../exponential.hpp" +#include "../ext/scalar_common.hpp" +#include "../ext/vector_common.hpp" #include #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) @@ -30,34 +32,10 @@ namespace glm /// @addtogroup gtc_integer /// @{ - /// Returns the log2 of x for integer values. Usefull 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/third_party/glm/gtc/integer.inl b/third_party/glm/gtc/integer.inl index f0a8b4f257..5f66dfe2c0 100644 --- a/third_party/glm/gtc/integer.inl +++ b/third_party/glm/gtc/integer.inl @@ -30,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/third_party/glm/gtc/matrix_inverse.hpp b/third_party/glm/gtc/matrix_inverse.hpp index a1900adcbb..75d53f2023 100644 --- a/third_party/glm/gtc/matrix_inverse.hpp +++ b/third_party/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. @@ -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/third_party/glm/gtc/noise.inl b/third_party/glm/gtc/noise.inl index 30d0b274d3..a1cf399d38 100644 --- a/third_party/glm/gtc/noise.inl +++ b/third_party/glm/gtc/noise.inl @@ -6,7 +6,7 @@ // http://www.itn.liu.se/~stegu/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) @@ -17,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 @@ -781,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/third_party/glm/gtc/packing.inl b/third_party/glm/gtc/packing.inl index 8c906e16c1..17927607fc 100644 --- a/third_party/glm/gtc/packing.inl +++ b/third_party/glm/gtc/packing.inl @@ -179,9 +179,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 +199,7 @@ namespace detail union u4u4 { - struct + struct Data { uint x : 4; uint y : 4; @@ -202,7 +209,7 @@ namespace detail union u4u4u4u4 { - struct + struct Data { uint x : 4; uint y : 4; @@ -214,7 +221,7 @@ namespace detail union u5u6u5 { - struct + struct Data { uint x : 5; uint y : 6; @@ -225,7 +232,7 @@ namespace detail union u5u5u5u1 { - struct + struct Data { uint x : 5; uint y : 5; @@ -235,9 +242,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 +262,7 @@ namespace detail union i10i10i10i2 { - struct + struct Data { int x : 10; int y : 10; @@ -261,7 +274,7 @@ namespace detail union u9u9u9e5 { - struct + struct Data { uint x : 9; uint y : 9; @@ -347,7 +360,7 @@ namespace detail { 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)); + return vec<4, float, Q>(detail::toFloat32(Unpack.x), detail::toFloat32(Unpack.y), detail::toFloat32(Unpack.z), detail::toFloat32(Unpack.w)); } }; }//namespace detail @@ -637,7 +650,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 +696,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 diff --git a/third_party/glm/gtc/quaternion.hpp b/third_party/glm/gtc/quaternion.hpp index 359e072b9f..314449ebd9 100644 --- a/third_party/glm/gtc/quaternion.hpp +++ b/third_party/glm/gtc/quaternion.hpp @@ -112,7 +112,7 @@ namespace glm /// /// @see ext_quaternion_relational template - GLM_FUNC_DECL vec<4, bool, Q> lessThan(qua const& x, qua 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. /// @@ -121,7 +121,7 @@ namespace glm /// /// @see ext_quaternion_relational template - GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(qua const& x, qua 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. /// @@ -130,7 +130,7 @@ namespace glm /// /// @see ext_quaternion_relational template - GLM_FUNC_DECL vec<4, bool, Q> greaterThan(qua const& x, qua 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. /// @@ -139,7 +139,7 @@ namespace glm /// /// @see ext_quaternion_relational template - GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y); /// Build a look at quaternion based on the default handedness. /// diff --git a/third_party/glm/gtc/quaternion.inl b/third_party/glm/gtc/quaternion.inl index 06f9f020b8..ea159f2988 100644 --- a/third_party/glm/gtc/quaternion.inl +++ b/third_party/glm/gtc/quaternion.inl @@ -15,7 +15,13 @@ namespace glm template GLM_FUNC_QUALIFIER T roll(qua 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)); + 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; + + 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 static_cast(atan(y, x)); } template @@ -103,16 +109,16 @@ namespace glm switch(biggestIndex) { case 0: - return qua(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 qua((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 qua((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 qua((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 qua(1, 0, 0, 0); + return qua::wxyz(1, 0, 0, 0); } } @@ -123,36 +129,36 @@ namespace glm } template - GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThan(qua const& x, qua const& y) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> lessThan(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> lessThanEqual(qua const& x, qua 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(qua const& x, qua 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(qua const& x, qua 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; diff --git a/third_party/glm/gtc/random.hpp b/third_party/glm/gtc/random.hpp index 9a859580e4..c6485bf1da 100644 --- a/third_party/glm/gtc/random.hpp +++ b/third_party/glm/gtc/random.hpp @@ -52,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/third_party/glm/gtc/random.inl b/third_party/glm/gtc/random.inl index 704850987c..249ec9f92b 100644 --- a/third_party/glm/gtc/random.inl +++ b/third_party/glm/gtc/random.inl @@ -22,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())); } }; diff --git a/third_party/glm/gtc/reciprocal.hpp b/third_party/glm/gtc/reciprocal.hpp index c7d1330383..4d0fc91ca6 100644 --- a/third_party/glm/gtc/reciprocal.hpp +++ b/third_party/glm/gtc/reciprocal.hpp @@ -19,117 +19,6 @@ # 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/third_party/glm/gtc/reciprocal.inl b/third_party/glm/gtc/reciprocal.inl deleted file mode 100644 index d88729e88f..0000000000 --- a/third_party/glm/gtc/reciprocal.inl +++ /dev/null @@ -1,191 +0,0 @@ -/// @ref gtc_reciprocal - -#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/third_party/glm/gtc/type_ptr.hpp b/third_party/glm/gtc/type_ptr.hpp index d7e625aa59..85586d0726 100644 --- a/third_party/glm/gtc/type_ptr.hpp +++ b/third_party/glm/gtc/type_ptr.hpp @@ -19,8 +19,8 @@ /// /// Example: /// @code -/// #include -/// #include +/// #include "third_party/glm/latest/glm/glm.hpp" +/// #include "third_party/glm/latest/glm/gtc/type_ptr.hpp" /// /// glm::vec3 aVector(3); /// glm::mat4 someMatrix(1.0); diff --git a/third_party/glm/gtc/type_ptr.inl b/third_party/glm/gtc/type_ptr.inl index 71df4d30d0..26b20b52e9 100644 --- a/third_party/glm/gtc/type_ptr.inl +++ b/third_party/glm/gtc/type_ptr.inl @@ -164,97 +164,97 @@ namespace glm } 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; } diff --git a/third_party/glm/gtc/ulp.hpp b/third_party/glm/gtc/ulp.hpp index 0d80a75852..7b918f0fa7 100644 --- a/third_party/glm/gtc/ulp.hpp +++ b/third_party/glm/gtc/ulp.hpp @@ -26,6 +26,9 @@ namespace glm { + /// @addtogroup gtc_ulp + /// @{ + /// Return the next ULP value(s) after the input value(s). /// /// @tparam genType A floating-point scalar type. diff --git a/third_party/glm/gtc/ulp.inl b/third_party/glm/gtc/ulp.inl index 4ecbd3f437..836c84b4a2 100644 --- a/third_party/glm/gtc/ulp.inl +++ b/third_party/glm/gtc/ulp.inl @@ -35,7 +35,7 @@ namespace glm template GLM_FUNC_QUALIFIER T next_float(T x, int ULPs) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'next_float' only accept floating-point input"); + 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; @@ -73,7 +73,7 @@ namespace glm template GLM_FUNC_QUALIFIER T prev_float(T x, int ULPs) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'prev_float' only accept floating-point input"); + 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; diff --git a/third_party/glm/gtx/associated_min_max.hpp b/third_party/glm/gtx/associated_min_max.hpp index a7bd231ee9..435230d277 100644 --- a/third_party/glm/gtx/associated_min_max.hpp +++ b/third_party/glm/gtx/associated_min_max.hpp @@ -9,19 +9,17 @@ /// /// 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 // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_associated_min_max is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_associated_min_max extension included") -# endif +#ifndef GLM_ENABLE_EXPERIMENTAL +# 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 namespace glm @@ -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/third_party/glm/gtx/associated_min_max.inl b/third_party/glm/gtx/associated_min_max.inl index 5186c471c2..f09f5bb74c 100644 --- a/third_party/glm/gtx/associated_min_max.inl +++ b/third_party/glm/gtx/associated_min_max.inl @@ -3,14 +3,14 @@ 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 @@ -169,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 diff --git a/third_party/glm/gtx/bit.hpp b/third_party/glm/gtx/bit.hpp index e577614db5..2f6b3f6644 100644 --- a/third_party/glm/gtx/bit.hpp +++ b/third_party/glm/gtx/bit.hpp @@ -15,12 +15,10 @@ // Dependencies #include "../gtc/bitfield.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_bit is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_bit extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_bit extension included") #endif namespace glm diff --git a/third_party/glm/gtx/closest_point.hpp b/third_party/glm/gtx/closest_point.hpp index d5d91c56d8..a248e4b593 100644 --- a/third_party/glm/gtx/closest_point.hpp +++ b/third_party/glm/gtx/closest_point.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_closest_point extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_closest_point extension included") #endif namespace glm diff --git a/third_party/glm/gtx/color_encoding.hpp b/third_party/glm/gtx/color_encoding.hpp index 956a736abb..4769e0abcb 100644 --- a/third_party/glm/gtx/color_encoding.hpp +++ b/third_party/glm/gtx/color_encoding.hpp @@ -19,12 +19,10 @@ #include "../vec3.hpp" #include -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTC_color_encoding is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTC_color_encoding extension included") -# endif +#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 namespace glm diff --git a/third_party/glm/gtx/color_space.hpp b/third_party/glm/gtx/color_space.hpp index 2d82d88b0c..c39a1f47de 100644 --- a/third_party/glm/gtx/color_space.hpp +++ b/third_party/glm/gtx/color_space.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_color_space is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_color_space extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_color_space extension included") #endif namespace glm diff --git a/third_party/glm/gtx/color_space.inl b/third_party/glm/gtx/color_space.inl index f698afe1e1..c7df5cdc07 100644 --- a/third_party/glm/gtx/color_space.inl +++ b/third_party/glm/gtx/color_space.inl @@ -1,5 +1,8 @@ /// @ref gtx_color_space +#include "third_party/glm/latest/glm/ext/scalar_relational.hpp" +#include "third_party/glm/latest/glm/ext/scalar_constants.hpp" + namespace glm { template @@ -8,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 @@ -63,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/third_party/glm/gtx/color_space_YCoCg.hpp b/third_party/glm/gtx/color_space_YCoCg.hpp index 52477dbb95..a41803750e 100644 --- a/third_party/glm/gtx/color_space_YCoCg.hpp +++ b/third_party/glm/gtx/color_space_YCoCg.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_color_space_YCoCg is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") #endif namespace glm diff --git a/third_party/glm/gtx/common.hpp b/third_party/glm/gtx/common.hpp index 14659d9cb7..283f947b9d 100644 --- a/third_party/glm/gtx/common.hpp +++ b/third_party/glm/gtx/common.hpp @@ -18,12 +18,10 @@ #include "../vec4.hpp" #include "../gtc/vec1.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_common is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_common extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_common extension included") #endif namespace glm diff --git a/third_party/glm/gtx/common.inl b/third_party/glm/gtx/common.inl index 4ad2126d96..4575b20752 100644 --- a/third_party/glm/gtx/common.inl +++ b/third_party/glm/gtx/common.inl @@ -29,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; @@ -44,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)); @@ -56,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), @@ -69,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), @@ -83,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/third_party/glm/gtx/compatibility.hpp b/third_party/glm/gtx/compatibility.hpp index 0c59448555..463f86fe4e 100644 --- a/third_party/glm/gtx/compatibility.hpp +++ b/third_party/glm/gtx/compatibility.hpp @@ -16,12 +16,10 @@ #include "../glm.hpp" #include "../gtc/quaternion.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_compatibility is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_compatibility extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_compatibility extension included") #endif #if GLM_COMPILER & GLM_COMPILER_VC @@ -47,15 +45,15 @@ 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) diff --git a/third_party/glm/gtx/component_wise.hpp b/third_party/glm/gtx/component_wise.hpp index 81c8ff48e1..b1caaa2744 100644 --- a/third_party/glm/gtx/component_wise.hpp +++ b/third_party/glm/gtx/component_wise.hpp @@ -18,12 +18,10 @@ #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_component_wise is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_component_wise extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_component_wise extension included") #endif namespace glm @@ -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/third_party/glm/gtx/component_wise.inl b/third_party/glm/gtx/component_wise.inl index cbbc7d41ec..f8217b2efe 100644 --- a/third_party/glm/gtx/component_wise.inl +++ b/third_party/glm/gtx/component_wise.inl @@ -1,6 +1,8 @@ /// @ref gtx_component_wise +#include "../ext/scalar_common.hpp" #include +#include namespace glm{ namespace detail @@ -124,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/third_party/glm/gtx/dual_quaternion.hpp b/third_party/glm/gtx/dual_quaternion.hpp index 46c6c9ff9d..04a60706ef 100644 --- a/third_party/glm/gtx/dual_quaternion.hpp +++ b/third_party/glm/gtx/dual_quaternion.hpp @@ -20,12 +20,10 @@ #include "../gtc/constants.hpp" #include "../gtc/quaternion.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_dual_quaternion is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_dual_quaternion extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_dual_quaternion extension included") #endif namespace glm @@ -56,35 +54,35 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT; - 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(qua const& real); - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& orientation, vec<3, T, Q> const& translation); - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& real, qua 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 GLM_CONSTEXPR tdualquat(mat<2, 4, T, Q> const& holder_mat); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR 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/third_party/glm/gtx/dual_quaternion.inl b/third_party/glm/gtx/dual_quaternion.inl index fad07ea842..3a04160e3a 100644 --- a/third_party/glm/gtx/dual_quaternion.inl +++ b/third_party/glm/gtx/dual_quaternion.inl @@ -25,15 +25,15 @@ namespace glm # if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() + GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() # if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE : real(qua()) - , dual(qua(0, 0, 0, 0)) + , dual(qua::wxyz(0, 0, 0, 0)) # endif {} 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) {} @@ -50,16 +50,16 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r) - : real(r), dual(qua(0, 0, 0, 0)) + : real(r), dual(qua::wxyz(0, 0, 0, 0)) {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& q, vec<3, T, Q> const& p) - : real(q), dual( + : 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 @@ -92,7 +92,7 @@ namespace glm # 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; @@ -219,8 +219,8 @@ namespace glm GLM_FUNC_QUALIFIER tdualquat dual_quat_identity() { return tdualquat( - qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)), - qua(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 @@ -295,8 +295,8 @@ namespace glm GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<2, 4, T, Q> const& x) { return tdualquat( - qua( x[0].w, x[0].x, x[0].y, x[0].z ), - qua( 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 diff --git a/third_party/glm/gtx/easing.hpp b/third_party/glm/gtx/easing.hpp index d4eaada978..50ed9037b1 100644 --- a/third_party/glm/gtx/easing.hpp +++ b/third_party/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) @@ -21,12 +21,10 @@ #include "../gtc/constants.hpp" #include "../detail/qualifier.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_easing is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_easing extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_easing extension included") #endif namespace glm{ diff --git a/third_party/glm/gtx/easing.inl b/third_party/glm/gtx/easing.inl index 4b7d05b719..b599c30664 100644 --- a/third_party/glm/gtx/easing.inl +++ b/third_party/glm/gtx/easing.inl @@ -425,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/third_party/glm/gtx/euler_angles.hpp b/third_party/glm/gtx/euler_angles.hpp index 888e9687ae..5d67d8eb54 100644 --- a/third_party/glm/gtx/euler_angles.hpp +++ b/third_party/glm/gtx/euler_angles.hpp @@ -18,12 +18,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_euler_angles is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_euler_angles extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_euler_angles extension included") #endif namespace glm @@ -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/third_party/glm/gtx/euler_angles.inl b/third_party/glm/gtx/euler_angles.inl index 68c50124e8..85f22b902e 100644 --- a/third_party/glm/gtx/euler_angles.inl +++ b/third_party/glm/gtx/euler_angles.inl @@ -665,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; } @@ -694,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) { - T T1 = glm::atan2(M[2][1], M[2][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 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 ]); + 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; @@ -716,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; @@ -733,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; @@ -750,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; @@ -767,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; @@ -784,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; @@ -801,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; @@ -818,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; @@ -835,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; @@ -852,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; @@ -869,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; @@ -886,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/third_party/glm/gtx/extend.hpp b/third_party/glm/gtx/extend.hpp index ad30944a6c..46bf5e7059 100644 --- a/third_party/glm/gtx/extend.hpp +++ b/third_party/glm/gtx/extend.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_extend extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_extend extension included") #endif namespace glm diff --git a/third_party/glm/gtx/extended_min_max.hpp b/third_party/glm/gtx/extended_min_max.hpp index 0ed34169c5..e1b722fe49 100644 --- a/third_party/glm/gtx/extended_min_max.hpp +++ b/third_party/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. @@ -16,12 +16,10 @@ #include "../glm.hpp" #include "../ext/vector_common.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_extented_min_max is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_extented_min_max extension included") -# endif +#ifndef GLM_ENABLE_EXPERIMENTAL +# 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 diff --git a/third_party/glm/gtx/exterior_product.hpp b/third_party/glm/gtx/exterior_product.hpp index b473859aed..1979acc847 100644 --- a/third_party/glm/gtx/exterior_product.hpp +++ b/third_party/glm/gtx/exterior_product.hpp @@ -17,12 +17,10 @@ #include "../detail/setup.hpp" #include "../detail/qualifier.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_exterior_product is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_exterior_product extension included") -# endif +#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 namespace glm @@ -37,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/third_party/glm/gtx/exterior_product.inl b/third_party/glm/gtx/exterior_product.inl index 93661fd3fd..690085d6f6 100644 --- a/third_party/glm/gtx/exterior_product.inl +++ b/third_party/glm/gtx/exterior_product.inl @@ -8,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; } @@ -18,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/third_party/glm/gtx/fast_exponential.hpp b/third_party/glm/gtx/fast_exponential.hpp index 206464a7bd..9fae32521f 100644 --- a/third_party/glm/gtx/fast_exponential.hpp +++ b/third_party/glm/gtx/fast_exponential.hpp @@ -16,12 +16,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_fast_exponential is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_fast_exponential extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_fast_exponential extension included") #endif namespace glm diff --git a/third_party/glm/gtx/fast_exponential.inl b/third_party/glm/gtx/fast_exponential.inl index f139e50563..5b1174246b 100644 --- a/third_party/glm/gtx/fast_exponential.inl +++ b/third_party/glm/gtx/fast_exponential.inl @@ -112,7 +112,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType fastExp2(genType x) { - return fastExp(0.69314718055994530941723212145818f * x); + return fastExp(static_cast(0.69314718055994530941723212145818) * x); } template @@ -125,7 +125,7 @@ namespace glm template GLM_FUNC_QUALIFIER genType fastLog2(genType x) { - return fastLog(x) / 0.69314718055994530941723212145818f; + return fastLog(x) / static_cast(0.69314718055994530941723212145818); } template diff --git a/third_party/glm/gtx/fast_square_root.hpp b/third_party/glm/gtx/fast_square_root.hpp index 70ce0b0c8a..80729dbda4 100644 --- a/third_party/glm/gtx/fast_square_root.hpp +++ b/third_party/glm/gtx/fast_square_root.hpp @@ -19,12 +19,10 @@ #include "../exponential.hpp" #include "../geometric.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_fast_square_root is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_fast_square_root extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_fast_square_root extension included") #endif namespace glm @@ -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/third_party/glm/gtx/fast_square_root.inl b/third_party/glm/gtx/fast_square_root.inl index 4e6c6de90e..60fdb7a5ac 100644 --- a/third_party/glm/gtx/fast_square_root.inl +++ b/third_party/glm/gtx/fast_square_root.inl @@ -6,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); } @@ -34,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); } @@ -42,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/third_party/glm/gtx/fast_trigonometry.hpp b/third_party/glm/gtx/fast_trigonometry.hpp index 8da7bd6bfe..93acab5fff 100644 --- a/third_party/glm/gtx/fast_trigonometry.hpp +++ b/third_party/glm/gtx/fast_trigonometry.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../gtc/constants.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_fast_trigonometry is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_fast_trigonometry extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_fast_trigonometry extension included") #endif namespace glm diff --git a/third_party/glm/gtx/float_normalize.inl b/third_party/glm/gtx/float_normalize.inl new file mode 100644 index 0000000000..8cdbc5aaa9 --- /dev/null +++ b/third_party/glm/gtx/float_normalize.inl @@ -0,0 +1,13 @@ +/// @ref gtx_float_normalize + +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) + { + return vec(v) / static_cast(std::numeric_limits::max()); + } + +}//namespace glm diff --git a/third_party/glm/gtx/functions.hpp b/third_party/glm/gtx/functions.hpp index d40fc88157..df68a0d74d 100644 --- a/third_party/glm/gtx/functions.hpp +++ b/third_party/glm/gtx/functions.hpp @@ -18,12 +18,10 @@ #include "../detail/qualifier.hpp" #include "../detail/type_vec2.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_functions is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_functions extension included") -# endif +#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 namespace glm diff --git a/third_party/glm/gtx/gradient_paint.hpp b/third_party/glm/gtx/gradient_paint.hpp index 3fb2e7c15e..5656445dfe 100644 --- a/third_party/glm/gtx/gradient_paint.hpp +++ b/third_party/glm/gtx/gradient_paint.hpp @@ -17,12 +17,10 @@ #include "../glm.hpp" #include "../gtx/optimum_pow.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_gradient_paint is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_gradient_paint extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_gradient_paint extension included") #endif namespace glm diff --git a/third_party/glm/gtx/handed_coordinate_space.hpp b/third_party/glm/gtx/handed_coordinate_space.hpp index b53cd158d2..7c2aada016 100644 --- a/third_party/glm/gtx/handed_coordinate_space.hpp +++ b/third_party/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. @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_handed_coordinate_space is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") #endif namespace glm diff --git a/third_party/glm/gtx/hash.hpp b/third_party/glm/gtx/hash.hpp index c0b2541626..ef89290b43 100644 --- a/third_party/glm/gtx/hash.hpp +++ b/third_party/glm/gtx/hash.hpp @@ -12,16 +12,14 @@ #pragma once -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +#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 before including it, if you really want to use it.") +# 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" @@ -42,101 +40,107 @@ #include "../mat4x3.hpp" #include "../mat4x4.hpp" -#if !GLM_HAS_CXX11_STL -# error "GLM_GTX_hash requires C++11 standard library support" +#if __cplusplus < 201103L +#pragma message("GLM_GTX_hash requires C++11 standard library support") #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::qua 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/third_party/glm/gtx/hash.inl b/third_party/glm/gtx/hash.inl index ff71ca9f7e..bcadfe53e5 100644 --- a/third_party/glm/gtx/hash.inl +++ b/third_party/glm/gtx/hash.inl @@ -1,13 +1,4 @@ /// @ref gtx_hash -/// -/// @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 @@ -22,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; @@ -39,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; @@ -50,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; @@ -62,7 +53,7 @@ namespace std } template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::qua const& q) const + GLM_FUNC_QUALIFIER size_t hash >::operator()(glm::qua const& q) const GLM_NOEXCEPT { size_t seed = 0; hash hasher; @@ -74,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])); @@ -125,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])); @@ -136,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])); @@ -147,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])); @@ -159,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])); @@ -171,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/third_party/glm/gtx/integer.hpp b/third_party/glm/gtx/integer.hpp index ec4cb2c04e..2b168302df 100644 --- a/third_party/glm/gtx/integer.hpp +++ b/third_party/glm/gtx/integer.hpp @@ -16,12 +16,10 @@ #include "../glm.hpp" #include "../gtc/integer.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_integer is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_integer extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_integer extension included") #endif namespace glm diff --git a/third_party/glm/gtx/integer.inl b/third_party/glm/gtx/integer.inl index 956366b250..eb5df30cfc 100644 --- a/third_party/glm/gtx/integer.inl +++ b/third_party/glm/gtx/integer.inl @@ -141,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 @@ -181,5 +181,5 @@ namespace detail } #endif//(GLM_COMPILER) - +*/ }//namespace glm diff --git a/third_party/glm/gtx/intersect.hpp b/third_party/glm/gtx/intersect.hpp index 25f7076227..c7aec6f223 100644 --- a/third_party/glm/gtx/intersect.hpp +++ b/third_party/glm/gtx/intersect.hpp @@ -21,12 +21,10 @@ #include "../gtx/closest_point.hpp" #include "../gtx/vector_query.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_closest_point extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_closest_point extension included") #endif namespace glm @@ -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/third_party/glm/gtx/intersect.inl b/third_party/glm/gtx/intersect.inl index 54ecb4d909..925a903d4a 100644 --- a/third_party/glm/gtx/intersect.inl +++ b/third_party/glm/gtx/intersect.inl @@ -45,7 +45,7 @@ namespace glm 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 dist = orig - vert0; @@ -63,7 +63,7 @@ namespace glm 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 dist = orig - vert0; @@ -108,25 +108,25 @@ namespace glm genType Perpendicular = cross(dir, edge2); - float det = dot(edge1, Perpendicular); + typename genType::value_type det = dot(edge1, Perpendicular); if (det > -Epsilon && det < Epsilon) return false; typename genType::value_type inv_det = typename genType::value_type(1) / det; - genType Tengant = orig - vert0; + genType Tangent = orig - vert0; - position.y = dot(Tengant, Perpendicular) * 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 Cotengant = cross(Tengant, edge1); + genType Cotangent = cross(Tangent, edge1); - position.z = dot(dir, Cotengant) * 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, Cotengant) * inv_det; + position.x = dot(edge2, Cotangent) * inv_det; return true; } @@ -135,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 ) { @@ -143,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/third_party/glm/gtx/io.hpp b/third_party/glm/gtx/io.hpp index 928a7049b1..5afc8ccf79 100644 --- a/third_party/glm/gtx/io.hpp +++ b/third_party/glm/gtx/io.hpp @@ -23,12 +23,17 @@ #include "../glm.hpp" #include "../gtx/quaternion.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_io is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_io extension included") -# endif +#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_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&, qua 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/third_party/glm/gtx/io.inl b/third_party/glm/gtx/io.inl index a3a1bb6c26..d4ef825eb2 100644 --- a/third_party/glm/gtx/io.inl +++ b/third_party/glm/gtx/io.inl @@ -6,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 { @@ -167,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; } @@ -438,3 +445,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/third_party/glm/gtx/log_base.hpp b/third_party/glm/gtx/log_base.hpp index 3852b98b05..915c7a4a05 100644 --- a/third_party/glm/gtx/log_base.hpp +++ b/third_party/glm/gtx/log_base.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_log_base is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_log_base extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_log_base extension included") #endif namespace glm diff --git a/third_party/glm/gtx/matrix_cross_product.hpp b/third_party/glm/gtx/matrix_cross_product.hpp index 1792fd9c57..882a1d760d 100644 --- a/third_party/glm/gtx/matrix_cross_product.hpp +++ b/third_party/glm/gtx/matrix_cross_product.hpp @@ -16,12 +16,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_cross_product is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_cross_product extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_matrix_cross_product extension included") #endif namespace glm diff --git a/third_party/glm/gtx/matrix_decompose.hpp b/third_party/glm/gtx/matrix_decompose.hpp index 4da8fe11ac..19ac8a8b7d 100644 --- a/third_party/glm/gtx/matrix_decompose.hpp +++ b/third_party/glm/gtx/matrix_decompose.hpp @@ -20,12 +20,10 @@ #include "../gtc/quaternion.hpp" #include "../gtc/matrix_transform.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_decompose is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_decompose extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_matrix_decompose extension included") #endif namespace glm @@ -36,10 +34,16 @@ 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, 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/third_party/glm/gtx/matrix_decompose.inl b/third_party/glm/gtx/matrix_decompose.inl index 694f5eca74..1b587e2a1b 100644 --- a/third_party/glm/gtx/matrix_decompose.inl +++ b/third_party/glm/gtx/matrix_decompose.inl @@ -2,6 +2,7 @@ #include "../gtc/constants.hpp" #include "../gtc/epsilon.hpp" +#include "../gtx/transform.hpp" namespace glm{ namespace detail @@ -172,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/third_party/glm/gtx/matrix_factorisation.hpp b/third_party/glm/gtx/matrix_factorisation.hpp index 10ee498420..dc32847b62 100644 --- a/third_party/glm/gtx/matrix_factorisation.hpp +++ b/third_party/glm/gtx/matrix_factorisation.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_factorisation is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_factorisation extension included") -# endif +#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." +#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/third_party/glm/gtx/matrix_factorisation.inl b/third_party/glm/gtx/matrix_factorisation.inl index c479b8ad99..6f1683c007 100644 --- a/third_party/glm/gtx/matrix_factorisation.inl +++ b/third_party/glm/gtx/matrix_factorisation.inl @@ -28,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... @@ -64,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/third_party/glm/gtx/matrix_interpolation.hpp b/third_party/glm/gtx/matrix_interpolation.hpp index 1896906f12..e2767c83e9 100644 --- a/third_party/glm/gtx/matrix_interpolation.hpp +++ b/third_party/glm/gtx/matrix_interpolation.hpp @@ -16,12 +16,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_interpolation is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_interpolation extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_matrix_interpolation extension included") #endif namespace glm @@ -32,7 +30,7 @@ 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( + 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. diff --git a/third_party/glm/gtx/matrix_interpolation.inl b/third_party/glm/gtx/matrix_interpolation.inl index de40b7d745..f4ba3a6f3a 100644 --- a/third_party/glm/gtx/matrix_interpolation.inl +++ b/third_party/glm/gtx/matrix_interpolation.inl @@ -1,26 +1,37 @@ /// @ref gtx_matrix_interpolation -#include "../gtc/constants.hpp" +#include "../ext/scalar_constants.hpp" + +#include namespace glm { template - GLM_FUNC_QUALIFIER void axisAngle(mat<4, 4, T, Q> const& m, 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(m[1][0] - m[0][1]) < epsilon) && (abs(m[2][0] - m[0][2]) < epsilon) && (abs(m[2][1] - m[1][2]) < epsilon)) + if(nearSymmetrical) { - if ((abs(m[1][0] + m[0][1]) < epsilon2) && (abs(m[2][0] + m[0][2]) < epsilon2) && (abs(m[2][1] + m[1][2]) < epsilon2) && (abs(m[0][0] + m[1][1] + m[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); + 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); @@ -74,17 +85,23 @@ namespace glm } return; } - T s = sqrt((m[2][1] - m[1][2]) * (m[2][1] - m[1][2]) + (m[2][0] - m[0][2]) * (m[2][0] - m[0][2]) + (m[1][0] - m[0][1]) * (m[1][0] - m[0][1])); - if (glm::abs(s) < T(0.001)) - s = static_cast(1); + T const angleCos = (m[0][0] + m[1][1] + m[2][2] - static_cast(1)) * static_cast(0.5); - if(angleCos - static_cast(1) < epsilon) - angle = pi() * static_cast(0.25); + 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 = (m[1][2] - m[2][1]) / s; - axis.y = (m[2][0] - m[0][2]) / s; - axis.z = (m[0][1] - m[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/third_party/glm/gtx/matrix_major_storage.hpp b/third_party/glm/gtx/matrix_major_storage.hpp index aa0022b73a..f5185786cd 100644 --- a/third_party/glm/gtx/matrix_major_storage.hpp +++ b/third_party/glm/gtx/matrix_major_storage.hpp @@ -16,12 +16,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_major_storage is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_major_storage extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_matrix_major_storage extension included") #endif namespace glm diff --git a/third_party/glm/gtx/matrix_operation.hpp b/third_party/glm/gtx/matrix_operation.hpp index 04349502eb..07ed8e843d 100644 --- a/third_party/glm/gtx/matrix_operation.hpp +++ b/third_party/glm/gtx/matrix_operation.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_operation is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_operation extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_matrix_operation extension included") #endif namespace glm diff --git a/third_party/glm/gtx/matrix_operation.inl b/third_party/glm/gtx/matrix_operation.inl index 9de83f8236..a4f4a85000 100644 --- a/third_party/glm/gtx/matrix_operation.inl +++ b/third_party/glm/gtx/matrix_operation.inl @@ -119,8 +119,8 @@ namespace glm 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[1][0], - -m[0][1], +m[0][0]); + +m[1][1], -m[0][1], + -m[1][0], +m[0][0]); } template @@ -149,7 +149,7 @@ namespace glm { 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][2], m[2][3], m[3][0], m[3][1], 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])); @@ -168,9 +168,9 @@ namespace glm 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, -m01, +m02, -m03, - -m10, +m11, -m12, +m13, - +m20, -m21, +m22, -m23, - -m30, +m31, -m32, +m33); + +m00, -m10, +m20, -m30, + -m01, +m11, -m21, +m31, + +m02, -m12, +m22, -m32, + -m03, +m13, -m23, +m33); } }//namespace glm diff --git a/third_party/glm/gtx/matrix_query.hpp b/third_party/glm/gtx/matrix_query.hpp index 369e54b2ce..de8c65593d 100644 --- a/third_party/glm/gtx/matrix_query.hpp +++ b/third_party/glm/gtx/matrix_query.hpp @@ -18,12 +18,10 @@ #include "../gtx/vector_query.hpp" #include -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_query is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_query extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_matrix_query extension included") #endif namespace glm diff --git a/third_party/glm/gtx/matrix_query.inl b/third_party/glm/gtx/matrix_query.inl index 77bd23108e..dc3ec8453b 100644 --- a/third_party/glm/gtx/matrix_query.inl +++ b/third_party/glm/gtx/matrix_query.inl @@ -33,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; @@ -97,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/third_party/glm/gtx/matrix_transform_2d.hpp b/third_party/glm/gtx/matrix_transform_2d.hpp index 468be01ef5..deb8da2dc6 100644 --- a/third_party/glm/gtx/matrix_transform_2d.hpp +++ b/third_party/glm/gtx/matrix_transform_2d.hpp @@ -17,12 +17,10 @@ #include "../mat3x3.hpp" #include "../vec2.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_transform_2d is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_transform_2d extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_matrix_transform_2d extension included") #endif namespace glm diff --git a/third_party/glm/gtx/mixed_product.hpp b/third_party/glm/gtx/mixed_product.hpp index dbbd2ebf81..a091274cbb 100644 --- a/third_party/glm/gtx/mixed_product.hpp +++ b/third_party/glm/gtx/mixed_product.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_mixed_product is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_mixed_product extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_mixed_product extension included") #endif namespace glm diff --git a/third_party/glm/gtx/norm.hpp b/third_party/glm/gtx/norm.hpp index 586dd129c7..d6724a80b6 100644 --- a/third_party/glm/gtx/norm.hpp +++ b/third_party/glm/gtx/norm.hpp @@ -19,12 +19,10 @@ #include "../gtx/quaternion.hpp" #include "../gtx/component_wise.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_norm is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_norm extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_norm extension included") #endif namespace glm diff --git a/third_party/glm/gtx/norm.inl b/third_party/glm/gtx/norm.inl index 6db561b37e..4a9f796451 100644 --- a/third_party/glm/gtx/norm.inl +++ b/third_party/glm/gtx/norm.inl @@ -18,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); } diff --git a/third_party/glm/gtx/normal.hpp b/third_party/glm/gtx/normal.hpp index d90011a513..8b3a4b54b3 100644 --- a/third_party/glm/gtx/normal.hpp +++ b/third_party/glm/gtx/normal.hpp @@ -16,12 +16,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_normal is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_normal extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_normal extension included") #endif namespace glm diff --git a/third_party/glm/gtx/normalize_dot.hpp b/third_party/glm/gtx/normalize_dot.hpp index f7afc9acf3..04a6b08a98 100644 --- a/third_party/glm/gtx/normalize_dot.hpp +++ b/third_party/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. @@ -16,12 +16,10 @@ // Dependency: #include "../gtx/fast_square_root.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_normalize_dot is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_normalize_dot extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_normalize_dot extension included") #endif namespace glm diff --git a/third_party/glm/gtx/number_precision.hpp b/third_party/glm/gtx/number_precision.hpp index 9fbfde02c7..5b9663ed74 100644 --- a/third_party/glm/gtx/number_precision.hpp +++ b/third_party/glm/gtx/number_precision.hpp @@ -18,34 +18,19 @@ #include "../glm.hpp" #include "../gtc/type_precision.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_number_precision is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_number_precision extension included") -# endif +#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." +#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/third_party/glm/gtx/number_precision.inl b/third_party/glm/gtx/number_precision.inl deleted file mode 100644 index b39d71c3b4..0000000000 --- a/third_party/glm/gtx/number_precision.inl +++ /dev/null @@ -1,6 +0,0 @@ -/// @ref gtx_number_precision - -namespace glm -{ - -} diff --git a/third_party/glm/gtx/optimum_pow.hpp b/third_party/glm/gtx/optimum_pow.hpp index 3d106f79d6..ac34e7e1ff 100644 --- a/third_party/glm/gtx/optimum_pow.hpp +++ b/third_party/glm/gtx/optimum_pow.hpp @@ -15,16 +15,13 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_optimum_pow is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_optimum_pow extension included") -# endif +#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." +#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/third_party/glm/gtx/orthonormalize.hpp b/third_party/glm/gtx/orthonormalize.hpp index afad299fb9..801b7558a4 100644 --- a/third_party/glm/gtx/orthonormalize.hpp +++ b/third_party/glm/gtx/orthonormalize.hpp @@ -18,12 +18,10 @@ #include "../mat3x3.hpp" #include "../geometric.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_orthonormalize is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_orthonormalize extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_orthonormalize extension included") #endif namespace glm diff --git a/third_party/glm/gtx/pca.hpp b/third_party/glm/gtx/pca.hpp new file mode 100644 index 0000000000..26f9aecdf1 --- /dev/null +++ b/third_party/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/third_party/glm/gtx/pca.inl b/third_party/glm/gtx/pca.inl new file mode 100644 index 0000000000..94cae946e8 --- /dev/null +++ b/third_party/glm/gtx/pca.inl @@ -0,0 +1,343 @@ +/// @ref gtx_pca + +#ifndef GLM_HAS_CXX11_STL +#include +#else +#include +#endif + +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/third_party/glm/gtx/perpendicular.hpp b/third_party/glm/gtx/perpendicular.hpp index e2c0c0a3c8..4087ab04a7 100644 --- a/third_party/glm/gtx/perpendicular.hpp +++ b/third_party/glm/gtx/perpendicular.hpp @@ -17,12 +17,10 @@ #include "../glm.hpp" #include "../gtx/projection.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_perpendicular is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_perpendicular extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_perpendicular extension included") #endif namespace glm diff --git a/third_party/glm/gtx/polar_coordinates.hpp b/third_party/glm/gtx/polar_coordinates.hpp index 479e1e462e..c27aacfe61 100644 --- a/third_party/glm/gtx/polar_coordinates.hpp +++ b/third_party/glm/gtx/polar_coordinates.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_polar_coordinates is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_polar_coordinates extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_polar_coordinates extension included") #endif namespace glm diff --git a/third_party/glm/gtx/projection.hpp b/third_party/glm/gtx/projection.hpp index c8358049b3..a438f396e6 100644 --- a/third_party/glm/gtx/projection.hpp +++ b/third_party/glm/gtx/projection.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../geometric.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_projection is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_projection extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_projection extension included") #endif namespace glm diff --git a/third_party/glm/gtx/quaternion.hpp b/third_party/glm/gtx/quaternion.hpp index 298caeff5c..f51c521cc3 100644 --- a/third_party/glm/gtx/quaternion.hpp +++ b/third_party/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 @@ -20,12 +20,10 @@ #include "../ext/quaternion_exponential.hpp" #include "../gtx/norm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_quaternion is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_quaternion extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_quaternion extension included") #endif namespace glm @@ -43,7 +41,7 @@ namespace glm /// /// @see gtx_quaternion template - GLM_FUNC_DECL vec<3, T, Q> cross( + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross( qua const& q, vec<3, T, Q> const& v); @@ -51,7 +49,7 @@ namespace glm /// /// @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, qua const& q); @@ -110,28 +108,28 @@ namespace glm /// /// @see gtx_quaternion template - GLM_FUNC_DECL mat<3, 3, T, Q> toMat3( + 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( + 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 qua 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 qua toQuat( + GLM_FUNC_QUALIFIER qua toQuat( mat<4, 4, T, Q> const& x){return quat_cast(x);} /// Quaternion interpolation using the rotation short path. diff --git a/third_party/glm/gtx/quaternion.inl b/third_party/glm/gtx/quaternion.inl index d125bccc9a..5e18899a71 100644 --- a/third_party/glm/gtx/quaternion.inl +++ b/third_party/glm/gtx/quaternion.inl @@ -8,17 +8,17 @@ namespace glm template GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua quat_identity() { - return qua(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, qua 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(qua 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; } @@ -105,7 +105,7 @@ namespace glm k1 = sin((static_cast(0) + a) * fAngle) * fOneOverSin; } - return qua( + return qua::wxyz( k0 * x.w + k1 * y2.w, k0 * x.x + k1 * y2.x, k0 * x.y + k1 * y2.y, @@ -150,7 +150,7 @@ namespace glm T s = sqrt((T(1) + cosTheta) * static_cast(2)); T invs = static_cast(1) / s; - return qua( + return qua::wxyz( s * static_cast(0.5f), rotationAxis.x * invs, rotationAxis.y * invs, diff --git a/third_party/glm/gtx/range.hpp b/third_party/glm/gtx/range.hpp index f28bd2de73..50c5e57be6 100644 --- a/third_party/glm/gtx/range.hpp +++ b/third_party/glm/gtx/range.hpp @@ -15,12 +15,10 @@ // Dependencies #include "../detail/setup.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_range is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_range extension included") -# endif +#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." +#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/third_party/glm/gtx/raw_data.hpp b/third_party/glm/gtx/raw_data.hpp index 33356636ca..3bc27b98dd 100644 --- a/third_party/glm/gtx/raw_data.hpp +++ b/third_party/glm/gtx/raw_data.hpp @@ -16,12 +16,10 @@ #include "../ext/scalar_uint_sized.hpp" #include "../detail/setup.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_raw_data is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_raw_data extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_raw_data extension included") #endif namespace glm diff --git a/third_party/glm/gtx/rotate_normalized_axis.hpp b/third_party/glm/gtx/rotate_normalized_axis.hpp index 1e886cfcbd..02c3f5c7e4 100644 --- a/third_party/glm/gtx/rotate_normalized_axis.hpp +++ b/third_party/glm/gtx/rotate_normalized_axis.hpp @@ -19,12 +19,10 @@ #include "../gtc/epsilon.hpp" #include "../gtc/quaternion.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_rotate_normalized_axis is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") #endif namespace glm diff --git a/third_party/glm/gtx/rotate_normalized_axis.inl b/third_party/glm/gtx/rotate_normalized_axis.inl index b2e9278c0a..352a56cb17 100644 --- a/third_party/glm/gtx/rotate_normalized_axis.inl +++ b/third_party/glm/gtx/rotate_normalized_axis.inl @@ -52,7 +52,7 @@ namespace glm T const AngleRad(angle); T const Sin = sin(AngleRad * T(0.5)); - return q * qua(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/third_party/glm/gtx/rotate_vector.hpp b/third_party/glm/gtx/rotate_vector.hpp index a86f55f39f..b7345bf41e 100644 --- a/third_party/glm/gtx/rotate_vector.hpp +++ b/third_party/glm/gtx/rotate_vector.hpp @@ -19,12 +19,10 @@ #include "../ext/vector_relational.hpp" #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_rotate_vector is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_rotate_vector extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_rotate_vector extension included") #endif namespace glm diff --git a/third_party/glm/gtx/scalar_multiplication.hpp b/third_party/glm/gtx/scalar_multiplication.hpp index 7d7fc69c5c..97df000035 100644 --- a/third_party/glm/gtx/scalar_multiplication.hpp +++ b/third_party/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 @@ -16,12 +19,10 @@ #include "../detail/setup.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_scalar_multiplication is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_scalar_multiplication extension included") -# endif +#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." +#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 @@ -72,4 +76,5 @@ GLM_IMPLEMENT_SCAL_MULT(mat4x3) GLM_IMPLEMENT_SCAL_MULT(mat4) #undef GLM_IMPLEMENT_SCAL_MULT + /// @} } // namespace glm diff --git a/third_party/glm/gtx/scalar_relational.hpp b/third_party/glm/gtx/scalar_relational.hpp index 2b759280b9..e8409329b6 100644 --- a/third_party/glm/gtx/scalar_relational.hpp +++ b/third_party/glm/gtx/scalar_relational.hpp @@ -15,12 +15,10 @@ // Dependency: #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_extend extension included") -# endif +#ifndef GLM_ENABLE_EXPERIMENTAL +# 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/third_party/glm/gtx/spline.hpp b/third_party/glm/gtx/spline.hpp index 4f72255879..8df5584913 100644 --- a/third_party/glm/gtx/spline.hpp +++ b/third_party/glm/gtx/spline.hpp @@ -16,12 +16,10 @@ #include "../glm.hpp" #include "../gtx/optimum_pow.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_spline is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_spline extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_spline extension included") #endif namespace glm diff --git a/third_party/glm/gtx/std_based_type.hpp b/third_party/glm/gtx/std_based_type.hpp index 27212e3704..864885de7a 100644 --- a/third_party/glm/gtx/std_based_type.hpp +++ b/third_party/glm/gtx/std_based_type.hpp @@ -17,12 +17,10 @@ #include "../glm.hpp" #include -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_std_based_type is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_std_based_type extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_std_based_type extension included") #endif namespace glm diff --git a/third_party/glm/gtx/string_cast.hpp b/third_party/glm/gtx/string_cast.hpp index 9252b0649e..2958edc469 100644 --- a/third_party/glm/gtx/string_cast.hpp +++ b/third_party/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,17 +21,12 @@ #include "../gtx/dual_quaternion.hpp" #include #include +#include -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_string_cast extension included") -# endif -#endif - -#if(GLM_COMPILER & GLM_COMPILER_CUDA) -# error "GLM_GTX_string_cast is not supported on CUDA compiler" +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_string_cast extension included") #endif namespace glm diff --git a/third_party/glm/gtx/string_cast.inl b/third_party/glm/gtx/string_cast.inl index f67751d41c..875f2be3c1 100644 --- a/third_party/glm/gtx/string_cast.inl +++ b/third_party/glm/gtx/string_cast.inl @@ -18,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// - std::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"; diff --git a/third_party/glm/gtx/texture.hpp b/third_party/glm/gtx/texture.hpp index ddacede762..608c6ad03f 100644 --- a/third_party/glm/gtx/texture.hpp +++ b/third_party/glm/gtx/texture.hpp @@ -17,12 +17,10 @@ #include "../gtc/integer.hpp" #include "../gtx/component_wise.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_texture is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_texture extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_texture extension included") #endif namespace glm diff --git a/third_party/glm/gtx/transform.hpp b/third_party/glm/gtx/transform.hpp index 467c527817..9707b5041b 100644 --- a/third_party/glm/gtx/transform.hpp +++ b/third_party/glm/gtx/transform.hpp @@ -19,12 +19,10 @@ #include "../glm.hpp" #include "../gtc/matrix_transform.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_transform is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_transform extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_transform extension included") #endif namespace glm diff --git a/third_party/glm/gtx/transform2.hpp b/third_party/glm/gtx/transform2.hpp index 0f73251947..9604a92312 100644 --- a/third_party/glm/gtx/transform2.hpp +++ b/third_party/glm/gtx/transform2.hpp @@ -17,12 +17,10 @@ #include "../glm.hpp" #include "../gtx/transform.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_transform2 is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_transform2 extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_transform2 extension included") #endif namespace glm diff --git a/third_party/glm/gtx/transform2.inl b/third_party/glm/gtx/transform2.inl index 2b53198b33..0118ab0960 100644 --- a/third_party/glm/gtx/transform2.inl +++ b/third_party/glm/gtx/transform2.inl @@ -119,7 +119,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/third_party/glm/gtx/type_aligned.hpp b/third_party/glm/gtx/type_aligned.hpp index 574af26960..ec40935847 100644 --- a/third_party/glm/gtx/type_aligned.hpp +++ b/third_party/glm/gtx/type_aligned.hpp @@ -17,12 +17,10 @@ #include "../gtc/type_precision.hpp" #include "../gtc/quaternion.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_type_aligned is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_type_aligned extension included") -# endif +#ifndef GLM_ENABLE_EXPERIMENTAL +# 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 namespace glm diff --git a/third_party/glm/gtx/type_trait.hpp b/third_party/glm/gtx/type_trait.hpp index d12ea1ab83..17ddbad1b8 100644 --- a/third_party/glm/gtx/type_trait.hpp +++ b/third_party/glm/gtx/type_trait.hpp @@ -12,12 +12,10 @@ #pragma once -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_type_trait is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_type_trait extension included") -# endif +#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: diff --git a/third_party/glm/gtx/vec_swizzle.hpp b/third_party/glm/gtx/vec_swizzle.hpp index 99f0509e0d..2dafa645f5 100644 --- a/third_party/glm/gtx/vec_swizzle.hpp +++ b/third_party/glm/gtx/vec_swizzle.hpp @@ -14,2769 +14,2771 @@ #include "../glm.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_vec_swizzle is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_vec_swizzle extension included") -# endif +#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) { + 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); } 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<4, 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) { + GLM_FUNC_QUALIFIER 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) { + GLM_FUNC_QUALIFIER 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/third_party/glm/gtx/vector_angle.hpp b/third_party/glm/gtx/vector_angle.hpp index 05821e3603..9ff41279b3 100644 --- a/third_party/glm/gtx/vector_angle.hpp +++ b/third_party/glm/gtx/vector_angle.hpp @@ -20,12 +20,10 @@ #include "../gtx/quaternion.hpp" #include "../gtx/rotate_vector.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_vector_angle is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_vector_angle extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_vector_angle extension included") #endif namespace glm diff --git a/third_party/glm/gtx/vector_angle.inl b/third_party/glm/gtx/vector_angle.inl index a1f957a594..11e1a21837 100644 --- a/third_party/glm/gtx/vector_angle.inl +++ b/third_party/glm/gtx/vector_angle.inl @@ -16,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; @@ -36,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/third_party/glm/gtx/vector_query.hpp b/third_party/glm/gtx/vector_query.hpp index 0a8effe4d8..ab52df0f20 100644 --- a/third_party/glm/gtx/vector_query.hpp +++ b/third_party/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 @@ -17,12 +17,10 @@ #include #include -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_vector_query is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_vector_query extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_vector_query extension included") #endif namespace glm diff --git a/third_party/glm/gtx/wrap.hpp b/third_party/glm/gtx/wrap.hpp index 99483c5542..b7ac5af263 100644 --- a/third_party/glm/gtx/wrap.hpp +++ b/third_party/glm/gtx/wrap.hpp @@ -18,12 +18,10 @@ #include "../ext/vector_common.hpp" #include "../gtc/vec1.hpp" -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_wrap is an experimental extension and may change in the future. Use before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_wrap extension included") -# endif +#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." +#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTX_wrap extension included") #endif namespace glm diff --git a/third_party/glm/integer.hpp b/third_party/glm/integer.hpp index 8817db3f0a..36c67bec79 100644 --- a/third_party/glm/integer.hpp +++ b/third_party/glm/integer.hpp @@ -62,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, @@ -77,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/third_party/glm/manual.md b/third_party/glm/manual.md index a7f6956f74..2a2352082c 100644 --- a/third_party/glm/manual.md +++ b/third_party/glm/manual.md @@ -1,6 +1,6 @@ ![Alt](./doc/manual/logo-mini.png "GLM Logo") -# GLM 0.9.9 Manual +# GLM 1.0.0 Manual ![Alt](./doc/manual/g-truc.png "G-Truc Logo") @@ -8,6 +8,7 @@
## Table of Contents + + [0. Licenses](#section0) + [1. Getting started](#section1) + [1.1. Using global headers](#section1_1) @@ -170,21 +171,23 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## 1. Getting started + ### 1.1. Using global headers GLM is a header-only library, and thus does not need to be compiled. We can use GLM's implementation of GLSL's mathematics functionality by including the `` header: ```cpp -#include +#include "third_party/glm/latest/glm/glm.hpp" ``` -To extend the feature set supported by GLM and keeping the library as close to GLSL as possible, new features are implemented as extensions that can be included thought a separated header: -```cpp +To extend the feature set supported by GLM and keeping the library as close to GLSL as possible, new features are implemented as extensions that can be included through a separate header: + +```cpp // Include all GLM core / GLSL features -#include // vec2, vec3, mat4, radians +#include "third_party/glm/latest/glm/glm.hpp" // vec2, vec3, mat4, radians // Include all GLM extensions -#include // perspective, translate, rotate +#include "third_party/glm/latest/glm/ext.hpp" // perspective, translate, rotate glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) { @@ -202,39 +205,42 @@ glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, gl ### 1.2. Using separated headers GLM relies on C++ templates heavily, and may significantly increase compilation times for projects that use it. Hence, user projects could only include the features they actually use. Following is the list of all the core features, based on GLSL specification, headers: + ```cpp -#include // vec2, bvec2, dvec2, ivec2 and uvec2 -#include // vec3, bvec3, dvec3, ivec3 and uvec3 -#include // vec4, bvec4, dvec4, ivec4 and uvec4 -#include // mat2, dmat2 -#include // mat2x3, dmat2x3 -#include // mat2x4, dmat2x4 -#include // mat3x2, dmat3x2 -#include // mat3, dmat3 -#include // mat3x4, dmat2 -#include // mat4x2, dmat4x2 -#include // mat4x3, dmat4x3 -#include // mat4, dmat4 -#include // all the GLSL common functions: abs, min, mix, isnan, fma, etc. -#include // all the GLSL exponential functions: pow, log, exp2, sqrt, etc. -#include // all the GLSL geometry functions: dot, cross, reflect, etc. -#include // all the GLSL integer functions: findMSB, bitfieldExtract, etc. -#include // all the GLSL matrix functions: transpose, inverse, etc. -#include // all the GLSL packing functions: packUnorm4x8, unpackHalf2x16, etc. -#include // all the GLSL trigonometric functions: radians, cos, asin, etc. -#include // all the GLSL vector relational functions: equal, less, etc. +#include "third_party/glm/latest/glm/vec2.hpp" // vec2, bvec2, dvec2, ivec2 and uvec2 +#include "third_party/glm/latest/glm/vec3.hpp" // vec3, bvec3, dvec3, ivec3 and uvec3 +#include "third_party/glm/latest/glm/vec4.hpp" // vec4, bvec4, dvec4, ivec4 and uvec4 +#include "third_party/glm/latest/glm/mat2x2.hpp" // mat2, dmat2 +#include "third_party/glm/latest/glm/mat2x3.hpp" // mat2x3, dmat2x3 +#include "third_party/glm/latest/glm/mat2x4.hpp" // mat2x4, dmat2x4 +#include "third_party/glm/latest/glm/mat3x2.hpp" // mat3x2, dmat3x2 +#include "third_party/glm/latest/glm/mat3x3.hpp" // mat3, dmat3 +#include "third_party/glm/latest/glm/mat3x4.hpp" // mat3x4, dmat2 +#include "third_party/glm/latest/glm/mat4x2.hpp" // mat4x2, dmat4x2 +#include "third_party/glm/latest/glm/mat4x3.hpp" // mat4x3, dmat4x3 +#include "third_party/glm/latest/glm/mat4x4.hpp" // mat4, dmat4 +#include "third_party/glm/latest/glm/common.hpp" // all the GLSL common functions: abs, min, mix, isnan, fma, etc. +#include "third_party/glm/latest/glm/exponential.hpp" // all the GLSL exponential functions: pow, log, exp2, sqrt, etc. +#include "third_party/glm/latest/glm/geometric.hpp" // all the GLSL geometry functions: dot, cross, reflect, etc. +#include "third_party/glm/latest/glm/integer.hpp" // all the GLSL integer functions: findMSB, bitfieldExtract, etc. +#include "third_party/glm/latest/glm/matrix.hpp" // all the GLSL matrix functions: transpose, inverse, etc. +#include "third_party/glm/latest/glm/packing.hpp" // all the GLSL packing functions: packUnorm4x8, unpackHalf2x16, etc. +#include "third_party/glm/latest/glm/trigonometric.hpp" // all the GLSL trigonometric functions: radians, cos, asin, etc. +#include "third_party/glm/latest/glm/vector_relational.hpp" // all the GLSL vector relational functions: equal, less, etc. ``` The following is a code sample using separated core headers and an extension: + ```cpp // Include GLM core features -#include // vec2 -#include // vec3 -#include // mat4 -#include //radians +#include "third_party/glm/latest/glm/vec2.hpp" // vec2 +#include "third_party/glm/latest/glm/vec3.hpp" // vec3 +#include "third_party/glm/latest/glm/mat4x4.hpp" // mat4 +#include "third_party/glm/latest/glm/trigonometric.hpp" //radians // Include GLM extension -#include // perspective, translate, rotate +#include "third_party/glm/latest/glm/ext/matrix_transform.hpp" // translate, rotate +#include "third_party/glm/latest/glm/ext/matrix_clip_space.hpp" // perspective glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) { @@ -250,15 +256,17 @@ glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, gl ### 1.3. Using extension headers Using GLM through split headers to minimize the project build time: + ```cpp // Include GLM vector extensions: -#include // vec2 -#include // vec3 -#include // radians +#include "third_party/glm/latest/glm/ext/vector_float2.hpp" // vec2 +#include "third_party/glm/latest/glm/ext/vector_float3.hpp" // vec3 +#include "third_party/glm/latest/glm/ext/vector_trigonometric.hpp" // radians // Include GLM matrix extensions: -#include // mat4 -#include // perspective, translate, rotate +#include "third_party/glm/latest/glm/ext/matrix_float4x4.hpp" // mat4 +#include "third_party/glm/latest/glm/ext/matrix_transform.hpp" // translate, rotate +#include "third_party/glm/latest/glm/ext/matrix_clip_space.hpp" // perspective glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) { @@ -277,7 +285,26 @@ GLM does not depend on external libraries or headers such as ``, [` 1.5. Finding GLM with CMake -GLM packages a `glmConfig.cmake` and `glmConfig-version.cmake` in the root of the repository and the release archives. To find GLM with CMake you can pass `-Dglm_DIR=/cmake/glm/` when running CMake. You can then either add `${GLM_INCLUDE_DIRS}` to your target's include directories, or link against the imported `glm::glm` target. +When installed, GLM provides the CMake package configuration files `glmConfig.cmake` and `glmConfigVersion.cmake`. + +To use these configurations files, you may need to set the `glm_DIR` variable to the directory containing the configuration files `/lib/cmake/glm/`. + +Use the `find_package` CMake command to load the configurations into your project. Lastly, either link your executable against the `glm::glm` target or add `${GLM_INCLUDE_DIRS}` to your target's include directories: + +```cmake +set(glm_DIR /lib/cmake/glm) # if necessary +find_package(glm REQUIRED) +target_link_libraries( glm::glm) +``` + +To use GLM as a submodule in a project instead, use `add_subdirectory` to expose the same target, or add the directory to your target's + +```cmake +add_subdirectory(glm) +target_link_libraries( glm::glm) +# or +target_include_directories( glm) +``` ---
@@ -296,11 +323,12 @@ Using `GLM_FORCE_MESSAGES`, GLM will report the configuration as part of the bui ```cpp #define GLM_FORCE_MESSAGES // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) -#include +#include "third_party/glm/latest/glm/glm.hpp" ``` Example of configuration log generated by `GLM_FORCE_MESSAGES`: -```cpp + +```plaintext GLM: version 0.9.9.1 GLM: C++ 17 with extensions GLM: Clang compiler detected @@ -338,17 +366,18 @@ any inclusion of `` to restrict the language feature set C++98: ```cpp #define GLM_FORCE_CXX98 -#include +#include "third_party/glm/latest/glm/glm.hpp" ``` For C++11, C++14, and C++17 equivalent defines are available: + * `GLM_FORCE_CXX11` * `GLM_FORCE_CXX14` * `GLM_FORCE_CXX17` ```cpp #define GLM_FORCE_CXX11 -#include +#include "third_party/glm/latest/glm/glm.hpp" // If the compiler doesn’t support C++11, compiler errors will happen. ``` @@ -362,7 +391,7 @@ GLSL supports implicit conversions of vector and matrix types. For example, an i Often, this behaviour is not desirable but following the spirit of the library, this is the default behavior in GLM. However, GLM 0.9.6 introduced the define `GLM_FORCE_EXPLICIT_CTOR` to require explicit conversion for GLM types. ```cpp -#include +#include "third_party/glm/latest/glm/glm.hpp" void foo() { @@ -379,7 +408,7 @@ With `GLM_FORCE_EXPLICIT_CTOR` define, implicit conversions are not allowed: ```cpp #define GLM_FORCE_EXPLICIT_CTOR -#include +#include "third_party/glm/latest/glm/glm.hpp" void foo() { @@ -397,7 +426,7 @@ To push further the software performance, a programmer can define `GLM_FORCE_INL ```cpp #define GLM_FORCE_INLINE -#include +#include "third_party/glm/latest/glm/glm.hpp" ``` ### 2.9. GLM\_FORCE\_ALIGNED\_GENTYPES: Force GLM to enable aligned types @@ -406,14 +435,14 @@ Every object type has the property called alignment requirement, which is an int Each object type imposes its alignment requirement on every object of that type; stricter alignment (with larger alignment requirement) can be requested using C++11 `alignas`. -In order to satisfy alignment requirements of all non-static members of a class, padding may be inserted after some of its members. +In order to satisfy alignment requirements of all non-static members of a class, padding may be inserted after some of its members. GLM supports both packed and aligned types. Packed types allow filling data structure without inserting extra padding. Aligned GLM types align addresses based on the size of the value type of a GLM type. ```cpp #define GLM_FORCE_ALIGNED_GENTYPES -#include -#include +#include "third_party/glm/latest/glm/glm.hpp" +#include "third_party/glm/latest/glm/gtc/type_aligned.hpp" typedef glm::aligned_vec4 vec4a; typedef glm::packed_vec4 vec4p; @@ -425,7 +454,7 @@ GLM allows using aligned types by default for vector types using `GLM_FORCE_DEFA ```cpp #define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -#include +#include "third_party/glm/latest/glm/glm.hpp" struct MyStruct { @@ -443,7 +472,7 @@ void foo() ``` ```cpp -#include +#include "third_party/glm/latest/glm/glm.hpp" struct MyStruct { @@ -475,7 +504,7 @@ The use of intrinsic functions by GLM implementation can be avoided using the de ```cpp #define GLM_FORCE_PURE -#include +#include "third_party/glm/latest/glm/glm.hpp" static_assert(glm::vec4::length() == 4, "Using GLM C++ 14 constexpr support for compile time tests"); @@ -484,7 +513,7 @@ static_assert(glm::vec4::length() == 4, "Using GLM C++ 14 constexpr support for ```cpp #define GLM_FORCE_SIMD_AVX2 -#include +#include "third_party/glm/latest/glm/glm.hpp" // If the compiler doesn’t support AVX2 instrinsics, compiler errors will happen. ``` @@ -505,7 +534,7 @@ To use the default precision functionality, GLM provides some defines that need ```cpp #define GLM_FORCE_PRECISION_MEDIUMP_INT #define GLM_FORCE_PRECISION_HIGHP_FLOAT -#include +#include "third_party/glm/latest/glm/glm.hpp" ``` Available defines for floating point types (`glm::vec\*`, `glm::mat\*`): @@ -556,13 +585,13 @@ GLM supports some of this functionality. Swizzling can be enabled by defining `G GLM has two levels of swizzling support described in the following subsections. -#### 2.14.1. Swizzle functions for standard C++ 98 +#### 2.14.1. Swizzle functions for standard C++ 98 When compiling GLM as C++98, R-value swizzle expressions are simulated through member functions of each vector type. ```cpp #define GLM_FORCE_SWIZZLE // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) -#include +#include "third_party/glm/latest/glm/glm.hpp" void foo() { @@ -581,7 +610,7 @@ Swizzle operators return a **copy** of the component values, and thus *can't* be ```cpp #define GLM_FORCE_SWIZZLE -#include +#include "third_party/glm/latest/glm/glm.hpp" void foo() { @@ -599,7 +628,7 @@ Visual C++, GCC and Clang support, as a _non-standard language extension_, anony ```cpp #define GLM_FORCE_SWIZZLE -#include +#include "third_party/glm/latest/glm/glm.hpp" // Only guaranteed to work with Visual C++! // Some compilers that support Microsoft extensions may compile this. @@ -622,7 +651,7 @@ This version returns implementation-specific objects that _implicitly convert_ t ```cpp #define GLM_FORCE_SWIZZLE -#include +#include "third_party/glm/latest/glm/glm.hpp" using namespace glm; @@ -667,7 +696,7 @@ GLM allows switching the clip space in Z-axis to 0 to 1 by defining `GLM_FORCE_D GLSL supports the member function .length() for all vector and matrix types. ```cpp -#include +#include "third_party/glm/latest/glm/glm.hpp" void foo(vec4 const& v) { @@ -682,7 +711,7 @@ Additionally, GLM defines the type `glm::length_t` to identify `length()` return ```cpp #define GLM_FORCE_SIZE_T_LENGTH -#include +#include "third_party/glm/latest/glm/glm.hpp" void foo(vec4 const& v) { @@ -697,7 +726,7 @@ GLSL has restrictions on types supported by certain functions that may appear ex By default, GLM follows the GLSL specification as accurately as possible however it's possible to relax these rules using `GLM_FORCE_UNRESTRICTED_GENTYPE` define. ```cpp -#include +#include "third_party/glm/latest/glm/glm.hpp" float average(float const A, float const B) { @@ -709,7 +738,7 @@ By defining GLM\_FORCE\_UNRESTRICTED\_GENTYPE, we allow using integer types: ```cpp #define GLM_FORCE_UNRESTRICTED_GENTYPE -#include +#include "third_party/glm/latest/glm/glm.hpp" int average(int const A, int const B) { @@ -722,10 +751,9 @@ int average(int const A, int const B) When using /W4 on Visual C++ or -Wpedantic on GCC, for example, the compilers will generate warnings for using C++ language extensions (/Za with Visual C++) such as anonymous struct. GLM relies on anonymous structs for swizzle operators and aligned vector types. To silent those warnings define `GLM_FORCE_SILENT_WARNINGS` before including GLM headers. +### 2.21. GLM\_FORCE\_QUAT\_DATA\_XYZW: Force GLM to store quat data as x,y,z,w instead of w,x,y,z -### 2.21. GLM\_FORCE\_QUAT\_DATA\_WXYZ: Force GLM to store quat data as w,x,y,z instead of x,y,z,w - -By default GLM store quaternion components with the x, y, z, w order. `GLM_FORCE_QUAT_DATA_WXYZ` allows switching the quaternion data storage to the w, x, y, z order. +By default GLM stores quaternion components with the w, x, y, z order. `GLM_FORCE_QUAT_DATA_XYZW` allows switching the quaternion data storage to the x, y, z, w order. ---
@@ -745,7 +773,7 @@ Include `` to use these features. This extension exposes sized and unsigned integer types. ```cpp -#include +#include "third_party/glm/latest/glm/ext/scalar_common.hpp" glm::uint64 pack(glm::uint32 A, glm::uint16 B, glm::uint8 C, glm::uint8 D) { @@ -766,7 +794,7 @@ Include `` to use these features. This extension exposes support for `min` and `max` functions taking more than two scalar arguments. Also, it adds `fmin` and `fmax` variants which prevents `NaN` propagation. ```cpp -#include +#include "third_party/glm/latest/glm/ext/scalar_common.hpp" float positiveMax(float const a, float const b) { @@ -781,7 +809,7 @@ Include `` to use these features. This extension exposes `equal` and `notEqual` scalar variants which takes an epsilon argument. ```cpp -#include +#include "third_party/glm/latest/glm/ext/scalar_relational.hpp" bool epsilonEqual(float const a, float const b) { @@ -797,7 +825,7 @@ Include `` to use these features. This extension exposes useful constants such as `epsilon` and `pi`. ```cpp -#include +#include "third_party/glm/latest/glm/ext/scalar_constants.hpp" float circumference(float const Diameter) { @@ -806,8 +834,8 @@ float circumference(float const Diameter) ``` ```cpp -#include // abs -#include // epsilon +#include "third_party/glm/latest/glm/common.hpp" // abs +#include "third_party/glm/latest/glm/ext/scalar_constants.hpp" // epsilon bool equalULP1(float const a, float const b) { @@ -822,7 +850,7 @@ Include `` to use these features. This extension exposes function that measure of accuracy in numeric calculations. ```cpp -#include +#include "third_party/glm/latest/glm/ext/scalar_ulp.hpp" bool test_ulp(float x) { @@ -1005,15 +1033,15 @@ This extension exposes double-precision floating point vector with 4 components Include `` to use these features. -### 3.5. Vector functions +### 3.5. Vector functions #### 3.5.1. GLM_EXT_vector_common This extension exposes support for `min` and `max` functions taking more than two vector arguments. Also, it adds `fmin` and `fmax` variants which prevents `NaN` propagation. ```cpp -#include // vec2 -#include // fmax +#include "third_party/glm/latest/glm/ext/vector_float2.hpp" // vec2 +#include "third_party/glm/latest/glm/ext/vector_common.hpp" // fmax float positiveMax(float const a, float const b) { @@ -1028,8 +1056,8 @@ Include `` to use these features. This extension exposes `equal` and `notEqual` vector variants which takes an epsilon argument. ```cpp -#include // vec2 -#include // equal, all +#include "third_party/glm/latest/glm/ext/vector_float2.hpp" // vec2 +#include "third_party/glm/latest/glm/ext/vector_relational.hpp" // equal, all bool epsilonEqual(glm::vec2 const& A, glm::vec2 const& B) { @@ -1045,9 +1073,9 @@ Include `` to use these features. This extension exposes function that measure of accuracy in numeric calculations. ```cpp -#include -#include -#include +#include "third_party/glm/latest/glm/ext/vector_ulp.hpp" +#include "third_party/glm/latest/glm/ext/vector_float4.hpp" +#include "third_party/glm/latest/glm/ext/vector_int4.hpp" bool test_ulp(glm::vec4 const& x) { @@ -1285,9 +1313,9 @@ Include `` to use these features. This extension exposes `equal` and `notEqual` matrix variants which takes an optional epsilon argument. ```cpp -#include // bvec4 -#include // mat4 -#include // equal, all +#include "third_party/glm/latest/glm/ext/vector_bool4.hpp" // bvec4 +#include "third_party/glm/latest/glm/ext/matrix_float4x4.hpp" // mat4 +#include "third_party/glm/latest/glm/ext/matrix_relational.hpp" // equal, all bool epsilonEqual(glm::mat4 const& A, glm::mat4 const& B) { @@ -1304,10 +1332,10 @@ Include `` to use these features. This extension exposes matrix transformation functions: `translate`, `rotate` and `scale`. ```cpp -#include // vec2 -#include // vec3 -#include // mat4x4 -#include // translate, rotate, scale, identity +#include "third_party/glm/latest/glm/ext/vector_float2.hpp" // vec2 +#include "third_party/glm/latest/glm/ext/vector_float3.hpp" // vec3 +#include "third_party/glm/latest/glm/ext/matrix_float4x4.hpp" // mat4x4 +#include "third_party/glm/latest/glm/ext/matrix_transform.hpp" // translate, rotate, scale, identity glm::mat4 computeModelViewMatrix(float Translate, glm::vec2 const & Rotate) { @@ -1326,9 +1354,9 @@ Include `` to use these features. This extension exposes functions to transform scenes into the clip space. ```cpp -#include // mat4x4 -#include // perspective -#include // radians +#include "third_party/glm/latest/glm/ext/matrix_float4x4.hpp" // mat4x4 +#include "third_party/glm/latest/glm/ext/matrix_clip_space.hpp" // perspective +#include "third_party/glm/latest/glm/trigonometric.hpp" // radians glm::mat4 computeProjection(float Width, float Height) { @@ -1420,8 +1448,8 @@ GLM extends the core GLSL feature set with extensions. These extensions include: To include an extension, we only need to include the dedicated header file. Once included, the features are added to the GLM namespace. ```cpp -#include -#include +#include "third_party/glm/latest/glm/glm.hpp" +#include "third_party/glm/latest/glm/gtc/matrix_transform.hpp" int foo() { @@ -1500,41 +1528,41 @@ projective matrix functions (`perspective`, `ortho`, etc) are designed to expect Define 2D, 3D and 4D procedural noise functions. -<`glm/gtc/noise.hpp>` need to be included to use these features. +`` need to be included to use these features. -![](/doc/manual/noise-simplex1.jpg) +![](./doc/manual/noise-simplex1.jpg) Figure 4.10.1: glm::simplex(glm::vec2(x / 16.f, y / 16.f)); -![](/doc/manual/noise-simplex2.jpg) +![](./doc/manual/noise-simplex2.jpg) Figure 4.10.2: glm::simplex(glm::vec3(x / 16.f, y / 16.f, 0.5f)); -![](/doc/manual/noise-simplex3.jpg) +![](./doc/manual/noise-simplex3.jpg) Figure 4.10.3: glm::simplex(glm::vec4(x / 16.f, y / 16.f, 0.5f, 0.5f)); -![](/doc/manual/noise-perlin1.jpg) +![](./doc/manual/noise-perlin1.jpg) Figure 4.10.4: glm::perlin(glm::vec2(x / 16.f, y / 16.f)); -![](/doc/manual/noise-perlin2.jpg) +![](./doc/manual/noise-perlin2.jpg) Figure 4.10.5: glm::perlin(glm::vec3(x / 16.f, y / 16.f, 0.5f)); -![](/doc/manual/noise-perlin3.jpg) +![](./doc/manual/noise-perlin3.jpg) Figure 4.10.6: glm::perlin(glm::vec4(x / 16.f, y / 16.f, 0.5f, 0.5f))); -![](/doc/manual/noise-perlin4.png) +![](./doc/manual/noise-perlin4.png) Figure 4.10.7: glm::perlin(glm::vec2(x / 16.f, y / 16.f), glm::vec2(2.0f)); -![](/doc/manual/noise-perlin5.png) +![](./doc/manual/noise-perlin5.png) Figure 4.10.8: glm::perlin(glm::vec3(x / 16.f, y / 16.f, 0.5f), glm::vec3(2.0f)); -![](/doc/manual/noise-perlin6.png) +![](./doc/manual/noise-perlin6.png) Figure 4.10.9: glm::perlin(glm::vec4(x / 16.f, y / 16.f, glm::vec2(0.5f)), glm::vec4(2.0f)); @@ -1556,27 +1584,27 @@ Probability distributions in up to four dimensions. `` need to be included to use these features. -![](/doc/manual/random-linearrand.png) +![](./doc/manual/random-linearrand.png) Figure 4.13.1: glm::vec4(glm::linearRand(glm::vec2(-1), glm::vec2(1)), 0, 1); -![](/doc/manual/random-circularrand.png) +![](./doc/manual/random-circularrand.png) Figure 4.13.2: glm::vec4(glm::circularRand(1.0f), 0, 1); -![](/doc/manual/random-sphericalrand.png) +![](./doc/manual/random-sphericalrand.png) Figure 4.13.3: glm::vec4(glm::sphericalRand(1.0f), 1); -![](/doc/manual/random-diskrand.png) +![](./doc/manual/random-diskrand.png) Figure 4.13.4: glm::vec4(glm::diskRand(1.0f), 0, 1); -![](/doc/manual/random-ballrand.png) +![](./doc/manual/random-ballrand.png) Figure 4.13.5: glm::vec4(glm::ballRand(1.0f), 1); -![](/doc/manual/random-gaussrand.png) +![](./doc/manual/random-gaussrand.png) Figure 4.13.6: glm::vec4(glm::gaussRand(glm::vec3(0), glm::vec3(1)), 1); @@ -1612,8 +1640,8 @@ This extension defines an overloaded function, `glm::value_ptr`, which returns a ```cpp // GLM_GTC_type_ptr provides a safe solution: -#include -#include +#include "third_party/glm/latest/glm/glm.hpp" +#include "third_party/glm/latest/glm/gtc/type_ptr.hpp" void foo() { @@ -1625,7 +1653,7 @@ void foo() } // Another solution, this one inspired by the STL: -#include +#include "third_party/glm/latest/glm/glm.hpp" void foo() { @@ -1638,7 +1666,7 @@ void foo() ``` *Note: It would be possible to implement [`glVertex3fv`](http://www.opengl.org/sdk/docs/man2/xhtml/glVertex.xml)(glm::vec3(0)) in C++ with the appropriate cast operator that would result as an -implicit cast in this example. However cast operators may produce programs running with unexpected behaviours without build error or any form of notification. * +implicit cast in this example. However cast operators may produce programs running with unexpected behaviours without build error or any form of notification.* `` need to be included to use these features. @@ -1832,7 +1860,7 @@ ivec3 foo(in vec4 v) // Using precision qualifier in GLM: -#include +#include "third_party/glm/latest/glm/glm.hpp" ivec3 foo(const vec4 & v) { @@ -1914,7 +1942,7 @@ To workaround the incompatibility with these macros, GLM will systematically und ### 7.13. Constant expressions support -GLM has some C++ constant expressions support. However, GLM automatically detects the use of SIMD instruction sets through compiler arguments to populate its implementation with SIMD intrinsics. +GLM has some C++ [constant expressions](http://en.cppreference.com/w/cpp/language/constexpr) support. However, GLM automatically detects the use of SIMD instruction sets through compiler arguments to populate its implementation with SIMD intrinsics. Unfortunately, GCC and Clang doesn't support SIMD instrinsics as constant expressions. To allow constant expressions on all vectors and matrices types, define `GLM_FORCE_PURE` before including GLM headers. --- @@ -1927,7 +1955,7 @@ This series of samples only shows various GLM features without consideration of ### 8.1. Compute a triangle normal ```cpp -#include // vec3 normalize cross +#include "third_party/glm/latest/glm/glm.hpp" // vec3 normalize cross glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& c) { @@ -1935,8 +1963,8 @@ glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& } // A much faster but less accurate alternative: -#include // vec3 cross -#include // fastNormalize +#include "third_party/glm/latest/glm/glm.hpp" // vec3 cross +#include "third_party/glm/latest/glm/gtx/fast_square_root.hpp" // fastNormalize glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& c) { @@ -1947,9 +1975,9 @@ glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& ### 8.2. Matrix transform ```cpp -#include // vec3, vec4, ivec4, mat4 -#include // translate, rotate, scale, perspective -#include // value_ptr +#include "third_party/glm/latest/glm/glm.hpp" // vec3, vec4, ivec4, mat4 +#include "third_party/glm/latest/glm/gtc/matrix_transform.hpp" // translate, rotate, scale, perspective +#include "third_party/glm/latest/glm/gtc/type_ptr.hpp" // value_ptr void setUniformMVP(GLuint Location, glm::vec3 const& Translate, glm::vec3 const& Rotate) { @@ -1970,8 +1998,8 @@ void setUniformMVP(GLuint Location, glm::vec3 const& Translate, glm::vec3 const& ### 8.3. Vector types ```cpp -#include // vec2 -#include // hvec2, i8vec2, i32vec2 +#include "third_party/glm/latest/glm/glm.hpp" // vec2 +#include "third_party/glm/latest/glm/gtc/type_precision.hpp" // hvec2, i8vec2, i32vec2 std::size_t const VertexCount = 4; @@ -2019,8 +2047,8 @@ glm::i32vec2 const PositionDataI32[VertexCount] = ### 8.4. Lighting ```cpp -#include // vec3 normalize reflect dot pow -#include // ballRand +#include "third_party/glm/latest/glm/glm.hpp" // vec3 normalize reflect dot pow +#include "third_party/glm/latest/glm/gtc/random.hpp" // ballRand // vecRand3, generate a random and equiprobable normalized vec3 glm::vec3 lighting(intersection const& Intersection, material const& Material, light const& Light, glm::vec3 const& View) @@ -2068,11 +2096,12 @@ Additional, bugs can be configuration specific. We can report the configuration ```cpp #define GLM_FORCE_MESSAGES -#include +#include "third_party/glm/latest/glm/glm.hpp" ``` An example of build messages generated by GLM: -``` + +```plaintext GLM: 0.9.9.1 GLM: C++ 17 with extensions GLM: GCC compiler detected" @@ -2098,7 +2127,7 @@ The tutorial assumes you have some basic understanding of git concepts - reposit We will make our changes in our own copy of the GLM sitory. On the GLM GitHub repo and we press the Fork button. We need to download a copy of our fork to our local machine. In the terminal, type: -``` +```plaintext >>> git clone ``` @@ -2110,25 +2139,25 @@ We can find our repository git url on the Github reposotory page. The url looks We can use the following command to add `upstream` (original project repository) as a remote repository so that we can fetch the latest GLM commits into our branch and keep our forked copy is synchronized. -``` +```plaintext >>> git remote add upstream https://github.com/processing/processing.git ``` To synchronize our fork to the latest commit in the GLM repository, we can use the following command: -``` +```plaintext >>> git fetch upstream ``` Then, we can merge the remote master branch to our current branch: -``` +```plaintext >>> git merge upstream/master ``` Now our local copy of our fork has been synchronized. However, the fork's copy is not updated on GitHub's servers yet. To do that, use: -``` +```plaintext >>> git push origin master ``` @@ -2141,28 +2170,33 @@ It's a good practice to make changes in our fork in a separate branch than the m Before creating a new branch, it's best to synchronize our fork and then create a new branch from the latest master branch. If we are not on the master branch, we should switch to it using: -``` + +```plaintext >>> git checkout master ``` To create a new branch called `bugifx`, we use: -``` + +```plaintext git branch bugfix ``` Once the code changes for the fix is done, we need to commit the changes: -``` + +```plaintext >>> git commit -m "Resolve the issue that caused problem with a specific fix #432" ``` The commit message should be as specific as possible and finished by the bug number in the [GLM GitHub issue page](https://github.com/g-truc/glm/issues) Finally, we need to push our changes in our branch to our GitHub fork using: -``` + +```plaintext >>> git push origin bugfix ``` Some things to keep in mind for a pull request: + * Keep it minimal: Try to make the minimum required changes to fix the issue. If we have added any debugging code, we should remove it. * A fix at a time: The pull request should deal with one issue at a time only, unless two issue are so interlinked they must be fixed together. * Write a test: GLM is largely unit tests. Unit tests are in `glm/test` directory. We should also add tests for the fixes we provide to ensure future regression doesn't happen. @@ -2206,6 +2240,7 @@ else ``` Single line if blocks: + ```cpp if(blah) // yes like this @@ -2214,6 +2249,7 @@ else ``` No spaces inside parens: + ```cpp if (blah) // No if( blah ) // No @@ -2222,12 +2258,14 @@ if(blah) // Yes ``` Use spaces before/after commas: + ```cpp someFunction(apple,bear,cat); // No someFunction(apple, bear, cat); // Yes ``` Use spaces before/after use of `+, -, *, /, %, >>, <<, |, &, ^, ||, &&` operators: + ```cpp vec4 v = a + b; ``` @@ -2242,7 +2280,7 @@ Always one space after the // in single line comments One space before // at the end of a line (that has code as well) -Try to use // comments inside functions, to make it easier to remove a whole block via /* */ +Try to use // comments inside functions, to make it easier to remove a whole block via /\* \*/ #### Cases @@ -2299,9 +2337,9 @@ Beautifully hand-crafted levels bring the story of Leo to life in this epic adve “Whatever lies ahead, I must recover my fortune.†-Leopold -![](/doc/manual/references-leosfortune.jpeg) +![](./doc/manual/references-leosfortune.jpeg) -![](/doc/manual/references-leosfortune2.jpg) +![](./doc/manual/references-leosfortune2.jpg) [***OpenGL 4.0 Shading Language Cookbook***](http://www.packtpub.com/opengl-4-0-shading-language-cookbook/book?tag=rk/opengl4-abr1/0811) @@ -2313,19 +2351,19 @@ A set of recipes that demonstrates a wide of techniques for producing high-quali Simple, easy-to-follow examples with GLSL source code are provided, as well as a basic description of the theory behind each technique. -![](/doc/manual/references-glsl4book.jpg) +![](./doc/manual/references-glsl4book.jpg) [***Outerra***](http://outerra.com/) A 3D planetary engine for seamless planet rendering from space down to the surface. Can use arbitrary resolution of elevation data, refining it to centimetre resolution using fractal algorithms. -![](/doc/manual/references-outerra1.jpg) +![](./doc/manual/references-outerra1.jpg) -![](/doc/manual/references-outerra2.jpg) +![](./doc/manual/references-outerra2.jpg) -![](/doc/manual/references-outerra3.jpg) +![](./doc/manual/references-outerra3.jpg) -![](/doc/manual/references-outerra4.jpg) +![](./doc/manual/references-outerra4.jpg) [***Falcor***](https://github.com/NVIDIA/Falcor) @@ -2339,17 +2377,17 @@ Cinder is a C++ library for programming with aesthetic intent - the sort of dev Cinder is production-proven, powerful enough to be the primary tool for professionals, but still suitable for learning and experimentation. Cinder is released under the [2-Clause BSD License](http://opensource.org/licenses/BSD-2-Clause). -![](/doc/manual/references-cinder.png) +![](./doc/manual/references-cinder.png) -[***opencloth***](http://code.google.com/p/opencloth/) +[***opencloth***](https://github.com/mmmovania/opencloth/) A collection of source codes implementing cloth simulation algorithms in OpenGL. Simple, easy-to-follow examples with GLSL source code, as well as a basic description of the theory behind each technique. -![](/doc/manual/references-opencloth1.png) +![](./doc/manual/references-opencloth1.png) -![](/doc/manual/references-opencloth3.png) +![](./doc/manual/references-opencloth3.png) [***LibreOffice***](https://www.libreoffice.org/) @@ -2400,6 +2438,7 @@ LibreOffice includes several applications that make it the most powerful Free an GLM is developed and maintained by [*Christophe Riccio*](http://www.g-truc.net) but many contributors have made this project what it is. Special thanks to: + * Ashima Arts and Stefan Gustavson for their work on [*webgl-noise*](https://github.com/ashima/webgl-noise) which has been used for GLM noises implementation. * [*Arthur Winters*](http://athile.net/library/wiki/index.php?title=Athile_Technologies) for the C++11 and Visual C++ swizzle operators implementation and tests. * Joshua Smith and Christoph Schied for the discussions and the experiments around the swizzle operators implementation issues. diff --git a/third_party/glm/matrix.hpp b/third_party/glm/matrix.hpp index 6badf53850..4584c92c3c 100644 --- a/third_party/glm/matrix.hpp +++ b/third_party/glm/matrix.hpp @@ -97,7 +97,7 @@ namespace detail /// /// @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 @@ -111,7 +111,7 @@ namespace detail /// /// @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 @@ -123,7 +123,7 @@ namespace detail /// /// @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 @@ -135,7 +135,7 @@ namespace detail /// /// @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 @@ -147,7 +147,7 @@ namespace detail /// /// @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/third_party/glm/readme.md b/third_party/glm/readme.md index 611c257665..64127402dd 100644 --- a/third_party/glm/readme.md +++ b/third_party/glm/readme.md @@ -6,30 +6,29 @@ This project isn't limited to *GLSL* features. An extension system, based on the *GLSL* extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc... -This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physic simulations and any development context that requires a simple and convenient mathematics library. +This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physics simulations and any development context that requires a simple and convenient mathematics library. *GLM* is written in C++98 but can take advantage of C++11 when supported by the compiler. It is a platform independent library with no dependence and it officially supports the following compilers: -- [Apple Clang 6.0](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher -- [GCC](http://gcc.gnu.org/) 4.7 and higher -- [Intel C++ Composer](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher -- [LLVM](http://llvm.org/) 3.4 and higher -- [Visual C++](http://www.visualstudio.com/) 2013 and higher -- [CUDA](https://developer.nvidia.com/about-cuda) 9.0 and higher (experimental) -- [SYCL](https://www.khronos.org/sycl/) (experimental: only [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) implementation has been tested). +- [*GCC*](http://gcc.gnu.org/) 4.7 and higher +- [*Intel C++ Compose*](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher +- [*Clang*](http://llvm.org/) 3.4 and higher +- [*Apple Clang 6.0*](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher +- [*Visual C++*](http://www.visualstudio.com/) 2013 and higher +- [*CUDA*](https://developer.nvidia.com/about-cuda) 9.0 and higher (experimental) - Any C++11 compiler -For more information about *GLM*, please have a look at the [manual](manual.md) and the [API reference documentation](http://glm.g-truc.net/0.9.8/api/index.html). +For more information about *GLM*, please have a look at the [manual](manual.md) and the [API reference documentation](http://glm.g-truc.net/0.9.9/api/modules.html). The source code and the documentation are licensed under either the [Happy Bunny License (Modified MIT) or the MIT License](manual.md#section0). -Thanks for contributing to the project by [submitting issues](https://github.com/g-truc/glm/issues) for bug reports and feature requests. Any feedback is welcome at [glm@g-truc.net](mailto://glm@g-truc.net). +Thanks for contributing to the project by [submitting pull requests](https://github.com/g-truc/glm/pulls). ```cpp -#include // glm::vec3 -#include // glm::vec4 -#include // glm::mat4 -#include // glm::translate, glm::rotate, glm::scale -#include // glm::perspective -#include // glm::pi +#include "third_party/glm/latest/glm/vec3.hpp" // glm::vec3 +#include "third_party/glm/latest/glm/vec4.hpp" // glm::vec4 +#include "third_party/glm/latest/glm/mat4x4.hpp" // glm::mat4 +#include "third_party/glm/latest/glm/ext/matrix_transform.hpp" // glm::translate, glm::rotate, glm::scale +#include "third_party/glm/latest/glm/ext/matrix_clip_space.hpp" // glm::perspective +#include "third_party/glm/latest/glm/ext/scalar_constants.hpp" // glm::pi glm::mat4 camera(float Translate, glm::vec2 const& Rotate) { @@ -46,166 +45,258 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate) ## Project Health -| Service | System | Compiler | Status | -| ------- | ------ | -------- | ------ | -| [Travis CI](https://travis-ci.org/g-truc/glm)| MacOSX, Linux 64 bits | Clang 3.6, Clang 5.0, GCC 4.9, GCC 7.3 | [![Travis CI](https://travis-ci.org/g-truc/glm.svg?branch=master)](https://travis-ci.org/g-truc/glm) -| [AppVeyor](https://ci.appveyor.com/project/Groovounet/glm)| Windows 32 and 64 | Visual Studio 2013, Visual Studio 2015, Visual Studio 2017 | [![AppVeyor](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true)](https://ci.appveyor.com/project/Groovounet/glm) +| Service | Status | +| ------- | ------ | +| [GitHub actions](https://github.com/g-truc/glm/actions)| [![.github/workflows/ci.yml](https://github.com/g-truc/glm/actions/workflows/ci.yml/badge.svg)](https://github.com/g-truc/glm/actions/workflows/ci.yml) + +## Build and Install + +```shell +cd /path/to/glm +cmake \ + -DGLM_BUILD_TESTS=OFF \ + -DBUILD_SHARED_LIBS=OFF \ + -B build . +cmake --build build -- all +cmake --build build -- install +``` + +Passing `-DBUILD_SHARED_LIBS=ON` to build shared library + +And then in your `CMakeLists.txt`: + +```cmake +find_package(glm CONFIG REQUIRED) +target_link_libraries(main PRIVATE glm::glm) +``` + +If your perfer to use header-only version of GLM + +```cmake +find_package(glm CONFIG REQUIRED) +target_link_libraries(main PRIVATE glm::glm-header-only) +``` + +## Vcpkg + +```shell +vcpkg install glm +``` + +## CMake using FetchContent +You can add glm to your CMake project to be built together. + +Add to the `CMakeLists.txt` file: +```cmake +cmake_minimum_required(VERSION 3.11) # FetchContent is new in version 3.11. + +include(FetchContent) + +FetchContent_Declare( + glm + GIT_REPOSITORY https://github.com/g-truc/glm.git + GIT_TAG bf71a834948186f4097caa076cd2663c69a10e1e #refs/tags/0.9.9.8 +) + +FetchContent_MakeAvailable(glm) + +target_link_libraries(main PRIVATE glm::glm) +``` ## Release notes +### [GLM 1.0.1](https://github.com/g-truc/glm/releases/tag/1.0.1) - 2024-02-26 + +#### Features: +- Added C++17 [[nodiscard]] support + +#### Improvements: +- Enables only warnings as errors while building unit tests +- Added aligned_*vec3 simd support #1245 + +#### Fixes: +- Fixed C++ language auto detection build, disable C++98 warnings with Clang #1235, #1231 +- Fixed `GTX_color_space` missing include #1233 #1238 +- Fixed `EXT_matrix_transform` `shear` implementation #1140 #1182 +- Fixed `smoothstep` SIMD implementation #1222 + +### [GLM 1.0.0](https://github.com/g-truc/glm/releases/tag/1.0.0) - 2024-01-24 +#### Features: +- Added *GLM_EXT_scalar_reciprocal* with tests +- Added *GLM_EXT_vector_reciprocal* with tests +- Added `glm::iround` and `glm::uround` to *GLM_EXT_scalar_common* and *GLM_EXT_vector_common* +- Added *GLM_EXT_matrix_integer* with tests +- Added Github Actions +- Added GLM_FORCE_UNRESTRICTED_FLOAT to prevent static asserts when using other scalar types with function expecting floats. + +#### Improvements: +- Added `constexpr` qualifier for `cross` product #1040 +- Added `constexpr` qualifier for `dot` product #1040 + +#### Fixes: +- Fixed incorrect assertion for `glm::min` and `glm::max` #1009 +- Fixed quaternion orientation in `glm::decompose` #1012 +- Fixed singularity in quaternion to euler angle roll conversion #1019 +- Fixed `quat` `glm::pow` handling of small magnitude quaternions #1022 +- Fixed `glm::fastNormalize` build error #1033 +- Fixed `glm::isMultiple` build error #1034 +- Fixed `glm::adjugate` calculation #1035 +- Fixed `glm::angle` discards the sign of result for angles in range (2*pi-1, 2*pi) #1038 +- Removed ban on using `glm::string_cast` with *CUDA* host code #1041 + ### [GLM 0.9.9.8](https://github.com/g-truc/glm/releases/tag/0.9.9.8) - 2020-04-13 #### Features: -- Added GLM_EXT_vector_intX* and GLM_EXT_vector_uintX* extensions -- Added GLM_EXT_matrix_intX* and GLM_EXT_matrix_uintX* extensions +- Added *GLM_EXT_vector_intX* and *GLM_EXT_vector_uintX* extensions +- Added *GLM_EXT_matrix_intX* and *GLM_EXT_matrix_uintX* extensions #### Improvements: -- Added clamp, repeat, mirrorClamp and mirrorRepeat function to GLM_EXT_scalar_commond and GLM_EXT_vector_commond extensions with tests +- Added `glm::clamp`, `glm::repeat`, `glm::mirrorClamp` and `glm::mirrorRepeat` function to `GLM_EXT_scalar_commond` and `GLM_EXT_vector_commond` extensions with tests #### Fixes: -- Fixed unnecessary warnings from matrix_projection.inl #995 -- Fixed quaternion slerp overload which interpolates with extra spins #996 -- Fixed for glm::length using arch64 #992 -- Fixed singularity check for quatLookAt #770 +- Fixed unnecessary warnings from `matrix_projection.inl` #995 +- Fixed quaternion `glm::slerp` overload which interpolates with extra spins #996 +- Fixed for `glm::length` using arch64 #992 +- Fixed singularity check for `glm::quatLookAt` #770 ### [GLM 0.9.9.7](https://github.com/g-truc/glm/releases/tag/0.9.9.7) - 2020-01-05 #### Improvements: -- Improved Neon support with more functions optimized #950 -- Added CMake GLM interface #963 -- Added fma implementation based on std::fma #969 +- Improved *Neon* support with more functions optimized #950 +- Added *CMake* *GLM* interface #963 +- Added `glm::fma` implementation based on `std::fma` #969 - Added missing quat constexpr #955 -- Added GLM_FORCE_QUAT_DATA_WXYZ to store quat data as w,x,y,z instead of x,y,z,w #983 +- Added `GLM_FORCE_QUAT_DATA_WXYZ` to store quat data as w,x,y,z instead of x,y,z,w #983 #### Fixes: -- Fixed equal ULP variation when using negative sign #965 +- Fixed equal *ULP* variation when using negative sign #965 - Fixed for intersection ray/plane and added related tests #953 - Fixed ARM 64bit detection #949 -- Fixed GLM_EXT_matrix_clip_space warnings #980 +- Fixed *GLM_EXT_matrix_clip_space* warnings #980 - Fixed Wimplicit-int-float-conversion warnings with clang 10+ #986 -- Fixed EXT_matrix_clip_space perspectiveFov +- Fixed *GLM_EXT_matrix_clip_space* `perspectiveFov` ### [GLM 0.9.9.6](https://github.com/g-truc/glm/releases/tag/0.9.9.6) - 2019-09-08 #### Features: -- Added Neon support #945 -- Added SYCL support #914 -- Added EXT_scalar_integer extension with power of two and multiple scalar functions -- Added EXT_vector_integer extension with power of two and multiple vector functions +- Added *Neon* support #945 +- Added *SYCL* support #914 +- Added *GLM_EXT_scalar_integer* extension with power of two and multiple scalar functions +- Added *GLM_EXT_vector_integer* extension with power of two and multiple vector functions #### Improvements: -- Added Visual C++ 2019 detection -- Added Visual C++ 2017 15.8 and 15.9 detection -- Added missing genType check for bitCount and bitfieldReverse #893 +- Added *Visual C++ 2019* detection +- Added *Visual C++ 2017* 15.8 and 15.9 detection +- Added missing genType check for `glm::bitCount` and `glm::bitfieldReverse` #893 #### Fixes: - Fixed for g++6 where -std=c++1z sets __cplusplus to 201500 instead of 201402 #921 - Fixed hash hashes qua instead of tquat #919 -- Fixed .natvis as structs renamed #915 -- Fixed ldexp and frexp declaration #895 +- Fixed `.natvis` as structs renamed #915 +- Fixed `glm::ldexp` and `glm::frexp` declaration #895 - Fixed missing const to quaternion conversion operators #890 -- Fixed EXT_scalar_ulp and EXT_vector_ulp API coding style -- Fixed quaternion componant order: w, {x, y, z} #916 -- Fixed GLM_HAS_CXX11_STL broken on Clang with Linux #926 -- Fixed Clang or GCC build due to wrong GLM_HAS_IF_CONSTEXPR definition #907 -- Fixed CUDA 9 build #910 +- Fixed *GLM_EXT_scalar_ulp* and *GLM_EXT_vector_ulp* API coding style +- Fixed quaternion componant order: `w, {x, y, z}` #916 +- Fixed `GLM_HAS_CXX11_STL` broken on Clang with Linux #926 +- Fixed *Clang* or *GCC* build due to wrong `GLM_HAS_IF_CONSTEXPR` definition #907 +- Fixed *CUDA* 9 build #910 #### Deprecation: - Removed CMake install and uninstall scripts ### [GLM 0.9.9.5](https://github.com/g-truc/glm/releases/tag/0.9.9.5) - 2019-04-01 #### Fixes: -- Fixed build errors when defining GLM_ENABLE_EXPERIMENTAL #884 #883 -- Fixed 'if constexpr' warning #887 -- Fixed missing declarations for frexp and ldexp #886 +- Fixed build errors when defining `GLM_ENABLE_EXPERIMENTAL` #884 #883 +- Fixed `if constexpr` warning #887 +- Fixed missing declarations for `glm::frexp` and `glm::ldexp` #886 ### [GLM 0.9.9.4](https://github.com/g-truc/glm/releases/tag/0.9.9.4) - 2019-03-19 #### Features: -- Added mix implementation for matrices in EXT_matrix_common #842 -- Added BUILD_SHARED_LIBS and BUILD_STATIC_LIBS build options #871 +- Added `glm::mix` implementation for matrices in *GLM_EXT_matrix_common/ #842 +- Added *CMake* `BUILD_SHARED_LIBS` and `BUILD_STATIC_LIBS` build options #871 #### Improvements: - Added GLM_FORCE_INTRINSICS to enable SIMD instruction code path. By default, it's disabled allowing constexpr support by default. #865 - Optimized inverseTransform #867 #### Fixes: -- Fixed in mat4x3 conversion #829 -- Fixed constexpr issue on GCC #832 #865 -- Fixed mix implementation to improve GLSL conformance #866 -- Fixed int8 being defined as unsigned char with some compiler #839 -- Fixed vec1 include #856 -- Ignore .vscode #848 +- Fixed in `glm::mat4x3` conversion #829 +- Fixed `constexpr` issue on GCC #832 #865 +- Fixed `glm::mix` implementation to improve GLSL conformance #866 +- Fixed `glm::int8` being defined as unsigned char with some compiler #839 +- Fixed `glm::vec1` include #856 +- Ignore `.vscode` #848 ### [GLM 0.9.9.3](https://github.com/g-truc/glm/releases/tag/0.9.9.3) - 2018-10-31 #### Features: -- Added equal and notEqual overload with max ULPs parameters for scalar numbers #121 -- Added GLM_FORCE_SILENT_WARNINGS to silent GLM warnings when using language extensions but using W4 or Wpedantic warnings #814 #775 -- Added adjugate functions to GTX_matrix_operation #151 -- Added GLM_FORCE_ALIGNED_GENTYPES to enable aligned types and SIMD instruction are not enabled. This disable constexpr #816 +- Added `glm::equal` and `glm::notEqual` overload with max ULPs parameters for scalar numbers #121 +- Added `GLM_FORCE_SILENT_WARNINGS` to silent *GLM* warnings when using language extensions but using W4 or Wpedantic warnings #814 #775 +- Added adjugate functions to `GLM_GTX_matrix_operation` #151 +- Added `GLM_FORCE_ALIGNED_GENTYPES` to enable aligned types and SIMD instruction are not enabled. This disable `constexpr` #816 #### Improvements: - Added constant time ULP distance between float #121 -- Added GLM_FORCE_SILENT_WARNINGS to suppress GLM warnings #822 +- Added `GLM_FORCE_SILENT_WARNINGS` to suppress *GLM* warnings #822 #### Fixes: -- Fixed simplex noise build with double #734 -- Fixed bitfieldInsert according to GLSL spec #818 -- Fixed refract for negative 'k' #808 +- Fixed `glm::simplex` noise build with double #734 +- Fixed `glm::bitfieldInsert` according to GLSL spec #818 +- Fixed `glm::refract` for negative 'k' #808 ### [GLM 0.9.9.2](https://github.com/g-truc/glm/releases/tag/0.9.9.2) - 2018-09-14 #### Fixes: -- Fixed GLM_FORCE_CXX** section in the manual -- Fixed default initialization with vector and quaternion types using GLM_FORCE_CTOR_INIT #812 +- Fixed `GLM_FORCE_CXX**` section in the manual +- Fixed default initialization with vector and quaternion types using `GLM_FORCE_CTOR_INIT` #812 ### [GLM 0.9.9.1](https://github.com/g-truc/glm/releases/tag/0.9.9.1) - 2018-09-03 #### Features: -- Added bitfieldDeinterleave to GTC_bitfield -- Added missing equal and notEqual with epsilon for quaternion types to GTC_quaternion -- Added EXT_matrix_relational: equal and notEqual with epsilon for matrix types -- Added missing aligned matrix types to GTC_type_aligned +- Added `bitfieldDeinterleave` to *GLM_GTC_bitfield* +- Added missing `glm::equal` and `glm::notEqual` with epsilon for quaternion types to *GLM_GTC_quaternion* +- Added *GLM_EXT_matrix_relational*: `glm::equal` and `glm::notEqual` with epsilon for matrix types +- Added missing aligned matrix types to *GLM_GTC_type_aligned* - Added C++17 detection -- Added Visual C++ language standard version detection +- Added *Visual C++* language standard version detection - Added PDF manual build from markdown #### Improvements: -- Added a section to the manual for contributing to GLM +- Added a section to the manual for contributing to *GLM* - Refactor manual, lists all configuration defines -- Added missing vec1 based constructors -- Redesigned constexpr support which excludes both SIMD and constexpr #783 -- Added detection of Visual C++ 2017 toolsets +- Added missing `glm::vec1` based constructors +- Redesigned constexpr support which excludes both SIMD and `constexpr` #783 +- Added detection of *Visual C++ 2017* toolsets - Added identity functions #765 - Splitted headers into EXT extensions to improve compilation time #670 - Added separated performance tests - Clarified refract valid range of the indices of refraction, between -1 and 1 inclusively #806 #### Fixes: -- Fixed SIMD detection on Clang and GCC -- Fixed build problems due to printf and std::clock_t #778 +- Fixed SIMD detection on *Clang* and *GCC* +- Fixed build problems due to `std::printf` and `std::clock_t` #778 - Fixed int mod - Anonymous unions require C++ language extensions -- Fixed ortho #790 -- Fixed Visual C++ 2013 warnings in vector relational code #782 -- Fixed ICC build errors with constexpr #704 +- Fixed `glm::ortho` #790 +- Fixed *Visual C++* 2013 warnings in vector relational code #782 +- Fixed *ICC* build errors with constexpr #704 - Fixed defaulted operator= and constructors #791 - Fixed invalid conversion from int scalar with vec4 constructor when using SSE instruction - Fixed infinite loop in random functions when using negative radius values using an assert #739 ### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/tag/0.9.9.0) - 2018-05-22 #### Features: -- Added RGBM encoding in GTC_packing #420 -- Added GTX_color_encoding extension -- Added GTX_vec_swizzle, faster compile time swizzling then swizzle operator #558 -- Added GTX_exterior_product with a vec2 cross implementation #621 -- Added GTX_matrix_factorisation to factor matrices in various forms #654 -- Added [GLM_ENABLE_EXPERIMENTAL](manual.md#section7_4) to enable experimental features. +- Added *RGBM* encoding in *GLM_GTC_packing* #420 +- Added *GLM_GTX_color_encoding* extension +- Added *GLM_GTX_vec_swizzle*, faster compile time swizzling then swizzle operator #558 +- Added *GLM_GTX_exterior_product* with a `vec2` `glm::cross` implementation #621 +- Added *GLM_GTX_matrix_factorisation* to factor matrices in various forms #654 +- Added [`GLM_ENABLE_EXPERIMENTAL`](manual.md#section7_4) to enable experimental features. - Added packing functions for integer vectors #639 - Added conan packaging configuration #643 #641 -- Added quatLookAt to GTX_quaternion #659 -- Added fmin, fmax and fclamp to GTX_extended_min_max #372 -- Added EXT_vector_relational: extend equal and notEqual to take an epsilon argument -- Added EXT_vector_relational: openBounded and closeBounded -- Added EXT_vec1: *vec1 types -- Added GTX_texture: levels function +- Added `glm::quatLookAt` to *GLM_GTX_quaternion* #659 +- Added `glm::fmin`, `glm::fmax` and `glm::fclamp` to *GLM_GTX_extended_min_max* #372 +- Added *GLM_EXT_vector_relational*: extend `glm::equal` and `glm::notEqual` to take an epsilon argument +- Added *GLM_EXT_vector_relational*: `glm::openBounded` and `glm::closeBounded` +- Added *GLM_EXT_vec1*: `*vec1` types +- Added *GLM_GTX_texture*: `levels` function - Added spearate functions to use both nagative one and zero near clip plans #680 -- Added GLM_FORCE_SINGLE_ONLY to use GLM on platforms that don't support double #627 -- Added GTX_easing for interpolation functions #761 +- Added `GLM_FORCE_SINGLE_ONLY` to use *GLM* on platforms that don't support double #627 +- Added *GLM_GTX_easing* for interpolation functions #761 #### Improvements: - No more default initialization of vector, matrix and quaternion types @@ -230,151 +321,151 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate) - Clarify quat_cast documentation, applying on pure rotation matrices #759 #### Fixes: -- Removed doxygen references to GTC_half_float which was removed in 0.9.4 -- Fixed glm::decompose #448 -- Fixed intersectRayTriangle #6 +- Removed doxygen references to *GLM_GTC_half_float* which was removed in 0.9.4 +- Fixed `glm::decompose` #448 +- Fixed `glm::intersectRayTriangle` #6 - Fixed dual quaternion != operator #629 -- Fixed usused variable warning in GTX_spline #618 -- Fixed references to GLM_FORCE_RADIANS which was removed #642 -- Fixed glm::fastInverseSqrt to use fast inverse square #640 -- Fixed axisAngle NaN #638 -- Fixed integer pow from GTX_integer with null exponent #658 -- Fixed quat normalize build error #656 -- Fixed Visual C++ 2017.2 warning regarding __has_feature definision #655 +- Fixed usused variable warning in *GLM_GTX_spline* #618 +- Fixed references to `GLM_FORCE_RADIANS` which was removed #642 +- Fixed `glm::fastInverseSqrt` to use fast inverse square #640 +- Fixed `glm::axisAngle` NaN #638 +- Fixed integer pow from *GLM_GTX_integer* with null exponent #658 +- Fixed `quat` `normalize` build error #656 +- Fixed *Visual C++ 2017.2* warning regarding `__has_feature` definision #655 - Fixed documentation warnings -- Fixed GLM_HAS_OPENMP when OpenMP is not enabled -- Fixed Better follow GLSL min and max specification #372 +- Fixed `GLM_HAS_OPENMP` when *OpenMP* is not enabled +- Fixed Better follow GLSL `min` and `max` specification #372 - Fixed quaternion constructor from two vectors special cases #469 -- Fixed glm::to_string on quaternions wrong components order #681 -- Fixed acsch #698 -- Fixed isnan on CUDA #727 +- Fixed `glm::to_string` on quaternions wrong components order #681 +- Fixed `glm::acsch` #698 +- Fixed `glm::isnan` on *CUDA* #727 #### Deprecation: -- Requires Visual Studio 2013, GCC 4.7, Clang 3.4, Cuda 7, ICC 2013 or a C++11 compiler -- Removed GLM_GTX_simd_vec4 extension -- Removed GLM_GTX_simd_mat4 extension -- Removed GLM_GTX_simd_quat extension -- Removed GLM_SWIZZLE, use GLM_FORCE_SWIZZLE instead -- Removed GLM_MESSAGES, use GLM_FORCE_MESSAGES instead -- Removed GLM_DEPTH_ZERO_TO_ONE, use GLM_FORCE_DEPTH_ZERO_TO_ONE instead -- Removed GLM_LEFT_HANDED, use GLM_FORCE_LEFT_HANDED instead -- Removed GLM_FORCE_NO_CTOR_INIT -- Removed glm::uninitialize +- Requires *Visual Studio 2013*, *GCC 4.7*, *Clang 3.4*, *Cuda 7*, *ICC 2013* or a C++11 compiler +- Removed *GLM_GTX_simd_vec4* extension +- Removed *GLM_GTX_simd_mat4* extension +- Removed *GLM_GTX_simd_quat* extension +- Removed `GLM_SWIZZLE`, use `GLM_FORCE_SWIZZLE` instead +- Removed `GLM_MESSAGES`, use `GLM_FORCE_MESSAGES` instead +- Removed `GLM_DEPTH_ZERO_TO_ONE`, use `GLM_FORCE_DEPTH_ZERO_TO_ONE` instead +- Removed `GLM_LEFT_HANDED`, use `GLM_FORCE_LEFT_HANDED` instead +- Removed `GLM_FORCE_NO_CTOR_INIT` +- Removed `glm::uninitialize` --- ### [GLM 0.9.8.5](https://github.com/g-truc/glm/releases/tag/0.9.8.5) - 2017-08-16 #### Features: -- Added Conan package support #647 +- Added *Conan* package support #647 #### Fixes: -- Fixed Clang version detection from source #608 -- Fixed packF3x9_E1x5 exponent packing #614 -- Fixed build error min and max specializations with integer #616 -- Fixed simd_mat4 build error #652 +- Fixed *Clang* version detection from source #608 +- Fixed `glm::packF3x9_E1x5` exponent packing #614 +- Fixed build error `min` and `max` specializations with integer #616 +- Fixed `simd_mat4` build error #652 --- ### [GLM 0.9.8.4](https://github.com/g-truc/glm/releases/tag/0.9.8.4) - 2017-01-22 #### Fixes: -- Fixed GTC_packing test failing on GCC x86 due to denorms #212 #577 -- Fixed POPCNT optimization build in Clang #512 -- Fixed intersectRayPlane returns true in parallel case #578 -- Fixed GCC 6.2 compiler warnings #580 -- Fixed GTX_matrix_decompose decompose #582 #448 -- Fixed GCC 4.5 and older build #566 -- Fixed Visual C++ internal error when declaring a global vec type with siwzzle expression enabled #594 -- Fixed GLM_FORCE_CXX11 with Clang and libstlc++ which wasn't using C++11 STL features. #604 +- Fixed *GLM_GTC_packing* test failing on *GCC* x86 due to denorms #212 #577 +- Fixed `POPCNT` optimization build in *Clang* #512 +- Fixed `glm::intersectRayPlane` returns true in parallel case #578 +- Fixed *GCC* 6.2 compiler warnings #580 +- Fixed *GLM_GTX_matrix_decompose* `glm::decompose` #582 #448 +- Fixed *GCC* 4.5 and older build #566 +- Fixed *Visual C++* internal error when declaring a global vec type with siwzzle expression enabled #594 +- Fixed `GLM_FORCE_CXX11` with Clang and libstlc++ which wasn't using C++11 STL features. #604 --- ### [GLM 0.9.8.3](https://github.com/g-truc/glm/releases/tag/0.9.8.3) - 2016-11-12 #### Improvements: -- Broader support of GLM_FORCE_UNRESTRICTED_GENTYPE #378 +- Broader support of `GLM_FORCE_UNRESTRICTED_GENTYPE` #378 #### Fixes: - Fixed Android build error with C++11 compiler but C++98 STL #284 #564 -- Fixed GTX_transform2 shear* functions #403 -- Fixed interaction between GLM_FORCE_UNRESTRICTED_GENTYPE and ortho function #568 -- Fixed bitCount with AVX on 32 bit builds #567 -- Fixed CMake find_package with version specification #572 #573 +- Fixed *GLM_GTX_transform2* shear* functions #403 +- Fixed interaction between `GLM_FORCE_UNRESTRICTED_GENTYPE` and `glm::ortho` function #568 +- Fixed `glm::bitCount` with AVX on 32 bit builds #567 +- Fixed *CMake* `find_package` with version specification #572 #573 --- ### [GLM 0.9.8.2](https://github.com/g-truc/glm/releases/tag/0.9.8.2) - 2016-11-01 #### Improvements: -- Added Visual C++ 15 detection -- Added Clang 4.0 detection -- Added warning messages when using GLM_FORCE_CXX** but the compiler +- Added *Visual C++* 15 detection +- Added *Clang* 4.0 detection +- Added warning messages when using `GLM_FORCE_CXX**` but the compiler is known to not fully support the requested C++ version #555 -- Refactored GLM_COMPILER_VC values -- Made quat, vec, mat type component length() static #565 +- Refactored `GLM_COMPILER_VC` values +- Made quat, vec, mat type component `length()` static #565 #### Fixes: -- Fixed Visual C++ constexpr build error #555, #556 +- Fixed *Visual C++* `constexpr` build error #555, #556 --- ### [GLM 0.9.8.1](https://github.com/g-truc/glm/releases/tag/0.9.8.1) - 2016-09-25 #### Improvements: -- Optimized quaternion log function #554 +- Optimized quaternion `glm::log` function #554 #### Fixes: -- Fixed GCC warning filtering, replaced -pedantic by -Wpedantic +- Fixed *GCC* warning filtering, replaced -pedantic by -Wpedantic - Fixed SIMD faceforward bug. #549 -- Fixed GCC 4.8 with C++11 compilation option #550 -- Fixed Visual Studio aligned type W4 warning #548 +- Fixed *GCC* 4.8 with C++11 compilation option #550 +- Fixed *Visual Studio* aligned type W4 warning #548 - Fixed packing/unpacking function fixed for 5_6_5 and 5_5_5_1 #552 --- ### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/tag/0.9.8.0) - 2016-09-11 #### Features: - Added right and left handed projection and clip control support #447 #415 #119 -- Added compNormalize and compScale functions to GTX_component_wise -- Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416 -- Added (un)packHalf to GTC_packing -- Added (un)packUnorm and (un)packSnorm to GTC_packing -- Added 16bit pack and unpack to GTC_packing -- Added 8bit pack and unpack to GTC_packing -- Added missing bvec* && and || operators -- Added iround and uround to GTC_integer, fast round on positive values +- Added `glm::compNormalize` and `glm::compScale` functions to *GLM_GTX_component_wise* +- Added `glm::packF3x9_E1x5` and `glm::unpackF3x9_E1x5` to *GLM_GTC_packing* for RGB9E5 #416 +- Added `(un)packHalf` to *GLM_GTC_packing* +- Added `(un)packUnorm` and `(un)packSnorm` to *GLM_GTC_packing* +- Added 16bit pack and unpack to *GLM_GTC_packing* +- Added 8bit pack and unpack to *GLM_GTC_packing* +- Added missing `bvec*` && and || operators +- Added `glm::iround` and `glm::uround` to *GLM_GTC_integer*, fast round on positive values - Added raw SIMD API - Added 'aligned' qualifiers -- Added GTC_type_aligned with aligned *vec* types -- Added GTC_functions extension -- Added quaternion version of isnan and isinf #521 -- Added lowestBitValue to GTX_bit #536 -- Added GLM_FORCE_UNRESTRICTED_GENTYPE allowing non basic genType #543 +- Added *GLM_GTC_type_aligned* with aligned *vec* types +- Added *GLM_GTC_functions* extension +- Added quaternion version of `glm::isnan` and `glm::isinf` #521 +- Added `glm::lowestBitValue` to *GLM_GTX_bit* #536 +- Added `GLM_FORCE_UNRESTRICTED_GENTYPE` allowing non basic `genType` #543 #### Improvements: -- Improved SIMD and swizzle operators interactions with GCC and Clang #474 -- Improved GTC_random linearRand documentation -- Improved GTC_reciprocal documentation -- Improved GLM_FORCE_EXPLICIT_CTOR coverage #481 -- Improved OpenMP support detection for Clang, GCC, ICC and VC -- Improved GTX_wrap for SIMD friendliness -- Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493 -- Added NEON instruction set detection -- Added MIPS CPUs detection -- Added PowerPC CPUs detection -- Use Cuda built-in function for abs function implementation with Cuda compiler -- Factorized GLM_COMPILER_LLVM and GLM_COMPILER_APPLE_CLANG into GLM_COMPILER_CLANG +- Improved SIMD and swizzle operators interactions with *GCC* and *Clang* #474 +- Improved *GLM_GTC_random* `linearRand` documentation +- Improved *GLM_GTC_reciprocal* documentation +- Improved `GLM_FORCE_EXPLICIT_CTOR` coverage #481 +- Improved *OpenMP* support detection for *Clang*, *GCC*, *ICC* and *VC* +- Improved *GLM_GTX_wrap* for SIMD friendliness +- Added `constexpr` for `*vec*`, `*mat*`, `*quat*` and `*dual_quat*` types #493 +- Added *NEON* instruction set detection +- Added *MIPS* CPUs detection +- Added *PowerPC* CPUs detection +- Use *Cuda* built-in function for abs function implementation with Cuda compiler +- Factorized `GLM_COMPILER_LLVM` and `GLM_COMPILER_APPLE_CLANG` into `GLM_COMPILER_CLANG` - No more warnings for use of long long - Added more information to build messages #### Fixes: -- Fixed GTX_extended_min_max filename typo #386 -- Fixed intersectRayTriangle to not do any unintentional backface culling -- Fixed long long warnings when using C++98 on GCC and Clang #482 +- Fixed *GLM_GTX_extended_min_max* filename typo #386 +- Fixed `glm::intersectRayTriangle` to not do any unintentional backface culling +- Fixed long long warnings when using C++98 on *GCC* and *Clang* #482 - Fixed sign with signed integer function on non-x86 architecture - Fixed strict aliasing warnings #473 -- Fixed missing vec1 overload to length2 and distance2 functions #431 -- Fixed GLM test '/fp:fast' and '/Za' command-line options are incompatible -- Fixed quaterion to mat3 cast function mat3_cast from GTC_quaternion #542 -- Fixed GTX_io for Cuda #547 #546 +- Fixed missing `glm::vec1` overload to `glm::length2` and `glm::distance2` functions #431 +- Fixed *GLM* test '/fp:fast' and '/Za' command-line options are incompatible +- Fixed quaterion to mat3 cast function `glm::mat3_cast` from *GLM_GTC_quaternion* #542 +- Fixed *GLM_GTX_io* for *Cuda* #547 #546 #### Deprecation: -- Removed GLM_FORCE_SIZE_FUNC define -- Deprecated GLM_GTX_simd_vec4 extension -- Deprecated GLM_GTX_simd_mat4 extension -- Deprecated GLM_GTX_simd_quat extension -- Deprecated GLM_SWIZZLE, use GLM_FORCE_SWIZZLE instead -- Deprecated GLM_MESSAGES, use GLM_FORCE_MESSAGES instead +- Removed `GLM_FORCE_SIZE_FUNC` define +- Deprecated *GLM_GTX_simd_vec4* extension +- Deprecated *GLM_GTX_simd_mat4* extension +- Deprecated *GLM_GTX_simd_quat* extension +- Deprecated `GLM_SWIZZLE`, use `GLM_FORCE_SWIZZLE` instead +- Deprecated `GLM_MESSAGES`, use `GLM_FORCE_MESSAGES` instead --- ### [GLM 0.9.7.6](https://github.com/g-truc/glm/releases/tag/0.9.7.6) - 2016-07-16 @@ -701,14 +792,14 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate) - Increased static_assert coverage - Replaced GLM traits by STL traits when possible - Allowed including individual core feature -- Increased unit tests completness +- Increased unit tests completeness - Added creating of a quaternion from two vectors - Added C++11 initializer lists - Fixed umulExtended and imulExtended implementations for vector types (#76) - Fixed CUDA coverage for GTC extensions - Added GTX_io extension - Improved GLM messages enabled when defining GLM_MESSAGES -- Hidden matrix _inverse function implementation detail into private section +- Hidden matrix_inverse function implementation detail into private section --- ### [GLM 0.9.4.6](https://github.com/g-truc/glm/releases/tag/0.9.4.6) - 2013-09-20 @@ -868,7 +959,7 @@ generation distribution --- ### [GLM 0.9.2.7](https://github.com/g-truc/glm/releases/tag/0.9.2.7) - 2011-10-24 - Added more swizzling constructors -- Added missing none-squared matrix products +- Added missing non-squared matrix products --- ### [GLM 0.9.2.6](https://github.com/g-truc/glm/releases/tag/0.9.2.6) - 2011-10-01 @@ -1197,7 +1288,7 @@ generation distribution ### GLM 0.2 - 2005-05-05 - Improve adaptative from GLSL. - Add experimental extensions based on OpenGL extension process. -- Fixe bugs. +- Fixed bugs. --- ### GLM 0.1 - 2005-02-21 diff --git a/third_party/glm/simd/common.h b/third_party/glm/simd/common.h index 226d61503b..a580a1f48f 100644 --- a/third_party/glm/simd/common.h +++ b/third_party/glm/simd/common.h @@ -7,43 +7,53 @@ #if GLM_ARCH & GLM_ARCH_SSE2_BIT -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_add(glm_f32vec4 a, glm_f32vec4 b) { - return _mm_add_ps(a, 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_f32vec4 glm_vec1_add(glm_f32vec4 a, glm_f32vec4 b) { - return _mm_add_ss(a, 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_f32vec4 glm_vec4_sub(glm_f32vec4 a, glm_f32vec4 b) { - return _mm_sub_ps(a, 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_f32vec4 glm_vec1_sub(glm_f32vec4 a, glm_f32vec4 b) { - return _mm_sub_ss(a, 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_f32vec4 glm_vec4_mul(glm_f32vec4 a, glm_f32vec4 b) { - return _mm_mul_ps(a, 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_f32vec4 glm_vec1_mul(glm_f32vec4 a, glm_f32vec4 b) { - return _mm_mul_ss(a, 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_f32vec4 glm_vec4_div(glm_f32vec4 a, glm_f32vec4 b) { - return _mm_div_ps(a, 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_f32vec4 glm_vec1_div(glm_f32vec4 a, glm_f32vec4 b) { - return _mm_div_ss(a, 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_f32vec4 glm_vec4_div_lowp(glm_f32vec4 a, glm_f32vec4 b) { - return glm_vec4_mul(a, _mm_rcp_ps(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_f32vec4 glm_vec4_swizzle_xyzw(glm_f32vec4 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)); # else @@ -51,8 +61,8 @@ GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_swizzle_xyzw(glm_f32vec4 a) { # endif } -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_fma(glm_f32vec4 a, glm_f32vec4 b, - glm_f32vec4 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) return _mm_fmadd_ss(a, b, c); # else @@ -60,8 +70,8 @@ GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_fma(glm_f32vec4 a, glm_f32vec4 b, # endif } -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_fma(glm_f32vec4 a, glm_f32vec4 b, - glm_f32vec4 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) return _mm_fmadd_ps(a, b, c); # else @@ -69,8 +79,9 @@ GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_fma(glm_f32vec4 a, glm_f32vec4 b, # endif } -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_abs(glm_f32vec4 x) { - return _mm_and_ps(x, _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF))); +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_abs(glm_f32vec4 x) +{ + return _mm_and_ps(x, _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF))); } GLM_FUNC_QUALIFIER glm_ivec4 glm_ivec4_abs(glm_ivec4 x) @@ -92,8 +103,8 @@ 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); - return or0; + glm_vec4 const or0 = _mm_or_ps(and0, and1); + return or0; } GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_round(glm_vec4 x) @@ -195,7 +206,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/third_party/glm/simd/exponential.h b/third_party/glm/simd/exponential.h index b85a2e7210..bc351d0119 100644 --- a/third_party/glm/simd/exponential.h +++ b/third_party/glm/simd/exponential.h @@ -7,12 +7,14 @@ #if GLM_ARCH & GLM_ARCH_SSE2_BIT -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_f32vec4 glm_vec1_sqrt_lowp(glm_f32vec4 x) +{ + return _mm_mul_ss(_mm_rsqrt_ss(x), x); } -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sqrt_lowp(glm_f32vec4 x) { - return _mm_mul_ps(_mm_rsqrt_ps(x), x); +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sqrt_lowp(glm_f32vec4 x) +{ + return _mm_mul_ps(_mm_rsqrt_ps(x), x); } #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/third_party/glm/simd/geometric.h b/third_party/glm/simd/geometric.h index c8c537b579..afbe590e86 100644 --- a/third_party/glm/simd/geometric.h +++ b/third_party/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/third_party/glm/simd/integer.h b/third_party/glm/simd/integer.h index 51010e47a4..93814183fe 100644 --- a/third_party/glm/simd/integer.h +++ b/third_party/glm/simd/integer.h @@ -56,7 +56,7 @@ GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave(glm_uvec4 x) Reg2 = _mm_srli_si128(Reg2, 8); Reg1 = _mm_or_si128(Reg1, Reg2); - return Reg1; + return Reg1; } GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave2(glm_uvec4 x, glm_uvec4 y) @@ -109,7 +109,7 @@ GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave2(glm_uvec4 x, glm_uvec4 y) Reg2 = _mm_srli_si128(Reg2, 8); Reg1 = _mm_or_si128(Reg1, Reg2); - return Reg1; + return Reg1; } #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/third_party/glm/simd/matrix.h b/third_party/glm/simd/matrix.h index c2dff6791b..b6c42ea4c1 100644 --- a/third_party/glm/simd/matrix.h +++ b/third_party/glm/simd/matrix.h @@ -712,14 +712,11 @@ GLM_FUNC_QUALIFIER void glm_mat4_inverse(glm_vec4 const in[4], glm_vec4 out[4]) __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); - // valType Determinant = m[0][0] * Inverse[0][0] - // + m[0][1] * - //Inverse[1][0] - // + m[0][2] * - //Inverse[2][0] - // + m[0][3] * - //Inverse[3][0]; - __m128 Det0 = glm_vec4_dot(in[0], Row2); + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = glm_vec4_dot(in[0], Row2); __m128 Rcp0 = _mm_div_ps(_mm_set1_ps(1.0f), Det0); //__m128 Rcp0 = _mm_rcp_ps(Det0); @@ -936,14 +933,11 @@ GLM_FUNC_QUALIFIER void glm_mat4_inverse_lowp(glm_vec4 const in[4], glm_vec4 out __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); - // valType Determinant = m[0][0] * Inverse[0][0] - // + m[0][1] * - //Inverse[1][0] - // + m[0][2] * - //Inverse[2][0] - // + m[0][3] * - //Inverse[3][0]; - __m128 Det0 = glm_vec4_dot(in[0], Row2); + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = glm_vec4_dot(in[0], Row2); __m128 Rcp0 = _mm_rcp_ps(Det0); //__m128 Rcp0 = _mm_div_ps(one, Det0); // Inverse /= Determinant; @@ -953,78 +947,74 @@ GLM_FUNC_QUALIFIER void glm_mat4_inverse_lowp(glm_vec4 const in[4], glm_vec4 out out[3] = _mm_mul_ps(Inv3, Rcp0); } /* -GLM_FUNC_QUALIFIER void glm_mat4_rotate(__m128 const in[4], float Angle, float -const v[3], __m128 out[4]) +GLM_FUNC_QUALIFIER void glm_mat4_rotate(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) { - float a = glm::radians(Angle); - float c = cos(a); - float s = sin(a); - - glm::vec4 AxisA(v[0], v[1], v[2], float(0)); - __m128 AxisB = _mm_set_ps(AxisA.w, AxisA.z, AxisA.y, AxisA.x); - __m128 AxisC = detail::sse_nrm_ps(AxisB); - - __m128 Cos0 = _mm_set_ss(c); - __m128 CosA = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Sin0 = _mm_set_ss(s); - __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0)); - - // vec<3, T, Q> temp = (valType(1) - c) * axis; - __m128 Temp0 = _mm_sub_ps(one, CosA); - __m128 Temp1 = _mm_mul_ps(Temp0, AxisC); - - //Rotate[0][0] = c + temp[0] * axis[0]; - //Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; - //Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; - __m128 Axis0 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 TmpA0 = _mm_mul_ps(Axis0, AxisC); - __m128 CosA0 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 1, 0)); - __m128 TmpA1 = _mm_add_ps(CosA0, TmpA0); - __m128 SinA0 = SinA;//_mm_set_ps(0.0f, s, -s, 0.0f); - __m128 TmpA2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 1, 2, 3)); - __m128 TmpA3 = _mm_mul_ps(SinA0, TmpA2); - __m128 TmpA4 = _mm_add_ps(TmpA1, TmpA3); - - //Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; - //Rotate[1][1] = c + temp[1] * axis[1]; - //Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; - __m128 Axis1 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 TmpB0 = _mm_mul_ps(Axis1, AxisC); - __m128 CosA1 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 0, 1)); - __m128 TmpB1 = _mm_add_ps(CosA1, TmpB0); - __m128 SinB0 = SinA;//_mm_set_ps(-s, 0.0f, s, 0.0f); - __m128 TmpB2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 0, 3, 2)); - __m128 TmpB3 = _mm_mul_ps(SinA0, TmpB2); - __m128 TmpB4 = _mm_add_ps(TmpB1, TmpB3); - - //Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; - //Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; - //Rotate[2][2] = c + temp[2] * axis[2]; - __m128 Axis2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 TmpC0 = _mm_mul_ps(Axis2, AxisC); - __m128 CosA2 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 0, 1, 1)); - __m128 TmpC1 = _mm_add_ps(CosA2, TmpC0); - __m128 SinC0 = SinA;//_mm_set_ps(s, -s, 0.0f, 0.0f); - __m128 TmpC2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 3, 0, 1)); - __m128 TmpC3 = _mm_mul_ps(SinA0, TmpC2); - __m128 TmpC4 = _mm_add_ps(TmpC1, TmpC3); - - __m128 Result[4]; - Result[0] = TmpA4; - Result[1] = TmpB4; - Result[2] = TmpC4; - Result[3] = _mm_set_ps(1, 0, 0, 0); - - //mat<4, 4, valType> 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; - sse_mul_ps(in, Result, out); + float a = glm::radians(Angle); + float c = cos(a); + float s = sin(a); + + glm::vec4 AxisA(v[0], v[1], v[2], float(0)); + __m128 AxisB = _mm_set_ps(AxisA.w, AxisA.z, AxisA.y, AxisA.x); + __m128 AxisC = detail::sse_nrm_ps(AxisB); + + __m128 Cos0 = _mm_set_ss(c); + __m128 CosA = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Sin0 = _mm_set_ss(s); + __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0)); + + // vec<3, T, Q> temp = (valType(1) - c) * axis; + __m128 Temp0 = _mm_sub_ps(one, CosA); + __m128 Temp1 = _mm_mul_ps(Temp0, AxisC); + + //Rotate[0][0] = c + temp[0] * axis[0]; + //Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; + //Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; + __m128 Axis0 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 TmpA0 = _mm_mul_ps(Axis0, AxisC); + __m128 CosA0 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 1, 0)); + __m128 TmpA1 = _mm_add_ps(CosA0, TmpA0); + __m128 SinA0 = SinA;//_mm_set_ps(0.0f, s, -s, 0.0f); + __m128 TmpA2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 1, 2, 3)); + __m128 TmpA3 = _mm_mul_ps(SinA0, TmpA2); + __m128 TmpA4 = _mm_add_ps(TmpA1, TmpA3); + + //Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; + //Rotate[1][1] = c + temp[1] * axis[1]; + //Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; + __m128 Axis1 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 TmpB0 = _mm_mul_ps(Axis1, AxisC); + __m128 CosA1 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 0, 1)); + __m128 TmpB1 = _mm_add_ps(CosA1, TmpB0); + __m128 SinB0 = SinA;//_mm_set_ps(-s, 0.0f, s, 0.0f); + __m128 TmpB2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 0, 3, 2)); + __m128 TmpB3 = _mm_mul_ps(SinA0, TmpB2); + __m128 TmpB4 = _mm_add_ps(TmpB1, TmpB3); + + //Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; + //Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; + //Rotate[2][2] = c + temp[2] * axis[2]; + __m128 Axis2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 TmpC0 = _mm_mul_ps(Axis2, AxisC); + __m128 CosA2 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 0, 1, 1)); + __m128 TmpC1 = _mm_add_ps(CosA2, TmpC0); + __m128 SinC0 = SinA;//_mm_set_ps(s, -s, 0.0f, 0.0f); + __m128 TmpC2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 3, 0, 1)); + __m128 TmpC3 = _mm_mul_ps(SinA0, TmpC2); + __m128 TmpC4 = _mm_add_ps(TmpC1, TmpC3); + + __m128 Result[4]; + Result[0] = TmpA4; + Result[1] = TmpB4; + Result[2] = TmpC4; + Result[3] = _mm_set_ps(1, 0, 0, 0); + + //mat<4, 4, valType> 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; + sse_mul_ps(in, Result, out); } */ GLM_FUNC_QUALIFIER void glm_mat4_outerProduct(__m128 const& c, __m128 const& r, __m128 out[4]) diff --git a/third_party/glm/simd/neon.h b/third_party/glm/simd/neon.h index e7feda3f69..f85947f5c1 100644 --- a/third_party/glm/simd/neon.h +++ b/third_party/glm/simd/neon.h @@ -7,211 +7,149 @@ #include namespace glm { -namespace neon { -static float32x4_t dupq_lane(float32x4_t vsrc, int lane) { - switch (lane) { + namespace neon { + static inline float32x4_t dupq_lane(float32x4_t vsrc, int lane) { + switch(lane) { #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); + 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)); + 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 - } - assert(!"Unreachable code executed!"); - return vdupq_n_f32(0.0f); -} + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); + } -static float32x2_t dup_lane(float32x4_t vsrc, int lane) { - switch (lane) { + static inline float32x2_t dup_lane(float32x4_t vsrc, int lane) { + switch(lane) { #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); + 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)); + 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 - } - assert(!"Unreachable code executed!"); - return vdup_n_f32(0.0f); -} + } + assert(!"Unreachable code executed!"); + return vdup_n_f32(0.0f); + } -static float32x4_t copy_lane(float32x4_t vdst, int dlane, float32x4_t vsrc, - int slane) { + 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) { - case 0: - switch (slane) { - 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); - } - assert(!"Unreachable code executed!"); - case 1: - switch (slane) { - 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); - } - assert(!"Unreachable code executed!"); - case 2: - switch (slane) { - 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); - } - assert(!"Unreachable code executed!"); - case 3: - switch (slane) { - 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); - } - assert(!"Unreachable code executed!"); - } + switch(dlane) { + case 0: + switch(slane) { + 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); + } + assert(!"Unreachable code executed!"); + case 1: + switch(slane) { + 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); + } + assert(!"Unreachable code executed!"); + case 2: + switch(slane) { + 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); + } + assert(!"Unreachable code executed!"); + case 3: + switch(slane) { + 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); + } + assert(!"Unreachable code executed!"); + } #else - float l; - switch (slane) { - 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; - default: - assert(!"Unreachable code executed!"); - } - switch (dlane) { - 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); - } + float l; + switch(slane) { + 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; + default: + assert(!"Unreachable code executed!"); + } + switch(dlane) { + 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 - assert(!"Unreachable code executed!"); - return vdupq_n_f32(0.0f); -} + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); + } -static float32x4_t mul_lane(float32x4_t v, float32x4_t vlane, int lane) { + static inline float32x4_t mul_lane(float32x4_t v, float32x4_t vlane, int lane) { #if GLM_ARCH & GLM_ARCH_ARMV8_BIT - switch (lane) { - 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; - default: - assert(!"Unreachable code executed!"); - } - assert(!"Unreachable code executed!"); - return vdupq_n_f32(0.0f); + switch(lane) { + 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; + default: + assert(!"Unreachable code executed!"); + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); #else - return vmulq_f32(v, dupq_lane(vlane, lane)); + return vmulq_f32(v, dupq_lane(vlane, lane)); #endif -} + } -static float32x4_t madd_lane(float32x4_t acc, float32x4_t v, float32x4_t vlane, - int lane) { + 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) +# 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) +# 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(!"Unreachable code executed!"); - } - assert(!"Unreachable code executed!"); - return vdupq_n_f32(0.0f); -#undef FMADD_LANE + 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(!"Unreachable code executed!"); + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); +# undef FMADD_LANE #else - return vaddq_f32(acc, vmulq_f32(v, dupq_lane(vlane, lane))); + return vaddq_f32(acc, vmulq_f32(v, dupq_lane(vlane, lane))); #endif -} -} // namespace neon -} // namespace glm -#endif // GLM_ARCH & GLM_ARCH_NEON_BIT + } + } //namespace neon +} // namespace glm +#endif // GLM_ARCH & GLM_ARCH_NEON_BIT diff --git a/third_party/glm/simd/platform.h b/third_party/glm/simd/platform.h index 83761446ea..a318b098f9 100644 --- a/third_party/glm/simd/platform.h +++ b/third_party/glm/simd/platform.h @@ -50,19 +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 0x01000001 -#define GLM_COMPILER_VC14 0x01000002 -#define GLM_COMPILER_VC15 0x01000003 -#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 +#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 @@ -72,17 +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_CUDA75 0x10000001 -#define GLM_COMPILER_CUDA80 0x10000002 -#define GLM_COMPILER_CUDA90 0x10000004 - -// SYCL -#define GLM_COMPILER_SYCL 0x00300000 +#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 @@ -92,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 @@ -105,16 +130,22 @@ # define GLM_COMPILER GLM_COMPILER_UNKNOWN #elif defined(__INTEL_COMPILER) -#if __INTEL_COMPILER >= 1700 +# 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" +# 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 @@ -122,19 +153,21 @@ # 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 >= 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" +# 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 -// SYCL -#elif defined(__SYCL_DEVICE_ONLY__) -#define GLM_COMPILER GLM_COMPILER_SYCL +// HIP +#elif defined(__HIP__) +# define GLM_COMPILER GLM_COMPILER_HIP // Clang #elif defined(__clang__) @@ -164,62 +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 >= 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 +# 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" +# 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__ >= 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" +# 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 @@ -233,31 +304,30 @@ /////////////////////////////////////////////////////////////////////////////////// // Instruction sets -// User defines: GLM_FORCE_PURE GLM_FORCE_INTRINSICS GLM_FORCE_SSE2 -// GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2 +// 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_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_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_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_UNKNOWN (0) #define GLM_ARCH_X86 (GLM_ARCH_X86_BIT) -#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_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) @@ -265,47 +335,46 @@ #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_ARM (GLM_ARCH_ARM_BIT) -#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_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_ARCH_UNKNOWN) || defined(GLM_FORCE_PURE) -#define GLM_ARCH GLM_ARCH_UNKNOWN +# define GLM_ARCH GLM_ARCH_UNKNOWN #elif defined(GLM_FORCE_NEON) -#if __ARM_ARCH >= 8 -#define GLM_ARCH (GLM_ARCH_ARMV8) -#else -#define GLM_ARCH (GLM_ARCH_NEON) -#endif -#define GLM_FORCE_INTRINSICS +# 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 +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_AVX) # define GLM_ARCH (GLM_ARCH_AVX) -#define GLM_FORCE_INTRINSICS +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE42) # define GLM_ARCH (GLM_ARCH_SSE42) -#define GLM_FORCE_INTRINSICS +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE41) # define GLM_ARCH (GLM_ARCH_SSE41) -#define GLM_FORCE_INTRINSICS +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSSE3) # define GLM_ARCH (GLM_ARCH_SSSE3) -#define GLM_FORCE_INTRINSICS +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE3) # define GLM_ARCH (GLM_ARCH_SSE3) -#define GLM_FORCE_INTRINSICS +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE2) # define GLM_ARCH (GLM_ARCH_SSE2) -#define GLM_FORCE_INTRINSICS +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_SSE) -#define GLM_ARCH (GLM_ARCH_SSE) -#define GLM_FORCE_INTRINSICS +# define GLM_ARCH (GLM_ARCH_SSE) +# define GLM_FORCE_INTRINSICS #elif defined(GLM_FORCE_INTRINSICS) && !defined(GLM_FORCE_XYZW_ONLY) -#if defined(__AVX2__) +# if defined(__AVX2__) # define GLM_ARCH (GLM_ARCH_AVX2) # elif defined(__AVX__) # define GLM_ARCH (GLM_ARCH_AVX) @@ -317,36 +386,34 @@ # define GLM_ARCH (GLM_ARCH_SSSE3) # elif defined(__SSE3__) # define GLM_ARCH (GLM_ARCH_SSE3) -#elif defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64) || \ - defined(_M_IX86_FP) +# elif defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86_FP) # define GLM_ARCH (GLM_ARCH_SSE2) -#elif defined(__i386__) +# 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_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__) || defined(_M_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__) || defined(_M_PPC) +# elif defined(__powerpc__ ) || defined(_M_PPC) # define GLM_ARCH (GLM_ARCH_PPC) # else -#define GLM_ARCH (GLM_ARCH_UNKNOWN) +# define GLM_ARCH (GLM_ARCH_UNKNOWN) # endif #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) +# 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(__powerpc__) || defined(_M_PPC) +# elif defined(__powerpc__) || defined(_M_PPC) # define GLM_ARCH (GLM_ARCH_PPC) -#elif defined(__mips__) -#define GLM_ARCH (GLM_ARCH_MIPS) +# elif defined(__mips__) +# define GLM_ARCH (GLM_ARCH_MIPS) # else -#define GLM_ARCH (GLM_ARCH_UNKNOWN) +# define GLM_ARCH (GLM_ARCH_UNKNOWN) # endif #endif @@ -368,35 +435,35 @@ #elif GLM_ARCH & GLM_ARCH_SSE2_BIT # include #elif GLM_ARCH & GLM_ARCH_NEON_BIT -#include "neon.h" +# include "neon.h" #endif//GLM_ARCH #if GLM_ARCH & GLM_ARCH_SSE2_BIT -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; + 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_f64vec4; -typedef glm_f64vec4 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; + typedef float32x4_t glm_f32vec4; + typedef int32x4_t glm_i32vec4; + typedef uint32x4_t glm_u32vec4; #endif diff --git a/third_party/glm/trigonometric.hpp b/third_party/glm/trigonometric.hpp index fcf07f899f..51d49c132b 100644 --- a/third_party/glm/trigonometric.hpp +++ b/third_party/glm/trigonometric.hpp @@ -96,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. ///