From 1e0825028e795a96e38fee78ac07486782fd2178 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 9 Jan 2015 01:37:16 +0100 Subject: [PATCH] Fixed Visual Studio natvis support for vec4 #288, Added Visual Studio natvis support for vec1, quat and dualqual types --- glm/CMakeLists.txt | 3 ++- glm/detail/dummy.cpp | 20 ++++++++++---- glm/detail/type_vec4.hpp | 5 ++-- readme.txt | 4 ++- util/glm.natvis | 58 +++++++++++++++++++++++++++++++++------- 5 files changed, 71 insertions(+), 19 deletions(-) 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/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/readme.txt b/readme.txt index d1c38d11..b41752c4 100644 --- a/readme.txt +++ b/readme.txt @@ -71,12 +71,14 @@ Features: 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 decompose function VS2010 templating issues #294 - Fixed mat4x3 = mat2x3 * mat4x2 operator #297 -- Fixed warnings in F2x11_1x10 pcking function in GTC_packing #295 +- 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/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 + + + +