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/detail/dummy.cpp b/glm/detail/dummy.cpp index 23a7c4de..50342809 100644 --- a/glm/detail/dummy.cpp +++ b/glm/detail/dummy.cpp @@ -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/setup.hpp b/glm/detail/setup.hpp index 577ef484..27601b7a 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -632,12 +632,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 @@ -664,7 +665,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) @@ -725,6 +728,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) diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 2452da84..126f5858 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -432,7 +432,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_vec4.hpp b/glm/detail/type_vec4.hpp index fa6027f7..ea9409ab 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -115,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) diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index ac8aa4c4..25df2e3e 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -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/packing.inl b/glm/gtc/packing.inl index da58fc2c..902787fb 100644 --- a/glm/gtc/packing.inl +++ b/glm/gtc/packing.inl @@ -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; diff --git a/glm/gtx/matrix_decompose.inl b/glm/gtx/matrix_decompose.inl index 30b640f9..ba507d0e 100644 --- a/glm/gtx/matrix_decompose.inl +++ b/glm/gtx/matrix_decompose.inl @@ -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/readme.txt b/readme.txt index fcac62fa..1358fd45 100644 --- a/readme.txt +++ b/readme.txt @@ -62,15 +62,29 @@ GLM is a header only library, there is nothing to build, just include it. More informations in GLM manual: http://glm.g-truc.net/glm.pdf +================================================================================ +GLM 0.9.7.0: 2015-XX-XX +-------------------------------------------------------------------------------- + + ================================================================================ GLM 0.9.6.2: 2015-01-XX -------------------------------------------------------------------------------- Features: - Added display of GLM version with other GLM_MESSAGES +- Added ARM instruction set detection + +Improvements: +- Removed assert for perspective with zFar < zNear #298 +- Added Visual Studio natvis support for vec1, quat and dualqual types Fixes: - Fixed faceforward build #289 - Fixed conflict with Xlib #define True 1 #293 +- Fixed decompose function VS2010 templating issues #294 +- Fixed mat4x3 = mat2x3 * mat4x2 operator #297 +- Fixed warnings in F2x11_1x10 packing function in GTC_packing #295 +- Fixed Visual Studio natvis support for vec4 #288 ================================================================================ GLM 0.9.6.1: 2014-12-10 diff --git a/test/core/core_setup_message.cpp b/test/core/core_setup_message.cpp index 07d5d0b5..0955f2e1 100644 --- a/test/core/core_setup_message.cpp +++ b/test/core/core_setup_message.cpp @@ -176,6 +176,8 @@ int test_instruction_set() if(GLM_ARCH == GLM_ARCH_PURE) std::printf("GLM_ARCH_PURE "); + if(GLM_ARCH & GLM_ARCH_ARM) + std::printf("GLM_ARCH_ARM "); if(GLM_ARCH & GLM_ARCH_AVX2) std::printf("GLM_ARCH_AVX2 "); if(GLM_ARCH & GLM_ARCH_AVX) diff --git a/util/glm.natvis b/util/glm.natvis index 8ae5d91e..d13bf30e 100644 --- a/util/glm.natvis +++ b/util/glm.natvis @@ -4,28 +4,66 @@ - - ({x}, {y}) + + {x} + + x + + + + + {x}, {y} x y - - - ({x}, {y}, {z}) + + + + {x}, {y}, {z} x y z - - - ({x}, {y}, {z}, {w}) + + + + {x}, {y}, {z}, {w} x y z w - - \ No newline at end of file + + + + + + ({x}, {y}, {z}), {w} + + x + y + z + w + + + + + (({real.x}, {real.y}, {real.z}), {real.w}), (({dual.x}, {dual.y}, {dual.z}), {dual.w}) + + real + dual + + + +