From 07db64744f96d6fdcf46e3879333778c5327e35d Mon Sep 17 00:00:00 2001 From: saschawillems Date: Thu, 25 Feb 2016 22:07:24 +0100 Subject: [PATCH] Update to glm 0.9.7.3 --- external/glm/glm/CMakeLists.txt | 5 +- external/glm/glm/detail/func_common.inl | 22 +- external/glm/glm/detail/func_integer.inl | 12 +- external/glm/glm/detail/func_noise.hpp | 93 ---- external/glm/glm/detail/func_noise.inl | 388 ------------- external/glm/glm/detail/func_packing.inl | 156 +++++- .../glm/glm/detail/func_trigonometric.hpp | 4 +- .../glm/glm/detail/func_trigonometric.inl | 8 +- external/glm/glm/detail/precision.hpp | 1 + external/glm/glm/detail/setup.hpp | 427 +++++++------- external/glm/glm/detail/type_half.inl | 8 +- external/glm/glm/detail/type_mat2x2.hpp | 95 ++-- external/glm/glm/detail/type_mat2x2.inl | 97 ++-- external/glm/glm/detail/type_mat2x3.hpp | 86 +-- external/glm/glm/detail/type_mat2x3.inl | 97 ++-- external/glm/glm/detail/type_mat2x4.hpp | 89 +-- external/glm/glm/detail/type_mat2x4.inl | 97 ++-- external/glm/glm/detail/type_mat3x2.hpp | 89 +-- external/glm/glm/detail/type_mat3x2.inl | 105 ++-- external/glm/glm/detail/type_mat3x3.hpp | 73 +-- external/glm/glm/detail/type_mat3x3.inl | 113 ++-- external/glm/glm/detail/type_mat3x4.hpp | 90 +-- external/glm/glm/detail/type_mat3x4.inl | 114 ++-- external/glm/glm/detail/type_mat4x2.hpp | 87 +-- external/glm/glm/detail/type_mat4x2.inl | 122 ++-- external/glm/glm/detail/type_mat4x3.hpp | 70 ++- external/glm/glm/detail/type_mat4x3.inl | 166 +++--- external/glm/glm/detail/type_mat4x4.hpp | 73 +-- external/glm/glm/detail/type_mat4x4.inl | 148 +++-- external/glm/glm/detail/type_vec.hpp | 56 +- external/glm/glm/detail/type_vec1.hpp | 197 ++++--- external/glm/glm/detail/type_vec1.inl | 259 +++++---- external/glm/glm/detail/type_vec2.hpp | 141 ++--- external/glm/glm/detail/type_vec2.inl | 379 +++++++------ external/glm/glm/detail/type_vec3.hpp | 200 +++---- external/glm/glm/detail/type_vec3.inl | 519 +++++++++--------- external/glm/glm/detail/type_vec4.hpp | 173 +++--- external/glm/glm/detail/type_vec4.inl | 357 ++++++------ external/glm/glm/detail/type_vec4_sse2.inl | 69 +-- external/glm/glm/fwd.hpp | 40 +- external/glm/glm/gtc/bitfield.inl | 98 ++-- .../glm/gtc/{color.hpp => color_space.hpp} | 32 +- .../glm/gtc/{color.inl => color_space.inl} | 18 +- external/glm/glm/gtc/constants.hpp | 58 +- external/glm/glm/gtc/constants.inl | 58 +- external/glm/glm/gtc/matrix_inverse.inl | 25 +- external/glm/glm/gtc/matrix_transform.hpp | 5 +- external/glm/glm/gtc/packing.inl | 23 +- external/glm/glm/gtc/quaternion.hpp | 55 +- external/glm/glm/gtc/quaternion.inl | 79 +-- external/glm/glm/gtc/random.inl | 20 +- external/glm/glm/gtc/round.inl | 10 +- external/glm/glm/gtx/compatibility.hpp | 1 + external/glm/glm/gtx/compatibility.inl | 13 +- external/glm/glm/gtx/dual_quaternion.hpp | 161 +++--- external/glm/glm/gtx/dual_quaternion.inl | 76 +-- external/glm/glm/gtx/euler_angles.hpp | 18 +- external/glm/glm/gtx/euler_angles.inl | 56 +- external/glm/glm/gtx/fast_trigonometry.inl | 16 +- external/glm/glm/gtx/hash.hpp | 163 ++++++ external/glm/glm/gtx/hash.inl | 214 ++++++++ external/glm/glm/gtx/intersect.hpp | 6 +- external/glm/glm/gtx/intersect.inl | 4 - external/glm/glm/gtx/io.hpp | 6 + external/glm/glm/gtx/io.inl | 8 + external/glm/glm/gtx/log_base.hpp | 12 +- external/glm/glm/gtx/matrix_decompose.hpp | 2 +- external/glm/glm/gtx/matrix_decompose.inl | 30 +- external/glm/glm/gtx/multiple.hpp | 106 ---- external/glm/glm/gtx/multiple.inl | 64 --- external/glm/glm/gtx/norm.hpp | 4 +- external/glm/glm/gtx/quaternion.inl | 44 +- .../glm/glm/gtx/scalar_multiplication.hpp | 2 +- external/glm/glm/gtx/simd_mat4.hpp | 28 +- external/glm/glm/gtx/simd_mat4.inl | 44 +- external/glm/glm/gtx/simd_quat.hpp | 121 ++-- external/glm/glm/gtx/simd_quat.inl | 45 +- external/glm/glm/gtx/simd_vec4.hpp | 99 ++-- external/glm/glm/gtx/simd_vec4.inl | 34 +- external/glm/glm/gtx/string_cast.hpp | 2 + external/glm/glm/gtx/string_cast.inl | 32 ++ external/glm/glm/gtx/transform.hpp | 2 +- external/glm/glm/gtx/vector_angle.hpp | 6 +- external/glm/glm/gtx/wrap.hpp | 5 + external/glm/glm/gtx/wrap.inl | 127 ++--- 85 files changed, 3739 insertions(+), 3618 deletions(-) delete mode 100644 external/glm/glm/detail/func_noise.hpp delete mode 100644 external/glm/glm/detail/func_noise.inl rename external/glm/glm/gtc/{color.hpp => color_space.hpp} (71%) rename external/glm/glm/gtc/{color.inl => color_space.inl} (85%) create mode 100644 external/glm/glm/gtx/hash.hpp create mode 100644 external/glm/glm/gtx/hash.inl delete mode 100644 external/glm/glm/gtx/multiple.hpp delete mode 100644 external/glm/glm/gtx/multiple.inl diff --git a/external/glm/glm/CMakeLists.txt b/external/glm/glm/CMakeLists.txt index aaeae6269..8f2f552e9 100644 --- a/external/glm/glm/CMakeLists.txt +++ b/external/glm/glm/CMakeLists.txt @@ -4,6 +4,7 @@ file(GLOB ROOT_SOURCE *.cpp) file(GLOB ROOT_INLINE *.inl) file(GLOB ROOT_HEADER *.hpp) file(GLOB ROOT_TEXT ../*.txt) +file(GLOB ROOT_MD ../*.md) file(GLOB ROOT_NAT ../util/glm.natvis) file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) @@ -18,7 +19,7 @@ file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) -source_group("Text Files" FILES ${ROOT_TEXT}) +source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) source_group("Core Files" FILES ${CORE_SOURCE}) source_group("Core Files" FILES ${CORE_INLINE}) source_group("Core Files" FILES ${CORE_HEADER}) @@ -32,7 +33,7 @@ source_group("GTX Files" FILES ${GTX_HEADER}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) if(GLM_TEST_ENABLE) - add_executable(${NAME} ${ROOT_TEXT} ${ROOT_NAT} + add_executable(${NAME} ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} diff --git a/external/glm/glm/detail/func_common.inl b/external/glm/glm/detail/func_common.inl index 83252de40..2c32626f0 100644 --- a/external/glm/glm/detail/func_common.inl +++ b/external/glm/glm/detail/func_common.inl @@ -548,14 +548,16 @@ namespace detail # if GLM_HAS_CXX11_STL return std::isnan(x); -# elif GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL) +# elif GLM_COMPILER & GLM_COMPILER_VC return _isnan(x) != 0; -# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) -# if GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# if GLM_PLATFORM & GLM_PLATFORM_WINDOWS return _isnan(x) != 0; # else - return std::isnan(x); + return ::isnan(x) != 0; # endif +# elif (GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L + return _isnan(x) != 0; # elif GLM_COMPILER & GLM_COMPILER_CUDA return isnan(x) != 0; # else @@ -583,7 +585,11 @@ namespace detail # if GLM_HAS_CXX11_STL return std::isinf(x); # elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) + return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# else + return ::isinf(x); +# endif # elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) return _isinf(x) != 0; @@ -662,7 +668,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); - return std::frexp(x, exp); + return std::frexp(x, &exp); } template @@ -670,7 +676,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); - return tvec1(std::frexp(x.x, exp.x)); + return tvec1(std::frexp(x.x, &exp.x)); } template @@ -706,7 +712,7 @@ namespace detail frexp(x.w, exp.w)); } - template + 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"); diff --git a/external/glm/glm/detail/func_integer.inl b/external/glm/glm/detail/func_integer.inl index 31eddf9bc..20e29d6f9 100644 --- a/external/glm/glm/detail/func_integer.inl +++ b/external/glm/glm/detail/func_integer.inl @@ -248,10 +248,8 @@ namespace detail GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); uint64 Value64 = static_cast(x) * static_cast(y); - uint32* PointerMSB = (reinterpret_cast(&Value64) + 1); - msb = *PointerMSB; - uint32* PointerLSB = (reinterpret_cast(&Value64) + 0); - lsb = *PointerLSB; + msb = static_cast(Value64 >> static_cast(32)); + lsb = static_cast(Value64); } template class vecType> @@ -270,10 +268,8 @@ namespace detail GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); int64 Value64 = static_cast(x) * static_cast(y); - int32* PointerMSB = (reinterpret_cast(&Value64) + 1); - msb = *PointerMSB; - int32* PointerLSB = (reinterpret_cast(&Value64)); - lsb = *PointerLSB; + msb = static_cast(Value64 >> static_cast(32)); + lsb = static_cast(Value64); } template class vecType> diff --git a/external/glm/glm/detail/func_noise.hpp b/external/glm/glm/detail/func_noise.hpp deleted file mode 100644 index a8270879a..000000000 --- a/external/glm/glm/detail/func_noise.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_noise.hpp -/// @date 2008-08-01 / 2011-06-18 -/// @author Christophe Riccio -/// -/// @see GLSL 4.20.8 specification, section 8.13 Noise Functions -/// -/// @defgroup core_func_noise Noise functions -/// @ingroup core -/// -/// Noise functions are stochastic functions that can be used to increase visual -/// complexity. Values returned by the following noise functions give the -/// appearance of randomness, but are not truly random. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "type_vec1.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "setup.hpp" - -namespace glm -{ - /// @addtogroup core_func_noise - /// @{ - - /// Returns a 1D noise value based on the input value x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL noise1 man page - /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions - template - GLM_FUNC_DECL typename genType::value_type noise1(genType const & x); - - /// Returns a 2D noise value based on the input value x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL noise2 man page - /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions - template - GLM_FUNC_DECL tvec2 noise2(genType const & x); - - /// Returns a 3D noise value based on the input value x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL noise3 man page - /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions - template - GLM_FUNC_DECL tvec3 noise3(genType const & x); - - /// Returns a 4D noise value based on the input value x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL noise4 man page - /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions - template - GLM_FUNC_DECL tvec4 noise4(genType const & x); - - /// @} -}//namespace glm - -#include "func_noise.inl" diff --git a/external/glm/glm/detail/func_noise.inl b/external/glm/glm/detail/func_noise.inl deleted file mode 100644 index 10901e693..000000000 --- a/external/glm/glm/detail/func_noise.inl +++ /dev/null @@ -1,388 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref core -/// @file glm/detail/func_noise.inl -/// @date 2008-08-01 / 2011-09-27 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include "../detail/_noise.hpp" -#include "./func_common.hpp" - -namespace glm{ -namespace detail -{ - template - GLM_FUNC_QUALIFIER tvec4 grad4(T const & j, tvec4 const & ip) - { - tvec3 pXYZ = floor(fract(tvec3(j) * tvec3(ip)) * T(7)) * ip[2] - T(1); - T pW = static_cast(1.5) - dot(abs(pXYZ), tvec3(1)); - tvec4 s = tvec4(lessThan(tvec4(pXYZ, pW), tvec4(0.0))); - pXYZ = pXYZ + (tvec3(s) * T(2) - T(1)) * s.w; - return tvec4(pXYZ, pW); - } -}//namespace detail - - template - GLM_FUNC_QUALIFIER T noise1(T const & x) - { - return noise1(tvec2(x, T(0))); - } - - template - GLM_FUNC_QUALIFIER tvec2 noise2(T const & x) - { - return tvec2( - noise1(x + T(0.0)), - noise1(x + T(1.0))); - } - - template - GLM_FUNC_QUALIFIER tvec3 noise3(T const & x) - { - return tvec3( - noise1(x - T(1.0)), - noise1(x + T(0.0)), - noise1(x + T(1.0))); - } - - template - GLM_FUNC_QUALIFIER tvec4 noise4(T const & x) - { - return tvec4( - noise1(x - T(1.0)), - noise1(x + T(0.0)), - noise1(x + T(1.0)), - noise1(x + T(2.0))); - } - - template - GLM_FUNC_QUALIFIER T noise1(tvec2 const & v) - { - tvec4 const C = tvec4( - T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 - T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0) - T(-0.577350269189626), // -1.0 + 2.0 * C.x - T( 0.024390243902439)); // 1.0 / 41.0 - - // First corner - tvec2 i = floor(v + dot(v, tvec2(C[1]))); - tvec2 x0 = v - i + dot(i, tvec2(C[0])); - - // Other corners - //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 - //i1.y = 1.0 - i1.x; - tvec2 i1 = (x0.x > x0.y) ? tvec2(1, 0) : tvec2(0, 1); - - // x0 = x0 - 0.0 + 0.0 * C.xx ; - // x1 = x0 - i1 + 1.0 * C.xx ; - // x2 = x0 - 1.0 + 2.0 * C.xx ; - tvec4 x12 = tvec4(x0.x, x0.y, x0.x, x0.y) + tvec4(C.x, C.x, C.z, C.z); - x12 = tvec4(tvec2(x12) - i1, x12.z, x12.w); - - // Permutations - i = mod(i, T(289)); // Avoid truncation effects in permutation - tvec3 p = detail::permute( - detail::permute(i.y + tvec3(T(0), i1.y, T(1))) + i.x + tvec3(T(0), i1.x, T(1))); - - tvec3 m = max(T(0.5) - tvec3( - dot(x0, x0), - dot(tvec2(x12.x, x12.y), tvec2(x12.x, x12.y)), - dot(tvec2(x12.z, x12.w), tvec2(x12.z, x12.w))), T(0)); - - m = m * m; - m = m * m; - - // Gradients: 41 points uniformly over a line, mapped onto a diamond. - // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) - - tvec3 x = static_cast(2) * fract(p * C.w) - T(1); - tvec3 h = abs(x) - T(0.5); - tvec3 ox = floor(x + T(0.5)); - tvec3 a0 = x - ox; - - // Normalise gradients implicitly by scaling m - // Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h ); - m *= static_cast(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h); - - // Compute final noise value at P - tvec3 g; - g.x = a0.x * x0.x + h.x * x0.y; - //g.yz = a0.yz * x12.xz + h.yz * x12.yw; - g.y = a0.y * x12.x + h.y * x12.y; - g.z = a0.z * x12.z + h.z * x12.w; - return T(130) * dot(m, g); - } - - template - GLM_FUNC_QUALIFIER T noise1(tvec3 const & v) - { - tvec2 const C(1.0 / 6.0, 1.0 / 3.0); - tvec4 const D(0.0, 0.5, 1.0, 2.0); - - // First corner - tvec3 i(floor(v + dot(v, tvec3(C.y)))); - tvec3 x0(v - i + dot(i, tvec3(C.x))); - - // Other corners - tvec3 g(step(tvec3(x0.y, x0.z, x0.x), x0)); - tvec3 l(T(1) - g); - tvec3 i1(min(g, tvec3(l.z, l.x, l.y))); - tvec3 i2(max(g, tvec3(l.z, l.x, l.y))); - - // x0 = x0 - 0.0 + 0.0 * C.xxx; - // x1 = x0 - i1 + 1.0 * C.xxx; - // x2 = x0 - i2 + 2.0 * C.xxx; - // x3 = x0 - 1.0 + 3.0 * C.xxx; - tvec3 x1(x0 - i1 + C.x); - tvec3 x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y - tvec3 x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y - - // Permutations - i = mod289(i); - tvec4 p(detail::permute(detail::permute(detail::permute( - i.z + tvec4(T(0), i1.z, i2.z, T(1))) + - i.y + tvec4(T(0), i1.y, i2.y, T(1))) + - i.x + tvec4(T(0), i1.x, i2.x, T(1)))); - - // Gradients: 7x7 points over a square, mapped onto an octahedron. - // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) - T n_ = static_cast(0.142857142857); // 1.0/7.0 - tvec3 ns(n_ * tvec3(D.w, D.y, D.z) - tvec3(D.x, D.z, D.x)); - - tvec4 j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7) - - tvec4 x_(floor(j * ns.z)); - tvec4 y_(floor(j - T(7) * x_)); // mod(j,N) - - tvec4 x(x_ * ns.x + ns.y); - tvec4 y(y_ * ns.x + ns.y); - tvec4 h(T(1) - abs(x) - abs(y)); - - tvec4 b0(x.x, x.y, y.x, y.y); - tvec4 b1(x.z, x.w, y.z, y.w); - - // vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; - // vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; - tvec4 s0(floor(b0) * T(2) + T(1)); - tvec4 s1(floor(b1) * T(2) + T(1)); - tvec4 sh(-step(h, tvec4(0.0))); - - tvec4 a0 = tvec4(b0.x, b0.z, b0.y, b0.w) + tvec4(s0.x, s0.z, s0.y, s0.w) * tvec4(sh.x, sh.x, sh.y, sh.y); - tvec4 a1 = tvec4(b1.x, b1.z, b1.y, b1.w) + tvec4(s1.x, s1.z, s1.y, s1.w) * tvec4(sh.z, sh.z, sh.w, sh.w); - - tvec3 p0(a0.x, a0.y, h.x); - tvec3 p1(a0.z, a0.w, h.y); - tvec3 p2(a1.x, a1.y, h.z); - tvec3 p3(a1.z, a1.w, h.w); - - // Normalise gradients - tvec4 norm = taylorInvSqrt(tvec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - - // Mix final noise value - tvec4 m = max(T(0.6) - tvec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), T(0)); - m = m * m; - return T(42) * dot(m * m, tvec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); - } - - template - GLM_FUNC_QUALIFIER T noise1(tvec4 const & v) - { - tvec4 const C( - 0.138196601125011, // (5 - sqrt(5))/20 G4 - 0.276393202250021, // 2 * G4 - 0.414589803375032, // 3 * G4 - -0.447213595499958); // -1 + 4 * G4 - - // (sqrt(5) - 1)/4 = F4, used once below - T const F4 = static_cast(0.309016994374947451); - - // First corner - tvec4 i = floor(v + dot(v, tvec4(F4))); - tvec4 x0 = v - i + dot(i, tvec4(C.x)); - - // Other corners - - // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) - tvec4 i0; - tvec3 isX = step(tvec3(x0.y, x0.z, x0.w), tvec3(x0.x)); - tvec3 isYZ = step(tvec3(x0.z, x0.w, x0.w), tvec3(x0.y, x0.y, x0.z)); - - // i0.x = dot(isX, vec3(1.0)); - //i0.x = isX.x + isX.y + isX.z; - //i0.yzw = static_cast(1) - isX; - i0 = tvec4(isX.x + isX.y + isX.z, T(1) - isX); - - // i0.y += dot(isYZ.xy, vec2(1.0)); - i0.y += isYZ.x + isYZ.y; - - //i0.zw += 1.0 - tvec2(isYZ.x, isYZ.y); - i0.z += static_cast(1) - isYZ.x; - i0.w += static_cast(1) - isYZ.y; - i0.z += isYZ.z; - i0.w += static_cast(1) - isYZ.z; - - // i0 now contains the unique values 0,1,2,3 in each channel - tvec4 i3 = clamp(i0, T(0), T(1)); - tvec4 i2 = clamp(i0 - T(1), T(0), T(1)); - tvec4 i1 = clamp(i0 - T(2), T(0), T(1)); - - // x0 = x0 - 0.0 + 0.0 * C.xxxx - // x1 = x0 - i1 + 0.0 * C.xxxx - // x2 = x0 - i2 + 0.0 * C.xxxx - // x3 = x0 - i3 + 0.0 * C.xxxx - // x4 = x0 - 1.0 + 4.0 * C.xxxx - tvec4 x1 = x0 - i1 + C.x; - tvec4 x2 = x0 - i2 + C.y; - tvec4 x3 = x0 - i3 + C.z; - tvec4 x4 = x0 + C.w; - - // Permutations - i = mod(i, T(289)); - T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x); - tvec4 j1 = detail::permute(detail::permute(detail::permute(detail::permute( - i.w + tvec4(i1.w, i2.w, i3.w, T(1))) + - i.z + tvec4(i1.z, i2.z, i3.z, T(1))) + - i.y + tvec4(i1.y, i2.y, i3.y, T(1))) + - i.x + tvec4(i1.x, i2.x, i3.x, T(1))); - - // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope - // 7*7*6 = 294, which is close to the ring size 17*17 = 289. - tvec4 ip = tvec4(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); - - tvec4 p0 = detail::grad4(j0, ip); - tvec4 p1 = detail::grad4(j1.x, ip); - tvec4 p2 = detail::grad4(j1.y, ip); - tvec4 p3 = detail::grad4(j1.z, ip); - tvec4 p4 = detail::grad4(j1.w, ip); - - // Normalise gradients - tvec4 norm = detail::taylorInvSqrt(tvec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - p4 *= taylorInvSqrt(dot(p4, p4)); - - // Mix contributions from the five corners - tvec3 m0 = max(T(0.6) - tvec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), T(0)); - tvec2 m1 = max(T(0.6) - tvec2(dot(x3, x3), dot(x4, x4) ), T(0)); - m0 = m0 * m0; - m1 = m1 * m1; - - return T(49) * ( - dot(m0 * m0, tvec3(dot(p0, x0), dot(p1, x1), dot(p2, x2))) + - dot(m1 * m1, tvec2(dot(p3, x3), dot(p4, x4)))); - } - - template - GLM_FUNC_QUALIFIER tvec2 noise2(tvec2 const & x) - { - return tvec2( - noise1(x + tvec2(0.0)), - noise1(tvec2(0.0) - x)); - } - - template - GLM_FUNC_QUALIFIER tvec2 noise2(tvec3 const & x) - { - return tvec2( - noise1(x + tvec3(0.0)), - noise1(tvec3(0.0) - x)); - } - - template - GLM_FUNC_QUALIFIER tvec2 noise2(tvec4 const & x) - { - return tvec2( - noise1(x + tvec4(0)), - noise1(tvec4(0) - x)); - } - - template - GLM_FUNC_QUALIFIER tvec3 noise3(tvec2 const & x) - { - return tvec3( - noise1(x - tvec2(1.0)), - noise1(x + tvec2(0.0)), - noise1(x + tvec2(1.0))); - } - - template - GLM_FUNC_QUALIFIER tvec3 noise3(tvec3 const & x) - { - return tvec3( - noise1(x - tvec3(1.0)), - noise1(x + tvec3(0.0)), - noise1(x + tvec3(1.0))); - } - - template - GLM_FUNC_QUALIFIER tvec3 noise3(tvec4 const & x) - { - return tvec3( - noise1(x - tvec4(1)), - noise1(x + tvec4(0)), - noise1(x + tvec4(1))); - } - - template - GLM_FUNC_QUALIFIER tvec4 noise4(tvec2 const & x) - { - return tvec4( - noise1(x - tvec2(1)), - noise1(x + tvec2(0)), - noise1(x + tvec2(1)), - noise1(x + tvec2(2))); - } - - - template - GLM_FUNC_QUALIFIER tvec4 noise4(tvec3 const & x) - { - return tvec4( - noise1(x - tvec3(1)), - noise1(x + tvec3(0)), - noise1(x + tvec3(1)), - noise1(x + tvec3(2))); - } - - template - GLM_FUNC_QUALIFIER tvec4 noise4(tvec4 const & x) - { - return tvec4( - noise1(x - tvec4(1)), - noise1(x + tvec4(0)), - noise1(x + tvec4(1)), - noise1(x + tvec4(2))); - } - -}//namespace glm diff --git a/external/glm/glm/detail/func_packing.inl b/external/glm/glm/detail/func_packing.inl index 3132a279c..34953fdf5 100644 --- a/external/glm/glm/detail/func_packing.inl +++ b/external/glm/glm/detail/func_packing.inl @@ -38,82 +38,178 @@ namespace glm { GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v) { - u16vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); - return reinterpret_cast(Topack); + union + { + u16 in[2]; + uint out; + } u; + + u16vec2 result(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + + return u.out; } GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p) { - vec2 Unpack(reinterpret_cast(p)); - return Unpack * float(1.5259021896696421759365224689097e-5); // 1.0 / 65535.0 + union + { + uint in; + u16 out[2]; + } u; + + u.in = p; + + return vec2(u.out[0], u.out[1]) * 1.5259021896696421759365224689097e-5f; } GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v) { - i16vec2 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - return reinterpret_cast(Topack); + union + { + i16 in[2]; + uint out; + } u; + + i16vec2 result(round(clamp(v, -1.0f, 1.0f) * 32767.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + + return u.out; } GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p) { - vec2 const Unpack(reinterpret_cast(p)); - return clamp( - Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, - -1.0f, 1.0f); + union + { + uint in; + i16 out[2]; + } u; + + u.in = p; + + return clamp(vec2(u.out[0], u.out[1]) * 3.0518509475997192297128208258309e-5f, -1.0f, 1.0f); } GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v) { - u8vec4 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - return reinterpret_cast(Topack); + union + { + u8 in[4]; + uint out; + } u; + + u8vec4 result(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + u.in[2] = result[2]; + u.in[3] = result[3]; + + return u.out; } GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p) { - vec4 const Unpack(reinterpret_cast(p)); - return Unpack * float(0.0039215686274509803921568627451); // 1 / 255 + union + { + uint in; + u8 out[4]; + } u; + + u.in = p; + + return vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0039215686274509803921568627451f; } GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const & v) { - i8vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 127.0f)); - return reinterpret_cast(Topack); + union + { + i8 in[4]; + uint out; + } u; + + i8vec4 result(round(clamp(v, -1.0f, 1.0f) * 127.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + u.in[2] = result[2]; + u.in[3] = result[3]; + + return u.out; } GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p) { - vec4 const Unpack(reinterpret_cast(p)); - return clamp( - Unpack * 0.0078740157480315f, // 1.0f / 127.0f - -1.0f, 1.0f); + union + { + uint in; + i8 out[4]; + } u; + + u.in = p; + + return clamp(vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0078740157480315f, -1.0f, 1.0f); } GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const & v) { - return reinterpret_cast(v); + union + { + uint in[2]; + double out; + } u; + + u.in[0] = v[0]; + u.in[1] = v[1]; + + return u.out; } GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v) { - return reinterpret_cast(v); + union + { + double in; + uint out[2]; + } u; + + u.in = v; + + return uvec2(u.out[0], u.out[1]); } GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v) { - i16vec2 const Unpack( - detail::toFloat16(v.x), - detail::toFloat16(v.y)); + union + { + i16 in[2]; + uint out; + } u; + + u.in[0] = detail::toFloat16(v.x); + u.in[1] = detail::toFloat16(v.y); - return reinterpret_cast(Unpack); + return u.out; } GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v) { - i16vec2 const Unpack(reinterpret_cast(v)); - + union + { + uint in; + i16 out[2]; + } u; + + u.in = v; + return vec2( - detail::toFloat32(Unpack.x), - detail::toFloat32(Unpack.y)); + detail::toFloat32(u.out[0]), + detail::toFloat32(u.out[1])); } }//namespace glm diff --git a/external/glm/glm/detail/func_trigonometric.hpp b/external/glm/glm/detail/func_trigonometric.hpp index d43961bac..244349775 100644 --- a/external/glm/glm/detail/func_trigonometric.hpp +++ b/external/glm/glm/detail/func_trigonometric.hpp @@ -58,7 +58,7 @@ namespace glm /// @see GLSL radians man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template class vecType> - GLM_FUNC_DECL vecType radians(vecType const & degrees); + GLM_FUNC_DECL GLM_CONSTEXPR vecType radians(vecType const & degrees); /// Converts radians to degrees and returns the result. /// @@ -67,7 +67,7 @@ namespace glm /// @see GLSL degrees man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template class vecType> - GLM_FUNC_DECL vecType degrees(vecType const & radians); + GLM_FUNC_DECL GLM_CONSTEXPR vecType degrees(vecType const & radians); /// The standard trigonometric sine function. /// The values returned by this function will range from [-1, 1]. diff --git a/external/glm/glm/detail/func_trigonometric.inl b/external/glm/glm/detail/func_trigonometric.inl index a71052508..f723de47b 100644 --- a/external/glm/glm/detail/func_trigonometric.inl +++ b/external/glm/glm/detail/func_trigonometric.inl @@ -38,7 +38,7 @@ namespace glm { // radians template - GLM_FUNC_QUALIFIER genType radians(genType degrees) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'radians' only accept floating-point input"); @@ -46,14 +46,14 @@ namespace glm } template class vecType> - GLM_FUNC_QUALIFIER vecType radians(vecType const & v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType radians(vecType const & v) { return detail::functor1::call(radians, v); } // degrees template - GLM_FUNC_QUALIFIER genType degrees(genType radians) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'degrees' only accept floating-point input"); @@ -61,7 +61,7 @@ namespace glm } template class vecType> - GLM_FUNC_QUALIFIER vecType degrees(vecType const & v) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType degrees(vecType const & v) { return detail::functor1::call(degrees, v); } diff --git a/external/glm/glm/detail/precision.hpp b/external/glm/glm/detail/precision.hpp index 2be5e238a..c657d031c 100644 --- a/external/glm/glm/detail/precision.hpp +++ b/external/glm/glm/detail/precision.hpp @@ -39,6 +39,7 @@ namespace glm highp, mediump, lowp, + simd, defaultp = highp }; }//namespace glm diff --git a/external/glm/glm/detail/setup.hpp b/external/glm/glm/detail/setup.hpp index 1defed896..f8378ee06 100644 --- a/external/glm/glm/detail/setup.hpp +++ b/external/glm/glm/detail/setup.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -42,11 +42,11 @@ #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 #define GLM_VERSION_PATCH 7 -#define GLM_VERSION_REVISION 0 +#define GLM_VERSION_REVISION 3 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_VERSION_DISPLAYED)) # define GLM_MESSAGE_VERSION_DISPLAYED -# pragma message ("GLM: version 0.9.7") +# pragma message ("GLM: version 0.9.7.3") #endif//GLM_MESSAGE /////////////////////////////////////////////////////////////////////////////////// @@ -65,6 +65,8 @@ #ifdef GLM_FORCE_PLATFORM_UNKNOWN # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN +#elif defined(__CYGWIN__) +# define GLM_PLATFORM GLM_PLATFORM_CYGWIN #elif defined(__QNXNTO__) # define GLM_PLATFORM GLM_PLATFORM_QNXNTO #elif defined(__APPLE__) @@ -117,7 +119,7 @@ // Compiler // User defines: GLM_FORCE_COMPILER_UNKNOWN -// TODO ? __llvm__ +// TODO ? __llvm__ #define GLM_COMPILER_UNKNOWN 0x00000000 @@ -128,6 +130,7 @@ #define GLM_COMPILER_INTEL13 0x00100030 #define GLM_COMPILER_INTEL14 0x00100040 #define GLM_COMPILER_INTEL15 0x00100050 +#define GLM_COMPILER_INTEL16 0x00100060 // Visual C++ defines #define GLM_COMPILER_VC 0x01000000 @@ -145,6 +148,10 @@ #define GLM_COMPILER_GCC48 0x020000F0 #define GLM_COMPILER_GCC49 0x02000100 #define GLM_COMPILER_GCC50 0x02000200 +#define GLM_COMPILER_GCC51 0x02000300 +#define GLM_COMPILER_GCC52 0x02000400 +#define GLM_COMPILER_GCC53 0x02000500 +#define GLM_COMPILER_GCC60 0x02000600 // CUDA #define GLM_COMPILER_CUDA 0x10000000 @@ -154,6 +161,8 @@ #define GLM_COMPILER_CUDA50 0x10000070 #define GLM_COMPILER_CUDA60 0x10000080 #define GLM_COMPILER_CUDA65 0x10000090 +#define GLM_COMPILER_CUDA70 0x100000A0 +#define GLM_COMPILER_CUDA75 0x100000B0 // LLVM #define GLM_COMPILER_LLVM 0x20000000 @@ -161,6 +170,10 @@ #define GLM_COMPILER_LLVM33 0x20000040 #define GLM_COMPILER_LLVM34 0x20000050 #define GLM_COMPILER_LLVM35 0x20000060 +#define GLM_COMPILER_LLVM36 0x20000070 +#define GLM_COMPILER_LLVM37 0x20000080 +#define GLM_COMPILER_LLVM38 0x20000090 +#define GLM_COMPILER_LLVM39 0x200000A0 // Apple Clang #define GLM_COMPILER_APPLE_CLANG 0x40000000 @@ -170,6 +183,7 @@ #define GLM_COMPILER_APPLE_CLANG50 0x40000040 #define GLM_COMPILER_APPLE_CLANG51 0x40000050 #define GLM_COMPILER_APPLE_CLANG60 0x40000060 +#define GLM_COMPILER_APPLE_CLANG61 0x40000070 // Build model #define GLM_MODEL_32 0x00000010 @@ -188,8 +202,10 @@ # define GLM_COMPILER GLM_COMPILER_INTEL13 # elif __INTEL_COMPILER == 1400 # define GLM_COMPILER GLM_COMPILER_INTEL14 -# elif __INTEL_COMPILER >= 1500 +# elif __INTEL_COMPILER == 1500 # define GLM_COMPILER GLM_COMPILER_INTEL15 +# elif __INTEL_COMPILER >= 1600 +# define GLM_COMPILER GLM_COMPILER_INTEL16 # else # define GLM_COMPILER GLM_COMPILER_INTEL # endif @@ -197,7 +213,7 @@ // CUDA #elif defined(__CUDACC__) # if !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA) -# include // make sure version is defined since nvcc does not define it itself! +# include // make sure version is defined since nvcc does not define it itself! # endif # if CUDA_VERSION < 3000 # error "GLM requires CUDA 3.0 or higher" @@ -234,8 +250,14 @@ # define GLM_COMPILER GLM_COMPILER_APPLE_CLANG50 # elif __clang_major__ == 5 && __clang_minor__ == 1 # define GLM_COMPILER GLM_COMPILER_APPLE_CLANG51 -# elif __clang_major__ >= 6 +# elif __clang_major__ == 6 && __clang_minor__ == 0 # define GLM_COMPILER GLM_COMPILER_APPLE_CLANG60 +# elif __clang_major__ == 6 && __clang_minor__ >= 1 +# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61 +# elif __clang_major__ >= 7 +# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61 +# else +# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG # endif # else # if __clang_major__ == 3 && __clang_minor__ == 0 @@ -250,12 +272,22 @@ # define GLM_COMPILER GLM_COMPILER_LLVM34 # elif __clang_major__ == 3 && __clang_minor__ == 5 # define GLM_COMPILER GLM_COMPILER_LLVM35 +# elif __clang_major__ == 3 && __clang_minor__ == 6 +# define GLM_COMPILER GLM_COMPILER_LLVM36 +# elif __clang_major__ == 3 && __clang_minor__ == 7 +# define GLM_COMPILER GLM_COMPILER_LLVM37 +# elif __clang_major__ == 3 && __clang_minor__ == 8 +# define GLM_COMPILER GLM_COMPILER_LLVM38 +# elif __clang_major__ == 3 && __clang_minor__ >= 9 +# define GLM_COMPILER GLM_COMPILER_LLVM39 +# elif __clang_major__ >= 4 +# define GLM_COMPILER GLM_COMPILER_LLVM39 # else -# define GLM_COMPILER GLM_COMPILER_LLVM35 +# define GLM_COMPILER GLM_COMPILER_LLVM # endif # endif -// G++ +// G++ #elif defined(__GNUC__) || defined(__MINGW32__) # if (__GNUC__ == 4) && (__GNUC_MINOR__ == 2) # define GLM_COMPILER (GLM_COMPILER_GCC42) @@ -273,8 +305,16 @@ # define GLM_COMPILER (GLM_COMPILER_GCC48) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9) # define GLM_COMPILER (GLM_COMPILER_GCC49) -# elif (__GNUC__ > 4 ) +# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0) # define GLM_COMPILER (GLM_COMPILER_GCC50) +# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 1) +# define GLM_COMPILER (GLM_COMPILER_GCC51) +# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 2) +# define GLM_COMPILER (GLM_COMPILER_GCC52) +# elif (__GNUC__ == 5) && (__GNUC_MINOR__ >= 3) +# define GLM_COMPILER (GLM_COMPILER_GCC53) +# elif (__GNUC__ >= 6) +# define GLM_COMPILER (GLM_COMPILER_GCC60) # else # define GLM_COMPILER (GLM_COMPILER_GCC) # endif @@ -331,6 +371,120 @@ # endif//GLM_MODEL #endif//GLM_MESSAGE +/////////////////////////////////////////////////////////////////////////////////// +// Platform + +// User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2 + +#define GLM_ARCH_PURE 0x0000 +#define GLM_ARCH_ARM 0x0001 +#define GLM_ARCH_X86 0x0002 +#define GLM_ARCH_SSE2 0x0004 +#define GLM_ARCH_SSE3 0x0008 +#define GLM_ARCH_SSE4 0x0010 +#define GLM_ARCH_AVX 0x0020 +#define GLM_ARCH_AVX2 0x0040 +#define GLM_ARCH_AVX512 0x0080 // Skylake set + +#if defined(GLM_FORCE_PURE) +# define GLM_ARCH GLM_ARCH_PURE +#elif defined(GLM_FORCE_AVX512) +# define GLM_ARCH (GLM_ARCH_AVX512 | GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +#elif defined(GLM_FORCE_AVX2) +# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +#elif defined(GLM_FORCE_AVX) +# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +#elif defined(GLM_FORCE_SSE4) +# define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +#elif defined(GLM_FORCE_SSE3) +# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +#elif defined(GLM_FORCE_SSE2) +# define GLM_ARCH (GLM_ARCH_SSE2) +#elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) +// This is Skylake set of instruction set +# if defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512CD__) && defined(__AVX512VL__) && defined(__AVX512DQ__) +# define GLM_ARCH (GLM_ARCH_AVX512 | GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__AVX2__) +# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__AVX__) +# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__SSE3__) +# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__SSE2__) +# define GLM_ARCH (GLM_ARCH_SSE2) +# else +# define GLM_ARCH GLM_ARCH_PURE +# endif +#elif (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) +# if defined(_M_ARM_FP) +# define GLM_ARCH (GLM_ARCH_ARM) +# elif defined(__AVX2__) +# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__AVX__) +# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif _M_IX86_FP == 2 +# define GLM_ARCH (GLM_ARCH_SSE2) +# else +# define GLM_ARCH (GLM_ARCH_PURE) +# endif +#elif (GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__)) +# if defined(__AVX2__) +# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__AVX__) +# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__SSE4_1__ ) +# define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__SSE3__) +# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) +# elif defined(__SSE2__) +# define GLM_ARCH (GLM_ARCH_SSE2) +# else +# define GLM_ARCH (GLM_ARCH_PURE) +# endif +#else +# define GLM_ARCH GLM_ARCH_PURE +#endif + +// With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is +// that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems. +// To fix, we just explicitly include intrin.h here. +#if defined(__MINGW64__) && (GLM_ARCH != GLM_ARCH_PURE) +# include +#endif + +#if GLM_ARCH & GLM_ARCH_AVX2 +# include +#endif//GLM_ARCH +#if GLM_ARCH & GLM_ARCH_AVX +# include +#endif//GLM_ARCH +#if GLM_ARCH & GLM_ARCH_SSE4 +# include +#endif//GLM_ARCH +#if GLM_ARCH & GLM_ARCH_SSE3 +# include +#endif//GLM_ARCH +#if GLM_ARCH & GLM_ARCH_SSE2 +# include +#endif//GLM_ARCH + +#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED) +# define GLM_MESSAGE_ARCH_DISPLAYED +# if(GLM_ARCH == GLM_ARCH_PURE) +# pragma message("GLM: Platform independent code") +# elif(GLM_ARCH & GLM_ARCH_ARM) +# pragma message("GLM: ARM instruction set") +# elif(GLM_ARCH & GLM_ARCH_AVX2) +# pragma message("GLM: AVX2 instruction set") +# elif(GLM_ARCH & GLM_ARCH_AVX) +# pragma message("GLM: AVX instruction set") +# elif(GLM_ARCH & GLM_ARCH_SSE3) +# pragma message("GLM: SSE3 instruction set") +# elif(GLM_ARCH & GLM_ARCH_SSE2) +# pragma message("GLM: SSE2 instruction set") +# endif//GLM_ARCH +#endif//GLM_MESSAGE + /////////////////////////////////////////////////////////////////////////////////// // C++ Version @@ -427,29 +581,20 @@ # endif # elif GLM_COMPILER & GLM_COMPILER_INTEL # ifdef _MSC_EXTENSIONS -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# elif GLM_COMPILER >= GLM_COMPILER_INTEL13 -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) -# endif +# define GLM_MSC_EXT GLM_LANG_CXXMS_FLAG # else -# if __cplusplus >= 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) -# elif GLM_COMPILER >= GLM_COMPILER_INTEL13 -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# elif __cplusplus >= 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) -# else -# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) -# endif +# define GLM_MSC_EXT 0 +# endif +# if __cplusplus >= 201402L +# define GLM_LANG (GLM_LANG_CXX14 | GLM_MSC_EXT) +# elif __cplusplus >= 201103L +# define GLM_LANG (GLM_LANG_CXX11 | GLM_MSC_EXT) +# elif __INTEL_CXX11_MODE__ +# define GLM_LANG (GLM_LANG_CXX0X | GLM_MSC_EXT) +# elif __cplusplus >= 199711L +# define GLM_LANG (GLM_LANG_CXX98 | GLM_MSC_EXT) +# else +# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT) # endif # else // Unkown compiler # if __cplusplus >= 201402L @@ -500,14 +645,24 @@ // http://gcc.gnu.org/projects/cxx0x.html // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx -#if GLM_PLATFORM == GLM_PLATFORM_ANDROID +#if GLM_PLATFORM == GLM_PLATFORM_ANDROID || GLM_PLATFORM == GLM_PLATFORM_CYGWIN # define GLM_HAS_CXX11_STL 0 -#elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_INTEL) -# define GLM_HAS_CXX11_STL __has_include("__config") +#elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# if __has_include(<__config>) // libc++ +# include <__config> +//# else // libstdc++ +//# include +# endif +# if defined(_LIBCPP_VERSION)// || defined(__GLIBCXX__) +# define GLM_HAS_CXX11_STL 1 +# else +# define GLM_HAS_CXX11_STL 0 +# endif #else # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15))) #endif // N1720 @@ -516,9 +671,9 @@ #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_STATIC_ASSERT 1 #else -# define GLM_HAS_STATIC_ASSERT (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ +# define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010)))) #endif // N1988 @@ -540,9 +695,9 @@ # define GLM_HAS_CONSTEXPR 1 # define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR #else -# define GLM_HAS_CONSTEXPR (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46))) -# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR || ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015)) +# define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)))) +# define GLM_HAS_CONSTEXPR_PARTIAL (GLM_HAS_CONSTEXPR || ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015))) #endif // N2672 @@ -551,9 +706,9 @@ #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_INITIALIZER_LISTS 1 #else -# define GLM_HAS_INITIALIZER_LISTS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ +# define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) #endif // N2544 Unrestricted unions @@ -572,9 +727,10 @@ #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_DEFAULTED_FUNCTIONS 1 #else -# define GLM_HAS_DEFAULTED_FUNCTIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ +# define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12)))) #endif // N2118 @@ -583,9 +739,9 @@ #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_RVALUE_REFERENCES 1 #else -# define GLM_HAS_RVALUE_REFERENCES (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ +# define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)))) #endif // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf @@ -594,10 +750,10 @@ #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 #else -# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ +# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC45)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) #endif // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf @@ -606,10 +762,10 @@ #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_TEMPLATE_ALIASES 1 #else -# define GLM_HAS_TEMPLATE_ALIASES (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ +# define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12_1)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC47)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) #endif // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html @@ -618,42 +774,40 @@ #elif GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_RANGE_FOR 1 #else -# define GLM_HAS_RANGE_FOR (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ +# define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL13)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))) + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)))) #endif -// +// #if GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_ASSIGNABLE 1 #else -# define GLM_HAS_ASSIGNABLE (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))) +# define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))) #endif -// -#define GLM_HAS_TRIVIAL_QUERIES 0//( \ - //((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) +// +#define GLM_HAS_TRIVIAL_QUERIES 0 -// +// #if GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_MAKE_SIGNED 1 #else -# define GLM_HAS_MAKE_SIGNED (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) +# define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))) #endif -// #if GLM_ARCH == GLM_ARCH_PURE # define GLM_HAS_BITSCAN_WINDOWS 0 #else -# define GLM_HAS_BITSCAN_WINDOWS (GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ - (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_LLVM | GLM_COMPILER_INTEL)) +# define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ + (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)))) #endif // OpenMP -#ifdef _OPENMP +#ifdef _OPENMP # if GLM_COMPILER & GLM_COMPILER_GCC # if GLM_COMPILER >= GLM_COMPILER_GCC47 # define GLM_HAS_OPENMP 31 @@ -674,121 +828,6 @@ // Not standard #define GLM_HAS_ANONYMOUS_UNION (GLM_LANG & GLM_LANG_CXXMS_FLAG) -/////////////////////////////////////////////////////////////////////////////////// -// Platform - -// User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 - -#define GLM_ARCH_PURE 0x0000 -#define GLM_ARCH_ARM 0x0001 -#define GLM_ARCH_X86 0x0002 -#define GLM_ARCH_SSE2 0x0004 -#define GLM_ARCH_SSE3 0x0008 -#define GLM_ARCH_SSE4 0x0010 -#define GLM_ARCH_AVX 0x0020 -#define GLM_ARCH_AVX2 0x0040 - -#if defined(GLM_FORCE_PURE) -# define GLM_ARCH GLM_ARCH_PURE -#elif defined(GLM_FORCE_AVX2) -# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif defined(GLM_FORCE_AVX) -# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif defined(GLM_FORCE_SSE4) -# define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif defined(GLM_FORCE_SSE3) -# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -#elif defined(GLM_FORCE_SSE2) -# define GLM_ARCH (GLM_ARCH_SSE2) -#elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) -# if(__AVX2__) -# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__AVX__) -# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__SSE3__) -# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(__SSE2__) -# define GLM_ARCH (GLM_ARCH_SSE2) -# else -# define GLM_ARCH GLM_ARCH_PURE -# endif -#elif (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) -# if defined(_M_ARM_FP) -# define GLM_ARCH (GLM_ARCH_ARM) -# elif defined(__AVX2__) -# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__AVX__) -# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif _M_IX86_FP == 2 -# define GLM_ARCH (GLM_ARCH_SSE2) -# else -# define GLM_ARCH (GLM_ARCH_PURE) -# endif -#elif (GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__)) -# if defined(__AVX2__) -# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__AVX__) -# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__SSE4_1__ ) -# define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__SSE3__) -# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif defined(__SSE2__) -# define GLM_ARCH (GLM_ARCH_SSE2) -# else -# define GLM_ARCH (GLM_ARCH_PURE) -# endif -#else -# define GLM_ARCH GLM_ARCH_PURE -#endif - -// With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is -// that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems. -// To fix, we just explicitly include intrin.h here. -#if defined(__MINGW64__) && (GLM_ARCH != GLM_ARCH_PURE) -# include -#endif - -#if GLM_ARCH & GLM_ARCH_AVX2 -# include -#endif//GLM_ARCH -#if GLM_ARCH & GLM_ARCH_AVX -# include -#endif//GLM_ARCH -#if GLM_ARCH & GLM_ARCH_SSE4 -# include -#endif//GLM_ARCH -#if GLM_ARCH & GLM_ARCH_SSE3 -# include -#endif//GLM_ARCH -#if GLM_ARCH & GLM_ARCH_SSE2 -# include -# if(GLM_COMPILER == GLM_COMPILER_VC2005) // VC2005 is missing some intrinsics, workaround - inline float _mm_cvtss_f32(__m128 A) { return A.m128_f32[0]; } - inline __m128 _mm_castpd_ps(__m128d PD) { union { __m128 ps; __m128d pd; } c; c.pd = PD; return c.ps; } - inline __m128d _mm_castps_pd(__m128 PS) { union { __m128 ps; __m128d pd; } c; c.ps = PS; return c.pd; } - inline __m128i _mm_castps_si128(__m128 PS) { union { __m128 ps; __m128i pi; } c; c.ps = PS; return c.pi; } - inline __m128 _mm_castsi128_ps(__m128i PI) { union { __m128 ps; __m128i pi; } c; c.pi = PI; return c.ps; } -# endif -#endif//GLM_ARCH - -#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED) -# define GLM_MESSAGE_ARCH_DISPLAYED -# if(GLM_ARCH == GLM_ARCH_PURE) -# pragma message("GLM: Platform independent code") -# elif(GLM_ARCH & GLM_ARCH_ARM) -# pragma message("GLM: ARM instruction set") -# elif(GLM_ARCH & GLM_ARCH_AVX2) -# pragma message("GLM: AVX2 instruction set") -# elif(GLM_ARCH & GLM_ARCH_AVX) -# pragma message("GLM: AVX instruction set") -# elif(GLM_ARCH & GLM_ARCH_SSE3) -# pragma message("GLM: SSE3 instruction set") -# elif(GLM_ARCH & GLM_ARCH_SSE2) -# pragma message("GLM: SSE2 instruction set") -# endif//GLM_ARCH -#endif//GLM_MESSAGE - /////////////////////////////////////////////////////////////////////////////////// // Static assert @@ -879,10 +918,30 @@ # define GLM_RESTRICT_VAR #endif//GLM_COMPILER +#if GLM_HAS_DEFAULTED_FUNCTIONS +# define GLM_DEFAULT = default +# ifdef GLM_FORCE_NO_CTOR_INIT +# define GLM_DEFAULT_CTOR = default +# else +# define GLM_DEFAULT_CTOR +# endif +#else +# define GLM_DEFAULT +# define GLM_DEFAULT_CTOR +#endif + #if GLM_HAS_CONSTEXPR # define GLM_CONSTEXPR constexpr +# define GLM_RELAXED_CONSTEXPR constexpr #else # define GLM_CONSTEXPR +# define GLM_RELAXED_CONSTEXPR const +#endif + +#ifdef GLM_FORCE_EXPLICIT_CTOR +# define GLM_EXPLICIT explicit +#else +# define GLM_EXPLICIT #endif /////////////////////////////////////////////////////////////////////////////////// @@ -947,7 +1006,7 @@ namespace detail } }//namespace glm # define GLM_COUNTOF(arr) glm::countof(arr) -#elif _MSC_VER +#elif defined(_MSC_VER) # define GLM_COUNTOF(arr) _countof(arr) #else # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) diff --git a/external/glm/glm/detail/type_half.inl b/external/glm/glm/detail/type_half.inl index ff8740c82..b9f9f0ed9 100644 --- a/external/glm/glm/detail/type_half.inl +++ b/external/glm/glm/detail/type_half.inl @@ -52,12 +52,12 @@ namespace detail i(0) {} - GLM_FUNC_QUALIFIER uif32(float f) : - f(f) + GLM_FUNC_QUALIFIER uif32(float f_) : + f(f_) {} - GLM_FUNC_QUALIFIER uif32(uint32 i) : - i(i) + GLM_FUNC_QUALIFIER uif32(uint32 i_) : + i(i_) {} float f; diff --git a/external/glm/glm/detail/type_mat2x2.hpp b/external/glm/glm/detail/type_mat2x2.hpp index 046ceac3c..9761adfe1 100644 --- a/external/glm/glm/detail/type_mat2x2.hpp +++ b/external/glm/glm/detail/type_mat2x2.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -54,16 +54,21 @@ namespace glm template friend tvec2 operator/(tvec2 const & v, tmat2x2 const & m); +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 2; + static GLM_RELAXED_CONSTEXPR length_t cols = 2; + static GLM_RELAXED_CONSTEXPR length_t rows = 2; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + private: - /// @cond DETAIL col_type value[2]; - /// @endcond - + public: - ////////////////////////////////////// - // Constructors - GLM_FUNC_DECL tmat2x2(); - GLM_FUNC_DECL tmat2x2(tmat2x2 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat2x2() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat2x2(tmat2x2 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat2x2(tmat2x2 const & m); @@ -76,8 +81,8 @@ namespace glm col_type const & v1, col_type const & v2); - ////////////////////////////////////// - // Conversions + // -- Conversions -- + template GLM_FUNC_DECL tmat2x2( U const & x1, V const & y1, @@ -88,16 +93,10 @@ namespace glm tvec2 const & v1, tvec2 const & v2); - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat2x2(tmat2x2 const & m); -# else - template - GLM_FUNC_DECL tmat2x2(tmat2x2 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x2 const & m); GLM_FUNC_DECL explicit tmat2x2(tmat3x3 const & x); GLM_FUNC_DECL explicit tmat2x2(tmat4x4 const & x); @@ -108,8 +107,7 @@ namespace glm GLM_FUNC_DECL explicit tmat2x2(tmat3x4 const & x); GLM_FUNC_DECL explicit tmat2x2(tmat4x3 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -125,32 +123,30 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & v); + GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & v) GLM_DEFAULT; - template + template GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); - template + template GLM_FUNC_DECL tmat2x2 & operator+=(U s); - template + template GLM_FUNC_DECL tmat2x2 & operator+=(tmat2x2 const & m); - template + template GLM_FUNC_DECL tmat2x2 & operator-=(U s); - template + template GLM_FUNC_DECL tmat2x2 & operator-=(tmat2x2 const & m); - template + template GLM_FUNC_DECL tmat2x2 & operator*=(U s); - template + template GLM_FUNC_DECL tmat2x2 & operator*=(tmat2x2 const & m); - template + template GLM_FUNC_DECL tmat2x2 & operator/=(U s); - template + template GLM_FUNC_DECL tmat2x2 & operator/=(tmat2x2 const & m); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat2x2 & operator++ (); GLM_FUNC_DECL tmat2x2 & operator-- (); @@ -158,7 +154,16 @@ namespace glm GLM_FUNC_DECL tmat2x2 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat2x2 operator+(tmat2x2 const & m); + + template + GLM_FUNC_DECL tmat2x2 operator-(tmat2x2 const & m); + + // -- Binary operators -- + template GLM_FUNC_DECL tmat2x2 operator+(tmat2x2 const & m, T const & s); @@ -191,10 +196,10 @@ namespace glm template GLM_FUNC_DECL tmat2x2 operator*(tmat2x2 const & m1, tmat2x2 const & m2); - + template GLM_FUNC_DECL tmat3x2 operator*(tmat2x2 const & m1, tmat3x2 const & m2); - + template GLM_FUNC_DECL tmat4x2 operator*(tmat2x2 const & m1, tmat4x2 const & m2); @@ -213,9 +218,13 @@ namespace glm template GLM_FUNC_DECL tmat2x2 operator/(tmat2x2 const & m1, tmat2x2 const & m2); - // Unary constant operators - template - GLM_FUNC_DECL tmat2x2 const operator-(tmat2x2 const & m); + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat2x2 const & m1, tmat2x2 const & m2); + + template + GLM_FUNC_DECL bool operator!=(tmat2x2 const & m1, tmat2x2 const & m2); } //namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat2x2.inl b/external/glm/glm/detail/type_mat2x2.inl index 779cc091a..960fee573 100644 --- a/external/glm/glm/detail/type_mat2x2.inl +++ b/external/glm/glm/detail/type_mat2x2.inl @@ -50,24 +50,27 @@ namespace detail } }//namespace detail - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat2x2::tmat2x2() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); -# endif - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat2x2::tmat2x2() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(tmat2x2 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(tmat2x2 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -106,8 +109,8 @@ namespace detail this->value[1] = v1; } - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- + template template GLM_FUNC_QUALIFIER tmat2x2::tmat2x2 @@ -128,8 +131,7 @@ namespace detail this->value[1] = col_type(v2); } - ////////////////////////////////////////////////////////////// - // mat2x2 matrix conversions + // -- mat2x2 matrix conversions -- template template @@ -195,8 +197,7 @@ namespace detail this->value[1] = col_type(m[1]); } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -240,16 +241,17 @@ namespace detail } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Unary updatable operators + // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator=(tmat2x2 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator=(tmat2x2 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -328,6 +330,8 @@ namespace detail return (*this = *this * detail::compute_inverse(m)); } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator++() { @@ -360,8 +364,23 @@ namespace detail return Result; } - ////////////////////////////////////////////////////////////// - // Binary operators + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tmat2x2 operator+(tmat2x2 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat2x2 operator-(tmat2x2 const & m) + { + return tmat2x2( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tmat2x2 operator+(tmat2x2 const & m, T const & s) @@ -522,17 +541,7 @@ namespace detail return m1_copy /= m2; } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat2x2 const operator-(tmat2x2 const & m) - { - return tmat2x2( - -m[0], - -m[1]); - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat2x2 const & m1, tmat2x2 const & m2) diff --git a/external/glm/glm/detail/type_mat2x3.hpp b/external/glm/glm/detail/type_mat2x3.hpp index 9986e881b..eeb69ad2a 100644 --- a/external/glm/glm/detail/type_mat2x3.hpp +++ b/external/glm/glm/detail/type_mat2x3.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,15 +50,21 @@ namespace glm typedef tmat3x2 transpose_type; typedef T value_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 2; + static GLM_RELAXED_CONSTEXPR length_t cols = 2; + static GLM_RELAXED_CONSTEXPR length_t rows = 3; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + private: - /// @cond DETAIL col_type value[2]; - /// @endcond - + public: - // Constructors - GLM_FUNC_DECL tmat2x3(); - GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat2x3() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat2x3(tmat2x3 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); @@ -71,29 +77,22 @@ namespace glm col_type const & v0, col_type const & v1); - ////////////////////////////////////// - // Conversions + // -- Conversions -- template GLM_FUNC_DECL tmat2x3( X1 const & x1, Y1 const & y1, Z1 const & z1, X2 const & x2, Y2 const & y2, Z2 const & z2); - + template GLM_FUNC_DECL tmat2x3( tvec3 const & v1, tvec3 const & v2); - ////////////////////////////////////// - // Matrix conversion + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat2x3(tmat2x3 const & m); -# else - template - GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x3 const & m); GLM_FUNC_DECL explicit tmat2x3(tmat2x2 const & x); GLM_FUNC_DECL explicit tmat2x3(tmat3x3 const & x); @@ -104,8 +103,7 @@ namespace glm GLM_FUNC_DECL explicit tmat2x3(tmat4x2 const & x); GLM_FUNC_DECL explicit tmat2x3(tmat4x3 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -121,28 +119,26 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat2x3 & operator=(tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 & operator=(tmat2x3 const & m) GLM_DEFAULT; - template + template GLM_FUNC_DECL tmat2x3 & operator=(tmat2x3 const & m); - template + template GLM_FUNC_DECL tmat2x3 & operator+=(U s); - template + template GLM_FUNC_DECL tmat2x3 & operator+=(tmat2x3 const & m); - template + template GLM_FUNC_DECL tmat2x3 & operator-=(U s); - template + template GLM_FUNC_DECL tmat2x3 & operator-=(tmat2x3 const & m); - template + template GLM_FUNC_DECL tmat2x3 & operator*=(U s); - template + template GLM_FUNC_DECL tmat2x3 & operator/=(U s); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat2x3 & operator++ (); GLM_FUNC_DECL tmat2x3 & operator-- (); @@ -150,7 +146,15 @@ namespace glm GLM_FUNC_DECL tmat2x3 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat2x3 operator+(tmat2x3 const & m); + + template + GLM_FUNC_DECL tmat2x3 operator-(tmat2x3 const & m); + + // -- Binary operators -- template GLM_FUNC_DECL tmat2x3 operator+(tmat2x3 const & m, T const & s); @@ -181,7 +185,7 @@ namespace glm template GLM_FUNC_DECL tmat3x3 operator*(tmat2x3 const & m1, tmat3x2 const & m2); - + template GLM_FUNC_DECL tmat4x3 operator*(tmat2x3 const & m1, tmat4x2 const & m2); @@ -191,9 +195,13 @@ namespace glm template GLM_FUNC_DECL tmat2x3 operator/(T const & s, tmat2x3 const & m); - // Unary constant operators + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat2x3 const & m1, tmat2x3 const & m2); + template - GLM_FUNC_DECL tmat2x3 const operator-(tmat2x3 const & m); + GLM_FUNC_DECL bool operator!=(tmat2x3 const & m1, tmat2x3 const & m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat2x3.inl b/external/glm/glm/detail/type_mat2x3.inl index 32c30fdd9..76c00f503 100644 --- a/external/glm/glm/detail/type_mat2x3.inl +++ b/external/glm/glm/detail/type_mat2x3.inl @@ -32,24 +32,27 @@ namespace glm { - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); -# endif - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(tmat2x3 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(tmat2x3 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -88,8 +91,8 @@ namespace glm this->value[1] = v1; } - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- + template template < typename X1, typename Y1, typename Z1, @@ -112,8 +115,7 @@ namespace glm this->value[1] = col_type(v2); } - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- template template @@ -179,8 +181,7 @@ namespace glm this->value[1] = m[1]; } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -224,16 +225,17 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Unary updatable operators + // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator=(tmat2x3 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator=(tmat2x3 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -298,6 +300,8 @@ namespace glm return *this; } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat2x3 & tmat2x3::operator++() { @@ -330,8 +334,23 @@ namespace glm return Result; } - ////////////////////////////////////////////////////////////// - // Binary operators + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tmat2x3 operator+(tmat2x3 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat2x3 operator-(tmat2x3 const & m) + { + return tmat2x3( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tmat2x3 operator+(tmat2x3 const & m, T const & s) @@ -480,17 +499,7 @@ namespace glm s / m[1]); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat2x3 const operator-(tmat2x3 const & m) - { - return tmat2x3( - -m[0], - -m[1]); - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat2x3 const & m1, tmat2x3 const & m2) diff --git a/external/glm/glm/detail/type_mat2x4.hpp b/external/glm/glm/detail/type_mat2x4.hpp index 9239e9c9b..8e3c616a3 100644 --- a/external/glm/glm/detail/type_mat2x4.hpp +++ b/external/glm/glm/detail/type_mat2x4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,15 +50,21 @@ namespace glm typedef tmat4x2 transpose_type; typedef T value_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 2; + static GLM_RELAXED_CONSTEXPR length_t cols = 2; + static GLM_RELAXED_CONSTEXPR length_t rows = 4; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + private: - /// @cond DETAIL col_type value[2]; - /// @endcond - + public: - // Constructors - GLM_FUNC_DECL tmat2x4(); - GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat2x4() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat2x4(tmat2x4 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); @@ -68,11 +74,11 @@ namespace glm T const & x0, T const & y0, T const & z0, T const & w0, T const & x1, T const & y1, T const & z1, T const & w1); GLM_FUNC_DECL tmat2x4( - col_type const & v0, + col_type const & v0, col_type const & v1); - ////////////////////////////////////// - // Conversions + // -- Conversions -- + template < typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2> @@ -85,16 +91,10 @@ namespace glm tvec4 const & v1, tvec4 const & v2); - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat2x4(tmat2x4 const & m); -# else - template - GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x4 const & m); GLM_FUNC_DECL explicit tmat2x4(tmat2x2 const & x); GLM_FUNC_DECL explicit tmat2x4(tmat3x3 const & x); @@ -105,8 +105,7 @@ namespace glm GLM_FUNC_DECL explicit tmat2x4(tmat4x2 const & x); GLM_FUNC_DECL explicit tmat2x4(tmat4x3 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -122,28 +121,26 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat2x4 & operator=(tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 & operator=(tmat2x4 const & m) GLM_DEFAULT; - template + template GLM_FUNC_DECL tmat2x4 & operator=(tmat2x4 const & m); - template + template GLM_FUNC_DECL tmat2x4 & operator+=(U s); - template + template GLM_FUNC_DECL tmat2x4 & operator+=(tmat2x4 const & m); - template + template GLM_FUNC_DECL tmat2x4 & operator-=(U s); - template + template GLM_FUNC_DECL tmat2x4 & operator-=(tmat2x4 const & m); - template + template GLM_FUNC_DECL tmat2x4 & operator*=(U s); - template + template GLM_FUNC_DECL tmat2x4 & operator/=(U s); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat2x4 & operator++ (); GLM_FUNC_DECL tmat2x4 & operator-- (); @@ -151,7 +148,15 @@ namespace glm GLM_FUNC_DECL tmat2x4 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat2x4 operator+(tmat2x4 const & m); + + template + GLM_FUNC_DECL tmat2x4 operator-(tmat2x4 const & m); + + // -- Binary operators -- template GLM_FUNC_DECL tmat2x4 operator+(tmat2x4 const & m, T const & s); @@ -179,7 +184,7 @@ namespace glm template GLM_FUNC_DECL tmat4x4 operator*(tmat2x4 const & m1, tmat4x2 const & m2); - + template GLM_FUNC_DECL tmat2x4 operator*(tmat2x4 const & m1, tmat2x2 const & m2); @@ -189,12 +194,16 @@ namespace glm template GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T s); - template + template GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); - // Unary constant operators + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat2x4 const & m1, tmat2x4 const & m2); + template - GLM_FUNC_DECL tmat2x4 const operator-(tmat2x4 const & m); + GLM_FUNC_DECL bool operator!=(tmat2x4 const & m1, tmat2x4 const & m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat2x4.inl b/external/glm/glm/detail/type_mat2x4.inl index fcf5d315a..422997873 100644 --- a/external/glm/glm/detail/type_mat2x4.inl +++ b/external/glm/glm/detail/type_mat2x4.inl @@ -32,24 +32,27 @@ namespace glm { - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat2x4::tmat2x4() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); -# endif - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat2x4::tmat2x4() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(tmat2x4 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(tmat2x4 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -89,8 +92,8 @@ namespace glm this->value[1] = v1; } - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- + template template < typename X1, typename Y1, typename Z1, typename W1, @@ -113,8 +116,7 @@ namespace glm this->value[1] = col_type(v2); } - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- template template @@ -180,8 +182,7 @@ namespace glm this->value[1] = col_type(m[1], 0); } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -225,16 +226,17 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Unary updatable operators + // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator=(tmat2x4 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator=(tmat2x4 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -299,6 +301,8 @@ namespace glm return *this; } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator++() { @@ -331,8 +335,23 @@ namespace glm return Result; } - ////////////////////////////////////////////////////////////// - // Binary operators + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tmat2x4 operator+(tmat2x4 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat2x4 operator-(tmat2x4 const & m) + { + return tmat2x4( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tmat2x4 operator+(tmat2x4 const & m, T const & s) @@ -489,17 +508,7 @@ namespace glm s / m[1]); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat2x4 const operator-(tmat2x4 const & m) - { - return tmat2x4( - -m[0], - -m[1]); - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat2x4 const & m1, tmat2x4 const & m2) diff --git a/external/glm/glm/detail/type_mat3x2.hpp b/external/glm/glm/detail/type_mat3x2.hpp index 9fd573f21..fedf8c9e7 100644 --- a/external/glm/glm/detail/type_mat3x2.hpp +++ b/external/glm/glm/detail/type_mat3x2.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,15 +50,21 @@ namespace glm typedef tmat2x3 transpose_type; typedef T value_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 3; + static GLM_RELAXED_CONSTEXPR length_t cols = 3; + static GLM_RELAXED_CONSTEXPR length_t rows = 2; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + private: - /// @cond DETAIL col_type value[3]; - /// @endcond - + public: - // Constructors - GLM_FUNC_DECL tmat3x2(); - GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat3x2() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat3x2(tmat3x2 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); @@ -73,8 +79,7 @@ namespace glm col_type const & v1, col_type const & v2); - ////////////////////////////////////// - // Conversions + // -- Conversions -- template< typename X1, typename Y1, @@ -84,23 +89,17 @@ namespace glm X1 const & x1, Y1 const & y1, X2 const & x2, Y2 const & y2, X3 const & x3, Y3 const & y3); - + template GLM_FUNC_DECL tmat3x2( tvec2 const & v1, tvec2 const & v2, tvec2 const & v3); - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat3x2(tmat3x2 const & m); -# else - template - GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x2 const & m); GLM_FUNC_DECL explicit tmat3x2(tmat2x2 const & x); GLM_FUNC_DECL explicit tmat3x2(tmat3x3 const & x); @@ -111,8 +110,7 @@ namespace glm GLM_FUNC_DECL explicit tmat3x2(tmat4x2 const & x); GLM_FUNC_DECL explicit tmat3x2(tmat4x3 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -128,28 +126,26 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat3x2 & operator=(tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 & operator=(tmat3x2 const & m) GLM_DEFAULT; - template + template GLM_FUNC_DECL tmat3x2 & operator=(tmat3x2 const & m); - template + template GLM_FUNC_DECL tmat3x2 & operator+=(U s); - template + template GLM_FUNC_DECL tmat3x2 & operator+=(tmat3x2 const & m); - template + template GLM_FUNC_DECL tmat3x2 & operator-=(U s); - template + template GLM_FUNC_DECL tmat3x2 & operator-=(tmat3x2 const & m); - template + template GLM_FUNC_DECL tmat3x2 & operator*=(U s); - template + template GLM_FUNC_DECL tmat3x2 & operator/=(U s); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat3x2 & operator++ (); GLM_FUNC_DECL tmat3x2 & operator-- (); @@ -157,7 +153,16 @@ namespace glm GLM_FUNC_DECL tmat3x2 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat3x2 operator+(tmat3x2 const & m); + + template + GLM_FUNC_DECL tmat3x2 operator-(tmat3x2 const & m); + + // -- Binary operators -- + template GLM_FUNC_DECL tmat3x2 operator+(tmat3x2 const & m, T const & s); @@ -184,10 +189,10 @@ namespace glm template GLM_FUNC_DECL tmat2x2 operator*(tmat3x2 const & m1, tmat2x3 const & m2); - + template GLM_FUNC_DECL tmat3x2 operator*(tmat3x2 const & m1, tmat3x3 const & m2); - + template GLM_FUNC_DECL tmat4x2 operator*(tmat3x2 const & m1, tmat4x3 const & m2); @@ -197,9 +202,13 @@ namespace glm template GLM_FUNC_DECL tmat3x2 operator/(T const & s, tmat3x2 const & m); - // Unary constant operators + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat3x2 const & m1, tmat3x2 const & m2); + template - GLM_FUNC_DECL tmat3x2 const operator-(tmat3x2 const & m); + GLM_FUNC_DECL bool operator!=(tmat3x2 const & m1, tmat3x2 const & m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat3x2.inl b/external/glm/glm/detail/type_mat3x2.inl index d42a9aec5..f497e395c 100644 --- a/external/glm/glm/detail/type_mat3x2.inl +++ b/external/glm/glm/detail/type_mat3x2.inl @@ -32,26 +32,29 @@ namespace glm { - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); -# endif - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(tmat3x2 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(tmat3x2 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -100,8 +103,8 @@ namespace glm this->value[2] = v2; } - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- + template template < typename X1, typename Y1, @@ -133,8 +136,7 @@ namespace glm this->value[2] = col_type(v3); } - ////////////////////////////////////////////////////////////// - // mat3x2 matrix conversions + // -- Matrix conversions -- template template @@ -209,8 +211,7 @@ namespace glm this->value[2] = col_type(m[2]); } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -254,17 +255,18 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Unary updatable operators + // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator=(tmat3x2 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator=(tmat3x2 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -336,6 +338,8 @@ namespace glm return *this; } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator++() { @@ -370,8 +374,24 @@ namespace glm return Result; } - ////////////////////////////////////////////////////////////// - // Binary operators + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tmat3x2 operator+(tmat3x2 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat3x2 operator-(tmat3x2 const & m) + { + return tmat3x2( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tmat3x2 operator+(tmat3x2 const & m, T const & s) @@ -513,18 +533,7 @@ namespace glm s / m[2]); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat3x2 const operator-(tmat3x2 const & m) - { - return tmat3x2( - -m[0], - -m[1], - -m[2]); - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat3x2 const & m1, tmat3x2 const & m2) diff --git a/external/glm/glm/detail/type_mat3x3.hpp b/external/glm/glm/detail/type_mat3x3.hpp index dddfc535d..e7e2e6dee 100644 --- a/external/glm/glm/detail/type_mat3x3.hpp +++ b/external/glm/glm/detail/type_mat3x3.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -49,20 +49,26 @@ namespace glm typedef tmat3x3 transpose_type; typedef T value_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 3; + static GLM_RELAXED_CONSTEXPR length_t cols = 3; + static GLM_RELAXED_CONSTEXPR length_t rows = 3; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + template friend tvec3 operator/(tmat3x3 const & m, tvec3 const & v); template friend tvec3 operator/(tvec3 const & v, tmat3x3 const & m); private: - /// @cond DETAIL col_type value[3]; - /// @endcond public: - // Constructors - GLM_FUNC_DECL tmat3x3(); - GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat3x3() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat3x3(tmat3x3 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); @@ -77,8 +83,7 @@ namespace glm col_type const & v1, col_type const & v2); - ////////////////////////////////////// - // Conversions + // -- Conversions -- template< typename X1, typename Y1, typename Z1, @@ -88,23 +93,17 @@ namespace glm 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); - + template GLM_FUNC_DECL tmat3x3( tvec3 const & v1, tvec3 const & v2, tvec3 const & v3); - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat3x3(tmat3x3 const & m); -# else - template - GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x3 const & m); GLM_FUNC_DECL explicit tmat3x3(tmat2x2 const & x); GLM_FUNC_DECL explicit tmat3x3(tmat4x4 const & x); @@ -115,8 +114,7 @@ namespace glm GLM_FUNC_DECL explicit tmat3x3(tmat3x4 const & x); GLM_FUNC_DECL explicit tmat3x3(tmat4x3 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -132,10 +130,9 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat3x3 & operator=(tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 & operator=(tmat3x3 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat3x3 & operator=(tmat3x3 const & m); @@ -156,8 +153,7 @@ namespace glm template GLM_FUNC_DECL tmat3x3 & operator/=(tmat3x3 const & m); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat3x3 & operator++(); GLM_FUNC_DECL tmat3x3 & operator--(); @@ -165,7 +161,16 @@ namespace glm GLM_FUNC_DECL tmat3x3 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat3x3 operator+(tmat3x3 const & m); + + template + GLM_FUNC_DECL tmat3x3 operator-(tmat3x3 const & m); + + // -- Binary operators -- + template GLM_FUNC_DECL tmat3x3 operator+(tmat3x3 const & m, T const & s); @@ -198,10 +203,10 @@ namespace glm template GLM_FUNC_DECL tmat3x3 operator*(tmat3x3 const & m1, tmat3x3 const & m2); - + template GLM_FUNC_DECL tmat2x3 operator*(tmat3x3 const & m1, tmat2x3 const & m2); - + template GLM_FUNC_DECL tmat4x3 operator*(tmat3x3 const & m1, tmat4x3 const & m2); @@ -220,9 +225,13 @@ namespace glm template GLM_FUNC_DECL tmat3x3 operator/(tmat3x3 const & m1, tmat3x3 const & m2); - // Unary constant operators + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat3x3 const & m1, tmat3x3 const & m2); + template - GLM_FUNC_DECL tmat3x3 const operator-(tmat3x3 const & m); + GLM_FUNC_DECL bool operator!=(tmat3x3 const & m1, tmat3x3 const & m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat3x3.inl b/external/glm/glm/detail/type_mat3x3.inl index ad933d36d..9ee0111e9 100644 --- a/external/glm/glm/detail/type_mat3x3.inl +++ b/external/glm/glm/detail/type_mat3x3.inl @@ -56,30 +56,29 @@ namespace detail } }//namespace detail - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat3x3::tmat3x3() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); - this->value[2] = col_type(0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(ctor) - {} +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat3x3::tmat3x3() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(tmat3x3 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(tmat3x3 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -90,6 +89,10 @@ namespace detail this->value[2] = m.value[2]; } + template + GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(ctor) + {} + template GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(T const & s) { @@ -124,8 +127,8 @@ namespace detail this->value[2] = v2; } - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- + template template < typename X1, typename Y1, typename Z1, @@ -157,8 +160,7 @@ namespace detail this->value[2] = col_type(v3); } - ////////////////////////////////////////////////////////////// - // Conversions + // -- Matrix conversions -- template template @@ -233,8 +235,7 @@ namespace detail this->value[2] = m[2]; } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -278,17 +279,18 @@ namespace detail } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Operators + // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER tmat3x3 & tmat3x3::operator=(tmat3x3 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat3x3 & tmat3x3::operator=(tmat3x3 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -374,6 +376,8 @@ namespace detail return (*this = *this * detail::compute_inverse(m)); } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat3x3 & tmat3x3::operator++() { @@ -408,8 +412,24 @@ namespace detail return Result; } - ////////////////////////////////////////////////////////////// - // Binary operators + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tmat3x3 operator+(tmat3x3 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat3x3 operator-(tmat3x3 const & m) + { + return tmat3x3( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tmat3x3 operator+(tmat3x3 const & m, T const & s) @@ -604,18 +624,7 @@ namespace detail return m1_copy /= m2; } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat3x3 const operator-(tmat3x3 const & m) - { - return tmat3x3( - -m[0], - -m[1], - -m[2]); - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat3x3 const & m1, tmat3x3 const & m2) diff --git a/external/glm/glm/detail/type_mat3x4.hpp b/external/glm/glm/detail/type_mat3x4.hpp index 7814e3fdb..11261589d 100644 --- a/external/glm/glm/detail/type_mat3x4.hpp +++ b/external/glm/glm/detail/type_mat3x4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,15 +50,21 @@ namespace glm typedef tmat4x3 transpose_type; typedef T value_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 3; + static GLM_RELAXED_CONSTEXPR length_t cols = 3; + static GLM_RELAXED_CONSTEXPR length_t rows = 4; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + private: - /// @cond DETAIL col_type value[3]; - /// @endcond public: - // Constructors - GLM_FUNC_DECL tmat3x4(); - GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat3x4() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat3x4(tmat3x4 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); @@ -73,8 +79,8 @@ namespace glm col_type const & v1, col_type const & v2); - ////////////////////////////////////// - // Conversions + // -- Conversions -- + template< typename X1, typename Y1, typename Z1, typename W1, typename X2, typename Y2, typename Z2, typename W2, @@ -83,23 +89,17 @@ namespace glm 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); - + template GLM_FUNC_DECL tmat3x4( tvec4 const & v1, tvec4 const & v2, tvec4 const & v3); - ////////////////////////////////////// - // Matrix conversion + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat3x4(tmat3x4 const & m); -# else - template - GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x4 const & m); GLM_FUNC_DECL explicit tmat3x4(tmat2x2 const & x); GLM_FUNC_DECL explicit tmat3x4(tmat3x3 const & x); @@ -110,8 +110,7 @@ namespace glm GLM_FUNC_DECL explicit tmat3x4(tmat4x2 const & x); GLM_FUNC_DECL explicit tmat3x4(tmat4x3 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -127,28 +126,26 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m); + GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m) GLM_DEFAULT; - template + template GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m); - template + template GLM_FUNC_DECL tmat3x4 & operator+=(U s); - template + template GLM_FUNC_DECL tmat3x4 & operator+=(tmat3x4 const & m); - template + template GLM_FUNC_DECL tmat3x4 & operator-=(U s); - template + template GLM_FUNC_DECL tmat3x4 & operator-=(tmat3x4 const & m); - template + template GLM_FUNC_DECL tmat3x4 & operator*=(U s); - template + template GLM_FUNC_DECL tmat3x4 & operator/=(U s); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat3x4 & operator++(); GLM_FUNC_DECL tmat3x4 & operator--(); @@ -156,7 +153,16 @@ namespace glm GLM_FUNC_DECL tmat3x4 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat3x4 operator+(tmat3x4 const & m); + + template + GLM_FUNC_DECL tmat3x4 operator-(tmat3x4 const & m); + + // -- Binary operators -- + template GLM_FUNC_DECL tmat3x4 operator+(tmat3x4 const & m, T const & s); @@ -178,15 +184,15 @@ namespace glm template GLM_FUNC_DECL typename tmat3x4::col_type operator*(tmat3x4 const & m, typename tmat3x4::row_type const & v); - template + template GLM_FUNC_DECL typename tmat3x4::row_type operator*(typename tmat3x4::col_type const & v, tmat3x4 const & m); template GLM_FUNC_DECL tmat4x4 operator*(tmat3x4 const & m1, tmat4x3 const & m2); - + template GLM_FUNC_DECL tmat2x4 operator*(tmat3x4 const & m1, tmat2x3 const & m2); - + template GLM_FUNC_DECL tmat3x4 operator*(tmat3x4 const & m1, tmat3x3 const & m2); @@ -196,9 +202,13 @@ namespace glm template GLM_FUNC_DECL tmat3x4 operator/(T const & s, tmat3x4 const & m); - // Unary constant operators + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat3x4 const & m1, tmat3x4 const & m2); + template - GLM_FUNC_DECL tmat3x4 const operator-(tmat3x4 const & m); + GLM_FUNC_DECL bool operator!=(tmat3x4 const & m1, tmat3x4 const & m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat3x4.inl b/external/glm/glm/detail/type_mat3x4.inl index 03e0c2cf8..3991d95d6 100644 --- a/external/glm/glm/detail/type_mat3x4.inl +++ b/external/glm/glm/detail/type_mat3x4.inl @@ -32,26 +32,29 @@ namespace glm { - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(tmat3x4 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(tmat3x4 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -69,10 +72,9 @@ namespace glm template GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(T const & s) { - value_type const Zero(0); - this->value[0] = col_type(s, Zero, Zero, Zero); - this->value[1] = col_type(Zero, s, Zero, Zero); - this->value[2] = col_type(Zero, Zero, s, Zero); + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); + this->value[2] = col_type(0, 0, s, 0); } template @@ -101,8 +103,8 @@ namespace glm this->value[2] = v2; } - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- + template template < typename X1, typename Y1, typename Z1, typename W1, @@ -134,7 +136,8 @@ namespace glm this->value[2] = col_type(v3); } - // Conversion + // -- Matrix conversions -- + template template GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(tmat3x4 const & m) @@ -181,7 +184,7 @@ namespace glm { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 0, 1); + this->value[2] = col_type(m[2], 1, 0); } template @@ -208,8 +211,7 @@ namespace glm this->value[2] = col_type(m[2], 0); } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -253,17 +255,18 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Unary updatable operators + // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator=(tmat3x4 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator=(tmat3x4 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -335,6 +338,8 @@ namespace glm return *this; } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator++() { @@ -369,8 +374,24 @@ namespace glm return Result; } - ////////////////////////////////////////////////////////////// - // Binary operators + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tmat3x4 operator+(tmat3x4 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat3x4 operator-(tmat3x4 const & m) + { + return tmat3x4( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tmat3x4 operator+(tmat3x4 const & m, T const & s) @@ -552,18 +573,7 @@ namespace glm s / m[2]); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat3x4 const operator-(tmat3x4 const & m) - { - return tmat3x4( - -m[0], - -m[1], - -m[2]); - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat3x4 const & m1, tmat3x4 const & m2) diff --git a/external/glm/glm/detail/type_mat4x2.hpp b/external/glm/glm/detail/type_mat4x2.hpp index d529ecbdb..62cd7aeda 100644 --- a/external/glm/glm/detail/type_mat4x2.hpp +++ b/external/glm/glm/detail/type_mat4x2.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,15 +50,21 @@ namespace glm typedef tmat2x4 transpose_type; typedef T value_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 4; + static GLM_RELAXED_CONSTEXPR length_t cols = 4; + static GLM_RELAXED_CONSTEXPR length_t rows = 2; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + private: - /// @cond DETAIL col_type value[4]; - /// @endcond public: - // Constructors - GLM_FUNC_DECL tmat4x2(); - GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat4x2() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat4x2(tmat4x2 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); @@ -70,13 +76,12 @@ namespace glm T const & x2, T const & y2, T const & x3, T const & y3); GLM_FUNC_DECL tmat4x2( - col_type const & v0, + col_type const & v0, col_type const & v1, col_type const & v2, col_type const & v3); - ////////////////////////////////////// - // Conversions + // -- Conversions -- template < typename X1, typename Y1, @@ -96,16 +101,10 @@ namespace glm tvec2 const & v3, tvec2 const & v4); - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat4x2(tmat4x2 const & m); -# else - template - GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x2 const & m); GLM_FUNC_DECL explicit tmat4x2(tmat2x2 const & x); GLM_FUNC_DECL explicit tmat4x2(tmat3x3 const & x); @@ -116,8 +115,7 @@ namespace glm GLM_FUNC_DECL explicit tmat4x2(tmat4x3 const & x); GLM_FUNC_DECL explicit tmat4x2(tmat3x4 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -133,28 +131,26 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat4x2 & operator=(tmat4x2 const & m); + GLM_FUNC_DECL tmat4x2 & operator=(tmat4x2 const & m) GLM_DEFAULT; - template + template GLM_FUNC_DECL tmat4x2 & operator=(tmat4x2 const & m); - template + template GLM_FUNC_DECL tmat4x2 & operator+=(U s); - template + template GLM_FUNC_DECL tmat4x2 & operator+=(tmat4x2 const & m); - template + template GLM_FUNC_DECL tmat4x2 & operator-=(U s); - template + template GLM_FUNC_DECL tmat4x2 & operator-=(tmat4x2 const & m); - template + template GLM_FUNC_DECL tmat4x2 & operator*=(U s); - template + template GLM_FUNC_DECL tmat4x2 & operator/=(U s); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat4x2 & operator++ (); GLM_FUNC_DECL tmat4x2 & operator-- (); @@ -162,7 +158,16 @@ namespace glm GLM_FUNC_DECL tmat4x2 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat4x2 operator+(tmat4x2 const & m); + + template + GLM_FUNC_DECL tmat4x2 operator-(tmat4x2 const & m); + + // -- Binary operators -- + template GLM_FUNC_DECL tmat4x2 operator+(tmat4x2 const & m, T const & s); @@ -189,10 +194,10 @@ namespace glm template GLM_FUNC_DECL tmat3x2 operator*(tmat4x2 const & m1, tmat3x4 const & m2); - + template GLM_FUNC_DECL tmat4x2 operator*(tmat4x2 const & m1, tmat4x4 const & m2); - + template GLM_FUNC_DECL tmat2x3 operator*(tmat4x3 const & m1, tmat2x4 const & m2); @@ -202,9 +207,13 @@ namespace glm template GLM_FUNC_DECL tmat4x2 operator/(T const & s, tmat4x2 const & m); - // Unary constant operators + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat4x2 const & m1, tmat4x2 const & m2); + template - GLM_FUNC_DECL tmat4x2 const operator-(tmat4x2 const & m); + GLM_FUNC_DECL bool operator!=(tmat4x2 const & m1, tmat4x2 const & m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat4x2.inl b/external/glm/glm/detail/type_mat4x2.inl index dac9ff066..811f46227 100644 --- a/external/glm/glm/detail/type_mat4x2.inl +++ b/external/glm/glm/detail/type_mat4x2.inl @@ -32,28 +32,31 @@ namespace glm { - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); - this->value[3] = col_type(0, 0); -# endif - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(tmat4x2 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(tmat4x2 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + this->value[3] = m.value[3]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -72,11 +75,10 @@ namespace glm template GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(T const & s) { - value_type const Zero(0); - this->value[0] = col_type(s, Zero); - this->value[1] = col_type(Zero, s); - this->value[2] = col_type(Zero, Zero); - this->value[3] = col_type(Zero, Zero); + this->value[0] = col_type(s, 0); + this->value[1] = col_type(0, s); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); } template @@ -109,8 +111,7 @@ namespace glm this->value[3] = v3; } - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- template template < @@ -148,8 +149,8 @@ namespace glm this->value[3] = col_type(v4); } - ////////////////////////////////////// - // Conversion + // -- Conversion -- + template template GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(tmat4x2 const & m) @@ -232,8 +233,7 @@ namespace glm this->value[3] = col_type(0); } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -277,18 +277,19 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Unary updatable operators + // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER tmat4x2& tmat4x2::operator=(tmat4x2 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat4x2& tmat4x2::operator=(tmat4x2 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -367,6 +368,8 @@ namespace glm return *this; } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat4x2 & tmat4x2::operator++() { @@ -403,8 +406,25 @@ namespace glm return Result; } - ////////////////////////////////////////////////////////////// - // Binary operators + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tmat4x2 operator+(tmat4x2 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat4x2 operator-(tmat4x2 const & m) + { + return tmat4x2( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tmat4x2 operator+(tmat4x2 const & m, T const & s) @@ -559,19 +579,7 @@ namespace glm s / m[3]); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat4x2 const operator-(tmat4x2 const & m) - { - return tmat4x2( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat4x2 const & m1, tmat4x2 const & m2) diff --git a/external/glm/glm/detail/type_mat4x3.hpp b/external/glm/glm/detail/type_mat4x3.hpp index 8bde1ac0a..eea246679 100644 --- a/external/glm/glm/detail/type_mat4x3.hpp +++ b/external/glm/glm/detail/type_mat4x3.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -50,14 +50,21 @@ namespace glm typedef tmat3x4 transpose_type; typedef T value_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 4; + static GLM_RELAXED_CONSTEXPR length_t cols = 4; + static GLM_RELAXED_CONSTEXPR length_t rows = 3; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + private: - // Data col_type value[4]; public: - // Constructors - GLM_FUNC_DECL tmat4x3(); - GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat4x3() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat4x3(tmat4x3 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); @@ -74,8 +81,7 @@ namespace glm col_type const & v2, col_type const & v3); - ////////////////////////////////////// - // Conversions + // -- Conversions -- template < typename X1, typename Y1, typename Z1, @@ -87,7 +93,7 @@ namespace glm 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 tmat4x3( tvec3 const & v1, @@ -95,16 +101,10 @@ namespace glm tvec3 const & v3, tvec3 const & v4); - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat4x3(tmat4x3 const & m); -# else - template - GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x3 const & m); GLM_FUNC_DECL explicit tmat4x3(tmat2x2 const & x); GLM_FUNC_DECL explicit tmat4x3(tmat3x3 const & x); @@ -115,8 +115,7 @@ namespace glm GLM_FUNC_DECL explicit tmat4x3(tmat4x2 const & x); GLM_FUNC_DECL explicit tmat4x3(tmat3x4 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -132,10 +131,9 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat4x3 & operator=(tmat4x3 const & m); + GLM_FUNC_DECL tmat4x3 & operator=(tmat4x3 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat4x3 & operator=(tmat4x3 const & m); @@ -152,8 +150,7 @@ namespace glm template GLM_FUNC_DECL tmat4x3 & operator/=(U s); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat4x3 & operator++(); GLM_FUNC_DECL tmat4x3 & operator--(); @@ -161,7 +158,16 @@ namespace glm GLM_FUNC_DECL tmat4x3 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat4x3 operator+(tmat4x3 const & m); + + template + GLM_FUNC_DECL tmat4x3 operator-(tmat4x3 const & m); + + // -- Binary operators -- + template GLM_FUNC_DECL tmat4x3 operator+(tmat4x3 const & m, T const & s); @@ -191,7 +197,7 @@ namespace glm template GLM_FUNC_DECL tmat3x3 operator*(tmat4x3 const & m1, tmat3x4 const & m2); - + template GLM_FUNC_DECL tmat4x3 operator*(tmat4x3 const & m1, tmat4x4 const & m2); @@ -201,9 +207,13 @@ namespace glm template GLM_FUNC_DECL tmat4x3 operator/(T const & s, tmat4x3 const & m); - // Unary constant operators + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat4x3 const & m1, tmat4x3 const & m2); + template - GLM_FUNC_DECL tmat4x3 const operator-(tmat4x3 const & m); + GLM_FUNC_DECL bool operator!=(tmat4x3 const & m1, tmat4x3 const & m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat4x3.inl b/external/glm/glm/detail/type_mat4x3.inl index d5c62c8ac..c2979782f 100644 --- a/external/glm/glm/detail/type_mat4x3.inl +++ b/external/glm/glm/detail/type_mat4x3.inl @@ -32,28 +32,31 @@ namespace glm { - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0, 0, 0); -# endif - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0, 0, 0); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat4x3::tmat4x3(tmat4x3 const & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - this->value[2] = m.value[2]; - this->value[3] = m.value[3]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat4x3::tmat4x3(tmat4x3 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + this->value[2] = m.value[2]; + this->value[3] = m.value[3]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -108,8 +111,7 @@ namespace glm this->value[3] = v3; } - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- template template < @@ -147,8 +149,7 @@ namespace glm this->value[3] = col_type(v4); } - ////////////////////////////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- template template @@ -165,7 +166,7 @@ namespace glm { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); + this->value[2] = col_type(0, 0, 1); this->value[3] = col_type(0); } @@ -232,8 +233,7 @@ namespace glm this->value[3] = col_type(0); } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -277,18 +277,19 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Unary updatable operators + // -- Unary updatable operators -- - template - GLM_FUNC_QUALIFIER tmat4x3& tmat4x3::operator=(tmat4x3 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat4x3& tmat4x3::operator=(tmat4x3 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -367,6 +368,8 @@ namespace glm return *this; } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat4x3 & tmat4x3::operator++() { @@ -387,8 +390,41 @@ namespace glm return *this; } - ////////////////////////////////////////////////////////////// - // Binary operators + template + GLM_FUNC_QUALIFIER tmat4x3 tmat4x3::operator++(int) + { + tmat4x3 Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER tmat4x3 tmat4x3::operator--(int) + { + tmat4x3 Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tmat4x3 operator+(tmat4x3 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat4x3 operator-(tmat4x3 const & m) + { + return tmat4x3( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tmat4x3 operator+(tmat4x3 const & m, T const & s) @@ -567,55 +603,7 @@ namespace glm s / m[3]); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat4x3 const operator-(tmat4x3 const & m) - { - return tmat4x3( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - template - GLM_FUNC_QUALIFIER tmat4x3 const operator++(tmat4x3 const & m, int) - { - return tmat4x3( - m[0] + T(1), - m[1] + T(1), - m[2] + T(1), - m[3] + T(1)); - } - - template - GLM_FUNC_QUALIFIER tmat4x3 const operator--(tmat4x3 const & m, int) - { - return tmat4x3( - m[0] - T(1), - m[1] - T(1), - m[2] - T(1), - m[3] - T(1)); - } - - template - GLM_FUNC_QUALIFIER tmat4x3 tmat4x3::operator++(int) - { - tmat4x3 Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER tmat4x3 tmat4x3::operator--(int) - { - tmat4x3 Result(*this); - --*this; - return Result; - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat4x3 const & m1, tmat4x3 const & m2) diff --git a/external/glm/glm/detail/type_mat4x4.hpp b/external/glm/glm/detail/type_mat4x4.hpp index dcb7269b9..1690bf1da 100644 --- a/external/glm/glm/detail/type_mat4x4.hpp +++ b/external/glm/glm/detail/type_mat4x4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -49,20 +49,26 @@ namespace glm typedef tmat4x4 transpose_type; typedef T value_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 4; + static GLM_RELAXED_CONSTEXPR length_t cols = 4; + static GLM_RELAXED_CONSTEXPR length_t rows = 4; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + template friend tvec4 operator/(tmat4x4 const & m, tvec4 const & v); template friend tvec4 operator/(tvec4 const & v, tmat4x4 const & m); private: - /// @cond DETAIL col_type value[4]; - /// @endcond public: - // Constructors - GLM_FUNC_DECL tmat4x4(); - GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); + // -- Constructors -- + + GLM_FUNC_DECL tmat4x4() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tmat4x4(tmat4x4 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); @@ -79,8 +85,7 @@ namespace glm col_type const & v2, col_type const & v3); - ////////////////////////////////////// - // Conversions + // -- Conversions -- template < typename X1, typename Y1, typename Z1, typename W1, @@ -100,16 +105,10 @@ namespace glm tvec4 const & v3, tvec4 const & v4); - ////////////////////////////////////// - // Matrix conversions + // -- Matrix conversions -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tmat4x4(tmat4x4 const & m); -# else - template - GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x4 const & m); GLM_FUNC_DECL explicit tmat4x4(tmat2x2 const & x); GLM_FUNC_DECL explicit tmat4x4(tmat3x3 const & x); @@ -120,8 +119,7 @@ namespace glm GLM_FUNC_DECL explicit tmat4x4(tmat3x4 const & x); GLM_FUNC_DECL explicit tmat4x4(tmat4x3 const & x); - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -137,10 +135,9 @@ namespace glm GLM_FUNC_DECL col_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tmat4x4 & operator=(tmat4x4 const & m); + GLM_FUNC_DECL tmat4x4 & operator=(tmat4x4 const & m) GLM_DEFAULT; template GLM_FUNC_DECL tmat4x4 & operator=(tmat4x4 const & m); @@ -161,8 +158,7 @@ namespace glm template GLM_FUNC_DECL tmat4x4 & operator/=(tmat4x4 const & m); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tmat4x4 & operator++(); GLM_FUNC_DECL tmat4x4 & operator--(); @@ -170,20 +166,29 @@ namespace glm GLM_FUNC_DECL tmat4x4 operator--(int); }; - // Binary operators + // -- Unary operators -- + + template + GLM_FUNC_DECL tmat4x4 operator+(tmat4x4 const & m); + + template + GLM_FUNC_DECL tmat4x4 operator-(tmat4x4 const & m); + + // -- Binary operators -- + template GLM_FUNC_DECL tmat4x4 operator+(tmat4x4 const & m, T const & s); template GLM_FUNC_DECL tmat4x4 operator+(T const & s, tmat4x4 const & m); - template + template GLM_FUNC_DECL tmat4x4 operator+(tmat4x4 const & m1, tmat4x4 const & m2); - template + template GLM_FUNC_DECL tmat4x4 operator-(tmat4x4 const & m, T const & s); - template + template GLM_FUNC_DECL tmat4x4 operator-(T const & s, tmat4x4 const & m); template @@ -225,9 +230,13 @@ namespace glm template GLM_FUNC_DECL tmat4x4 operator/(tmat4x4 const & m1, tmat4x4 const & m2); - // Unary constant operators + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tmat4x4 const & m1, tmat4x4 const & m2); + template - GLM_FUNC_DECL tmat4x4 const operator-(tmat4x4 const & m); + GLM_FUNC_DECL bool operator!=(tmat4x4 const & m1, tmat4x4 const & m2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_mat4x4.inl b/external/glm/glm/detail/type_mat4x4.inl index 103be5b65..319325a70 100644 --- a/external/glm/glm/detail/type_mat4x4.inl +++ b/external/glm/glm/detail/type_mat4x4.inl @@ -92,28 +92,31 @@ namespace detail } }//namespace detail - ////////////////////////////////////////////////////////////// - // Constructors + // -- Constructors -- - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4() - { -# ifndef GLM_FORCE_NO_CTOR_INIT - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } +# endif - template - GLM_FUNC_QUALIFIER tmat4x4::tmat4x4(tmat4x4 const & m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat4x4::tmat4x4(tmat4x4 const & m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -181,8 +184,8 @@ namespace detail this->value[3] = col_type(m[3]); } - ////////////////////////////////////// - // Conversion constructors + // -- Conversions -- + template template < typename X1, typename Y1, typename Z1, typename W1, @@ -244,14 +247,14 @@ namespace detail this->value[3] = col_type(v4); } - ////////////////////////////////////// - // Matrix convertion constructors + // -- Matrix conversions -- + template GLM_FUNC_QUALIFIER tmat4x4::tmat4x4(tmat2x2 const & m) { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0); + this->value[2] = col_type(0, 0, 1, 0); this->value[3] = col_type(0, 0, 0, 1); } @@ -269,7 +272,7 @@ namespace detail { this->value[0] = col_type(m[0], 0); this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0); + this->value[2] = col_type(0, 0, 1, 0); this->value[3] = col_type(0, 0, 0, 1); } @@ -278,7 +281,7 @@ namespace detail { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 0, 0); + this->value[2] = col_type(m[2], 1, 0); this->value[3] = col_type(0, 0, 0, 1); } @@ -287,7 +290,7 @@ namespace detail { this->value[0] = m[0]; this->value[1] = m[1]; - this->value[2] = col_type(0); + this->value[2] = col_type(0, 0, 1, 0); this->value[3] = col_type(0, 0, 0, 1); } @@ -296,7 +299,7 @@ namespace detail { this->value[0] = col_type(m[0], 0, 0); this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0); + this->value[2] = col_type(0, 0, 1, 0); this->value[3] = col_type(0, 0, 0, 1); } @@ -318,8 +321,7 @@ namespace detail this->value[3] = col_type(m[3], 1); } - ////////////////////////////////////// - // Accesses + // -- Accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -363,20 +365,21 @@ namespace detail } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////////////////////////////// - // Operators + // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator=(tmat4x4 const & m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(valType)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator=(tmat4x4 const & m) + { + //memcpy could be faster + //memcpy(&this->value, &m.value, 16 * sizeof(valType)); + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -471,6 +474,8 @@ namespace detail return (*this = *this * detail::compute_inverse(m)); } + // -- Increment and decrement operators -- + template GLM_FUNC_QUALIFIER tmat4x4 & tmat4x4::operator++() { @@ -507,7 +512,26 @@ namespace detail return Result; } - // Binary operators + // -- Unary constant operators -- + + template + GLM_FUNC_QUALIFIER tmat4x4 operator+(tmat4x4 const & m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER tmat4x4 operator-(tmat4x4 const & m) + { + return tmat4x4( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- + template GLM_FUNC_QUALIFIER tmat4x4 operator+(tmat4x4 const & m, T const & s) { @@ -742,39 +766,7 @@ namespace detail return m1_copy /= m2; } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tmat4x4 const operator-(tmat4x4 const & m) - { - return tmat4x4( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - template - GLM_FUNC_QUALIFIER tmat4x4 const operator++(tmat4x4 const & m, int) - { - return tmat4x4( - m[0] + static_cast(1), - m[1] + static_cast(1), - m[2] + static_cast(1), - m[3] + static_cast(1)); - } - - template - GLM_FUNC_QUALIFIER tmat4x4 const operator--(tmat4x4 const & m, int) - { - return tmat4x4( - m[0] - static_cast(1), - m[1] - static_cast(1), - m[2] - static_cast(1), - m[3] - static_cast(1)); - } - - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tmat4x4 const & m1, tmat4x4 const & m2) diff --git a/external/glm/glm/detail/type_vec.hpp b/external/glm/glm/detail/type_vec.hpp index c14f234c9..ee0e2b307 100644 --- a/external/glm/glm/detail/type_vec.hpp +++ b/external/glm/glm/detail/type_vec.hpp @@ -168,7 +168,6 @@ namespace glm /// @} - /// @addtogroup core_precision /// @{ @@ -374,8 +373,7 @@ namespace glm /// @addtogroup core_types /// @{ - ////////////////////////// - // Default float definition + // -- Default float definition -- #if(defined(GLM_PRECISION_LOWP_FLOAT)) typedef lowp_vec2 vec2; @@ -402,8 +400,7 @@ namespace glm typedef highp_vec4 vec4; #endif//GLM_PRECISION - ////////////////////////// - // Default double definition + // -- Default double definition -- #if(defined(GLM_PRECISION_LOWP_DOUBLE)) typedef lowp_dvec2 dvec2; @@ -418,21 +415,20 @@ namespace glm /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_dvec2 dvec2; - + //! 3 components vector of double-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_dvec3 dvec3; - + //! 4 components vector of double-precision floating-point numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_dvec4 dvec4; #endif//GLM_PRECISION - - ////////////////////////// - // Signed integer definition - + + // -- Signed integer definition -- + #if(defined(GLM_PRECISION_LOWP_INT)) typedef lowp_ivec2 ivec2; typedef lowp_ivec3 ivec3; @@ -442,25 +438,24 @@ namespace glm typedef mediump_ivec3 ivec3; typedef mediump_ivec4 ivec4; #else //defined(GLM_PRECISION_HIGHP_INT) - //! 2 components vector of signed integer numbers. + /// 2 components vector of signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_ivec2 ivec2; - - //! 3 components vector of signed integer numbers. + + /// 3 components vector of signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_ivec3 ivec3; - - //! 4 components vector of signed integer numbers. + + /// 4 components vector of signed integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_ivec4 ivec4; #endif//GLM_PRECISION - - ////////////////////////// - // Unsigned integer definition - + + // -- Unsigned integer definition -- + #if(defined(GLM_PRECISION_LOWP_UINT)) typedef lowp_uvec2 uvec2; typedef lowp_uvec3 uvec3; @@ -474,20 +469,19 @@ namespace glm /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_uvec2 uvec2; - + /// 3 components vector of unsigned integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_uvec3 uvec3; - + /// 4 components vector of unsigned integer numbers. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_uvec4 uvec4; #endif//GLM_PRECISION - - ////////////////////////// - // Boolean definition + + // -- Boolean definition -- #if(defined(GLM_PRECISION_LOWP_BOOL)) typedef lowp_bvec2 bvec2; @@ -498,21 +492,21 @@ namespace glm typedef mediump_bvec3 bvec3; typedef mediump_bvec4 bvec4; #else //defined(GLM_PRECISION_HIGHP_BOOL) - //! 2 components vector of boolean. + /// 2 components vector of boolean. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_bvec2 bvec2; - - //! 3 components vector of boolean. + + /// 3 components vector of boolean. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_bvec3 bvec3; - - //! 4 components vector of boolean. + + /// 4 components vector of boolean. /// /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors typedef highp_bvec4 bvec4; #endif//GLM_PRECISION - + /// @} }//namespace glm diff --git a/external/glm/glm/detail/type_vec1.hpp b/external/glm/glm/detail/type_vec1.hpp index 3550d0324..6c30a4389 100644 --- a/external/glm/glm/detail/type_vec1.hpp +++ b/external/glm/glm/detail/type_vec1.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -48,15 +48,18 @@ namespace glm template struct tvec1 { - ////////////////////////////////////// - // Implementation detail + // -- Implementation detail -- typedef tvec1 type; typedef tvec1 bool_type; typedef T value_type; - ////////////////////////////////////// - // Data +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 1; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + + // -- Data -- # if GLM_HAS_ANONYMOUS_UNION union @@ -85,8 +88,7 @@ namespace glm # endif//GLM_SWIZZLE*/ # endif - ////////////////////////////////////// - // Accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC /// Return the count of components of the vector @@ -104,45 +106,35 @@ namespace glm GLM_FUNC_DECL T const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - GLM_FUNC_DECL tvec1(); - GLM_FUNC_DECL tvec1(tvec1 const & v); + GLM_FUNC_DECL tvec1() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tvec1(tvec1 const & v) GLM_DEFAULT; template GLM_FUNC_DECL tvec1(tvec1 const & v); - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tvec1(ctor); - GLM_FUNC_DECL explicit tvec1(T const & s); + GLM_FUNC_DECL explicit tvec1(T const & scalar); - ////////////////////////////////////// - // Conversion vector constructors - - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec1(tvec2 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec1(tvec3 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec1(tvec4 const & v); -# ifdef GLM_FORCE_EXPLICIT_CTOR - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec1(tvec1 const & v); -# else - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL tvec1(tvec1 const & v); -# endif + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_EXPLICIT tvec1(tvec1 const & v); - ////////////////////////////////////// - // Swizzle constructors + // -- Swizzle constructors -- # if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)) template @@ -152,169 +144,174 @@ namespace glm } # endif//(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)) - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tvec1 & operator=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator=(tvec1 const & v) GLM_DEFAULT; - template + template GLM_FUNC_DECL tvec1 & operator=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator+=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator+=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator+=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator-=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator-=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator-=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator*=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator*=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator*=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator/=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator/=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator/=(tvec1 const & v); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tvec1 & operator++(); GLM_FUNC_DECL tvec1 & operator--(); GLM_FUNC_DECL tvec1 operator++(int); GLM_FUNC_DECL tvec1 operator--(int); - ////////////////////////////////////// - // Unary bit operators + // -- Unary bit operators -- - template - GLM_FUNC_DECL tvec1 & operator%=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator%=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator%=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator&=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator&=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator&=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator|=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator|=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator|=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator^=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator^=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator^=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator<<=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator<<=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator<<=(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 & operator>>=(U const & s); - template + template + GLM_FUNC_DECL tvec1 & operator>>=(U const & scalar); + template GLM_FUNC_DECL tvec1 & operator>>=(tvec1 const & v); }; + // -- Unary operators -- template - GLM_FUNC_DECL tvec1 operator+(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator+(tvec1 const & v); template - GLM_FUNC_DECL tvec1 operator+(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator-(tvec1 const & v); - template - GLM_FUNC_DECL tvec1 operator+(tvec1 const & v1, tvec1 const & v2); + // -- Binary operators -- template - GLM_FUNC_DECL tvec1 operator-(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator+(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator-(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator+(T const & scalar, tvec1 const & v); template - GLM_FUNC_DECL tvec1 operator- (tvec1 const & v1, tvec1 const & v2); + GLM_FUNC_DECL tvec1 operator+(tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator*(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator-(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator*(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator-(T const & scalar, tvec1 const & v); template - GLM_FUNC_DECL tvec1 operator*(tvec1 const & v1, tvec1 const & v2); + GLM_FUNC_DECL tvec1 operator- (tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator/(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator*(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator/(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator*(T const & scalar, tvec1 const & v); template - GLM_FUNC_DECL tvec1 operator/(tvec1 const & v1, tvec1 const & v2); + GLM_FUNC_DECL tvec1 operator*(tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator-(tvec1 const & v); + GLM_FUNC_DECL tvec1 operator/(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL bool operator==(tvec1 const & v1, tvec1 const & v2); + GLM_FUNC_DECL tvec1 operator/(T const & scalar, tvec1 const & v); template - GLM_FUNC_DECL bool operator!=(tvec1 const & v1, tvec1 const & v2); + GLM_FUNC_DECL tvec1 operator/(tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator%(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator%(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator%(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator%(T const & scalar, tvec1 const & v); template GLM_FUNC_DECL tvec1 operator%(tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator&(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator&(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator&(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator&(T const & scalar, tvec1 const & v); template GLM_FUNC_DECL tvec1 operator&(tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator|(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator|(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator|(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator|(T const & scalar, tvec1 const & v); template GLM_FUNC_DECL tvec1 operator|(tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator^(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator^(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator^(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator^(T const & scalar, tvec1 const & v); template GLM_FUNC_DECL tvec1 operator^(tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator<<(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator<<(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator<<(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator<<(T const & scalar, tvec1 const & v); template GLM_FUNC_DECL tvec1 operator<<(tvec1 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec1 operator>>(tvec1 const & v, T const & s); + GLM_FUNC_DECL tvec1 operator>>(tvec1 const & v, T const & scalar); template - GLM_FUNC_DECL tvec1 operator>>(T const & s, tvec1 const & v); + GLM_FUNC_DECL tvec1 operator>>(T const & scalar, tvec1 const & v); template GLM_FUNC_DECL tvec1 operator>>(tvec1 const & v1, tvec1 const & v2); - template + template GLM_FUNC_DECL tvec1 operator~(tvec1 const & v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tvec1 const & v1, tvec1 const & v2); + + template + GLM_FUNC_DECL bool operator!=(tvec1 const & v1, tvec1 const & v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_vec1.inl b/external/glm/glm/detail/type_vec1.inl index bd756cd41..effac06f7 100644 --- a/external/glm/glm/detail/type_vec1.inl +++ b/external/glm/glm/detail/type_vec1.inl @@ -32,20 +32,23 @@ namespace glm { - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - template - GLM_FUNC_QUALIFIER tvec1::tvec1() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0) -# endif - {} - - template - GLM_FUNC_QUALIFIER tvec1::tvec1(tvec1 const & v) - : x(v.x) - {} +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tvec1::tvec1() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0) +# endif + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS + +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tvec1::tvec1(tvec1 const & v) + : x(v.x) + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -53,20 +56,18 @@ namespace glm : x(v.x) {} - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- template GLM_FUNC_QUALIFIER tvec1::tvec1(ctor) {} template - GLM_FUNC_QUALIFIER tvec1::tvec1(T const & s) - : x(s) + GLM_FUNC_QUALIFIER tvec1::tvec1(T const & scalar) + : x(scalar) {} - ////////////////////////////////////// - // Conversion vector constructors + // -- Conversion vector constructors -- template template @@ -92,8 +93,7 @@ namespace glm : x(static_cast(v.x)) {} - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -137,15 +137,16 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator=(tvec1 const & v) - { - this->x = v.x; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator=(tvec1 const & v) + { + this->x = v.x; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -157,9 +158,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator+=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator+=(U const & scalar) { - this->x += static_cast(s); + this->x += static_cast(scalar); return *this; } @@ -173,9 +174,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator-=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator-=(U const & scalar) { - this->x -= static_cast(s); + this->x -= static_cast(scalar); return *this; } @@ -189,9 +190,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator*=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator*=(U const & scalar) { - this->x *= static_cast(s); + this->x *= static_cast(scalar); return *this; } @@ -205,9 +206,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator/=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator/=(U const & scalar) { - this->x /= static_cast(s); + this->x /= static_cast(scalar); return *this; } @@ -219,8 +220,7 @@ namespace glm return *this; } - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator++() @@ -252,29 +252,13 @@ namespace glm return Result; } - ////////////////////////////////////// - // Boolean operators - - template - GLM_FUNC_QUALIFIER bool operator==(tvec1 const & v1, tvec1 const & v2) - { - return (v1.x == v2.x); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(tvec1 const & v1, tvec1 const & v2) - { - return (v1.x != v2.x); - } - - ////////////////////////////////////// - // Unary bit operators + // -- Unary bit operators -- template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator%=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator%=(U const & scalar) { - this->x %= static_cast(s); + this->x %= static_cast(scalar); return *this; } @@ -288,9 +272,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator&=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator&=(U const & scalar) { - this->x &= static_cast(s); + this->x &= static_cast(scalar); return *this; } @@ -304,9 +288,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator|=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator|=(U const & scalar) { - this->x |= static_cast(s); + this->x |= static_cast(scalar); return *this; } @@ -320,9 +304,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator^=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator^=(U const & scalar) { - this->x ^= static_cast(s); + this->x ^= static_cast(scalar); return *this; } @@ -336,9 +320,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator<<=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator<<=(U const & scalar) { - this->x <<= static_cast(s); + this->x <<= static_cast(scalar); return *this; } @@ -352,9 +336,9 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec1 & tvec1::operator>>=(U const & s) + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator>>=(U const & scalar) { - this->x >>= static_cast(s); + this->x >>= static_cast(scalar); return *this; } @@ -366,21 +350,35 @@ namespace glm return *this; } - ////////////////////////////////////// - // Binary arithmetic operators + // -- Unary constant operators -- + + template + GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v) + { + return tvec1( + -v.x); + } + + // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v, T const & scalar) { return tvec1( - v.x + s); + v.x + scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator+(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator+(T const & scalar, tvec1 const & v) { return tvec1( - s + v.x); + scalar + v.x); } template @@ -392,17 +390,17 @@ namespace glm //operator- template - GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v, T const & scalar) { return tvec1( - v.x - s); + v.x - scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator-(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator-(T const & scalar, tvec1 const & v) { return tvec1( - s - v.x); + scalar - v.x); } template @@ -412,19 +410,18 @@ namespace glm v1.x - v2.x); } - //operator* template - GLM_FUNC_QUALIFIER tvec1 operator*(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator*(tvec1 const & v, T const & scalar) { return tvec1( - v.x * s); + v.x * scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator*(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator*(T const & scalar, tvec1 const & v) { return tvec1( - s * v.x); + scalar * v.x); } template @@ -434,19 +431,18 @@ namespace glm v1.x * v2.x); } - //operator/ template - GLM_FUNC_QUALIFIER tvec1 operator/(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator/(tvec1 const & v, T const & scalar) { return tvec1( - v.x / s); + v.x / scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator/(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator/(T const & scalar, tvec1 const & v) { return tvec1( - s / v.x); + scalar / v.x); } template @@ -456,43 +452,20 @@ namespace glm v1.x / v2.x); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v) - { - return tvec1( - -v.x); - } - - template - GLM_FUNC_QUALIFIER tvec1 operator++(tvec1 const & v, int) - { - return tvec1( - v.x + T(1)); - } + // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER tvec1 operator--(tvec1 const & v, int) + GLM_FUNC_QUALIFIER tvec1 operator%(tvec1 const & v, T const & scalar) { return tvec1( - v.x - T(1)); + v.x % scalar); } - ////////////////////////////////////// - // Binary bit operators - template - GLM_FUNC_QUALIFIER tvec1 operator%(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator%(T const & scalar, tvec1 const & v) { return tvec1( - v.x % s); - } - - template - GLM_FUNC_QUALIFIER tvec1 operator%(T const & s, tvec1 const & v) - { - return tvec1( - s % v.x); + scalar % v.x); } template @@ -503,17 +476,17 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator&(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator&(tvec1 const & v, T const & scalar) { return tvec1( - v.x & s); + v.x & scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator&(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator&(T const & scalar, tvec1 const & v) { return tvec1( - s & v.x); + scalar & v.x); } template @@ -524,17 +497,17 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator|(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator|(tvec1 const & v, T const & scalar) { return tvec1( - v.x | s); + v.x | scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator|(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator|(T const & scalar, tvec1 const & v) { return tvec1( - s | v.x); + scalar | v.x); } template @@ -545,17 +518,17 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator^(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator^(tvec1 const & v, T const & scalar) { return tvec1( - v.x ^ s); + v.x ^ scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator^(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator^(T const & scalar, tvec1 const & v) { return tvec1( - s ^ v.x); + scalar ^ v.x); } template @@ -566,17 +539,17 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator<<(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator<<(tvec1 const & v, T const & scalar) { return tvec1( - v.x << s); + v.x << scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator<<(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator<<(T const & scalar, tvec1 const & v) { return tvec1( - s << v.x); + scalar << v.x); } template @@ -587,17 +560,17 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec1 operator>>(tvec1 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec1 operator>>(tvec1 const & v, T const & scalar) { return tvec1( - v.x >> s); + v.x >> scalar); } template - GLM_FUNC_QUALIFIER tvec1 operator>>(T const & s, tvec1 const & v) + GLM_FUNC_QUALIFIER tvec1 operator>>(T const & scalar, tvec1 const & v) { return tvec1( - s >> v.x); + scalar >> v.x); } template @@ -613,4 +586,18 @@ namespace glm return tvec1( ~v.x); } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(tvec1 const & v1, tvec1 const & v2) + { + return (v1.x == v2.x); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(tvec1 const & v1, tvec1 const & v2) + { + return (v1.x != v2.x); + } }//namespace glm diff --git a/external/glm/glm/detail/type_vec2.hpp b/external/glm/glm/detail/type_vec2.hpp index 29cfa0924..76029f497 100644 --- a/external/glm/glm/detail/type_vec2.hpp +++ b/external/glm/glm/detail/type_vec2.hpp @@ -32,7 +32,6 @@ #pragma once -//#include "../fwd.hpp" #include "type_vec.hpp" #ifdef GLM_SWIZZLE # if GLM_HAS_ANONYMOUS_UNION @@ -48,15 +47,18 @@ namespace glm template struct tvec2 { - ////////////////////////////////////// - // Implementation detail + // -- Implementation detail -- typedef tvec2 type; typedef tvec2 bool_type; typedef T value_type; - ////////////////////////////////////// - // Data +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 2; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + + // -- Data -- # if GLM_HAS_ANONYMOUS_UNION union @@ -86,8 +88,7 @@ namespace glm # endif//GLM_SWIZZLE # endif - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC /// Return the count of components of the vector @@ -105,23 +106,20 @@ namespace glm GLM_FUNC_DECL T const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - GLM_FUNC_DECL tvec2(); - GLM_FUNC_DECL tvec2(tvec2 const & v); + GLM_FUNC_DECL tvec2() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tvec2(tvec2 const & v) GLM_DEFAULT; template GLM_FUNC_DECL tvec2(tvec2 const & v); - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tvec2(ctor); - GLM_FUNC_DECL explicit tvec2(T const & s); + GLM_FUNC_DECL explicit tvec2(T const & scalar); GLM_FUNC_DECL tvec2(T const & s1, T const & s2); - ////////////////////////////////////// - // Conversion constructors + // -- Conversion constructors -- /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template @@ -129,28 +127,20 @@ namespace glm template GLM_FUNC_DECL tvec2(tvec1 const & v1, tvec1 const & v2); - ////////////////////////////////////// - // Conversion vector constructors + // -- Conversion vector constructors -- - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec2(tvec3 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec2(tvec4 const & v); -# ifdef GLM_FORCE_EXPLICIT_CTOR - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec2(tvec2 const & v); -# else - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL tvec2(tvec2 const & v); -# endif + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_EXPLICIT tvec2(tvec2 const & v); - ////////////////////////////////////// - // Swizzle constructors + // -- Swizzle constructors -- # if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) template @@ -160,95 +150,102 @@ namespace glm } # endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tvec2& operator=(tvec2 const & v); + GLM_FUNC_DECL tvec2& operator=(tvec2 const & v) GLM_DEFAULT; template GLM_FUNC_DECL tvec2& operator=(tvec2 const & v); template - GLM_FUNC_DECL tvec2& operator+=(U s); + GLM_FUNC_DECL tvec2& operator+=(U scalar); template GLM_FUNC_DECL tvec2& operator+=(tvec1 const & v); template GLM_FUNC_DECL tvec2& operator+=(tvec2 const & v); template - GLM_FUNC_DECL tvec2& operator-=(U s); + GLM_FUNC_DECL tvec2& operator-=(U scalar); template GLM_FUNC_DECL tvec2& operator-=(tvec1 const & v); template GLM_FUNC_DECL tvec2& operator-=(tvec2 const & v); template - GLM_FUNC_DECL tvec2& operator*=(U s); + GLM_FUNC_DECL tvec2& operator*=(U scalar); template GLM_FUNC_DECL tvec2& operator*=(tvec1 const & v); template GLM_FUNC_DECL tvec2& operator*=(tvec2 const & v); template - GLM_FUNC_DECL tvec2& operator/=(U s); + GLM_FUNC_DECL tvec2& operator/=(U scalar); template GLM_FUNC_DECL tvec2& operator/=(tvec1 const & v); template GLM_FUNC_DECL tvec2& operator/=(tvec2 const & v); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tvec2 & operator++(); GLM_FUNC_DECL tvec2 & operator--(); GLM_FUNC_DECL tvec2 operator++(int); GLM_FUNC_DECL tvec2 operator--(int); - ////////////////////////////////////// - // Unary bit operators + // -- Unary bit operators -- template - GLM_FUNC_DECL tvec2 & operator%=(U s); + GLM_FUNC_DECL tvec2 & operator%=(U scalar); template GLM_FUNC_DECL tvec2 & operator%=(tvec1 const & v); template GLM_FUNC_DECL tvec2 & operator%=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator&=(U s); + GLM_FUNC_DECL tvec2 & operator&=(U scalar); template GLM_FUNC_DECL tvec2 & operator&=(tvec1 const & v); template GLM_FUNC_DECL tvec2 & operator&=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator|=(U s); + GLM_FUNC_DECL tvec2 & operator|=(U scalar); template GLM_FUNC_DECL tvec2 & operator|=(tvec1 const & v); template GLM_FUNC_DECL tvec2 & operator|=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator^=(U s); + GLM_FUNC_DECL tvec2 & operator^=(U scalar); template GLM_FUNC_DECL tvec2 & operator^=(tvec1 const & v); template GLM_FUNC_DECL tvec2 & operator^=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator<<=(U s); + GLM_FUNC_DECL tvec2 & operator<<=(U scalar); template GLM_FUNC_DECL tvec2 & operator<<=(tvec1 const & v); template GLM_FUNC_DECL tvec2 & operator<<=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator>>=(U s); + GLM_FUNC_DECL tvec2 & operator>>=(U scalar); template GLM_FUNC_DECL tvec2 & operator>>=(tvec1 const & v); template GLM_FUNC_DECL tvec2 & operator>>=(tvec2 const & v); }; + // -- Unary operators -- + + template + GLM_FUNC_DECL tvec2 operator+(tvec2 const & v); + + template + GLM_FUNC_DECL tvec2 operator-(tvec2 const & v); + + // -- Binary operators -- + template - GLM_FUNC_DECL tvec2 operator+(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator+(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator+(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator+(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator+(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator+(tvec1 const & v1, tvec2 const & v2); @@ -257,13 +254,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator+(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator-(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator-(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator-(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator-(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator-(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator-(tvec1 const & v1, tvec2 const & v2); @@ -272,13 +269,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator-(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator*(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator*(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator*(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator*(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator*(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator*(tvec1 const & v1, tvec2 const & v2); @@ -287,13 +284,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator*(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator/(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator/(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator/(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator/(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator/(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator/(tvec1 const & v1, tvec2 const & v2); @@ -305,13 +302,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator-(tvec2 const & v); template - GLM_FUNC_DECL tvec2 operator%(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator%(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator%(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator%(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator%(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator%(tvec1 const & v1, tvec2 const & v2); @@ -320,13 +317,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator%(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator&(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator&(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator&(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator&(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator&(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator&(tvec1 const & v1, tvec2 const & v2); @@ -335,13 +332,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator&(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator|(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator|(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator|(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator|(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator|(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator|(tvec1 const & v1, tvec2 const & v2); @@ -350,13 +347,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator|(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator^(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator^(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator^(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator^(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator^(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator^(tvec1 const & v1, tvec2 const & v2); @@ -365,13 +362,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator^(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator<<(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator<<(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator<<(tvec1 const & v1, tvec2 const & v2); @@ -380,13 +377,13 @@ namespace glm GLM_FUNC_DECL tvec2 operator<<(tvec2 const & v1, tvec2 const & v2); template - GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v, T const & s); + GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v, T const & scalar); template GLM_FUNC_DECL tvec2 operator>>(tvec2 const & v1, tvec1 const & v2); template - GLM_FUNC_DECL tvec2 operator>>(T const & s, tvec2 const & v); + GLM_FUNC_DECL tvec2 operator>>(T const & scalar, tvec2 const & v); template GLM_FUNC_DECL tvec2 operator>>(tvec1 const & v1, tvec2 const & v2); @@ -396,6 +393,14 @@ namespace glm template GLM_FUNC_DECL tvec2 operator~(tvec2 const & v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tvec2 const & v1, tvec2 const & v2); + + template + GLM_FUNC_DECL bool operator!=(tvec2 const & v1, tvec2 const & v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_vec2.inl b/external/glm/glm/detail/type_vec2.inl index 4db29479e..b8cb1ff85 100644 --- a/external/glm/glm/detail/type_vec2.inl +++ b/external/glm/glm/detail/type_vec2.inl @@ -28,51 +28,23 @@ namespace glm { -#ifdef GLM_FORCE_SIZE_FUNC - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tvec2::size() const - { - return 2; - } -#else - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tvec2::length() const - { - return 2; - } -#endif + // -- Implicit basic constructors -- - ////////////////////////////////////// - // Accesses +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tvec2::tvec2() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0), y(0) +# endif + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS - template - GLM_FUNC_QUALIFIER T & tvec2::operator[](length_t i) - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } - - template - GLM_FUNC_QUALIFIER T const & tvec2::operator[](length_t i) const - { - assert(i >= 0 && static_cast(i) < detail::component_count(*this)); - return (&x)[i]; - } - - ////////////////////////////////////// - // Implicit basic constructors - - template - GLM_FUNC_QUALIFIER tvec2::tvec2() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0), y(0) -# endif - {} - - template - GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) - : x(v.x), y(v.y) - {} +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) + : x(v.x), y(v.y) + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -80,16 +52,15 @@ namespace glm : x(v.x), y(v.y) {} - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- template GLM_FUNC_QUALIFIER tvec2::tvec2(ctor) {} template - GLM_FUNC_QUALIFIER tvec2::tvec2(T const & s) - : x(s), y(s) + GLM_FUNC_QUALIFIER tvec2::tvec2(T const & scalar) + : x(scalar), y(scalar) {} template @@ -97,8 +68,7 @@ namespace glm : x(s1), y(s2) {} - ////////////////////////////////////// - // Conversion scalar constructors + // -- Conversion scalar constructors -- template template @@ -114,8 +84,7 @@ namespace glm , y(static_cast(b.x)) {} - ////////////////////////////////////// - // Conversion vector constructors + // -- Conversion vector constructors -- template template @@ -138,16 +107,61 @@ namespace glm , y(static_cast(v.y)) {} - ////////////////////////////////////// - // Unary arithmetic operators - - template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator=(tvec2 const & v) - { - this->x = v.x; - this->y = v.y; - return *this; - } + // -- Component accesses -- + +# ifdef GLM_FORCE_SIZE_FUNC + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2::size_type tvec2::size() const + { + return 2; + } + + template + GLM_FUNC_QUALIFIER T & tvec2::operator[](typename tvec2::size_type i) + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } + + template + GLM_FUNC_QUALIFIER T const & tvec2::operator[](typename tvec2::size_type i) const + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } +# else + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2::length_type tvec2::length() const + { + return 2; + } + + template + GLM_FUNC_QUALIFIER T & tvec2::operator[](typename tvec2::length_type i) + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } + + template + GLM_FUNC_QUALIFIER T const & tvec2::operator[](typename tvec2::length_type i) const + { + assert(i >= 0 && static_cast(i) < detail::component_count(*this)); + return (&x)[i]; + } +# endif//GLM_FORCE_SIZE_FUNC + + // -- Unary arithmetic operators -- + +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator=(tvec2 const & v) + { + this->x = v.x; + this->y = v.y; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -160,10 +174,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator+=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator+=(U scalar) { - this->x += static_cast(s); - this->y += static_cast(s); + this->x += static_cast(scalar); + this->y += static_cast(scalar); return *this; } @@ -187,10 +201,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator-=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator-=(U scalar) { - this->x -= static_cast(s); - this->y -= static_cast(s); + this->x -= static_cast(scalar); + this->y -= static_cast(scalar); return *this; } @@ -214,10 +228,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator*=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator*=(U scalar) { - this->x *= static_cast(s); - this->y *= static_cast(s); + this->x *= static_cast(scalar); + this->y *= static_cast(scalar); return *this; } @@ -241,10 +255,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator/=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator/=(U scalar) { - this->x /= static_cast(s); - this->y /= static_cast(s); + this->x /= static_cast(scalar); + this->y /= static_cast(scalar); return *this; } @@ -266,8 +280,7 @@ namespace glm return *this; } - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- template GLM_FUNC_QUALIFIER tvec2 & tvec2::operator++() @@ -301,30 +314,14 @@ namespace glm return Result; } - ////////////////////////////////////// - // Boolean operators - - template - GLM_FUNC_QUALIFIER bool operator==(tvec2 const & v1, tvec2 const & v2) - { - return (v1.x == v2.x) && (v1.y == v2.y); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(tvec2 const & v1, tvec2 const & v2) - { - return (v1.x != v2.x) || (v1.y != v2.y); - } - - ////////////////////////////////////// - // Unary bit operators + // -- Unary bit operators -- template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator%=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator%=(U scalar) { - this->x %= static_cast(s); - this->y %= static_cast(s); + this->x %= static_cast(scalar); + this->y %= static_cast(scalar); return *this; } @@ -348,10 +345,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator&=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator&=(U scalar) { - this->x &= static_cast(s); - this->y &= static_cast(s); + this->x &= static_cast(scalar); + this->y &= static_cast(scalar); return *this; } @@ -375,10 +372,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator|=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator|=(U scalar) { - this->x |= static_cast(s); - this->y |= static_cast(s); + this->x |= static_cast(scalar); + this->y |= static_cast(scalar); return *this; } @@ -402,10 +399,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator^=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator^=(U scalar) { - this->x ^= static_cast(s); - this->y ^= static_cast(s); + this->x ^= static_cast(scalar); + this->y ^= static_cast(scalar); return *this; } @@ -429,10 +426,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator<<=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator<<=(U scalar) { - this->x <<= static_cast(s); - this->y <<= static_cast(s); + this->x <<= static_cast(scalar); + this->y <<= static_cast(scalar); return *this; } @@ -456,10 +453,10 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec2 & tvec2::operator>>=(U s) + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator>>=(U scalar) { - this->x >>= static_cast(s); - this->y >>= static_cast(s); + this->x >>= static_cast(scalar); + this->y >>= static_cast(scalar); return *this; } @@ -481,15 +478,30 @@ namespace glm return *this; } - ////////////////////////////////////// - // Binary arithmetic operators + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER tvec2 operator+(tvec2 const & v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER tvec2 operator-(tvec2 const & v) + { + return tvec2( + -v.x, + -v.y); + } + + // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec2 operator+(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator+(tvec2 const & v, T const & scalar) { return tvec2( - v.x + s, - v.y + s); + v.x + scalar, + v.y + scalar); } template @@ -501,11 +513,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator+(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator+(T const & scalar, tvec2 const & v) { return tvec2( - s + v.x, - s + v.y); + scalar + v.x, + scalar + v.y); } template @@ -524,13 +536,12 @@ namespace glm v1.y + v2.y); } - //operator- template - GLM_FUNC_QUALIFIER tvec2 operator-(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator-(tvec2 const & v, T const & scalar) { return tvec2( - v.x - s, - v.y - s); + v.x - scalar, + v.y - scalar); } template @@ -542,11 +553,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator-(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator-(T const & scalar, tvec2 const & v) { return tvec2( - s - v.x, - s - v.y); + scalar - v.x, + scalar - v.y); } template @@ -565,7 +576,6 @@ namespace glm v1.y - v2.y); } - //operator* template GLM_FUNC_QUALIFIER tvec2 operator*(tvec2 const & v1, T const & v2) { @@ -583,11 +593,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator*(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator*(T const & scalar, tvec2 const & v) { return tvec2( - s * v.x, - s * v.y); + scalar * v.x, + scalar * v.y); } template @@ -606,13 +616,12 @@ namespace glm v1.y * v2.y); } - //operator/ template - GLM_FUNC_QUALIFIER tvec2 operator/(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator/(tvec2 const & v, T const & scalar) { return tvec2( - v.x / s, - v.y / s); + v.x / scalar, + v.y / scalar); } template @@ -624,11 +633,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator/(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator/(T const & scalar, tvec2 const & v) { return tvec2( - s / v.x, - s / v.y); + scalar / v.x, + scalar / v.y); } template @@ -647,24 +656,14 @@ namespace glm v1.y / v2.y); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tvec2 operator-(tvec2 const & v) - { - return tvec2( - -v.x, - -v.y); - } - - ////////////////////////////////////// - // Binary bit operators + // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER tvec2 operator%(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator%(tvec2 const & v, T const & scalar) { return tvec2( - v.x % s, - v.y % s); + v.x % scalar, + v.y % scalar); } template @@ -676,11 +675,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator%(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator%(T const & scalar, tvec2 const & v) { return tvec2( - s % v.x, - s % v.y); + scalar % v.x, + scalar % v.y); } template @@ -700,11 +699,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator&(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator&(tvec2 const & v, T const & scalar) { return tvec2( - v.x & s, - v.y & s); + v.x & scalar, + v.y & scalar); } template @@ -716,11 +715,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator&(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator&(T const & scalar, tvec2 const & v) { return tvec2( - s & v.x, - s & v.y); + scalar & v.x, + scalar & v.y); } template @@ -740,11 +739,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator|(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator|(tvec2 const & v, T const & scalar) { return tvec2( - v.x | s, - v.y | s); + v.x | scalar, + v.y | scalar); } template @@ -756,11 +755,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator|(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator|(T const & scalar, tvec2 const & v) { return tvec2( - s | v.x, - s | v.y); + scalar | v.x, + scalar | v.y); } template @@ -780,11 +779,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator^(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator^(tvec2 const & v, T const & scalar) { return tvec2( - v.x ^ s, - v.y ^ s); + v.x ^ scalar, + v.y ^ scalar); } template @@ -796,11 +795,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator^(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator^(T const & scalar, tvec2 const & v) { return tvec2( - s ^ v.x, - s ^ v.y); + scalar ^ v.x, + scalar ^ v.y); } template @@ -820,11 +819,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator<<(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator<<(tvec2 const & v, T const & scalar) { return tvec2( - v.x << s, - v.y << s); + v.x << scalar, + v.y << scalar); } template @@ -836,11 +835,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator<<(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator<<(T const & scalar, tvec2 const & v) { return tvec2( - s << v.x, - s << v.y); + scalar << v.x, + scalar << v.y); } template @@ -860,11 +859,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator>>(tvec2 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec2 operator>>(tvec2 const & v, T const & scalar) { return tvec2( - v.x >> s, - v.y >> s); + v.x >> scalar, + v.y >> scalar); } template @@ -876,11 +875,11 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec2 operator>>(T const & s, tvec2 const & v) + GLM_FUNC_QUALIFIER tvec2 operator>>(T const & scalar, tvec2 const & v) { return tvec2( - s >> v.x, - s >> v.y); + scalar >> v.x, + scalar >> v.y); } template @@ -906,4 +905,18 @@ namespace glm ~v.x, ~v.y); } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(tvec2 const & v1, tvec2 const & v2) + { + return (v1.x == v2.x) && (v1.y == v2.y); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(tvec2 const & v1, tvec2 const & v2) + { + return (v1.x != v2.x) || (v1.y != v2.y); + } }//namespace glm diff --git a/external/glm/glm/detail/type_vec3.hpp b/external/glm/glm/detail/type_vec3.hpp index 5f0673bf4..f155b076a 100644 --- a/external/glm/glm/detail/type_vec3.hpp +++ b/external/glm/glm/detail/type_vec3.hpp @@ -32,7 +32,6 @@ #pragma once -//#include "../fwd.hpp" #include "type_vec.hpp" #ifdef GLM_SWIZZLE # if GLM_HAS_ANONYMOUS_UNION @@ -47,16 +46,19 @@ namespace glm { template struct tvec3 - { - ////////////////////////////////////// - // Implementation detail + { + // -- Implementation detail -- typedef tvec3 type; typedef tvec3 bool_type; typedef T value_type; - ////////////////////////////////////// - // Data +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 3; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + + // -- Data -- # if GLM_HAS_ANONYMOUS_UNION union @@ -87,8 +89,7 @@ namespace glm # endif//GLM_SWIZZLE # endif//GLM_LANG - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC /// Return the count of components of the vector @@ -106,23 +107,20 @@ namespace glm GLM_FUNC_DECL T const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - GLM_FUNC_DECL tvec3(); - GLM_FUNC_DECL tvec3(tvec3 const & v); + GLM_FUNC_DECL tvec3() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tvec3(tvec3 const & v) GLM_DEFAULT; template GLM_FUNC_DECL tvec3(tvec3 const & v); - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tvec3(ctor); - GLM_FUNC_DECL explicit tvec3(T const & s); + GLM_FUNC_DECL explicit tvec3(T const & scalar); GLM_FUNC_DECL tvec3(T const & a, T const & b, T const & c); - ////////////////////////////////////// - // Conversion scalar constructors + // -- Conversion scalar constructors -- /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template @@ -130,37 +128,29 @@ namespace glm template GLM_FUNC_DECL tvec3(tvec1 const & a, tvec1 const & b, tvec1 const & c); - ////////////////////////////////////// - // Conversion vector constructors + // -- Conversion vector constructors -- - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec3(tvec2 const & a, B const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec3(tvec2 const & a, tvec1 const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec3(A const & a, tvec2 const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec3(tvec1 const & a, tvec2 const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec3(tvec4 const & v); -# ifdef GLM_FORCE_EXPLICIT_CTOR - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec3(tvec3 const & v); -# else - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL tvec3(tvec3 const & v); -# endif + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_EXPLICIT tvec3(tvec3 const & v); - ////////////////////////////////////// - // Swizzle constructors + // -- Swizzle constructors -- # if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) template @@ -170,254 +160,266 @@ namespace glm } template - GLM_FUNC_DECL tvec3(detail::_swizzle<2, T, P, tvec2, E0, E1, -1, -2> const & v, T const & s) + GLM_FUNC_DECL tvec3(detail::_swizzle<2, T, P, tvec2, E0, E1, -1, -2> const & v, T const & scalar) { - *this = tvec3(v(), s); + *this = tvec3(v(), scalar); } template - GLM_FUNC_DECL tvec3(T const & s, detail::_swizzle<2, T, P, tvec2, E0, E1, -1, -2> const & v) + GLM_FUNC_DECL tvec3(T const & scalar, detail::_swizzle<2, T, P, tvec2, E0, E1, -1, -2> const & v) { - *this = tvec3(s, v()); + *this = tvec3(scalar, v()); } # endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tvec3 & operator=(tvec3 const & v); + GLM_FUNC_DECL tvec3 & operator=(tvec3 const & v) GLM_DEFAULT; template GLM_FUNC_DECL tvec3 & operator=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator+=(U s); + GLM_FUNC_DECL tvec3 & operator+=(U scalar); template GLM_FUNC_DECL tvec3 & operator+=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator+=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator-=(U s); + GLM_FUNC_DECL tvec3 & operator-=(U scalar); template GLM_FUNC_DECL tvec3 & operator-=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator-=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator*=(U s); + GLM_FUNC_DECL tvec3 & operator*=(U scalar); template GLM_FUNC_DECL tvec3 & operator*=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator*=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator/=(U s); + GLM_FUNC_DECL tvec3 & operator/=(U scalar); template GLM_FUNC_DECL tvec3 & operator/=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator/=(tvec3 const & v); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tvec3 & operator++(); GLM_FUNC_DECL tvec3 & operator--(); GLM_FUNC_DECL tvec3 operator++(int); GLM_FUNC_DECL tvec3 operator--(int); - ////////////////////////////////////// - // Unary bit operators + // -- Unary bit operators -- template - GLM_FUNC_DECL tvec3 & operator%=(U s); + GLM_FUNC_DECL tvec3 & operator%=(U scalar); template GLM_FUNC_DECL tvec3 & operator%=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator%=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator&=(U s); + GLM_FUNC_DECL tvec3 & operator&=(U scalar); template GLM_FUNC_DECL tvec3 & operator&=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator&=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator|=(U s); + GLM_FUNC_DECL tvec3 & operator|=(U scalar); template GLM_FUNC_DECL tvec3 & operator|=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator|=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator^=(U s); + GLM_FUNC_DECL tvec3 & operator^=(U scalar); template GLM_FUNC_DECL tvec3 & operator^=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator^=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator<<=(U s); + GLM_FUNC_DECL tvec3 & operator<<=(U scalar); template GLM_FUNC_DECL tvec3 & operator<<=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator<<=(tvec3 const & v); template - GLM_FUNC_DECL tvec3 & operator>>=(U s); + GLM_FUNC_DECL tvec3 & operator>>=(U scalar); template GLM_FUNC_DECL tvec3 & operator>>=(tvec1 const & v); template GLM_FUNC_DECL tvec3 & operator>>=(tvec3 const & v); }; + // -- Unary operators -- + + template + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v); + + // -- Binary operators -- + template - GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator+(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator+(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator+(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator+(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator+(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator+(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator-(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator-(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator-(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator-(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator-(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator-(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator*(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator*(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator*(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator*(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator*(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator/(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator/(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator/(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator/(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator/(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator/(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator-(tvec3 const & v); + GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator%(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator%(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator%(T const & s, tvec3 const & v); - - template - GLM_FUNC_DECL tvec3 operator%(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator%(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator%(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator&(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator&(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator&(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator&(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator&(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator&(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator&(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator&(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator&(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator|(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator|(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator|(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator|(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator|(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator|(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator^(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator^(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator^(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator^(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator^(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator^(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator<<(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator<<(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator<<(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator<<(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator<<(tvec3 const & v1, tvec3 const & v2); template - GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, T const & s); + GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, T const & scalar); template - GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v, tvec1 const & scalar); template - GLM_FUNC_DECL tvec3 operator>>(T const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator>>(T const & scalar, tvec3 const & v); template - GLM_FUNC_DECL tvec3 operator>>(tvec1 const & s, tvec3 const & v); + GLM_FUNC_DECL tvec3 operator>>(tvec1 const & scalar, tvec3 const & v); template GLM_FUNC_DECL tvec3 operator>>(tvec3 const & v1, tvec3 const & v2); template GLM_FUNC_DECL tvec3 operator~(tvec3 const & v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tvec3 const & v1, tvec3 const & v2); + + template + GLM_FUNC_DECL bool operator!=(tvec3 const & v1, tvec3 const & v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_vec3.inl b/external/glm/glm/detail/type_vec3.inl index b2088d8b7..fa8102c84 100644 --- a/external/glm/glm/detail/type_vec3.inl +++ b/external/glm/glm/detail/type_vec3.inl @@ -32,20 +32,23 @@ namespace glm { - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - template - GLM_FUNC_QUALIFIER tvec3::tvec3() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0), y(0), z(0) -# endif - {} - - template - GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) - : x(v.x), y(v.y), z(v.z) - {} +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tvec3::tvec3() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0), y(0), z(0) +# endif + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS + +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) + : x(v.x), y(v.y), z(v.z) + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -53,16 +56,15 @@ namespace glm : x(v.x), y(v.y), z(v.z) {} - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- template GLM_FUNC_QUALIFIER tvec3::tvec3(ctor) {} template - GLM_FUNC_QUALIFIER tvec3::tvec3(T const & s) - : x(s), y(s), z(s) + GLM_FUNC_QUALIFIER tvec3::tvec3(T const & scalar) + : x(scalar), y(scalar), z(scalar) {} template @@ -70,8 +72,7 @@ namespace glm : x(a), y(b), z(c) {} - ////////////////////////////////////// - // Conversion scalar constructors + // -- Conversion scalar constructors -- template template @@ -89,8 +90,7 @@ namespace glm z(static_cast(c)) {} - ////////////////////////////////////// - // Conversion vector constructors + // -- Conversion vector constructors -- template template @@ -140,8 +140,7 @@ namespace glm z(static_cast(v.z)) {} - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -185,17 +184,18 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER tvec3& tvec3::operator=(tvec3 const & v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tvec3& tvec3::operator=(tvec3 const & v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -209,11 +209,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator+=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator+=(U scalar) { - this->x += static_cast(s); - this->y += static_cast(s); - this->z += static_cast(s); + this->x += static_cast(scalar); + this->y += static_cast(scalar); + this->z += static_cast(scalar); return *this; } @@ -239,11 +239,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator-=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator-=(U scalar) { - this->x -= static_cast(s); - this->y -= static_cast(s); - this->z -= static_cast(s); + this->x -= static_cast(scalar); + this->y -= static_cast(scalar); + this->z -= static_cast(scalar); return *this; } @@ -269,11 +269,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator*=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator*=(U scalar) { - this->x *= static_cast(s); - this->y *= static_cast(s); - this->z *= static_cast(s); + this->x *= static_cast(scalar); + this->y *= static_cast(scalar); + this->z *= static_cast(scalar); return *this; } @@ -299,11 +299,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator/=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator/=(U v) { - this->x /= static_cast(s); - this->y /= static_cast(s); - this->z /= static_cast(s); + this->x /= static_cast(v); + this->y /= static_cast(v); + this->z /= static_cast(v); return *this; } @@ -327,8 +327,7 @@ namespace glm return *this; } - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator++() @@ -364,16 +363,15 @@ namespace glm return Result; } - ////////////////////////////////////// - // Unary bit operators + // -- Unary bit operators -- template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator%=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator%=(U scalar) { - this->x %= s; - this->y %= s; - this->z %= s; + this->x %= scalar; + this->y %= scalar; + this->z %= scalar; return *this; } @@ -399,11 +397,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator&=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator&=(U scalar) { - this->x &= s; - this->y &= s; - this->z &= s; + this->x &= scalar; + this->y &= scalar; + this->z &= scalar; return *this; } @@ -429,11 +427,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator|=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator|=(U scalar) { - this->x |= s; - this->y |= s; - this->z |= s; + this->x |= scalar; + this->y |= scalar; + this->z |= scalar; return *this; } @@ -459,11 +457,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator^=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator^=(U scalar) { - this->x ^= s; - this->y ^= s; - this->z ^= s; + this->x ^= scalar; + this->y ^= scalar; + this->z ^= scalar; return *this; } @@ -489,11 +487,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator<<=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator<<=(U scalar) { - this->x <<= s; - this->y <<= s; - this->z <<= s; + this->x <<= scalar; + this->y <<= scalar; + this->z <<= scalar; return *this; } @@ -519,11 +517,11 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator>>=(U s) + GLM_FUNC_QUALIFIER tvec3 & tvec3::operator>>=(U scalar) { - this->x >>= static_cast(s); - this->y >>= static_cast(s); - this->z >>= static_cast(s); + this->x >>= static_cast(scalar); + this->y >>= static_cast(scalar); + this->z >>= static_cast(scalar); return *this; } @@ -547,58 +545,59 @@ namespace glm return *this; } - ////////////////////////////////////// - // Boolean operators + // -- Unary arithmetic operators -- template - GLM_FUNC_QUALIFIER bool operator==(tvec3 const & v1, tvec3 const & v2) + GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v) { - return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z); + return v; } template - GLM_FUNC_QUALIFIER bool operator!=(tvec3 const & v1, tvec3 const & v2) + GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v) { - return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z); + return tvec3( + -v.x, + -v.y, + -v.z); } - ////////////////////////////////////// - // Binary arithmetic operators + // -- Binary arithmetic operators -- template - GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v, T const & scalar) { return tvec3( - v.x + s, - v.y + s, - v.z + s); + v.x + scalar, + v.y + scalar, + v.z + scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x + s.x, - v.y + s.x, - v.z + s.x); + v.x + scalar.x, + v.y + scalar.x, + v.z + scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator+(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator+(T const & scalar, tvec3 const & v) { return tvec3( - s + v.x, - s + v.y, - s + v.z); + scalar + v.x, + scalar + v.y, + scalar + v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator+(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator+(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x + v.x, - s.x + v.y, - s.x + v.z); + scalar.x + v.x, + scalar.x + v.y, + scalar.x + v.z); } template @@ -610,41 +609,40 @@ namespace glm v1.z + v2.z); } - //operator- template - GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v, T const & scalar) { return tvec3( - v.x - s, - v.y - s, - v.z - s); + v.x - scalar, + v.y - scalar, + v.z - scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x - s.x, - v.y - s.x, - v.z - s.x); + v.x - scalar.x, + v.y - scalar.x, + v.z - scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator-(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator-(T const & scalar, tvec3 const & v) { return tvec3( - s - v.x, - s - v.y, - s - v.z); + scalar - v.x, + scalar - v.y, + scalar - v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator-(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator-(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x - v.x, - s.x - v.y, - s.x - v.z); + scalar.x - v.x, + scalar.x - v.y, + scalar.x - v.z); } template @@ -656,41 +654,40 @@ namespace glm v1.z - v2.z); } - //operator* template - GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v, T const & scalar) { return tvec3( - v.x * s, - v.y * s, - v.z * s); + v.x * scalar, + v.y * scalar, + v.z * scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x * s.x, - v.y * s.x, - v.z * s.x); + v.x * scalar.x, + v.y * scalar.x, + v.z * scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator*(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator*(T const & scalar, tvec3 const & v) { return tvec3( - s * v.x, - s * v.y, - s * v.z); + scalar * v.x, + scalar * v.y, + scalar * v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator*(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator*(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x * v.x, - s.x * v.y, - s.x * v.z); + scalar.x * v.x, + scalar.x * v.y, + scalar.x * v.z); } template @@ -702,41 +699,40 @@ namespace glm v1.z * v2.z); } - //operator/ template - GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v, T const & scalar) { return tvec3( - v.x / s, - v.y / s, - v.z / s); + v.x / scalar, + v.y / scalar, + v.z / scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x / s.x, - v.y / s.x, - v.z / s.x); + v.x / scalar.x, + v.y / scalar.x, + v.z / scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator/(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator/(T const & scalar, tvec3 const & v) { return tvec3( - s / v.x, - s / v.y, - s / v.z); + scalar / v.x, + scalar / v.y, + scalar / v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator/(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator/(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x / v.x, - s.x / v.y, - s.x / v.z); + scalar.x / v.x, + scalar.x / v.y, + scalar.x / v.z); } template @@ -748,53 +744,42 @@ namespace glm v1.z / v2.z); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v) - { - return tvec3( - -v.x, - -v.y, - -v.z); - } - - ////////////////////////////////////// - // Binary bit operators + // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v, T const & scalar) { return tvec3( - v.x % s, - v.y % s, - v.z % s); + v.x % scalar, + v.y % scalar, + v.z % scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x % s.x, - v.y % s.x, - v.z % s.x); + v.x % scalar.x, + v.y % scalar.x, + v.z % scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator%(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator%(T const & scalar, tvec3 const & v) { return tvec3( - s % v.x, - s % v.y, - s % v.z); + scalar % v.x, + scalar % v.y, + scalar % v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator%(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator%(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x % v.x, - s.x % v.y, - s.x % v.z); + scalar.x % v.x, + scalar.x % v.y, + scalar.x % v.z); } template @@ -807,39 +792,39 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v, T const & scalar) { return tvec3( - v.x & s, - v.y & s, - v.z & s); + v.x & scalar, + v.y & scalar, + v.z & scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x & s.x, - v.y & s.x, - v.z & s.x); + v.x & scalar.x, + v.y & scalar.x, + v.z & scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator&(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator&(T const & scalar, tvec3 const & v) { return tvec3( - s & v.x, - s & v.y, - s & v.z); + scalar & v.x, + scalar & v.y, + scalar & v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator&(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator&(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x & v.x, - s.x & v.y, - s.x & v.z); + scalar.x & v.x, + scalar.x & v.y, + scalar.x & v.z); } template @@ -852,39 +837,39 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v, T const & scalar) { return tvec3( - v.x | s, - v.y | s, - v.z | s); + v.x | scalar, + v.y | scalar, + v.z | scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x | s.x, - v.y | s.x, - v.z | s.x); + v.x | scalar.x, + v.y | scalar.x, + v.z | scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator|(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator|(T const & scalar, tvec3 const & v) { return tvec3( - s | v.x, - s | v.y, - s | v.z); + scalar | v.x, + scalar | v.y, + scalar | v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator|(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator|(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x | v.x, - s.x | v.y, - s.x | v.z); + scalar.x | v.x, + scalar.x | v.y, + scalar.x | v.z); } template @@ -897,39 +882,39 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v, T const & scalar) { return tvec3( - v.x ^ s, - v.y ^ s, - v.z ^ s); + v.x ^ scalar, + v.y ^ scalar, + v.z ^ scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x ^ s.x, - v.y ^ s.x, - v.z ^ s.x); + v.x ^ scalar.x, + v.y ^ scalar.x, + v.z ^ scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator^(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator^(T const & scalar, tvec3 const & v) { return tvec3( - s ^ v.x, - s ^ v.y, - s ^ v.z); + scalar ^ v.x, + scalar ^ v.y, + scalar ^ v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator^(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator^(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x ^ v.x, - s.x ^ v.y, - s.x ^ v.z); + scalar.x ^ v.x, + scalar.x ^ v.y, + scalar.x ^ v.z); } template @@ -942,39 +927,39 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v, T const & scalar) { return tvec3( - v.x << s, - v.y << s, - v.z << s); + v.x << scalar, + v.y << scalar, + v.z << scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x << s.x, - v.y << s.x, - v.z << s.x); + v.x << scalar.x, + v.y << scalar.x, + v.z << scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator<<(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator<<(T const & scalar, tvec3 const & v) { return tvec3( - s << v.x, - s << v.y, - s << v.z); + scalar << v.x, + scalar << v.y, + scalar << v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator<<(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator<<(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x << v.x, - s.x << v.y, - s.x << v.z); + scalar.x << v.x, + scalar.x << v.y, + scalar.x << v.z); } template @@ -987,39 +972,39 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v, T const & s) + GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v, T const & scalar) { return tvec3( - v.x >> s, - v.y >> s, - v.z >> s); + v.x >> scalar, + v.y >> scalar, + v.z >> scalar); } template - GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v, tvec1 const & scalar) { return tvec3( - v.x >> s.x, - v.y >> s.x, - v.z >> s.x); + v.x >> scalar.x, + v.y >> scalar.x, + v.z >> scalar.x); } template - GLM_FUNC_QUALIFIER tvec3 operator>>(T const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator>>(T const & scalar, tvec3 const & v) { return tvec3( - s >> v.x, - s >> v.y, - s >> v.z); + scalar >> v.x, + scalar >> v.y, + scalar >> v.z); } template - GLM_FUNC_QUALIFIER tvec3 operator>>(tvec1 const & s, tvec3 const & v) + GLM_FUNC_QUALIFIER tvec3 operator>>(tvec1 const & scalar, tvec3 const & v) { return tvec3( - s.x >> v.x, - s.x >> v.y, - s.x >> v.z); + scalar.x >> v.x, + scalar.x >> v.y, + scalar.x >> v.z); } template @@ -1039,4 +1024,18 @@ namespace glm ~v.y, ~v.z); } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(tvec3 const & v1, tvec3 const & v2) + { + return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(tvec3 const & v1, tvec3 const & v2) + { + return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z); + } }//namespace glm diff --git a/external/glm/glm/detail/type_vec4.hpp b/external/glm/glm/detail/type_vec4.hpp index 8189d6f08..e9fe6c1d7 100644 --- a/external/glm/glm/detail/type_vec4.hpp +++ b/external/glm/glm/detail/type_vec4.hpp @@ -32,7 +32,6 @@ #pragma once -//#include "../fwd.hpp" #include "setup.hpp" #include "type_vec.hpp" #ifdef GLM_SWIZZLE @@ -47,51 +46,51 @@ namespace glm{ namespace detail { - template - struct simd + template + struct simd_data { typedef T type[4]; }; -# define GLM_NOT_BUGGY_VC32BITS !(GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER < GLM_COMPILER_VC2013) +# define GLM_NOT_BUGGY_VC32BITS !(GLM_MODEL == GLM_MODEL_32 && (GLM_COMPILER & GLM_COMPILER_VC) && GLM_COMPILER < GLM_COMPILER_VC2013) -# if GLM_ARCH & GLM_ARCH_SSE2 && GLM_NOT_BUGGY_VC32BITS +# if (GLM_ARCH & GLM_ARCH_SSE2) && GLM_NOT_BUGGY_VC32BITS template <> - struct simd + struct simd_data { typedef __m128 type; }; template <> - struct simd + struct simd_data { typedef __m128i type; }; template <> - struct simd + struct simd_data { typedef __m128i type; }; # endif -# if GLM_ARCH & GLM_ARCH_AVX && GLM_NOT_BUGGY_VC32BITS +# if (GLM_ARCH & GLM_ARCH_AVX) && GLM_NOT_BUGGY_VC32BITS template <> - struct simd + struct simd_data { typedef __m256d type; }; # endif -# if GLM_ARCH & GLM_ARCH_AVX2 && GLM_NOT_BUGGY_VC32BITS +# if (GLM_ARCH & GLM_ARCH_AVX2) && GLM_NOT_BUGGY_VC32BITS template <> - struct simd + struct simd_data { typedef __m256i type; }; template <> - struct simd + struct simd_data { typedef __m256i type; }; @@ -102,24 +101,27 @@ namespace detail template struct tvec4 { - ////////////////////////////////////// - // Implementation detail + // -- Implementation detail -- typedef tvec4 type; typedef tvec4 bool_type; typedef T value_type; - ////////////////////////////////////// - // Data +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 4; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + + // -- Data -- -# if GLM_HAS_ANONYMOUS_UNION +# if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS union { struct { T x, y, z, w;}; struct { T r, g, b, a; }; struct { T s, t, p, q; }; - typename detail::simd::type data; + typename detail::simd_data::type data; # ifdef GLM_SWIZZLE _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w) @@ -144,8 +146,7 @@ namespace detail # endif//GLM_SWIZZLE # endif//GLM_LANG - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC /// Return the count of components of the vector @@ -163,24 +164,20 @@ namespace detail GLM_FUNC_DECL T const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - GLM_FUNC_DECL tvec4(); - GLM_FUNC_DECL tvec4(tvec4 const & v); + GLM_FUNC_DECL tvec4() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tvec4(tvec4 const & v) GLM_DEFAULT; template GLM_FUNC_DECL tvec4(tvec4 const & v); - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tvec4(ctor); - GLM_FUNC_DECL explicit tvec4(T s); + GLM_FUNC_DECL explicit tvec4(T scalar); GLM_FUNC_DECL tvec4(T a, T b, T c, T d); - GLM_FUNC_DECL ~tvec4(){} - ////////////////////////////////////// - // Conversion scalar constructors + // -- Conversion scalar constructors -- /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template @@ -188,55 +185,47 @@ namespace detail template GLM_FUNC_DECL tvec4(tvec1 const & a, tvec1 const & b, tvec1 const & c, tvec1 const & d); - ////////////////////////////////////// - // Conversion vector constructors + // -- Conversion vector constructors -- - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(tvec2 const & a, B b, C c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(tvec2 const & a, tvec1 const & b, tvec1 const & c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(A a, tvec2 const & b, C c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec2 const & b, tvec1 const & c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(A a, B b, tvec2 const & c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec1 const & b, tvec2 const & c); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(tvec3 const & a, B b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(tvec3 const & a, tvec1 const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(A a, tvec3 const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(tvec1 const & a, tvec3 const & b); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) template GLM_FUNC_DECL explicit tvec4(tvec2 const & a, tvec2 const & b); - -# ifdef GLM_FORCE_EXPLICIT_CTOR - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(tvec4 const & v); -# else - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL tvec4(tvec4 const & v); -# endif - ////////////////////////////////////// - // Swizzle constructors + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_EXPLICIT tvec4(tvec4 const & v); + + // -- Swizzle constructors -- # if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) template @@ -282,10 +271,9 @@ namespace detail } # endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE) - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tvec4 & operator=(tvec4 const & v); + GLM_FUNC_DECL tvec4 & operator=(tvec4 const & v) GLM_DEFAULT; template GLM_FUNC_DECL tvec4 & operator=(tvec4 const & v); @@ -314,16 +302,14 @@ namespace detail template GLM_FUNC_DECL tvec4 & operator/=(tvec4 const & v); - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- GLM_FUNC_DECL tvec4 & operator++(); GLM_FUNC_DECL tvec4 & operator--(); GLM_FUNC_DECL tvec4 operator++(int); GLM_FUNC_DECL tvec4 operator--(int); - ////////////////////////////////////// - // Unary bit operators + // -- Unary bit operators -- template GLM_FUNC_DECL tvec4 & operator%=(U scalar); @@ -363,17 +349,27 @@ namespace detail GLM_FUNC_DECL tvec4 & operator>>=(tvec4 const & v); }; + // -- Unary operators -- + + template + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v); + + // -- Binary operators -- + template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator+(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator+(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator+(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator+(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator+(tvec4 const & v1, tvec4 const & v2); @@ -382,13 +378,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator-(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator-(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator-(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator-(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator-(tvec4 const & v1, tvec4 const & v2); @@ -397,13 +393,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator*(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator*(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator*(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator*(tvec4 const & v1, tvec4 const & v2); @@ -412,20 +408,17 @@ namespace detail GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator/(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator/(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator/(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator/(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator/(tvec4 const & v1, tvec4 const & v2); - template - GLM_FUNC_DECL tvec4 operator-(tvec4 const & v); - template GLM_FUNC_DECL bool operator==(tvec4 const & v1, tvec4 const & v2); @@ -436,13 +429,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator%(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator%(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator%(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator%(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator%(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator%(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator%(tvec4 const & v1, tvec4 const & v2); @@ -451,13 +444,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator&(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator&(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator&(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator&(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator&(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator&(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator&(tvec4 const & v1, tvec4 const & v2); @@ -466,13 +459,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator|(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator|(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator|(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator|(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator|(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator|(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator|(tvec4 const & v1, tvec4 const & v2); @@ -481,13 +474,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator^(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator^(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator^(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator^(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator^(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator^(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator^(tvec4 const & v1, tvec4 const & v2); @@ -496,13 +489,13 @@ namespace detail GLM_FUNC_DECL tvec4 operator<<(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator<<(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator<<(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator<<(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator<<(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator<<(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator<<(tvec4 const & v1, tvec4 const & v2); @@ -511,19 +504,27 @@ namespace detail GLM_FUNC_DECL tvec4 operator>>(tvec4 const & v, T scalar); template - GLM_FUNC_DECL tvec4 operator>>(tvec4 const & v, tvec1 const & s); + GLM_FUNC_DECL tvec4 operator>>(tvec4 const & v, tvec1 const & scalar); template GLM_FUNC_DECL tvec4 operator>>(T scalar, tvec4 const & v); template - GLM_FUNC_DECL tvec4 operator>>(tvec1 const & s, tvec4 const & v); + GLM_FUNC_DECL tvec4 operator>>(tvec1 const & scalar, tvec4 const & v); template GLM_FUNC_DECL tvec4 operator>>(tvec4 const & v1, tvec4 const & v2); template GLM_FUNC_DECL tvec4 operator~(tvec4 const & v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tvec4 const & v1, tvec4 const & v2); + + template + GLM_FUNC_DECL bool operator!=(tvec4 const & v1, tvec4 const & v2); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/external/glm/glm/detail/type_vec4.inl b/external/glm/glm/detail/type_vec4.inl index fbdf51fc5..8e215d001 100644 --- a/external/glm/glm/detail/type_vec4.inl +++ b/external/glm/glm/detail/type_vec4.inl @@ -32,20 +32,23 @@ namespace glm { - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - template - GLM_FUNC_QUALIFIER tvec4::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0), y(0), z(0), w(0) -# endif - {} - - template - GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) - : x(v.x), y(v.y), z(v.z), w(v.w) - {} +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tvec4::tvec4() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0), y(0), z(0), w(0) +# endif + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS + +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) + : x(v.x), y(v.y), z(v.z), w(v.w) + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -53,16 +56,15 @@ namespace glm : x(v.x), y(v.y), z(v.z), w(v.w) {} - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- template GLM_FUNC_QUALIFIER tvec4::tvec4(ctor) {} template - GLM_FUNC_QUALIFIER tvec4::tvec4(T s) - : x(s), y(s), z(s), w(s) + GLM_FUNC_QUALIFIER tvec4::tvec4(T scalar) + : x(scalar), y(scalar), z(scalar), w(scalar) {} template @@ -70,8 +72,7 @@ namespace glm : x(a), y(b), z(c), w(d) {} - ////////////////////////////////////// - // Conversion scalar constructors + // -- Conversion scalar constructors -- template template @@ -91,8 +92,7 @@ namespace glm w(static_cast(d.x)) {} - ////////////////////////////////////// - // Conversion vector constructors + // -- Conversion vector constructors -- template template @@ -202,8 +202,7 @@ namespace glm w(static_cast(v.w)) {} - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -247,18 +246,19 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Unary arithmetic operators + // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator=(tvec4 const & v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - this->w = v.w; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator=(tvec4 const & v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + this->w = v.w; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -341,12 +341,12 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator*=(U s) + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator*=(U v) { - this->x *= static_cast(s); - this->y *= static_cast(s); - this->z *= static_cast(s); - this->w *= static_cast(s); + this->x *= static_cast(v); + this->y *= static_cast(v); + this->z *= static_cast(v); + this->w *= static_cast(v); return *this; } @@ -374,12 +374,12 @@ namespace glm template template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator/=(U s) + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator/=(U v) { - this->x /= static_cast(s); - this->y /= static_cast(s); - this->z /= static_cast(s); - this->w /= static_cast(s); + this->x /= static_cast(v); + this->y /= static_cast(v); + this->z /= static_cast(v); + this->w /= static_cast(v); return *this; } @@ -405,8 +405,7 @@ namespace glm return *this; } - ////////////////////////////////////// - // Increment and decrement operators + // -- Increment and decrement operators -- template GLM_FUNC_QUALIFIER tvec4 & tvec4::operator++() @@ -444,8 +443,7 @@ namespace glm return Result; } - ////////////////////////////////////// - // Unary bit operators + // -- Unary bit operators -- template template @@ -645,25 +643,27 @@ namespace glm return *this; } - ////////////////////////////////////// - // Boolean operators + // -- Unary constant operators -- template - GLM_FUNC_QUALIFIER bool operator==(tvec4 const & v1, tvec4 const & v2) + GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v) { - return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z) && (v1.w == v2.w); + return v; } template - GLM_FUNC_QUALIFIER bool operator!=(tvec4 const & v1, tvec4 const & v2) + GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v) { - return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z) || (v1.w != v2.w); + return tvec4( + -v.x, + -v.y, + -v.z, + -v.w); } - ////////////////////////////////////// - // Binary arithmetic operators + // -- Binary arithmetic operators -- - template + template GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v, T scalar) { return tvec4( @@ -673,7 +673,7 @@ namespace glm v.w + scalar); } - template + template GLM_FUNC_QUALIFIER tvec4 operator+(T scalar, tvec4 const & v) { return tvec4( @@ -683,7 +683,7 @@ namespace glm scalar + v.w); } - template + template GLM_FUNC_QUALIFIER tvec4 operator+(tvec4 const & v1, tvec4 const & v2) { return tvec4( @@ -693,8 +693,7 @@ namespace glm v1.w + v2.w); } - //operator- - template + template GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v, T scalar) { return tvec4( @@ -704,7 +703,7 @@ namespace glm v.w - scalar); } - template + template GLM_FUNC_QUALIFIER tvec4 operator-(T scalar, tvec4 const & v) { return tvec4( @@ -714,7 +713,7 @@ namespace glm scalar - v.w); } - template + template GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v1, tvec4 const & v2) { return tvec4( @@ -724,8 +723,7 @@ namespace glm v1.w - v2.w); } - //operator* - template + template GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v, T scalar) { return tvec4( @@ -735,7 +733,7 @@ namespace glm v.w * scalar); } - template + template GLM_FUNC_QUALIFIER tvec4 operator*(T scalar, tvec4 const & v) { return tvec4( @@ -745,7 +743,7 @@ namespace glm scalar * v.w); } - template + template GLM_FUNC_QUALIFIER tvec4 operator*(tvec4 const & v1, tvec4 const & v2) { return tvec4( @@ -755,8 +753,7 @@ namespace glm v1.w * v2.w); } - //operator/ - template + template GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v, T scalar) { return tvec4( @@ -766,7 +763,7 @@ namespace glm v.w / scalar); } - template + template GLM_FUNC_QUALIFIER tvec4 operator/(T scalar, tvec4 const & v) { return tvec4( @@ -776,7 +773,7 @@ namespace glm scalar / v.w); } - template + template GLM_FUNC_QUALIFIER tvec4 operator/(tvec4 const & v1, tvec4 const & v2) { return tvec4( @@ -786,58 +783,46 @@ namespace glm v1.w / v2.w); } - // Unary constant operators - template - GLM_FUNC_QUALIFIER tvec4 operator-(tvec4 const & v) - { - return tvec4( - -v.x, - -v.y, - -v.z, - -v.w); - } - - ////////////////////////////////////// - // Binary bit operators + // -- Binary bit operators -- template - GLM_FUNC_QUALIFIER tvec4 operator%(tvec4 const & v, T s) + GLM_FUNC_QUALIFIER tvec4 operator%(tvec4 const & v, T scalar) { return tvec4( - v.x % s, - v.y % s, - v.z % s, - v.w % s); + v.x % scalar, + v.y % scalar, + v.z % scalar, + v.w % scalar); } template - GLM_FUNC_QUALIFIER tvec4 operator%(tvec4 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec4 operator%(tvec4 const & v, tvec1 const & scalar) { return tvec4( - v.x % s.x, - v.y % s.x, - v.z % s.x, - v.w % s.x); + v.x % scalar.x, + v.y % scalar.x, + v.z % scalar.x, + v.w % scalar.x); } template - GLM_FUNC_QUALIFIER tvec4 operator%(T s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator%(T scalar, tvec4 const & v) { return tvec4( - s % v.x, - s % v.y, - s % v.z, - s % v.w); + scalar % v.x, + scalar % v.y, + scalar % v.z, + scalar % v.w); } template - GLM_FUNC_QUALIFIER tvec4 operator%(tvec1 const & s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator%(tvec1 const & scalar, tvec4 const & v) { return tvec4( - s.x % v.x, - s.x % v.y, - s.x % v.z, - s.x % v.w); + scalar.x % v.x, + scalar.x % v.y, + scalar.x % v.z, + scalar.x % v.w); } template @@ -851,43 +836,43 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator&(tvec4 const & v, T s) + GLM_FUNC_QUALIFIER tvec4 operator&(tvec4 const & v, T scalar) { return tvec4( - v.x & s, - v.y & s, - v.z & s, - v.w & s); + v.x & scalar, + v.y & scalar, + v.z & scalar, + v.w & scalar); } template - GLM_FUNC_QUALIFIER tvec4 operator&(tvec4 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec4 operator&(tvec4 const & v, tvec1 const & scalar) { return tvec4( - v.x & s.x, - v.y & s.x, - v.z & s.x, - v.w & s.x); + v.x & scalar.x, + v.y & scalar.x, + v.z & scalar.x, + v.w & scalar.x); } template - GLM_FUNC_QUALIFIER tvec4 operator&(T s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator&(T scalar, tvec4 const & v) { return tvec4( - s & v.x, - s & v.y, - s & v.z, - s & v.w); + scalar & v.x, + scalar & v.y, + scalar & v.z, + scalar & v.w); } template - GLM_FUNC_QUALIFIER tvec4 operator&(tvec1 const & s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator&(tvec1 const & scalar, tvec4 const & v) { return tvec4( - s.x & v.x, - s.x & v.y, - s.x & v.z, - s.x & v.w); + scalar.x & v.x, + scalar.x & v.y, + scalar.x & v.z, + scalar.x & v.w); } template @@ -901,43 +886,43 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator|(tvec4 const & v, T s) + GLM_FUNC_QUALIFIER tvec4 operator|(tvec4 const & v, T scalar) { return tvec4( - v.x | s, - v.y | s, - v.z | s, - v.w | s); + v.x | scalar, + v.y | scalar, + v.z | scalar, + v.w | scalar); } template - GLM_FUNC_QUALIFIER tvec4 operator|(tvec4 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec4 operator|(tvec4 const & v, tvec1 const & scalar) { return tvec4( - v.x | s.x, - v.y | s.x, - v.z | s.x, - v.w | s.x); + v.x | scalar.x, + v.y | scalar.x, + v.z | scalar.x, + v.w | scalar.x); } template - GLM_FUNC_QUALIFIER tvec4 operator|(T s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator|(T scalar, tvec4 const & v) { return tvec4( - s | v.x, - s | v.y, - s | v.z, - s | v.w); + scalar | v.x, + scalar | v.y, + scalar | v.z, + scalar | v.w); } template - GLM_FUNC_QUALIFIER tvec4 operator|(tvec1 const & s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator|(tvec1 const & scalar, tvec4 const & v) { return tvec4( - s.x | v.x, - s.x | v.y, - s.x | v.z, - s.x | v.w); + scalar.x | v.x, + scalar.x | v.y, + scalar.x | v.z, + scalar.x | v.w); } template @@ -951,23 +936,23 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator^(tvec4 const & v, T s) + GLM_FUNC_QUALIFIER tvec4 operator^(tvec4 const & v, T scalar) { return tvec4( - v.x ^ s, - v.y ^ s, - v.z ^ s, - v.w ^ s); + v.x ^ scalar, + v.y ^ scalar, + v.z ^ scalar, + v.w ^ scalar); } template - GLM_FUNC_QUALIFIER tvec4 operator^(tvec4 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec4 operator^(tvec4 const & v, tvec1 const & scalar) { return tvec4( - v.x ^ s.x, - v.y ^ s.x, - v.z ^ s.x, - v.w ^ s.x); + v.x ^ scalar.x, + v.y ^ scalar.x, + v.z ^ scalar.x, + v.w ^ scalar.x); } template @@ -981,13 +966,13 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator^(tvec1 const & s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator^(tvec1 const & scalar, tvec4 const & v) { return tvec4( - s.x ^ v.x, - s.x ^ v.y, - s.x ^ v.z, - s.x ^ v.w); + scalar.x ^ v.x, + scalar.x ^ v.y, + scalar.x ^ v.z, + scalar.x ^ v.w); } template @@ -1011,13 +996,13 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator<<(tvec4 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec4 operator<<(tvec4 const & v, tvec1 const & scalar) { return tvec4( - v.x << s.x, - v.y << s.x, - v.z << s.x, - v.w << s.x); + v.x << scalar.x, + v.y << scalar.x, + v.z << scalar.x, + v.w << scalar.x); } template @@ -1031,13 +1016,13 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator<<(tvec1 const & s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator<<(tvec1 const & scalar, tvec4 const & v) { return tvec4( - s.x << v.x, - s.x << v.y, - s.x << v.z, - s.x << v.w); + scalar.x << v.x, + scalar.x << v.y, + scalar.x << v.z, + scalar.x << v.w); } template @@ -1061,13 +1046,13 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator>>(tvec4 const & v, tvec1 const & s) + GLM_FUNC_QUALIFIER tvec4 operator>>(tvec4 const & v, tvec1 const & scalar) { return tvec4( - v.x >> s.x, - v.y >> s.x, - v.z >> s.x, - v.w >> s.x); + v.x >> scalar.x, + v.y >> scalar.x, + v.z >> scalar.x, + v.w >> scalar.x); } template @@ -1081,13 +1066,13 @@ namespace glm } template - GLM_FUNC_QUALIFIER tvec4 operator>>(tvec1 const & s, tvec4 const & v) + GLM_FUNC_QUALIFIER tvec4 operator>>(tvec1 const & scalar, tvec4 const & v) { return tvec4( - s.x >> v.x, - s.x >> v.y, - s.x >> v.z, - s.x >> v.w); + scalar.x >> v.x, + scalar.x >> v.y, + scalar.x >> v.z, + scalar.x >> v.w); } template @@ -1109,6 +1094,20 @@ namespace glm ~v.z, ~v.w); } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(tvec4 const & v1, tvec4 const & v2) + { + return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z) && (v1.w == v2.w); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(tvec4 const & v1, tvec4 const & v2) + { + return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z) || (v1.w != v2.w); + } }//namespace glm #if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS diff --git a/external/glm/glm/detail/type_vec4_sse2.inl b/external/glm/glm/detail/type_vec4_sse2.inl index 002446f29..968e9fedd 100644 --- a/external/glm/glm/detail/type_vec4_sse2.inl +++ b/external/glm/glm/detail/type_vec4_sse2.inl @@ -31,64 +31,29 @@ /////////////////////////////////////////////////////////////////////////////////// namespace glm{ -namespace detail -{ -}//namespace detail +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template <> + GLM_FUNC_QUALIFIER tvec4::tvec4() +# ifndef GLM_FORCE_NO_CTOR_INIT + : data(_mm_setzero_ps()) +# endif + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template <> - GLM_FUNC_QUALIFIER tvec4::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : data(_mm_setzero_ps()) -# endif - {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : data(_mm_setzero_ps()) -# endif - {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : - data(_mm_set1_ps(s)) - {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : + GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : data(_mm_set1_ps(s)) {} template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float a, float b, float c, float d) : + GLM_FUNC_QUALIFIER tvec4::tvec4(float a, float b, float c, float d) : data(_mm_set_ps(d, c, b, a)) {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float a, float b, float c, float d) : - data(_mm_set_ps(d, c, b, a)) - {} - - template <> - template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(U scalar) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(scalar))); - return *this; - } - - template <> - template <> - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(float scalar) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar)); - return *this; - } template <> template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(U scalar) + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(U scalar) { this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(scalar))); return *this; @@ -96,7 +61,7 @@ namespace detail template <> template <> - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(float scalar) + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(float scalar) { this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar)); return *this; @@ -104,15 +69,7 @@ namespace detail template <> template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec1 const & v) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(v.x))); - return *this; - } - - template <> - template - GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec1 const & v) + GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec1 const & v) { this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(v.x))); return *this; diff --git a/external/glm/glm/fwd.hpp b/external/glm/glm/fwd.hpp index 742474caf..eacb73f36 100644 --- a/external/glm/glm/fwd.hpp +++ b/external/glm/glm/fwd.hpp @@ -124,9 +124,6 @@ namespace glm // GLM_GTC_precision namespace glm { - /// @addtogroup gtc_type_precision - /// @{ - /// Low precision 8 bit signed integer type. /// @see gtc_type_precision typedef detail::int8 lowp_int8; @@ -1547,15 +1544,15 @@ namespace glm typedef tvec1 lowp_vec1; /// Low single-precision floating-point vector of 2 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec2 lowp_vec2; /// Low single-precision floating-point vector of 3 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec3 lowp_vec3; /// Low single-precision floating-point vector of 4 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec4 lowp_vec4; /// Low single-precision floating-point vector of 1 component. @@ -1580,15 +1577,15 @@ namespace glm typedef tvec1 mediump_vec1; /// Medium Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec2 mediump_vec2; /// Medium Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec3 mediump_vec3; /// Medium Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec4 mediump_vec4; /// Medium single-precision floating-point vector of 1 component. @@ -1613,15 +1610,15 @@ namespace glm typedef tvec1 highp_vec1; /// High Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec2 highp_vec2; /// High Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec3 highp_vec3; /// High Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec4 highp_vec4; /// High single-precision floating-point vector of 1 component. @@ -1629,15 +1626,15 @@ namespace glm typedef tvec1 highp_fvec1; /// High Single-precision floating-point vector of 2 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec2 highp_fvec2; /// High Single-precision floating-point vector of 3 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec3 highp_fvec3; /// High Single-precision floating-point vector of 4 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec4 highp_fvec4; @@ -1646,15 +1643,15 @@ namespace glm typedef tvec1 lowp_f32vec1; /// Low single-precision floating-point vector of 2 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec2 lowp_f32vec2; /// Low single-precision floating-point vector of 3 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec3 lowp_f32vec3; /// Low single-precision floating-point vector of 4 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec4 lowp_f32vec4; /// Medium single-precision floating-point vector of 1 component. @@ -1662,15 +1659,15 @@ namespace glm typedef tvec1 mediump_f32vec1; /// Medium single-precision floating-point vector of 2 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec2 mediump_f32vec2; /// Medium single-precision floating-point vector of 3 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec3 mediump_f32vec3; /// Medium single-precision floating-point vector of 4 components. - /// @see gtc_type_precision + /// @see core_precision typedef tvec4 mediump_f32vec4; /// High single-precision floating-point vector of 1 component. @@ -2598,4 +2595,5 @@ namespace glm /// @see gtc_type_precision typedef highp_f64quat f64quat; #endif + }//namespace glm diff --git a/external/glm/glm/gtc/bitfield.inl b/external/glm/glm/gtc/bitfield.inl index 117026271..a9eeb2eb8 100644 --- a/external/glm/glm/gtc/bitfield.inl +++ b/external/glm/glm/gtc/bitfield.inl @@ -138,25 +138,25 @@ namespace detail glm::uint64 REG2(y); glm::uint64 REG3(z); - REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFF); - REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFF); - REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFF); + REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFFull); + REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFFull); + REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFFull); - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FF); - REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FF); + REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FFull); + REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FFull); + REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FFull); - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00F); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00F); - REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00F); + REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00Full); + REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00Full); + REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00Full); - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3); - REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3); + REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3ull); + REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3ull); + REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3ull); - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249); - REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249); + REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249ull); + REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249ull); + REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249ull); return REG1 | (REG2 << 1) | (REG3 << 2); } @@ -168,25 +168,25 @@ namespace detail glm::uint64 REG2(y); glm::uint64 REG3(z); - REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFF); - REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFF); - REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFF); + REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFFull); + REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFFull); + REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFFull); - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FF); - REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FF); + REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FFull); + REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FFull); + REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FFull); - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00F); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00F); - REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00F); + REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00Full); + REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00Full); + REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00Full); - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3); - REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3); + REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3ull); + REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3ull); + REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3ull); - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249); - REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249); + REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249ull); + REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249ull); + REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249ull); return REG1 | (REG2 << 1) | (REG3 << 2); } @@ -225,25 +225,25 @@ namespace detail glm::uint64 REG3(z); glm::uint64 REG4(w); - REG1 = ((REG1 << 24) | REG1) & glm::uint64(0x000000FF000000FF); - REG2 = ((REG2 << 24) | REG2) & glm::uint64(0x000000FF000000FF); - REG3 = ((REG3 << 24) | REG3) & glm::uint64(0x000000FF000000FF); - REG4 = ((REG4 << 24) | REG4) & glm::uint64(0x000000FF000000FF); - - REG1 = ((REG1 << 12) | REG1) & glm::uint64(0x000F000F000F000F); - REG2 = ((REG2 << 12) | REG2) & glm::uint64(0x000F000F000F000F); - REG3 = ((REG3 << 12) | REG3) & glm::uint64(0x000F000F000F000F); - REG4 = ((REG4 << 12) | REG4) & glm::uint64(0x000F000F000F000F); - - REG1 = ((REG1 << 6) | REG1) & glm::uint64(0x0303030303030303); - REG2 = ((REG2 << 6) | REG2) & glm::uint64(0x0303030303030303); - REG3 = ((REG3 << 6) | REG3) & glm::uint64(0x0303030303030303); - REG4 = ((REG4 << 6) | REG4) & glm::uint64(0x0303030303030303); - - REG1 = ((REG1 << 3) | REG1) & glm::uint64(0x1111111111111111); - REG2 = ((REG2 << 3) | REG2) & glm::uint64(0x1111111111111111); - REG3 = ((REG3 << 3) | REG3) & glm::uint64(0x1111111111111111); - REG4 = ((REG4 << 3) | REG4) & glm::uint64(0x1111111111111111); + REG1 = ((REG1 << 24) | REG1) & glm::uint64(0x000000FF000000FFull); + REG2 = ((REG2 << 24) | REG2) & glm::uint64(0x000000FF000000FFull); + REG3 = ((REG3 << 24) | REG3) & glm::uint64(0x000000FF000000FFull); + REG4 = ((REG4 << 24) | REG4) & glm::uint64(0x000000FF000000FFull); + + REG1 = ((REG1 << 12) | REG1) & glm::uint64(0x000F000F000F000Full); + REG2 = ((REG2 << 12) | REG2) & glm::uint64(0x000F000F000F000Full); + REG3 = ((REG3 << 12) | REG3) & glm::uint64(0x000F000F000F000Full); + REG4 = ((REG4 << 12) | REG4) & glm::uint64(0x000F000F000F000Full); + + REG1 = ((REG1 << 6) | REG1) & glm::uint64(0x0303030303030303ull); + REG2 = ((REG2 << 6) | REG2) & glm::uint64(0x0303030303030303ull); + REG3 = ((REG3 << 6) | REG3) & glm::uint64(0x0303030303030303ull); + REG4 = ((REG4 << 6) | REG4) & glm::uint64(0x0303030303030303ull); + + REG1 = ((REG1 << 3) | REG1) & glm::uint64(0x1111111111111111ull); + REG2 = ((REG2 << 3) | REG2) & glm::uint64(0x1111111111111111ull); + REG3 = ((REG3 << 3) | REG3) & glm::uint64(0x1111111111111111ull); + REG4 = ((REG4 << 3) | REG4) & glm::uint64(0x1111111111111111ull); return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); } diff --git a/external/glm/glm/gtc/color.hpp b/external/glm/glm/gtc/color_space.hpp similarity index 71% rename from external/glm/glm/gtc/color.hpp rename to external/glm/glm/gtc/color_space.hpp index e685cf4f5..8a35a4e63 100644 --- a/external/glm/glm/gtc/color.hpp +++ b/external/glm/glm/gtc/color_space.hpp @@ -24,15 +24,15 @@ /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// -/// @ref gtc_color -/// @file glm/gtc/color.hpp -/// @date 2015-02-10 / 2015-02-10 +/// @ref gtc_color_space +/// @file glm/gtc/color_space.hpp +/// @date 2015-02-10 / 2015-08-02 /// @author Christophe Riccio /// /// @see core (dependence) -/// @see gtc_color (dependence) +/// @see gtc_color_space (dependence) /// -/// @defgroup gtc_color GLM_GTC_color +/// @defgroup gtc_color_space GLM_GTC_color_space /// @ingroup gtc /// /// @brief Allow to perform bit operations on integer values @@ -51,31 +51,31 @@ #include #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) -# pragma message("GLM: GLM_GTC_color extension included") +# pragma message("GLM: GLM_GTC_color_space extension included") #endif namespace glm { - /// @addtogroup gtc_color + /// @addtogroup gtc_color_space /// @{ - /// Convert a RGB color to sRGB color using a standard gamma correction + /// Convert a linear color to sRGB color using a standard gamma correction template class vecType> - GLM_FUNC_DECL vecType convertRgbToSrgb(vecType const & ColorRGB); + GLM_FUNC_DECL vecType convertLinearToSRGB(vecType const & ColorLinear); - /// Convert a RGB color to sRGB color using a custom gamma correction + /// Convert a linear color to sRGB color using a custom gamma correction template class vecType> - GLM_FUNC_DECL vecType convertRgbToSrgb(vecType const & ColorRGB, T Gamma); + GLM_FUNC_DECL vecType convertLinearToSRGB(vecType const & ColorLinear, T Gamma); - /// Convert a sRGB color to RGB color using a standard gamma correction + /// Convert a sRGB color to linear color using a standard gamma correction template class vecType> - GLM_FUNC_DECL vecType convertSrgbToRgb(vecType const & ColorSRGB); + GLM_FUNC_DECL vecType convertSRGBToLinear(vecType const & ColorSRGB); - /// Convert a sRGB color to RGB color using a custom gamma correction + /// Convert a sRGB color to linear color using a custom gamma correction template class vecType> - GLM_FUNC_DECL vecType convertSrgbToRgb(vecType const & ColorSRGB, T Gamma); + GLM_FUNC_DECL vecType convertSRGBToLinear(vecType const & ColorSRGB, T Gamma); /// @} } //namespace glm -#include "color.inl" +#include "color_space.inl" diff --git a/external/glm/glm/gtc/color.inl b/external/glm/glm/gtc/color_space.inl similarity index 85% rename from external/glm/glm/gtc/color.inl rename to external/glm/glm/gtc/color_space.inl index 8d127fa10..3561045d9 100644 --- a/external/glm/glm/gtc/color.inl +++ b/external/glm/glm/gtc/color_space.inl @@ -24,9 +24,9 @@ /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN /// THE SOFTWARE. /// -/// @ref gtc_color -/// @file glm/gtc/color.inl -/// @date 2015-02-10 / 2015-02-10 +/// @ref gtc_color_space +/// @file glm/gtc/color_space.inl +/// @date 2015-02-10 / 2015-08-02 /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -79,25 +79,25 @@ namespace detail }//namespace detail template class vecType> - GLM_FUNC_QUALIFIER vecType convertRgbToSrgb(vecType const & ColorRGB) + GLM_FUNC_QUALIFIER vecType convertLinearToSRGB(vecType const & ColorLinear) { - return detail::compute_rgbToSrgb::call(ColorRGB, static_cast(0.41666)); + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(0.41666)); } template class vecType> - GLM_FUNC_QUALIFIER vecType convertRgbToSrgb(vecType const & ColorRGB, T Gamma) + GLM_FUNC_QUALIFIER vecType convertLinearToSRGB(vecType const & ColorLinear, T Gamma) { - return detail::compute_rgbToSrgb::call(ColorRGB, static_cast(1) / Gamma); + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(1) / Gamma); } template class vecType> - GLM_FUNC_QUALIFIER vecType convertSrgbToRgb(vecType const & ColorSRGB) + GLM_FUNC_QUALIFIER vecType convertSRGBToLinear(vecType const & ColorSRGB) { return detail::compute_srgbToRgb::call(ColorSRGB, static_cast(2.4)); } template class vecType> - GLM_FUNC_QUALIFIER vecType convertSrgbToRgb(vecType const & ColorSRGB, T Gamma) + GLM_FUNC_QUALIFIER vecType convertSRGBToLinear(vecType const & ColorSRGB, T Gamma) { return detail::compute_srgbToRgb::call(ColorSRGB, Gamma); } diff --git a/external/glm/glm/gtc/constants.hpp b/external/glm/glm/gtc/constants.hpp index ae1fb6224..786467ada 100644 --- a/external/glm/glm/gtc/constants.hpp +++ b/external/glm/glm/gtc/constants.hpp @@ -57,147 +57,147 @@ namespace glm /// Return the epsilon constant for floating point types. /// @see gtc_constants template - GLM_FUNC_DECL genType epsilon(); + GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); /// Return 0. /// @see gtc_constants template - GLM_FUNC_DECL genType zero(); + GLM_FUNC_DECL GLM_CONSTEXPR genType zero(); /// Return 1. /// @see gtc_constants template - GLM_FUNC_DECL genType one(); + GLM_FUNC_DECL GLM_CONSTEXPR genType one(); /// Return the pi constant. /// @see gtc_constants template - GLM_FUNC_DECL genType pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); /// Return pi * 2. /// @see gtc_constants template - GLM_FUNC_DECL genType two_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); /// Return square root of pi. /// @see gtc_constants template - GLM_FUNC_DECL genType root_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi(); /// Return pi / 2. /// @see gtc_constants template - GLM_FUNC_DECL genType half_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi(); /// Return pi / 2 * 3. /// @see gtc_constants template - GLM_FUNC_DECL genType three_over_two_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi(); /// Return pi / 4. /// @see gtc_constants template - GLM_FUNC_DECL genType quarter_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi(); /// Return 1 / pi. /// @see gtc_constants template - GLM_FUNC_DECL genType one_over_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi(); /// Return 1 / (pi * 2). /// @see gtc_constants template - GLM_FUNC_DECL genType one_over_two_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi(); /// Return 2 / pi. /// @see gtc_constants template - GLM_FUNC_DECL genType two_over_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi(); /// Return 4 / pi. /// @see gtc_constants template - GLM_FUNC_DECL genType four_over_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi(); /// Return 2 / sqrt(pi). /// @see gtc_constants template - GLM_FUNC_DECL genType two_over_root_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi(); /// Return 1 / sqrt(2). /// @see gtc_constants template - GLM_FUNC_DECL genType one_over_root_two(); + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two(); /// Return sqrt(pi / 2). /// @see gtc_constants template - GLM_FUNC_DECL genType root_half_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi(); /// Return sqrt(2 * pi). /// @see gtc_constants template - GLM_FUNC_DECL genType root_two_pi(); + GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi(); /// Return sqrt(ln(4)). /// @see gtc_constants template - GLM_FUNC_DECL genType root_ln_four(); + GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four(); /// Return e constant. /// @see gtc_constants template - GLM_FUNC_DECL genType e(); + GLM_FUNC_DECL GLM_CONSTEXPR genType e(); /// Return Euler's constant. /// @see gtc_constants template - GLM_FUNC_DECL genType euler(); + GLM_FUNC_DECL GLM_CONSTEXPR genType euler(); /// Return sqrt(2). /// @see gtc_constants template - GLM_FUNC_DECL genType root_two(); + GLM_FUNC_DECL GLM_CONSTEXPR genType root_two(); /// Return sqrt(3). /// @see gtc_constants template - GLM_FUNC_DECL genType root_three(); + GLM_FUNC_DECL GLM_CONSTEXPR genType root_three(); /// Return sqrt(5). /// @see gtc_constants template - GLM_FUNC_DECL genType root_five(); + GLM_FUNC_DECL GLM_CONSTEXPR genType root_five(); /// Return ln(2). /// @see gtc_constants template - GLM_FUNC_DECL genType ln_two(); + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two(); /// Return ln(10). /// @see gtc_constants template - GLM_FUNC_DECL genType ln_ten(); + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten(); /// Return ln(ln(2)). /// @see gtc_constants template - GLM_FUNC_DECL genType ln_ln_two(); + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two(); /// Return 1 / 3. /// @see gtc_constants template - GLM_FUNC_DECL genType third(); + GLM_FUNC_DECL GLM_CONSTEXPR genType third(); /// Return 2 / 3. /// @see gtc_constants template - GLM_FUNC_DECL genType two_thirds(); + GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds(); /// Return the golden ratio constant. /// @see gtc_constants template - GLM_FUNC_DECL genType golden_ratio(); + GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio(); /// @} } //namespace glm diff --git a/external/glm/glm/gtc/constants.inl b/external/glm/glm/gtc/constants.inl index a5de153b1..8214f6063 100644 --- a/external/glm/glm/gtc/constants.inl +++ b/external/glm/glm/gtc/constants.inl @@ -35,175 +35,175 @@ namespace glm { template - GLM_FUNC_QUALIFIER genType epsilon() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() { return std::numeric_limits::epsilon(); } template - GLM_FUNC_QUALIFIER genType zero() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero() { return genType(0); } template - GLM_FUNC_QUALIFIER genType one() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one() { return genType(1); } template - GLM_FUNC_QUALIFIER genType pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() { return genType(3.14159265358979323846264338327950288); } template - GLM_FUNC_QUALIFIER genType two_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() { return genType(6.28318530717958647692528676655900576); } template - GLM_FUNC_QUALIFIER genType root_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() { return genType(1.772453850905516027); } template - GLM_FUNC_QUALIFIER genType half_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType half_pi() { return genType(1.57079632679489661923132169163975144); } template - GLM_FUNC_QUALIFIER genType three_over_two_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi() { return genType(4.71238898038468985769396507491925432); } template - GLM_FUNC_QUALIFIER genType quarter_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType quarter_pi() { return genType(0.785398163397448309615660845819875721); } template - GLM_FUNC_QUALIFIER genType one_over_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_pi() { return genType(0.318309886183790671537767526745028724); } template - GLM_FUNC_QUALIFIER genType one_over_two_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_two_pi() { return genType(0.159154943091895335768883763372514362); } template - GLM_FUNC_QUALIFIER genType two_over_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_pi() { return genType(0.636619772367581343075535053490057448); } template - GLM_FUNC_QUALIFIER genType four_over_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType four_over_pi() { return genType(1.273239544735162686151070106980114898); } template - GLM_FUNC_QUALIFIER genType two_over_root_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_root_pi() { return genType(1.12837916709551257389615890312154517); } template - GLM_FUNC_QUALIFIER genType one_over_root_two() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two() { return genType(0.707106781186547524400844362104849039); } template - GLM_FUNC_QUALIFIER genType root_half_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi() { return genType(1.253314137315500251); } template - GLM_FUNC_QUALIFIER genType root_two_pi() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi() { return genType(2.506628274631000502); } template - GLM_FUNC_QUALIFIER genType root_ln_four() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four() { return genType(1.17741002251547469); } template - GLM_FUNC_QUALIFIER genType e() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e() { return genType(2.71828182845904523536); } template - GLM_FUNC_QUALIFIER genType euler() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler() { return genType(0.577215664901532860606); } template - GLM_FUNC_QUALIFIER genType root_two() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two() { return genType(1.41421356237309504880168872420969808); } template - GLM_FUNC_QUALIFIER genType root_three() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three() { return genType(1.73205080756887729352744634150587236); } template - GLM_FUNC_QUALIFIER genType root_five() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five() { return genType(2.23606797749978969640917366873127623); } template - GLM_FUNC_QUALIFIER genType ln_two() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two() { return genType(0.693147180559945309417232121458176568); } template - GLM_FUNC_QUALIFIER genType ln_ten() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten() { return genType(2.30258509299404568401799145468436421); } template - GLM_FUNC_QUALIFIER genType ln_ln_two() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two() { return genType(-0.3665129205816643); } template - GLM_FUNC_QUALIFIER genType third() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third() { return genType(0.3333333333333333333333333333333333333333); } template - GLM_FUNC_QUALIFIER genType two_thirds() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds() { return genType(0.666666666666666666666666666666666666667); } template - GLM_FUNC_QUALIFIER genType golden_ratio() + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio() { return genType(1.61803398874989484820458683436563811); } diff --git a/external/glm/glm/gtc/matrix_inverse.inl b/external/glm/glm/gtc/matrix_inverse.inl index d88a33198..d2437d5de 100644 --- a/external/glm/glm/gtc/matrix_inverse.inl +++ b/external/glm/glm/gtc/matrix_inverse.inl @@ -35,23 +35,24 @@ namespace glm template GLM_FUNC_QUALIFIER tmat3x3 affineInverse(tmat3x3 const & m) { - tmat3x3 Result(m); - Result[2] = tvec3(0, 0, 1); - Result = transpose(Result); - tvec3 Translation = Result * tvec3(-tvec2(m[2]), m[2][2]); - Result[2] = Translation; - return Result; + tmat2x2 const Inv(inverse(tmat2x2(m))); + + return tmat3x3( + tvec3(Inv[0], static_cast(0)), + tvec3(Inv[1], static_cast(0)), + tvec3(-Inv * tvec2(m[2]), static_cast(1))); } template GLM_FUNC_QUALIFIER tmat4x4 affineInverse(tmat4x4 const & m) { - tmat4x4 Result(m); - Result[3] = tvec4(0, 0, 0, 1); - Result = transpose(Result); - tvec4 Translation = Result * tvec4(-tvec3(m[3]), m[3][3]); - Result[3] = Translation; - return Result; + tmat3x3 const Inv(inverse(tmat3x3(m))); + + return tmat4x4( + tvec4(Inv[0], static_cast(0)), + tvec4(Inv[1], static_cast(0)), + tvec4(Inv[2], static_cast(0)), + tvec4(-Inv * tvec3(m[3]), static_cast(1))); } template diff --git a/external/glm/glm/gtc/matrix_transform.hpp b/external/glm/glm/gtc/matrix_transform.hpp index e70e6a81a..b9f8098ca 100644 --- a/external/glm/glm/gtc/matrix_transform.hpp +++ b/external/glm/glm/gtc/matrix_transform.hpp @@ -92,7 +92,7 @@ namespace glm /// /// @param m Input matrix multiplied by this rotation matrix. /// @param angle Rotation angle expressed in radians. - /// @param axis Rotation axis, recommanded to be normalized. + /// @param axis Rotation axis, recommended to be normalized. /// @tparam T Value type used to build the matrix. Supported: half, float or double. /// @see gtc_matrix_transform /// @see - rotate(tmat4x4 const & m, T angle, T x, T y, T z) @@ -173,7 +173,7 @@ namespace glm /// Creates a matrix for a symetric perspective-view frustum based on the default handedness. /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param fovy Specifies the field of view angle in the y direction. Expressed in radians. /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). @@ -186,7 +186,6 @@ namespace glm T near, T far); - /// Creates a matrix for a right handed, symetric perspective-view frustum. /// /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. diff --git a/external/glm/glm/gtc/packing.inl b/external/glm/glm/gtc/packing.inl index 58b1d59b9..6f351a8f5 100644 --- a/external/glm/glm/gtc/packing.inl +++ b/external/glm/glm/gtc/packing.inl @@ -451,24 +451,23 @@ namespace detail GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const & v) { - detail::i10i10i10i2 Result; - Result.data.x = int(round(clamp(v.x, 0.0f, 1.0f) * 1023.f)); - Result.data.y = int(round(clamp(v.y, 0.0f, 1.0f) * 1023.f)); - Result.data.z = int(round(clamp(v.z, 0.0f, 1.0f) * 1023.f)); - Result.data.w = int(round(clamp(v.w, 0.0f, 1.0f) * 3.f)); + uvec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(1023.f, 1023.f, 1023.f, 3.f))); + + detail::u10u10u10u2 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + Result.data.w = Unpack.w; return Result.pack; } GLM_FUNC_QUALIFIER vec4 unpackUnorm3x10_1x2(uint32 v) { - detail::i10i10i10i2 Unpack; + vec4 const ScaleFactors(1.0f / 1023.f, 1.0f / 1023.f, 1.0f / 1023.f, 1.0f / 3.f); + + detail::u10u10u10u2 Unpack; Unpack.pack = v; - vec4 Result; - Result.x = float(Unpack.data.x) / 1023.f; - Result.y = float(Unpack.data.y) / 1023.f; - Result.z = float(Unpack.data.z) / 1023.f; - Result.w = float(Unpack.data.w) / 3.f; - return Result; + return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactors; } GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const & v) diff --git a/external/glm/glm/gtc/quaternion.hpp b/external/glm/glm/gtc/quaternion.hpp index 812b5b000..6fae5cc6d 100644 --- a/external/glm/glm/gtc/quaternion.hpp +++ b/external/glm/glm/gtc/quaternion.hpp @@ -62,14 +62,21 @@ namespace glm template struct tquat { + // -- Implementation detail -- + typedef tquat type; typedef T value_type; - public: +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 4; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + + // -- Data -- + T x, y, z, w; - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -87,40 +94,32 @@ namespace glm GLM_FUNC_DECL T const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - GLM_FUNC_DECL tquat(); - GLM_FUNC_DECL tquat(tquat const & q); + GLM_FUNC_DECL tquat() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tquat(tquat const & q) GLM_DEFAULT; template GLM_FUNC_DECL tquat(tquat const & q); - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tquat(ctor); GLM_FUNC_DECL explicit tquat(T const & s, tvec3 const & v); GLM_FUNC_DECL tquat(T const & w, T const & x, T const & y, T const & z); - ////////////////////////////////////// - // Convertions + // -- Conversion constructors -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tquat(tquat const & q); -# else - template - GLM_FUNC_DECL tquat(tquat const & q); -# endif - - // explicit conversion operators + template + GLM_FUNC_DECL GLM_EXPLICIT tquat(tquat const & q); + + /// Explicit conversion operators # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS GLM_FUNC_DECL explicit operator tmat3x3(); GLM_FUNC_DECL explicit operator tmat4x4(); # endif - + /// Create a quaternion from two normalized axis - /// + /// /// @param u A first normalized axis /// @param v A second normalized axis /// @see gtc_quaternion @@ -132,10 +131,9 @@ namespace glm GLM_FUNC_DECL explicit tquat(tmat3x3 const & m); GLM_FUNC_DECL explicit tquat(tmat4x4 const & m); - ////////////////////////////////////// - // Operators + // -- Unary arithmetic operators -- - GLM_FUNC_DECL tquat & operator=(tquat const & m); + GLM_FUNC_DECL tquat & operator=(tquat const & m) GLM_DEFAULT; template GLM_FUNC_DECL tquat & operator=(tquat const & m); @@ -149,9 +147,16 @@ namespace glm GLM_FUNC_DECL tquat & operator/=(U s); }; + // -- Unary bit operators -- + + template + GLM_FUNC_DECL tquat operator+(tquat const & q); + template GLM_FUNC_DECL tquat operator-(tquat const & q); + // -- Binary operators -- + template GLM_FUNC_DECL tquat operator+(tquat const & q, tquat const & p); diff --git a/external/glm/glm/gtc/quaternion.inl b/external/glm/glm/gtc/quaternion.inl index 33ca82cc0..83a1b66fb 100644 --- a/external/glm/glm/gtc/quaternion.inl +++ b/external/glm/glm/gtc/quaternion.inl @@ -49,8 +49,7 @@ namespace detail }; }//namespace detail - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -94,20 +93,23 @@ namespace detail } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - template - GLM_FUNC_QUALIFIER tquat::tquat() -# ifndef GLM_FORCE_NO_CTOR_INIT - : x(0), y(0), z(0), w(1) -# endif - {} - - template - GLM_FUNC_QUALIFIER tquat::tquat(tquat const & q) - : x(q.x), y(q.y), z(q.z), w(q.w) - {} +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tquat::tquat() +# ifndef GLM_FORCE_NO_CTOR_INIT + : x(0), y(0), z(0), w(1) +# endif + {} +# endif + +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tquat::tquat(tquat const & q) + : x(q.x), y(q.y), z(q.z), w(q.w) + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -115,8 +117,7 @@ namespace detail : x(q.x), y(q.y), z(q.z), w(q.w) {} - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- template GLM_FUNC_QUALIFIER tquat::tquat(ctor) @@ -132,8 +133,7 @@ namespace detail : x(x), y(y), z(z), w(w) {} - ////////////////////////////////////////////////////////////// - // Conversions + // -- Conversion constructors -- template template @@ -222,18 +222,19 @@ namespace detail return conjugate(q) / dot(q, q); } - ////////////////////////////////////////////////////////////// - // tquat operators + // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const & q) - { - this->w = q.w; - this->x = q.x; - this->y = q.y; - this->z = q.z; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const & q) + { + this->w = q.w; + this->x = q.x; + this->y = q.y; + this->z = q.z; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -293,8 +294,13 @@ namespace detail return *this; } - ////////////////////////////////////////////////////////////// - // tquat external operators + // -- Unary bit operators -- + + template + GLM_FUNC_QUALIFIER tquat operator+(tquat const & q) + { + return q; + } template GLM_FUNC_QUALIFIER tquat operator-(tquat const & q) @@ -302,6 +308,8 @@ namespace detail return tquat(-q.w, -q.x, -q.y, -q.z); } + // -- Binary operators -- + template GLM_FUNC_QUALIFIER tquat operator+(tquat const & q, tquat const & p) { @@ -314,7 +322,6 @@ namespace detail return tquat(q) *= p; } - // Transformation template GLM_FUNC_QUALIFIER tvec3 operator*(tquat const & q, tvec3 const & v) { @@ -363,8 +370,7 @@ namespace detail q.w / s, q.x / s, q.y / s, q.z / s); } - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tquat const & q1, tquat const & q2) @@ -378,7 +384,8 @@ namespace detail return (q1.x != q2.x) || (q1.y != q2.y) || (q1.z != q2.z) || (q1.w != q2.w); } - //////////////////////////////////////////////////////// + // -- Operations -- + template GLM_FUNC_QUALIFIER T length(tquat const & q) { diff --git a/external/glm/glm/gtc/random.inl b/external/glm/glm/gtc/random.inl index e21b19531..d299af2f9 100644 --- a/external/glm/glm/gtc/random.inl +++ b/external/glm/glm/gtc/random.inl @@ -51,7 +51,7 @@ namespace detail GLM_FUNC_QUALIFIER static tvec1 call() { return tvec1( - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max()); } }; @@ -61,8 +61,8 @@ namespace detail GLM_FUNC_QUALIFIER static tvec2 call() { return tvec2( - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } }; @@ -72,9 +72,9 @@ namespace detail GLM_FUNC_QUALIFIER static tvec3 call() { return tvec3( - std::rand(), - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } }; @@ -84,10 +84,10 @@ namespace detail GLM_FUNC_QUALIFIER static tvec4 call() { return tvec4( - std::rand(), - std::rand(), - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } }; diff --git a/external/glm/glm/gtc/round.inl b/external/glm/glm/gtc/round.inl index 255dec66b..94fdd54bb 100644 --- a/external/glm/glm/gtc/round.inl +++ b/external/glm/glm/gtc/round.inl @@ -104,10 +104,7 @@ namespace detail GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) { if(Source > genType(0)) - { - genType Tmp = Source - genType(1); - return Tmp + (Multiple - std::fmod(Tmp, Multiple)); - } + return Source + (Multiple - std::fmod(Source, Multiple)); else return Source + std::fmod(-Source, Multiple); } @@ -152,10 +149,7 @@ namespace detail if(Source >= genType(0)) return Source - std::fmod(Source, Multiple); else - { - genType Tmp = Source + genType(1); - return Tmp - std::fmod(Tmp, Multiple) - Multiple; - } + return Source - std::fmod(Source, Multiple) - Multiple; } }; diff --git a/external/glm/glm/gtx/compatibility.hpp b/external/glm/glm/gtx/compatibility.hpp index 6a3623bed..5b3f05135 100644 --- a/external/glm/glm/gtx/compatibility.hpp +++ b/external/glm/glm/gtx/compatibility.hpp @@ -84,6 +84,7 @@ namespace glm template GLM_FUNC_QUALIFIER tvec4 atan2(const tvec4& x, const tvec4& 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_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 tvec1 isfinite(const tvec1& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) template GLM_FUNC_DECL tvec2 isfinite(const tvec2& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) template GLM_FUNC_DECL tvec3 isfinite(const tvec3& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) template GLM_FUNC_DECL tvec4 isfinite(const tvec4& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) diff --git a/external/glm/glm/gtx/compatibility.inl b/external/glm/glm/gtx/compatibility.inl index decc26c20..77f99d13e 100644 --- a/external/glm/glm/gtx/compatibility.inl +++ b/external/glm/glm/gtx/compatibility.inl @@ -46,10 +46,21 @@ namespace glm # elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID return _isfinite(x) != 0; # else - return x >= std::numeric_limits::min() && x <= std::numeric_limits::max(); + if (std::numeric_limits::is_integer || std::denorm_absent == std::numeric_limits::has_denorm) + return std::numeric_limits::min() <= x && std::numeric_limits::max() >= x; + else + return -std::numeric_limits::max() <= x && std::numeric_limits::max() >= x; # endif } + template + GLM_FUNC_QUALIFIER tvec1 isfinite( + tvec1 const & x) + { + return tvec1( + isfinite(x.x)); + } + template GLM_FUNC_QUALIFIER tvec2 isfinite( tvec2 const & x) diff --git a/external/glm/glm/gtx/dual_quaternion.hpp b/external/glm/glm/gtx/dual_quaternion.hpp index a8005cb86..0b0832952 100644 --- a/external/glm/glm/gtx/dual_quaternion.hpp +++ b/external/glm/glm/gtx/dual_quaternion.hpp @@ -15,7 +15,7 @@ /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -61,14 +61,21 @@ namespace glm template struct tdualquat { + // -- Implementation detail -- + typedef T value_type; typedef glm::tquat part_type; - - public: + +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 2; + static GLM_RELAXED_CONSTEXPR precision prec = P; +# endif//GLM_META_PROG_HELPERS + + // -- Data -- + glm::tquat real, dual; - - ////////////////////////////////////// - // Component accesses + + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC typedef size_t size_type; @@ -86,38 +93,31 @@ namespace glm GLM_FUNC_DECL part_type const & operator[](length_type i) const; # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - GLM_FUNC_DECL tdualquat(); - GLM_FUNC_DECL tdualquat(tdualquat const & d); + GLM_FUNC_DECL tdualquat() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL tdualquat(tdualquat const & d) GLM_DEFAULT; template GLM_FUNC_DECL tdualquat(tdualquat const & d); - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- GLM_FUNC_DECL explicit tdualquat(ctor); GLM_FUNC_DECL explicit tdualquat(tquat const & real); GLM_FUNC_DECL tdualquat(tquat const & orientation, tvec3 const & translation); GLM_FUNC_DECL tdualquat(tquat const & real, tquat const & dual); - ////////////////////////////////////////////////////////////// - // tdualquat conversions + // -- Conversion constructors -- -# ifdef GLM_FORCE_EXPLICIT_CTOR - template - GLM_FUNC_DECL explicit tdualquat(tdualquat const & q); -# else - template - GLM_FUNC_DECL tdualquat(tdualquat const & q); -# endif + template + GLM_FUNC_DECL GLM_EXPLICIT tdualquat(tdualquat const & q); GLM_FUNC_DECL explicit tdualquat(tmat2x4 const & holder_mat); GLM_FUNC_DECL explicit tdualquat(tmat3x4 const & aug_mat); - - // Operators - GLM_FUNC_DECL tdualquat & operator=(tdualquat const & m); + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL tdualquat & operator=(tdualquat const & m) GLM_DEFAULT; template GLM_FUNC_DECL tdualquat & operator=(tdualquat const & m); @@ -126,118 +126,97 @@ namespace glm template GLM_FUNC_DECL tdualquat & operator/=(U s); }; - + + // -- Unary bit operators -- + template - GLM_FUNC_DECL tquat operator- ( - tquat const & q); - + GLM_FUNC_DECL tdualquat operator+(tdualquat const & q); + template - GLM_FUNC_DECL tdualquat operator+ ( - tdualquat const & q, - tdualquat const & p); - + GLM_FUNC_DECL tdualquat operator-(tdualquat const & q); + + // -- Binary operators -- + template - GLM_FUNC_DECL tdualquat operator* ( - tdualquat const & q, - tdualquat const & p); - + GLM_FUNC_DECL tdualquat operator+(tdualquat const & q, tdualquat const & p); + template - GLM_FUNC_DECL tvec3 operator* ( - tquat const & q, - tvec3 const & v); - + GLM_FUNC_DECL tdualquat operator*(tdualquat const & q, tdualquat const & p); + template - GLM_FUNC_DECL tvec3 operator* ( - tvec3 const & v, - tquat const & q); - + GLM_FUNC_DECL tvec3 operator*(tquat const & q, tvec3 const & v); + template - GLM_FUNC_DECL tvec4 operator* ( - tquat const & q, - tvec4 const & v); - + GLM_FUNC_DECL tvec3 operator*(tvec3 const & v, tquat const & q); + template - GLM_FUNC_DECL tvec4 operator* ( - tvec4 const & v, - tquat const & q); - + GLM_FUNC_DECL tvec4 operator*(tquat const & q, tvec4 const & v); + template - GLM_FUNC_DECL tdualquat operator* ( - tdualquat const & q, - T const & s); - + GLM_FUNC_DECL tvec4 operator*(tvec4 const & v, tquat const & q); + template - GLM_FUNC_DECL tdualquat operator* ( - T const & s, - tdualquat const & q); - + GLM_FUNC_DECL tdualquat operator*(tdualquat const & q, T const & s); + + template + GLM_FUNC_DECL tdualquat operator*(T const & s, tdualquat const & q); + template - GLM_FUNC_DECL tdualquat operator/ ( - tdualquat const & q, - T const & s); + GLM_FUNC_DECL tdualquat operator/(tdualquat const & q, T const & s); /// Returns the normalized quaternion. /// /// @see gtx_dual_quaternion template - GLM_FUNC_DECL tdualquat normalize( - tdualquat const & q); + GLM_FUNC_DECL tdualquat normalize(tdualquat const & q); /// Returns the linear interpolation of two dual quaternion. /// /// @see gtc_dual_quaternion template - GLM_FUNC_DECL tdualquat lerp( - tdualquat const & x, - tdualquat const & y, - T const & a); + GLM_FUNC_DECL tdualquat lerp(tdualquat const & x, tdualquat const & y, T const & a); /// Returns the q inverse. /// /// @see gtx_dual_quaternion template - GLM_FUNC_DECL tdualquat inverse( - tdualquat const & q); + GLM_FUNC_DECL tdualquat inverse(tdualquat const & q); /// Converts a quaternion to a 2 * 4 matrix. /// /// @see gtx_dual_quaternion template - GLM_FUNC_DECL tmat2x4 mat2x4_cast( - tdualquat const & x); + GLM_FUNC_DECL tmat2x4 mat2x4_cast(tdualquat const & x); /// Converts a quaternion to a 3 * 4 matrix. /// /// @see gtx_dual_quaternion template - GLM_FUNC_DECL tmat3x4 mat3x4_cast( - tdualquat const & x); + GLM_FUNC_DECL tmat3x4 mat3x4_cast(tdualquat const & x); /// Converts a 2 * 4 matrix (matrix which holds real and dual parts) to a quaternion. /// /// @see gtx_dual_quaternion template - GLM_FUNC_DECL tdualquat dualquat_cast( - tmat2x4 const & x); + GLM_FUNC_DECL tdualquat dualquat_cast(tmat2x4 const & x); /// Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion. /// /// @see gtx_dual_quaternion template - GLM_FUNC_DECL tdualquat dualquat_cast( - tmat3x4 const & x); + GLM_FUNC_DECL tdualquat dualquat_cast(tmat3x4 const & x); + - /// Dual-quaternion of low single-precision floating-point numbers. /// /// @see gtx_dual_quaternion typedef tdualquat lowp_dualquat; - + /// Dual-quaternion of medium single-precision floating-point numbers. /// /// @see gtx_dual_quaternion typedef tdualquat mediump_dualquat; - + /// Dual-quaternion of high single-precision floating-point numbers. /// /// @see gtx_dual_quaternion @@ -248,40 +227,40 @@ namespace glm /// /// @see gtx_dual_quaternion typedef tdualquat lowp_fdualquat; - + /// Dual-quaternion of medium single-precision floating-point numbers. /// /// @see gtx_dual_quaternion typedef tdualquat mediump_fdualquat; - + /// Dual-quaternion of high single-precision floating-point numbers. /// /// @see gtx_dual_quaternion typedef tdualquat highp_fdualquat; - - + + /// Dual-quaternion of low double-precision floating-point numbers. /// /// @see gtx_dual_quaternion typedef tdualquat lowp_ddualquat; - + /// Dual-quaternion of medium double-precision floating-point numbers. /// /// @see gtx_dual_quaternion typedef tdualquat mediump_ddualquat; - + /// Dual-quaternion of high double-precision floating-point numbers. /// /// @see gtx_dual_quaternion typedef tdualquat highp_ddualquat; - + #if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) /// Dual-quaternion of floating-point numbers. /// /// @see gtx_dual_quaternion typedef highp_fdualquat dualquat; - + /// Dual-quaternion of single-precision floating-point numbers. /// /// @see gtx_dual_quaternion @@ -298,7 +277,7 @@ namespace glm #else # error "GLM error: multiple default precision requested for single-precision floating-point types" #endif - + #if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) /// Dual-quaternion of default double-precision floating-point numbers. diff --git a/external/glm/glm/gtx/dual_quaternion.inl b/external/glm/glm/gtx/dual_quaternion.inl index 8fed08554..961dd1ca0 100644 --- a/external/glm/glm/gtx/dual_quaternion.inl +++ b/external/glm/glm/gtx/dual_quaternion.inl @@ -35,8 +35,7 @@ namespace glm { - ////////////////////////////////////// - // Component accesses + // -- Component accesses -- # ifdef GLM_FORCE_SIZE_FUNC template @@ -80,22 +79,25 @@ namespace glm } # endif//GLM_FORCE_SIZE_FUNC - ////////////////////////////////////// - // Implicit basic constructors + // -- Implicit basic constructors -- - template - GLM_FUNC_QUALIFIER tdualquat::tdualquat() -# ifndef GLM_FORCE_NO_CTOR_INIT - : real(tquat()) - , dual(tquat(0, 0, 0, 0)) -# endif - {} - - template - GLM_FUNC_QUALIFIER tdualquat::tdualquat(tdualquat const & d) - : real(d.real) - , dual(d.dual) - {} +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + template + GLM_FUNC_QUALIFIER tdualquat::tdualquat() +# ifndef GLM_FORCE_NO_CTOR_INIT + : real(tquat()) + , dual(tquat(0, 0, 0, 0)) +# endif + {} +# endif + +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tdualquat::tdualquat(tdualquat const & d) + : real(d.real) + , dual(d.dual) + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -104,8 +106,7 @@ namespace glm , dual(d.dual) {} - ////////////////////////////////////// - // Explicit basic constructors + // -- Explicit basic constructors -- template GLM_FUNC_QUALIFIER tdualquat::tdualquat(ctor) @@ -130,8 +131,7 @@ namespace glm : real(r), dual(d) {} - ////////////////////////////////////////////////////////////// - // tdualquat conversions + // -- Conversion constructors -- template template @@ -152,16 +152,17 @@ namespace glm *this = dualquat_cast(m); } - ////////////////////////////////////////////////////////////// - // tdualquat operators + // -- Unary arithmetic operators -- - template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const & q) - { - this->real = q.real; - this->dual = q.dual; - return *this; - } +# if !GLM_HAS_DEFAULTED_FUNCTIONS + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const & q) + { + this->real = q.real; + this->dual = q.dual; + return *this; + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template @@ -190,15 +191,16 @@ namespace glm return *this; } - ////////////////////////////////////////////////////////////// - // tquat external operators + // -- Unary bit operators -- template GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const & q) { - return tdualquat(-q.real,-q.dual); + return q; } + // -- Binary operators -- + template GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const & q, tdualquat const & p) { @@ -211,7 +213,6 @@ namespace glm return tdualquat(p.real * o.real,p.real * o.dual + p.dual * o.real); } - // Transformation template GLM_FUNC_QUALIFIER tvec3 operator*(tdualquat const & q, tvec3 const & v) { @@ -256,8 +257,8 @@ namespace glm return tdualquat(q.real / s, q.dual / s); } - ////////////////////////////////////// - // Boolean operators + // -- Boolean operators -- + template GLM_FUNC_QUALIFIER bool operator==(tdualquat const & q1, tdualquat const & q2) { @@ -270,7 +271,8 @@ namespace glm return (q1.real != q2.dual) || (q1.real != q2.dual); } - //////////////////////////////////////////////////////// + // -- Operations -- + template GLM_FUNC_QUALIFIER tdualquat normalize(tdualquat const & q) { diff --git a/external/glm/glm/gtx/euler_angles.hpp b/external/glm/glm/gtx/euler_angles.hpp index 7a1cb3647..e772bbf04 100644 --- a/external/glm/glm/gtx/euler_angles.hpp +++ b/external/glm/glm/gtx/euler_angles.hpp @@ -114,6 +114,14 @@ namespace glm T const & angleZ, T const & angleY); + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL tmat4x4 eulerAngleXYZ( + T const & t1, + T const & t2, + T const & t3); + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). /// @see gtx_euler_angles template @@ -121,7 +129,7 @@ namespace glm T const & yaw, T const & pitch, T const & roll); - + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). /// @see gtx_euler_angles template @@ -150,6 +158,14 @@ namespace glm template GLM_FUNC_DECL tmat4x4 orientate4(tvec3 const & angles); + /// Extracts the (X * Y * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXYZ(tmat4x4 & M, + T & t1, + T & t2, + T & t3); + /// @} }//namespace glm diff --git a/external/glm/glm/gtx/euler_angles.inl b/external/glm/glm/gtx/euler_angles.inl index 77fea4257..80b30dbeb 100644 --- a/external/glm/glm/gtx/euler_angles.inl +++ b/external/glm/glm/gtx/euler_angles.inl @@ -30,6 +30,8 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////////////////////// +#include "compatibility.hpp" // glm::atan2 + namespace glm { template @@ -157,7 +159,42 @@ namespace glm { return eulerAngleZ(angleZ) * eulerAngleY(angleY); } - + + template + GLM_FUNC_QUALIFIER tmat4x4 eulerAngleXYZ + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(-t1); + T c2 = glm::cos(-t2); + T c3 = glm::cos(-t3); + T s1 = glm::sin(-t1); + T s2 = glm::sin(-t2); + T s3 = glm::sin(-t3); + + tmat4x4 Result; + Result[0][0] = c2 * c3; + Result[0][1] =-c1 * s3 + s1 * s2 * c3; + Result[0][2] = s1 * s3 + c1 * s2 * c3; + Result[0][3] = static_cast(0); + Result[1][0] = c2 * s3; + Result[1][1] = c1 * c3 + s1 * s2 * s3; + Result[1][2] =-s1 * c3 + c1 * s2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] =-s2; + Result[2][1] = s1 * c2; + Result[2][2] = c1 * c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + template GLM_FUNC_QUALIFIER tmat4x4 eulerAngleYXZ ( @@ -284,4 +321,21 @@ namespace glm { return yawPitchRoll(angles.z, angles.x, angles.y); } + + template + GLM_FUNC_DECL void extractEulerAngleXYZ(tmat4x4 & M, + T & t1, + T & t2, + T & t3) + { + float T1 = glm::atan2(M[2][1], M[2][2]); + float C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]); + float T2 = glm::atan2(-M[2][0], C2); + float S1 = glm::sin(T1); + float C1 = glm::cos(T1); + float T3 = glm::atan2(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]); + t1 = -T1; + t2 = -T2; + t3 = -T3; + } }//namespace glm diff --git a/external/glm/glm/gtx/fast_trigonometry.inl b/external/glm/glm/gtx/fast_trigonometry.inl index 16a821ad8..b8c65810e 100644 --- a/external/glm/glm/gtx/fast_trigonometry.inl +++ b/external/glm/glm/gtx/fast_trigonometry.inl @@ -33,6 +33,16 @@ namespace glm{ namespace detail { + template class vecType> + GLM_FUNC_QUALIFIER vecType taylorCos(vecType const & x) + { + return static_cast(1) + - (x * x) / 2.f + + (x * x * x * x) / 24.f + - (x * x * x * x * x * x) / 720.f + + (x * x * x * x * x * x * x * x) / 40320.f; + } + template GLM_FUNC_QUALIFIER T cos_52s(T x) { @@ -66,11 +76,11 @@ namespace detail { T const angle(wrapAngle(x)); - if(angle()) + if(angle < half_pi()) return detail::cos_52s(angle); - if(angle()) + if(angle < pi()) return -detail::cos_52s(pi() - angle); - if(angle<(T(3) * half_pi())) + if(angle < (T(3) * half_pi())) return -detail::cos_52s(angle - pi()); return detail::cos_52s(two_pi() - angle); diff --git a/external/glm/glm/gtx/hash.hpp b/external/glm/glm/gtx/hash.hpp new file mode 100644 index 000000000..02030987f --- /dev/null +++ b/external/glm/glm/gtx/hash.hpp @@ -0,0 +1,163 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref gtx_hash +/// @file glm/gtx/hash.hpp +/// @date 2015-03-07 / 2015-03-07 +/// @author Christophe Riccio +/// +/// @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 these functionalities. +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include + +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../gtc/vec1.hpp" + +#include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" + +#include "../mat2x2.hpp" +#include "../mat2x3.hpp" +#include "../mat2x4.hpp" + +#include "../mat3x2.hpp" +#include "../mat3x3.hpp" +#include "../mat3x4.hpp" + +#include "../mat4x2.hpp" +#include "../mat4x3.hpp" +#include "../mat4x4.hpp" + +#if !GLM_HAS_CXX11_STL +# error "GLM_GTX_hash requires C++11 standard library support" +#endif + +namespace std +{ + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tvec1 const & v) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tvec2 const & v) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tvec3 const & v) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tvec4 const & v) const; + }; + + template + struct hash> + { + GLM_FUNC_DECL size_t operator()(glm::tquat const & q) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tdualquat const & q) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat2x2 const & m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat2x3 const & m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat2x4 const & m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat3x2 const & m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat3x3 const & m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat3x4 const & m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat4x2 const & m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat4x3 const & m) const; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tmat4x4 const & m) const; + }; +} // namespace std + +#include "hash.inl" diff --git a/external/glm/glm/gtx/hash.inl b/external/glm/glm/gtx/hash.inl new file mode 100644 index 000000000..8aa299e17 --- /dev/null +++ b/external/glm/glm/gtx/hash.inl @@ -0,0 +1,214 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref gtx_hash +/// @file glm/gtx/hash.inl +/// @date 2015-03-07 / 2015-03-07 +/// @author Christophe Riccio +/// +/// @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 these functionalities. +/////////////////////////////////////////////////////////////////////////////////// + +namespace glm { +namespace detail +{ + GLM_INLINE void hash_combine(size_t &seed, size_t hash) + { + hash += 0x9e3779b9 + (seed << 6) + (seed >> 2); + seed ^= hash; + } +}} + +namespace std +{ + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tvec1 const & v) const + { + hash hasher; + return hasher(v.x); + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tvec2 const & v) const + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tvec3 const & v) const + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + glm::detail::hash_combine(seed, hasher(v.z)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tvec4 const & v) const + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + glm::detail::hash_combine(seed, hasher(v.z)); + glm::detail::hash_combine(seed, hasher(v.w)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tquat const & q) const + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(q.x)); + glm::detail::hash_combine(seed, hasher(q.y)); + glm::detail::hash_combine(seed, hasher(q.z)); + glm::detail::hash_combine(seed, hasher(q.w)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tdualquat const & q) const + { + size_t seed = 0; + 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::tmat2x2 const & m) const + { + size_t seed = 0; + 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::tmat2x3 const & m) const + { + size_t seed = 0; + 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::tmat2x4 const & m) const + { + size_t seed = 0; + 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::tmat3x2 const & m) const + { + size_t seed = 0; + 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])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tmat3x3 const & m) const + { + size_t seed = 0; + 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])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tmat3x4 const & m) const + { + size_t seed = 0; + 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])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tmat4x2 const & m) const + { + size_t seed = 0; + 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])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tmat4x3 const & m) const + { + size_t seed = 0; + 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])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tmat4x4 const & m) const + { + size_t seed = 0; + 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])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } +} diff --git a/external/glm/glm/gtx/intersect.hpp b/external/glm/glm/gtx/intersect.hpp index ef3d42d18..3bce70817 100644 --- a/external/glm/glm/gtx/intersect.hpp +++ b/external/glm/glm/gtx/intersect.hpp @@ -43,8 +43,12 @@ #pragma once // Dependency: +#include +#include #include "../glm.hpp" +#include "../geometric.hpp" #include "../gtx/closest_point.hpp" +#include "../gtx/vector_query.hpp" #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) # pragma message("GLM: GLM_GTX_closest_point extension included") @@ -55,7 +59,7 @@ namespace glm /// @addtogroup gtx_intersect /// @{ - //! Compute the intersection of a ray and a triangle. + //! Compute the intersection of a ray and a plane. //! Ray direction and plane normal must be unit length. //! From GLM_GTX_intersect extension. template diff --git a/external/glm/glm/gtx/intersect.inl b/external/glm/glm/gtx/intersect.inl index 0c1cc9353..3b1b9e8c0 100644 --- a/external/glm/glm/gtx/intersect.inl +++ b/external/glm/glm/gtx/intersect.inl @@ -7,10 +7,6 @@ // File : glm/gtx/intersect.inl /////////////////////////////////////////////////////////////////////////////////////////////////// -#include "../geometric.hpp" -#include -#include - namespace glm { template diff --git a/external/glm/glm/gtx/io.hpp b/external/glm/glm/gtx/io.hpp index b3842bbd2..a52ab9c0e 100644 --- a/external/glm/glm/gtx/io.hpp +++ b/external/glm/glm/gtx/io.hpp @@ -220,6 +220,12 @@ namespace glm std::pair const, tmat4x4 const> const &); + template + GLM_FUNC_DECL std::basic_ostream & operator<<( + std::basic_ostream &, + std::pair, + tmat4x4 > const &); + /// @} }//namespace glm diff --git a/external/glm/glm/gtx/io.inl b/external/glm/glm/gtx/io.inl index 5af266dd9..92c68732e 100644 --- a/external/glm/glm/gtx/io.inl +++ b/external/glm/glm/gtx/io.inl @@ -645,4 +645,12 @@ namespace io return os; } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<( + std::basic_ostream & os, + std::pair, tmat4x4 > const& a) + { + return operator<<(os, static_cast const, tmat4x4 const> const&>(a)); + } }//namespace glm diff --git a/external/glm/glm/gtx/log_base.hpp b/external/glm/glm/gtx/log_base.hpp index 94d034728..e6c89ea2f 100644 --- a/external/glm/glm/gtx/log_base.hpp +++ b/external/glm/glm/gtx/log_base.hpp @@ -53,15 +53,15 @@ namespace glm /// @addtogroup gtx_log_base /// @{ - //! Logarithm for any base. - //! From GLM_GTX_log_base. + /// Logarithm for any base. + /// From GLM_GTX_log_base. template GLM_FUNC_DECL genType log( - genType x, - genType base); + genType const & x, + genType const & base); - //! Logarithm for any base. - //! From GLM_GTX_log_base. + /// Logarithm for any base. + /// From GLM_GTX_log_base. template class vecType> GLM_FUNC_DECL vecType sign( vecType const & x, diff --git a/external/glm/glm/gtx/matrix_decompose.hpp b/external/glm/glm/gtx/matrix_decompose.hpp index 735b42880..e7fc83e21 100644 --- a/external/glm/glm/gtx/matrix_decompose.hpp +++ b/external/glm/glm/gtx/matrix_decompose.hpp @@ -36,7 +36,7 @@ /// /// @brief Decomposes a model matrix to translations, rotation and scale components /// -/// need to be included to use these functionalities. +/// need to be included to use these functionalities. /////////////////////////////////////////////////////////////////////////////////// #pragma once diff --git a/external/glm/glm/gtx/matrix_decompose.inl b/external/glm/glm/gtx/matrix_decompose.inl index ba507d0ee..dec795722 100644 --- a/external/glm/glm/gtx/matrix_decompose.inl +++ b/external/glm/glm/gtx/matrix_decompose.inl @@ -81,15 +81,15 @@ namespace glm tmat4x4 PerspectiveMatrix(LocalMatrix); for(length_t i = 0; i < 3; i++) - PerspectiveMatrix[i][3] = 0; - PerspectiveMatrix[3][3] = 1; + PerspectiveMatrix[i][3] = static_cast(0); + PerspectiveMatrix[3][3] = static_cast(1); /// TODO: Fixme! if(determinant(PerspectiveMatrix) == static_cast(0)) return false; // First, isolate perspective. This is the messiest. - if(LocalMatrix[0][3] != 0 || LocalMatrix[1][3] != 0 || LocalMatrix[2][3] != 0) + if(LocalMatrix[0][3] != static_cast(0) || LocalMatrix[1][3] != static_cast(0) || LocalMatrix[2][3] != static_cast(0)) { // rightHandSide is the right hand side of the equation. tvec4 RightHandSide; @@ -108,8 +108,8 @@ namespace glm // v4MulPointByMatrix(rightHandSide, transposedInversePerspectiveMatrix, perspectivePoint); // Clear the perspective partition - LocalMatrix[0][3] = LocalMatrix[1][3] = LocalMatrix[2][3] = 0; - LocalMatrix[3][3] = 1; + LocalMatrix[0][3] = LocalMatrix[1][3] = LocalMatrix[2][3] = static_cast(0); + LocalMatrix[3][3] = static_cast(1); } else { @@ -186,38 +186,38 @@ namespace glm T s, t, x, y, z, w; - t = Row[0][0] + Row[1][1] + Row[2][2] + 1.0; + t = Row[0][0] + Row[1][1] + Row[2][2] + static_cast(1); - if(t > 1e-4) + if(t > static_cast(1e-4)) { - s = 0.5 / sqrt(t); - w = 0.25 / s; + s = static_cast(0.5) / sqrt(t); + w = static_cast(0.25) / s; x = (Row[2][1] - Row[1][2]) * s; y = (Row[0][2] - Row[2][0]) * s; z = (Row[1][0] - Row[0][1]) * s; } else if(Row[0][0] > Row[1][1] && Row[0][0] > Row[2][2]) { - s = sqrt (1.0 + Row[0][0] - Row[1][1] - Row[2][2]) * 2.0; // S=4*qx - x = 0.25 * s; + s = sqrt (static_cast(1) + Row[0][0] - Row[1][1] - Row[2][2]) * static_cast(2); // S=4*qx + x = static_cast(0.25) * s; y = (Row[0][1] + Row[1][0]) / s; z = (Row[0][2] + Row[2][0]) / s; w = (Row[2][1] - Row[1][2]) / s; } else if(Row[1][1] > Row[2][2]) { - s = sqrt (1.0 + Row[1][1] - Row[0][0] - Row[2][2]) * 2.0; // S=4*qy + s = sqrt (static_cast(1) + Row[1][1] - Row[0][0] - Row[2][2]) * static_cast(2); // S=4*qy x = (Row[0][1] + Row[1][0]) / s; - y = 0.25 * s; + y = static_cast(0.25) * s; z = (Row[1][2] + Row[2][1]) / s; w = (Row[0][2] - Row[2][0]) / s; } else { - s = sqrt(1.0 + Row[2][2] - Row[0][0] - Row[1][1]) * 2.0; // S=4*qz + s = sqrt(static_cast(1) + Row[2][2] - Row[0][0] - Row[1][1]) * static_cast(2); // S=4*qz x = (Row[0][2] + Row[2][0]) / s; y = (Row[1][2] + Row[2][1]) / s; - z = 0.25 * s; + z = static_cast(0.25) * s; w = (Row[1][0] - Row[0][1]) / s; } diff --git a/external/glm/glm/gtx/multiple.hpp b/external/glm/glm/gtx/multiple.hpp deleted file mode 100644 index f693ee19d..000000000 --- a/external/glm/glm/gtx/multiple.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_multiple -/// @file glm/gtx/multiple.hpp -/// @date 2009-10-26 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_multiple GLM_GTX_multiple -/// @ingroup gtx -/// -/// @brief Find the closest number of a number multiple of other number. -/// -/// need to be included to use these functionalities. -/////////////////////////////////////////////////////////////////////////////////// - -#pragma once - -// Dependency: -#include "../gtc/round.hpp" - -#pragma message("GLM: GLM_GTX_multiple extension is deprecated, use GLM_GTC_round instead.") - -namespace glm -{ - /// @addtogroup gtx_multiple - /// @{ - - /// Higher multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtx_multiple - template - GLM_DEPRECATED GLM_FUNC_DECL genType higherMultiple( - genType Source, - genType Multiple); - - /// Higher multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtx_multiple - template class vecType> - GLM_DEPRECATED GLM_FUNC_DECL vecType higherMultiple( - vecType const & Source, - vecType const & Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtx_multiple - template - GLM_DEPRECATED GLM_FUNC_DECL genType lowerMultiple( - genType Source, - genType Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// @param Source - /// @param Multiple Must be a null or positive value - /// - /// @see gtx_multiple - template class vecType> - GLM_DEPRECATED GLM_FUNC_DECL vecType lowerMultiple( - vecType const & Source, - vecType const & Multiple); - - /// @} -}//namespace glm - -#include "multiple.inl" diff --git a/external/glm/glm/gtx/multiple.inl b/external/glm/glm/gtx/multiple.inl deleted file mode 100644 index 878cdfbf2..000000000 --- a/external/glm/glm/gtx/multiple.inl +++ /dev/null @@ -1,64 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @ref gtx_multiple -/// @file glm/gtx/multiple.inl -/// @date 2009-10-26 / 2011-06-07 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////// - // higherMultiple - - template - GLM_FUNC_QUALIFIER genType higherMultiple(genType Source, genType Multiple) - { - return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); - } - - template class vecType> - GLM_FUNC_QUALIFIER vecType higherMultiple(vecType const & Source, vecType const & Multiple) - { - return detail::functor2::call(higherMultiple, Source, Multiple); - } - - ////////////////////// - // lowerMultiple - - template - GLM_FUNC_QUALIFIER genType lowerMultiple(genType Source, genType Multiple) - { - return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); - } - - template class vecType> - GLM_FUNC_QUALIFIER vecType lowerMultiple(vecType const & Source, vecType const & Multiple) - { - return detail::functor2::call(lowerMultiple, Source, Multiple); - } -}//namespace glm diff --git a/external/glm/glm/gtx/norm.hpp b/external/glm/glm/gtx/norm.hpp index d8fbf2c16..f1d8d1b28 100644 --- a/external/glm/glm/gtx/norm.hpp +++ b/external/glm/glm/gtx/norm.hpp @@ -67,14 +67,14 @@ namespace glm GLM_FUNC_DECL typename genType::value_type length2( genType const & x); - //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). + //! Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). //! From GLM_GTX_norm extension. template GLM_FUNC_DECL T distance2( T const & p0, T const & p1); - //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). + //! Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). //! From GLM_GTX_norm extension. template GLM_FUNC_DECL typename genType::value_type distance2( diff --git a/external/glm/glm/gtx/quaternion.inl b/external/glm/glm/gtx/quaternion.inl index 4c5b3d665..b405cc5ed 100644 --- a/external/glm/glm/gtx/quaternion.inl +++ b/external/glm/glm/gtx/quaternion.inl @@ -121,33 +121,28 @@ namespace glm } template - GLM_FUNC_QUALIFIER tquat pow - ( - tquat const & x, - T const & y - ) + GLM_FUNC_QUALIFIER tquat pow(tquat const & x, T const & y) { - if(abs(x.w) > (static_cast(1) - epsilon())) - return x; - T Angle = acos(y); + //Raising to the power of 0 should yield 1 + //Needed to prevent a division by 0 error later on + if(y > -epsilon() && y < epsilon()) + return tquat(1,0,0,0); + + //To deal with non-unit quaternions + T magnitude = sqrt(x.x * x.x + x.y * x.y + x.z * x.z + x.w *x.w); + + //Equivalent to raising a real number to a power + //Needed to prevent a division by 0 error later on + if(abs(x.w / magnitude) > static_cast(1) - epsilon() && abs(x.w / magnitude) < static_cast(1) + epsilon()) + return tquat(pow(x.w, y),0,0,0); + + T Angle = acos(x.w / magnitude); T NewAngle = Angle * y; T Div = sin(NewAngle) / sin(Angle); - return tquat( - cos(NewAngle), - x.x * Div, - x.y * Div, - x.z * Div); - } + T Mag = pow(magnitude, y-1); - //template - //GLM_FUNC_QUALIFIER tquat sqrt - //( - // tquat const & q - //) - //{ - // T q0 = static_cast(1) - dot(q, q); - // return T(2) * (T(1) + q0) * q; - //} + return tquat(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); + } template GLM_FUNC_QUALIFIER tvec3 rotate @@ -254,6 +249,9 @@ namespace glm T cosTheta = dot(orig, dest); tvec3 rotationAxis; + if(cosTheta >= static_cast(1) - epsilon()) + return quat(); + if(cosTheta < static_cast(-1) + epsilon()) { // special case when vectors in opposite directions : diff --git a/external/glm/glm/gtx/scalar_multiplication.hpp b/external/glm/glm/gtx/scalar_multiplication.hpp index 5f6c4d9e7..3b34d2b3b 100644 --- a/external/glm/glm/gtx/scalar_multiplication.hpp +++ b/external/glm/glm/gtx/scalar_multiplication.hpp @@ -44,7 +44,7 @@ #include "../detail/setup.hpp" #if !GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC) -# error "GLM_GTX_scalar_multiplication requires C++11 suppport or alias templates and if not support for GCC" +# error "GLM_GTX_scalar_multiplication requires C++11 support or alias templates and if not support for GCC" #endif #include "../vec2.hpp" diff --git a/external/glm/glm/gtx/simd_mat4.hpp b/external/glm/glm/gtx/simd_mat4.hpp index 89ee5e753..041983339 100644 --- a/external/glm/glm/gtx/simd_mat4.hpp +++ b/external/glm/glm/gtx/simd_mat4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -33,9 +33,9 @@ /// /// @defgroup gtx_simd_mat4 GLM_GTX_simd_mat4 /// @ingroup gtx -/// +/// /// @brief SIMD implementation of mat4 type. -/// +/// /// need to be included to use these functionalities. /////////////////////////////////////////////////////////////////////////////////// @@ -71,6 +71,18 @@ namespace detail typedef fmat4x4SIMD type; typedef fmat4x4SIMD transpose_type; + typedef tmat4x4 pure_type; + typedef tvec4 pure_row_type; + typedef tvec4 pure_col_type; + typedef tmat4x4 pure_transpose_type; + +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 4; + static GLM_RELAXED_CONSTEXPR length_t cols = 4; + static GLM_RELAXED_CONSTEXPR length_t rows = 4; + static GLM_RELAXED_CONSTEXPR precision prec = defaultp; +# endif//GLM_META_PROG_HELPERS + GLM_FUNC_DECL length_t length() const; fvec4SIMD Data[4]; @@ -78,7 +90,7 @@ namespace detail ////////////////////////////////////// // Constructors - fmat4x4SIMD(); + fmat4x4SIMD() GLM_DEFAULT_CTOR; explicit fmat4x4SIMD(float const & s); explicit fmat4x4SIMD( float const & x0, float const & y0, float const & z0, float const & w0, @@ -96,7 +108,7 @@ namespace detail __m128 const in[4]); // Conversions - //template + //template //explicit tmat4x4(tmat4x4 const & m); //explicit tmat4x4(tmat2x2 const & x); @@ -113,7 +125,7 @@ namespace detail fvec4SIMD const & operator[](length_t i) const; // Unary updatable operators - fmat4x4SIMD & operator= (fmat4x4SIMD const & m); + fmat4x4SIMD & operator= (fmat4x4SIMD const & m) GLM_DEFAULT; fmat4x4SIMD & operator+= (float const & s); fmat4x4SIMD & operator+= (fmat4x4SIMD const & m); fmat4x4SIMD & operator-= (float const & s); diff --git a/external/glm/glm/gtx/simd_mat4.inl b/external/glm/glm/gtx/simd_mat4.inl index 14c8b45e9..13dcb20f0 100644 --- a/external/glm/glm/gtx/simd_mat4.inl +++ b/external/glm/glm/gtx/simd_mat4.inl @@ -64,15 +64,17 @@ GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[] ////////////////////////////////////////////////////////////// // Constructors -GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD() -{ -# ifndef GLM_FORCE_NO_CTOR_INIT - this->Data[0] = fvec4SIMD(1, 0, 0, 0); - this->Data[1] = fvec4SIMD(0, 1, 0, 0); - this->Data[2] = fvec4SIMD(0, 0, 1, 0); - this->Data[3] = fvec4SIMD(0, 0, 0, 1); -# endif -} +#if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD() + { +# ifndef GLM_FORCE_NO_CTOR_INIT + this->Data[0] = fvec4SIMD(1, 0, 0, 0); + this->Data[1] = fvec4SIMD(0, 1, 0, 0); + this->Data[2] = fvec4SIMD(0, 0, 1, 0); + this->Data[3] = fvec4SIMD(0, 0, 0, 1); +# endif + } +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD(float const & s) { @@ -135,17 +137,19 @@ GLM_FUNC_QUALIFIER fmat4x4SIMD::fmat4x4SIMD ////////////////////////////////////////////////////////////// // mat4 operators -GLM_FUNC_QUALIFIER fmat4x4SIMD& fmat4x4SIMD::operator= -( - fmat4x4SIMD const & m -) -{ - this->Data[0] = m[0]; - this->Data[1] = m[1]; - this->Data[2] = m[2]; - this->Data[3] = m[3]; - return *this; -} +#if !GLM_HAS_DEFAULTED_FUNCTIONS + GLM_FUNC_QUALIFIER fmat4x4SIMD& fmat4x4SIMD::operator= + ( + fmat4x4SIMD const & m + ) + { + this->Data[0] = m[0]; + this->Data[1] = m[1]; + this->Data[2] = m[2]; + this->Data[3] = m[3]; + return *this; + } +#endif//!GLM_HAS_DEFAULTED_FUNCTIONS GLM_FUNC_QUALIFIER fmat4x4SIMD & fmat4x4SIMD::operator+= ( diff --git a/external/glm/glm/gtx/simd_quat.hpp b/external/glm/glm/gtx/simd_quat.hpp index 810ce30c6..97075ba66 100644 --- a/external/glm/glm/gtx/simd_quat.hpp +++ b/external/glm/glm/gtx/simd_quat.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -33,9 +33,9 @@ /// /// @defgroup gtx_simd_quat GLM_GTX_simd_quat /// @ingroup gtx -/// +/// /// @brief SIMD implementation of quat type. -/// +/// /// need to be included to use these functionalities. /////////////////////////////////////////////////////////////////////////////////// @@ -69,12 +69,17 @@ namespace detail { GLM_ALIGNED_STRUCT(16) fquatSIMD { - typedef __m128 value_type; + typedef float value_type; typedef std::size_t size_type; - static size_type value_size(); typedef fquatSIMD type; typedef tquat bool_type; + typedef tquat pure_type; + +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 4; + static GLM_RELAXED_CONSTEXPR precision prec = defaultp; +# endif//GLM_META_PROG_HELPERS #ifdef GLM_SIMD_ENABLE_XYZW_UNION union @@ -89,9 +94,9 @@ namespace detail ////////////////////////////////////// // Implicit basic constructors - fquatSIMD(); + fquatSIMD() GLM_DEFAULT_CTOR; + fquatSIMD(fquatSIMD const & q) GLM_DEFAULT; fquatSIMD(__m128 const & Data); - fquatSIMD(fquatSIMD const & q); ////////////////////////////////////// // Explicit basic constructors @@ -99,20 +104,20 @@ namespace detail explicit fquatSIMD( ctor); explicit fquatSIMD( - float const & w, - float const & x, - float const & y, + float const & w, + float const & x, + float const & y, float const & z); explicit fquatSIMD( quat const & v); explicit fquatSIMD( vec3 const & eulerAngles); - + ////////////////////////////////////// // Unary arithmetic operators - fquatSIMD& operator =(fquatSIMD const & q); + fquatSIMD& operator= (fquatSIMD const & q) GLM_DEFAULT; fquatSIMD& operator*=(float const & s); fquatSIMD& operator/=(float const & s); }; @@ -124,16 +129,16 @@ namespace detail detail::fquatSIMD operator- ( detail::fquatSIMD const & q); - detail::fquatSIMD operator+ ( - detail::fquatSIMD const & q, - detail::fquatSIMD const & p); + detail::fquatSIMD operator+ ( + detail::fquatSIMD const & q, + detail::fquatSIMD const & p); - detail::fquatSIMD operator* ( - detail::fquatSIMD const & q, - detail::fquatSIMD const & p); + detail::fquatSIMD operator* ( + detail::fquatSIMD const & q, + detail::fquatSIMD const & p); detail::fvec4SIMD operator* ( - detail::fquatSIMD const & q, + detail::fquatSIMD const & q, detail::fvec4SIMD const & v); detail::fvec4SIMD operator* ( @@ -141,7 +146,7 @@ namespace detail detail::fquatSIMD const & q); detail::fquatSIMD operator* ( - detail::fquatSIMD const & q, + detail::fquatSIMD const & q, float s); detail::fquatSIMD operator* ( @@ -149,7 +154,7 @@ namespace detail detail::fquatSIMD const & q); detail::fquatSIMD operator/ ( - detail::fquatSIMD const & q, + detail::fquatSIMD const & q, float s); }//namespace detail @@ -192,64 +197,64 @@ namespace detail detail::fquatSIMD const & q); - /// Returns the length of the quaternion. - /// + /// Returns the length of the quaternion. + /// /// @see gtx_simd_quat float length( detail::fquatSIMD const & x); - /// Returns the normalized quaternion. - /// + /// Returns the normalized quaternion. + /// /// @see gtx_simd_quat detail::fquatSIMD normalize( detail::fquatSIMD const & x); - /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... - /// + /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... + /// /// @see gtx_simd_quat float dot( - detail::fquatSIMD const & q1, + detail::fquatSIMD const & q1, detail::fquatSIMD const & q2); /// Spherical linear interpolation of two quaternions. /// The interpolation is oriented and the rotation is performed at constant speed. /// For short path spherical linear interpolation, use the slerp function. - /// + /// /// @param x A quaternion /// @param y A quaternion /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. /// @tparam T Value type used to build the quaternion. Supported: half, float or double. /// @see gtx_simd_quat - /// @see - slerp(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) + /// @see - slerp(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) detail::fquatSIMD mix( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, + detail::fquatSIMD const & x, + detail::fquatSIMD const & y, float const & a); - /// Linear interpolation of two quaternions. + /// Linear interpolation of two quaternions. /// The interpolation is oriented. - /// + /// /// @param x A quaternion /// @param y A quaternion /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. /// @tparam T Value type used to build the quaternion. Supported: half, float or double. /// @see gtx_simd_quat detail::fquatSIMD lerp( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, + detail::fquatSIMD const & x, + detail::fquatSIMD const & y, float const & a); /// Spherical linear interpolation of two quaternions. /// The interpolation always take the short path and the rotation is performed at constant speed. - /// + /// /// @param x A quaternion /// @param y A quaternion /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. /// @tparam T Value type used to build the quaternion. Supported: half, float or double. /// @see gtx_simd_quat detail::fquatSIMD slerp( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, + detail::fquatSIMD const & x, + detail::fquatSIMD const & y, float const & a); @@ -262,10 +267,10 @@ namespace detail /// This will use the equivalent to fastAcos() and fastSin(). /// /// @see gtx_simd_quat - /// @see - mix(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) + /// @see - mix(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) detail::fquatSIMD fastMix( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, + detail::fquatSIMD const & x, + detail::fquatSIMD const & y, float const & a); /// Identical to fastMix() except takes the shortest path. @@ -273,22 +278,22 @@ namespace detail /// The same rules apply here as those in fastMix(). Both quaternions must be unit length and 'a' must be /// in the range [0, 1]. /// - /// @see - fastMix(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) - /// @see - slerp(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) + /// @see - fastMix(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) + /// @see - slerp(detail::fquatSIMD const & x, detail::fquatSIMD const & y, T const & a) detail::fquatSIMD fastSlerp( - detail::fquatSIMD const & x, - detail::fquatSIMD const & y, + detail::fquatSIMD const & x, + detail::fquatSIMD const & y, float const & a); - /// Returns the q conjugate. - /// + /// Returns the q conjugate. + /// /// @see gtx_simd_quat detail::fquatSIMD conjugate( detail::fquatSIMD const & q); - /// Returns the q inverse. - /// + /// Returns the q inverse. + /// /// @see gtx_simd_quat detail::fquatSIMD inverse( detail::fquatSIMD const & q); @@ -296,14 +301,14 @@ namespace detail /// Build a quaternion from an angle and a normalized axis. /// /// @param angle Angle expressed in radians. - /// @param axis Axis of the quaternion, must be normalized. + /// @param axis Axis of the quaternion, must be normalized. /// /// @see gtx_simd_quat detail::fquatSIMD angleAxisSIMD( - float const & angle, + float const & angle, vec3 const & axis); - /// Build a quaternion from an angle and a normalized axis. + /// Build a quaternion from an angle and a normalized axis. /// /// @param angle Angle expressed in radians. /// @param x x component of the x-axis, x, y, z must be a normalized axis @@ -312,9 +317,9 @@ namespace detail /// /// @see gtx_simd_quat detail::fquatSIMD angleAxisSIMD( - float const & angle, - float const & x, - float const & y, + float const & angle, + float const & x, + float const & y, float const & z); // TODO: Move this to somewhere more appropriate. Used with fastMix() and fastSlerp(). diff --git a/external/glm/glm/gtx/simd_quat.inl b/external/glm/glm/gtx/simd_quat.inl index f9dd4c003..2fcc7fe4e 100644 --- a/external/glm/glm/gtx/simd_quat.inl +++ b/external/glm/glm/gtx/simd_quat.inl @@ -55,21 +55,24 @@ void print(const fvec4SIMD &v) ////////////////////////////////////// // Implicit basic constructors -GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD() -# ifdef GLM_FORCE_NO_CTOR_INIT - : Data(_mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f)) +# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD() +# ifdef GLM_FORCE_NO_CTOR_INIT + : Data(_mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f)) +# endif + {} # endif -{} + +# if !GLM_HAS_DEFAULTED_FUNCTIONS + GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(fquatSIMD const & q) : + Data(q.Data) + {} +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(__m128 const & Data) : Data(Data) {} -GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(fquatSIMD const & q) : - Data(q.Data) -{} - - ////////////////////////////////////// // Explicit basic constructors @@ -83,25 +86,27 @@ GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(quat const & q) : GLM_FUNC_QUALIFIER fquatSIMD::fquatSIMD(vec3 const & eulerAngles) { - vec3 c = glm::cos(eulerAngles * 0.5f); + vec3 c = glm::cos(eulerAngles * 0.5f); vec3 s = glm::sin(eulerAngles * 0.5f); - Data = _mm_set_ps( - (c.x * c.y * c.z) + (s.x * s.y * s.z), - (c.x * c.y * s.z) - (s.x * s.y * c.z), - (c.x * s.y * c.z) + (s.x * c.y * s.z), - (s.x * c.y * c.z) - (c.x * s.y * s.z)); + Data = _mm_set_ps( + (c.x * c.y * c.z) + (s.x * s.y * s.z), + (c.x * c.y * s.z) - (s.x * s.y * c.z), + (c.x * s.y * c.z) + (s.x * c.y * s.z), + (s.x * c.y * c.z) - (c.x * s.y * s.z)); } ////////////////////////////////////// // Unary arithmetic operators -GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator=(fquatSIMD const & q) -{ - this->Data = q.Data; - return *this; -} +#if !GLM_HAS_DEFAULTED_FUNCTIONS + GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator=(fquatSIMD const & q) + { + this->Data = q.Data; + return *this; + } +#endif//!GLM_HAS_DEFAULTED_FUNCTIONS GLM_FUNC_QUALIFIER fquatSIMD& fquatSIMD::operator*=(float const & s) { diff --git a/external/glm/glm/gtx/simd_vec4.hpp b/external/glm/glm/gtx/simd_vec4.hpp index 2d836a41b..cb084852e 100644 --- a/external/glm/glm/gtx/simd_vec4.hpp +++ b/external/glm/glm/gtx/simd_vec4.hpp @@ -8,14 +8,14 @@ /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell /// copies of the Software, and to permit persons to whom the Software is /// furnished to do so, subject to the following conditions: -/// +/// /// The above copyright notice and this permission notice shall be included in /// all copies or substantial portions of the Software. -/// +/// /// Restrictions: /// By making use of the Software for military purposes, you choose to make /// a Bunny unhappy. -/// +/// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -33,9 +33,9 @@ /// /// @defgroup gtx_simd_vec4 GLM_GTX_simd_vec4 /// @ingroup gtx -/// +/// /// @brief SIMD implementation of vec4 type. -/// +/// /// need to be included to use these functionalities. /////////////////////////////////////////////////////////////////////////////////// @@ -92,13 +92,18 @@ namespace detail /// \ingroup gtx_simd_vec4 GLM_ALIGNED_STRUCT(16) fvec4SIMD { - typedef __m128 value_type; + typedef float value_type; typedef std::size_t size_type; - static size_type value_size(); typedef fvec4SIMD type; + typedef tvec4 pure_type; typedef tvec4 bool_type; +# ifdef GLM_META_PROG_HELPERS + static GLM_RELAXED_CONSTEXPR length_t components = 4; + static GLM_RELAXED_CONSTEXPR precision prec = defaultp; +# endif//GLM_META_PROG_HELPERS + #ifdef GLM_SIMD_ENABLE_XYZW_UNION union { @@ -112,9 +117,9 @@ namespace detail ////////////////////////////////////// // Implicit basic constructors - fvec4SIMD(); + fvec4SIMD() GLM_DEFAULT_CTOR; + fvec4SIMD(fvec4SIMD const & v) GLM_DEFAULT; fvec4SIMD(__m128 const & Data); - fvec4SIMD(fvec4SIMD const & v); ////////////////////////////////////// // Explicit basic constructors @@ -124,9 +129,9 @@ namespace detail explicit fvec4SIMD( float const & s); explicit fvec4SIMD( - float const & x, - float const & y, - float const & z, + float const & x, + float const & y, + float const & z, float const & w); explicit fvec4SIMD( vec4 const & v); @@ -145,7 +150,7 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators - fvec4SIMD& operator= (fvec4SIMD const & v); + fvec4SIMD& operator= (fvec4SIMD const & v) GLM_DEFAULT; fvec4SIMD& operator+=(fvec4SIMD const & v); fvec4SIMD& operator-=(fvec4SIMD const & v); fvec4SIMD& operator*=(fvec4SIMD const & v); @@ -213,13 +218,13 @@ namespace detail //! Returns a value equal to the nearest integer to x. //! A fractional part of 0.5 will round toward the nearest even - //! integer. (Both 3.5 and 4.5 for x will return 4.0.) + //! integer. (Both 3.5 and 4.5 for x will return 4.0.) /// /// @see gtx_simd_vec4 //detail::fvec4SIMD roundEven(detail::fvec4SIMD const & x); - //! Returns a value equal to the nearest integer - //! that is greater than or equal to x. + //! Returns a value equal to the nearest integer + //! that is greater than or equal to x. /// @see gtx_simd_vec4 detail::fvec4SIMD ceil(detail::fvec4SIMD const & x); @@ -233,7 +238,7 @@ namespace detail /// /// @see gtx_simd_vec4 detail::fvec4SIMD mod( - detail::fvec4SIMD const & x, + detail::fvec4SIMD const & x, detail::fvec4SIMD const & y); //! Modulus. Returns x - y * floor(x / y) @@ -241,7 +246,7 @@ namespace detail /// /// @see gtx_simd_vec4 detail::fvec4SIMD mod( - detail::fvec4SIMD const & x, + detail::fvec4SIMD const & x, float const & y); //! Returns the fractional part of x and sets i to the integer @@ -250,51 +255,51 @@ namespace detail //! sign as x. //! (From GLM_GTX_simd_vec4 extension, common function) //detail::fvec4SIMD modf( - // detail::fvec4SIMD const & x, + // detail::fvec4SIMD const & x, // detail::fvec4SIMD & i); //! Returns y if y < x; otherwise, it returns x. - /// + /// /// @see gtx_simd_vec4 detail::fvec4SIMD min( - detail::fvec4SIMD const & x, + detail::fvec4SIMD const & x, detail::fvec4SIMD const & y); detail::fvec4SIMD min( - detail::fvec4SIMD const & x, + detail::fvec4SIMD const & x, float const & y); //! Returns y if x < y; otherwise, it returns x. /// /// @see gtx_simd_vec4 detail::fvec4SIMD max( - detail::fvec4SIMD const & x, + detail::fvec4SIMD const & x, detail::fvec4SIMD const & y); detail::fvec4SIMD max( - detail::fvec4SIMD const & x, + detail::fvec4SIMD const & x, float const & y); - //! Returns min(max(x, minVal), maxVal) for each component in x + //! Returns min(max(x, minVal), maxVal) for each component in x //! using the floating-point values minVal and maxVal. /// /// @see gtx_simd_vec4 detail::fvec4SIMD clamp( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & minVal, - detail::fvec4SIMD const & maxVal); + detail::fvec4SIMD const & x, + detail::fvec4SIMD const & minVal, + detail::fvec4SIMD const & maxVal); detail::fvec4SIMD clamp( - detail::fvec4SIMD const & x, - float const & minVal, - float const & maxVal); + detail::fvec4SIMD const & x, + float const & minVal, + float const & maxVal); - //! \return If genTypeU is a floating scalar or vector: - //! Returns x * (1.0 - a) + y * a, i.e., the linear blend of - //! x and y using the floating-point value a. + //! \return If genTypeU is a floating scalar or vector: + //! Returns x * (1.0 - a) + y * a, i.e., the linear blend of + //! x and y using the floating-point value a. //! The value for a is not restricted to the range [0, 1]. //! - //! \return If genTypeU is a boolean scalar or vector: + //! \return If genTypeU is a boolean scalar or vector: //! Selects which vector each returned component comes //! from. For a component of a that is false, the //! corresponding component of x is returned. For a @@ -305,9 +310,9 @@ namespace detail //! provides different functionality than //! genType mix(genType x, genType y, genType(a)) //! where a is a Boolean vector. - //! + //! //! From GLSL 1.30.08 specification, section 8.3 - //! + //! //! \param[in] x Floating point scalar or vector. //! \param[in] y Floating point scalar or vector. //! \param[in] a Floating point or boolean scalar or vector. @@ -316,19 +321,19 @@ namespace detail /// /// @see gtx_simd_vec4 detail::fvec4SIMD mix( - detail::fvec4SIMD const & x, - detail::fvec4SIMD const & y, + detail::fvec4SIMD const & x, + detail::fvec4SIMD const & y, detail::fvec4SIMD const & a); //! Returns 0.0 if x < edge, otherwise it returns 1.0. /// /// @see gtx_simd_vec4 detail::fvec4SIMD step( - detail::fvec4SIMD const & edge, + detail::fvec4SIMD const & edge, detail::fvec4SIMD const & x); detail::fvec4SIMD step( - float const & edge, + float const & edge, detail::fvec4SIMD const & x); //! Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and @@ -343,13 +348,13 @@ namespace detail /// /// @see gtx_simd_vec4 detail::fvec4SIMD smoothstep( - detail::fvec4SIMD const & edge0, - detail::fvec4SIMD const & edge1, + detail::fvec4SIMD const & edge0, + detail::fvec4SIMD const & edge1, detail::fvec4SIMD const & x); detail::fvec4SIMD smoothstep( - float const & edge0, - float const & edge1, + float const & edge0, + float const & edge1, detail::fvec4SIMD const & x); //! Returns true if x holds a NaN (not a number) @@ -390,8 +395,8 @@ namespace detail /// /// @see gtx_simd_vec4 detail::fvec4SIMD fma( - detail::fvec4SIMD const & a, - detail::fvec4SIMD const & b, + detail::fvec4SIMD const & a, + detail::fvec4SIMD const & b, detail::fvec4SIMD const & c); //! Splits x into a floating-point significand in the range diff --git a/external/glm/glm/gtx/simd_vec4.inl b/external/glm/glm/gtx/simd_vec4.inl index ba5387c27..e375073f0 100644 --- a/external/glm/glm/gtx/simd_vec4.inl +++ b/external/glm/glm/gtx/simd_vec4.inl @@ -19,20 +19,24 @@ struct shuffle_mask ////////////////////////////////////// // Implicit basic constructors -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD() -# ifdef GLM_FORCE_NO_CTOR_INIT - : Data(_mm_set_ps(0.0f, 0.0f, 0.0f, 0.0f)) -# endif -{} +#if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) + GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD() +# ifdef GLM_FORCE_NO_CTOR_INIT + : Data(_mm_set_ps(0.0f, 0.0f, 0.0f, 0.0f)) +# endif + {} +#endif//!GLM_HAS_DEFAULTED_FUNCTIONS + +#if !GLM_HAS_DEFAULTED_FUNCTIONS + GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) : + Data(v.Data) + {} +#endif//!GLM_HAS_DEFAULTED_FUNCTIONS GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(__m128 const & Data) : Data(Data) {} -GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) : - Data(v.Data) -{} - GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec4 const & v) : Data(_mm_set_ps(v.w, v.z, v.y, v.x)) {} @@ -92,11 +96,13 @@ GLM_FUNC_QUALIFIER fvec4SIMD::fvec4SIMD(vec2 const & v1, vec2 const & v2) : ////////////////////////////////////// // Unary arithmetic operators -GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator=(fvec4SIMD const & v) -{ - this->Data = v.Data; - return *this; -} +#if !GLM_HAS_DEFAULTED_FUNCTIONS + GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator=(fvec4SIMD const & v) + { + this->Data = v.Data; + return *this; + } +#endif//!GLM_HAS_DEFAULTED_FUNCTIONS GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::operator+=(float const & s) { diff --git a/external/glm/glm/gtx/string_cast.hpp b/external/glm/glm/gtx/string_cast.hpp index e04320c04..c292efd1c 100644 --- a/external/glm/glm/gtx/string_cast.hpp +++ b/external/glm/glm/gtx/string_cast.hpp @@ -48,6 +48,8 @@ // Dependency: #include "../glm.hpp" #include "../gtc/type_precision.hpp" +#include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" #include #if(GLM_COMPILER & GLM_COMPILER_CUDA) diff --git a/external/glm/glm/gtx/string_cast.inl b/external/glm/glm/gtx/string_cast.inl index fb70ebc00..c21fa75fb 100644 --- a/external/glm/glm/gtx/string_cast.inl +++ b/external/glm/glm/gtx/string_cast.inl @@ -444,6 +444,38 @@ namespace detail x[3][0], x[3][1], x[3][2], x[3][3]); } }; + + + template + struct compute_to_string + { + GLM_FUNC_QUALIFIER static std::string call(tquat const & x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%squat(%s, %s, %s, %s)", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), x[0], x[1], x[2], x[3]); + } + }; + + template + struct compute_to_string + { + GLM_FUNC_QUALIFIER static std::string call(tdualquat const & x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%sdualquat((%s, %s, %s, %s), (%s, %s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), x.real[0], x.real[1], x.real[2], x.real[3], x.dual[0], x.dual[1], x.dual[2], x.dual[3]); + } + }; + }//namespace detail template