From bf11a54bc8ad08329b3ed9817086c2d7746f0dd5 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 26 May 2011 22:39:08 +0100 Subject: [PATCH] Fixed half based types, missing non square matrices types --- glm/gtc/half_float.hpp | 47 ++++++++++++++++++++++++++++++++++++++---- glm/gtc/half_float.inl | 15 ++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/glm/gtc/half_float.hpp b/glm/gtc/half_float.hpp index 84f34a46..e7476529 100644 --- a/glm/gtc/half_float.hpp +++ b/glm/gtc/half_float.hpp @@ -27,7 +27,8 @@ namespace detail enum ctor{null}; typedef thalf value_type; typedef std::size_t size_type; - static size_type value_size(); + GLM_FUNC_DECL size_type length() const; + static GLM_FUNC_DECL size_type value_size(); typedef tvec2 type; typedef tvec2 bool_type; @@ -119,7 +120,8 @@ namespace detail enum ctor{null}; typedef thalf value_type; typedef std::size_t size_type; - static size_type value_size(); + GLM_FUNC_DECL size_type length() const; + static GLM_FUNC_DECL size_type value_size(); typedef tvec3 type; typedef tvec3 bool_type; @@ -215,7 +217,8 @@ namespace detail enum ctor{null}; typedef thalf value_type; typedef std::size_t size_type; - static size_type value_size(); + GLM_FUNC_DECL size_type length() const; + static GLM_FUNC_DECL size_type value_size(); typedef tvec4 type; typedef tvec4 bool_type; @@ -343,7 +346,7 @@ namespace half_float ///< GLM_GTC_half_float extension: Add support for half pre /// 2 * 2 matrix of half-precision floating-point numbers. /// From GLM_GTC_half_float extension. typedef detail::tmat2x2 hmat2; - + /// 3 * 3 matrix of half-precision floating-point numbers. /// From GLM_GTC_half_float extension. typedef detail::tmat3x3 hmat3; @@ -352,6 +355,42 @@ namespace half_float ///< GLM_GTC_half_float extension: Add support for half pre /// From GLM_GTC_half_float extension. typedef detail::tmat4x4 hmat4; + /// 2 * 2 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat2x2 hmat2x2; + + /// 2 * 3 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat2x3 hmat2x3; + + /// 2 * 4 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat2x4 hmat2x4; + + /// 3 * 2 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat3x2 hmat3x2; + + /// 3 * 3 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat3x3 hmat3x3; + + /// 3 * 4 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat3x4 hmat3x4; + + /// 4 * 2 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat4x2 hmat4x2; + + /// 4 * 3 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat4x3 hmat4x3; + + /// 4 * 4 matrix of half-precision floating-point numbers. + /// From GLM_GTC_half_float extension. + typedef detail::tmat4x4 hmat4x4; + /// @} }// namespace half_float diff --git a/glm/gtc/half_float.inl b/glm/gtc/half_float.inl index b3c36a99..68cd91a7 100644 --- a/glm/gtc/half_float.inl +++ b/glm/gtc/half_float.inl @@ -15,6 +15,11 @@ namespace detail{ ////////////////////////////////////// // hvec2 +GLM_FUNC_QUALIFIER tvec2::size_type tvec2::length() const +{ + return 2; +} + GLM_FUNC_QUALIFIER tvec2::size_type tvec2::value_size() { return 2; @@ -283,6 +288,11 @@ GLM_FUNC_QUALIFIER tref2 tvec2::swizzle(comp x, comp y) ////////////////////////////////////// // hvec3 +GLM_FUNC_QUALIFIER tvec3::size_type tvec3::length() const +{ + return 3; +} + GLM_FUNC_QUALIFIER tvec3::size_type tvec3::value_size() { return 3; @@ -595,6 +605,11 @@ GLM_FUNC_QUALIFIER tref3 tvec3::swizzle(comp x, comp y, comp z) ////////////////////////////////////// // hvec4 +GLM_FUNC_QUALIFIER tvec4::size_type tvec4::length() const +{ + return 4; +} + GLM_FUNC_QUALIFIER tvec4::size_type tvec4::value_size() { return 4;