From 22a7f6d1f1c54979d1b4f9ab9794c49d3198eb3d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 2 Jul 2010 16:19:26 +0100 Subject: [PATCH 1/2] Fixed swizzle extension --- glm/gtc/swizzle.hpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/glm/gtc/swizzle.hpp b/glm/gtc/swizzle.hpp index eb354080..e71210eb 100644 --- a/glm/gtc/swizzle.hpp +++ b/glm/gtc/swizzle.hpp @@ -11,7 +11,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtc_swizzle -#define glm_gtc_closest_point +#define glm_gtc_swizzle // Dependency: #include "../glm.hpp" @@ -26,7 +26,25 @@ namespace glm //! GLM_GTC_swizzle extension namespace swizzle{ + template + T swizzle( + detail::tvec4 const & v, + comp x); + template + detail::tvec2 swizzle( + detail::tvec4 const & v, + comp x, comp y); + + template + detail::tvec3 swizzle( + detail::tvec4 const & v, + comp x, comp y, comp z); + + template + inline detail::tref4 swizzle( + detail::tvec4 const & v, + comp x, comp y, comp z, comp w); }//namespace swizzle }//namespace gtc From ea61e975e4208cbb85344ed1d257a8af70a7e183 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 6 Jul 2010 14:02:25 +0100 Subject: [PATCH 2/2] Fixed ticket #24 --- glm/core/type_mat2x2.inl | 4 ++-- glm/core/type_mat2x3.inl | 4 ++-- glm/core/type_mat2x4.inl | 4 ++-- glm/core/type_mat3x2.inl | 4 ++-- glm/core/type_mat3x3.inl | 4 ++-- glm/core/type_mat3x4.inl | 4 ++-- glm/core/type_mat4x2.inl | 4 ++-- glm/core/type_mat4x3.inl | 4 ++-- glm/core/type_mat4x4.inl | 4 ++-- glm/core/type_vec1.inl | 4 ++-- glm/core/type_vec2.inl | 4 ++-- glm/core/type_vec3.inl | 4 ++-- glm/core/type_vec4.inl | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl index f2d9c2b5..1228478f 100644 --- a/glm/core/type_mat2x2.inl +++ b/glm/core/type_mat2x2.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl index 16cd1eaf..94f43905 100644 --- a/glm/core/type_mat2x3.inl +++ b/glm/core/type_mat2x3.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl index 2ae0b06f..9da29a7f 100644 --- a/glm/core/type_mat2x4.inl +++ b/glm/core/type_mat2x4.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl index cbdc2821..24def0b2 100644 --- a/glm/core/type_mat3x2.inl +++ b/glm/core/type_mat3x2.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl index 5ca1b2ed..58737054 100644 --- a/glm/core/type_mat3x3.inl +++ b/glm/core/type_mat3x3.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl index 03963500..5bb9158f 100644 --- a/glm/core/type_mat3x4.inl +++ b/glm/core/type_mat3x4.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl index c7107436..48117f28 100644 --- a/glm/core/type_mat4x2.inl +++ b/glm/core/type_mat4x2.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl index f9324e7c..0ba1f17c 100644 --- a/glm/core/type_mat4x3.inl +++ b/glm/core/type_mat4x3.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl index f96f782c..0152e4b4 100644 --- a/glm/core/type_mat4x4.inl +++ b/glm/core/type_mat4x4.inl @@ -32,7 +32,7 @@ namespace detail size_type i ) { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } @@ -43,7 +43,7 @@ namespace detail size_type i ) const { - assert(i >= size_type(0) && i < col_size()); + assert(i < col_size()); return this->value[i]; } diff --git a/glm/core/type_vec1.inl b/glm/core/type_vec1.inl index 8b27c3e8..47c586a2 100644 --- a/glm/core/type_vec1.inl +++ b/glm/core/type_vec1.inl @@ -26,7 +26,7 @@ namespace glm size_type i ) { - assert(i >= size_type(0) && i < value_size()); + assert(i < value_size()); return (&x)[i]; } @@ -36,7 +36,7 @@ namespace glm size_type i ) const { - assert(i >= size_type(0) && i < value_size()); + assert(i < value_size()); return (&x)[i]; } diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index 4bd5a69b..4620b687 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -27,7 +27,7 @@ namespace glm size_type i ) { - assert(i >= size_type(0) && i < value_size()); + assert(i < value_size()); return (&x)[i]; } @@ -38,7 +38,7 @@ namespace glm size_type i ) const { - assert(i >= size_type(0) && i < value_size()); + assert(i < value_size()); return (&x)[i]; } diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl index e652fa28..d2b1ae29 100644 --- a/glm/core/type_vec3.inl +++ b/glm/core/type_vec3.inl @@ -27,7 +27,7 @@ namespace glm size_type i ) { - assert(i >= size_type(0) && i < value_size()); + assert(i < value_size()); return (&x)[i]; } @@ -38,7 +38,7 @@ namespace glm size_type i ) const { - assert(i >= size_type(0) && i < value_size()); + assert(i < value_size()); return (&x)[i]; } diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index 1bcf20ca..cb2ff4cc 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -27,7 +27,7 @@ namespace glm size_type i ) { - assert(i >= size_type(0) && i < value_size()); + assert(i < value_size()); return (&x)[i]; } @@ -38,7 +38,7 @@ namespace glm size_type i ) const { - assert(i >= size_type(0) && i < value_size()); + assert(i < value_size()); return (&x)[i]; }