diff --git a/CMakeLists.txt b/CMakeLists.txt index a03df974..5925d5fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,18 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" option(GLM_TEST_ENABLE_CXX_0X "Enable C++ 0x" OFF) option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF) option(GLM_TEST_ENABLE_CXX_1Y "Enable C++ 1y" OFF) + option(GLM_TEST_ENABLE_CXX_14 "Enable C++ 14" OFF) + option(GLM_TEST_ENABLE_CXX_1Z "Enable C++ 1z" OFF) - if(GLM_TEST_ENABLE_CXX_1Y) + if(GLM_TEST_ENABLE_CXX_1Z) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++1z") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + set(CMAKE_CXX_FLAGS "-std=c++1Z") + elseif(GLM_TEST_ENABLE_CXX_14) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + set(CMAKE_CXX_FLAGS "-std=c++14") + elseif(GLM_TEST_ENABLE_CXX_1Y) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++1y") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") set(CMAKE_CXX_FLAGS "-std=c++1y") @@ -64,8 +74,6 @@ if(GLM_TEST_FORCE_PURE) if(CMAKE_COMPILER_IS_GNUCXX) add_definitions(-mfpmath=387) - elseif(MSVC) - add_definitions(/arch:IA32) endif() elseif(GLM_TEST_ENABLE_SIMD_AVX2) if(CMAKE_COMPILER_IS_GNUCXX) @@ -121,8 +129,8 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX) #add_definitions(-S) #add_definitions(-s) - #add_definitions(-m32) - #add_definitions(-O3) + add_definitions(-m64) + add_definitions(-O2) #add_definitions(-fprofile-arcs -ftest-coverage) gcov #ctest_enable_coverage() diff --git a/copying.txt b/copying.txt index 0b3b5acf..ec06e46e 100644 --- a/copying.txt +++ b/copying.txt @@ -1,12 +1,13 @@ ================================================================================ OpenGL Mathematics (GLM) -------------------------------------------------------------------------------- -GLM is licensed under The Happy Bunny License and MIT License +GLM can be distributed and/or modified under the terms of either +a) The Happy Bunny License, or b) the MIT License. ================================================================================ The Happy Bunny License (Modified MIT License) -------------------------------------------------------------------------------- -Copyright (c) 2005 - 2014 G-Truc Creation +Copyright (c) 2005 - 2015 G-Truc Creation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -33,7 +34,7 @@ THE SOFTWARE. ================================================================================ The MIT License -------------------------------------------------------------------------------- -Copyright (c) 2005 - 2014 G-Truc Creation +Copyright (c) 2005 - 2015 G-Truc Creation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/doc/glm.docx b/doc/glm.docx index ef80499b..80add995 100644 Binary files a/doc/glm.docx and b/doc/glm.docx differ diff --git a/doc/glm.pdf b/doc/glm.pdf index dc00efee..2ddc9e87 100644 Binary files a/doc/glm.pdf and b/doc/glm.pdf differ diff --git a/doc/~$glm.docx b/doc/~$glm.docx deleted file mode 100644 index db258f22..00000000 Binary files a/doc/~$glm.docx and /dev/null differ diff --git a/glm/CMakeLists.txt b/glm/CMakeLists.txt index 9dbe11ca..aaeae626 100644 --- a/glm/CMakeLists.txt +++ b/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_NAT ../util/glm.natvis) file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) @@ -31,7 +32,7 @@ source_group("GTX Files" FILES ${GTX_HEADER}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) if(GLM_TEST_ENABLE) - add_executable(${NAME} ${ROOT_TEXT} + add_executable(${NAME} ${ROOT_TEXT} ${ROOT_NAT} ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} diff --git a/glm/common.hpp b/glm/common.hpp index 8f1c3171..b2ff9da1 100644 --- a/glm/common.hpp +++ b/glm/common.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/_features.hpp b/glm/detail/_features.hpp index 51eda577..b0aa3036 100644 --- a/glm/detail/_features.hpp +++ b/glm/detail/_features.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/_fixes.hpp b/glm/detail/_fixes.hpp index 6185dcbb..0405f33a 100644 --- a/glm/detail/_fixes.hpp +++ b/glm/detail/_fixes.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/_noise.hpp b/glm/detail/_noise.hpp index 94c835d5..e8875976 100644 --- a/glm/detail/_noise.hpp +++ b/glm/detail/_noise.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/_swizzle.hpp b/glm/detail/_swizzle.hpp index 3edf6cb2..2f23d0e1 100644 --- a/glm/detail/_swizzle.hpp +++ b/glm/detail/_swizzle.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/_swizzle_func.hpp b/glm/detail/_swizzle_func.hpp index 7d725e10..464109d4 100644 --- a/glm/detail/_swizzle_func.hpp +++ b/glm/detail/_swizzle_func.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/_vectorize.hpp b/glm/detail/_vectorize.hpp index 8eea6b87..53cf5b37 100644 --- a/glm/detail/_vectorize.hpp +++ b/glm/detail/_vectorize.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/dummy.cpp b/glm/detail/dummy.cpp index 8392ede9..50342809 100644 --- a/glm/detail/dummy.cpp +++ b/glm/detail/dummy.cpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -34,7 +34,8 @@ /////////////////////////////////////////////////////////////////////////////////// #define GLM_MESSAGES -#include "../glm.hpp" +#include +#include #include struct material @@ -213,10 +214,19 @@ typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) int main() { - glm::vec4 v(1); - float a = normalizeDotA(v, v); - float b = normalizeDotB(v, v); - float c = normalizeDotC(v, v); + glm::vec1 o(1); + glm::vec2 a(1); + glm::vec3 b(1); + glm::vec4 c(1); + + glm::quat q; + glm::dualquat p; + + glm::mat4 m(1); + + float a0 = normalizeDotA(a, a); + float b0 = normalizeDotB(b, b); + float c0 = normalizeDotC(c, c); return 0; } diff --git a/glm/detail/func_common.hpp b/glm/detail/func_common.hpp index 0cea4942..08b69c80 100644 --- a/glm/detail/func_common.hpp +++ b/glm/detail/func_common.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index cd04085e..83252de4 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -546,7 +546,7 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); -# if GLM_LANG & GLM_LANG_CXX11_FLAG +# if GLM_HAS_CXX11_STL return std::isnan(x); # elif GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL) return _isnan(x) != 0; @@ -580,17 +580,17 @@ namespace detail { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); -# if(GLM_LANG & GLM_LANG_CXX11_FLAG) +# if GLM_HAS_CXX11_STL return std::isinf(x); -# elif(GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC)) +# elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -# elif(GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))) +# 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; # else return std::isinf(x); # endif -# elif(GLM_COMPILER & GLM_COMPILER_CUDA) +# elif GLM_COMPILER & GLM_COMPILER_CUDA // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab return isinf(double(x)) != 0; # else diff --git a/glm/detail/func_exponential.hpp b/glm/detail/func_exponential.hpp index 9b4840bb..9277990b 100644 --- a/glm/detail/func_exponential.hpp +++ b/glm/detail/func_exponential.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_exponential.inl b/glm/detail/func_exponential.inl index 830ac42b..d5583922 100644 --- a/glm/detail/func_exponential.inl +++ b/glm/detail/func_exponential.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -39,7 +39,7 @@ namespace glm{ namespace detail { -# if GLM_LANG & GLM_LANG_CXX11_FLAG +# if GLM_HAS_CXX11_STL using std::log2; # else template diff --git a/glm/detail/func_geometric.hpp b/glm/detail/func_geometric.hpp index a8ab7811..cdbcc7b8 100644 --- a/glm/detail/func_geometric.hpp +++ b/glm/detail/func_geometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -104,11 +104,11 @@ namespace glm /// /// @see GLSL faceforward man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL genType faceforward( - genType const & N, - genType const & I, - genType const & Nref); + template class vecType> + GLM_FUNC_DECL vecType faceforward( + vecType const & N, + vecType const & I, + vecType const & Nref); /// For the incident vector I and surface orientation N, /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. diff --git a/glm/detail/func_geometric.inl b/glm/detail/func_geometric.inl index 93709887..0673718b 100644 --- a/glm/detail/func_geometric.inl +++ b/glm/detail/func_geometric.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -165,6 +165,12 @@ namespace detail return dot(Nref, I) < static_cast(0) ? N : -N; } + template class vecType> + GLM_FUNC_QUALIFIER vecType faceforward(vecType const & N, vecType const & I, vecType const & Nref) + { + return dot(Nref, I) < static_cast(0) ? N : -N; + } + // reflect template GLM_FUNC_QUALIFIER genType reflect(genType const & I, genType const & N) diff --git a/glm/detail/func_integer.hpp b/glm/detail/func_integer.hpp index 19401fb8..fa32fa1e 100644 --- a/glm/detail/func_integer.hpp +++ b/glm/detail/func_integer.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl index f84304e5..31eddf9b 100644 --- a/glm/detail/func_integer.inl +++ b/glm/detail/func_integer.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -116,6 +116,7 @@ namespace detail } }; +# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) template struct compute_findLSB { @@ -126,6 +127,7 @@ namespace detail return IsNotNull ? int(Result) : -1; } }; +# endif # endif//GLM_HAS_BITSCAN_WINDOWS template class vecType, bool EXEC = true> @@ -171,14 +173,6 @@ namespace detail return IsNotNull ? int(Result) : -1; } - template - GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - template class vecType> struct compute_findMSB_vec { @@ -188,6 +182,15 @@ namespace detail } }; +# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) + template + GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + template class vecType> struct compute_findMSB_vec { @@ -196,6 +199,7 @@ namespace detail return detail::functor1::call(compute_findMSB_64, x); } }; +# endif # endif//GLM_HAS_BITSCAN_WINDOWS }//namespace detail @@ -203,7 +207,7 @@ namespace detail GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry) { uint64 const Value64(static_cast(x) + static_cast(y)); - uint64 const Max32(static_cast(std::numeric_limits::max())); + uint64 const Max32((static_cast(1) << static_cast(32)) - static_cast(1)); Carry = Value64 > Max32 ? 1 : 0; return static_cast(Value64 % (Max32 + static_cast(1))); } diff --git a/glm/detail/func_matrix.hpp b/glm/detail/func_matrix.hpp index 54f86e87..5a9cb11f 100644 --- a/glm/detail/func_matrix.hpp +++ b/glm/detail/func_matrix.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_matrix.inl b/glm/detail/func_matrix.inl index afefb67e..1ebed1fb 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_noise.hpp b/glm/detail/func_noise.hpp index 969a4c9d..a8270879 100644 --- a/glm/detail/func_noise.hpp +++ b/glm/detail/func_noise.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_noise.inl b/glm/detail/func_noise.inl index 8910a5ae..10901e69 100644 --- a/glm/detail/func_noise.inl +++ b/glm/detail/func_noise.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_packing.hpp b/glm/detail/func_packing.hpp index 02d26926..bce0fe52 100644 --- a/glm/detail/func_packing.hpp +++ b/glm/detail/func_packing.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -111,7 +111,7 @@ namespace glm /// /// @see GLSL unpackUnorm2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackUnorm2x16(uint const & p); + GLM_FUNC_DECL vec2 unpackUnorm2x16(uint p); /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. @@ -124,7 +124,7 @@ namespace glm /// /// @see GLSL unpackSnorm2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackSnorm2x16(uint const & p); + GLM_FUNC_DECL vec2 unpackSnorm2x16(uint p); /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. @@ -137,7 +137,7 @@ namespace glm /// /// @see GLSL unpackUnorm4x8 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec4 unpackUnorm4x8(uint const & p); + GLM_FUNC_DECL vec4 unpackUnorm4x8(uint p); /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. @@ -150,7 +150,7 @@ namespace glm /// /// @see GLSL unpackSnorm4x8 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec4 unpackSnorm4x8(uint const & p); + GLM_FUNC_DECL vec4 unpackSnorm4x8(uint p); /// Returns a double-precision value obtained by packing the components of v into a 64-bit value. /// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. @@ -169,7 +169,7 @@ namespace glm /// /// @see GLSL unpackDouble2x32 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uvec2 unpackDouble2x32(double const & v); + GLM_FUNC_DECL uvec2 unpackDouble2x32(double v); /// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector /// to the 16-bit floating-point representation found in the OpenGL Specification, @@ -189,7 +189,7 @@ namespace glm /// /// @see GLSL unpackHalf2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackHalf2x16(uint const & v); + GLM_FUNC_DECL vec2 unpackHalf2x16(uint v); /// @} }//namespace glm diff --git a/glm/detail/func_packing.inl b/glm/detail/func_packing.inl index b37ff9aa..3132a279 100644 --- a/glm/detail/func_packing.inl +++ b/glm/detail/func_packing.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -38,13 +38,11 @@ namespace glm { GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v) { - u16vec2 Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); - // return reinterpret_cast(Topack); - uint* ptr(reinterpret_cast(&Topack)); - return *ptr; + u16vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); + return reinterpret_cast(Topack); } - GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint const & p) + GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p) { vec2 Unpack(reinterpret_cast(p)); return Unpack * float(1.5259021896696421759365224689097e-5); // 1.0 / 65535.0 @@ -52,15 +50,13 @@ namespace glm GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v) { - i16vec2 Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - // return reinterpret_cast(Topack); - uint* ptr(reinterpret_cast(&Topack)); - return *ptr; + i16vec2 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); + return reinterpret_cast(Topack); } - GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint const & p) + GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p) { - vec2 Unpack(reinterpret_cast(p)); + vec2 const Unpack(reinterpret_cast(p)); return clamp( Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, -1.0f, 1.0f); @@ -68,25 +64,25 @@ namespace glm GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v) { - u8vec4 Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - return reinterpret_cast(Topack); + u8vec4 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + return reinterpret_cast(Topack); } - GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint const & p) + GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p) { - vec4 Unpack(reinterpret_cast(p)); + vec4 const Unpack(reinterpret_cast(p)); return Unpack * float(0.0039215686274509803921568627451); // 1 / 255 } GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const & v) { - i8vec4 Topack(round(clamp(v ,-1.0f, 1.0f) * 127.0f)); - return reinterpret_cast(Topack); + i8vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 127.0f)); + return reinterpret_cast(Topack); } - GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint const & p) + GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p) { - vec4 Unpack(reinterpret_cast(p)); + vec4 const Unpack(reinterpret_cast(p)); return clamp( Unpack * 0.0078740157480315f, // 1.0f / 127.0f -1.0f, 1.0f); @@ -97,24 +93,23 @@ namespace glm return reinterpret_cast(v); } - GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double const & v) + GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v) { return reinterpret_cast(v); } GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v) { - i16vec2 Unpack( + i16vec2 const Unpack( detail::toFloat16(v.x), detail::toFloat16(v.y)); - uint * Result = reinterpret_cast(&Unpack); - return *Result; + return reinterpret_cast(Unpack); } - GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint const & v) + GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v) { - i16vec2 Unpack(reinterpret_cast(v)); + i16vec2 const Unpack(reinterpret_cast(v)); return vec2( detail::toFloat32(Unpack.x), diff --git a/glm/detail/func_trigonometric.hpp b/glm/detail/func_trigonometric.hpp index c51161ae..d43961ba 100644 --- a/glm/detail/func_trigonometric.hpp +++ b/glm/detail/func_trigonometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index fb12081c..a7105250 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -162,7 +162,7 @@ namespace glm } // asinh -# if GLM_LANG & GLM_LANG_CXX11_FLAG +# if GLM_HAS_CXX11_STL using std::asinh; # else template @@ -181,7 +181,7 @@ namespace glm } // acosh -# if GLM_LANG & GLM_LANG_CXX11_FLAG +# if GLM_HAS_CXX11_STL using std::acosh; # else template @@ -202,7 +202,7 @@ namespace glm } // atanh -# if GLM_LANG & GLM_LANG_CXX11_FLAG +# if GLM_HAS_CXX11_STL using std::atanh; # else template diff --git a/glm/detail/func_vector_relational.hpp b/glm/detail/func_vector_relational.hpp index 4b2b8abb..9252fcd5 100644 --- a/glm/detail/func_vector_relational.hpp +++ b/glm/detail/func_vector_relational.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/func_vector_relational.inl b/glm/detail/func_vector_relational.inl index 692fe975..72106d6e 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/glm.cpp b/glm/detail/glm.cpp index 2e03e319..d48b47c2 100644 --- a/glm/detail/glm.cpp +++ b/glm/detail/glm.cpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_common.hpp b/glm/detail/intrinsic_common.hpp index 5521c193..8cb1a1c6 100644 --- a/glm/detail/intrinsic_common.hpp +++ b/glm/detail/intrinsic_common.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_common.inl b/glm/detail/intrinsic_common.inl index 6d16cf43..bd9774bb 100644 --- a/glm/detail/intrinsic_common.inl +++ b/glm/detail/intrinsic_common.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -301,13 +301,13 @@ GLM_FUNC_QUALIFIER __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) // By Elan Ruskin, http://assemblyrequired.crashworks.org/ GLM_FUNC_QUALIFIER __m128 sse_sqrt_wip_ss(__m128 const & x) { - __m128 recip = _mm_rsqrt_ss(x); // "estimate" opcode - const static __m128 three = {3, 3, 3, 3}; // aligned consts for fast load - const static __m128 half = {0.5,0.5,0.5,0.5}; - __m128 halfrecip = _mm_mul_ss(half, recip); - __m128 threeminus_xrr = _mm_sub_ss(three, _mm_mul_ss(x, _mm_mul_ss (recip, recip))); - return _mm_mul_ss( halfrecip, threeminus_xrr); + __m128 const recip = _mm_rsqrt_ss(x); // "estimate" opcode + __m128 const half = _mm_set_ps1(0.5f); + __m128 const halfrecip = _mm_mul_ss(half, recip); + __m128 const threeminus_xrr = _mm_sub_ss(three, _mm_mul_ss(x, _mm_mul_ss (recip, recip))); + return _mm_mul_ss(halfrecip, threeminus_xrr); } }//namespace detail }//namespace glms + diff --git a/glm/detail/intrinsic_exponential.hpp b/glm/detail/intrinsic_exponential.hpp index abb15157..96d0129c 100644 --- a/glm/detail/intrinsic_exponential.hpp +++ b/glm/detail/intrinsic_exponential.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_exponential.inl b/glm/detail/intrinsic_exponential.inl index 17fccb83..9dba23cd 100644 --- a/glm/detail/intrinsic_exponential.inl +++ b/glm/detail/intrinsic_exponential.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_geometric.hpp b/glm/detail/intrinsic_geometric.hpp index 1a76fd96..ecfbb032 100644 --- a/glm/detail/intrinsic_geometric.hpp +++ b/glm/detail/intrinsic_geometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_geometric.inl b/glm/detail/intrinsic_geometric.inl index ae8c7928..3a3e4b08 100644 --- a/glm/detail/intrinsic_geometric.inl +++ b/glm/detail/intrinsic_geometric.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_matrix.hpp b/glm/detail/intrinsic_matrix.hpp index 4d92a4e0..e41b162c 100644 --- a/glm/detail/intrinsic_matrix.hpp +++ b/glm/detail/intrinsic_matrix.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_matrix.inl b/glm/detail/intrinsic_matrix.inl index fb89a53e..380ffe4a 100644 --- a/glm/detail/intrinsic_matrix.inl +++ b/glm/detail/intrinsic_matrix.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_trigonometric.hpp b/glm/detail/intrinsic_trigonometric.hpp index 41b7c30d..bf2c9e22 100644 --- a/glm/detail/intrinsic_trigonometric.hpp +++ b/glm/detail/intrinsic_trigonometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_trigonometric.inl b/glm/detail/intrinsic_trigonometric.inl index 9f8ead1e..5941ca31 100644 --- a/glm/detail/intrinsic_trigonometric.inl +++ b/glm/detail/intrinsic_trigonometric.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_vector_relational.hpp b/glm/detail/intrinsic_vector_relational.hpp index a19ad681..fe7e902b 100644 --- a/glm/detail/intrinsic_vector_relational.hpp +++ b/glm/detail/intrinsic_vector_relational.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/intrinsic_vector_relational.inl b/glm/detail/intrinsic_vector_relational.inl index 1042661d..e7445edc 100644 --- a/glm/detail/intrinsic_vector_relational.inl +++ b/glm/detail/intrinsic_vector_relational.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/precision.hpp b/glm/detail/precision.hpp index 1b6d542d..2be5e238 100644 --- a/glm/detail/precision.hpp +++ b/glm/detail/precision.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index c2251546..1defed89 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -44,6 +44,11 @@ #define GLM_VERSION_PATCH 7 #define GLM_VERSION_REVISION 0 +#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_VERSION_DISPLAYED)) +# define GLM_MESSAGE_VERSION_DISPLAYED +# pragma message ("GLM: version 0.9.7") +#endif//GLM_MESSAGE + /////////////////////////////////////////////////////////////////////////////////// // Platform @@ -329,88 +334,132 @@ /////////////////////////////////////////////////////////////////////////////////// // C++ Version -// User defines: GLM_FORCE_CXX98 +// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14 #define GLM_LANG_CXX98_FLAG (1 << 1) #define GLM_LANG_CXX03_FLAG (1 << 2) #define GLM_LANG_CXX0X_FLAG (1 << 3) #define GLM_LANG_CXX11_FLAG (1 << 4) #define GLM_LANG_CXX1Y_FLAG (1 << 5) -#define GLM_LANG_CXXMS_FLAG (1 << 6) -#define GLM_LANG_CXXGNU_FLAG (1 << 7) +#define GLM_LANG_CXX14_FLAG (1 << 6) +#define GLM_LANG_CXX1Z_FLAG (1 << 7) +#define GLM_LANG_CXXMS_FLAG (1 << 8) +#define GLM_LANG_CXXGNU_FLAG (1 << 9) #define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) #define GLM_LANG_CXX1Y (GLM_LANG_CXX11 | GLM_LANG_CXX1Y_FLAG) +#define GLM_LANG_CXX14 (GLM_LANG_CXX1Y | GLM_LANG_CXX14_FLAG) +#define GLM_LANG_CXX1Z (GLM_LANG_CXX14 | GLM_LANG_CXX1Z_FLAG) #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG -#if defined(GLM_FORCE_CXX1Y) -# define GLM_LANG GLM_LANG_CXX1Y +#if defined(GLM_FORCE_CXX14) +# undef GLM_FORCE_CXX11 +# undef GLM_FORCE_CXX03 +# undef GLM_FORCE_CXX98 +# define GLM_LANG GLM_LANG_CXX14 #elif defined(GLM_FORCE_CXX11) +# undef GLM_FORCE_CXX03 +# undef GLM_FORCE_CXX98 # define GLM_LANG GLM_LANG_CXX11 #elif defined(GLM_FORCE_CXX03) +# undef GLM_FORCE_CXX98 # define GLM_LANG GLM_LANG_CXX03 #elif defined(GLM_FORCE_CXX98) # define GLM_LANG GLM_LANG_CXX98 #else -# if __cplusplus >= 201103L -# define GLM_LANG GLM_LANG_CXX11 -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# if(GLM_PLATFORM == GLM_PLATFORM_APPLE) -# define GLM_DETAIL_MAJOR 1 -# else -# define GLM_DETAIL_MAJOR 0 -# endif -# if __clang_major__ < (2 + GLM_DETAIL_MAJOR) -# define GLM_LANG GLM_LANG_CXX -# elif __has_feature(cxx_auto_type) +# if GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM) +# if __cplusplus >= 201402L // GLM_COMPILER_LLVM34 + -std=c++14 +# define GLM_LANG GLM_LANG_CXX14 +# elif __has_feature(cxx_decltype_auto) && __has_feature(cxx_aggregate_nsdmi) // GLM_COMPILER_LLVM33 + -std=c++1y +# define GLM_LANG GLM_LANG_CXX1Y +# elif __cplusplus >= 201103L // GLM_COMPILER_LLVM33 + -std=c++11 +# define GLM_LANG GLM_LANG_CXX11 +# elif __has_feature(cxx_static_assert) // GLM_COMPILER_LLVM29 + -std=c++11 # define GLM_LANG GLM_LANG_CXX0X -# else +# elif __cplusplus >= 199711L # define GLM_LANG GLM_LANG_CXX98 +# else +# define GLM_LANG GLM_LANG_CXX # endif # elif GLM_COMPILER & GLM_COMPILER_GCC -# ifdef __GXX_EXPERIMENTAL_CXX0X__ +# if __cplusplus >= 201402L +# define GLM_LANG GLM_LANG_CXX14 +# elif __cplusplus >= 201103L +# define GLM_LANG GLM_LANG_CXX11 +# elif defined(__GXX_EXPERIMENTAL_CXX0X__) # define GLM_LANG GLM_LANG_CXX0X # else # define GLM_LANG GLM_LANG_CXX98 # endif # elif GLM_COMPILER & GLM_COMPILER_VC # ifdef _MSC_EXTENSIONS -# if GLM_COMPILER >= GLM_COMPILER_VC2010 +# if __cplusplus >= 201402L +# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) +//# elif GLM_COMPILER >= GLM_COMPILER_VC2015 +//# define GLM_LANG (GLM_LANG_CXX1Y | GLM_LANG_CXXMS_FLAG) +# elif __cplusplus >= 201103L +# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) +# elif GLM_COMPILER >= GLM_COMPILER_VC2010 # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) -# else +# 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 # else -# if GLM_COMPILER >= GLM_COMPILER_VC2010 +# if __cplusplus >= 201402L +# define GLM_LANG GLM_LANG_CXX14 +//# elif GLM_COMPILER >= GLM_COMPILER_VC2015 +//# define GLM_LANG GLM_LANG_CXX1Y +# elif __cplusplus >= 201103L +# define GLM_LANG GLM_LANG_CXX11 +# elif GLM_COMPILER >= GLM_COMPILER_VC2010 # define GLM_LANG GLM_LANG_CXX0X -# else +# elif __cplusplus >= 199711L # define GLM_LANG GLM_LANG_CXX98 +# else +# define GLM_LANG GLM_LANG_CXX # endif # endif # elif GLM_COMPILER & GLM_COMPILER_INTEL # ifdef _MSC_EXTENSIONS -# if GLM_COMPILER >= GLM_COMPILER_INTEL13 +# 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) -# else +# 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 # else -# if GLM_COMPILER >= GLM_COMPILER_INTEL13 -# define GLM_LANG (GLM_LANG_CXX0X) +# 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_CXX98) +# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) # endif # endif -# else -# if __cplusplus >= 199711L +# else // Unkown compiler +# if __cplusplus >= 201402L +# define GLM_LANG GLM_LANG_CXX14 +# elif __cplusplus >= 201103L +# define GLM_LANG GLM_LANG_CXX11 +# elif __cplusplus >= 199711L # define GLM_LANG GLM_LANG_CXX98 -# endif -# ifndef GLM_FORCE_CXX98 -# define GLM_FORCE_CXX98 +# else +# define GLM_LANG GLM_LANG_CXX // Good luck with that! # endif # ifndef GLM_FORCE_PURE # define GLM_FORCE_PURE @@ -420,122 +469,188 @@ #if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_LANG_DISPLAYED) # define GLM_MESSAGE_LANG_DISPLAYED -# if(GLM_LANG & GLM_LANG_CXXGNU_FLAG) -# pragma message("GLM: C++ with language extensions") -# elif(GLM_LANG & GLM_LANG_CXXMS_FLAG) -# pragma message("GLM: C++ with language extensions") -# elif(GLM_LANG & GLM_LANG_CXX11_FLAG) + +# if GLM_LANG & GLM_LANG_CXX1Z_FLAG +# pragma message("GLM: C++1z") +# elif GLM_LANG & GLM_LANG_CXX14_FLAG +# pragma message("GLM: C++14") +# elif GLM_LANG & GLM_LANG_CXX1Y_FLAG +# pragma message("GLM: C++1y") +# elif GLM_LANG & GLM_LANG_CXX11_FLAG # pragma message("GLM: C++11") -# elif(GLM_LANG & GLM_LANG_CXX0X_FLAG) +# elif GLM_LANG & GLM_LANG_CXX0X_FLAG # pragma message("GLM: C++0x") -# elif(GLM_LANG & GLM_LANG_CXX03_FLAG) +# elif GLM_LANG & GLM_LANG_CXX03_FLAG # pragma message("GLM: C++03") -# elif(GLM_LANG & GLM_LANG_CXX98_FLAG) +# elif GLM_LANG & GLM_LANG_CXX98_FLAG # pragma message("GLM: C++98") # else # pragma message("GLM: C++ language undetected") -# endif//GLM_MODEL -# pragma message("GLM: #define GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_LANG_CXX11 or GLM_FORCE_CXX1Y to force using a specific version of the C++ language") +# endif//GLM_LANG + +# if GLM_LANG & (GLM_LANG_CXXGNU_FLAG | GLM_LANG_CXXMS_FLAG) +# pragma message("GLM: Language extensions enabled") +# endif//GLM_LANG #endif//GLM_MESSAGE /////////////////////////////////////////////////////////////////////////////////// // Has of C++ features -#ifndef __has_feature -# define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif -#ifndef __has_extension -# define __has_extension __has_feature // Compatibility with pre-3.0 compilers. -#endif - // http://clang.llvm.org/cxx_status.html // http://gcc.gnu.org/projects/cxx0x.html // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx -// N1720 -#define GLM_HAS_CXX11_STL ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2015))) +#if GLM_PLATFORM == GLM_PLATFORM_ANDROID +# 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") +#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))) +#endif // N1720 -#define GLM_HAS_STATIC_ASSERT ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ - __has_feature(cxx_static_assert)) +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert) +#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) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010))) +#endif // N1988 -#define GLM_HAS_EXTENDED_INTEGER_TYPE ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) && (GLM_COMPILER >= GLM_COMPILER_APPLE_CLANG40))) +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_EXTENDED_INTEGER_TYPE 1 +#else +# define GLM_HAS_EXTENDED_INTEGER_TYPE (\ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)) || \ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) && (GLM_COMPILER >= GLM_COMPILER_APPLE_CLANG40))) +#endif // N2235 -#define GLM_HAS_CONSTEXPR ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ - __has_feature(cxx_constexpr)) +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_CONSTEXPR __has_feature(cxx_constexpr) +# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_CONSTEXPR 1 +# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR +#else +# define GLM_HAS_CONSTEXPR (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_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 -#define GLM_HAS_INITIALIZER_LISTS ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ - __has_feature(cxx_generalized_initializers)) +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_INITIALIZER_LISTS 1 +#else +# define GLM_HAS_INITIALIZER_LISTS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) +#endif // N2544 Unrestricted unions -#define GLM_HAS_UNRESTRICTED_UNIONS ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - (GLM_LANG & GLM_LANG_CXXMS_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ - __has_feature(cxx_unrestricted_unions)) +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) +#elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG) +# define GLM_HAS_UNRESTRICTED_UNIONS 1 +#else +# define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46))) +#endif // N2346 -#define GLM_HAS_DEFAULTED_FUNCTIONS ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ - __has_feature(cxx_defaulted_functions)) +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_DEFAULTED_FUNCTIONS 1 +#else +# define GLM_HAS_DEFAULTED_FUNCTIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) +#endif // N2118 -#define GLM_HAS_RVALUE_REFERENCES ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ - __has_feature(cxx_rvalue_references)) +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) +#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) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))) +#endif -#define GLM_HAS_STL_ARRAY ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010))) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43))) +// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions) +#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) && (\ + ((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))) +#endif -#define GLM_HAS_TEMPLATE_ALIASES ( \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) || \ - __has_feature(cxx_alias_templates)) +// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) +#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) && (\ + ((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))) +#endif -#define GLM_HAS_RANGE_FOR ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ - __has_feature(cxx_range_for)) +// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for) +#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) && (\ + ((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))) +#endif -#define GLM_HAS_ASSIGNABLE ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))) +// +#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))) +#endif -#define GLM_HAS_TRIVIAL_QUERIES ( \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) +// +#define GLM_HAS_TRIVIAL_QUERIES 0//( \ + //((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) -#define GLM_HAS_MAKE_SIGNED ( \ - (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) +// +#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))) +#endif -#define GLM_HAS_BITSCAN_WINDOWS ( \ - (GLM_ARCH != GLM_ARCH_PURE) && \ - (GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && \ - (GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_LLVM | GLM_COMPILER_INTEL))) +// +#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)) +#endif // OpenMP #ifdef _OPENMP @@ -565,12 +680,13 @@ // 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_X86 0x0001 -#define GLM_ARCH_SSE2 0x0002 -#define GLM_ARCH_SSE3 0x0004 -#define GLM_ARCH_SSE4 0x0008 -#define GLM_ARCH_AVX 0x0010 -#define GLM_ARCH_AVX2 0x0020 +#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 @@ -597,7 +713,9 @@ # 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(__AVX2__) +# 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) @@ -627,7 +745,7 @@ // 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(__MINGW32__) && (GLM_ARCH != GLM_ARCH_PURE) +#if defined(__MINGW64__) && (GLM_ARCH != GLM_ARCH_PURE) # include #endif @@ -658,6 +776,8 @@ # 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) @@ -667,7 +787,6 @@ # elif(GLM_ARCH & GLM_ARCH_SSE2) # pragma message("GLM: SSE2 instruction set") # endif//GLM_ARCH -# pragma message("GLM: #define GLM_FORCE_PURE to avoid using platform specific instruction sets") #endif//GLM_MESSAGE /////////////////////////////////////////////////////////////////////////////////// @@ -705,12 +824,9 @@ # if GLM_COMPILER & GLM_COMPILER_VC # define GLM_INLINE __forceinline # define GLM_NEVER_INLINE __declspec((noinline)) -# elif GLM_COMPILER & GLM_COMPILER_GCC +# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM) # define GLM_INLINE inline __attribute__((__always_inline__)) # define GLM_NEVER_INLINE __attribute__((__noinline__)) -# elif GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM) -# define GLM_INLINE __attribute__((__always_inline__)) -# define GLM_NEVER_INLINE __attribute__((__noinline__)) # else # define GLM_INLINE inline # define GLM_NEVER_INLINE @@ -777,11 +893,11 @@ namespace glm { using std::size_t; -#if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC) - typedef size_t length_t; -#else - typedef int length_t; -#endif +# if defined(GLM_FORCE_SIZE_T_LENGTH) || defined(GLM_FORCE_SIZE_FUNC) + typedef size_t length_t; +# else + typedef int length_t; +# endif namespace detail { @@ -805,14 +921,38 @@ namespace detail #if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_FORCE_SIZE_T_LENGTH) # define GLM_MESSAGE_FORCE_SIZE_T_LENGTH -# if defined(GLM_FORCE_SIZE_T_LENGTH) +# if defined GLM_FORCE_SIZE_FUNC +# pragma message("GLM: .length() is replaced by .size() and returns a std::size_t") +# elif defined GLM_FORCE_SIZE_T_LENGTH # pragma message("GLM: .length() returns glm::length_t, a typedef of std::size_t") # else # pragma message("GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification") -# pragma message("GLM: #define GLM_FORCE_SIZE_T_LENGTH for .length() to return a size_t") # endif #endif//GLM_MESSAGE +/////////////////////////////////////////////////////////////////////////////////// +// countof + +#ifndef __has_feature +# define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif + +#if GLM_HAS_CONSTEXPR_PARTIAL + namespace glm + { + template + constexpr std::size_t countof(T const (&)[N]) + { + return N; + } + }//namespace glm +# define GLM_COUNTOF(arr) glm::countof(arr) +#elif _MSC_VER +# define GLM_COUNTOF(arr) _countof(arr) +#else +# define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) +#endif + /////////////////////////////////////////////////////////////////////////////////// // Uninitialize constructors diff --git a/glm/detail/type_float.hpp b/glm/detail/type_float.hpp index a3d7f707..81d00b60 100644 --- a/glm/detail/type_float.hpp +++ b/glm/detail/type_float.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/type_gentype.hpp b/glm/detail/type_gentype.hpp index c8c24f64..cfa63867 100644 --- a/glm/detail/type_gentype.hpp +++ b/glm/detail/type_gentype.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/type_gentype.inl b/glm/detail/type_gentype.inl index 46571e20..e46e7743 100644 --- a/glm/detail/type_gentype.inl +++ b/glm/detail/type_gentype.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/type_half.hpp b/glm/detail/type_half.hpp index 774298d5..6f6fae21 100644 --- a/glm/detail/type_half.hpp +++ b/glm/detail/type_half.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/type_half.inl b/glm/detail/type_half.inl index 202b2a59..ff8740c8 100644 --- a/glm/detail/type_half.inl +++ b/glm/detail/type_half.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) /// /// This half implementation is based on OpenEXR which is Copyright (c) 2002, /// Industrial Light & Magic, a division of Lucas Digital Ltd. LLC diff --git a/glm/detail/type_int.hpp b/glm/detail/type_int.hpp index 69168592..6aacdc19 100644 --- a/glm/detail/type_int.hpp +++ b/glm/detail/type_int.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -33,7 +33,9 @@ #pragma once #include "setup.hpp" -#include +#if GLM_HAS_MAKE_SIGNED +# include +#endif #if GLM_HAS_EXTENDED_INTEGER_TYPE # include diff --git a/glm/detail/type_mat.hpp b/glm/detail/type_mat.hpp index ecfe0156..2e4f5113 100644 --- a/glm/detail/type_mat.hpp +++ b/glm/detail/type_mat.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/type_mat.inl b/glm/detail/type_mat.inl index 1fa740f4..d6f43abc 100644 --- a/glm/detail/type_mat.inl +++ b/glm/detail/type_mat.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 008a1f0d..046ceac3 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -63,6 +63,7 @@ namespace glm ////////////////////////////////////// // Constructors GLM_FUNC_DECL tmat2x2(); + GLM_FUNC_DECL tmat2x2(tmat2x2 const & m); template GLM_FUNC_DECL tmat2x2(tmat2x2 const & m); @@ -127,6 +128,8 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & v); + template GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); template diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 5d26395c..779cc091 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -62,6 +62,13 @@ namespace detail # endif } + template + GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(tmat2x2 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + } + template template GLM_FUNC_QUALIFIER tmat2x2::tmat2x2(tmat2x2 const & m) @@ -236,6 +243,14 @@ namespace detail ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat2x2& tmat2x2::operator=(tmat2x2 const & m) diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 6c05bbc4..9986e881 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -58,6 +58,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat2x3(); + GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); template GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); @@ -123,20 +124,22 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat2x3 & operator=(tmat2x3 const & m); + template - GLM_FUNC_DECL tmat2x3 & operator= (tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 & operator=(tmat2x3 const & m); template - GLM_FUNC_DECL tmat2x3 & operator+= (U s); + GLM_FUNC_DECL tmat2x3 & operator+=(U s); template - GLM_FUNC_DECL tmat2x3 & operator+= (tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 & operator+=(tmat2x3 const & m); template - GLM_FUNC_DECL tmat2x3 & operator-= (U s); + GLM_FUNC_DECL tmat2x3 & operator-=(U s); template - GLM_FUNC_DECL tmat2x3 & operator-= (tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 & operator-=(tmat2x3 const & m); template - GLM_FUNC_DECL tmat2x3 & operator*= (U s); + GLM_FUNC_DECL tmat2x3 & operator*=(U s); template - GLM_FUNC_DECL tmat2x3 & operator/= (U s); + GLM_FUNC_DECL tmat2x3 & operator/=(U s); ////////////////////////////////////// // Increment and decrement operators @@ -150,74 +153,47 @@ namespace glm // Binary operators template - GLM_FUNC_DECL tmat2x3 operator+ ( - tmat2x3 const & m, - T const & s); + GLM_FUNC_DECL tmat2x3 operator+(tmat2x3 const & m, T const & s); template - GLM_FUNC_DECL tmat2x3 operator+ ( - tmat2x3 const & m1, - tmat2x3 const & m2); + GLM_FUNC_DECL tmat2x3 operator+(tmat2x3 const & m1, tmat2x3 const & m2); template - GLM_FUNC_DECL tmat2x3 operator- ( - tmat2x3 const & m, - T const & s); + GLM_FUNC_DECL tmat2x3 operator-(tmat2x3 const & m, T const & s); template - GLM_FUNC_DECL tmat2x3 operator- ( - tmat2x3 const & m1, - tmat2x3 const & m2); + GLM_FUNC_DECL tmat2x3 operator-(tmat2x3 const & m1, tmat2x3 const & m2); template - GLM_FUNC_DECL tmat2x3 operator* ( - tmat2x3 const & m, - T const & s); + GLM_FUNC_DECL tmat2x3 operator*(tmat2x3 const & m, T const & s); template - GLM_FUNC_DECL tmat2x3 operator* ( - T const & s, - tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 operator*(T const & s, tmat2x3 const & m); template - GLM_FUNC_DECL typename tmat2x3::col_type operator* ( - tmat2x3 const & m, - typename tmat2x3::row_type const & v); + GLM_FUNC_DECL typename tmat2x3::col_type operator*(tmat2x3 const & m, typename tmat2x3::row_type const & v); template - GLM_FUNC_DECL typename tmat2x3::row_type operator* ( - typename tmat2x3::col_type const & v, - tmat2x3 const & m); + GLM_FUNC_DECL typename tmat2x3::row_type operator*(typename tmat2x3::col_type const & v, tmat2x3 const & m); template - GLM_FUNC_DECL tmat2x3 operator* ( - tmat2x3 const & m1, - tmat2x2 const & m2); + GLM_FUNC_DECL tmat2x3 operator*(tmat2x3 const & m1, tmat2x2 const & m2); template - GLM_FUNC_DECL tmat3x3 operator* ( - tmat2x3 const & m1, - tmat3x2 const & m2); + GLM_FUNC_DECL tmat3x3 operator*(tmat2x3 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat4x3 operator* ( - tmat2x3 const & m1, - tmat4x2 const & m2); + GLM_FUNC_DECL tmat4x3 operator*(tmat2x3 const & m1, tmat4x2 const & m2); template - GLM_FUNC_DECL tmat2x3 operator/ ( - tmat2x3 const & m, - T const & s); + GLM_FUNC_DECL tmat2x3 operator/(tmat2x3 const & m, T const & s); template - GLM_FUNC_DECL tmat2x3 operator/ ( - T const & s, - tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 operator/(T const & s, tmat2x3 const & m); // Unary constant operators template - GLM_FUNC_DECL tmat2x3 const operator- ( - tmat2x3 const & m); + GLM_FUNC_DECL tmat2x3 const operator-(tmat2x3 const & m); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 20960e1f..32c30fdd 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -44,6 +44,13 @@ namespace glm # endif } + template + GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(tmat2x3 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + } + template template GLM_FUNC_QUALIFIER tmat2x3::tmat2x3(tmat2x3 const & m) @@ -220,6 +227,14 @@ namespace glm ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat2x3& tmat2x3::operator=(tmat2x3 const & m) @@ -432,7 +447,7 @@ namespace glm } template - GLM_FUNC_QUALIFIER tmat4x3 operator*(tmat2x3 const & m1, tmat3x2 const & m2) + GLM_FUNC_QUALIFIER tmat4x3 operator*(tmat2x3 const & m1, tmat4x2 const & m2) { return tmat4x3( m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index bc26dac9..9239e9c9 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -58,6 +58,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat2x4(); + GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); template GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); @@ -124,20 +125,22 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat2x4 & operator=(tmat2x4 const & m); + template - GLM_FUNC_DECL tmat2x4& operator= (tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 & operator=(tmat2x4 const & m); template - GLM_FUNC_DECL tmat2x4& operator+= (U s); + GLM_FUNC_DECL tmat2x4 & operator+=(U s); template - GLM_FUNC_DECL tmat2x4& operator+= (tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 & operator+=(tmat2x4 const & m); template - GLM_FUNC_DECL tmat2x4& operator-= (U s); + GLM_FUNC_DECL tmat2x4 & operator-=(U s); template - GLM_FUNC_DECL tmat2x4& operator-= (tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 & operator-=(tmat2x4 const & m); template - GLM_FUNC_DECL tmat2x4& operator*= (U s); + GLM_FUNC_DECL tmat2x4 & operator*=(U s); template - GLM_FUNC_DECL tmat2x4& operator/= (U s); + GLM_FUNC_DECL tmat2x4 & operator/=(U s); ////////////////////////////////////// // Increment and decrement operators @@ -151,74 +154,47 @@ namespace glm // Binary operators template - GLM_FUNC_DECL tmat2x4 operator+ ( - tmat2x4 const & m, - T const & s); + GLM_FUNC_DECL tmat2x4 operator+(tmat2x4 const & m, T const & s); template - GLM_FUNC_DECL tmat2x4 operator+ ( - tmat2x4 const & m1, - tmat2x4 const & m2); + GLM_FUNC_DECL tmat2x4 operator+(tmat2x4 const & m1, tmat2x4 const & m2); template - GLM_FUNC_DECL tmat2x4 operator- ( - tmat2x4 const & m, - T const & s); + GLM_FUNC_DECL tmat2x4 operator-(tmat2x4 const & m, T const & s); template - GLM_FUNC_DECL tmat2x4 operator- ( - tmat2x4 const & m1, - tmat2x4 const & m2); + GLM_FUNC_DECL tmat2x4 operator-(tmat2x4 const & m1, tmat2x4 const & m2); template - GLM_FUNC_DECL tmat2x4 operator* ( - tmat2x4 const & m, - T const & s); + GLM_FUNC_DECL tmat2x4 operator*(tmat2x4 const & m, T const & s); template - GLM_FUNC_DECL tmat2x4 operator* ( - T const & s, - tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 operator*(T const & s, tmat2x4 const & m); template - GLM_FUNC_DECL typename tmat2x4::col_type operator* ( - tmat2x4 const & m, - typename tmat2x4::row_type const & v); + GLM_FUNC_DECL typename tmat2x4::col_type operator*(tmat2x4 const & m, typename tmat2x4::row_type const & v); template - GLM_FUNC_DECL typename tmat2x4::row_type operator* ( - typename tmat2x4::col_type const & v, - tmat2x4 const & m); + GLM_FUNC_DECL typename tmat2x4::row_type operator*(typename tmat2x4::col_type const & v, tmat2x4 const & m); template - GLM_FUNC_DECL tmat4x4 operator* ( - tmat2x4 const & m1, - tmat4x2 const & m2); + GLM_FUNC_DECL tmat4x4 operator*(tmat2x4 const & m1, tmat4x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator* ( - tmat2x4 const & m1, - tmat2x2 const & m2); - - template - GLM_FUNC_DECL tmat3x4 operator* ( - tmat2x4 const & m1, - tmat3x2 const & m2); + GLM_FUNC_DECL tmat2x4 operator*(tmat2x4 const & m1, tmat2x2 const & m2); template - GLM_FUNC_DECL tmat2x4 operator/ ( - tmat2x4 const & m, - T s); + GLM_FUNC_DECL tmat3x4 operator*(tmat2x4 const & m1, tmat3x2 const & m2); + + template + GLM_FUNC_DECL tmat2x4 operator/(tmat2x4 const & m, T s); template - GLM_FUNC_DECL tmat2x4 operator/ ( - T s, - tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 operator/(T s, tmat2x4 const & m); // Unary constant operators template - GLM_FUNC_DECL tmat2x4 const operator- ( - tmat2x4 const & m); + GLM_FUNC_DECL tmat2x4 const operator-(tmat2x4 const & m); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index d7f63785..fcf5d315 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -44,6 +44,13 @@ namespace glm # endif } + template + GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(tmat2x4 const & m) + { + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; + } + template template GLM_FUNC_QUALIFIER tmat2x4::tmat2x4(tmat2x4 const & m) @@ -221,6 +228,14 @@ namespace glm ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat2x4& tmat2x4::operator=(tmat2x4 const & m) diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 706f91fd..9fd573f2 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -58,6 +58,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat3x2(); + GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); template GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); @@ -130,20 +131,22 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat3x2 & operator=(tmat3x2 const & m); + template - GLM_FUNC_DECL tmat3x2 & operator= (tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 & operator=(tmat3x2 const & m); template - GLM_FUNC_DECL tmat3x2 & operator+= (U s); + GLM_FUNC_DECL tmat3x2 & operator+=(U s); template - GLM_FUNC_DECL tmat3x2 & operator+= (tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 & operator+=(tmat3x2 const & m); template - GLM_FUNC_DECL tmat3x2 & operator-= (U s); + GLM_FUNC_DECL tmat3x2 & operator-=(U s); template - GLM_FUNC_DECL tmat3x2 & operator-= (tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 & operator-=(tmat3x2 const & m); template - GLM_FUNC_DECL tmat3x2 & operator*= (U s); + GLM_FUNC_DECL tmat3x2 & operator*=(U s); template - GLM_FUNC_DECL tmat3x2 & operator/= (U s); + GLM_FUNC_DECL tmat3x2 & operator/=(U s); ////////////////////////////////////// // Increment and decrement operators @@ -156,74 +159,47 @@ namespace glm // Binary operators template - GLM_FUNC_DECL tmat3x2 operator+ ( - tmat3x2 const & m, - T const & s); + GLM_FUNC_DECL tmat3x2 operator+(tmat3x2 const & m, T const & s); template - GLM_FUNC_DECL tmat3x2 operator+ ( - tmat3x2 const & m1, - tmat3x2 const & m2); + GLM_FUNC_DECL tmat3x2 operator+(tmat3x2 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat3x2 operator- ( - tmat3x2 const & m, - T const & s); + GLM_FUNC_DECL tmat3x2 operator-(tmat3x2 const & m, T const & s); template - GLM_FUNC_DECL tmat3x2 operator- ( - tmat3x2 const & m1, - tmat3x2 const & m2); + GLM_FUNC_DECL tmat3x2 operator-(tmat3x2 const & m1, tmat3x2 const & m2); template - GLM_FUNC_DECL tmat3x2 operator* ( - tmat3x2 const & m, - T const & s); + GLM_FUNC_DECL tmat3x2 operator*(tmat3x2 const & m, T const & s); template - GLM_FUNC_DECL tmat3x2 operator* ( - T const & s, - tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 operator*(T const & s, tmat3x2 const & m); template - GLM_FUNC_DECL typename tmat3x2::col_type operator* ( - tmat3x2 const & m, - typename tmat3x2::row_type const & v); + GLM_FUNC_DECL typename tmat3x2::col_type operator*(tmat3x2 const & m, typename tmat3x2::row_type const & v); template - GLM_FUNC_DECL typename tmat3x2::row_type operator* ( - typename tmat3x2::col_type const & v, - tmat3x2 const & m); + GLM_FUNC_DECL typename tmat3x2::row_type operator*(typename tmat3x2::col_type const & v, tmat3x2 const & m); template - GLM_FUNC_DECL tmat2x2 operator* ( - tmat3x2 const & m1, - tmat2x3 const & m2); + GLM_FUNC_DECL tmat2x2 operator*(tmat3x2 const & m1, tmat2x3 const & m2); template - GLM_FUNC_DECL tmat3x2 operator* ( - tmat3x2 const & m1, - tmat3x3 const & m2); + GLM_FUNC_DECL tmat3x2 operator*(tmat3x2 const & m1, tmat3x3 const & m2); template - GLM_FUNC_DECL tmat4x2 operator* ( - tmat3x2 const & m1, - tmat4x3 const & m2); + GLM_FUNC_DECL tmat4x2 operator*(tmat3x2 const & m1, tmat4x3 const & m2); template - GLM_FUNC_DECL tmat3x2 operator/ ( - tmat3x2 const & m, - T const & s); + GLM_FUNC_DECL tmat3x2 operator/(tmat3x2 const & m, T const & s); template - GLM_FUNC_DECL tmat3x2 operator/ ( - T const & s, - tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 operator/(T const & s, tmat3x2 const & m); // Unary constant operators template - GLM_FUNC_DECL tmat3x2 const operator-( - tmat3x2 const & m); + GLM_FUNC_DECL tmat3x2 const operator-(tmat3x2 const & m); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index 2c299dea..d42a9aec 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -45,6 +45,14 @@ namespace glm # 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]; + } + template template GLM_FUNC_QUALIFIER tmat3x2::tmat3x2(tmat3x2 const & m) @@ -249,6 +257,15 @@ namespace glm ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat3x2& tmat3x2::operator=(tmat3x2 const & m) diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index b11c1344..dddfc535 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -62,6 +62,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat3x3(); + GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); template GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); @@ -134,129 +135,94 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat3x3 & operator=(tmat3x3 const & m); + template - GLM_FUNC_DECL tmat3x3& operator= (tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 & operator=(tmat3x3 const & m); template - GLM_FUNC_DECL tmat3x3& operator+= (U s); + GLM_FUNC_DECL tmat3x3 & operator+=(U s); template - GLM_FUNC_DECL tmat3x3& operator+= (tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 & operator+=(tmat3x3 const & m); template - GLM_FUNC_DECL tmat3x3& operator-= (U s); + GLM_FUNC_DECL tmat3x3 & operator-=(U s); template - GLM_FUNC_DECL tmat3x3& operator-= (tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 & operator-=(tmat3x3 const & m); template - GLM_FUNC_DECL tmat3x3& operator*= (U s); + GLM_FUNC_DECL tmat3x3 & operator*=(U s); template - GLM_FUNC_DECL tmat3x3& operator*= (tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 & operator*=(tmat3x3 const & m); template - GLM_FUNC_DECL tmat3x3& operator/= (U s); + GLM_FUNC_DECL tmat3x3 & operator/=(U s); template - GLM_FUNC_DECL tmat3x3& operator/= (tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 & operator/=(tmat3x3 const & m); ////////////////////////////////////// // Increment and decrement operators - GLM_FUNC_DECL tmat3x3 & operator++ (); - GLM_FUNC_DECL tmat3x3 & operator-- (); + GLM_FUNC_DECL tmat3x3 & operator++(); + GLM_FUNC_DECL tmat3x3 & operator--(); GLM_FUNC_DECL tmat3x3 operator++(int); GLM_FUNC_DECL tmat3x3 operator--(int); }; // Binary operators template - GLM_FUNC_DECL tmat3x3 operator+ ( - tmat3x3 const & m, - T const & s); + GLM_FUNC_DECL tmat3x3 operator+(tmat3x3 const & m, T const & s); template - GLM_FUNC_DECL tmat3x3 operator+ ( - T const & s, - tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator+(T const & s, tmat3x3 const & m); template - GLM_FUNC_DECL tmat3x3 operator+ ( - tmat3x3 const & m1, - tmat3x3 const & m2); + GLM_FUNC_DECL tmat3x3 operator+(tmat3x3 const & m1, tmat3x3 const & m2); template - GLM_FUNC_DECL tmat3x3 operator- ( - tmat3x3 const & m, - T const & s); + GLM_FUNC_DECL tmat3x3 operator-(tmat3x3 const & m, T const & s); template - GLM_FUNC_DECL tmat3x3 operator- ( - T const & s, - tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator-(T const & s, tmat3x3 const & m); template - GLM_FUNC_DECL tmat3x3 operator- ( - tmat3x3 const & m1, - tmat3x3 const & m2); + GLM_FUNC_DECL tmat3x3 operator-(tmat3x3 const & m1, tmat3x3 const & m2); template - GLM_FUNC_DECL tmat3x3 operator* ( - tmat3x3 const & m, - T const & s); + GLM_FUNC_DECL tmat3x3 operator*(tmat3x3 const & m, T const & s); template - GLM_FUNC_DECL tmat3x3 operator* ( - T const & s, - tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator*(T const & s, tmat3x3 const & m); template - GLM_FUNC_DECL typename tmat3x3::col_type operator* ( - tmat3x3 const & m, - typename tmat3x3::row_type const & v); + GLM_FUNC_DECL typename tmat3x3::col_type operator*(tmat3x3 const & m, typename tmat3x3::row_type const & v); template - GLM_FUNC_DECL typename tmat3x3::row_type operator* ( - typename tmat3x3::col_type const & v, - tmat3x3 const & m); + GLM_FUNC_DECL typename tmat3x3::row_type operator*(typename tmat3x3::col_type const & v, tmat3x3 const & m); template - GLM_FUNC_DECL tmat3x3 operator* ( - tmat3x3 const & m1, - tmat3x3 const & m2); + GLM_FUNC_DECL tmat3x3 operator*(tmat3x3 const & m1, tmat3x3 const & m2); template - GLM_FUNC_DECL tmat2x3 operator* ( - tmat3x3 const & m1, - tmat2x3 const & m2); + GLM_FUNC_DECL tmat2x3 operator*(tmat3x3 const & m1, tmat2x3 const & m2); template - GLM_FUNC_DECL tmat4x3 operator* ( - tmat3x3 const & m1, - tmat4x3 const & m2); + GLM_FUNC_DECL tmat4x3 operator*(tmat3x3 const & m1, tmat4x3 const & m2); template - GLM_FUNC_DECL tmat3x3 operator/ ( - tmat3x3 const & m, - T const & s); + GLM_FUNC_DECL tmat3x3 operator/(tmat3x3 const & m, T const & s); template - GLM_FUNC_DECL tmat3x3 operator/ ( - T const & s, - tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 operator/(T const & s, tmat3x3 const & m); template - GLM_FUNC_DECL typename tmat3x3::col_type operator/ ( - tmat3x3 const & m, - typename tmat3x3::row_type const & v); + GLM_FUNC_DECL typename tmat3x3::col_type operator/(tmat3x3 const & m, typename tmat3x3::row_type const & v); template - GLM_FUNC_DECL typename tmat3x3::row_type operator/ ( - typename tmat3x3::col_type const & v, - tmat3x3 const & m); + GLM_FUNC_DECL typename tmat3x3::row_type operator/(typename tmat3x3::col_type const & v, tmat3x3 const & m); template - GLM_FUNC_DECL tmat3x3 operator/ ( - tmat3x3 const & m1, - tmat3x3 const & m2); + GLM_FUNC_DECL tmat3x3 operator/(tmat3x3 const & m1, tmat3x3 const & m2); // Unary constant operators template - GLM_FUNC_DECL tmat3x3 const operator-( - tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3 const operator-(tmat3x3 const & m); }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index b36634a4..ad933d36 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -73,6 +73,14 @@ namespace detail GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(ctor) {} + 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]; + } + template template GLM_FUNC_QUALIFIER tmat3x3::tmat3x3(tmat3x3 const & m) @@ -273,6 +281,15 @@ namespace detail ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat3x3 & tmat3x3::operator=(tmat3x3 const & m) diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index caa4f7f3..7814e3fd 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -58,6 +58,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat3x4(); + GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); template GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); @@ -129,6 +130,8 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m); + template GLM_FUNC_DECL tmat3x4 & operator=(tmat3x4 const & m); template diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index 37258c36..03e0c2cf 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -45,6 +45,14 @@ namespace glm # 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]; + } + template template GLM_FUNC_QUALIFIER tmat3x4::tmat3x4(tmat3x4 const & m) @@ -248,6 +256,15 @@ namespace glm ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat3x4& tmat3x4::operator=(tmat3x4 const & m) diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index d6c11af0..d529ecbd 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -58,6 +58,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat4x2(); + GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); template GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); @@ -135,20 +136,22 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat4x2 & operator=(tmat4x2 const & m); + template - GLM_FUNC_DECL tmat4x2& operator=(tmat4x2 const & m); + GLM_FUNC_DECL tmat4x2 & operator=(tmat4x2 const & m); template - GLM_FUNC_DECL tmat4x2& operator+=(U s); + GLM_FUNC_DECL tmat4x2 & operator+=(U s); template - GLM_FUNC_DECL tmat4x2& operator+=(tmat4x2 const & m); + GLM_FUNC_DECL tmat4x2 & operator+=(tmat4x2 const & m); template - GLM_FUNC_DECL tmat4x2& operator-=(U s); + GLM_FUNC_DECL tmat4x2 & operator-=(U s); template - GLM_FUNC_DECL tmat4x2& operator-=(tmat4x2 const & m); + GLM_FUNC_DECL tmat4x2 & operator-=(tmat4x2 const & m); template - GLM_FUNC_DECL tmat4x2& operator*=(U s); + GLM_FUNC_DECL tmat4x2 & operator*=(U s); template - GLM_FUNC_DECL tmat4x2& operator/=(U s); + GLM_FUNC_DECL tmat4x2 & operator/=(U s); ////////////////////////////////////// // Increment and decrement operators diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 7e758222..dac9ff06 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -46,6 +46,15 @@ namespace glm # 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]; + } + template template GLM_FUNC_QUALIFIER tmat4x2::tmat4x2(tmat4x2 const & m) @@ -271,6 +280,16 @@ namespace glm ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat4x2& tmat4x2::operator=(tmat4x2 const & m) diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index dbd95fb5..8bde1ac0 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -57,6 +57,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat4x3(); + GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); template GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); @@ -134,6 +135,8 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat4x3 & operator=(tmat4x3 const & m); + template GLM_FUNC_DECL tmat4x3 & operator=(tmat4x3 const & m); template diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index 77a69ae5..d5c62c8a 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -46,6 +46,15 @@ namespace glm # 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]; + } + template template GLM_FUNC_QUALIFIER tmat4x3::tmat4x3(tmat4x3 const & m) @@ -271,6 +280,16 @@ namespace glm ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat4x3& tmat4x3::operator=(tmat4x3 const & m) diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index bc8cefff..dcb7269b 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -62,6 +62,7 @@ namespace glm public: // Constructors GLM_FUNC_DECL tmat4x4(); + GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); template GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); @@ -139,6 +140,8 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tmat4x4 & operator=(tmat4x4 const & m); + template GLM_FUNC_DECL tmat4x4 & operator=(tmat4x4 const & m); template diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index cf37e090..103be5b6 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -106,6 +106,15 @@ namespace detail # 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]; + } + template template GLM_FUNC_QUALIFIER tmat4x4::tmat4x4(tmat4x4 const & m) @@ -357,6 +366,18 @@ namespace detail ////////////////////////////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tmat4x4& tmat4x4::operator=(tmat4x4 const & m) diff --git a/glm/detail/type_vec.hpp b/glm/detail/type_vec.hpp index 3f16ba51..c14f234c 100644 --- a/glm/detail/type_vec.hpp +++ b/glm/detail/type_vec.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/type_vec.inl b/glm/detail/type_vec.inl index 1a5306d7..20219806 100644 --- a/glm/detail/type_vec.inl +++ b/glm/detail/type_vec.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 0c819ac8..3550d032 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -108,6 +108,7 @@ namespace glm // Implicit basic constructors GLM_FUNC_DECL tvec1(); + GLM_FUNC_DECL tvec1(tvec1 const & v); template GLM_FUNC_DECL tvec1(tvec1 const & v); @@ -154,6 +155,8 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tvec1 & operator=(tvec1 const & v); + template GLM_FUNC_DECL tvec1 & operator=(tvec1 const & v); template diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 55811739..bd756cd4 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -42,6 +42,11 @@ namespace glm # endif {} + template + GLM_FUNC_QUALIFIER tvec1::tvec1(tvec1 const & v) + : x(v.x) + {} + template template GLM_FUNC_QUALIFIER tvec1::tvec1(tvec1 const & v) @@ -135,6 +140,13 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + template + GLM_FUNC_QUALIFIER tvec1 & tvec1::operator=(tvec1 const & v) + { + this->x = v.x; + return *this; + } + template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator=(tvec1 const & v) diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 8ad6f946..29cfa092 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -109,6 +109,7 @@ namespace glm // Implicit basic constructors GLM_FUNC_DECL tvec2(); + GLM_FUNC_DECL tvec2(tvec2 const & v); template GLM_FUNC_DECL tvec2(tvec2 const & v); @@ -162,32 +163,34 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tvec2& operator=(tvec2 const & v); + template - GLM_FUNC_DECL tvec2 & operator=(tvec2 const & v); + GLM_FUNC_DECL tvec2& operator=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator+=(U s); + GLM_FUNC_DECL tvec2& operator+=(U s); template - GLM_FUNC_DECL tvec2 & operator+=(tvec1 const & v); + GLM_FUNC_DECL tvec2& operator+=(tvec1 const & v); template - GLM_FUNC_DECL tvec2 & operator+=(tvec2 const & v); + GLM_FUNC_DECL tvec2& operator+=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator-=(U s); + GLM_FUNC_DECL tvec2& operator-=(U s); template - GLM_FUNC_DECL tvec2 & operator-=(tvec1 const & v); + GLM_FUNC_DECL tvec2& operator-=(tvec1 const & v); template - GLM_FUNC_DECL tvec2 & operator-=(tvec2 const & v); + GLM_FUNC_DECL tvec2& operator-=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator*=(U s); + GLM_FUNC_DECL tvec2& operator*=(U s); template - GLM_FUNC_DECL tvec2 & operator*=(tvec1 const & v); + GLM_FUNC_DECL tvec2& operator*=(tvec1 const & v); template - GLM_FUNC_DECL tvec2 & operator*=(tvec2 const & v); + GLM_FUNC_DECL tvec2& operator*=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator/=(U s); + GLM_FUNC_DECL tvec2& operator/=(U s); template - GLM_FUNC_DECL tvec2 & operator/=(tvec1 const & v); + GLM_FUNC_DECL tvec2& operator/=(tvec1 const & v); template - GLM_FUNC_DECL tvec2 & operator/=(tvec2 const & v); + GLM_FUNC_DECL tvec2& operator/=(tvec2 const & v); ////////////////////////////////////// // Increment and decrement operators @@ -201,29 +204,29 @@ namespace glm // Unary bit operators template - GLM_FUNC_DECL tvec2 & operator%= (U s); + GLM_FUNC_DECL tvec2 & operator%=(U s); template - GLM_FUNC_DECL tvec2 & operator%= (tvec1 const & v); + GLM_FUNC_DECL tvec2 & operator%=(tvec1 const & v); template - GLM_FUNC_DECL tvec2 & operator%= (tvec2 const & v); + GLM_FUNC_DECL tvec2 & operator%=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator&= (U s); + GLM_FUNC_DECL tvec2 & operator&=(U s); template - GLM_FUNC_DECL tvec2 & operator&= (tvec1 const & v); + GLM_FUNC_DECL tvec2 & operator&=(tvec1 const & v); template - GLM_FUNC_DECL tvec2 & operator&= (tvec2 const & v); + GLM_FUNC_DECL tvec2 & operator&=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator|= (U s); + GLM_FUNC_DECL tvec2 & operator|=(U s); template - GLM_FUNC_DECL tvec2 & operator|= (tvec1 const & v); + GLM_FUNC_DECL tvec2 & operator|=(tvec1 const & v); template - GLM_FUNC_DECL tvec2 & operator|= (tvec2 const & v); + GLM_FUNC_DECL tvec2 & operator|=(tvec2 const & v); template - GLM_FUNC_DECL tvec2 & operator^= (U s); + GLM_FUNC_DECL tvec2 & operator^=(U s); template - GLM_FUNC_DECL tvec2 & operator^= (tvec1 const & v); + GLM_FUNC_DECL tvec2 & operator^=(tvec1 const & v); template - GLM_FUNC_DECL tvec2 & operator^= (tvec2 const & v); + GLM_FUNC_DECL tvec2 & operator^=(tvec2 const & v); template GLM_FUNC_DECL tvec2 & operator<<=(U s); template diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 674f075c..4db29479 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -12,10 +12,6 @@ /// 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 @@ -25,13 +21,44 @@ /// THE SOFTWARE. /// /// @ref core -/// @file glm/detail/type_tvec2.inl +/// @file glm/core/type_tvec2.inl /// @date 2008-08-18 / 2011-06-15 /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// 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 + + ////////////////////////////////////// + // Accesses + + 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 @@ -42,6 +69,11 @@ namespace glm # endif {} + template + GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) + : x(v.x), y(v.y) + {} + template template GLM_FUNC_QUALIFIER tvec2::tvec2(tvec2 const & v) @@ -61,8 +93,8 @@ namespace glm {} template - GLM_FUNC_QUALIFIER tvec2::tvec2(T const & a, T const & b) - : x(a), y(b) + GLM_FUNC_QUALIFIER tvec2::tvec2(T const & s1, T const & s2) + : x(s1), y(s2) {} ////////////////////////////////////// @@ -106,54 +138,17 @@ namespace glm , y(static_cast(v.y)) {} - ////////////////////////////////////// - // 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 + template + GLM_FUNC_QUALIFIER tvec2 & tvec2::operator=(tvec2 const & v) + { + this->x = v.x; + this->y = v.y; + return *this; + } + template template GLM_FUNC_QUALIFIER tvec2 & tvec2::operator=(tvec2 const & v) diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 094a3703..5f0673bf 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -110,6 +110,7 @@ namespace glm // Implicit basic constructors GLM_FUNC_DECL tvec3(); + GLM_FUNC_DECL tvec3(tvec3 const & v); template GLM_FUNC_DECL tvec3(tvec3 const & v); @@ -184,6 +185,8 @@ namespace glm ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tvec3 & operator=(tvec3 const & v); + template GLM_FUNC_DECL tvec3 & operator=(tvec3 const & v); template diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 27c1b90d..b2088d8b 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -42,6 +42,11 @@ namespace glm # endif {} + template + GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) + : x(v.x), y(v.y), z(v.z) + {} + template template GLM_FUNC_QUALIFIER tvec3::tvec3(tvec3 const & v) @@ -183,6 +188,15 @@ namespace glm ////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tvec3& tvec3::operator=(tvec3 const & v) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index b62906a2..8189d6f0 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -53,7 +53,9 @@ namespace detail typedef T type[4]; }; -# if GLM_ARCH & GLM_ARCH_SSE2 +# 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 template <> struct simd { @@ -73,7 +75,7 @@ namespace detail }; # endif -# if GLM_ARCH & GLM_ARCH_AVX +# if GLM_ARCH & GLM_ARCH_AVX && GLM_NOT_BUGGY_VC32BITS template <> struct simd { @@ -81,7 +83,7 @@ namespace detail }; # endif -# if GLM_ARCH & GLM_ARCH_AVX2 +# if GLM_ARCH & GLM_ARCH_AVX2 && GLM_NOT_BUGGY_VC32BITS template <> struct simd { @@ -113,10 +115,11 @@ namespace detail # if GLM_HAS_ANONYMOUS_UNION union { - typename detail::simd::type data; + struct { T x, y, z, w;}; struct { T r, g, b, a; }; struct { T s, t, p, q; }; - struct { T x, y, z, w;}; + + typename detail::simd::type data; # ifdef GLM_SWIZZLE _GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w) @@ -164,6 +167,7 @@ namespace detail // Implicit basic constructors GLM_FUNC_DECL tvec4(); + GLM_FUNC_DECL tvec4(tvec4 const & v); template GLM_FUNC_DECL tvec4(tvec4 const & v); @@ -281,6 +285,8 @@ namespace detail ////////////////////////////////////// // Unary arithmetic operators + GLM_FUNC_DECL tvec4 & operator=(tvec4 const & v); + template GLM_FUNC_DECL tvec4 & operator=(tvec4 const & v); template diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index f14b9cf2..fbdf51fc 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -42,21 +42,10 @@ namespace glm # endif {} -#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2) - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : data(_mm_setzero_ps()) -# endif + template + GLM_FUNC_QUALIFIER tvec4::tvec4(tvec4 const & v) + : x(v.x), y(v.y), z(v.z), w(v.w) {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4() -# ifndef GLM_FORCE_NO_CTOR_INIT - : data(_mm_setzero_ps()) -# endif - {} -#endif template template @@ -76,35 +65,11 @@ namespace glm : x(s), y(s), z(s), w(s) {} -#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2) - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : - data(_mm_set1_ps(s)) - {} - - template <> - GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : - data(_mm_set1_ps(s)) - {} -#endif - template GLM_FUNC_QUALIFIER tvec4::tvec4(T a, T b, T c, T d) : x(a), y(b), z(c), w(d) {} -#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2) - template <> - 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)) - {} -#endif - ////////////////////////////////////// // Conversion scalar constructors @@ -285,6 +250,16 @@ namespace glm ////////////////////////////////////// // 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; + } + template template GLM_FUNC_QUALIFIER tvec4 & tvec4::operator=(tvec4 const & v) @@ -307,40 +282,6 @@ namespace glm return *this; } -#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2) - 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) - { - 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; - } -#endif - template template GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec1 const & v) @@ -353,24 +294,6 @@ namespace glm return *this; } -#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2) - 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) - { - this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(v.x))); - return *this; - } -#endif - template template GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec4 const & v) @@ -1187,3 +1110,15 @@ namespace glm ~v.w); } }//namespace glm + +#if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS +#if GLM_ARCH & GLM_ARCH_SSE2 +# include "type_vec4_sse2.inl" +#endif +#if GLM_ARCH & GLM_ARCH_AVX +# include "type_vec4_avx.inl" +#endif +#if GLM_ARCH & GLM_ARCH_AVX2 +# include "type_vec4_avx2.inl" +#endif +#endif// diff --git a/glm/detail/type_vec4_avx.inl b/glm/detail/type_vec4_avx.inl new file mode 100644 index 00000000..f2a44398 --- /dev/null +++ b/glm/detail/type_vec4_avx.inl @@ -0,0 +1,41 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// 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/type_tvec4_avx.inl +/// @date 2014-12-01 / 2014-12-01 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail +{ + +}//namespace detail + + + +}//namespace glm diff --git a/glm/detail/type_vec4_avx2.inl b/glm/detail/type_vec4_avx2.inl new file mode 100644 index 00000000..fda75e51 --- /dev/null +++ b/glm/detail/type_vec4_avx2.inl @@ -0,0 +1,41 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// 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/type_tvec4_avx2.inl +/// @date 2014-12-01 / 2014-12-01 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail +{ + +}//namespace detail + + + +}//namespace glm diff --git a/glm/detail/type_vec4_sse2.inl b/glm/detail/type_vec4_sse2.inl new file mode 100644 index 00000000..002446f2 --- /dev/null +++ b/glm/detail/type_vec4_sse2.inl @@ -0,0 +1,120 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// 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/type_tvec4_sse2.inl +/// @date 2014-12-01 / 2014-12-01 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail +{ + +}//namespace detail + + 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) : + data(_mm_set1_ps(s)) + {} + + template <> + 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) + { + 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+=(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) + { + this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(v.x))); + return *this; + } +}//namespace glm diff --git a/glm/exponential.hpp b/glm/exponential.hpp index fdc6ba8f..dfba58a5 100644 --- a/glm/exponential.hpp +++ b/glm/exponential.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/ext.hpp b/glm/ext.hpp index b5d0921b..bdf050a9 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/fwd.hpp b/glm/fwd.hpp index 33cf45ee..742474ca 100644 --- a/glm/fwd.hpp +++ b/glm/fwd.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/geometric.hpp b/glm/geometric.hpp index 36df9c62..12d9f39d 100644 --- a/glm/geometric.hpp +++ b/glm/geometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/glm.hpp b/glm/glm.hpp index ac9c73ad..98be4466 100644 --- a/glm/glm.hpp +++ b/glm/glm.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/bitfield.hpp b/glm/gtc/bitfield.hpp index 56aa5013..c875d033 100644 --- a/glm/gtc/bitfield.hpp +++ b/glm/gtc/bitfield.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/bitfield.inl b/glm/gtc/bitfield.inl index aa7d4b5f..11702627 100644 --- a/glm/gtc/bitfield.inl +++ b/glm/gtc/bitfield.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/color.hpp b/glm/gtc/color.hpp new file mode 100644 index 00000000..e685cf4f --- /dev/null +++ b/glm/gtc/color.hpp @@ -0,0 +1,81 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// 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 gtc_color +/// @file glm/gtc/color.hpp +/// @date 2015-02-10 / 2015-02-10 +/// @author Christophe Riccio +/// +/// @see core (dependence) +/// @see gtc_color (dependence) +/// +/// @defgroup gtc_color GLM_GTC_color +/// @ingroup gtc +/// +/// @brief Allow to perform bit operations on integer values +/// +/// need to be included to use these functionalities. +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/precision.hpp" +#include "../exponential.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include + +#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) +# pragma message("GLM: GLM_GTC_color extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_color + /// @{ + + /// Convert a RGB color to sRGB color using a standard gamma correction + template class vecType> + GLM_FUNC_DECL vecType convertRgbToSrgb(vecType const & ColorRGB); + + /// Convert a RGB color to sRGB color using a custom gamma correction + template class vecType> + GLM_FUNC_DECL vecType convertRgbToSrgb(vecType const & ColorRGB, T Gamma); + + /// Convert a sRGB color to RGB color using a standard gamma correction + template class vecType> + GLM_FUNC_DECL vecType convertSrgbToRgb(vecType const & ColorSRGB); + + /// Convert a sRGB color to RGB color using a custom gamma correction + template class vecType> + GLM_FUNC_DECL vecType convertSrgbToRgb(vecType const & ColorSRGB, T Gamma); + + /// @} +} //namespace glm + +#include "color.inl" diff --git a/glm/gtc/color.inl b/glm/gtc/color.inl new file mode 100644 index 00000000..8d127fa1 --- /dev/null +++ b/glm/gtc/color.inl @@ -0,0 +1,104 @@ +///////////////////////////////////////////////////////////////////////////////////////// +/// 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 gtc_color +/// @file glm/gtc/color.inl +/// @date 2015-02-10 / 2015-02-10 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace detail +{ + template class vecType> + struct compute_rgbToSrgb + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & ColorRGB, T GammaCorrection) + { + vecType const ClampedColor(clamp(ColorRGB, static_cast(0), static_cast(1))); + + return mix( + pow(ClampedColor, vecType(GammaCorrection)) * static_cast(1.055) - static_cast(0.055), + ClampedColor * static_cast(12.92), + lessThan(ClampedColor, vecType(static_cast(0.0031308)))); + } + }; + + template + struct compute_rgbToSrgb + { + GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & ColorRGB, T GammaCorrection) + { + return tvec4(compute_rgbToSrgb::call(tvec3(ColorRGB), GammaCorrection), ColorRGB.a); + } + }; + + template class vecType> + struct compute_srgbToRgb + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & ColorSRGB, T Gamma) + { + return mix( + pow((ColorSRGB + static_cast(0.055)) * static_cast(0.94786729857819905213270142180095), vecType(Gamma)), + ColorSRGB * static_cast(0.07739938080495356037151702786378), + lessThanEqual(ColorSRGB, vecType(static_cast(0.04045)))); + } + }; + + template + struct compute_srgbToRgb + { + GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & ColorSRGB, T Gamma) + { + return tvec4(compute_srgbToRgb::call(tvec3(ColorSRGB), Gamma), ColorSRGB.a); + } + }; +}//namespace detail + + template class vecType> + GLM_FUNC_QUALIFIER vecType convertRgbToSrgb(vecType const & ColorRGB) + { + return detail::compute_rgbToSrgb::call(ColorRGB, static_cast(0.41666)); + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType convertRgbToSrgb(vecType const & ColorRGB, T Gamma) + { + return detail::compute_rgbToSrgb::call(ColorRGB, static_cast(1) / Gamma); + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType convertSrgbToRgb(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) + { + return detail::compute_srgbToRgb::call(ColorSRGB, Gamma); + } +}//namespace glm diff --git a/glm/gtc/constants.hpp b/glm/gtc/constants.hpp index 7300a618..ae1fb622 100644 --- a/glm/gtc/constants.hpp +++ b/glm/gtc/constants.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/constants.inl b/glm/gtc/constants.inl index 906c5096..a5de153b 100644 --- a/glm/gtc/constants.inl +++ b/glm/gtc/constants.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/epsilon.hpp b/glm/gtc/epsilon.hpp index 54bf16dc..b69e1a03 100644 --- a/glm/gtc/epsilon.hpp +++ b/glm/gtc/epsilon.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/epsilon.inl b/glm/gtc/epsilon.inl index 239d87da..8e65e974 100644 --- a/glm/gtc/epsilon.inl +++ b/glm/gtc/epsilon.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/integer.hpp b/glm/gtc/integer.hpp index edcbb9b8..96c19348 100644 --- a/glm/gtc/integer.hpp +++ b/glm/gtc/integer.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/integer.inl b/glm/gtc/integer.inl index 5a23f0b2..8ddf1238 100644 --- a/glm/gtc/integer.inl +++ b/glm/gtc/integer.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -40,7 +40,7 @@ namespace detail { //Equivalent to return findMSB(vec); but save one function call in ASM with VC //return findMSB(vec); - return detail::compute_findMSB_vec::call(vec); + return vecType(detail::compute_findMSB_vec::call(vec)); } }; @@ -61,14 +61,5 @@ namespace detail } }; # endif//GLM_HAS_BITSCAN_WINDOWS - - template class vecType, typename genType> - struct compute_mod - { - GLM_FUNC_QUALIFIER static vecType call(vecType const & a, genType const & b) - { - return a % b; - } - }; }//namespace detail }//namespace glm diff --git a/glm/gtc/matrix_access.hpp b/glm/gtc/matrix_access.hpp index 6541fe99..6a684412 100644 --- a/glm/gtc/matrix_access.hpp +++ b/glm/gtc/matrix_access.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/matrix_access.inl b/glm/gtc/matrix_access.inl index 1799b0d6..c0c2faad 100644 --- a/glm/gtc/matrix_access.inl +++ b/glm/gtc/matrix_access.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/matrix_integer.hpp b/glm/gtc/matrix_integer.hpp index 8d99615d..13fc3781 100644 --- a/glm/gtc/matrix_integer.hpp +++ b/glm/gtc/matrix_integer.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/matrix_inverse.hpp b/glm/gtc/matrix_inverse.hpp index 76ab2b8a..9d9bd845 100644 --- a/glm/gtc/matrix_inverse.hpp +++ b/glm/gtc/matrix_inverse.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/matrix_inverse.inl b/glm/gtc/matrix_inverse.inl index c3409318..d88a3319 100644 --- a/glm/gtc/matrix_inverse.inl +++ b/glm/gtc/matrix_inverse.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index c7445e47..e2fc72a9 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index a372eee8..25df2e3e 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -218,7 +218,6 @@ namespace glm ) { assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - assert(zFar > zNear); T const tanHalfFovy = tan(fovy / static_cast(2)); diff --git a/glm/gtc/noise.hpp b/glm/gtc/noise.hpp index d4ae69ef..9bab7ba6 100644 --- a/glm/gtc/noise.hpp +++ b/glm/gtc/noise.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/noise.inl b/glm/gtc/noise.inl index 20884bb7..126c7dcc 100644 --- a/glm/gtc/noise.inl +++ b/glm/gtc/noise.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/packing.hpp b/glm/gtc/packing.hpp index 99c6f023..8808aa4f 100644 --- a/glm/gtc/packing.hpp +++ b/glm/gtc/packing.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -283,7 +283,7 @@ namespace glm /// @see vec2 unpackSnorm2x16(uint32 p) /// @see GLSL unpackSnorm4x8 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 const & p); + GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 p); /// Returns an unsigned integer obtained by converting the components of a floating-point scalar /// to the 16-bit floating-point representation found in the OpenGL Specification, diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl index be9ab4ae..58b1d59b 100644 --- a/glm/gtc/packing.inl +++ b/glm/gtc/packing.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -144,14 +144,14 @@ namespace detail GLM_FUNC_QUALIFIER glm::uint floatTo11bit(float x) { if(x == 0.0f) - return 0; + return 0u; else if(glm::isnan(x)) - return ~0; + return ~0u; else if(glm::isinf(x)) - return 0x1f << 6; + return 0x1Fu << 6u; # if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) - uint Pack = 0; + uint Pack = 0u; memcpy(&Pack, &x, sizeof(Pack)); # else uint Pack = reinterpret_cast(x); @@ -183,11 +183,11 @@ namespace detail GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x) { if(x == 0.0f) - return 0; + return 0u; else if(glm::isnan(x)) - return ~0; + return ~0u; else if(glm::isinf(x)) - return 0x1f << 5; + return 0x1Fu << 5u; # if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) uint Pack = 0; @@ -257,33 +257,31 @@ namespace detail GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 p) { - float Unpack(static_cast(p)); + float const Unpack(p); return Unpack * static_cast(0.0039215686274509803921568627451); // 1 / 255 } GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const & v) { - u8vec2 Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - uint16* Packed = reinterpret_cast(&Topack); - return *Packed; + u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + return reinterpret_cast(Topack); } GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p) { - u8vec2* Unpacked = reinterpret_cast(const_cast(&p)); - return vec2(*Unpacked) * float(0.0039215686274509803921568627451); // 1 / 255 + vec2 const Unpack(reinterpret_cast(p)); + return Unpack * float(0.0039215686274509803921568627451); // 1 / 255 } GLM_FUNC_QUALIFIER uint8 packSnorm1x8(float v) { - int8 Topack(static_cast(round(clamp(v ,-1.0f, 1.0f) * 127.0f))); - uint8* Packed = reinterpret_cast(&Topack); - return *Packed; + int8 const Topack(static_cast(round(clamp(v ,-1.0f, 1.0f) * 127.0f))); + return reinterpret_cast(Topack); } GLM_FUNC_QUALIFIER float unpackSnorm1x8(uint8 p) { - float Unpack(static_cast(*const_cast(&p))); + float const Unpack(reinterpret_cast(p)); return clamp( Unpack * 0.00787401574803149606299212598425f, // 1.0f / 127.0f -1.0f, 1.0f); @@ -291,16 +289,15 @@ namespace detail GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const & v) { - i8vec2 Topack(round(clamp(v ,-1.0f, 1.0f) * 127.0f)); - uint16* Packed = reinterpret_cast(&Topack); - return *Packed; + i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f)); + return reinterpret_cast(Topack); } GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p) { - i8vec2* Unpack = reinterpret_cast(const_cast(&p)); + vec2 const Unpack(reinterpret_cast(p)); return clamp( - vec2(*Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f + Unpack * 0.00787401574803149606299212598425f, // 1.0f / 127.0f -1.0f, 1.0f); } @@ -311,33 +308,31 @@ namespace detail GLM_FUNC_QUALIFIER float unpackUnorm1x16(uint16 p) { - float Unpack = static_cast(*const_cast(&p)); + float const Unpack(p); return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 } GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const & v) { - u16vec4 Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f)); - uint64* Packed = reinterpret_cast(&Topack); - return *Packed; + u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f)); + return reinterpret_cast(Topack); } GLM_FUNC_QUALIFIER vec4 unpackUnorm4x16(uint64 p) { - u16vec4* Unpack = reinterpret_cast(const_cast(&p)); - return vec4(*Unpack) * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 + vec4 const Unpack(reinterpret_cast(p)); + return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 } GLM_FUNC_QUALIFIER uint16 packSnorm1x16(float v) { - int16 Topack = static_cast(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - uint16* Packed = reinterpret_cast(&Topack); - return *Packed; + int16 const Topack = static_cast(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); + return reinterpret_cast(Topack); } GLM_FUNC_QUALIFIER float unpackSnorm1x16(uint16 p) { - float Unpack = static_cast(*const_cast(&p)); + float const Unpack(reinterpret_cast(p)); return clamp( Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, -1.0f, 1.0f); @@ -345,30 +340,27 @@ namespace detail GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const & v) { - i16vec4 Topack = static_cast(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - uint64* Packed = reinterpret_cast(&Topack); - return *Packed; + i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); + return reinterpret_cast(Topack); } GLM_FUNC_QUALIFIER vec4 unpackSnorm4x16(uint64 p) { - i16vec4* Unpack(reinterpret_cast(const_cast(&p))); + vec4 const Unpack(reinterpret_cast(p)); return clamp( - vec4(*Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, + Unpack * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, -1.0f, 1.0f); } GLM_FUNC_QUALIFIER uint16 packHalf1x16(float v) { - int16 Topack = detail::toFloat16(v); - uint16* Packed = reinterpret_cast(&Topack); - return *Packed; + int16 const Topack(detail::toFloat16(v)); + return reinterpret_cast(Topack); } GLM_FUNC_QUALIFIER float unpackHalf1x16(uint16 v) { - int16* Unpack = reinterpret_cast(const_cast(&v)); - return detail::toFloat32(*Unpack); + return detail::toFloat32(reinterpret_cast(v)); } GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const & v) @@ -379,19 +371,17 @@ namespace detail detail::toFloat16(v.z), detail::toFloat16(v.w)); - uint64* Packed = reinterpret_cast(&Unpack); - return *Packed; + return reinterpret_cast(Unpack); } GLM_FUNC_QUALIFIER glm::vec4 unpackHalf4x16(uint64 v) { - i16vec4* p = reinterpret_cast(const_cast(&v)); - i16vec4 Unpack(*p); + i16vec4 Unpack(reinterpret_cast(v)); return vec4( - detail::toFloat32(Unpack.x), - detail::toFloat32(Unpack.y), - detail::toFloat32(Unpack.z), + detail::toFloat32(Unpack.x), + detail::toFloat32(Unpack.y), + detail::toFloat32(Unpack.z), detail::toFloat32(Unpack.w)); } @@ -483,7 +473,7 @@ namespace detail GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const & v) { - return + return ((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) | ((detail::floatTo11bit(v.y) & ((1 << 11) - 1)) << 11) | ((detail::floatTo10bit(v.z) & ((1 << 10) - 1)) << 22); @@ -492,8 +482,8 @@ namespace detail GLM_FUNC_QUALIFIER vec3 unpackF2x11_1x10(uint32 v) { return vec3( - detail::packed11bitToFloat(v >> 0), - detail::packed11bitToFloat(v >> 11), + detail::packed11bitToFloat(v >> 0), + detail::packed11bitToFloat(v >> 11), detail::packed10bitToFloat(v >> 22)); } diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 15372cd0..0735abf8 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -91,6 +91,7 @@ namespace glm // Implicit basic constructors GLM_FUNC_DECL tquat(); + GLM_FUNC_DECL tquat(tquat const & q); template GLM_FUNC_DECL tquat(tquat const & q); @@ -113,8 +114,10 @@ namespace glm # endif // explicit conversion operators - GLM_FUNC_DECL explicit operator tmat3x3(); - GLM_FUNC_DECL explicit operator tmat4x4(); +# 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 /// @@ -131,10 +134,19 @@ namespace glm ////////////////////////////////////// // Operators - GLM_FUNC_DECL tquat & operator+=(tquat const & q); - GLM_FUNC_DECL tquat & operator*=(tquat const & q); - GLM_FUNC_DECL tquat & operator*=(T const & s); - GLM_FUNC_DECL tquat & operator/=(T const & s); + + GLM_FUNC_DECL tquat & operator=(tquat const & m); + + template + GLM_FUNC_DECL tquat & operator=(tquat const & m); + template + GLM_FUNC_DECL tquat & operator+=(tquat const & q); + template + GLM_FUNC_DECL tquat & operator*=(tquat const & q); + template + GLM_FUNC_DECL tquat & operator*=(U s); + template + GLM_FUNC_DECL tquat & operator/=(U s); }; template @@ -196,7 +208,7 @@ namespace glm /// @see gtc_quaternion /// @see - slerp(tquat const & x, tquat const & y, T const & a) template - GLM_FUNC_DECL tquat mix(tquat const & x, tquat const & y, T const & a); + GLM_FUNC_DECL tquat mix(tquat const & x, tquat const & y, T a); /// Linear interpolation of two quaternions. /// The interpolation is oriented. @@ -207,7 +219,7 @@ namespace glm /// @tparam T Value type used to build the quaternion. Supported: half, float or double. /// @see gtc_quaternion template - GLM_FUNC_DECL tquat lerp(tquat const & x, tquat const & y, T const & a); + GLM_FUNC_DECL tquat lerp(tquat const & x, tquat const & y, T a); /// Spherical linear interpolation of two quaternions. /// The interpolation always take the short path and the rotation is performed at constant speed. @@ -218,7 +230,7 @@ namespace glm /// @tparam T Value type used to build the quaternion. Supported: half, float or double. /// @see gtc_quaternion template - GLM_FUNC_DECL tquat slerp(tquat const & x, tquat const & y, T const & a); + GLM_FUNC_DECL tquat slerp(tquat const & x, tquat const & y, T a); /// Returns the q conjugate. /// diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index d9615ce1..33ca82cc 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -104,6 +104,11 @@ namespace detail # endif {} + template + GLM_FUNC_QUALIFIER tquat::tquat(tquat const & q) + : x(q.x), y(q.y), z(q.z), w(q.w) + {} + template template GLM_FUNC_QUALIFIER tquat::tquat(tquat const & q) @@ -176,7 +181,7 @@ namespace detail this->w = c.x * c.y * c.z + s.x * s.y * s.z; this->x = s.x * c.y * c.z - c.x * s.y * s.z; this->y = c.x * s.y * c.z + s.x * c.y * s.z; - this->z = c.x * c.y * s.z - s.x * s.y * c.z; + this->z = c.x * c.y * s.z - s.x * s.y * c.z; } template @@ -190,7 +195,8 @@ namespace detail { *this = quat_cast(m); } - + +# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS template GLM_FUNC_QUALIFIER tquat::operator tmat3x3() { @@ -202,6 +208,7 @@ namespace detail { return mat4_cast(*this); } +# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS template GLM_FUNC_QUALIFIER tquat conjugate(tquat const & q) @@ -219,19 +226,43 @@ namespace detail // tquat operators template - GLM_FUNC_QUALIFIER tquat & tquat::operator+=(tquat const & q) + 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; + this->w = q.w; + this->x = q.x; + this->y = q.y; + this->z = q.z; return *this; } template - GLM_FUNC_QUALIFIER tquat & tquat::operator*=(tquat const & q) + template + GLM_FUNC_QUALIFIER tquat & tquat::operator=(tquat const & q) + { + this->w = static_cast(q.w); + this->x = static_cast(q.x); + this->y = static_cast(q.y); + this->z = static_cast(q.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER tquat & tquat::operator+=(tquat const & q) + { + this->w += static_cast(q.w); + this->x += static_cast(q.x); + this->y += static_cast(q.y); + this->z += static_cast(q.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER tquat & tquat::operator*=(tquat const & r) { tquat const p(*this); + tquat const q(r); this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z; this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y; @@ -240,23 +271,25 @@ namespace detail return *this; } - template - GLM_FUNC_QUALIFIER tquat & tquat::operator*=(T const & s) + template + template + GLM_FUNC_QUALIFIER tquat & tquat::operator*=(U s) { - this->w *= s; - this->x *= s; - this->y *= s; - this->z *= s; + this->w *= static_cast(s); + this->x *= static_cast(s); + this->y *= static_cast(s); + this->z *= static_cast(s); return *this; } - template - GLM_FUNC_QUALIFIER tquat & tquat::operator/=(T const & s) + template + template + GLM_FUNC_QUALIFIER tquat & tquat::operator/=(U s) { - this->w /= s; - this->x /= s; - this->y /= s; - this->z /= s; + this->w /= static_cast(s); + this->x /= static_cast(s); + this->y /= static_cast(s); + this->z /= static_cast(s); return *this; } @@ -449,7 +482,7 @@ namespace detail */ template - GLM_FUNC_QUALIFIER tquat mix(tquat const & x, tquat const & y, T const & a) + GLM_FUNC_QUALIFIER tquat mix(tquat const & x, tquat const & y, T a) { T cosTheta = dot(x, y); @@ -472,7 +505,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tquat lerp(tquat const & x, tquat const & y, T const & a) + GLM_FUNC_QUALIFIER tquat lerp(tquat const & x, tquat const & y, T a) { // Lerp is only defined in [0, 1] assert(a >= static_cast(0)); @@ -482,7 +515,7 @@ namespace detail } template - GLM_FUNC_QUALIFIER tquat slerp(tquat const & x, tquat const & y, T const & a) + GLM_FUNC_QUALIFIER tquat slerp(tquat const & x, tquat const & y, T a) { tquat z = y; diff --git a/glm/gtc/random.hpp b/glm/gtc/random.hpp index 83b79ef5..a9254c01 100644 --- a/glm/gtc/random.hpp +++ b/glm/gtc/random.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl index b6af9e50..e21b1953 100644 --- a/glm/gtc/random.inl +++ b/glm/gtc/random.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/reciprocal.hpp b/glm/gtc/reciprocal.hpp index 91c23e3b..72480788 100644 --- a/glm/gtc/reciprocal.hpp +++ b/glm/gtc/reciprocal.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/reciprocal.inl b/glm/gtc/reciprocal.inl index b1a0d5c7..b86c347b 100644 --- a/glm/gtc/reciprocal.inl +++ b/glm/gtc/reciprocal.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/round.hpp b/glm/gtc/round.hpp index fd68d615..270849e7 100644 --- a/glm/gtc/round.hpp +++ b/glm/gtc/round.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/round.inl b/glm/gtc/round.inl index ceffb7cd..255dec66 100644 --- a/glm/gtc/round.inl +++ b/glm/gtc/round.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/type_precision.hpp b/glm/gtc/type_precision.hpp index 6ed8614c..4716af8c 100644 --- a/glm/gtc/type_precision.hpp +++ b/glm/gtc/type_precision.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/type_precision.inl b/glm/gtc/type_precision.inl index 0a1c0165..0107db83 100644 --- a/glm/gtc/type_precision.inl +++ b/glm/gtc/type_precision.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/type_ptr.hpp b/glm/gtc/type_ptr.hpp index 8a6c5e25..302d8273 100644 --- a/glm/gtc/type_ptr.hpp +++ b/glm/gtc/type_ptr.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/type_ptr.inl b/glm/gtc/type_ptr.inl index d4a93b55..0e1cd312 100644 --- a/glm/gtc/type_ptr.inl +++ b/glm/gtc/type_ptr.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/ulp.hpp b/glm/gtc/ulp.hpp index ee634455..b0f8859d 100644 --- a/glm/gtc/ulp.hpp +++ b/glm/gtc/ulp.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/ulp.inl b/glm/gtc/ulp.inl index 34cd1e53..765698b1 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -203,7 +203,7 @@ namespace glm template <> GLM_FUNC_QUALIFIER float next_float(float const & x) { -# if((GLM_LANG & GLM_LANG_CXX11_FLAG) && !(GLM_PLATFORM & GLM_PLATFORM_ANDROID)) +# if GLM_HAS_CXX11_STL return std::nextafter(x, std::numeric_limits::max()); # elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) return detail::nextafterf(x, FLT_MAX); @@ -217,7 +217,7 @@ namespace glm template <> GLM_FUNC_QUALIFIER double next_float(double const & x) { -# if((GLM_LANG & GLM_LANG_CXX11_FLAG) && !(GLM_PLATFORM & GLM_PLATFORM_ANDROID)) +# if GLM_HAS_CXX11_STL return std::nextafter(x, std::numeric_limits::max()); # elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) return detail::nextafter(x, std::numeric_limits::max()); @@ -239,7 +239,7 @@ namespace glm GLM_FUNC_QUALIFIER float prev_float(float const & x) { -# if((GLM_LANG & GLM_LANG_CXX11_FLAG) && !(GLM_PLATFORM & GLM_PLATFORM_ANDROID)) +# if GLM_HAS_CXX11_STL return std::nextafter(x, std::numeric_limits::min()); # elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) return detail::nextafterf(x, FLT_MIN); @@ -252,7 +252,7 @@ namespace glm GLM_FUNC_QUALIFIER double prev_float(double const & x) { -# if((GLM_LANG & GLM_LANG_CXX11_FLAG) && !(GLM_PLATFORM & GLM_PLATFORM_ANDROID)) +# if GLM_HAS_CXX11_STL return std::nextafter(x, std::numeric_limits::min()); # elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) return _nextafter(x, DBL_MIN); diff --git a/glm/gtc/vec1.hpp b/glm/gtc/vec1.hpp index 6a474d39..fefcbb1f 100644 --- a/glm/gtc/vec1.hpp +++ b/glm/gtc/vec1.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtc/vec1.inl b/glm/gtc/vec1.inl index c8afef9e..4a7c88dc 100644 --- a/glm/gtc/vec1.inl +++ b/glm/gtc/vec1.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/associated_min_max.hpp b/glm/gtx/associated_min_max.hpp index 09d046d3..84c13222 100644 --- a/glm/gtx/associated_min_max.hpp +++ b/glm/gtx/associated_min_max.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/associated_min_max.inl b/glm/gtx/associated_min_max.inl index 78f050e1..41f08b46 100644 --- a/glm/gtx/associated_min_max.inl +++ b/glm/gtx/associated_min_max.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/bit.hpp b/glm/gtx/bit.hpp index b5c73687..126fc223 100644 --- a/glm/gtx/bit.hpp +++ b/glm/gtx/bit.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/bit.inl b/glm/gtx/bit.inl index 70252c9a..5178a123 100644 --- a/glm/gtx/bit.inl +++ b/glm/gtx/bit.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/closest_point.hpp b/glm/gtx/closest_point.hpp index 2a7e553e..0e5a1874 100644 --- a/glm/gtx/closest_point.hpp +++ b/glm/gtx/closest_point.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/closest_point.inl b/glm/gtx/closest_point.inl index b92d73b0..89bb1a88 100644 --- a/glm/gtx/closest_point.inl +++ b/glm/gtx/closest_point.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/color_space.hpp b/glm/gtx/color_space.hpp index bba74ad8..16b9d894 100644 --- a/glm/gtx/color_space.hpp +++ b/glm/gtx/color_space.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/color_space.inl b/glm/gtx/color_space.inl index 5e0943d8..76333b76 100644 --- a/glm/gtx/color_space.inl +++ b/glm/gtx/color_space.inl @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/color_space_YCoCg.hpp b/glm/gtx/color_space_YCoCg.hpp index 89bd762e..4fbbf820 100644 --- a/glm/gtx/color_space_YCoCg.hpp +++ b/glm/gtx/color_space_YCoCg.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/color_space_YCoCg.inl b/glm/gtx/color_space_YCoCg.inl index a5662263..45e41671 100644 --- a/glm/gtx/color_space_YCoCg.inl +++ b/glm/gtx/color_space_YCoCg.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -45,19 +45,6 @@ namespace glm return result; } - template - GLM_FUNC_QUALIFIER tvec3 rgb2YCoCgR - ( - tvec3 const & rgbColor - ) - { - tvec3 result; - result.x/*Y */ = rgbColor.g / T(2) + (rgbColor.r + rgbColor.b) / T(4); - result.y/*Co*/ = rgbColor.r - rgbColor.b; - result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) / T(2); - return result; - } - template GLM_FUNC_QUALIFIER tvec3 YCoCg2rgb ( @@ -66,22 +53,85 @@ namespace glm { tvec3 result; result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z; - result.g = YCoCgColor.x + YCoCgColor.z; + result.g = YCoCgColor.x + YCoCgColor.z; result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z; return result; } + template + class compute_YCoCgR { + public: + static GLM_FUNC_QUALIFIER tvec3 rgb2YCoCgR + ( + tvec3 const & rgbColor + ) + { + tvec3 result; + result.x/*Y */ = rgbColor.g / T(2) + (rgbColor.r + rgbColor.b) / T(4); + result.y/*Co*/ = rgbColor.r - rgbColor.b; + result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) / T(2); + return result; + } + + static GLM_FUNC_QUALIFIER tvec3 YCoCgR2rgb + ( + tvec3 const & YCoCgRColor + ) + { + tvec3 result; + T tmp = YCoCgRColor.x - (YCoCgRColor.z / T(2)); + result.g = YCoCgRColor.z + tmp; + result.b = tmp - (YCoCgRColor.y / T(2)); + result.r = result.b + YCoCgRColor.y; + return result; + } + }; + + template + class compute_YCoCgR { + public: + static GLM_FUNC_QUALIFIER tvec3 rgb2YCoCgR + ( + tvec3 const & rgbColor + ) + { + tvec3 result; + result.y/*Co*/ = rgbColor.r - rgbColor.b; + T tmp = rgbColor.b + (result.y >> 1); + result.z/*Cg*/ = rgbColor.g - tmp; + result.x/*Y */ = tmp + (result.z >> 1); + return result; + } + + static GLM_FUNC_QUALIFIER tvec3 YCoCgR2rgb + ( + tvec3 const & YCoCgRColor + ) + { + tvec3 result; + T tmp = YCoCgRColor.x - (YCoCgRColor.z >> 1); + result.g = YCoCgRColor.z + tmp; + result.b = tmp - (YCoCgRColor.y >> 1); + result.r = result.b + YCoCgRColor.y; + return result; + } + }; + + template + GLM_FUNC_QUALIFIER tvec3 rgb2YCoCgR + ( + tvec3 const & rgbColor + ) + { + return compute_YCoCgR::is_integer>::rgb2YCoCgR(rgbColor); + } + template GLM_FUNC_QUALIFIER tvec3 YCoCgR2rgb ( tvec3 const & YCoCgRColor ) { - tvec3 result; - T tmp = YCoCgRColor.x - (YCoCgRColor.z / T(2)); - result.g = YCoCgRColor.z + tmp; - result.b = tmp - (YCoCgRColor.y / T(2)); - result.r = result.b + YCoCgRColor.y; - return result; + return compute_YCoCgR::is_integer>::YCoCgR2rgb(YCoCgRColor); } }//namespace glm diff --git a/glm/gtx/common.hpp b/glm/gtx/common.hpp index 15790583..0c11f843 100644 --- a/glm/gtx/common.hpp +++ b/glm/gtx/common.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -68,6 +68,14 @@ namespace glm template GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x); + /// Similiar to 'mod' but with a different rounding and integer support. + /// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)' + /// + /// @see GLSL mod vs HLSL fmod + /// @see GLSL mod man page + template class vecType> + GLM_FUNC_DECL vecType fmod(vecType const & v); + /// @} }//namespace glm diff --git a/glm/gtx/common.inl b/glm/gtx/common.inl index 9b9dbb9c..337abfeb 100644 --- a/glm/gtx/common.inl +++ b/glm/gtx/common.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -32,14 +32,34 @@ #include -namespace glm +namespace glm{ +namespace detail { + template class vecType, bool isFloat = true> + struct compute_fmod + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & a, vecType const & b) + { + return detail::functor2::call(std::fmod, a, b); + } + }; + + template class vecType> + struct compute_fmod + { + GLM_FUNC_QUALIFIER static vecType call(vecType const & a, vecType const & b) + { + return a % b; + } + }; +}//namespace detail + template GLM_FUNC_QUALIFIER bool isdenormal(T const & x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); -# if(GLM_LANG & GLM_LANG_CXX11_FLAG) +# if GLM_HAS_CXX11_STL return std::fpclassify(x) == FP_SUBNORMAL; # else return x != static_cast(0) && std::fabs(x) < std::numeric_limits::min(); @@ -99,4 +119,23 @@ namespace glm isdenormal(x.z), isdenormal(x.w)); } + + // fmod + template + GLM_FUNC_QUALIFIER genType fmod(genType x, genType y) + { + return fmod(tvec1(x), y).x; + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType fmod(vecType const & x, T y) + { + return detail::compute_fmod::is_iec559>::call(x, vecType(y)); + } + + template class vecType> + GLM_FUNC_QUALIFIER vecType fmod(vecType const & x, vecType const & y) + { + return detail::compute_fmod::is_iec559>::call(x, y); + } }//namespace glm diff --git a/glm/gtx/compatibility.hpp b/glm/gtx/compatibility.hpp index 635ee912..6a3623be 100644 --- a/glm/gtx/compatibility.hpp +++ b/glm/gtx/compatibility.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -73,8 +73,6 @@ namespace glm template GLM_FUNC_QUALIFIER tvec3 lerp(const tvec3& x, const tvec3& y, const tvec3& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) template GLM_FUNC_QUALIFIER tvec4 lerp(const tvec4& x, const tvec4& y, const tvec4& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER T slerp(tquat const & x, tquat const & y, T const & a){return mix(x, y, a);} //!< \brief Returns the slurp interpolation between two quaternions. - template GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) template GLM_FUNC_QUALIFIER tvec2 saturate(const tvec2& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) template GLM_FUNC_QUALIFIER tvec3 saturate(const tvec3& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) diff --git a/glm/gtx/compatibility.inl b/glm/gtx/compatibility.inl index 75372d26..decc26c2 100644 --- a/glm/gtx/compatibility.inl +++ b/glm/gtx/compatibility.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -39,11 +39,11 @@ namespace glm GLM_FUNC_QUALIFIER bool isfinite( genType const & x) { -# if(GLM_LANG & GLM_LANG_CXX11_FLAG) +# if GLM_HAS_CXX11_STL return std::isfinite(x) != 0; -# elif(GLM_COMPILER & GLM_COMPILER_VC) +# elif GLM_COMPILER & GLM_COMPILER_VC return _finite(x); -# elif(GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID) +# 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(); diff --git a/glm/gtx/component_wise.hpp b/glm/gtx/component_wise.hpp index fb6b6ed6..d5b3d818 100644 --- a/glm/gtx/component_wise.hpp +++ b/glm/gtx/component_wise.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/component_wise.inl b/glm/gtx/component_wise.inl index e1252a0c..f944faeb 100644 --- a/glm/gtx/component_wise.inl +++ b/glm/gtx/component_wise.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 333d9681..3cb14746 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -90,6 +90,7 @@ namespace glm // Implicit basic constructors GLM_FUNC_DECL tdualquat(); + GLM_FUNC_DECL tdualquat(tdualquat const & d); template GLM_FUNC_DECL tdualquat(tdualquat const & d); @@ -116,8 +117,14 @@ namespace glm GLM_FUNC_DECL explicit tdualquat(tmat3x4 const & aug_mat); // Operators - GLM_FUNC_DECL tdualquat & operator*=(T const & s); - GLM_FUNC_DECL tdualquat & operator/=(T const & s); + GLM_FUNC_DECL tdualquat & operator=(tdualquat const & m); + + template + GLM_FUNC_DECL tdualquat & operator=(tdualquat const & m); + template + GLM_FUNC_DECL tdualquat & operator*=(U s); + template + GLM_FUNC_DECL tdualquat & operator/=(U s); }; template diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index eb1b5970..8fed0855 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -91,6 +91,12 @@ namespace glm # endif {} + template + GLM_FUNC_QUALIFIER tdualquat::tdualquat(tdualquat const & d) + : real(d.real) + , dual(d.dual) + {} + template template GLM_FUNC_QUALIFIER tdualquat::tdualquat(tdualquat const & d) @@ -150,18 +156,37 @@ namespace glm // tdualquat operators template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator*=(T const & s) + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const & q) { - this->real *= s; - this->dual *= s; + this->real = q.real; + this->dual = q.dual; return *this; } template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator/=(T const & s) + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const & q) { - this->real /= s; - this->dual /= s; + this->real = q.real; + this->dual = q.dual; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator*=(U s) + { + this->real *= static_cast(s); + this->dual *= static_cast(s); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator/=(U s) + { + this->real /= static_cast(s); + this->dual /= static_cast(s); return *this; } diff --git a/glm/gtx/euler_angles.hpp b/glm/gtx/euler_angles.hpp index 6dcd303b..7a1cb364 100644 --- a/glm/gtx/euler_angles.hpp +++ b/glm/gtx/euler_angles.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/euler_angles.inl b/glm/gtx/euler_angles.inl index c75af997..77fea425 100644 --- a/glm/gtx/euler_angles.inl +++ b/glm/gtx/euler_angles.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/extend.hpp b/glm/gtx/extend.hpp index e975ba7e..ad3a50a4 100644 --- a/glm/gtx/extend.hpp +++ b/glm/gtx/extend.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/extend.inl b/glm/gtx/extend.inl index c5b833f1..c8768e26 100644 --- a/glm/gtx/extend.inl +++ b/glm/gtx/extend.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/extented_min_max.hpp b/glm/gtx/extented_min_max.hpp index e754ad4c..08d56f17 100644 --- a/glm/gtx/extented_min_max.hpp +++ b/glm/gtx/extented_min_max.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/extented_min_max.inl b/glm/gtx/extented_min_max.inl index 5c6ac070..e54c8479 100644 --- a/glm/gtx/extented_min_max.inl +++ b/glm/gtx/extented_min_max.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/fast_exponential.hpp b/glm/gtx/fast_exponential.hpp index 2f31a27c..15b7d1da 100644 --- a/glm/gtx/fast_exponential.hpp +++ b/glm/gtx/fast_exponential.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/fast_exponential.inl b/glm/gtx/fast_exponential.inl index 1c62c1ee..9cf882c2 100644 --- a/glm/gtx/fast_exponential.inl +++ b/glm/gtx/fast_exponential.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/fast_square_root.hpp b/glm/gtx/fast_square_root.hpp index f005bc7c..2073df41 100644 --- a/glm/gtx/fast_square_root.hpp +++ b/glm/gtx/fast_square_root.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/fast_square_root.inl b/glm/gtx/fast_square_root.inl index 604268dc..9db769dd 100644 --- a/glm/gtx/fast_square_root.inl +++ b/glm/gtx/fast_square_root.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/fast_trigonometry.hpp b/glm/gtx/fast_trigonometry.hpp index 9f8c1035..93c38ab2 100644 --- a/glm/gtx/fast_trigonometry.hpp +++ b/glm/gtx/fast_trigonometry.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/fast_trigonometry.inl b/glm/gtx/fast_trigonometry.inl index f08974ee..16a821ad 100644 --- a/glm/gtx/fast_trigonometry.inl +++ b/glm/gtx/fast_trigonometry.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/gradient_paint.hpp b/glm/gtx/gradient_paint.hpp index 5cfaaf1a..8e734294 100644 --- a/glm/gtx/gradient_paint.hpp +++ b/glm/gtx/gradient_paint.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/gradient_paint.inl b/glm/gtx/gradient_paint.inl index db4b2b05..9a2305fe 100644 --- a/glm/gtx/gradient_paint.inl +++ b/glm/gtx/gradient_paint.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/handed_coordinate_space.hpp b/glm/gtx/handed_coordinate_space.hpp index 42512bbd..d4020af9 100644 --- a/glm/gtx/handed_coordinate_space.hpp +++ b/glm/gtx/handed_coordinate_space.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/handed_coordinate_space.inl b/glm/gtx/handed_coordinate_space.inl index 52c82d32..86e9faff 100644 --- a/glm/gtx/handed_coordinate_space.inl +++ b/glm/gtx/handed_coordinate_space.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/integer.hpp b/glm/gtx/integer.hpp index 777847ca..f22850a0 100644 --- a/glm/gtx/integer.hpp +++ b/glm/gtx/integer.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/integer.inl b/glm/gtx/integer.inl index 58c1b48b..360818b1 100644 --- a/glm/gtx/integer.inl +++ b/glm/gtx/integer.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/intersect.hpp b/glm/gtx/intersect.hpp index e3aaaf40..ef3d42d1 100644 --- a/glm/gtx/intersect.hpp +++ b/glm/gtx/intersect.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/io.hpp b/glm/gtx/io.hpp index 5630d92b..b3842bbd 100644 --- a/glm/gtx/io.hpp +++ b/glm/gtx/io.hpp @@ -188,6 +188,8 @@ namespace glm template GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, tquat const&); template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, tvec1 const&); + template GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, tvec2 const&); template GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, tvec3 const&); diff --git a/glm/gtx/io.inl b/glm/gtx/io.inl index fe5f1949..5af266dd 100644 --- a/glm/gtx/io.inl +++ b/glm/gtx/io.inl @@ -218,6 +218,36 @@ namespace io return os; } + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, tvec1 const& a) + { + typename std::basic_ostream::sentry const cerberus(os); + + if(cerberus) + { + io::format_punct const & fmt(io::get_facet >(os)); + + if(fmt.formatted) + { + io::basic_state_saver const bss(os); + + os << std::fixed + << std::right + << std::setprecision(fmt.precision) + << std::setfill(fmt.space) + << fmt.delim_left + << std::setw(fmt.width) << a.x + << fmt.delim_right; + } + else + { + os << a.x; + } + } + + return os; + } + template GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, tvec2 const& a) { diff --git a/glm/gtx/log_base.hpp b/glm/gtx/log_base.hpp index b15383e0..94d03472 100644 --- a/glm/gtx/log_base.hpp +++ b/glm/gtx/log_base.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/log_base.inl b/glm/gtx/log_base.inl index bfb39a4c..95b8dfaa 100644 --- a/glm/gtx/log_base.inl +++ b/glm/gtx/log_base.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_cross_product.hpp b/glm/gtx/matrix_cross_product.hpp index 63945fcb..f4fd54fa 100644 --- a/glm/gtx/matrix_cross_product.hpp +++ b/glm/gtx/matrix_cross_product.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_cross_product.inl b/glm/gtx/matrix_cross_product.inl index f178f4c0..9665b067 100644 --- a/glm/gtx/matrix_cross_product.inl +++ b/glm/gtx/matrix_cross_product.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_decompose.hpp b/glm/gtx/matrix_decompose.hpp index d58db217..735b4288 100644 --- a/glm/gtx/matrix_decompose.hpp +++ b/glm/gtx/matrix_decompose.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_decompose.inl b/glm/gtx/matrix_decompose.inl index af443a7d..ba507d0e 100644 --- a/glm/gtx/matrix_decompose.inl +++ b/glm/gtx/matrix_decompose.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -125,31 +125,32 @@ namespace glm // Now get scale and shear. for(length_t i = 0; i < 3; ++i) - Row[i] = LocalMatrix[i]; + for(int j = 0; j < 3; ++j) + Row[i][j] = LocalMatrix[i][j]; // Compute X scale factor and normalize first row. Scale.x = length(Row[0]);// v3Length(Row[0]); - v3Scale(Row[0], 1.0); + v3Scale(Row[0], static_cast(1)); // Compute XY shear factor and make 2nd row orthogonal to 1st. Skew.z = dot(Row[0], Row[1]); - Row[1] = combine(Row[1], Row[0], 1.0, -Skew.z); + Row[1] = combine(Row[1], Row[0], static_cast(1), -Skew.z); // Now, compute Y scale and normalize 2nd row. Scale.y = length(Row[1]); - v3Scale(Row[1], 1.0); + v3Scale(Row[1], static_cast(1)); Skew.z /= Scale.y; // Compute XZ and YZ shears, orthogonalize 3rd row. Skew.y = glm::dot(Row[0], Row[2]); - Row[2] = combine(Row[2], Row[0], 1.0, -Skew.y); + Row[2] = combine(Row[2], Row[0], static_cast(1), -Skew.y); Skew.x = glm::dot(Row[1], Row[2]); - Row[2] = combine(Row[2], Row[1], 1.0, -Skew.x); + Row[2] = combine(Row[2], Row[1], static_cast(1), -Skew.x); // Next, get Z scale and normalize 3rd row. Scale.z = length(Row[2]); - v3Scale(Row[2], 1.0); + v3Scale(Row[2], static_cast(1)); Skew.y /= Scale.z; Skew.x /= Scale.z; diff --git a/glm/gtx/matrix_interpolation.hpp b/glm/gtx/matrix_interpolation.hpp index c2521c40..d00b722a 100644 --- a/glm/gtx/matrix_interpolation.hpp +++ b/glm/gtx/matrix_interpolation.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_interpolation.inl b/glm/gtx/matrix_interpolation.inl index 4fb5f0aa..5112d1ac 100644 --- a/glm/gtx/matrix_interpolation.inl +++ b/glm/gtx/matrix_interpolation.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_major_storage.hpp b/glm/gtx/matrix_major_storage.hpp index 34499879..a098a55d 100644 --- a/glm/gtx/matrix_major_storage.hpp +++ b/glm/gtx/matrix_major_storage.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_major_storage.inl b/glm/gtx/matrix_major_storage.inl index 1420e407..5166a667 100644 --- a/glm/gtx/matrix_major_storage.inl +++ b/glm/gtx/matrix_major_storage.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_operation.hpp b/glm/gtx/matrix_operation.hpp index b3c508d9..3c06b942 100644 --- a/glm/gtx/matrix_operation.hpp +++ b/glm/gtx/matrix_operation.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_operation.inl b/glm/gtx/matrix_operation.inl index 4cc0812d..20c1496d 100644 --- a/glm/gtx/matrix_operation.inl +++ b/glm/gtx/matrix_operation.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_query.hpp b/glm/gtx/matrix_query.hpp index 77db9d66..0be1e54f 100644 --- a/glm/gtx/matrix_query.hpp +++ b/glm/gtx/matrix_query.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_query.inl b/glm/gtx/matrix_query.inl index e22cccd4..d913116f 100644 --- a/glm/gtx/matrix_query.inl +++ b/glm/gtx/matrix_query.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_transform_2d.hpp b/glm/gtx/matrix_transform_2d.hpp index 9ad29538..010a437b 100644 --- a/glm/gtx/matrix_transform_2d.hpp +++ b/glm/gtx/matrix_transform_2d.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/matrix_transform_2d.inl b/glm/gtx/matrix_transform_2d.inl index d11dd1a1..0c97161b 100644 --- a/glm/gtx/matrix_transform_2d.inl +++ b/glm/gtx/matrix_transform_2d.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/mixed_product.hpp b/glm/gtx/mixed_product.hpp index 71fd3966..91286408 100644 --- a/glm/gtx/mixed_product.hpp +++ b/glm/gtx/mixed_product.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/mixed_product.inl b/glm/gtx/mixed_product.inl index 85063c3a..36ef8142 100644 --- a/glm/gtx/mixed_product.inl +++ b/glm/gtx/mixed_product.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/multiple.hpp b/glm/gtx/multiple.hpp index 01536cf3..f693ee19 100644 --- a/glm/gtx/multiple.hpp +++ b/glm/gtx/multiple.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/multiple.inl b/glm/gtx/multiple.inl index e4669050..878cdfbf 100644 --- a/glm/gtx/multiple.inl +++ b/glm/gtx/multiple.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/norm.hpp b/glm/gtx/norm.hpp index 6b477f1e..d8fbf2c1 100644 --- a/glm/gtx/norm.hpp +++ b/glm/gtx/norm.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/norm.inl b/glm/gtx/norm.inl index db87e0dc..2b8e9820 100644 --- a/glm/gtx/norm.inl +++ b/glm/gtx/norm.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/normal.hpp b/glm/gtx/normal.hpp index 9d7665d8..7ddb002d 100644 --- a/glm/gtx/normal.hpp +++ b/glm/gtx/normal.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/normal.inl b/glm/gtx/normal.inl index d1dd99cc..153e9a47 100644 --- a/glm/gtx/normal.inl +++ b/glm/gtx/normal.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/normalize_dot.hpp b/glm/gtx/normalize_dot.hpp index 5b1fe1d5..1429c48d 100644 --- a/glm/gtx/normalize_dot.hpp +++ b/glm/gtx/normalize_dot.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/normalize_dot.inl b/glm/gtx/normalize_dot.inl index 775ffb27..80df8dd1 100644 --- a/glm/gtx/normalize_dot.inl +++ b/glm/gtx/normalize_dot.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/number_precision.hpp b/glm/gtx/number_precision.hpp index 68a0690f..c4736f32 100644 --- a/glm/gtx/number_precision.hpp +++ b/glm/gtx/number_precision.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/number_precision.inl b/glm/gtx/number_precision.inl index c006fecb..cd93fe5a 100644 --- a/glm/gtx/number_precision.inl +++ b/glm/gtx/number_precision.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/optimum_pow.hpp b/glm/gtx/optimum_pow.hpp index 7b6fa283..e958de40 100644 --- a/glm/gtx/optimum_pow.hpp +++ b/glm/gtx/optimum_pow.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/optimum_pow.inl b/glm/gtx/optimum_pow.inl index 85f4a732..d0c22ab9 100644 --- a/glm/gtx/optimum_pow.inl +++ b/glm/gtx/optimum_pow.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/orthonormalize.hpp b/glm/gtx/orthonormalize.hpp index cc83a093..d9f031d3 100644 --- a/glm/gtx/orthonormalize.hpp +++ b/glm/gtx/orthonormalize.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/orthonormalize.inl b/glm/gtx/orthonormalize.inl index 28af77e8..07491a36 100644 --- a/glm/gtx/orthonormalize.inl +++ b/glm/gtx/orthonormalize.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/perpendicular.hpp b/glm/gtx/perpendicular.hpp index 8ff9122e..e8c7fc03 100644 --- a/glm/gtx/perpendicular.hpp +++ b/glm/gtx/perpendicular.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/perpendicular.inl b/glm/gtx/perpendicular.inl index 60b43e9e..4c321b74 100644 --- a/glm/gtx/perpendicular.inl +++ b/glm/gtx/perpendicular.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/polar_coordinates.hpp b/glm/gtx/polar_coordinates.hpp index 257e73e0..c5e3d8f5 100644 --- a/glm/gtx/polar_coordinates.hpp +++ b/glm/gtx/polar_coordinates.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/polar_coordinates.inl b/glm/gtx/polar_coordinates.inl index 80bda122..d1afbb23 100644 --- a/glm/gtx/polar_coordinates.inl +++ b/glm/gtx/polar_coordinates.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/projection.hpp b/glm/gtx/projection.hpp index acb6d045..e64065b6 100644 --- a/glm/gtx/projection.hpp +++ b/glm/gtx/projection.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/projection.inl b/glm/gtx/projection.inl index 15ee0707..c46b96a2 100644 --- a/glm/gtx/projection.inl +++ b/glm/gtx/projection.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/quaternion.hpp b/glm/gtx/quaternion.hpp index 53f548e5..34d940a1 100644 --- a/glm/gtx/quaternion.hpp +++ b/glm/gtx/quaternion.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl index 86a2f1cb..4c5b3d66 100644 --- a/glm/gtx/quaternion.inl +++ b/glm/gtx/quaternion.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/range.hpp b/glm/gtx/range.hpp index 2f0f7908..19ae2409 100644 --- a/glm/gtx/range.hpp +++ b/glm/gtx/range.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/raw_data.hpp b/glm/gtx/raw_data.hpp index 56f37afd..b30c246a 100644 --- a/glm/gtx/raw_data.hpp +++ b/glm/gtx/raw_data.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/raw_data.inl b/glm/gtx/raw_data.inl index 1e21ffb7..f573a720 100644 --- a/glm/gtx/raw_data.inl +++ b/glm/gtx/raw_data.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/rotate_vector.hpp b/glm/gtx/rotate_vector.hpp index acf1d7ca..36a45d5f 100644 --- a/glm/gtx/rotate_vector.hpp +++ b/glm/gtx/rotate_vector.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/rotate_vector.inl b/glm/gtx/rotate_vector.inl index 94a40604..cdac5744 100644 --- a/glm/gtx/rotate_vector.inl +++ b/glm/gtx/rotate_vector.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/scalar_multiplication.hpp b/glm/gtx/scalar_multiplication.hpp index f9abfe5a..5f6c4d9e 100644 --- a/glm/gtx/scalar_multiplication.hpp +++ b/glm/gtx/scalar_multiplication.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -43,8 +43,8 @@ #include "../detail/setup.hpp" -#if !GLM_HAS_TEMPLATE_ALIASES -# error "GLM_GTX_scalar_multiplication requires C++11 suppport or alias templates" +#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" #endif #include "../vec2.hpp" diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp index f4403360..89ee5e75 100644 --- a/glm/gtx/simd_mat4.hpp +++ b/glm/gtx/simd_mat4.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl index 46f149d8..14c8b45e 100644 --- a/glm/gtx/simd_mat4.inl +++ b/glm/gtx/simd_mat4.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/simd_quat.hpp b/glm/gtx/simd_quat.hpp index 6371f5e4..810ce30c 100644 --- a/glm/gtx/simd_quat.hpp +++ b/glm/gtx/simd_quat.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/simd_quat.inl b/glm/gtx/simd_quat.inl index 95cd9b0f..f9dd4c00 100644 --- a/glm/gtx/simd_quat.inl +++ b/glm/gtx/simd_quat.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp index a6868070..2d836a41 100644 --- a/glm/gtx/simd_vec4.hpp +++ b/glm/gtx/simd_vec4.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/spline.hpp b/glm/gtx/spline.hpp index 3ae86d25..09fcf4e1 100644 --- a/glm/gtx/spline.hpp +++ b/glm/gtx/spline.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/spline.inl b/glm/gtx/spline.inl index 1791b407..befdc3c6 100644 --- a/glm/gtx/spline.inl +++ b/glm/gtx/spline.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/std_based_type.hpp b/glm/gtx/std_based_type.hpp index 8190f66f..f4bc1930 100644 --- a/glm/gtx/std_based_type.hpp +++ b/glm/gtx/std_based_type.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/std_based_type.inl b/glm/gtx/std_based_type.inl index 259cfd52..4e3cf1c8 100644 --- a/glm/gtx/std_based_type.inl +++ b/glm/gtx/std_based_type.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/string_cast.hpp b/glm/gtx/string_cast.hpp index 2c3eb22f..e04320c0 100644 --- a/glm/gtx/string_cast.hpp +++ b/glm/gtx/string_cast.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 diff --git a/glm/gtx/string_cast.inl b/glm/gtx/string_cast.inl index a898b542..fb70ebc0 100644 --- a/glm/gtx/string_cast.inl +++ b/glm/gtx/string_cast.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2014 G-Truc Creation (www.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 @@ -56,8 +56,34 @@ namespace detail return std::string(text); } - static const char* True = "true"; - static const char* False = "false"; + static const char* LabelTrue = "true"; + static const char* LabelFalse = "false"; + + template + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%d";}; + }; + + template + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%f";}; + }; + +# if GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC + template <> + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%lld";}; + }; + + template <> + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%lld";}; + }; +# endif//GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC template struct prefix{}; @@ -65,67 +91,67 @@ namespace detail template <> struct prefix { - static char const * value() {return "";}; + GLM_FUNC_QUALIFIER static char const * value() {return "";}; }; template <> struct prefix { - static char const * value() {return "d";}; + GLM_FUNC_QUALIFIER static char const * value() {return "d";}; }; template <> struct prefix { - static char const * value() {return "b";}; + GLM_FUNC_QUALIFIER static char const * value() {return "b";}; }; template <> struct prefix { - static char const * value() {return "u8";}; + GLM_FUNC_QUALIFIER static char const * value() {return "u8";}; }; template <> struct prefix { - static char const * value() {return "i8";}; + GLM_FUNC_QUALIFIER static char const * value() {return "i8";}; }; template <> struct prefix { - static char const * value() {return "u16";}; + GLM_FUNC_QUALIFIER static char const * value() {return "u16";}; }; template <> struct prefix { - static char const * value() {return "i16";}; + GLM_FUNC_QUALIFIER static char const * value() {return "i16";}; }; template <> struct prefix { - static char const * value() {return "u";}; + GLM_FUNC_QUALIFIER static char const * value() {return "u";}; }; template <> struct prefix { - static char const * value() {return "i";}; + GLM_FUNC_QUALIFIER static char const * value() {return "i";}; }; template <> struct prefix { - static char const * value() {return "u64";}; + GLM_FUNC_QUALIFIER static char const * value() {return "u64";}; }; template <> struct prefix { - static char const * value() {return "i64";}; + GLM_FUNC_QUALIFIER static char const * value() {return "i64";}; }; template