diff --git a/CMakeLists.txt b/CMakeLists.txt index 7375f2d5..85ae87a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS) #add_definitions(-pedantic) #add_definitions(-S) #add_definitions(-s) -#add_definitions(-msse2) +add_definitions(-msse2) #add_definitions(-m32) #add_definitions(-mfpmath=387) #add_definitions(-ffast-math) diff --git a/doc/about.html b/doc/about.html index cdbfb48f..3ba3953d 100644 --- a/doc/about.html +++ b/doc/about.html @@ -11,8 +11,8 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


+
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM)
A C++ mathematics library for graphics programming


OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specification.

@@ -32,4 +32,5 @@

Thanks for contributing to the project by submitting tickets for bug reports and feature requests. (SF.net account required). Any feedback is welcome at glm@g-truc.net. -

GLM is written as a platform independent library with no dependence and officially supports the following compilers:
  • GCC 3.4 and higher
  • LLVM 2.3 through GCC 4.2 front-end and higher
  • Visual C++ 2005 and higher
  • Any C++ compiler following C++98 norm
_________________

_________________

Copyright © 2005 - 2011G-Truc Creation
\ No newline at end of file +

GLM is written as a platform independent library with no dependence and officially supports the following compilers:
  • Clang 2.0 and higher
  • CUDA 3.0 and higher +
  • GCC 3.4 and higher
  • LLVM 2.3 through GCC 4.2 front-end and higher
  • Visual C++ 2005 and higher
  • Any C++ compiler following C++98 norm
_________________

_________________

Copyright © 2005 - 2011G-Truc Creation
\ No newline at end of file diff --git a/doc/code.html b/doc/code.html index a07bc9f2..5a742173 100644 --- a/doc/code.html +++ b/doc/code.html @@ -11,8 +11,8 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


Compute a triangle normal:
  • #include <glm/glm.hpp>
  • void computeNormal(triangle & Triangle) +
    OpenGL Mathematics
    GLSL + Optional features = OpenGL Mathematics (GLM)
    A C++ mathematics library for graphics programming


    Compute a triangle normal:
    • #include <glm/glm.hpp>
    • void computeNormal(triangle & Triangle)
    • {
    • diff --git a/doc/download.html b/doc/download.html index 440e2e85..a09a6bf9 100644 --- a/doc/download.html +++ b/doc/download.html @@ -11,11 +11,12 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      Current release
      08/05/2010: - GLM 0.9.2.0 +
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM)
      A C++ mathematics library for graphics programming


      Current release
      24/05/2010: + GLM 0.9.2.1 (3.4 MB) -
      _________________

      GLM - zip files
      08/05/2010: GLM 0.9.2.0 (3.4 MB) +
      _________________

      GLM - zip files
      24/05/2010: GLM 0.9.2.1 (3.4 MB) +
      08/05/2010: GLM 0.9.2.0 (3.4 MB)
      07/05/2010: GLM 0.9.1.3 (3.4 MB)
      12/04/2010: GLM 0.9.1.2 (3.4 MB)
      17/03/2010: GLM 0.9.1.1 (3.4 MB) @@ -73,7 +74,8 @@
      02/19/2006: GLM 0.3.0.0 (945 KB)
      05/05/2005: GLM 0.2.0.0 (194 KB)
      02/21/2005: GLM 0.1.0.0 (29.2 KB) -
      _________________

      GLM - 7z files
      08/05/2011: GLM 0.9.2.0 (2.1 MB) +
      _________________

      GLM - 7z files
      24/05/2011: GLM 0.9.2.1 (2.1 MB) +
      08/05/2011: GLM 0.9.2.0 (2.1 MB)
      07/05/2011: GLM 0.9.1.3 (2.1 MB)
      12/04/2011: GLM 0.9.1.2 (2.1 MB)
      17/03/2011: GLM 0.9.1.1 (2.1 MB) diff --git a/doc/glm-0.9.2.pdf b/doc/glm-0.9.2.pdf index cd273e98..8cd8b88e 100644 Binary files a/doc/glm-0.9.2.pdf and b/doc/glm-0.9.2.pdf differ diff --git a/doc/goodies.html b/doc/goodies.html index f2319274..91b56896 100644 --- a/doc/goodies.html +++ b/doc/goodies.html @@ -11,5 +11,5 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      16/10/2008
      GLM Logo

      Download: 2560x1600
      Download: 1920x1200
      Download: 1600x1000
      Download: 1280x0800
      Download: 1024x0640

      _________________

      16/10/2008
      GLM Font

      Download: Font (.otf)

      _________________

      _________________

      Copyright © 2005 - 2011G-Truc Creation
      \ No newline at end of file +
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM)
      A C++ mathematics library for graphics programming


      16/10/2008
      GLM Logo

      Download: 2560x1600
      Download: 1920x1200
      Download: 1600x1000
      Download: 1280x0800
      Download: 1024x0640

      _________________

      16/10/2008
      GLM Font

      Download: Font (.otf)

      _________________

      _________________

      Copyright © 2005 - 2011G-Truc Creation
      \ No newline at end of file diff --git a/doc/index.html b/doc/index.html index f05966f4..d9be58a6 100644 --- a/doc/index.html +++ b/doc/index.html @@ -11,8 +11,8 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      +
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM)
      A C++ mathematics library for graphics programming


      OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specification.

      @@ -27,12 +27,18 @@ quaternions, half-based types, random numbers, etc...

      This library works perfectly with OpenGL but it also ensures interoperability with other third party libraries and SDKs. It is a good candidate for software rendering (Raytracing / Rasterisation), image processing, physic simulations and any context that requires a simple and convenient mathematics library. -

      GLM is written as a platform independent library with no dependence and officially supports the following compilers:
      • GCC 3.4 and higher
      • LLVM 2.3 through GCC 4.2 front-end and higher
      • Visual C++ 2005 and higher
      • Any C++ compiler following C++98 norm

      +

      GLM is written as a platform independent library with no dependence and officially supports the following compilers:
      • Clang 2.0 and higher
      • CUDA 3.0 and higher +
      • GCC 3.4 and higher
      • LLVM 2.3 through GCC 4.2 front-end and higher
      • Visual C++ 2005 and higher
      • Any C++ compiler following C++98 norm

      The source code is under the MIT license.

      Thanks for contributing to the project by submitting tickets for bug reports and feature requests. (SF.net account required). Any feedback is welcome at glm@g-truc.net. -


      09/05/2011 - GLM 0.9.2.0 released

      +


      24/05/2011 - GLM 0.9.2.1 released

      + GLM 0.9.2.1 significantly improves compiler detection which allows CUDA to be automatically recognized when GLM is used inside a CUDA kernel. + By conscequence, GLM_FORCE_CUDA is no longer required to be declared. +

      + It fixed a couple of bugs, including Visual C++ supprot when Visual C++ extensions are disabled and fixed implementations of GLM_GTX_vector_angle and GLM_GTX_rotate_vector extensions. +

      Download: GLM 0.9.2.1 (zip)
      Download: GLM 0.9.2.1 (7z)
      Link: Submit a bug report

      09/05/2011 - GLM 0.9.2.0 released

      GLM 0.9.2.0 provides many exciting features which first of all is the CUDA copiler support so that GLM can be used within a CUDA kernel. This is possible only by defining GLM_FORCE_CUDA before including glm/glm.hpp in the CUDA Kernel source code.

      New experimental extensions are also available. GLM_GTX_noise is based on the work by Stefan Gustavson and Ashima Arts on WebGL-noise which adds perlin and simplex noise functions in a pure computational way. diff --git a/doc/src/data.xml b/doc/src/data.xml index 583a83d1..e0ba3945 100644 --- a/doc/src/data.xml +++ b/doc/src/data.xml @@ -3,6 +3,7 @@

      + @@ -63,11 +64,12 @@
      - + + - + @@ -150,6 +152,20 @@ + + + GLM 0.9.2.1 significantly improves compiler detection which allows CUDA to be automatically recognized when GLM is used inside a CUDA kernel. + By conscequence, GLM_FORCE_CUDA is no longer required to be declared. + + + It fixed a couple of bugs, including Visual C++ supprot when Visual C++ extensions are disabled and fixed implementations of GLM_GTX_vector_angle and GLM_GTX_rotate_vector extensions. + + + GLM 0.9.2.1 (zip) + GLM 0.9.2.1 (7z) + Submit a bug report + + GLM 0.9.2.0 provides many exciting features which first of all is the CUDA copiler support so that GLM can be used within a CUDA kernel. This is possible only by defining GLM_FORCE_CUDA before including glm/glm.hpp in the CUDA Kernel source code. @@ -1554,8 +1570,8 @@ - GLSL + Optional features = OpenGL Mathematics (GLM). - A C++ mathematics library for 3D graphics. + GLSL + Optional features = OpenGL Mathematics (GLM) + A C++ mathematics library for graphics programming diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index d41fa7f8..8f8a1c55 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -332,7 +332,7 @@ namespace detail # define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct # define GLM_RESTRICT __declspec(restrict) # define GLM_RESTRICT_VAR __restrict -#elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) +#elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGN(x) __attribute__((aligned(x))) # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index d4124369..c08a39a6 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -19,7 +19,6 @@ #define GLM_VERSION_PATCH 3 #define GLM_VERSION_REVISION 0 - /////////////////////////////////////////////////////////////////////////////////////////////////// // Compiler @@ -43,6 +42,8 @@ // GCC defines #define GLM_COMPILER_GCC 0x02000000 +#define GLM_COMPILER_GCC_LLVM 0x02000000 +#define GLM_COMPILER_GCC_CLANG 0x02000000 #define GLM_COMPILER_GCC30 0x02000010 #define GLM_COMPILER_GCC31 0x02000020 #define GLM_COMPILER_GCC32 0x02000030 @@ -145,22 +146,19 @@ # define GLM_COMPILER GLM_COMPILER_VC # endif//_MSC_VER -#elif defined(__clang__) -# if (__clang_major__ == 2) && (__clang_minor__ == 6) -# define GLM_COMPILER GLM_COMPILER_CLANG26 -# elif (__clang_major__ == 2) && (__clang_minor__ == 7) -# define GLM_COMPILER GLM_COMPILER_CLANG27 -# elif (__clang_major__ == 2) && (__clang_minor__ == 8) -# define GLM_COMPILER GLM_COMPILER_CLANG28 -# elif (__clang_major__ == 2) && (__clang_minor__ == 9) -# define GLM_COMPILER GLM_COMPILER_CLANG29 -# endif - -#elif defined(__llvm__) -# define GLM_COMPILER GLM_COMPILER_LLVM_GCC - // G++ -#elif defined(__GNUC__) +#elif defined(__GNUC__) || defined(__llvm__) || defined(__clang__) +# if defined (__llvm__) +# pragma message("LLVM") +# define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_LLVM +# elif defined (__clang__) +# pragma message("CLANG") +# define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_CLANG +# else +# pragma message("GCC") +# define GLM_COMPILER_GCC_EXTRA 0 +# endif +# # if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2) # define GLM_COMPILER GLM_COMPILER_GCC32 # elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 3) @@ -170,29 +168,29 @@ # elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 5) # define GLM_COMPILER GLM_COMPILER_GCC35 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 0) -# define GLM_COMPILER GLM_COMPILER_GCC40 +# define GLM_COMPILER (GLM_COMPILER_GCC40 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 1) -# define GLM_COMPILER GLM_COMPILER_GCC41 +# define GLM_COMPILER (GLM_COMPILER_GCC41 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 2) -# define GLM_COMPILER GLM_COMPILER_GCC42 +# define GLM_COMPILER (GLM_COMPILER_GCC42 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3) -# define GLM_COMPILER GLM_COMPILER_GCC43 +# define GLM_COMPILER (GLM_COMPILER_GCC43 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4) -# define GLM_COMPILER GLM_COMPILER_GCC44 +# define GLM_COMPILER (GLM_COMPILER_GCC44 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 5) -# define GLM_COMPILER GLM_COMPILER_GCC45 +# define GLM_COMPILER (GLM_COMPILER_GCC45 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6) -# define GLM_COMPILER GLM_COMPILER_GCC46 +# define GLM_COMPILER (GLM_COMPILER_GCC46 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 7) -# define GLM_COMPILER GLM_COMPILER_GCC47 +# define GLM_COMPILER (GLM_COMPILER_GCC47 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) -# define GLM_COMPILER GLM_COMPILER_GCC48 +# define GLM_COMPILER (GLM_COMPILER_GCC48 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 9) -# define GLM_COMPILER GLM_COMPILER_GCC49 +# define GLM_COMPILER (GLM_COMPILER_GCC49 | GLM_COMPILER_GCC_EXTRA) # elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0) -# define GLM_COMPILER GLM_COMPILER_GCC50 +# define GLM_COMPILER (GLM_COMPILER_GCC50 | GLM_COMPILER_GCC_EXTRA) # else -# define GLM_COMPILER GLM_COMPILER_GCC +# define GLM_COMPILER (GLM_COMPILER_GCC | GLM_COMPILER_GCC_EXTRA) # endif // Borland C++ @@ -233,7 +231,13 @@ # elif(GLM_COMPILER & GLM_COMPILER_LLVM_GCC) # pragma message("GLM: LLVM GCC compiler detected") # elif(GLM_COMPILER & GLM_COMPILER_GCC) -# pragma message("GLM: GCC compiler detected") +# if(GLM_COMPILER & GLM_COMPILER_GCC_LLVM) +# pragma message("GLM: LLVM GCC compiler detected") +# elif(GLM_COMPILER & GLM_COMPILER_GCC_CLANG) +# pragma message("GLM: CLANG compiler detected") +# else +# pragma message("GLM: GCC compiler detected") +# endif # elif(GLM_COMPILER & GLM_COMPILER_BC) # pragma message("GLM: Borland compiler detected but not supported") # elif(GLM_COMPILER & GLM_COMPILER_CODEWARRIOR) @@ -343,6 +347,16 @@ # else # define GLM_ARCH GLM_ARCH_PURE # endif +#elif(GLM_COMPILER & GLM_COMPILER_LLVM_GCC) +# if(defined(__AVX__)) +# define GLM_ARCH GLM_ARCH_AVX +# elif(defined(__SSE3__)) +# define GLM_ARCH GLM_ARCH_SSE3 +# elif(defined(__SSE2__)) +# define GLM_ARCH GLM_ARCH_SSE2 +# else +# define GLM_ARCH GLM_ARCH_PURE +# endif #elif((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__))) # if(defined(__AVX__)) # define GLM_ARCH GLM_ARCH_AVX diff --git a/glm/gtc/swizzle.hpp b/glm/gtc/swizzle.hpp index b3441326..bd4cfb83 100644 --- a/glm/gtc/swizzle.hpp +++ b/glm/gtc/swizzle.hpp @@ -67,278 +67,281 @@ namespace swizzle ///< GLM_GTC_swizzle extension vecType & v, comp x, comp y, comp z, comp w); -# define static_swizzle1(TYPE, SIZE) \ +# define static_swizzle1_const(TYPE, SIZE) \ template \ GLM_FUNC_QUALIFIER TYPE swizzle(detail::tvec##SIZE const & v) \ - {return v[x];} \ - \ - template \ + {return v[x];} + +# define static_swizzle1_ref(TYPE, SIZE) \ + template \ GLM_FUNC_QUALIFIER TYPE& swizzle(detail::tvec##SIZE & v) \ {return v[x];} - static_swizzle1(detail::float16, 2) - static_swizzle1(detail::float16, 3) - static_swizzle1(detail::float16, 4) - static_swizzle1(detail::float32, 2) - static_swizzle1(detail::float32, 3) - static_swizzle1(detail::float32, 4) - static_swizzle1(detail::float64, 2) - static_swizzle1(detail::float64, 3) - static_swizzle1(detail::float64, 4) + static_swizzle1_ref(detail::float16, 2) + static_swizzle1_ref(detail::float16, 3) + static_swizzle1_ref(detail::float16, 4) + static_swizzle1_ref(detail::float32, 2) + static_swizzle1_ref(detail::float32, 3) + static_swizzle1_ref(detail::float32, 4) + static_swizzle1_ref(detail::float64, 2) + static_swizzle1_ref(detail::float64, 3) + static_swizzle1_ref(detail::float64, 4) - static_swizzle1(detail::int8, 2) - static_swizzle1(detail::int8, 3) - static_swizzle1(detail::int8, 4) - static_swizzle1(detail::int16, 2) - static_swizzle1(detail::int16, 3) - static_swizzle1(detail::int16, 4) - static_swizzle1(detail::int32, 2) - static_swizzle1(detail::int32, 3) - static_swizzle1(detail::int32, 4) - static_swizzle1(detail::int64, 2) - static_swizzle1(detail::int64, 3) - static_swizzle1(detail::int64, 4) + static_swizzle1_ref(detail::int8, 2) + static_swizzle1_ref(detail::int8, 3) + static_swizzle1_ref(detail::int8, 4) + static_swizzle1_ref(detail::int16, 2) + static_swizzle1_ref(detail::int16, 3) + static_swizzle1_ref(detail::int16, 4) + static_swizzle1_ref(detail::int32, 2) + static_swizzle1_ref(detail::int32, 3) + static_swizzle1_ref(detail::int32, 4) + static_swizzle1_ref(detail::int64, 2) + static_swizzle1_ref(detail::int64, 3) + static_swizzle1_ref(detail::int64, 4) - static_swizzle1(detail::uint8, 2) - static_swizzle1(detail::uint8, 3) - static_swizzle1(detail::uint8, 4) - static_swizzle1(detail::uint16, 2) - static_swizzle1(detail::uint16, 3) - static_swizzle1(detail::uint16, 4) - static_swizzle1(detail::uint32, 2) - static_swizzle1(detail::uint32, 3) - static_swizzle1(detail::uint32, 4) - static_swizzle1(detail::uint64, 2) - static_swizzle1(detail::uint64, 3) - static_swizzle1(detail::uint64, 4) - -# define static_swizzle2_const(TYPE) \ + static_swizzle1_ref(detail::uint8, 2) + static_swizzle1_ref(detail::uint8, 3) + static_swizzle1_ref(detail::uint8, 4) + static_swizzle1_ref(detail::uint16, 2) + static_swizzle1_ref(detail::uint16, 3) + static_swizzle1_ref(detail::uint16, 4) + static_swizzle1_ref(detail::uint32, 2) + static_swizzle1_ref(detail::uint32, 3) + static_swizzle1_ref(detail::uint32, 4) + static_swizzle1_ref(detail::uint64, 2) + static_swizzle1_ref(detail::uint64, 3) + static_swizzle1_ref(detail::uint64, 4) +/* +# define static_swizzle2_const(TYPE) \ template \ GLM_FUNC_QUALIFIER TYPE swizzle(TYPE const & v) \ {return TYPE(v[x], v[y]);} -# define static_swizzle3_const(TYPE) \ +# define static_swizzle3_const(TYPE) \ template \ GLM_FUNC_QUALIFIER TYPE swizzle(TYPE const & v) \ {return TYPE(v[x], v[y], v[z]);} -# define static_swizzle4_const(TYPE) \ +# define static_swizzle4_const(TYPE) \ template \ GLM_FUNC_QUALIFIER TYPE swizzle(TYPE const & v) \ {return TYPE(v[x], v[y], v[z], v[w]);} -/* -# define static_swizzle2_const(TYPE, SIZE) \ +*/ + +# define static_swizzle2_const(TYPE, SIZE) \ template \ GLM_FUNC_QUALIFIER detail::tvec2 swizzle(detail::tvec##SIZE const & v) \ {return detail::tvec2(v[x], v[y]);} -# define static_swizzle3_const(TYPE, SIZE) \ +# define static_swizzle3_const(TYPE, SIZE) \ template \ GLM_FUNC_QUALIFIER detail::tvec3 swizzle(detail::tvec##SIZE const & v) \ {return detail::tvec3(v[x], v[y], v[z]);} -# define static_swizzle4_const(TYPE, SIZE) \ +# define static_swizzle4_const(TYPE, SIZE) \ template \ GLM_FUNC_QUALIFIER detail::tvec4 swizzle(detail::tvec##SIZE const & v) \ {return detail::tvec4(v[x], v[y], v[z], v[w]);} -*/ - static_swizzle2_const(glm::f16vec2) - static_swizzle2_const(glm::f16vec3) - static_swizzle2_const(glm::f16vec4) - static_swizzle2_const(glm::f32vec2) - static_swizzle2_const(glm::f32vec3) - static_swizzle2_const(glm::f32vec4) - static_swizzle2_const(glm::f64vec2) - static_swizzle2_const(glm::f64vec3) - static_swizzle2_const(glm::f64vec4) - static_swizzle2_const(glm::i8vec2) - static_swizzle2_const(glm::i8vec3) - static_swizzle2_const(glm::i8vec4) - static_swizzle2_const(glm::i16vec2) - static_swizzle2_const(glm::i16vec3) - static_swizzle2_const(glm::i16vec4) - static_swizzle2_const(glm::i32vec2) - static_swizzle2_const(glm::i32vec3) - static_swizzle2_const(glm::i32vec4) - static_swizzle2_const(glm::i64vec2) - static_swizzle2_const(glm::i64vec3) - static_swizzle2_const(glm::i64vec4) - static_swizzle2_const(glm::u8vec2) - static_swizzle2_const(glm::u8vec3) - static_swizzle2_const(glm::u8vec4) - static_swizzle2_const(glm::u16vec2) - static_swizzle2_const(glm::u16vec3) - static_swizzle2_const(glm::u16vec4) - static_swizzle2_const(glm::u32vec2) - static_swizzle2_const(glm::u32vec3) - static_swizzle2_const(glm::u32vec4) - static_swizzle2_const(glm::u64vec2) - static_swizzle2_const(glm::u64vec3) - static_swizzle2_const(glm::u64vec4) + static_swizzle2_const(glm::f16, 2) + static_swizzle2_const(glm::f16, 3) + static_swizzle2_const(glm::f16, 4) + static_swizzle2_const(glm::f32, 2) + static_swizzle2_const(glm::f32, 3) + static_swizzle2_const(glm::f32, 4) + static_swizzle2_const(glm::f64, 2) + static_swizzle2_const(glm::f64, 3) + static_swizzle2_const(glm::f64, 4) - static_swizzle3_const(glm::f16vec2) - static_swizzle3_const(glm::f16vec3) - static_swizzle3_const(glm::f16vec4) - static_swizzle3_const(glm::f32vec2) - static_swizzle3_const(glm::f32vec3) - static_swizzle3_const(glm::f32vec4) - static_swizzle3_const(glm::f64vec2) - static_swizzle3_const(glm::f64vec3) - static_swizzle3_const(glm::f64vec4) + static_swizzle2_const(glm::i8, 2) + static_swizzle2_const(glm::i8, 3) + static_swizzle2_const(glm::i8, 4) + static_swizzle2_const(glm::i16, 2) + static_swizzle2_const(glm::i16, 3) + static_swizzle2_const(glm::i16, 4) + static_swizzle2_const(glm::i32, 2) + static_swizzle2_const(glm::i32, 3) + static_swizzle2_const(glm::i32, 4) + static_swizzle2_const(glm::i64, 2) + static_swizzle2_const(glm::i64, 3) + static_swizzle2_const(glm::i64, 4) - static_swizzle3_const(glm::i8vec2) - static_swizzle3_const(glm::i8vec3) - static_swizzle3_const(glm::i8vec4) - static_swizzle3_const(glm::i16vec2) - static_swizzle3_const(glm::i16vec3) - static_swizzle3_const(glm::i16vec4) - static_swizzle3_const(glm::i32vec2) - static_swizzle3_const(glm::i32vec3) - static_swizzle3_const(glm::i32vec4) - static_swizzle3_const(glm::i64vec2) - static_swizzle3_const(glm::i64vec3) - static_swizzle3_const(glm::i64vec4) + static_swizzle2_const(glm::u8, 2) + static_swizzle2_const(glm::u8, 3) + static_swizzle2_const(glm::u8, 4) + static_swizzle2_const(glm::u16, 2) + static_swizzle2_const(glm::u16, 3) + static_swizzle2_const(glm::u16, 4) + static_swizzle2_const(glm::u32, 2) + static_swizzle2_const(glm::u32, 3) + static_swizzle2_const(glm::u32, 4) + static_swizzle2_const(glm::u64, 2) + static_swizzle2_const(glm::u64, 3) + static_swizzle2_const(glm::u64, 4) - static_swizzle3_const(glm::u8vec2) - static_swizzle3_const(glm::u8vec3) - static_swizzle3_const(glm::u8vec4) - static_swizzle3_const(glm::u16vec2) - static_swizzle3_const(glm::u16vec3) - static_swizzle3_const(glm::u16vec4) - static_swizzle3_const(glm::u32vec2) - static_swizzle3_const(glm::u32vec3) - static_swizzle3_const(glm::u32vec4) - static_swizzle3_const(glm::u64vec2) - static_swizzle3_const(glm::u64vec3) - static_swizzle3_const(glm::u64vec4) + static_swizzle3_const(glm::f16, 2) + static_swizzle3_const(glm::f16, 3) + static_swizzle3_const(glm::f16, 4) + static_swizzle3_const(glm::f32, 2) + static_swizzle3_const(glm::f32, 3) + static_swizzle3_const(glm::f32, 4) + static_swizzle3_const(glm::f64, 2) + static_swizzle3_const(glm::f64, 3) + static_swizzle3_const(glm::f64, 4) - static_swizzle4_const(glm::f16vec2) - static_swizzle4_const(glm::f16vec3) - static_swizzle4_const(glm::f16vec4) - static_swizzle4_const(glm::f32vec2) - static_swizzle4_const(glm::f32vec3) - static_swizzle4_const(glm::f32vec4) - static_swizzle4_const(glm::f64vec2) - static_swizzle4_const(glm::f64vec3) - static_swizzle4_const(glm::f64vec4) + static_swizzle3_const(glm::i8, 2) + static_swizzle3_const(glm::i8, 3) + static_swizzle3_const(glm::i8, 4) + static_swizzle3_const(glm::i16, 2) + static_swizzle3_const(glm::i16, 3) + static_swizzle3_const(glm::i16, 4) + static_swizzle3_const(glm::i32, 2) + static_swizzle3_const(glm::i32, 3) + static_swizzle3_const(glm::i32, 4) + static_swizzle3_const(glm::i64, 2) + static_swizzle3_const(glm::i64, 3) + static_swizzle3_const(glm::i64, 4) - static_swizzle4_const(glm::i8vec2) - static_swizzle4_const(glm::i8vec3) - static_swizzle4_const(glm::i8vec4) - static_swizzle4_const(glm::i16vec2) - static_swizzle4_const(glm::i16vec3) - static_swizzle4_const(glm::i16vec4) - static_swizzle4_const(glm::i32vec2) - static_swizzle4_const(glm::i32vec3) - static_swizzle4_const(glm::i32vec4) - static_swizzle4_const(glm::i64vec2) - static_swizzle4_const(glm::i64vec3) - static_swizzle4_const(glm::i64vec4) + static_swizzle3_const(glm::u8, 2) + static_swizzle3_const(glm::u8, 3) + static_swizzle3_const(glm::u8, 4) + static_swizzle3_const(glm::u16, 2) + static_swizzle3_const(glm::u16, 3) + static_swizzle3_const(glm::u16, 4) + static_swizzle3_const(glm::u32, 2) + static_swizzle3_const(glm::u32, 3) + static_swizzle3_const(glm::u32, 4) + static_swizzle3_const(glm::u64, 2) + static_swizzle3_const(glm::u64, 3) + static_swizzle3_const(glm::u64, 4) - static_swizzle4_const(glm::u8vec2) - static_swizzle4_const(glm::u8vec3) - static_swizzle4_const(glm::u8vec4) - static_swizzle4_const(glm::u16vec2) - static_swizzle4_const(glm::u16vec3) - static_swizzle4_const(glm::u16vec4) - static_swizzle4_const(glm::u32vec2) - static_swizzle4_const(glm::u32vec3) - static_swizzle4_const(glm::u32vec4) - static_swizzle4_const(glm::u64vec2) - static_swizzle4_const(glm::u64vec3) - static_swizzle4_const(glm::u64vec4) + static_swizzle4_const(glm::f16, 2) + static_swizzle4_const(glm::f16, 3) + static_swizzle4_const(glm::f16, 4) + static_swizzle4_const(glm::f32, 2) + static_swizzle4_const(glm::f32, 3) + static_swizzle4_const(glm::f32, 4) + static_swizzle4_const(glm::f64, 2) + static_swizzle4_const(glm::f64, 3) + static_swizzle4_const(glm::f64, 4) -# define static_swizzle2_ref(TYPE) \ + static_swizzle4_const(glm::i8, 2) + static_swizzle4_const(glm::i8, 3) + static_swizzle4_const(glm::i8, 4) + static_swizzle4_const(glm::i16, 2) + static_swizzle4_const(glm::i16, 3) + static_swizzle4_const(glm::i16, 4) + static_swizzle4_const(glm::i32, 2) + static_swizzle4_const(glm::i32, 3) + static_swizzle4_const(glm::i32, 4) + static_swizzle4_const(glm::i64, 2) + static_swizzle4_const(glm::i64, 3) + static_swizzle4_const(glm::i64, 4) + + static_swizzle4_const(glm::u8, 2) + static_swizzle4_const(glm::u8, 3) + static_swizzle4_const(glm::u8, 4) + static_swizzle4_const(glm::u16, 2) + static_swizzle4_const(glm::u16, 3) + static_swizzle4_const(glm::u16, 4) + static_swizzle4_const(glm::u32, 2) + static_swizzle4_const(glm::u32, 3) + static_swizzle4_const(glm::u32, 4) + static_swizzle4_const(glm::u64, 2) + static_swizzle4_const(glm::u64, 3) + static_swizzle4_const(glm::u64, 4) + +# define static_swizzle2_ref(TYPE, SIZE) \ template \ - GLM_FUNC_QUALIFIER glm::detail::tref2 swizzle(TYPE & v) \ - {return glm::detail::tref2(v[x], v[y]);} + GLM_FUNC_QUALIFIER glm::detail::tref2 swizzle(detail::tvec##SIZE & v) \ + {return glm::detail::tref2(v[x], v[y]);} -# define static_swizzle3_ref(TYPE) \ +# define static_swizzle3_ref(TYPE, SIZE) \ template \ - GLM_FUNC_QUALIFIER glm::detail::tref3 swizzle(TYPE & v) \ - {return glm::detail::tref3(v[x], v[y], v[z]);} + GLM_FUNC_QUALIFIER glm::detail::tref3 swizzle(detail::tvec##SIZE & v) \ + {return glm::detail::tref3(v[x], v[y], v[z]);} -# define static_swizzle4_ref(TYPE) \ +# define static_swizzle4_ref(TYPE, SIZE) \ template \ - GLM_FUNC_QUALIFIER glm::detail::tref4 swizzle(TYPE & v) \ - {return glm::detail::tref4(v[x], v[y], v[z], v[w]);} + GLM_FUNC_QUALIFIER glm::detail::tref4 swizzle(detail::tvec##SIZE & v) \ + {return glm::detail::tref4(v[x], v[y], v[z], v[w]);} - static_swizzle2_ref(glm::f16vec2) - static_swizzle2_ref(glm::f16vec3) - static_swizzle2_ref(glm::f16vec4) - static_swizzle2_ref(glm::f32vec2) - static_swizzle2_ref(glm::f32vec3) - static_swizzle2_ref(glm::f32vec4) - static_swizzle2_ref(glm::f64vec2) - static_swizzle2_ref(glm::f64vec3) - static_swizzle2_ref(glm::f64vec4) + static_swizzle2_ref(glm::f16, 2) + static_swizzle2_ref(glm::f16, 3) + static_swizzle2_ref(glm::f16, 4) + static_swizzle2_ref(glm::f32, 2) + static_swizzle2_ref(glm::f32, 3) + static_swizzle2_ref(glm::f32, 4) + static_swizzle2_ref(glm::f64, 2) + static_swizzle2_ref(glm::f64, 3) + static_swizzle2_ref(glm::f64, 4) - static_swizzle2_ref(glm::i8vec2) - static_swizzle2_ref(glm::i8vec3) - static_swizzle2_ref(glm::i8vec4) - static_swizzle2_ref(glm::i16vec2) - static_swizzle2_ref(glm::i16vec3) - static_swizzle2_ref(glm::i16vec4) - static_swizzle2_ref(glm::i32vec2) - static_swizzle2_ref(glm::i32vec3) - static_swizzle2_ref(glm::i32vec4) - static_swizzle2_ref(glm::i64vec2) - static_swizzle2_ref(glm::i64vec3) - static_swizzle2_ref(glm::i64vec4) + static_swizzle2_ref(glm::i8, 2) + static_swizzle2_ref(glm::i8, 3) + static_swizzle2_ref(glm::i8, 4) + static_swizzle2_ref(glm::i16, 2) + static_swizzle2_ref(glm::i16, 3) + static_swizzle2_ref(glm::i16, 4) + static_swizzle2_ref(glm::i32, 2) + static_swizzle2_ref(glm::i32, 3) + static_swizzle2_ref(glm::i32, 4) + static_swizzle2_ref(glm::i64, 2) + static_swizzle2_ref(glm::i64, 3) + static_swizzle2_ref(glm::i64, 4) - static_swizzle2_ref(glm::u8vec2) - static_swizzle2_ref(glm::u8vec3) - static_swizzle2_ref(glm::u8vec4) - static_swizzle2_ref(glm::u16vec2) - static_swizzle2_ref(glm::u16vec3) - static_swizzle2_ref(glm::u16vec4) - static_swizzle2_ref(glm::u32vec2) - static_swizzle2_ref(glm::u32vec3) - static_swizzle2_ref(glm::u32vec4) - static_swizzle2_ref(glm::u64vec2) - static_swizzle2_ref(glm::u64vec3) - static_swizzle2_ref(glm::u64vec4) + static_swizzle2_ref(glm::u8, 2) + static_swizzle2_ref(glm::u8, 3) + static_swizzle2_ref(glm::u8, 4) + static_swizzle2_ref(glm::u16, 2) + static_swizzle2_ref(glm::u16, 3) + static_swizzle2_ref(glm::u16, 4) + static_swizzle2_ref(glm::u32, 2) + static_swizzle2_ref(glm::u32, 3) + static_swizzle2_ref(glm::u32, 4) + static_swizzle2_ref(glm::u64, 2) + static_swizzle2_ref(glm::u64, 3) + static_swizzle2_ref(glm::u64, 4) - static_swizzle3_ref(glm::f16vec3) - static_swizzle3_ref(glm::f16vec4) - static_swizzle3_ref(glm::f32vec3) - static_swizzle3_ref(glm::f32vec4) - static_swizzle3_ref(glm::f64vec3) - static_swizzle3_ref(glm::f64vec4) + static_swizzle3_ref(glm::f16, 3) + static_swizzle3_ref(glm::f16, 4) + static_swizzle3_ref(glm::f32, 3) + static_swizzle3_ref(glm::f32, 4) + static_swizzle3_ref(glm::f64, 3) + static_swizzle3_ref(glm::f64, 4) - static_swizzle3_ref(glm::i8vec3) - static_swizzle3_ref(glm::i8vec4) - static_swizzle3_ref(glm::i16vec3) - static_swizzle3_ref(glm::i16vec4) - static_swizzle3_ref(glm::i32vec3) - static_swizzle3_ref(glm::i32vec4) - static_swizzle3_ref(glm::i64vec3) - static_swizzle3_ref(glm::i64vec4) + static_swizzle3_ref(glm::i8, 3) + static_swizzle3_ref(glm::i8, 4) + static_swizzle3_ref(glm::i16, 3) + static_swizzle3_ref(glm::i16, 4) + static_swizzle3_ref(glm::i32, 3) + static_swizzle3_ref(glm::i32, 4) + static_swizzle3_ref(glm::i64, 3) + static_swizzle3_ref(glm::i64, 4) - static_swizzle3_ref(glm::u8vec3) - static_swizzle3_ref(glm::u8vec4) - static_swizzle3_ref(glm::u16vec3) - static_swizzle3_ref(glm::u16vec4) - static_swizzle3_ref(glm::u32vec3) - static_swizzle3_ref(glm::u32vec4) - static_swizzle3_ref(glm::u64vec3) - static_swizzle3_ref(glm::u64vec4) + static_swizzle3_ref(glm::u8, 3) + static_swizzle3_ref(glm::u8, 4) + static_swizzle3_ref(glm::u16, 3) + static_swizzle3_ref(glm::u16, 4) + static_swizzle3_ref(glm::u32, 3) + static_swizzle3_ref(glm::u32, 4) + static_swizzle3_ref(glm::u64, 3) + static_swizzle3_ref(glm::u64, 4) - static_swizzle4_ref(glm::f16vec4) - static_swizzle4_ref(glm::f32vec4) - static_swizzle4_ref(glm::f64vec4) + static_swizzle4_ref(glm::f16, 4) + static_swizzle4_ref(glm::f32, 4) + static_swizzle4_ref(glm::f64, 4) - static_swizzle4_ref(glm::i8vec4) - static_swizzle4_ref(glm::i16vec4) - static_swizzle4_ref(glm::i32vec4) - static_swizzle4_ref(glm::i64vec4) + static_swizzle4_ref(glm::i8, 4) + static_swizzle4_ref(glm::i16, 4) + static_swizzle4_ref(glm::i32, 4) + static_swizzle4_ref(glm::i64, 4) - static_swizzle4_ref(glm::u8vec4) - static_swizzle4_ref(glm::u16vec4) - static_swizzle4_ref(glm::u32vec4) - static_swizzle4_ref(glm::u64vec4) + static_swizzle4_ref(glm::u8, 4) + static_swizzle4_ref(glm::u16, 4) + static_swizzle4_ref(glm::u32, 4) + static_swizzle4_ref(glm::u64, 4) }//namespace swizzle }//namespace gtc diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp index 3384e9e1..05fb99ec 100644 --- a/glm/gtx/simd_vec4.hpp +++ b/glm/gtx/simd_vec4.hpp @@ -33,7 +33,7 @@ namespace detail { /// 4-dimensional vector implemented using SIMD SEE intrinsics. /// \ingroup gtx_simd_vec4 - GLM_ALIGNED_STRUCT(4) fvec4SIMD + GLM_ALIGNED_STRUCT(16) fvec4SIMD { enum ctor{null}; typedef __m128 value_type; @@ -114,7 +114,7 @@ namespace detail namespace gtx{ namespace simd_vec4 ///< GLM_GTX_simd_vec4 extension: SIMD implementation of vec4 type. { - typedef detail::fvec4SIMD simdVec4; + typedef glm::detail::fvec4SIMD simdVec4; /// \addtogroup gtx_simd_vec4 ///@{ diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl index b6fb0fd8..d7b1863a 100644 --- a/glm/gtx/simd_vec4.inl +++ b/glm/gtx/simd_vec4.inl @@ -314,6 +314,8 @@ namespace glm detail::fvec4SIMD const & x ) { + //return x < 0 ? -floor(-x) : floor(x); + __m128 Flr0 = detail::sse_flr_ps(_mm_sub_ps(_mm_setzero_ps(), x.Data)); __m128 Sub0 = _mm_sub_ps(Flr0, x.Data); __m128 Flr1 = detail::sse_flr_ps(x.Data); @@ -321,7 +323,7 @@ namespace glm __m128 Cmp0 = _mm_cmplt_ps(x.Data, glm::detail::zero); __m128 Cmp1 = _mm_cmpnlt_ps(x.Data, glm::detail::zero); - __m128 And0 = _mm_and_ps(Flr0, Cmp0); + __m128 And0 = _mm_and_ps(Sub0, Cmp0); __m128 And1 = _mm_and_ps(Flr1, Cmp1); return _mm_or_ps(And0, And1); diff --git a/readme.txt b/readme.txt index 9c703b8f..50157d1a 100644 --- a/readme.txt +++ b/readme.txt @@ -4,6 +4,29 @@ G-Truc Creation www.g-truc.net glm@g-truc.net +================================================================================ +The MIT License +-------------------------------------------------------------------------------- +Copyright (c) 2005 - 2011 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 +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. + +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. + ================================================================================ GLM Usage -------------------------------------------------------------------------------- @@ -14,10 +37,10 @@ More informations in GLM manual: http://glm.g-truc.net/glm-0.9.2.pdf ================================================================================ -GLM 0.9.2.1: 2010-05-20 +GLM 0.9.2.1: 2010-05-24 -------------------------------------------------------------------------------- - Automatically detect CUDA support -- Improved Clang detection +- Improved compiler detection - Fixed errors and warnings in VC with C++ extensions disabled - Fixed and tested GLM_GTX_vector_angle - Fixed and tested GLM_GTX_rotate_vector