From ebba087843af60c134be0ab10f46f3ff526c5403 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 2 Jun 2011 13:06:24 +0100 Subject: [PATCH] typos --- glm/core/func_geometric.hpp | 7 +- glm/core/func_integer.hpp | 4 - glm/core/func_matrix.hpp | 4 - glm/core/func_noise.hpp | 4 - glm/core/func_packing.hpp | 4 - glm/core/func_trigonometric.hpp | 4 - glm/core/func_vector_relational.hpp | 4 - glm/core/type_half.hpp | 95 +++--- glm/core/type_int.hpp | 117 ++++--- glm/core/type_mat2x2.hpp | 449 +++++++++++++------------ glm/core/type_mat2x3.hpp | 361 ++++++++++----------- glm/core/type_mat2x4.hpp | 359 ++++++++++---------- glm/core/type_mat3x2.hpp | 371 +++++++++++---------- glm/core/type_mat3x3.hpp | 456 +++++++++++++------------- glm/core/type_mat3x4.hpp | 370 +++++++++++---------- glm/core/type_mat4x2.hpp | 386 +++++++++++----------- glm/core/type_mat4x3.hpp | 384 +++++++++++----------- glm/core/type_mat4x4.hpp | 464 +++++++++++++------------- glm/core/type_vec1.hpp | 230 +++++++------ glm/core/type_vec2.hpp | 413 ++++++++++++----------- glm/core/type_vec3.hpp | 462 +++++++++++++------------- glm/core/type_vec4.hpp | 486 ++++++++++++++-------------- 22 files changed, 2650 insertions(+), 2784 deletions(-) diff --git a/glm/core/func_geometric.hpp b/glm/core/func_geometric.hpp index c82d1043..bf572338 100644 --- a/glm/core/func_geometric.hpp +++ b/glm/core/func_geometric.hpp @@ -12,14 +12,9 @@ namespace glm { - namespace test{ - void main_core_func_geometric(); - }//namespace test - namespace core{ namespace function{ - //! Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace. - namespace geometric{ + namespace geometric{ //!< Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace. /// \addtogroup core_funcs ///@{ diff --git a/glm/core/func_integer.hpp b/glm/core/func_integer.hpp index b411b580..f75593a9 100644 --- a/glm/core/func_integer.hpp +++ b/glm/core/func_integer.hpp @@ -12,10 +12,6 @@ namespace glm { - namespace test{ - void main_core_func_integer(); - }//namespace test - namespace core{ namespace function{ //! Define integer functions from Section 8.8 of GLSL 4.00.8 specification. diff --git a/glm/core/func_matrix.hpp b/glm/core/func_matrix.hpp index 6a60b475..14f0b91d 100644 --- a/glm/core/func_matrix.hpp +++ b/glm/core/func_matrix.hpp @@ -12,10 +12,6 @@ namespace glm { - namespace test{ - void main_core_func_matrix(); - }//namespace test - namespace core{ namespace function{ //! Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace. diff --git a/glm/core/func_noise.hpp b/glm/core/func_noise.hpp index b76ec4b4..181ccee6 100644 --- a/glm/core/func_noise.hpp +++ b/glm/core/func_noise.hpp @@ -12,10 +12,6 @@ namespace glm { - namespace test{ - void main_core_func_noise(); - }//namespace test - namespace core{ namespace function{ // Define all noise functions from Section 8.9 of GLSL 1.30.8 specification. Included in glm namespace. diff --git a/glm/core/func_packing.hpp b/glm/core/func_packing.hpp index 3b427785..8f589e69 100644 --- a/glm/core/func_packing.hpp +++ b/glm/core/func_packing.hpp @@ -12,10 +12,6 @@ namespace glm { - namespace test{ - void main_core_func_packing(); - }//namespace test - namespace core{ namespace function{ //! Define packing functions from section 8.4 floating-point pack and unpack functions of GLSL 4.00.8 specification diff --git a/glm/core/func_trigonometric.hpp b/glm/core/func_trigonometric.hpp index 34e62579..aa34ebe7 100644 --- a/glm/core/func_trigonometric.hpp +++ b/glm/core/func_trigonometric.hpp @@ -12,10 +12,6 @@ namespace glm { - namespace test{ - void main_core_func_trigonometric(); - }//namespace test - namespace core{ namespace function{ //! Define Angle and trigonometry functions diff --git a/glm/core/func_vector_relational.hpp b/glm/core/func_vector_relational.hpp index d290defd..ffdc1a26 100644 --- a/glm/core/func_vector_relational.hpp +++ b/glm/core/func_vector_relational.hpp @@ -14,10 +14,6 @@ namespace glm { - namespace test{ - void main_core_func_vector_relational(); - }//namespace test - namespace core{ namespace function{ //! Define vector relational functions from Section 8.6 of GLSL 1.30.8 specification. diff --git a/glm/core/type_half.hpp b/glm/core/type_half.hpp index 00a90157..620c76ac 100644 --- a/glm/core/type_half.hpp +++ b/glm/core/type_half.hpp @@ -12,74 +12,65 @@ #include -namespace glm +namespace glm{ +namespace detail { - namespace test + typedef short hdata; + + float toFloat32(hdata value); + hdata toFloat16(float const & value); + + ///16-bit floating point type. + /// \ingroup gtc_half_float + class thalf { - bool main_type_half(); - - }//namespace test - - namespace detail - { - typedef short hdata; - - float toFloat32(hdata value); - hdata toFloat16(float const & value); - - ///16-bit floating point type. - /// \ingroup gtc_half_float - class thalf - { - public: - // Constructors - GLM_FUNC_DECL thalf(); - GLM_FUNC_DECL thalf(thalf const & s); + public: + // Constructors + GLM_FUNC_DECL thalf(); + GLM_FUNC_DECL thalf(thalf const & s); - template - GLM_FUNC_DECL explicit thalf(U const & s); + template + GLM_FUNC_DECL explicit thalf(U const & s); - // Cast - //operator float(); - GLM_FUNC_DECL operator float() const; - //operator double(); - //operator double() const; + // Cast + //operator float(); + GLM_FUNC_DECL operator float() const; + //operator double(); + //operator double() const; - // Unary updatable operators - GLM_FUNC_DECL thalf& operator= (thalf const & s); - GLM_FUNC_DECL thalf& operator+=(thalf const & s); - GLM_FUNC_DECL thalf& operator-=(thalf const & s); - GLM_FUNC_DECL thalf& operator*=(thalf const & s); - GLM_FUNC_DECL thalf& operator/=(thalf const & s); - GLM_FUNC_DECL thalf& operator++(); - GLM_FUNC_DECL thalf& operator--(); + // Unary updatable operators + GLM_FUNC_DECL thalf& operator= (thalf const & s); + GLM_FUNC_DECL thalf& operator+=(thalf const & s); + GLM_FUNC_DECL thalf& operator-=(thalf const & s); + GLM_FUNC_DECL thalf& operator*=(thalf const & s); + GLM_FUNC_DECL thalf& operator/=(thalf const & s); + GLM_FUNC_DECL thalf& operator++(); + GLM_FUNC_DECL thalf& operator--(); - GLM_FUNC_DECL float toFloat() const{return toFloat32(data);} + GLM_FUNC_DECL float toFloat() const{return toFloat32(data);} - GLM_FUNC_DECL hdata _data() const{return data;} + GLM_FUNC_DECL hdata _data() const{return data;} - private: - hdata data; - }; + private: + hdata data; + }; - thalf operator+ (thalf const & s1, thalf const & s2); + thalf operator+ (thalf const & s1, thalf const & s2); - thalf operator- (thalf const & s1, thalf const & s2); + thalf operator- (thalf const & s1, thalf const & s2); - thalf operator* (thalf const & s1, thalf const & s2); + thalf operator* (thalf const & s1, thalf const & s2); - thalf operator/ (thalf const & s1, thalf const & s2); + thalf operator/ (thalf const & s1, thalf const & s2); - // Unary constant operators - thalf operator- (thalf const & s); + // Unary constant operators + thalf operator- (thalf const & s); - thalf operator-- (thalf const & s, int); - - thalf operator++ (thalf const & s, int); - - }//namespace detail + thalf operator-- (thalf const & s, int); + thalf operator++ (thalf const & s, int); +}//namespace detail }//namespace glm #include "type_half.inl" diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp index 59abf8a4..eb4ed513 100644 --- a/glm/core/type_int.hpp +++ b/glm/core/type_int.hpp @@ -13,71 +13,66 @@ #include "setup.hpp" #include "_detail.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace detail - { - typedef signed short lowp_int_t; - typedef signed int mediump_int_t; - typedef sint64 highp_int_t; + typedef signed short lowp_int_t; + typedef signed int mediump_int_t; + typedef sint64 highp_int_t; - typedef unsigned short lowp_uint_t; - typedef unsigned int mediump_uint_t; - typedef uint64 highp_uint_t; + typedef unsigned short lowp_uint_t; + typedef unsigned int mediump_uint_t; + typedef uint64 highp_uint_t; - GLM_DETAIL_IS_INT(signed char); - GLM_DETAIL_IS_INT(signed short); - GLM_DETAIL_IS_INT(signed int); - GLM_DETAIL_IS_INT(signed long); - GLM_DETAIL_IS_INT(highp_int_t); + GLM_DETAIL_IS_INT(signed char); + GLM_DETAIL_IS_INT(signed short); + GLM_DETAIL_IS_INT(signed int); + GLM_DETAIL_IS_INT(signed long); + GLM_DETAIL_IS_INT(highp_int_t); - GLM_DETAIL_IS_UINT(unsigned char); - GLM_DETAIL_IS_UINT(unsigned short); - GLM_DETAIL_IS_UINT(unsigned int); - GLM_DETAIL_IS_UINT(unsigned long); - GLM_DETAIL_IS_UINT(highp_uint_t); - } - //namespace detail + GLM_DETAIL_IS_UINT(unsigned char); + GLM_DETAIL_IS_UINT(unsigned short); + GLM_DETAIL_IS_UINT(unsigned int); + GLM_DETAIL_IS_UINT(unsigned long); + GLM_DETAIL_IS_UINT(highp_uint_t); +}//namespace detail - namespace core{ - namespace type{ +namespace core{ +namespace type{ +namespace precision //!< Namespace for precision stuff. +{ + //! Low precision signed integer. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification. + //! \ingroup core_precision + typedef detail::lowp_int_t lowp_int; + //! Medium precision signed integer. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification. + //! \ingroup core_precision + typedef detail::mediump_int_t mediump_int; + //! High precision signed integer. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification. + //! \ingroup core_precision + typedef detail::highp_int_t highp_int; - ///namespace for precision stuff. - namespace precision - { - //! Low precision signed integer. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification. - //! \ingroup core_precision - typedef detail::lowp_int_t lowp_int; - //! Medium precision signed integer. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification. - //! \ingroup core_precision - typedef detail::mediump_int_t mediump_int; - //! High precision signed integer. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification. - //! \ingroup core_precision - typedef detail::highp_int_t highp_int; - - //! Low precision unsigned integer. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification. - //! \ingroup core_precision - typedef detail::lowp_uint_t lowp_uint; - //! Medium precision unsigned integer. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification. - //! \ingroup core_precision - typedef detail::mediump_uint_t mediump_uint; - //! High precision unsigned integer. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification. - //! \ingroup core_precision - typedef detail::highp_uint_t highp_uint; - } - //namespace precision + //! Low precision unsigned integer. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification. + //! \ingroup core_precision + typedef detail::lowp_uint_t lowp_uint; + //! Medium precision unsigned integer. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification. + //! \ingroup core_precision + typedef detail::mediump_uint_t mediump_uint; + //! High precision unsigned integer. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification. + //! \ingroup core_precision + typedef detail::highp_uint_t highp_uint; +}//namespace precision #if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) typedef precision::mediump_int int_t; @@ -107,8 +102,8 @@ namespace glm //! From GLSL 1.30.8 specification section 4.1.3 Integers. typedef uint_t uint; - }//namespace type - }//namespace core +}//namespace type +}//namespace core }//namespace glm #endif//glm_core_type_int diff --git a/glm/core/type_mat2x2.hpp b/glm/core/type_mat2x2.hpp index 9ae7cd13..82092fc6 100644 --- a/glm/core/type_mat2x2.hpp +++ b/glm/core/type_mat2x2.hpp @@ -12,276 +12,267 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! \brief Template for 2 * 2 matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat2x2 { - void main_mat2x2(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec2 col_type; + typedef tvec2 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat2x2 type; + typedef tmat2x2 transpose_type; - //! \brief Template for 2 * 2 matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat2x2 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec2 col_type; - typedef tvec2 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + public: + // Implementation detail + GLM_FUNC_DECL tmat2x2 _inverse() const; - typedef tmat2x2 type; - typedef tmat2x2 transpose_type; + private: + ////////////////////////////////////// + // Data + col_type value[2]; - public: - // Implementation detail - GLM_FUNC_DECL tmat2x2 _inverse() const; + public: + ////////////////////////////////////// + // Constructors + GLM_FUNC_DECL tmat2x2(); + GLM_FUNC_DECL tmat2x2( + tmat2x2 const & m); - private: - ////////////////////////////////////// - // Data - col_type value[2]; + GLM_FUNC_DECL explicit tmat2x2( + ctor Null); + GLM_FUNC_DECL explicit tmat2x2( + value_type const & x); + GLM_FUNC_DECL explicit tmat2x2( + value_type const & x1, value_type const & y1, + value_type const & x2, value_type const & y2); + GLM_FUNC_DECL explicit tmat2x2( + col_type const & v1, + col_type const & v2); - public: - ////////////////////////////////////// - // Constructors - GLM_FUNC_DECL tmat2x2(); - GLM_FUNC_DECL tmat2x2( - tmat2x2 const & m); - - GLM_FUNC_DECL explicit tmat2x2( - ctor Null); - GLM_FUNC_DECL explicit tmat2x2( - value_type const & x); - GLM_FUNC_DECL explicit tmat2x2( - value_type const & x1, value_type const & y1, - value_type const & x2, value_type const & y2); - GLM_FUNC_DECL explicit tmat2x2( - col_type const & v1, - col_type const & v2); - - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat2x2( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat2x2( + U const & x); - template - GLM_FUNC_DECL explicit tmat2x2( - U const & x1, V const & y1, - M const & x2, N const & y2); + template + GLM_FUNC_DECL explicit tmat2x2( + U const & x1, V const & y1, + M const & x2, N const & y2); - template - GLM_FUNC_DECL explicit tmat2x2( - tvec2 const & v1, - tvec2 const & v2); + template + GLM_FUNC_DECL explicit tmat2x2( + tvec2 const & v1, + tvec2 const & v2); - ////////////////////////////////////// - // Matrix conversions - template - GLM_FUNC_DECL explicit tmat2x2(tmat2x2 const & m); + ////////////////////////////////////// + // Matrix conversions + template + GLM_FUNC_DECL explicit tmat2x2(tmat2x2 const & m); - GLM_FUNC_DECL explicit tmat2x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x2(tmat4x3 const & x); + GLM_FUNC_DECL explicit tmat2x2(tmat3x3 const & x); + GLM_FUNC_DECL explicit tmat2x2(tmat4x4 const & x); + GLM_FUNC_DECL explicit tmat2x2(tmat2x3 const & x); + GLM_FUNC_DECL explicit tmat2x2(tmat3x2 const & x); + GLM_FUNC_DECL explicit tmat2x2(tmat2x4 const & x); + GLM_FUNC_DECL explicit tmat2x2(tmat4x2 const & x); + GLM_FUNC_DECL explicit tmat2x2(tmat3x4 const & x); + GLM_FUNC_DECL explicit tmat2x2(tmat4x3 const & x); - ////////////////////////////////////// - // Accesses + ////////////////////////////////////// + // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + GLM_FUNC_DECL col_type & operator[](size_type i); + GLM_FUNC_DECL col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); - template - GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); - template - GLM_FUNC_DECL tmat2x2 & operator+=(U const & s); - template - GLM_FUNC_DECL tmat2x2 & operator+=(tmat2x2 const & m); - template - GLM_FUNC_DECL tmat2x2 & operator-=(U const & s); - template - GLM_FUNC_DECL tmat2x2 & operator-=(tmat2x2 const & m); - template - GLM_FUNC_DECL tmat2x2 & operator*=(U const & s); - template - GLM_FUNC_DECL tmat2x2 & operator*=(tmat2x2 const & m); - template - GLM_FUNC_DECL tmat2x2 & operator/=(U const & s); - template - GLM_FUNC_DECL tmat2x2 & operator/=(tmat2x2 const & m); - GLM_FUNC_DECL tmat2x2 & operator++(); - GLM_FUNC_DECL tmat2x2 & operator--(); - }; + // Unary updatable operators + GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); + template + GLM_FUNC_DECL tmat2x2 & operator=(tmat2x2 const & m); + template + GLM_FUNC_DECL tmat2x2 & operator+=(U const & s); + template + GLM_FUNC_DECL tmat2x2 & operator+=(tmat2x2 const & m); + template + GLM_FUNC_DECL tmat2x2 & operator-=(U const & s); + template + GLM_FUNC_DECL tmat2x2 & operator-=(tmat2x2 const & m); + template + GLM_FUNC_DECL tmat2x2 & operator*=(U const & s); + template + GLM_FUNC_DECL tmat2x2 & operator*=(tmat2x2 const & m); + template + GLM_FUNC_DECL tmat2x2 & operator/=(U const & s); + template + GLM_FUNC_DECL tmat2x2 & operator/=(tmat2x2 const & m); + GLM_FUNC_DECL tmat2x2 & operator++(); + GLM_FUNC_DECL tmat2x2 & operator--(); + }; - // Binary operators - template - tmat2x2 operator+ ( - tmat2x2 const & m, - typename tmat2x2::value_type const & s); + // Binary operators + template + tmat2x2 operator+ ( + tmat2x2 const & m, + typename tmat2x2::value_type const & s); - template - tmat2x2 operator+ ( - typename tmat2x2::value_type const & s, - tmat2x2 const & m); + template + tmat2x2 operator+ ( + typename tmat2x2::value_type const & s, + tmat2x2 const & m); - template - tmat2x2 operator+ ( - tmat2x2 const & m1, - tmat2x2 const & m2); + template + tmat2x2 operator+ ( + tmat2x2 const & m1, + tmat2x2 const & m2); - template - tmat2x2 operator- ( - tmat2x2 const & m, - typename tmat2x2::value_type const & s); + template + tmat2x2 operator- ( + tmat2x2 const & m, + typename tmat2x2::value_type const & s); - template - tmat2x2 operator- ( - typename tmat2x2::value_type const & s, - tmat2x2 const & m); + template + tmat2x2 operator- ( + typename tmat2x2::value_type const & s, + tmat2x2 const & m); - template - tmat2x2 operator- ( - tmat2x2 const & m1, - tmat2x2 const & m2); + template + tmat2x2 operator- ( + tmat2x2 const & m1, + tmat2x2 const & m2); - template - tmat2x2 operator* ( - tmat2x2 const & m, - typename tmat2x2::value_type const & s); + template + tmat2x2 operator* ( + tmat2x2 const & m, + typename tmat2x2::value_type const & s); - template - tmat2x2 operator* ( - typename tmat2x2::value_type const & s, - tmat2x2 const & m); + template + tmat2x2 operator* ( + typename tmat2x2::value_type const & s, + tmat2x2 const & m); - template - typename tmat2x2::col_type operator* ( - tmat2x2 const & m, - typename tmat2x2::row_type const & v); + template + typename tmat2x2::col_type operator* ( + tmat2x2 const & m, + typename tmat2x2::row_type const & v); - template - typename tmat2x2::row_type operator* ( - typename tmat2x2::col_type const & v, - tmat2x2 const & m); + template + typename tmat2x2::row_type operator* ( + typename tmat2x2::col_type const & v, + tmat2x2 const & m); - template - tmat2x2 operator* ( - tmat2x2 const & m1, - tmat2x2 const & m2); + template + tmat2x2 operator* ( + tmat2x2 const & m1, + tmat2x2 const & m2); - template - tmat2x2 operator/ ( - tmat2x2 const & m, - typename tmat2x2::value_type const & s); + template + tmat2x2 operator/ ( + tmat2x2 const & m, + typename tmat2x2::value_type const & s); - template - tmat2x2 operator/ ( - typename tmat2x2::value_type const & s, - tmat2x2 const & m); + template + tmat2x2 operator/ ( + typename tmat2x2::value_type const & s, + tmat2x2 const & m); - template - typename tmat2x2::col_type operator/ ( - tmat2x2 const & m, - typename tmat2x2::row_type const & v); + template + typename tmat2x2::col_type operator/ ( + tmat2x2 const & m, + typename tmat2x2::row_type const & v); - template - typename tmat2x2::row_type operator/ ( - typename tmat2x2::col_type const & v, - tmat2x2 const & m); + template + typename tmat2x2::row_type operator/ ( + typename tmat2x2::col_type const & v, + tmat2x2 const & m); - template - tmat2x2 operator/ ( - tmat2x2 const & m1, - tmat2x2 const & m2); + template + tmat2x2 operator/ ( + tmat2x2 const & m1, + tmat2x2 const & m2); - // Unary constant operators - template - tmat2x2 const operator- ( - tmat2x2 const & m); + // Unary constant operators + template + tmat2x2 const operator- ( + tmat2x2 const & m); - template - tmat2x2 const operator-- ( - tmat2x2 const & m, - int); + template + tmat2x2 const operator-- ( + tmat2x2 const & m, + int); - template - tmat2x2 const operator++ ( - tmat2x2 const & m, - int); + template + tmat2x2 const operator++ ( + tmat2x2 const & m, + int); +} //namespace detail - } //namespace detail +namespace core{ +namespace type{ +namespace precision +{ + //! 2 columns of 2 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat2x2 lowp_mat2; - namespace core{ - namespace type{ + //! 2 columns of 2 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat2x2 mediump_mat2; - namespace precision - { - //! 2 columns of 2 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat2x2 lowp_mat2; + //! 2 columns of 2 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat2x2 highp_mat2; - //! 2 columns of 2 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat2x2 mediump_mat2; + //! 2 columns of 2 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat2x2 lowp_mat2x2; - //! 2 columns of 2 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat2x2 highp_mat2; + //! 2 columns of 2 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat2x2 mediump_mat2x2; - //! 2 columns of 2 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat2x2 lowp_mat2x2; + //! 2 columns of 2 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat2x2 highp_mat2x2; - //! 2 columns of 2 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat2x2 mediump_mat2x2; - - //! 2 columns of 2 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat2x2 highp_mat2x2; - } - //namespace precision - - }//namespace type - }//namespace core -} //namespace glm +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat2x2.inl" diff --git a/glm/core/type_mat2x3.hpp b/glm/core/type_mat2x3.hpp index 4ff621e1..caf3bea5 100644 --- a/glm/core/type_mat2x3.hpp +++ b/glm/core/type_mat2x3.hpp @@ -12,222 +12,213 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! \brief Template for 2 columns and 3 rows matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat2x3 { - void main_mat2x3(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec3 col_type; + typedef tvec2 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat2x3 type; + typedef tmat3x2 transpose_type; - //! \brief Template for 2 columns and 3 rows matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat2x3 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec3 col_type; - typedef tvec2 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + private: + // Data + col_type value[2]; - typedef tmat2x3 type; - typedef tmat3x2 transpose_type; + public: + // Constructors + GLM_FUNC_DECL tmat2x3(); + GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); - private: - // Data - col_type value[2]; - - public: - // Constructors - GLM_FUNC_DECL tmat2x3(); - GLM_FUNC_DECL tmat2x3(tmat2x3 const & m); - - GLM_FUNC_DECL explicit tmat2x3( - ctor); - GLM_FUNC_DECL explicit tmat2x3( - value_type const & s); - GLM_FUNC_DECL explicit tmat2x3( - value_type const & x0, value_type const & y0, value_type const & z0, - value_type const & x1, value_type const & y1, value_type const & z1); - GLM_FUNC_DECL explicit tmat2x3( - col_type const & v0, - col_type const & v1); + GLM_FUNC_DECL explicit tmat2x3( + ctor); + GLM_FUNC_DECL explicit tmat2x3( + value_type const & s); + GLM_FUNC_DECL explicit tmat2x3( + value_type const & x0, value_type const & y0, value_type const & z0, + value_type const & x1, value_type const & y1, value_type const & z1); + GLM_FUNC_DECL explicit tmat2x3( + col_type const & v0, + col_type const & v1); - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat2x3( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat2x3( + U const & x); - template - GLM_FUNC_DECL explicit tmat2x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2); + template + GLM_FUNC_DECL explicit tmat2x3( + X1 const & x1, Y1 const & y1, Z1 const & z1, + X2 const & x2, Y2 const & y2, Z2 const & z2); - template - GLM_FUNC_DECL explicit tmat2x3( - tvec3 const & v1, - tvec3 const & v2); + template + GLM_FUNC_DECL explicit tmat2x3( + tvec3 const & v1, + tvec3 const & v2); - ////////////////////////////////////// - // Matrix conversion - template - GLM_FUNC_DECL explicit tmat2x3(tmat2x3 const & m); + ////////////////////////////////////// + // Matrix conversion + template + GLM_FUNC_DECL explicit tmat2x3(tmat2x3 const & m); - GLM_FUNC_DECL explicit tmat2x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x3(tmat4x3 const & x); + GLM_FUNC_DECL explicit tmat2x3(tmat2x2 const & x); + GLM_FUNC_DECL explicit tmat2x3(tmat3x3 const & x); + GLM_FUNC_DECL explicit tmat2x3(tmat4x4 const & x); + GLM_FUNC_DECL explicit tmat2x3(tmat2x4 const & x); + GLM_FUNC_DECL explicit tmat2x3(tmat3x2 const & x); + GLM_FUNC_DECL explicit tmat2x3(tmat3x4 const & x); + GLM_FUNC_DECL explicit tmat2x3(tmat4x2 const & x); + GLM_FUNC_DECL explicit tmat2x3(tmat4x3 const & x); - // Accesses - col_type & operator[](size_type i); - col_type const & operator[](size_type i) const; + // Accesses + col_type & operator[](size_type i); + col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat2x3 & operator= (tmat2x3 const & m); - template - GLM_FUNC_DECL tmat2x3 & operator= (tmat2x3 const & m); - template - GLM_FUNC_DECL tmat2x3 & operator+= (U const & s); - template - GLM_FUNC_DECL tmat2x3 & operator+= (tmat2x3 const & m); - template - GLM_FUNC_DECL tmat2x3 & operator-= (U const & s); - template - GLM_FUNC_DECL tmat2x3 & operator-= (tmat2x3 const & m); - template - GLM_FUNC_DECL tmat2x3 & operator*= (U const & s); - template - GLM_FUNC_DECL tmat2x3 & operator*= (tmat2x3 const & m); - template - GLM_FUNC_DECL tmat2x3 & operator/= (U const & s); + // Unary updatable operators + GLM_FUNC_DECL tmat2x3 & operator= (tmat2x3 const & m); + template + GLM_FUNC_DECL tmat2x3 & operator= (tmat2x3 const & m); + template + GLM_FUNC_DECL tmat2x3 & operator+= (U const & s); + template + GLM_FUNC_DECL tmat2x3 & operator+= (tmat2x3 const & m); + template + GLM_FUNC_DECL tmat2x3 & operator-= (U const & s); + template + GLM_FUNC_DECL tmat2x3 & operator-= (tmat2x3 const & m); + template + GLM_FUNC_DECL tmat2x3 & operator*= (U const & s); + template + GLM_FUNC_DECL tmat2x3 & operator*= (tmat2x3 const & m); + template + GLM_FUNC_DECL tmat2x3 & operator/= (U const & s); - GLM_FUNC_DECL tmat2x3 & operator++ (); - GLM_FUNC_DECL tmat2x3 & operator-- (); - }; + GLM_FUNC_DECL tmat2x3 & operator++ (); + GLM_FUNC_DECL tmat2x3 & operator-- (); + }; - // Binary operators - template - tmat2x3 operator+ ( - tmat2x3 const & m, - typename tmat2x3::value_type const & s); + // Binary operators + template + tmat2x3 operator+ ( + tmat2x3 const & m, + typename tmat2x3::value_type const & s); - template - tmat2x3 operator+ ( - tmat2x3 const & m1, - tmat2x3 const & m2); + template + tmat2x3 operator+ ( + tmat2x3 const & m1, + tmat2x3 const & m2); - template - tmat2x3 operator- ( - tmat2x3 const & m, - typename tmat2x3::value_type const & s); + template + tmat2x3 operator- ( + tmat2x3 const & m, + typename tmat2x3::value_type const & s); - template - tmat2x3 operator- ( - tmat2x3 const & m1, - tmat2x3 const & m2); + template + tmat2x3 operator- ( + tmat2x3 const & m1, + tmat2x3 const & m2); - template - tmat2x3 operator* ( - tmat2x3 const & m, - typename tmat2x3::value_type const & s); + template + tmat2x3 operator* ( + tmat2x3 const & m, + typename tmat2x3::value_type const & s); - template - tmat2x3 operator* ( - typename tmat2x3::value_type const & s, - tmat2x3 const & m); + template + tmat2x3 operator* ( + typename tmat2x3::value_type const & s, + tmat2x3 const & m); - template - typename tmat2x3::col_type operator* ( - tmat2x3 const & m, - typename tmat2x3::row_type const & v); + template + typename tmat2x3::col_type operator* ( + tmat2x3 const & m, + typename tmat2x3::row_type const & v); - template - typename tmat2x3::row_type operator* ( - typename tmat2x3::col_type const & v, - tmat2x3 const & m); + template + typename tmat2x3::row_type operator* ( + typename tmat2x3::col_type const & v, + tmat2x3 const & m); - template - tmat3x3 operator* ( - tmat2x3 const & m1, - tmat3x2 const & m2); + template + tmat3x3 operator* ( + tmat2x3 const & m1, + tmat3x2 const & m2); - template - tmat2x3 operator/ ( - tmat2x3 const & m, - typename tmat2x3::value_type const & s); + template + tmat2x3 operator/ ( + tmat2x3 const & m, + typename tmat2x3::value_type const & s); - template - tmat2x3 operator/ ( - typename tmat2x3::value_type const & s, - tmat2x3 const & m); + template + tmat2x3 operator/ ( + typename tmat2x3::value_type const & s, + tmat2x3 const & m); - // Unary constant operators - template - tmat2x3 const operator- ( - tmat2x3 const & m); + // Unary constant operators + template + tmat2x3 const operator- ( + tmat2x3 const & m); - template - tmat2x3 const operator-- ( - tmat2x3 const & m, - int); + template + tmat2x3 const operator-- ( + tmat2x3 const & m, + int); - template - tmat2x3 const operator++ ( - tmat2x3 const & m, - int); + template + tmat2x3 const operator++ ( + tmat2x3 const & m, + int); - } //namespace detail +} //namespace detail - namespace core{ - namespace type{ - - namespace precision - { - //! 2 columns of 3 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat2x3 lowp_mat2x3; - //! 2 columns of 3 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat2x3 mediump_mat2x3; - //! 2 columns of 3 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat2x3 highp_mat2x3; - } - //namespace precision - - }//namespace type - }//namespace core -} //namespace glm +namespace core{ +namespace type{ +namespace precision +{ + //! 2 columns of 3 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat2x3 lowp_mat2x3; + //! 2 columns of 3 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat2x3 mediump_mat2x3; + //! 2 columns of 3 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat2x3 highp_mat2x3; +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat2x3.inl" diff --git a/glm/core/type_mat2x4.hpp b/glm/core/type_mat2x4.hpp index cf21c6f8..c14dea0f 100644 --- a/glm/core/type_mat2x4.hpp +++ b/glm/core/type_mat2x4.hpp @@ -12,220 +12,211 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! Template for 2 columns and 4 rows matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat2x4 { - void main_mat2x4(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec4 col_type; + typedef tvec2 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat2x4 type; + typedef tmat4x2 transpose_type; - //! Template for 2 columns and 4 rows matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat2x4 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec4 col_type; - typedef tvec2 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + private: + // Data + col_type value[2]; - typedef tmat2x4 type; - typedef tmat4x2 transpose_type; + public: + // Constructors + GLM_FUNC_DECL tmat2x4(); + GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); - private: - // Data - col_type value[2]; - - public: - // Constructors - GLM_FUNC_DECL tmat2x4(); - GLM_FUNC_DECL tmat2x4(tmat2x4 const & m); - - GLM_FUNC_DECL explicit tmat2x4( - ctor); - GLM_FUNC_DECL explicit tmat2x4( - value_type const & s); - GLM_FUNC_DECL explicit tmat2x4( - value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, - value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1); - GLM_FUNC_DECL explicit tmat2x4( - col_type const & v0, - col_type const & v1); + GLM_FUNC_DECL explicit tmat2x4( + ctor); + GLM_FUNC_DECL explicit tmat2x4( + value_type const & s); + GLM_FUNC_DECL explicit tmat2x4( + value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, + value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1); + GLM_FUNC_DECL explicit tmat2x4( + col_type const & v0, + col_type const & v1); - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat2x4( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat2x4( + U const & x); - template < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_DECL explicit tmat2x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2); + template < + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2> + GLM_FUNC_DECL explicit tmat2x4( + X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, + X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2); - template - GLM_FUNC_DECL explicit tmat2x4( - tvec4 const & v1, - tvec4 const & v2); + template + GLM_FUNC_DECL explicit tmat2x4( + tvec4 const & v1, + tvec4 const & v2); - ////////////////////////////////////// - // Matrix conversions - template - GLM_FUNC_DECL explicit tmat2x4(tmat2x4 const & m); + ////////////////////////////////////// + // Matrix conversions + template + GLM_FUNC_DECL explicit tmat2x4(tmat2x4 const & m); - GLM_FUNC_DECL explicit tmat2x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat2x4(tmat4x3 const & x); + GLM_FUNC_DECL explicit tmat2x4(tmat2x2 const & x); + GLM_FUNC_DECL explicit tmat2x4(tmat3x3 const & x); + GLM_FUNC_DECL explicit tmat2x4(tmat4x4 const & x); + GLM_FUNC_DECL explicit tmat2x4(tmat2x3 const & x); + GLM_FUNC_DECL explicit tmat2x4(tmat3x2 const & x); + GLM_FUNC_DECL explicit tmat2x4(tmat3x4 const & x); + GLM_FUNC_DECL explicit tmat2x4(tmat4x2 const & x); + GLM_FUNC_DECL explicit tmat2x4(tmat4x3 const & x); - // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + // Accesses + GLM_FUNC_DECL col_type & operator[](size_type i); + GLM_FUNC_DECL col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat2x4& operator= (tmat2x4 const & m); - template - GLM_FUNC_DECL tmat2x4& operator= (tmat2x4 const & m); - template - GLM_FUNC_DECL tmat2x4& operator+= (U const & s); - template - GLM_FUNC_DECL tmat2x4& operator+= (tmat2x4 const & m); - template - GLM_FUNC_DECL tmat2x4& operator-= (U const & s); - template - GLM_FUNC_DECL tmat2x4& operator-= (tmat2x4 const & m); - template - GLM_FUNC_DECL tmat2x4& operator*= (U const & s); - template - GLM_FUNC_DECL tmat2x4& operator*= (tmat2x4 const & m); - template - GLM_FUNC_DECL tmat2x4& operator/= (U const & s); + // Unary updatable operators + GLM_FUNC_DECL tmat2x4& operator= (tmat2x4 const & m); + template + GLM_FUNC_DECL tmat2x4& operator= (tmat2x4 const & m); + template + GLM_FUNC_DECL tmat2x4& operator+= (U const & s); + template + GLM_FUNC_DECL tmat2x4& operator+= (tmat2x4 const & m); + template + GLM_FUNC_DECL tmat2x4& operator-= (U const & s); + template + GLM_FUNC_DECL tmat2x4& operator-= (tmat2x4 const & m); + template + GLM_FUNC_DECL tmat2x4& operator*= (U const & s); + template + GLM_FUNC_DECL tmat2x4& operator*= (tmat2x4 const & m); + template + GLM_FUNC_DECL tmat2x4& operator/= (U const & s); - GLM_FUNC_DECL tmat2x4& operator++ (); - GLM_FUNC_DECL tmat2x4& operator-- (); - }; + GLM_FUNC_DECL tmat2x4& operator++ (); + GLM_FUNC_DECL tmat2x4& operator-- (); + }; - // Binary operators - template - tmat2x4 operator+ ( - tmat2x4 const & m, - typename tmat2x4::value_type const & s); + // Binary operators + template + tmat2x4 operator+ ( + tmat2x4 const & m, + typename tmat2x4::value_type const & s); - template - tmat2x4 operator+ ( - tmat2x4 const & m1, - tmat2x4 const & m2); + template + tmat2x4 operator+ ( + tmat2x4 const & m1, + tmat2x4 const & m2); - template - tmat2x4 operator- ( - tmat2x4 const & m, - typename tmat2x4::value_type const & s); + template + tmat2x4 operator- ( + tmat2x4 const & m, + typename tmat2x4::value_type const & s); - template - tmat2x4 operator- ( - tmat2x4 const & m1, - tmat2x4 const & m2); + template + tmat2x4 operator- ( + tmat2x4 const & m1, + tmat2x4 const & m2); - template - tmat2x4 operator* ( - tmat2x4 const & m, - typename tmat2x4::value_type const & s); + template + tmat2x4 operator* ( + tmat2x4 const & m, + typename tmat2x4::value_type const & s); - template - tmat2x4 operator* ( - typename tmat2x4::value_type const & s, - tmat2x4 const & m); + template + tmat2x4 operator* ( + typename tmat2x4::value_type const & s, + tmat2x4 const & m); - template - typename tmat2x4::col_type operator* ( - tmat2x4 const & m, - typename tmat2x4::row_type const & v); + template + typename tmat2x4::col_type operator* ( + tmat2x4 const & m, + typename tmat2x4::row_type const & v); - template - typename tmat2x4::row_type operator* ( - typename tmat2x4::col_type const & v, - tmat2x4 const & m); + template + typename tmat2x4::row_type operator* ( + typename tmat2x4::col_type const & v, + tmat2x4 const & m); - template - tmat2x4 operator* ( - tmat2x4 const & m1, - tmat2x4 const & m2); + template + tmat2x4 operator* ( + tmat2x4 const & m1, + tmat2x4 const & m2); - template - tmat2x4 operator/ ( - tmat2x4 const & m, - typename tmat2x4::value_type const & s); + template + tmat2x4 operator/ ( + tmat2x4 const & m, + typename tmat2x4::value_type const & s); - template - tmat2x4 operator/ ( - typename tmat2x4::value_type const & s, - tmat2x4 const & m); + template + tmat2x4 operator/ ( + typename tmat2x4::value_type const & s, + tmat2x4 const & m); - // Unary constant operators - template - tmat2x4 const operator- ( - tmat2x4 const & m); + // Unary constant operators + template + tmat2x4 const operator- ( + tmat2x4 const & m); - template - tmat2x4 const operator-- ( - tmat2x4 const & m, - int); + template + tmat2x4 const operator-- ( + tmat2x4 const & m, + int); - template - tmat2x4 const operator++ ( - tmat2x4 const & m, - int); + template + tmat2x4 const operator++ ( + tmat2x4 const & m, + int); - } //namespace detail +} //namespace detail - namespace core{ - namespace type{ - - namespace precision - { - //! 2 columns of 4 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat2x4 lowp_mat2x4; - //! 2 columns of 4 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat2x4 mediump_mat2x4; - //! 2 columns of 4 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat2x4 highp_mat2x4; - } - //namespace precision - - }//namespace type - }//namespace core -} //namespace glm +namespace core{ +namespace type{ +namespace precision +{ + //! 2 columns of 4 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x4 lowp_mat2x4; + //! 2 columns of 4 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x4 mediump_mat2x4; + //! 2 columns of 4 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat2x4 highp_mat2x4; +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat2x4.inl" diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp index 70c0795a..bcfe9eb0 100644 --- a/glm/core/type_mat3x2.hpp +++ b/glm/core/type_mat3x2.hpp @@ -12,226 +12,217 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! \brief Template for 3 columns and 2 rows matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat3x2 { - void main_mat3x2(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec2 col_type; + typedef tvec3 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat3x2 type; + typedef tmat2x3 transpose_type; - //! \brief Template for 3 columns and 2 rows matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat3x2 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec2 col_type; - typedef tvec3 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + private: + // Data + col_type value[3]; - typedef tmat3x2 type; - typedef tmat2x3 transpose_type; + public: + // Constructors + GLM_FUNC_DECL tmat3x2(); + GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); - private: - // Data - col_type value[3]; + GLM_FUNC_DECL explicit tmat3x2( + ctor); + GLM_FUNC_DECL explicit tmat3x2( + value_type const & s); + GLM_FUNC_DECL explicit tmat3x2( + value_type const & x0, value_type const & y0, + value_type const & x1, value_type const & y1, + value_type const & x2, value_type const & y2); + GLM_FUNC_DECL explicit tmat3x2( + col_type const & v0, + col_type const & v1, + col_type const & v2); - public: - // Constructors - GLM_FUNC_DECL tmat3x2(); - GLM_FUNC_DECL tmat3x2(tmat3x2 const & m); - - GLM_FUNC_DECL explicit tmat3x2( - ctor); - GLM_FUNC_DECL explicit tmat3x2( - value_type const & s); - GLM_FUNC_DECL explicit tmat3x2( - value_type const & x0, value_type const & y0, - value_type const & x1, value_type const & y1, - value_type const & x2, value_type const & y2); - GLM_FUNC_DECL explicit tmat3x2( - col_type const & v0, - col_type const & v1, - col_type const & v2); - - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat3x2( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat3x2( + U const & x); - template - < - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3 - > - GLM_FUNC_DECL explicit tmat3x2( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3); + template + < + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3 + > + GLM_FUNC_DECL explicit tmat3x2( + X1 const & x1, Y1 const & y1, + X2 const & x2, Y2 const & y2, + X3 const & x3, Y3 const & y3); - template - GLM_FUNC_DECL explicit tmat3x2( - tvec2 const & v1, - tvec2 const & v2, - tvec2 const & v3); + template + GLM_FUNC_DECL explicit tmat3x2( + tvec2 const & v1, + tvec2 const & v2, + tvec2 const & v3); - // Matrix conversions - template - GLM_FUNC_DECL explicit tmat3x2(tmat3x2 const & m); + // Matrix conversions + template + GLM_FUNC_DECL explicit tmat3x2(tmat3x2 const & m); - GLM_FUNC_DECL explicit tmat3x2(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x2(tmat4x3 const & x); + GLM_FUNC_DECL explicit tmat3x2(tmat2x2 const & x); + GLM_FUNC_DECL explicit tmat3x2(tmat3x3 const & x); + GLM_FUNC_DECL explicit tmat3x2(tmat4x4 const & x); + GLM_FUNC_DECL explicit tmat3x2(tmat2x3 const & x); + GLM_FUNC_DECL explicit tmat3x2(tmat2x4 const & x); + GLM_FUNC_DECL explicit tmat3x2(tmat3x4 const & x); + GLM_FUNC_DECL explicit tmat3x2(tmat4x2 const & x); + GLM_FUNC_DECL explicit tmat3x2(tmat4x3 const & x); - // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + // Accesses + GLM_FUNC_DECL col_type & operator[](size_type i); + GLM_FUNC_DECL col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat3x2 & operator= (tmat3x2 const & m); - template - GLM_FUNC_DECL tmat3x2 & operator= (tmat3x2 const & m); - template - GLM_FUNC_DECL tmat3x2 & operator+= (U const & s); - template - GLM_FUNC_DECL tmat3x2 & operator+= (tmat3x2 const & m); - template - GLM_FUNC_DECL tmat3x2 & operator-= (U const & s); - template - GLM_FUNC_DECL tmat3x2 & operator-= (tmat3x2 const & m); - template - GLM_FUNC_DECL tmat3x2 & operator*= (U const & s); - template - GLM_FUNC_DECL tmat3x2 & operator*= (tmat3x2 const & m); - template - GLM_FUNC_DECL tmat3x2 & operator/= (U const & s); + // Unary updatable operators + GLM_FUNC_DECL tmat3x2 & operator= (tmat3x2 const & m); + template + GLM_FUNC_DECL tmat3x2 & operator= (tmat3x2 const & m); + template + GLM_FUNC_DECL tmat3x2 & operator+= (U const & s); + template + GLM_FUNC_DECL tmat3x2 & operator+= (tmat3x2 const & m); + template + GLM_FUNC_DECL tmat3x2 & operator-= (U const & s); + template + GLM_FUNC_DECL tmat3x2 & operator-= (tmat3x2 const & m); + template + GLM_FUNC_DECL tmat3x2 & operator*= (U const & s); + template + GLM_FUNC_DECL tmat3x2 & operator*= (tmat3x2 const & m); + template + GLM_FUNC_DECL tmat3x2 & operator/= (U const & s); - GLM_FUNC_DECL tmat3x2 & operator++ (); - GLM_FUNC_DECL tmat3x2 & operator-- (); - }; + GLM_FUNC_DECL tmat3x2 & operator++ (); + GLM_FUNC_DECL tmat3x2 & operator-- (); + }; - // Binary operators - template - tmat3x2 operator+ ( - tmat3x2 const & m, - typename tmat3x2::value_type const & s); + // Binary operators + template + tmat3x2 operator+ ( + tmat3x2 const & m, + typename tmat3x2::value_type const & s); - template - tmat3x2 operator+ ( - tmat3x2 const & m1, - tmat3x2 const & m2); + template + tmat3x2 operator+ ( + tmat3x2 const & m1, + tmat3x2 const & m2); - template - tmat3x2 operator- ( - tmat3x2 const & m, - typename tmat3x2::value_type const & s); + template + tmat3x2 operator- ( + tmat3x2 const & m, + typename tmat3x2::value_type const & s); - template - tmat3x2 operator- ( - tmat3x2 const & m1, - tmat3x2 const & m2); + template + tmat3x2 operator- ( + tmat3x2 const & m1, + tmat3x2 const & m2); - template - tmat3x2 operator* ( - tmat3x2 const & m, - typename tmat3x2::value_type const & s); + template + tmat3x2 operator* ( + tmat3x2 const & m, + typename tmat3x2::value_type const & s); - template - tmat3x2 operator* ( - typename tmat3x2::value_type const & s, - tmat3x2 const & m); + template + tmat3x2 operator* ( + typename tmat3x2::value_type const & s, + tmat3x2 const & m); - template - typename tmat3x2::col_type operator* ( - tmat3x2 const & m, - typename tmat3x2::row_type const & v); + template + typename tmat3x2::col_type operator* ( + tmat3x2 const & m, + typename tmat3x2::row_type const & v); - template - typename tmat3x2::row_type operator* ( - typename tmat3x2::col_type const & v, - tmat3x2 const & m); + template + typename tmat3x2::row_type operator* ( + typename tmat3x2::col_type const & v, + tmat3x2 const & m); - template - tmat2x2 operator* ( - tmat3x2 const & m1, - tmat2x3 const & m2); + template + tmat2x2 operator* ( + tmat3x2 const & m1, + tmat2x3 const & m2); - template - tmat3x2 operator/ ( - tmat3x2 const & m, - typename tmat3x2::value_type const & s); + template + tmat3x2 operator/ ( + tmat3x2 const & m, + typename tmat3x2::value_type const & s); - template - tmat3x2 operator/ ( - typename tmat3x2::value_type const & s, - tmat3x2 const & m); + template + tmat3x2 operator/ ( + typename tmat3x2::value_type const & s, + tmat3x2 const & m); - // Unary constant operators - template - tmat3x2 const operator- ( - tmat3x2 const & m); + // Unary constant operators + template + tmat3x2 const operator- ( + tmat3x2 const & m); - template - tmat3x2 const operator-- ( - tmat3x2 const & m, - int); + template + tmat3x2 const operator-- ( + tmat3x2 const & m, + int); - template - tmat3x2 const operator++ ( - tmat3x2 const & m, - int); + template + tmat3x2 const operator++ ( + tmat3x2 const & m, + int); - } //namespace detail +} //namespace detail - namespace core{ - namespace type{ - - namespace precision - { - //! 3 columns of 2 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat3x2 lowp_mat3x2; - //! 3 columns of 2 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat3x2 mediump_mat3x2; - //! 3 columns of 2 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat3x2 highp_mat3x2; - } - //namespace precision - - }//namespace type - }//namespace core -} //namespace glm +namespace core{ +namespace type{ +namespace precision +{ + //! 3 columns of 2 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x2 lowp_mat3x2; + //! 3 columns of 2 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x2 mediump_mat3x2; + //! 3 columns of 2 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x2 highp_mat3x2; +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat3x2.inl" diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp index 4f47eb7a..50965d8d 100644 --- a/glm/core/type_mat3x3.hpp +++ b/glm/core/type_mat3x3.hpp @@ -12,277 +12,269 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! \brief Template for 3 * 3 matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat3x3 { - void main_mat3x3(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec3 col_type; + typedef tvec3 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat3x3 type; + typedef tmat3x3 transpose_type; - //! \brief Template for 3 * 3 matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat3x3 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec3 col_type; - typedef tvec3 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + public: + // Implementation detail + GLM_FUNC_DECL tmat3x3 _inverse() const; - typedef tmat3x3 type; - typedef tmat3x3 transpose_type; + private: + // Data + col_type value[3]; - public: - // Implementation detail - GLM_FUNC_DECL tmat3x3 _inverse() const; + public: + // Constructors + GLM_FUNC_DECL tmat3x3(); + GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); - private: - // Data - col_type value[3]; + GLM_FUNC_DECL explicit tmat3x3( + ctor Null); + GLM_FUNC_DECL explicit tmat3x3( + value_type const & s); + GLM_FUNC_DECL explicit tmat3x3( + value_type const & x0, value_type const & y0, value_type const & z0, + value_type const & x1, value_type const & y1, value_type const & z1, + value_type const & x2, value_type const & y2, value_type const & z2); + GLM_FUNC_DECL explicit tmat3x3( + col_type const & v0, + col_type const & v1, + col_type const & v2); - public: - // Constructors - GLM_FUNC_DECL tmat3x3(); - GLM_FUNC_DECL tmat3x3(tmat3x3 const & m); - - GLM_FUNC_DECL explicit tmat3x3( - ctor Null); - GLM_FUNC_DECL explicit tmat3x3( - value_type const & s); - GLM_FUNC_DECL explicit tmat3x3( - value_type const & x0, value_type const & y0, value_type const & z0, - value_type const & x1, value_type const & y1, value_type const & z1, - value_type const & x2, value_type const & y2, value_type const & z2); - GLM_FUNC_DECL explicit tmat3x3( - col_type const & v0, - col_type const & v1, - col_type const & v2); - - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat3x3( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat3x3( + U const & x); - template - < - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3 - > - GLM_FUNC_DECL explicit tmat3x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3); + template + < + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3 + > + GLM_FUNC_DECL explicit tmat3x3( + X1 const & x1, Y1 const & y1, Z1 const & z1, + X2 const & x2, Y2 const & y2, Z2 const & z2, + X3 const & x3, Y3 const & y3, Z3 const & z3); - template - GLM_FUNC_DECL explicit tmat3x3( - tvec3 const & v1, - tvec3 const & v2, - tvec3 const & v3); + template + GLM_FUNC_DECL explicit tmat3x3( + tvec3 const & v1, + tvec3 const & v2, + tvec3 const & v3); - // Matrix conversions - template - GLM_FUNC_DECL explicit tmat3x3(tmat3x3 const & m); + // Matrix conversions + template + GLM_FUNC_DECL explicit tmat3x3(tmat3x3 const & m); - GLM_FUNC_DECL explicit tmat3x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat3x3(tmat4x3 const & x); + GLM_FUNC_DECL explicit tmat3x3(tmat2x2 const & x); + GLM_FUNC_DECL explicit tmat3x3(tmat4x4 const & x); + GLM_FUNC_DECL explicit tmat3x3(tmat2x3 const & x); + GLM_FUNC_DECL explicit tmat3x3(tmat3x2 const & x); + GLM_FUNC_DECL explicit tmat3x3(tmat2x4 const & x); + GLM_FUNC_DECL explicit tmat3x3(tmat4x2 const & x); + GLM_FUNC_DECL explicit tmat3x3(tmat3x4 const & x); + GLM_FUNC_DECL explicit tmat3x3(tmat4x3 const & x); - // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + // Accesses + GLM_FUNC_DECL col_type & operator[](size_type i); + GLM_FUNC_DECL col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat3x3& operator= (tmat3x3 const & m); - template - GLM_FUNC_DECL tmat3x3& operator= (tmat3x3 const & m); - template - GLM_FUNC_DECL tmat3x3& operator+= (U const & s); - template - GLM_FUNC_DECL tmat3x3& operator+= (tmat3x3 const & m); - template - GLM_FUNC_DECL tmat3x3& operator-= (U const & s); - template - GLM_FUNC_DECL tmat3x3& operator-= (tmat3x3 const & m); - template - GLM_FUNC_DECL tmat3x3& operator*= (U const & s); - template - GLM_FUNC_DECL tmat3x3& operator*= (tmat3x3 const & m); - template - GLM_FUNC_DECL tmat3x3& operator/= (U const & s); - template - GLM_FUNC_DECL tmat3x3& operator/= (tmat3x3 const & m); - GLM_FUNC_DECL tmat3x3& operator++ (); - GLM_FUNC_DECL tmat3x3& operator-- (); - }; + // Unary updatable operators + GLM_FUNC_DECL tmat3x3& operator= (tmat3x3 const & m); + template + GLM_FUNC_DECL tmat3x3& operator= (tmat3x3 const & m); + template + GLM_FUNC_DECL tmat3x3& operator+= (U const & s); + template + GLM_FUNC_DECL tmat3x3& operator+= (tmat3x3 const & m); + template + GLM_FUNC_DECL tmat3x3& operator-= (U const & s); + template + GLM_FUNC_DECL tmat3x3& operator-= (tmat3x3 const & m); + template + GLM_FUNC_DECL tmat3x3& operator*= (U const & s); + template + GLM_FUNC_DECL tmat3x3& operator*= (tmat3x3 const & m); + template + GLM_FUNC_DECL tmat3x3& operator/= (U const & s); + template + GLM_FUNC_DECL tmat3x3& operator/= (tmat3x3 const & m); + GLM_FUNC_DECL tmat3x3& operator++ (); + GLM_FUNC_DECL tmat3x3& operator-- (); + }; - // Binary operators - template - tmat3x3 operator+ ( - tmat3x3 const & m, - typename tmat3x3::value_type const & s); + // Binary operators + template + tmat3x3 operator+ ( + tmat3x3 const & m, + typename tmat3x3::value_type const & s); - template - tmat3x3 operator+ ( - typename tmat3x3::value_type const & s, - tmat3x3 const & m); + template + tmat3x3 operator+ ( + typename tmat3x3::value_type const & s, + tmat3x3 const & m); - template - tmat3x3 operator+ ( - tmat3x3 const & m1, - tmat3x3 const & m2); + template + tmat3x3 operator+ ( + tmat3x3 const & m1, + tmat3x3 const & m2); - template - tmat3x3 operator- ( - tmat3x3 const & m, - typename tmat3x3::value_type const & s); + template + tmat3x3 operator- ( + tmat3x3 const & m, + typename tmat3x3::value_type const & s); - template - tmat3x3 operator- ( - typename tmat3x3::value_type const & s, - tmat3x3 const & m); + template + tmat3x3 operator- ( + typename tmat3x3::value_type const & s, + tmat3x3 const & m); - template - tmat3x3 operator- ( - tmat3x3 const & m1, - tmat3x3 const & m2); + template + tmat3x3 operator- ( + tmat3x3 const & m1, + tmat3x3 const & m2); - template - tmat3x3 operator* ( - tmat3x3 const & m, - typename tmat3x3::value_type const & s); + template + tmat3x3 operator* ( + tmat3x3 const & m, + typename tmat3x3::value_type const & s); - template - tmat3x3 operator* ( - typename tmat3x3::value_type const & s, - tmat3x3 const & m); + template + tmat3x3 operator* ( + typename tmat3x3::value_type const & s, + tmat3x3 const & m); - template - typename tmat3x3::col_type operator* ( - tmat3x3 const & m, - typename tmat3x3::row_type const & v); + template + typename tmat3x3::col_type operator* ( + tmat3x3 const & m, + typename tmat3x3::row_type const & v); - template - typename tmat3x3::row_type operator* ( - typename tmat3x3::col_type const & v, - tmat3x3 const & m); + template + typename tmat3x3::row_type operator* ( + typename tmat3x3::col_type const & v, + tmat3x3 const & m); - template - tmat3x3 operator* ( - tmat3x3 const & m1, - tmat3x3 const & m2); + template + tmat3x3 operator* ( + tmat3x3 const & m1, + tmat3x3 const & m2); - template - tmat3x3 operator/ ( - tmat3x3 const & m, - typename tmat3x3::value_type const & s); + template + tmat3x3 operator/ ( + tmat3x3 const & m, + typename tmat3x3::value_type const & s); - template - tmat3x3 operator/ ( - typename tmat3x3::value_type const & s, - tmat3x3 const & m); + template + tmat3x3 operator/ ( + typename tmat3x3::value_type const & s, + tmat3x3 const & m); - template - typename tmat3x3::col_type operator/ ( - tmat3x3 const & m, - typename tmat3x3::row_type const & v); + template + typename tmat3x3::col_type operator/ ( + tmat3x3 const & m, + typename tmat3x3::row_type const & v); - template - typename tmat3x3::row_type operator/ ( - typename tmat3x3::col_type const & v, - tmat3x3 const & m); + template + typename tmat3x3::row_type operator/ ( + typename tmat3x3::col_type const & v, + tmat3x3 const & m); - template - tmat3x3 operator/ ( - tmat3x3 const & m1, - tmat3x3 const & m2); + template + tmat3x3 operator/ ( + tmat3x3 const & m1, + tmat3x3 const & m2); - // Unary constant operators - template - tmat3x3 const operator- ( - tmat3x3 const & m); + // Unary constant operators + template + tmat3x3 const operator- ( + tmat3x3 const & m); - template - tmat3x3 const operator-- ( - tmat3x3 const & m, - int); + template + tmat3x3 const operator-- ( + tmat3x3 const & m, + int); - template - tmat3x3 const operator++ ( - tmat3x3 const & m, - int); + template + tmat3x3 const operator++ ( + tmat3x3 const & m, + int); - } //namespace detail +} //namespace detail - namespace core{ - namespace type{ +namespace core{ +namespace type{ +namespace precision +{ + //! 3 columns of 3 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat3x3 lowp_mat3; + //! 3 columns of 3 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat3x3 mediump_mat3; + //! 3 columns of 3 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat3x3 highp_mat3; - namespace precision - { - //! 3 columns of 3 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat3x3 lowp_mat3; - //! 3 columns of 3 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat3x3 mediump_mat3; - //! 3 columns of 3 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat3x3 highp_mat3; + //! 3 columns of 3 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat3x3 lowp_mat3x3; - //! 3 columns of 3 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat3x3 lowp_mat3x3; + //! 3 columns of 3 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat3x3 mediump_mat3x3; - //! 3 columns of 3 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat3x3 mediump_mat3x3; + //! 3 columns of 3 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat3x3 highp_mat3x3; - //! 3 columns of 3 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat3x3 highp_mat3x3; - } - //namespace precision - - }//namespace type - }//namespace core -} //namespace glm +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat3x3.inl" diff --git a/glm/core/type_mat3x4.hpp b/glm/core/type_mat3x4.hpp index 7978361e..a60d9a56 100644 --- a/glm/core/type_mat3x4.hpp +++ b/glm/core/type_mat3x4.hpp @@ -12,226 +12,218 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! \brief Template for 3 columns and 4 rows matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat3x4 { - void main_mat3x4(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec4 col_type; + typedef tvec3 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat3x4 type; + typedef tmat4x3 transpose_type; - //! \brief Template for 3 columns and 4 rows matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat3x4 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec4 col_type; - typedef tvec3 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + private: + // Data + col_type value[3]; - typedef tmat3x4 type; - typedef tmat4x3 transpose_type; + public: + // Constructors + GLM_FUNC_DECL tmat3x4(); + GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); - private: - // Data - col_type value[3]; + GLM_FUNC_DECL explicit tmat3x4( + ctor Null); + GLM_FUNC_DECL explicit tmat3x4( + value_type const & s); + GLM_FUNC_DECL explicit tmat3x4( + value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, + value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1, + value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2); + GLM_FUNC_DECL explicit tmat3x4( + col_type const & v0, + col_type const & v1, + col_type const & v2); - public: - // Constructors - GLM_FUNC_DECL tmat3x4(); - GLM_FUNC_DECL tmat3x4(tmat3x4 const & m); - - GLM_FUNC_DECL explicit tmat3x4( - ctor Null); - GLM_FUNC_DECL explicit tmat3x4( - value_type const & s); - GLM_FUNC_DECL explicit tmat3x4( - value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, - value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1, - value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2); - GLM_FUNC_DECL explicit tmat3x4( - col_type const & v0, - col_type const & v1, - col_type const & v2); - - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat3x4( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat3x4( + U const & x); - template - < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3 - > - GLM_FUNC_DECL explicit tmat3x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3); + template + < + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3 + > + GLM_FUNC_DECL explicit tmat3x4( + X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, + X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, + X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3); - template - GLM_FUNC_DECL explicit tmat3x4( - tvec4 const & v1, - tvec4 const & v2, - tvec4 const & v3); + template + GLM_FUNC_DECL explicit tmat3x4( + tvec4 const & v1, + tvec4 const & v2, + tvec4 const & v3); - // Matrix conversion - template - GLM_FUNC_DECL explicit tmat3x4(tmat3x4 const & m); + // Matrix conversion + template + GLM_FUNC_DECL explicit tmat3x4(tmat3x4 const & m); - GLM_FUNC_DECL explicit tmat3x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat3x4(tmat4x3 const & x); + GLM_FUNC_DECL explicit tmat3x4(tmat2x2 const & x); + GLM_FUNC_DECL explicit tmat3x4(tmat3x3 const & x); + GLM_FUNC_DECL explicit tmat3x4(tmat4x4 const & x); + GLM_FUNC_DECL explicit tmat3x4(tmat2x3 const & x); + GLM_FUNC_DECL explicit tmat3x4(tmat3x2 const & x); + GLM_FUNC_DECL explicit tmat3x4(tmat2x4 const & x); + GLM_FUNC_DECL explicit tmat3x4(tmat4x2 const & x); + GLM_FUNC_DECL explicit tmat3x4(tmat4x3 const & x); - // Accesses - col_type & operator[](size_type i); - col_type const & operator[](size_type i) const; + // Accesses + col_type & operator[](size_type i); + col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat3x4 & operator= (tmat3x4 const & m); - template - GLM_FUNC_DECL tmat3x4 & operator= (tmat3x4 const & m); - template - GLM_FUNC_DECL tmat3x4 & operator+= (U const & s); - template - GLM_FUNC_DECL tmat3x4 & operator+= (tmat3x4 const & m); - template - GLM_FUNC_DECL tmat3x4 & operator-= (U const & s); - template - GLM_FUNC_DECL tmat3x4 & operator-= (tmat3x4 const & m); - template - GLM_FUNC_DECL tmat3x4 & operator*= (U const & s); - template - GLM_FUNC_DECL tmat3x4 & operator*= (tmat3x4 const & m); - template - GLM_FUNC_DECL tmat3x4 & operator/= (U const & s); + // Unary updatable operators + GLM_FUNC_DECL tmat3x4 & operator= (tmat3x4 const & m); + template + GLM_FUNC_DECL tmat3x4 & operator= (tmat3x4 const & m); + template + GLM_FUNC_DECL tmat3x4 & operator+= (U const & s); + template + GLM_FUNC_DECL tmat3x4 & operator+= (tmat3x4 const & m); + template + GLM_FUNC_DECL tmat3x4 & operator-= (U const & s); + template + GLM_FUNC_DECL tmat3x4 & operator-= (tmat3x4 const & m); + template + GLM_FUNC_DECL tmat3x4 & operator*= (U const & s); + template + GLM_FUNC_DECL tmat3x4 & operator*= (tmat3x4 const & m); + template + GLM_FUNC_DECL tmat3x4 & operator/= (U const & s); - GLM_FUNC_DECL tmat3x4 & operator++ (); - GLM_FUNC_DECL tmat3x4 & operator-- (); - }; + GLM_FUNC_DECL tmat3x4 & operator++ (); + GLM_FUNC_DECL tmat3x4 & operator-- (); + }; - // Binary operators - template - tmat3x4 operator+ ( - tmat3x4 const & m, - typename tmat3x4::value_type const & s); + // Binary operators + template + tmat3x4 operator+ ( + tmat3x4 const & m, + typename tmat3x4::value_type const & s); - template - tmat3x4 operator+ ( - tmat3x4 const & m1, - tmat3x4 const & m2); + template + tmat3x4 operator+ ( + tmat3x4 const & m1, + tmat3x4 const & m2); - template - tmat3x4 operator- ( - tmat3x4 const & m, - typename tmat3x4::value_type const & s); + template + tmat3x4 operator- ( + tmat3x4 const & m, + typename tmat3x4::value_type const & s); - template - tmat3x4 operator- ( - tmat3x4 const & m1, - tmat3x4 const & m2); + template + tmat3x4 operator- ( + tmat3x4 const & m1, + tmat3x4 const & m2); - template - tmat3x4 operator* ( - tmat3x4 const & m, - typename tmat3x4::value_type const & s); + template + tmat3x4 operator* ( + tmat3x4 const & m, + typename tmat3x4::value_type const & s); - template - tmat3x4 operator* ( - typename tmat3x4::value_type const & s, - tmat3x4 const & m); + template + tmat3x4 operator* ( + typename tmat3x4::value_type const & s, + tmat3x4 const & m); - template - typename tmat3x4::col_type operator* ( - tmat3x4 const & m, - typename tmat3x4::row_type const & v); + template + typename tmat3x4::col_type operator* ( + tmat3x4 const & m, + typename tmat3x4::row_type const & v); - template - typename tmat3x4::row_type operator* ( - typename tmat3x4::col_type const & v, - tmat3x4 const & m); + template + typename tmat3x4::row_type operator* ( + typename tmat3x4::col_type const & v, + tmat3x4 const & m); - template - tmat4x4 operator* ( - tmat3x4 const & m1, - tmat4x3 const & m2); + template + tmat4x4 operator* ( + tmat3x4 const & m1, + tmat4x3 const & m2); - template - tmat3x4 operator/ ( - tmat3x4 const & m, - typename tmat3x4::value_type const & s); + template + tmat3x4 operator/ ( + tmat3x4 const & m, + typename tmat3x4::value_type const & s); - template - tmat3x4 operator/ ( - typename tmat3x4::value_type const & s, - tmat3x4 const & m); + template + tmat3x4 operator/ ( + typename tmat3x4::value_type const & s, + tmat3x4 const & m); - // Unary constant operators - template - tmat3x4 const operator- ( - tmat3x4 const & m); + // Unary constant operators + template + tmat3x4 const operator- ( + tmat3x4 const & m); - template - tmat3x4 const operator-- ( - tmat3x4 const & m, - int); + template + tmat3x4 const operator-- ( + tmat3x4 const & m, + int); - template - tmat3x4 const operator++ ( - tmat3x4 const & m, - int); + template + tmat3x4 const operator++ ( + tmat3x4 const & m, + int); - } //namespace detail +}//namespace detail - namespace core{ - namespace type{ +namespace core{ +namespace type{ +namespace precision +{ + //! 3 columns of 4 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x4 lowp_mat3x4; + //! 3 columns of 4 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x4 mediump_mat3x4; + //! 3 columns of 4 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + typedef detail::tmat3x4 highp_mat3x4; - namespace precision - { - //! 3 columns of 4 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat3x4 lowp_mat3x4; - //! 3 columns of 4 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat3x4 mediump_mat3x4; - //! 3 columns of 4 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - typedef detail::tmat3x4 highp_mat3x4; - } - //namespace precision - - }//namespace type - }//namespace core -} //namespace glm +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat3x4.inl" diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp index 67c5b2b2..0b003aa0 100644 --- a/glm/core/type_mat4x2.hpp +++ b/glm/core/type_mat4x2.hpp @@ -12,234 +12,228 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! \brief Template for 4 columns and 2 rows matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat4x2 { - void main_mat4x2(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec2 col_type; + typedef tvec4 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat4x2 type; + typedef tmat2x4 transpose_type; - //! \brief Template for 4 columns and 2 rows matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat4x2 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec2 col_type; - typedef tvec4 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + private: + // Data + col_type value[4]; - typedef tmat4x2 type; - typedef tmat2x4 transpose_type; + public: + // Constructors + GLM_FUNC_DECL tmat4x2(); + GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); - private: - // Data - col_type value[4]; - - public: - // Constructors - GLM_FUNC_DECL tmat4x2(); - GLM_FUNC_DECL tmat4x2(tmat4x2 const & m); - - GLM_FUNC_DECL explicit tmat4x2( - ctor Null); - GLM_FUNC_DECL explicit tmat4x2( - value_type const & x); - GLM_FUNC_DECL explicit tmat4x2( - value_type const & x0, value_type const & y0, - value_type const & x1, value_type const & y1, - value_type const & x2, value_type const & y2, - value_type const & x3, value_type const & y3); - GLM_FUNC_DECL explicit tmat4x2( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3); + GLM_FUNC_DECL explicit tmat4x2( + ctor Null); + GLM_FUNC_DECL explicit tmat4x2( + value_type const & x); + GLM_FUNC_DECL explicit tmat4x2( + value_type const & x0, value_type const & y0, + value_type const & x1, value_type const & y1, + value_type const & x2, value_type const & y2, + value_type const & x3, value_type const & y3); + GLM_FUNC_DECL explicit tmat4x2( + col_type const & v0, + col_type const & v1, + col_type const & v2, + col_type const & v3); - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat4x2( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat4x2( + U const & x); - template - < - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3, - typename X4, typename Y4 - > - GLM_FUNC_DECL explicit tmat4x2( - X1 const & x1, Y1 const & y1, - X2 const & x2, Y2 const & y2, - X3 const & x3, Y3 const & y3, - X4 const & x4, Y4 const & y4); + template + < + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3, + typename X4, typename Y4 + > + GLM_FUNC_DECL explicit tmat4x2( + X1 const & x1, Y1 const & y1, + X2 const & x2, Y2 const & y2, + X3 const & x3, Y3 const & y3, + X4 const & x4, Y4 const & y4); - template - GLM_FUNC_DECL explicit tmat4x2( - tvec2 const & v1, - tvec2 const & v2, - tvec2 const & v3, - tvec2 const & v4); + template + GLM_FUNC_DECL explicit tmat4x2( + tvec2 const & v1, + tvec2 const & v2, + tvec2 const & v3, + tvec2 const & v4); - // Matrix conversions - template - GLM_FUNC_DECL explicit tmat4x2(tmat4x2 const & m); + // Matrix conversions + template + GLM_FUNC_DECL explicit tmat4x2(tmat4x2 const & m); - GLM_FUNC_DECL explicit tmat4x2(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat4x3 const & x); - GLM_FUNC_DECL explicit tmat4x2(tmat3x4 const & x); + GLM_FUNC_DECL explicit tmat4x2(tmat2x2 const & x); + GLM_FUNC_DECL explicit tmat4x2(tmat3x3 const & x); + GLM_FUNC_DECL explicit tmat4x2(tmat4x4 const & x); + GLM_FUNC_DECL explicit tmat4x2(tmat2x3 const & x); + GLM_FUNC_DECL explicit tmat4x2(tmat3x2 const & x); + GLM_FUNC_DECL explicit tmat4x2(tmat2x4 const & x); + GLM_FUNC_DECL explicit tmat4x2(tmat4x3 const & x); + GLM_FUNC_DECL explicit tmat4x2(tmat3x4 const & x); - // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + // Accesses + GLM_FUNC_DECL col_type & operator[](size_type i); + GLM_FUNC_DECL col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat4x2& operator= (tmat4x2 const & m); - template - GLM_FUNC_DECL tmat4x2& operator= (tmat4x2 const & m); - template - GLM_FUNC_DECL tmat4x2& operator+= (U const & s); - template - GLM_FUNC_DECL tmat4x2& operator+= (tmat4x2 const & m); - template - GLM_FUNC_DECL tmat4x2& operator-= (U const & s); - template - GLM_FUNC_DECL tmat4x2& operator-= (tmat4x2 const & m); - template - GLM_FUNC_DECL tmat4x2& operator*= (U const & s); - template - GLM_FUNC_DECL tmat4x2& operator*= (tmat4x2 const & m); - template - GLM_FUNC_DECL tmat4x2& operator/= (U const & s); + // Unary updatable operators + GLM_FUNC_DECL tmat4x2& operator= (tmat4x2 const & m); + template + GLM_FUNC_DECL tmat4x2& operator= (tmat4x2 const & m); + template + GLM_FUNC_DECL tmat4x2& operator+= (U const & s); + template + GLM_FUNC_DECL tmat4x2& operator+= (tmat4x2 const & m); + template + GLM_FUNC_DECL tmat4x2& operator-= (U const & s); + template + GLM_FUNC_DECL tmat4x2& operator-= (tmat4x2 const & m); + template + GLM_FUNC_DECL tmat4x2& operator*= (U const & s); + template + GLM_FUNC_DECL tmat4x2& operator*= (tmat4x2 const & m); + template + GLM_FUNC_DECL tmat4x2& operator/= (U const & s); - GLM_FUNC_DECL tmat4x2& operator++ (); - GLM_FUNC_DECL tmat4x2& operator-- (); - }; + GLM_FUNC_DECL tmat4x2& operator++ (); + GLM_FUNC_DECL tmat4x2& operator-- (); + }; - // Binary operators - template - tmat4x2 operator+ ( - tmat4x2 const & m, - typename tmat4x2::value_type const & s); + // Binary operators + template + tmat4x2 operator+ ( + tmat4x2 const & m, + typename tmat4x2::value_type const & s); - template - tmat4x2 operator+ ( - tmat4x2 const & m1, - tmat4x2 const & m2); + template + tmat4x2 operator+ ( + tmat4x2 const & m1, + tmat4x2 const & m2); - template - tmat4x2 operator- ( - tmat4x2 const & m, - typename tmat4x2::value_type const & s); + template + tmat4x2 operator- ( + tmat4x2 const & m, + typename tmat4x2::value_type const & s); - template - tmat4x2 operator- ( - tmat4x2 const & m1, - tmat4x2 const & m2); + template + tmat4x2 operator- ( + tmat4x2 const & m1, + tmat4x2 const & m2); - template - tmat4x2 operator* ( - tmat4x2 const & m, - typename tmat4x2::value_type const & s); + template + tmat4x2 operator* ( + tmat4x2 const & m, + typename tmat4x2::value_type const & s); - template - tmat4x2 operator* ( - typename tmat4x2::value_type const & s, - tmat4x2 const & m); + template + tmat4x2 operator* ( + typename tmat4x2::value_type const & s, + tmat4x2 const & m); - template - typename tmat4x2::col_type operator* ( - tmat4x2 const & m, - typename tmat4x2::row_type const & v); + template + typename tmat4x2::col_type operator* ( + tmat4x2 const & m, + typename tmat4x2::row_type const & v); - template - typename tmat4x2::row_type operator* ( - typename tmat4x2::col_type const & v, - tmat4x2 const & m); + template + typename tmat4x2::row_type operator* ( + typename tmat4x2::col_type const & v, + tmat4x2 const & m); - template - tmat2x2 operator* ( - tmat4x2 const & m1, - tmat2x4 const & m2); + template + tmat2x2 operator* ( + tmat4x2 const & m1, + tmat2x4 const & m2); - template - tmat4x2 operator/ ( - tmat4x2 const & m, - typename tmat4x2::value_type const & s); + template + tmat4x2 operator/ ( + tmat4x2 const & m, + typename tmat4x2::value_type const & s); - template - tmat4x2 operator/ ( - typename tmat4x2::value_type const & s, - tmat4x2 const & m); + template + tmat4x2 operator/ ( + typename tmat4x2::value_type const & s, + tmat4x2 const & m); - // Unary constant operators - template - tmat4x2 const operator- ( - tmat4x2 const & m); + // Unary constant operators + template + tmat4x2 const operator- ( + tmat4x2 const & m); - template - tmat4x2 const operator-- ( - tmat4x2 const & m, - int); + template + tmat4x2 const operator-- ( + tmat4x2 const & m, + int); - template - tmat4x2 const operator++ ( - tmat4x2 const & m, - int); + template + tmat4x2 const operator++ ( + tmat4x2 const & m, + int); - } //namespace detail +} //namespace detail - namespace core{ - namespace type{ +namespace core{ +namespace type{ +namespace precision +{ + //! 4 columns of 2 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat4x2 lowp_mat4x2; - namespace precision - { - //! 4 columns of 2 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat4x2 lowp_mat4x2; - //! 4 columns of 2 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat4x2 mediump_mat4x2; - //! 4 columns of 2 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat4x2 highp_mat4x2; - } - //namespace precision + //! 4 columns of 2 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat4x2 mediump_mat4x2; - }//namespace type - }//namespace core -} //namespace glm + //! 4 columns of 2 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat4x2 highp_mat4x2; + +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat4x2.inl" diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp index 3876150b..1f295160 100644 --- a/glm/core/type_mat4x3.hpp +++ b/glm/core/type_mat4x3.hpp @@ -12,235 +12,229 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! \brief Template for 4 columns and 3 rows matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat4x3 { - void main_mat4x3(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec3 col_type; + typedef tvec4 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat4x3 type; + typedef tmat3x4 transpose_type; - //! \brief Template for 4 columns and 3 rows matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat4x3 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec3 col_type; - typedef tvec4 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + private: + // Data + col_type value[4]; - typedef tmat4x3 type; - typedef tmat3x4 transpose_type; + public: + // Constructors + GLM_FUNC_DECL tmat4x3(); + GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); - private: - // Data - col_type value[4]; - - public: - // Constructors - GLM_FUNC_DECL tmat4x3(); - GLM_FUNC_DECL tmat4x3(tmat4x3 const & m); - - GLM_FUNC_DECL explicit tmat4x3( - ctor Null); - GLM_FUNC_DECL explicit tmat4x3( - value_type const & x); - GLM_FUNC_DECL explicit tmat4x3( - value_type const & x0, value_type const & y0, value_type const & z0, - value_type const & x1, value_type const & y1, value_type const & z1, - value_type const & x2, value_type const & y2, value_type const & z2, - value_type const & x3, value_type const & y3, value_type const & z3); - GLM_FUNC_DECL explicit tmat4x3( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3); + GLM_FUNC_DECL explicit tmat4x3( + ctor Null); + GLM_FUNC_DECL explicit tmat4x3( + value_type const & x); + GLM_FUNC_DECL explicit tmat4x3( + value_type const & x0, value_type const & y0, value_type const & z0, + value_type const & x1, value_type const & y1, value_type const & z1, + value_type const & x2, value_type const & y2, value_type const & z2, + value_type const & x3, value_type const & y3, value_type const & z3); + GLM_FUNC_DECL explicit tmat4x3( + col_type const & v0, + col_type const & v1, + col_type const & v2, + col_type const & v3); - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat4x3( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat4x3( + U const & x); - template < - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3, - typename X4, typename Y4, typename Z4> - GLM_FUNC_DECL explicit tmat4x3( - X1 const & x1, Y1 const & y1, Z1 const & z1, - X2 const & x2, Y2 const & y2, Z2 const & z2, - X3 const & x3, Y3 const & y3, Z3 const & z3, - X4 const & x4, Y4 const & y4, Z4 const & z4); + template < + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3, + typename X4, typename Y4, typename Z4> + GLM_FUNC_DECL explicit tmat4x3( + X1 const & x1, Y1 const & y1, Z1 const & z1, + X2 const & x2, Y2 const & y2, Z2 const & z2, + X3 const & x3, Y3 const & y3, Z3 const & z3, + X4 const & x4, Y4 const & y4, Z4 const & z4); - template - GLM_FUNC_DECL explicit tmat4x3( - tvec3 const & v1, - tvec3 const & v2, - tvec3 const & v3, - tvec3 const & v4); + template + GLM_FUNC_DECL explicit tmat4x3( + tvec3 const & v1, + tvec3 const & v2, + tvec3 const & v3, + tvec3 const & v4); - // Matrix conversions - template - GLM_FUNC_DECL explicit tmat4x3(tmat4x3 const & m); + // Matrix conversions + template + GLM_FUNC_DECL explicit tmat4x3(tmat4x3 const & m); - GLM_FUNC_DECL explicit tmat4x3(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat4x4 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat4x3(tmat3x4 const & x); + GLM_FUNC_DECL explicit tmat4x3(tmat2x2 const & x); + GLM_FUNC_DECL explicit tmat4x3(tmat3x3 const & x); + GLM_FUNC_DECL explicit tmat4x3(tmat4x4 const & x); + GLM_FUNC_DECL explicit tmat4x3(tmat2x3 const & x); + GLM_FUNC_DECL explicit tmat4x3(tmat3x2 const & x); + GLM_FUNC_DECL explicit tmat4x3(tmat2x4 const & x); + GLM_FUNC_DECL explicit tmat4x3(tmat4x2 const & x); + GLM_FUNC_DECL explicit tmat4x3(tmat3x4 const & x); - // Accesses - col_type & operator[](size_type i); - col_type const & operator[](size_type i) const; + // Accesses + col_type & operator[](size_type i); + col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat4x3 & operator= (tmat4x3 const & m); - template - GLM_FUNC_DECL tmat4x3 & operator= (tmat4x3 const & m); - template - GLM_FUNC_DECL tmat4x3 & operator+= (U const & s); - template - GLM_FUNC_DECL tmat4x3 & operator+= (tmat4x3 const & m); - template - GLM_FUNC_DECL tmat4x3 & operator-= (U const & s); - template - GLM_FUNC_DECL tmat4x3 & operator-= (tmat4x3 const & m); - template - GLM_FUNC_DECL tmat4x3 & operator*= (U const & s); - template - GLM_FUNC_DECL tmat4x3 & operator*= (tmat4x3 const & m); - template - GLM_FUNC_DECL tmat4x3 & operator/= (U const & s); + // Unary updatable operators + GLM_FUNC_DECL tmat4x3 & operator= (tmat4x3 const & m); + template + GLM_FUNC_DECL tmat4x3 & operator= (tmat4x3 const & m); + template + GLM_FUNC_DECL tmat4x3 & operator+= (U const & s); + template + GLM_FUNC_DECL tmat4x3 & operator+= (tmat4x3 const & m); + template + GLM_FUNC_DECL tmat4x3 & operator-= (U const & s); + template + GLM_FUNC_DECL tmat4x3 & operator-= (tmat4x3 const & m); + template + GLM_FUNC_DECL tmat4x3 & operator*= (U const & s); + template + GLM_FUNC_DECL tmat4x3 & operator*= (tmat4x3 const & m); + template + GLM_FUNC_DECL tmat4x3 & operator/= (U const & s); - GLM_FUNC_DECL tmat4x3 & operator++ (); - GLM_FUNC_DECL tmat4x3 & operator-- (); - }; + GLM_FUNC_DECL tmat4x3 & operator++ (); + GLM_FUNC_DECL tmat4x3 & operator-- (); + }; - // Binary operators - template - tmat4x3 operator+ ( - tmat4x3 const & m, - typename tmat4x3::value_type const & s); + // Binary operators + template + tmat4x3 operator+ ( + tmat4x3 const & m, + typename tmat4x3::value_type const & s); - template - tmat4x3 operator+ ( - tmat4x3 const & m1, - tmat4x3 const & m2); + template + tmat4x3 operator+ ( + tmat4x3 const & m1, + tmat4x3 const & m2); - template - tmat4x3 operator- ( - tmat4x3 const & m, - typename tmat4x3::value_type const & s); + template + tmat4x3 operator- ( + tmat4x3 const & m, + typename tmat4x3::value_type const & s); - template - tmat4x3 operator- ( - tmat4x3 const & m1, - tmat4x3 const & m2); + template + tmat4x3 operator- ( + tmat4x3 const & m1, + tmat4x3 const & m2); - template - tmat4x3 operator* ( - tmat4x3 const & m, - typename tmat4x3::value_type const & s); + template + tmat4x3 operator* ( + tmat4x3 const & m, + typename tmat4x3::value_type const & s); - template - tmat4x3 operator* ( - typename tmat4x3::value_type const & s, - tmat4x3 const & m); + template + tmat4x3 operator* ( + typename tmat4x3::value_type const & s, + tmat4x3 const & m); - template - typename tmat4x3::col_type operator* ( - tmat4x3 const & m, - typename tmat4x3::row_type const & v); + template + typename tmat4x3::col_type operator* ( + tmat4x3 const & m, + typename tmat4x3::row_type const & v); - template - typename tmat4x3::row_type operator* ( - typename tmat4x3::col_type const & v, - tmat4x3 const & m); + template + typename tmat4x3::row_type operator* ( + typename tmat4x3::col_type const & v, + tmat4x3 const & m); - template - tmat3x3 operator* ( - tmat4x3 const & m1, - tmat3x4 const & m2); + template + tmat3x3 operator* ( + tmat4x3 const & m1, + tmat3x4 const & m2); - template - tmat4x3 operator/ ( - tmat4x3 const & m, - typename tmat4x3::value_type const & s); + template + tmat4x3 operator/ ( + tmat4x3 const & m, + typename tmat4x3::value_type const & s); - template - tmat4x3 operator/ ( - typename tmat4x3::value_type const & s, - tmat4x3 const & m); + template + tmat4x3 operator/ ( + typename tmat4x3::value_type const & s, + tmat4x3 const & m); - // Unary constant operators - template - tmat4x3 const operator- ( - tmat4x3 const & m); + // Unary constant operators + template + tmat4x3 const operator- ( + tmat4x3 const & m); - template - tmat4x3 const operator-- ( - tmat4x3 const & m, - int); + template + tmat4x3 const operator-- ( + tmat4x3 const & m, + int); - template - tmat4x3 const operator++ ( - tmat4x3 const & m, - int); + template + tmat4x3 const operator++ ( + tmat4x3 const & m, + int); - } //namespace detail +}//namespace detail - namespace core{ - namespace type{ +namespace core{ +namespace type{ +namespace precision +{ + //! 4 columns of 3 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat4x3 lowp_mat4x3; - namespace precision - { - //! 4 columns of 3 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat4x3 lowp_mat4x3; - //! 4 columns of 3 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat4x3 mediump_mat4x3; - //! 4 columns of 3 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) - //! \ingroup core_precision - typedef detail::tmat4x3 highp_mat4x3; - } - //namespace precision + //! 4 columns of 3 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat4x3 mediump_mat4x3; - }//namespace type - }//namespace core -} //namespace glm + //! 4 columns of 3 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers) + //! \ingroup core_precision + typedef detail::tmat4x3 highp_mat4x3; + +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat4x3.inl" -#endif +#endif //GLM_EXTERNAL_TEMPLATE #endif//glm_core_type_mat4x3 diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp index 4ff29db9..705ce8c2 100644 --- a/glm/core/type_mat4x4.hpp +++ b/glm/core/type_mat4x4.hpp @@ -2,7 +2,7 @@ // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2005-01-27 -// Updated : 2008-08-30 +// Updated : 2011-06-02 // Licence : This source is under MIT License // File : glm/core/type_mat4x4.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -12,283 +12,275 @@ #include "type_mat.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + template struct tmat2x2; + template struct tmat2x3; + template struct tmat2x4; + template struct tmat3x2; + template struct tmat3x3; + template struct tmat3x4; + template struct tmat4x2; + template struct tmat4x3; + template struct tmat4x4; + + //! \brief Template for 4 * 4 matrix of floating-point numbers. + //! \ingroup core_template + template + struct tmat4x4 { - void main_mat4x4(); - }//namespace test + enum ctor{null}; + typedef T value_type; + typedef std::size_t size_type; + typedef tvec4 col_type; + typedef tvec4 row_type; + static GLM_FUNC_DECL size_type col_size(); + static GLM_FUNC_DECL size_type row_size(); - namespace detail - { - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; - template struct tmat2x2; - template struct tmat2x3; - template struct tmat2x4; - template struct tmat3x2; - template struct tmat3x3; - template struct tmat3x4; - template struct tmat4x2; - template struct tmat4x3; - template struct tmat4x4; + typedef tmat4x4 type; + typedef tmat4x4 transpose_type; - //! \brief Template for 4 * 4 matrix of floating-point numbers. - //! \ingroup core_template - template - struct tmat4x4 - { - enum ctor{null}; - typedef T value_type; - typedef std::size_t size_type; - typedef tvec4 col_type; - typedef tvec4 row_type; - static GLM_FUNC_DECL size_type col_size(); - static GLM_FUNC_DECL size_type row_size(); + public: + // Implementation detail + GLM_FUNC_DECL tmat4x4 _inverse() const; - typedef tmat4x4 type; - typedef tmat4x4 transpose_type; + private: + // Data + col_type value[4]; - public: - // Implementation detail - GLM_FUNC_DECL tmat4x4 _inverse() const; + public: + // Constructors + GLM_FUNC_DECL tmat4x4(); + GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); - private: - // Data - col_type value[4]; + GLM_FUNC_DECL explicit tmat4x4( + ctor Null); + GLM_FUNC_DECL explicit tmat4x4( + value_type const & x); + GLM_FUNC_DECL explicit tmat4x4( + value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, + value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1, + value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2, + value_type const & x3, value_type const & y3, value_type const & z3, value_type const & w3); + GLM_FUNC_DECL explicit tmat4x4( + col_type const & v0, + col_type const & v1, + col_type const & v2, + col_type const & v3); - public: - // Constructors - GLM_FUNC_DECL tmat4x4(); - GLM_FUNC_DECL tmat4x4(tmat4x4 const & m); - - GLM_FUNC_DECL explicit tmat4x4( - ctor Null); - GLM_FUNC_DECL explicit tmat4x4( - value_type const & x); - GLM_FUNC_DECL explicit tmat4x4( - value_type const & x0, value_type const & y0, value_type const & z0, value_type const & w0, - value_type const & x1, value_type const & y1, value_type const & z1, value_type const & w1, - value_type const & x2, value_type const & y2, value_type const & z2, value_type const & w2, - value_type const & x3, value_type const & y3, value_type const & z3, value_type const & w3); - GLM_FUNC_DECL explicit tmat4x4( - col_type const & v0, - col_type const & v1, - col_type const & v2, - col_type const & v3); - - ////////////////////////////////////// - // Conversions - template - GLM_FUNC_DECL explicit tmat4x4( - U const & x); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat4x4( + U const & x); - template < - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3, - typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_DECL explicit tmat4x4( - X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, - X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, - X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, - X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4); + template < + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3, + typename X4, typename Y4, typename Z4, typename W4> + GLM_FUNC_DECL explicit tmat4x4( + X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1, + X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2, + X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, + X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4); - template - GLM_FUNC_DECL explicit tmat4x4( - tvec4 const & v1, - tvec4 const & v2, - tvec4 const & v3, - tvec4 const & v4); + template + GLM_FUNC_DECL explicit tmat4x4( + tvec4 const & v1, + tvec4 const & v2, + tvec4 const & v3, + tvec4 const & v4); - // Matrix conversions - template - GLM_FUNC_DECL explicit tmat4x4(tmat4x4 const & m); + // Matrix conversions + template + GLM_FUNC_DECL explicit tmat4x4(tmat4x4 const & m); - GLM_FUNC_DECL explicit tmat4x4(tmat2x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x3 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat2x3 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat2x4 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat4x2 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat3x4 const & x); - GLM_FUNC_DECL explicit tmat4x4(tmat4x3 const & x); + GLM_FUNC_DECL explicit tmat4x4(tmat2x2 const & x); + GLM_FUNC_DECL explicit tmat4x4(tmat3x3 const & x); + GLM_FUNC_DECL explicit tmat4x4(tmat2x3 const & x); + GLM_FUNC_DECL explicit tmat4x4(tmat3x2 const & x); + GLM_FUNC_DECL explicit tmat4x4(tmat2x4 const & x); + GLM_FUNC_DECL explicit tmat4x4(tmat4x2 const & x); + GLM_FUNC_DECL explicit tmat4x4(tmat3x4 const & x); + GLM_FUNC_DECL explicit tmat4x4(tmat4x3 const & x); - // Accesses - GLM_FUNC_DECL col_type & operator[](size_type i); - GLM_FUNC_DECL col_type const & operator[](size_type i) const; + // Accesses + GLM_FUNC_DECL col_type & operator[](size_type i); + GLM_FUNC_DECL col_type const & operator[](size_type i) const; - // Unary updatable operators - GLM_FUNC_DECL tmat4x4 & operator= (tmat4x4 const & m); - template - GLM_FUNC_DECL tmat4x4 & operator= (tmat4x4 const & m); - template - GLM_FUNC_DECL tmat4x4 & operator+= (U const & s); - template - GLM_FUNC_DECL tmat4x4 & operator+= (tmat4x4 const & m); - template - GLM_FUNC_DECL tmat4x4 & operator-= (U const & s); - template - GLM_FUNC_DECL tmat4x4 & operator-= (tmat4x4 const & m); - template - GLM_FUNC_DECL tmat4x4 & operator*= (U const & s); - template - GLM_FUNC_DECL tmat4x4 & operator*= (tmat4x4 const & m); - template - GLM_FUNC_DECL tmat4x4 & operator/= (U const & s); - template - GLM_FUNC_DECL tmat4x4 & operator/= (tmat4x4 const & m); - GLM_FUNC_DECL tmat4x4 & operator++ (); - GLM_FUNC_DECL tmat4x4 & operator-- (); - }; + // Unary updatable operators + GLM_FUNC_DECL tmat4x4 & operator= (tmat4x4 const & m); + template + GLM_FUNC_DECL tmat4x4 & operator= (tmat4x4 const & m); + template + GLM_FUNC_DECL tmat4x4 & operator+= (U const & s); + template + GLM_FUNC_DECL tmat4x4 & operator+= (tmat4x4 const & m); + template + GLM_FUNC_DECL tmat4x4 & operator-= (U const & s); + template + GLM_FUNC_DECL tmat4x4 & operator-= (tmat4x4 const & m); + template + GLM_FUNC_DECL tmat4x4 & operator*= (U const & s); + template + GLM_FUNC_DECL tmat4x4 & operator*= (tmat4x4 const & m); + template + GLM_FUNC_DECL tmat4x4 & operator/= (U const & s); + template + GLM_FUNC_DECL tmat4x4 & operator/= (tmat4x4 const & m); + GLM_FUNC_DECL tmat4x4 & operator++ (); + GLM_FUNC_DECL tmat4x4 & operator-- (); + }; - // Binary operators - template - tmat4x4 operator+ ( - tmat4x4 const & m, - typename tmat4x4::value_type const & s); + // Binary operators + template + tmat4x4 operator+ ( + tmat4x4 const & m, + typename tmat4x4::value_type const & s); - template - tmat4x4 operator+ ( - typename tmat4x4::value_type const & s, - tmat4x4 const & m); + template + tmat4x4 operator+ ( + typename tmat4x4::value_type const & s, + tmat4x4 const & m); - template - tmat4x4 operator+ ( - tmat4x4 const & m1, - tmat4x4 const & m2); + template + tmat4x4 operator+ ( + tmat4x4 const & m1, + tmat4x4 const & m2); - template - tmat4x4 operator- ( - tmat4x4 const & m, - typename tmat4x4::value_type const & s); + template + tmat4x4 operator- ( + tmat4x4 const & m, + typename tmat4x4::value_type const & s); - template - tmat4x4 operator- ( - typename tmat4x4::value_type const & s, - tmat4x4 const & m); + template + tmat4x4 operator- ( + typename tmat4x4::value_type const & s, + tmat4x4 const & m); - template - tmat4x4 operator- ( - tmat4x4 const & m1, - tmat4x4 const & m2); + template + tmat4x4 operator- ( + tmat4x4 const & m1, + tmat4x4 const & m2); - template - tmat4x4 operator* ( - tmat4x4 const & m, - typename tmat4x4::value_type const & s); + template + tmat4x4 operator* ( + tmat4x4 const & m, + typename tmat4x4::value_type const & s); - template - tmat4x4 operator* ( - typename tmat4x4::value_type const & s, - tmat4x4 const & m); + template + tmat4x4 operator* ( + typename tmat4x4::value_type const & s, + tmat4x4 const & m); - template - typename tmat4x4::col_type operator* ( - tmat4x4 const & m, - typename tmat4x4::row_type const & v); + template + typename tmat4x4::col_type operator* ( + tmat4x4 const & m, + typename tmat4x4::row_type const & v); - template - typename tmat4x4::row_type operator* ( - typename tmat4x4::col_type const & v, - tmat4x4 const & m); + template + typename tmat4x4::row_type operator* ( + typename tmat4x4::col_type const & v, + tmat4x4 const & m); - template - tmat4x4 operator* ( - tmat4x4 const & m1, - tmat4x4 const & m2); + template + tmat4x4 operator* ( + tmat4x4 const & m1, + tmat4x4 const & m2); - template - tmat4x4 operator/ ( - tmat4x4 const & m, - typename tmat4x4::value_type const & s); + template + tmat4x4 operator/ ( + tmat4x4 const & m, + typename tmat4x4::value_type const & s); - template - tmat4x4 operator/ ( - typename tmat4x4::value_type const & s, - tmat4x4 const & m); + template + tmat4x4 operator/ ( + typename tmat4x4::value_type const & s, + tmat4x4 const & m); - template - typename tmat4x4::col_type operator/ ( - tmat4x4 const & m, - typename tmat4x4::row_type const & v); + template + typename tmat4x4::col_type operator/ ( + tmat4x4 const & m, + typename tmat4x4::row_type const & v); - template - typename tmat4x4::row_type operator/ ( - typename tmat4x4::col_type & v, - tmat4x4 const & m); + template + typename tmat4x4::row_type operator/ ( + typename tmat4x4::col_type & v, + tmat4x4 const & m); - template - tmat4x4 operator/ ( - tmat4x4 const & m1, - tmat4x4 const & m2); + template + tmat4x4 operator/ ( + tmat4x4 const & m1, + tmat4x4 const & m2); - // Unary constant operators - template - tmat4x4 const operator- ( - tmat4x4 const & m); + // Unary constant operators + template + tmat4x4 const operator- ( + tmat4x4 const & m); - template - tmat4x4 const operator-- ( - tmat4x4 const & m, int); + template + tmat4x4 const operator-- ( + tmat4x4 const & m, int); - template - tmat4x4 const operator++ ( - tmat4x4 const & m, int); + template + tmat4x4 const operator++ ( + tmat4x4 const & m, int); - } //namespace detail +} //namespace detail - namespace core{ - namespace type{ +namespace core{ +namespace type{ +namespace precision +{ + //! 4 columns of 4 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat4x4 lowp_mat4; - namespace precision - { - //! 4 columns of 4 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat4x4 lowp_mat4; + //! 4 columns of 4 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat4x4 mediump_mat4; - //! 4 columns of 4 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat4x4 mediump_mat4; + //! 4 columns of 4 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat4x4 highp_mat4; - //! 4 columns of 4 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat4x4 highp_mat4; + //! 4 columns of 4 components matrix of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat4x4 lowp_mat4x4; - //! 4 columns of 4 components matrix of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat4x4 lowp_mat4x4; + //! 4 columns of 4 components matrix of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat4x4 mediump_mat4x4; - //! 4 columns of 4 components matrix of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat4x4 mediump_mat4x4; + //! 4 columns of 4 components matrix of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers + //! \ingroup core_precision + typedef detail::tmat4x4 highp_mat4x4; - //! 4 columns of 4 components matrix of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers - //! \ingroup core_precision - typedef detail::tmat4x4 highp_mat4x4; - } - //namespace precision - - }//namespace type - }//namespace core -} //namespace glm +}//namespace precision +}//namespace type +}//namespace core +}//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_mat4x4.inl" -#endif +#endif//GLM_EXTERNAL_TEMPLATE -#endif //glm_core_type_mat4x4 +#endif//glm_core_type_mat4x4 diff --git a/glm/core/type_vec1.hpp b/glm/core/type_vec1.hpp index ffd8da1c..ac8bf919 100644 --- a/glm/core/type_vec1.hpp +++ b/glm/core/type_vec1.hpp @@ -16,39 +16,33 @@ #include "type_size.hpp" #include "_swizzle.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tref1; + template struct tref2; + template struct tref3; + template struct tref4; + template struct tvec1; + template struct tvec2; + template struct tvec3; + template struct tvec4; + + template + struct tvec1 { - void main_vec1(); - }//namespace test + enum ctor{null}; - namespace detail - { - template struct tref1; - template struct tref2; - template struct tref3; - template struct tref4; - template struct tvec1; - template struct tvec2; - template struct tvec3; - template struct tvec4; + 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(); - template - struct tvec1 - { - enum ctor{null}; + typedef tvec1 type; + typedef tvec1 bool_type; - 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; - typedef tvec1 bool_type; - - ////////////////////////////////////// - // Data + ////////////////////////////////////// + // Data # if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) value_type x; @@ -56,123 +50,123 @@ namespace glm union {value_type x, r, s;}; # endif//GLM_COMPONENT - ////////////////////////////////////// - // Accesses + ////////////////////////////////////// + // Accesses - GLM_FUNC_DECL value_type & operator[](size_type i); - GLM_FUNC_DECL value_type const & operator[](size_type i) const; + GLM_FUNC_DECL value_type & operator[](size_type i); + GLM_FUNC_DECL value_type const & operator[](size_type i) const; - ////////////////////////////////////// - // Implicit basic constructors + ////////////////////////////////////// + // Implicit basic constructors - GLM_FUNC_DECL tvec1(); - GLM_FUNC_DECL tvec1(tvec1 const & v); + GLM_FUNC_DECL tvec1(); + GLM_FUNC_DECL tvec1(tvec1 const & v); - ////////////////////////////////////// - // Explicit basic constructors + ////////////////////////////////////// + // Explicit basic constructors - GLM_FUNC_DECL explicit tvec1( - ctor); - GLM_FUNC_DECL explicit tvec1( - value_type const & s); + GLM_FUNC_DECL explicit tvec1( + ctor); + GLM_FUNC_DECL explicit tvec1( + value_type const & s); - ////////////////////////////////////// - // Swizzle constructors + ////////////////////////////////////// + // Swizzle constructors - GLM_FUNC_DECL tvec1(tref1 const & r); + GLM_FUNC_DECL tvec1(tref1 const & r); - ////////////////////////////////////// - // Convertion scalar constructors + ////////////////////////////////////// + // Convertion scalar constructors - //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec1(U const & s); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec1(U const & s); - ////////////////////////////////////// - // Convertion vector constructors + ////////////////////////////////////// + // Convertion vector constructors - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec1(tvec2 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec1(tvec3 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec1(tvec4 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec1(tvec2 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec1(tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec1(tvec4 const & v); - ////////////////////////////////////// - // Unary arithmetic operators + ////////////////////////////////////// + // Unary arithmetic operators - GLM_FUNC_DECL tvec1 & operator= (tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator= (tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator+=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator+=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator-=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator-=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator*=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator*=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator/=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator/=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator++(); - GLM_FUNC_DECL tvec1 & operator--(); + GLM_FUNC_DECL tvec1 & operator+=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator+=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator-=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator-=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator*=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator*=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator/=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator/=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator++(); + GLM_FUNC_DECL tvec1 & operator--(); - ////////////////////////////////////// - // Unary bit operators + ////////////////////////////////////// + // Unary bit operators - GLM_FUNC_DECL tvec1 & operator%=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator%=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator&=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator&=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator|=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator|=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator^=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator^=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator<<=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator<<=(tvec1 const & v); - GLM_FUNC_DECL tvec1 & operator>>=(value_type const & s); - GLM_FUNC_DECL tvec1 & operator>>=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator%=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator%=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator&=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator&=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator|=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator|=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator^=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator^=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator<<=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator<<=(tvec1 const & v); + GLM_FUNC_DECL tvec1 & operator>>=(value_type const & s); + GLM_FUNC_DECL tvec1 & operator>>=(tvec1 const & v); - ////////////////////////////////////// - // Swizzle operators + ////////////////////////////////////// + // Swizzle operators - GLM_FUNC_DECL value_type swizzle(comp X) const; - GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; - GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; - GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; - GLM_FUNC_DECL tref1 swizzle(comp X); - }; + GLM_FUNC_DECL value_type swizzle(comp X) const; + GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; + GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; + GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + GLM_FUNC_DECL tref1 swizzle(comp X); + }; - template - struct tref1 - { - GLM_FUNC_DECL tref1(T & x); - GLM_FUNC_DECL tref1(tref1 const & r); - GLM_FUNC_DECL tref1(tvec1 const & v); + template + struct tref1 + { + GLM_FUNC_DECL tref1(T & x); + GLM_FUNC_DECL tref1(tref1 const & r); + GLM_FUNC_DECL tref1(tvec1 const & v); - GLM_FUNC_DECL tref1 & operator= (tref1 const & r); - GLM_FUNC_DECL tref1 & operator= (tvec1 const & v); + GLM_FUNC_DECL tref1 & operator= (tref1 const & r); + GLM_FUNC_DECL tref1 & operator= (tvec1 const & v); - T& x; - }; + T& x; + }; - GLM_DETAIL_IS_VECTOR(tvec1); + GLM_DETAIL_IS_VECTOR(tvec1); - typedef detail::tvec1 highp_vec1_t; - typedef detail::tvec1 mediump_vec1_t; - typedef detail::tvec1 lowp_vec1_t; - typedef detail::tvec1 highp_ivec1_t; - typedef detail::tvec1 mediump_ivec1_t; - typedef detail::tvec1 lowp_ivec1_t; - typedef detail::tvec1 highp_uvec1_t; - typedef detail::tvec1 mediump_uvec1_t; - typedef detail::tvec1 lowp_uvec1_t; + typedef detail::tvec1 highp_vec1_t; + typedef detail::tvec1 mediump_vec1_t; + typedef detail::tvec1 lowp_vec1_t; + typedef detail::tvec1 highp_ivec1_t; + typedef detail::tvec1 mediump_ivec1_t; + typedef detail::tvec1 lowp_ivec1_t; + typedef detail::tvec1 highp_uvec1_t; + typedef detail::tvec1 mediump_uvec1_t; + typedef detail::tvec1 lowp_uvec1_t; - } //namespace detail +}//namespace detail }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_vec1.inl" -#endif +#endif//GLM_EXTERNAL_TEMPLATE #endif//glm_core_type_gentype1 diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index afaf8f8d..b8d47b7b 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -16,251 +16,248 @@ #include "type_size.hpp" #include "_swizzle.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test + template struct tref2; + template struct tref3; + template struct tref4; + template struct tvec3; + template struct tvec4; + + //! The basic 2D vector type. + //! \ingroup core_template + template + struct tvec2 { - void main_vec2(); - } - //namespace test + enum ctor{null}; - namespace detail - { - template struct tref2; - template struct tref3; - template struct tref4; - template struct tvec3; - template struct tvec4; + 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(); - //! The basic 2D vector type. - //! \ingroup core_template - template - struct tvec2 - { - enum ctor{null}; + typedef tvec2 type; + typedef tvec2 bool_type; - 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; - typedef tvec2 bool_type; - - ////////////////////////////////////// - // Data + ////////////////////////////////////// + // Data # if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) - value_type x, y; + value_type x, y; # elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) - union - { - struct{value_type x, y;}; - struct{value_type r, g;}; - struct{value_type s, t;}; - }; + union + { + struct{value_type x, y;}; + struct{value_type r, g;}; + struct{value_type s, t;}; + }; # else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) - union {value_type x, r, s;}; - union {value_type y, g, t;}; + union {value_type x, r, s;}; + union {value_type y, g, t;}; # endif//GLM_COMPONENT - ////////////////////////////////////// - // Accesses + ////////////////////////////////////// + // Accesses - GLM_FUNC_DECL value_type & operator[](size_type i); - GLM_FUNC_DECL value_type const & operator[](size_type i) const; + GLM_FUNC_DECL value_type & operator[](size_type i); + GLM_FUNC_DECL value_type const & operator[](size_type i) const; - ////////////////////////////////////// - // Implicit basic constructors + ////////////////////////////////////// + // Implicit basic constructors - GLM_FUNC_DECL tvec2(); - GLM_FUNC_DECL tvec2(tvec2 const & v); + GLM_FUNC_DECL tvec2(); + GLM_FUNC_DECL tvec2(tvec2 const & v); - ////////////////////////////////////// - // Explicit basic constructors + ////////////////////////////////////// + // Explicit basic constructors - GLM_FUNC_DECL explicit tvec2( - ctor); - GLM_FUNC_DECL explicit tvec2( - value_type const & s); - GLM_FUNC_DECL explicit tvec2( - value_type const & s1, - value_type const & s2); + GLM_FUNC_DECL explicit tvec2( + ctor); + GLM_FUNC_DECL explicit tvec2( + value_type const & s); + GLM_FUNC_DECL explicit tvec2( + value_type const & s1, + value_type const & s2); - ////////////////////////////////////// - // Swizzle constructors + ////////////////////////////////////// + // Swizzle constructors - tvec2(tref2 const & r); + tvec2(tref2 const & r); - ////////////////////////////////////// - // Convertion constructors + ////////////////////////////////////// + // Convertion constructors - //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec2( - U const & x); - //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec2( - U const & x, - V const & y); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec2( + U const & x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec2( + U const & x, + V const & y); - ////////////////////////////////////// - // Convertion vector constructors + ////////////////////////////////////// + // Convertion vector constructors - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec2(tvec2 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec2(tvec3 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec2(tvec4 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec2(tvec2 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec2(tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec2(tvec4 const & v); - ////////////////////////////////////// - // Unary arithmetic operators + ////////////////////////////////////// + // Unary arithmetic operators - GLM_FUNC_DECL tvec2 & operator= (tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator= (tvec2 const & v); + GLM_FUNC_DECL tvec2 & operator= (tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator= (tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator+=(U const & s); - template - GLM_FUNC_DECL tvec2 & operator+=(tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator-=(U const & s); - template - GLM_FUNC_DECL tvec2 & operator-=(tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator*=(U const & s); - template - GLM_FUNC_DECL tvec2 & operator*=(tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator/=(U const & s); - template - GLM_FUNC_DECL tvec2 & operator/=(tvec2 const & v); - GLM_FUNC_DECL tvec2 & operator++(); - GLM_FUNC_DECL tvec2 & operator--(); + template + GLM_FUNC_DECL tvec2 & operator+=(U const & s); + template + GLM_FUNC_DECL tvec2 & operator+=(tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator-=(U const & s); + template + GLM_FUNC_DECL tvec2 & operator-=(tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator*=(U const & s); + template + GLM_FUNC_DECL tvec2 & operator*=(tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator/=(U const & s); + template + GLM_FUNC_DECL tvec2 & operator/=(tvec2 const & v); + GLM_FUNC_DECL tvec2 & operator++(); + GLM_FUNC_DECL tvec2 & operator--(); - ////////////////////////////////////// - // Unary bit operators + ////////////////////////////////////// + // Unary bit operators - template - GLM_FUNC_DECL tvec2 & operator%= (U const & s); - template - GLM_FUNC_DECL tvec2 & operator%= (tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator&= (U const & s); - template - GLM_FUNC_DECL tvec2 & operator&= (tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator|= (U const & s); - template - GLM_FUNC_DECL tvec2 & operator|= (tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator^= (U const & s); - template - GLM_FUNC_DECL tvec2 & operator^= (tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator<<=(U const & s); - template - GLM_FUNC_DECL tvec2 & operator<<=(tvec2 const & v); - template - GLM_FUNC_DECL tvec2 & operator>>=(U const & s); - template - GLM_FUNC_DECL tvec2 & operator>>=(tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator%= (U const & s); + template + GLM_FUNC_DECL tvec2 & operator%= (tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator&= (U const & s); + template + GLM_FUNC_DECL tvec2 & operator&= (tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator|= (U const & s); + template + GLM_FUNC_DECL tvec2 & operator|= (tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator^= (U const & s); + template + GLM_FUNC_DECL tvec2 & operator^= (tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator<<=(U const & s); + template + GLM_FUNC_DECL tvec2 & operator<<=(tvec2 const & v); + template + GLM_FUNC_DECL tvec2 & operator>>=(U const & s); + template + GLM_FUNC_DECL tvec2 & operator>>=(tvec2 const & v); - ////////////////////////////////////// - // Swizzle operators + ////////////////////////////////////// + // Swizzle operators - GLM_FUNC_DECL value_type swizzle(comp X) const; - GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; - GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; - GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; - GLM_FUNC_DECL tref2 swizzle(comp X, comp Y); - }; + GLM_FUNC_DECL value_type swizzle(comp X) const; + GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; + GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; + GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + GLM_FUNC_DECL tref2 swizzle(comp X, comp Y); + }; - template - struct tref2 - { - GLM_FUNC_DECL tref2(T & x, T & y); - GLM_FUNC_DECL tref2(tref2 const & r); - GLM_FUNC_DECL tref2(tvec2 const & v); - - GLM_FUNC_DECL tref2 & operator= (tref2 const & r); - GLM_FUNC_DECL tref2 & operator= (tvec2 const & v); - - T& x; - T& y; - }; - - GLM_DETAIL_IS_VECTOR(tvec2); - - } //namespace detail - - namespace core{ - namespace type{ - - namespace precision + template + struct tref2 { - //! 2 components vector of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 highp_vec2; - //! 2 components vector of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 mediump_vec2; - //! 2 components vector of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 lowp_vec2; + GLM_FUNC_DECL tref2(T & x, T & y); + GLM_FUNC_DECL tref2(tref2 const & r); + GLM_FUNC_DECL tref2(tvec2 const & v); - //! 2 components vector of high precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 highp_ivec2; - //! 2 components vector of medium precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 mediump_ivec2; - //! 2 components vector of low precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 lowp_ivec2; + GLM_FUNC_DECL tref2 & operator= (tref2 const & r); + GLM_FUNC_DECL tref2 & operator= (tvec2 const & v); + + T& x; + T& y; + }; + + GLM_DETAIL_IS_VECTOR(tvec2); + +} //namespace detail + +namespace core{ +namespace type{ +namespace precision +{ + //! 2 components vector of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 highp_vec2; + + //! 2 components vector of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 mediump_vec2; + + //! 2 components vector of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 lowp_vec2; + + //! 2 components vector of high precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 highp_ivec2; + + //! 2 components vector of medium precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 mediump_ivec2; + + //! 2 components vector of low precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 lowp_ivec2; - //! 2 components vector of high precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 highp_uvec2; - //! 2 components vector of medium precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 mediump_uvec2; - //! 2 components vector of low precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec2 lowp_uvec2; - } - //namespace precision + //! 2 components vector of high precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 highp_uvec2; - }//namespace type - }//namespace core + //! 2 components vector of medium precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 mediump_uvec2; + + //! 2 components vector of low precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec2 lowp_uvec2; + +}//namespace precision +}//namespace type +}//namespace core }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_vec2.inl" -#endif +#endif//GLM_EXTERNAL_TEMPLATE #endif//glm_core_type_gentype2 diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 1e06a783..7b568789 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -16,256 +16,254 @@ #include "type_size.hpp" #include "_swizzle.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test - { - void main_vec3(); - }//namespace test + template struct tref2; + template struct tref3; + template struct tref4; + template struct tvec2; + template struct tvec4; - namespace detail - { - template struct tref2; - template struct tref3; - template struct tref4; - template struct tvec2; - template struct tvec4; + //! Basic 3D vector type. + //! \ingroup core_template + template + struct tvec3 + { + enum ctor{null}; - //! Basic 3D vector type. - //! \ingroup core_template - template - struct tvec3 - { - enum ctor{null}; + 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 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; + typedef tvec3 bool_type; - typedef tvec3 type; - typedef tvec3 bool_type; + ////////////////////////////////////// + // Data - ////////////////////////////////////// - // Data - -# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) - value_type x, y, z; -# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) - union - { - struct{value_type x, y, z;}; - struct{value_type r, g, b;}; - struct{value_type s, t, p;}; - }; -# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) - union {value_type x, r, s;}; - union {value_type y, g, t;}; - union {value_type z, b, p;}; -# endif//GLM_COMPONENT - - ////////////////////////////////////// - // Accesses - - GLM_FUNC_DECL value_type & operator[](size_type i); - GLM_FUNC_DECL value_type const & operator[](size_type i) const; - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_DECL tvec3(); - GLM_FUNC_DECL tvec3(tvec3 const & v); - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_DECL explicit tvec3( - ctor); - GLM_FUNC_DECL explicit tvec3( - value_type const & s); - GLM_FUNC_DECL explicit tvec3( - value_type const & s1, - value_type const & s2, - value_type const & s3); - - ////////////////////////////////////// - // Swizzle constructors - - GLM_FUNC_DECL tvec3(tref3 const & r); - - ////////////////////////////////////// - // Convertion scalar constructors - - //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec3( - U const & x); - //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec3( - U const & x, - V const & y, - W const & z); - - ////////////////////////////////////// - // Convertion vector constructors - - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec3(tvec2 const & v, B const & s); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec3(A const & s, tvec2 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec3(tvec3 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec3(tvec4 const & v); - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tvec3 & operator= (tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator= (tvec3 const & v); - - template - GLM_FUNC_DECL tvec3 & operator+=(U const & s); - template - GLM_FUNC_DECL tvec3 & operator+=(tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator-=(U const & s); - template - GLM_FUNC_DECL tvec3 & operator-=(tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator*=(U const & s); - template - GLM_FUNC_DECL tvec3 & operator*=(tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator/=(U const & s); - template - GLM_FUNC_DECL tvec3 & operator/=(tvec3 const & v); - GLM_FUNC_DECL tvec3 & operator++(); - GLM_FUNC_DECL tvec3 & operator--(); - - ////////////////////////////////////// - // Unary bit operators - - template - GLM_FUNC_DECL tvec3 & operator%= (U const & s); - template - GLM_FUNC_DECL tvec3 & operator%= (tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator&= (U const & s); - template - GLM_FUNC_DECL tvec3 & operator&= (tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator|= (U const & s); - template - GLM_FUNC_DECL tvec3 & operator|= (tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator^= (U const & s); - template - GLM_FUNC_DECL tvec3 & operator^= (tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator<<=(U const & s); - template - GLM_FUNC_DECL tvec3 & operator<<=(tvec3 const & v); - template - GLM_FUNC_DECL tvec3 & operator>>=(U const & s); - template - GLM_FUNC_DECL tvec3 & operator>>=(tvec3 const & v); - - ////////////////////////////////////// - // Swizzle operators - - GLM_FUNC_DECL value_type swizzle(comp X) const; - GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; - GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; - GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; - GLM_FUNC_DECL tref3 swizzle(comp X, comp Y, comp Z); - }; - - template - struct tref3 +# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) + value_type x, y, z; +# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) + union { - GLM_FUNC_DECL tref3(T & x, T & y, T & z); - GLM_FUNC_DECL tref3(tref3 const & r); - GLM_FUNC_DECL tref3(tvec3 const & v); - - GLM_FUNC_DECL tref3 & operator= (tref3 const & r); - GLM_FUNC_DECL tref3 & operator= (tvec3 const & v); - - T & x; - T & y; - T & z; + struct{value_type x, y, z;}; + struct{value_type r, g, b;}; + struct{value_type s, t, p;}; }; +# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) + union {value_type x, r, s;}; + union {value_type y, g, t;}; + union {value_type z, b, p;}; +# endif//GLM_COMPONENT - GLM_DETAIL_IS_VECTOR(tvec3); - } //namespace detail + ////////////////////////////////////// + // Accesses - namespace core{ - namespace type{ + GLM_FUNC_DECL value_type & operator[](size_type i); + GLM_FUNC_DECL value_type const & operator[](size_type i) const; - namespace precision + ////////////////////////////////////// + // Implicit basic constructors + + GLM_FUNC_DECL tvec3(); + GLM_FUNC_DECL tvec3(tvec3 const & v); + + ////////////////////////////////////// + // Explicit basic constructors + + GLM_FUNC_DECL explicit tvec3( + ctor); + GLM_FUNC_DECL explicit tvec3( + value_type const & s); + GLM_FUNC_DECL explicit tvec3( + value_type const & s1, + value_type const & s2, + value_type const & s3); + + ////////////////////////////////////// + // Swizzle constructors + + GLM_FUNC_DECL tvec3(tref3 const & r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec3( + U const & x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec3( + U const & x, + V const & y, + W const & z); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec3(tvec2 const & v, B const & s); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec3(A const & s, tvec2 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec3(tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec3(tvec4 const & v); + + ////////////////////////////////////// + // Unary arithmetic operators + + GLM_FUNC_DECL tvec3 & operator= (tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator= (tvec3 const & v); + + template + GLM_FUNC_DECL tvec3 & operator+=(U const & s); + template + GLM_FUNC_DECL tvec3 & operator+=(tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator-=(U const & s); + template + GLM_FUNC_DECL tvec3 & operator-=(tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator*=(U const & s); + template + GLM_FUNC_DECL tvec3 & operator*=(tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator/=(U const & s); + template + GLM_FUNC_DECL tvec3 & operator/=(tvec3 const & v); + GLM_FUNC_DECL tvec3 & operator++(); + GLM_FUNC_DECL tvec3 & operator--(); + + ////////////////////////////////////// + // Unary bit operators + + template + GLM_FUNC_DECL tvec3 & operator%= (U const & s); + template + GLM_FUNC_DECL tvec3 & operator%= (tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator&= (U const & s); + template + GLM_FUNC_DECL tvec3 & operator&= (tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator|= (U const & s); + template + GLM_FUNC_DECL tvec3 & operator|= (tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator^= (U const & s); + template + GLM_FUNC_DECL tvec3 & operator^= (tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator<<=(U const & s); + template + GLM_FUNC_DECL tvec3 & operator<<=(tvec3 const & v); + template + GLM_FUNC_DECL tvec3 & operator>>=(U const & s); + template + GLM_FUNC_DECL tvec3 & operator>>=(tvec3 const & v); + + ////////////////////////////////////// + // Swizzle operators + + GLM_FUNC_DECL value_type swizzle(comp X) const; + GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; + GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; + GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + GLM_FUNC_DECL tref3 swizzle(comp X, comp Y, comp Z); + }; + + template + struct tref3 { - //! 3 components vector of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 highp_vec3; - //! 3 components vector of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 mediump_vec3; - //! 3 components vector of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 lowp_vec3; + GLM_FUNC_DECL tref3(T & x, T & y, T & z); + GLM_FUNC_DECL tref3(tref3 const & r); + GLM_FUNC_DECL tref3(tvec3 const & v); - //! 3 components vector of high precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 highp_ivec3; - //! 3 components vector of medium precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 mediump_ivec3; - //! 3 components vector of low precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 lowp_ivec3; + GLM_FUNC_DECL tref3 & operator= (tref3 const & r); + GLM_FUNC_DECL tref3 & operator= (tvec3 const & v); - //! 3 components vector of high precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 highp_uvec3; - //! 3 components vector of medium precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 mediump_uvec3; - //! 3 components vector of low precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec3 lowp_uvec3; - } - //namespace precision + T & x; + T & y; + T & z; + }; - }//namespace type - }//namespace core + GLM_DETAIL_IS_VECTOR(tvec3); +} //namespace detail + +namespace core{ +namespace type{ +namespace precision +{ + //! 3 components vector of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 highp_vec3; + + //! 3 components vector of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 mediump_vec3; + + //! 3 components vector of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 lowp_vec3; + + //! 3 components vector of high precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 highp_ivec3; + + //! 3 components vector of medium precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 mediump_ivec3; + + //! 3 components vector of low precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 lowp_ivec3; + + //! 3 components vector of high precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 highp_uvec3; + + //! 3 components vector of medium precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 mediump_uvec3; + + //! 3 components vector of low precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec3 lowp_uvec3; + +}//namespace precision +}//namespace type +}//namespace core }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_vec3.inl" -#endif +#endif//GLM_EXTERNAL_TEMPLATE #endif//glm_core_type_gentype3 diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 354cd5b7..940b5c19 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -16,275 +16,267 @@ #include "type_size.hpp" #include "_swizzle.hpp" -namespace glm +namespace glm{ +namespace detail { - namespace test - { - void main_vec4(); - }//namespace test + template struct tref2; + template struct tref3; + template struct tref4; + template struct tvec2; + template struct tvec3; - namespace detail + ///Basic 4D vector type. + //! \ingroup core_template + template + struct tvec4 { - template struct tref2; - template struct tref3; - template struct tref4; - template struct tvec2; - template struct tvec3; + enum ctor{null}; - ///Basic 4D vector type. - //! \ingroup core_template - template - struct tvec4 + 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; + typedef tvec4 bool_type; + + ////////////////////////////////////// + // Data + +# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) + value_type x, y, z, w; +# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) + union { - enum ctor{null}; - - 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; - typedef tvec4 bool_type; - - ////////////////////////////////////// - // Data - -# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) - value_type x, y, z, w; -# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) - union - { - struct{value_type x, y, z, w;}; - struct{value_type r, g, b, a;}; - struct{value_type s, t, p, q;}; - }; -# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) - union {value_type x, r, s;}; - union {value_type y, g, t;}; - union {value_type z, b, p;}; - union {value_type w, a, q;}; -# endif//GLM_COMPONENT - - ////////////////////////////////////// - // Accesses - - GLM_FUNC_DECL value_type & operator[](size_type i); - GLM_FUNC_DECL value_type const & operator[](size_type i) const; - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_DECL tvec4(); - GLM_FUNC_DECL tvec4(type const & v); - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_DECL explicit tvec4( - ctor); - GLM_FUNC_DECL explicit tvec4( - value_type const & s); - GLM_FUNC_DECL explicit tvec4( - value_type const & s0, - value_type const & s1, - value_type const & s2, - value_type const & s3); - - ////////////////////////////////////// - // Swizzle constructors - - GLM_FUNC_DECL tvec4(tref4 const & r); - - ////////////////////////////////////// - // Convertion scalar constructors - - //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4( - U const & x); - //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4( - A const & x, - B const & y, - C const & z, - D const & w); - - ////////////////////////////////////// - // Convertion vector constructors - - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(tvec2 const & v, B const & s1, C const & s2); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(A const & s1, tvec2 const & v, C const & s2); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(A const & s1, B const & s2, tvec2 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(tvec3 const & v, B const & s); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(A const & s, tvec3 const & v); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(tvec2 const & v1, tvec2 const & v2); - //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL explicit tvec4(tvec4 const & v); - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_DECL tvec4 & operator= (tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator= (tvec4 const & v); - - template - GLM_FUNC_DECL tvec4 & operator+=(U const & s); - template - GLM_FUNC_DECL tvec4 & operator+=(tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator-=(U const & s); - template - GLM_FUNC_DECL tvec4 & operator-=(tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator*=(U const & s); - template - GLM_FUNC_DECL tvec4 & operator*=(tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator/=(U const & s); - template - GLM_FUNC_DECL tvec4 & operator/=(tvec4 const & v); - GLM_FUNC_DECL tvec4 & operator++(); - GLM_FUNC_DECL tvec4 & operator--(); - - ////////////////////////////////////// - // Unary bit operators - - template - GLM_FUNC_DECL tvec4 & operator%= (U const & s); - template - GLM_FUNC_DECL tvec4 & operator%= (tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator&= (U const & s); - template - GLM_FUNC_DECL tvec4 & operator&= (tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator|= (U const & s); - template - GLM_FUNC_DECL tvec4 & operator|= (tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator^= (U const & s); - template - GLM_FUNC_DECL tvec4 & operator^= (tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator<<=(U const & s); - template - GLM_FUNC_DECL tvec4 & operator<<=(tvec4 const & v); - template - GLM_FUNC_DECL tvec4 & operator>>=(U const & s); - template - GLM_FUNC_DECL tvec4 & operator>>=(tvec4 const & v); - - ////////////////////////////////////// - // Swizzle operators - - GLM_FUNC_DECL value_type swizzle(comp X) const; - GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; - GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; - GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; - GLM_FUNC_DECL tref4 swizzle(comp X, comp Y, comp Z, comp W); + struct{value_type x, y, z, w;}; + struct{value_type r, g, b, a;}; + struct{value_type s, t, p, q;}; }; +# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) + union {value_type x, r, s;}; + union {value_type y, g, t;}; + union {value_type z, b, p;}; + union {value_type w, a, q;}; +# endif//GLM_COMPONENT - template - struct tref4 - { - GLM_FUNC_DECL tref4(T & x, T & y, T & z, T & w); - GLM_FUNC_DECL tref4(tref4 const & r); - GLM_FUNC_DECL tref4(tvec4 const & v); + ////////////////////////////////////// + // Accesses - GLM_FUNC_DECL tref4 & operator= (tref4 const & r); - GLM_FUNC_DECL tref4 & operator= (tvec4 const & v); + GLM_FUNC_DECL value_type & operator[](size_type i); + GLM_FUNC_DECL value_type const & operator[](size_type i) const; - T & x; - T & y; - T & z; - T & w; - }; + ////////////////////////////////////// + // Implicit basic constructors - GLM_DETAIL_IS_VECTOR(tvec4); - } //namespace detail + GLM_FUNC_DECL tvec4(); + GLM_FUNC_DECL tvec4(type const & v); - namespace core{ - namespace type{ + ////////////////////////////////////// + // Explicit basic constructors - ////////////////////////// - // Float definition + GLM_FUNC_DECL explicit tvec4( + ctor); + GLM_FUNC_DECL explicit tvec4( + value_type const & s); + GLM_FUNC_DECL explicit tvec4( + value_type const & s0, + value_type const & s1, + value_type const & s2, + value_type const & s3); - namespace precision + ////////////////////////////////////// + // Swizzle constructors + + GLM_FUNC_DECL tvec4(tref4 const & r); + + ////////////////////////////////////// + // Convertion scalar constructors + + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4( + U const & x); + //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4( + A const & x, + B const & y, + C const & z, + D const & w); + + ////////////////////////////////////// + // Convertion vector constructors + + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4(tvec2 const & v, B const & s1, C const & s2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4(A const & s1, tvec2 const & v, C const & s2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4(A const & s1, B const & s2, tvec2 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4(tvec3 const & v, B const & s); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4(A const & s, tvec3 const & v); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4(tvec2 const & v1, tvec2 const & v2); + //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL explicit tvec4(tvec4 const & v); + + ////////////////////////////////////// + // Unary arithmetic operators + + GLM_FUNC_DECL tvec4 & operator= (tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator= (tvec4 const & v); + + template + GLM_FUNC_DECL tvec4 & operator+=(U const & s); + template + GLM_FUNC_DECL tvec4 & operator+=(tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator-=(U const & s); + template + GLM_FUNC_DECL tvec4 & operator-=(tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator*=(U const & s); + template + GLM_FUNC_DECL tvec4 & operator*=(tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator/=(U const & s); + template + GLM_FUNC_DECL tvec4 & operator/=(tvec4 const & v); + GLM_FUNC_DECL tvec4 & operator++(); + GLM_FUNC_DECL tvec4 & operator--(); + + ////////////////////////////////////// + // Unary bit operators + + template + GLM_FUNC_DECL tvec4 & operator%= (U const & s); + template + GLM_FUNC_DECL tvec4 & operator%= (tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator&= (U const & s); + template + GLM_FUNC_DECL tvec4 & operator&= (tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator|= (U const & s); + template + GLM_FUNC_DECL tvec4 & operator|= (tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator^= (U const & s); + template + GLM_FUNC_DECL tvec4 & operator^= (tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator<<=(U const & s); + template + GLM_FUNC_DECL tvec4 & operator<<=(tvec4 const & v); + template + GLM_FUNC_DECL tvec4 & operator>>=(U const & s); + template + GLM_FUNC_DECL tvec4 & operator>>=(tvec4 const & v); + + ////////////////////////////////////// + // Swizzle operators + + GLM_FUNC_DECL value_type swizzle(comp X) const; + GLM_FUNC_DECL tvec2 swizzle(comp X, comp Y) const; + GLM_FUNC_DECL tvec3 swizzle(comp X, comp Y, comp Z) const; + GLM_FUNC_DECL tvec4 swizzle(comp X, comp Y, comp Z, comp W) const; + GLM_FUNC_DECL tref4 swizzle(comp X, comp Y, comp Z, comp W); + }; + + template + struct tref4 { - //! 4 components vector of high precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 highp_vec4; - //! 4 components vector of medium precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 mediump_vec4; - //! 4 components vector of low precision floating-point numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 lowp_vec4; + GLM_FUNC_DECL tref4(T & x, T & y, T & z, T & w); + GLM_FUNC_DECL tref4(tref4 const & r); + GLM_FUNC_DECL tref4(tvec4 const & v); - //! 4 components vector of high precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 highp_ivec4; - //! 4 components vector of medium precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 mediump_ivec4; - //! 4 components vector of low precision signed integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 lowp_ivec4; + GLM_FUNC_DECL tref4 & operator= (tref4 const & r); + GLM_FUNC_DECL tref4 & operator= (tvec4 const & v); - //! 4 components vector of high precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 highp_uvec4; - //! 4 components vector of medium precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 mediump_uvec4; - //! 4 components vector of low precision unsigned integer numbers. - //! There is no guarantee on the actual precision. - //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. - //! \ingroup core_precision - typedef detail::tvec4 lowp_uvec4; - } - //namespace precision + T & x; + T & y; + T & z; + T & w; + }; - }//namespace type - }//namespace core + GLM_DETAIL_IS_VECTOR(tvec4); +}//namespace detail - using namespace core::type; +namespace core{ +namespace type{ +namespace precision +{ + //! 4 components vector of high precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 highp_vec4; + //! 4 components vector of medium precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 mediump_vec4; + + //! 4 components vector of low precision floating-point numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 lowp_vec4; + + //! 4 components vector of high precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 highp_ivec4; + + //! 4 components vector of medium precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 mediump_ivec4; + + //! 4 components vector of low precision signed integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 lowp_ivec4; + + //! 4 components vector of high precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 highp_uvec4; + + //! 4 components vector of medium precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 mediump_uvec4; + + //! 4 components vector of low precision unsigned integer numbers. + //! There is no guarantee on the actual precision. + //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers. + //! \ingroup core_precision + typedef detail::tvec4 lowp_uvec4; + +}//namespace precision +}//namespace type +}//namespace core }//namespace glm #ifndef GLM_EXTERNAL_TEMPLATE #include "type_vec4.inl" -#endif +#endif//GLM_EXTERNAL_TEMPLATE #endif//glm_core_type_gentype4