From ecc167d0f2be10663be85ebbdebff9e5eda4fce8 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 8 May 2011 01:36:13 +0100 Subject: [PATCH] Added length member function --- glm/core/type_vec1.hpp | 1 + glm/core/type_vec1.inl | 6 ++++++ glm/core/type_vec2.hpp | 1 + glm/core/type_vec2.inl | 6 ++++++ glm/core/type_vec3.hpp | 1 + glm/core/type_vec3.inl | 6 ++++++ glm/core/type_vec4.hpp | 1 + glm/core/type_vec4.inl | 6 ++++++ 8 files changed, 28 insertions(+) diff --git a/glm/core/type_vec1.hpp b/glm/core/type_vec1.hpp index 5dcbca88..ffd8da1c 100644 --- a/glm/core/type_vec1.hpp +++ b/glm/core/type_vec1.hpp @@ -41,6 +41,7 @@ namespace glm typedef T value_type; typedef std::size_t size_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type value_size(); typedef tvec1 type; diff --git a/glm/core/type_vec1.inl b/glm/core/type_vec1.inl index 5fba5b80..df0d1ada 100644 --- a/glm/core/type_vec1.inl +++ b/glm/core/type_vec1.inl @@ -11,6 +11,12 @@ namespace glm { namespace detail { + template + GLM_FUNC_QUALIFIER typename tvec1::size_type tvec1::length() const + { + return 1; + } + template GLM_FUNC_QUALIFIER typename tvec1::size_type tvec1::value_size() { diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 47e384de..29d641ce 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -41,6 +41,7 @@ namespace glm typedef T value_type; typedef std::size_t size_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type value_size(); typedef tvec2 type; diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl index 03e038b9..b9fc67cb 100644 --- a/glm/core/type_vec2.inl +++ b/glm/core/type_vec2.inl @@ -11,6 +11,12 @@ namespace glm { namespace detail { + template + GLM_FUNC_QUALIFIER typename tvec2::size_type tvec2::length() const + { + return 2; + } + template GLM_FUNC_QUALIFIER typename tvec2::size_type tvec2::value_size() { diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 7ea1cbfa..1e06a783 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -40,6 +40,7 @@ namespace glm typedef T value_type; typedef std::size_t size_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type value_size(); typedef tvec3 type; diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl index d9795d6c..f7e9bfb5 100644 --- a/glm/core/type_vec3.inl +++ b/glm/core/type_vec3.inl @@ -11,6 +11,12 @@ namespace glm { namespace detail { + template + GLM_FUNC_QUALIFIER typename tvec3::size_type tvec3::length() const + { + return 3; + } + template GLM_FUNC_QUALIFIER typename tvec3::size_type tvec3::value_size() { diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 25135de4..354cd5b7 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -40,6 +40,7 @@ namespace glm typedef T value_type; typedef std::size_t size_type; + GLM_FUNC_DECL size_type length() const; static GLM_FUNC_DECL size_type value_size(); typedef tvec4 type; diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl index e4c28f16..52e16d8a 100644 --- a/glm/core/type_vec4.inl +++ b/glm/core/type_vec4.inl @@ -11,6 +11,12 @@ namespace glm { namespace detail { + template + GLM_FUNC_QUALIFIER typename tvec4::size_type tvec4::length() const + { + return 4; + } + template GLM_FUNC_QUALIFIER typename tvec4::size_type tvec4::value_size() {