diff --git a/doc/about.html b/doc/about.html index 3ba3953d..126961e9 100644 --- a/doc/about.html +++ b/doc/about.html @@ -11,8 +11,8 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM)
A C++ mathematics library for graphics programming


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


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

diff --git a/doc/code.html b/doc/code.html index 5a742173..bd08be2e 100644 --- a/doc/code.html +++ b/doc/code.html @@ -11,8 +11,8 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM)
A C++ mathematics library for graphics programming


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


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


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


      Current release
      02/06/2011: + GLM 0.9.2.2 (3.4 MB) -
      _________________

      GLM - zip files
      24/05/2010: GLM 0.9.2.1 (3.4 MB) -
      08/05/2010: GLM 0.9.2.0 (3.4 MB) -
      07/05/2010: GLM 0.9.1.3 (3.4 MB) -
      12/04/2010: GLM 0.9.1.2 (3.4 MB) -
      17/03/2010: GLM 0.9.1.1 (3.4 MB) -
      03/03/2010: GLM 0.9.1.0 (3.4 MB) -
      13/02/2010: GLM 0.9.1.B (3.4 MB) -
      13/02/2010: GLM 0.9.0.8 (3.3 MB) -
      31/01/2010: GLM 0.9.1.A (3.0 MB) -
      30/01/2010: GLM 0.9.0.7 (1.4 MB) +
      _________________

      GLM - zip files
      02/06/2011: GLM 0.9.2.2 (3.4 MB) +
      24/05/2011: GLM 0.9.2.1 (3.4 MB) +
      08/05/2011: GLM 0.9.2.0 (3.4 MB) +
      07/05/2011: GLM 0.9.1.3 (3.4 MB) +
      12/04/2011: GLM 0.9.1.2 (3.4 MB) +
      17/03/2011: GLM 0.9.1.1 (3.4 MB) +
      03/03/2011: GLM 0.9.1.0 (3.4 MB) +
      13/02/2011: GLM 0.9.1.B (3.4 MB) +
      13/02/2011: GLM 0.9.0.8 (3.3 MB) +
      31/01/2011: GLM 0.9.1.A (3.0 MB) +
      30/01/2011: GLM 0.9.0.7 (1.4 MB)
      21/12/2010: GLM 0.9.0.6 (2.2 MB)
      01/11/2010: GLM 0.9.0.5 (2.2 MB)
      04/10/2010: GLM 0.9.0.4 (1.5 MB) @@ -74,7 +75,8 @@
      02/19/2006: GLM 0.3.0.0 (945 KB)
      05/05/2005: GLM 0.2.0.0 (194 KB)
      02/21/2005: GLM 0.1.0.0 (29.2 KB) -
      _________________

      GLM - 7z files
      24/05/2011: GLM 0.9.2.1 (2.1 MB) +
      _________________

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


      16/10/2008
      GLM Logo

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

      _________________

      16/10/2008
      GLM Font

      Download: Font (.otf)

      _________________

      _________________

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


      16/10/2008
      GLM Logo

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

      _________________

      16/10/2008
      GLM Font

      Download: Font (.otf)

      _________________

      _________________

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


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


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

      @@ -33,7 +33,21 @@

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


      24/05/2011 - GLM 0.9.2.1 released

      +


      02/06/2011 - GLM 0.9.2.2 released

      + The main improvement of this version comes from the extended number of matrix constructors so that a programmer can used different scalar types for each parameter. +

      • #include <glm/glm.hpp>
      • // Create an identity matrix
      • + glm::mat3 m( +
      • + 1, 0.0, 0, +
      • + 0.0, 1.0, 0.0f, +
      • + 0, 0.0, 1.0f); +

      + The quaternion implementation has been updated as well, fixing the various slerp implementation flavours (mix, shortMix and fastMix) and providing more completeness: Added interaction with GLM_GTX_epsilon and missing lowp_quat, mediump_quat and highp_quat but also none square matrix equivalents. +

      + Finally, some efforts have been put to remove warnings across all supported compilers. +

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

      24/05/2011 - GLM 0.9.2.1 released

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

      @@ -106,7 +120,7 @@ This implementation can probably be improve in many ways so don't hesitate to send me some feedbacks.

      GLM 0.9.1 is not 100% backward compatible with GLM 0.9.0 but mostly advanced usages should be concerned by this compatibility issues. -


      30/01/2011 - GLM 0.9.0.7 released


      21/12/2010 - GLM 0.9.0.6 released

      GLM 0.9.0.6 is a new update of GLM built over GLM's user bug reports. @@ -148,9 +162,9 @@

      Reaching the beta status, this new features close the feature list of GLM 0.9. Further development releases may happen before the final release. -

      Download: GLM 0.9.B.1 (zip, 964 KB)
      Download: GLM 0.9.B.1 (7z, 414 KB)

      20/02/2010 - GLM 0.9 Alpha 2 released


      20/02/2010 - GLM 0.9 Alpha 2 released

      Groove

      This update fixes some problem of Alpha 1 but also brings some improvements in case of errors when using GLM to provide more relevant messages. -

      Download: GLM 0.9.A.2 (zip, 1.3 MB)
      Download: GLM 0.9.A.2 (7z, 726 KB)

      09/02/2010 - GLM 0.9 Alpha 1 released


      09/02/2010 - GLM 0.9 Alpha 1 released

      Groove

      First step until a major release for GLM with this first alpha of GLM 0.9.

      This version brings a large internal redesign to improve the library reliability and optimized some parts. @@ -159,32 +173,32 @@ For most users the build issues when upgrading to GLM 0.9 should be reduced especially if they follow the deprecation policy.

      This release is still UNSTABLE and not recommanded for commertial products. -

      Download: GLM 0.9.A.1 (zip, 950 KB)
      Download: GLM 0.9.A.1 (7z, 391 KB)
      Link: Full changelog

      25/01/2010 - GLM 0.8.4.4 released


      25/01/2010 - GLM 0.8.4.4 released

      Groove

      This update just removes some warnings

      By the way, if you have questions about GLM, a good place for those is the OpenGL.org Toolkits forum. -

      Download: GLM 0.8.4.4 (zip, 1.1 MB)
      Download: GLM 0.8.4.4 (7z, 479 KB)
      Link: Full changelog

      16/11/2009 - GLM 0.8.4.3 released


      16/11/2009 - GLM 0.8.4.3 released

      Groove

      This version fixed half scalars and half vectors arithmetics. This is a really slow practice that should be avoid. Half floating point value should be use only to store GPU data. GPUs have native support for half values, not x86 CPUs. -

      Download: GLM 0.8.4.3 (zip, 1.1 MB)
      Download: GLM 0.8.4.3 (7z, 463 KB)
      Link: Full changelog

      19/10/2009 - GLM 0.8.4.2 released


      19/10/2009 - GLM 0.8.4.2 released

      Groove

      This version is a really minor updates, fixing single issue with half float types. -

      Download: GLM 0.8.4.2 (zip, 1.1 MB)
      Download: GLM 0.8.4.2 (7z, 443 KB)
      Link: Full changelog

      05/10/2009 - GLM 0.8.4.1 released


      05/10/2009 - GLM 0.8.4.1 released

      Groove

      This version fixes few bugs and provides an major update of the manual thanks to Damian Trebilco. -

      Download: GLM 0.8.4.1 (zip, 1.1 MB)
      Download: GLM 0.8.4.1 (7z, 443 KB)
      Link: Full changelog

      16/09/2009 - GLM 0.8.4.0 released


      16/09/2009 - GLM 0.8.4.0 released

      Groove

      This new version mainly adds support for Visual Studio 2010 and GCC 4.4. It also provides various code optimization, bug fixes and an extension. -

      Download: GLM 0.8.4.0 (zip, 1.1 MB)
      Download: GLM 0.8.4.0 (7z, 439 KB)
      Link: Full changelog

      11/08/2009 - GLM 0.8.3.5 released


      11/08/2009 - GLM 0.8.3.5 released

      Groove

      Fixed extension bugs introduced by core update. -

      Download: GLM 0.8.3.5 (zip, 971 KB)
      Download: GLM 0.8.3.5 (7z, 405 KB)
      Link: Full changelog

      10/08/2009 - GLM 0.8.3.4 released


      10/08/2009 - GLM 0.8.3.4 released

      Groove

      Fixed varius bugs. Move determinant fonction to core following GLSL 1.5 specification. -

      Download: GLM 0.8.3.4 (zip, 971 KB)
      Download: GLM 0.8.3.4 (7z, 405 KB)
      Link: Full changelog

      25/06/2009 - GLM 0.8.3.3 released


      25/06/2009 - GLM 0.8.3.3 released

      Groove

      Fixed varius bugs. -

      Download: GLM 0.8.3.3 (zip, 971 KB)
      Download: GLM 0.8.3.3 (7z, 405 KB)
      Link: Full changelog

      04/06/2009 - GLM 0.8.3.2 released


      04/06/2009 - GLM 0.8.3.2 released

      Groove

      Add GLM_GTC_quaternion and GLM_GTC_type_precision extensions both subset of GLM_GTX_quaternion and GLM_GTX_number_precision -

      Download: GLM 0.8.3.2 (zip, 971 KB)
      Download: GLM 0.8.3.2 (7z, 405 KB)
      Link: Full changelog

      21/05/2009 - GLM 0.8.3.1 released


      21/05/2009 - GLM 0.8.3.1 released

      Groove

      The old way to use extensions have been fixed and GLM_GTX_bit extension gets updated with more functions to manipulate bit fields. -

      Download: GLM 0.8.3.1 (zip, 954 KB)
      Download: GLM 0.8.3.1 (7z, 402 KB)
      Link: Full changelog

      06/05/2009 - GLM 0.8.3.0 released


      06/05/2009 - GLM 0.8.3.0 released

      Groove

      This version brings to main changed: Stable extensions and a new extension system.

      The first stable GLM extensions are: GLM_GTC_double_float and GLM_GTC_half_float for higher and lower vectors and matrices floating point precision. GLM_GTC_matrix_operation provides determinant and inverse matrix calculation. GLM_GTC_matrix_transform allows to build scale, rotate and translate matrices and GLM_GTC_matrix_projection provides varius functions to build projection matrices. Few stable extensions yet but the number is going to grow with the next release! @@ -192,11 +206,11 @@ Both GLM 0.8.2.x extensions use method are deprecated (but still working) and replace by a new one. If you wnat to use GLM_GTC_half_float just include "glm/gtc/half_float.hpp" and it is going to be included in GLM namespace.

      Finally, quite some file have been renamed, using "hpp" instead of ".h". Old file have been deprecated but are still available so that GLM 0.8.3.0 is fully compatible with GLM 0.8.2.x. -

      Download: GLM 0.8.3.0 (zip, 896 KB)
      Download: GLM 0.8.3.0 (7z, 359 KB)
      Link: Code samples page
      Link: Manual
      Link: Full changelog

      01/04/2009 - GLM 0.8.2.3 released


      13/02/2009 - GLM 0.8.2.1 released


      01/04/2009 - GLM 0.8.2.3 released


      13/02/2009 - GLM 0.8.2.1 released

      Groove

      A new release is available and inogurate a patch number. The goal of this patch number is to release faster fixes from bug reports. -

      Download: GLM 0.8.2.1 (zip, 963 KB)
      Download: GLM 0.8.2.1 (7z, 381 KB)
      Link: Manual
      Link: Full changelog

      21/01/2009 - GLM 0.8.2 released


      21/01/2009 - GLM 0.8.2 released

      Groove

      This release only fixes bugs. Left sided swizzle operators, quaternion operators, vectors access operators for the main onces. -

      Download: GLM 0.8.2 (zip, 963 KB)
      Download: GLM 0.8.2 (7z, 381 KB)
      Link: Manual
      Link: Full changelog

      19/11/2008 - GLM current developments


      19/11/2008 - GLM current developments

      Groove

      Some artifacts have been added to the tracker to give a picture of what you could expect for the next releases.

      If you need something else you can add some artifacts to the tracker. Any comment on added entries is welcome. @@ -204,9 +218,9 @@ Furthermore, no more release of GLM 0.7.x will be done. Please upgrade to GLM 0.8.1.

      Finally, a pack of programmable oriented OpenGL samples using GLM is under development and planed to be release in December. -

      Link: Tracker

      30/10/2008 - GLM 0.8.1 released

      +

      Link: Tracker

      30/10/2008 - GLM 0.8.1 released

      Groove

      GLM 0.8.1 is released. This new version mainly fixes 64 bit integers with GCC and various bugs. -

      Download: GLM 0.8.1 (zip, 938 KB)
      Download: GLM 0.8.1 (7z, 372 KB)
      Link: GLM 0.8.1 Manual
      Link: Full changelog

      23/10/2008 - GLM 0.8.0 final released


      23/10/2008 - GLM 0.8.0 final released

      Groove

      GLM 0.8.0 is released. This new version is now based on GLSL 1.30 specification which provided new functions and precision qualifiers.

      Beyond this, lot of changes have been done to make GLM easier to use, easier to develop, more reliable, more conform to C++ ISO98 standard and GLSL specifications. @@ -218,39 +232,39 @@ On GLM extension side, the mechanism to use them has changed. The old [__]***GTX way doesn't exist anymore. Have a look on the manual for more information.

      Have a look on the manual and the changelog for more information. Don't forget to send your feedback and enjoy! -

      Download: GLM 0.8.0 (zip, 936 KB)
      Download: GLM 0.8.0 (7z, 370 KB)
      Link: GLM 0.8.0 Manual
      Link: Full changelog
      Link: Post a comment

      22/10/2008 - A Humus demo to feature GLM 0.8.0


      22/10/2008 - A Humus demo to feature GLM 0.8.0

      Groove

      Ambient aperture lighting Humus demo have been updated to use GLM as math library. -

      Download: Updated demo + all sources (zip, 2.38 MB)
      Download: Original demo (zip, 1.40 MB)
      Link: Post a comment

      18/10/2008 - Webside updated


      18/10/2008 - Webside updated

      Groove

      As you can see the website get a little update to prepare GLM 0.8.0 final release.

      GLM 0.8.0 final should be release during the week. -


      10/10/2008 - GLM 0.8.0 beta 3 released

      +


      10/10/2008 - GLM 0.8.0 beta 3 released

      Groove

      This release fixes some bugs and add few features though extensions. The development is now based on CMake to make easier cross platform tests and project management. -

      Download: GLM 0.8.0 Beta 3 (zip, 819 KB)
      Download: GLM 0.8.0 Beta 3 (7z, 345 KB)
      Link: Full changelog
      Link: Post a comment

      04/10/2008 - GLM 0.8.0 beta 2 released


      04/10/2008 - GLM 0.8.0 beta 2 released

      Groove

      This release mainly improves half float vectors support. By default the low precission vectors are based on float numbers not on half numbers

      It also provides new setup options. GLM_USE_ONLY_XYZW to disable multiple names to access to a single vector component. GLM_USE_ANONYMOUS_UNION to allow multiple component names on half vectors with Visual C++.

      Various bugs and updates of extensions have been done too. Final release is coming... -

      Download: GLM 0.8.0 Beta 2 (zip, 798 KB)
      Download: GLM 0.8.0 Beta 2 (7z, 327 KB)
      Link: Full changelog
      Link: Post a comment

      26/09/2008 - GLM 0.8.0 beta 1 released


      26/09/2008 - GLM 0.8.0 beta 1 released

      Groove

      GLM have been updated to support GLSL 1.30. API documentation had significant improvements to make easier finding of GLSL functions and types.

      GLM 0.8.x is NOT backward compatible with GLM 0.7.x. Upgrade to GLM 0.8.x could involve build errors for the following cases: A lot of improvements have been made to increase the conformance with GLSL specification. Lot of GLSL 1.30 features were already exposed in extensions that have been deleted. The extension syntaxe based on ARB convension is no long used.

      Due to the number of changes GLM 0.8.0 is release as beta first. The final release is schedule for october. -

      Download: GLM 0.8.0 Beta 1 (zip, 786 KB)
      Download: GLM 0.8.0 Beta 1 (7z, 321 KB)
      Link: Full changelog
      Link: Post a comment

      08/08/2008 - GLM 0.7.6 released


      08/08/2008 - GLM 0.7.6 released

      Groove

      GLM 0.7.6 provides a better C++ conformance so that you can build GLM with –pedantic G++ parameter or without Visual Studio extensions. To make GLM more reliable, BOOST_STATIC_ASSERT are used according developer wishes. -

      Download: GLM 0.7.6 (zip, 907 KB)
      Download: GLM 0.7.6 (7z, 387 KB)
      Link: Full changelog
      Link: Manual

      05/07/2008 - GLM 0.7.5 released


      05/07/2008 - GLM 0.7.5 released

      Groove

      GLM 0.7.5 is available and introduces a new build messsage system to get information of GLM build configuration with Visual Studio. This mechanism is documented in section 6 of GLM manual. Also, GLM can be built with GCC pedantic options. -

      Download: GLM 0.7.5 (zip, 852 KB)
      Download: GLM 0.7.5 (7z, 366 KB)
      Link: Full changelog
      Link: Manual

      01/06/2008 - GLM 0.7.4 released


      01/06/2008 - GLM 0.7.4 released

      Groove

      GLM 0.7.4 introduces a new system to manage external dependencies.

      It allows developing extension using external dependencies like GLEW, Boost, etc. without making required those dependencies for GLM programmer that doesn't need those external dependent extensions.

      The mechanism is described into the updated manual. -

      Download: GLM 0.7.4 (zip, 859 KB)
      Download: GLM 0.7.4 (7z, 372 KB)
      Link: Full changelog
      Link: Manual

      24/05/2008 - GLM 0.7.3 released


      24/05/2008 - GLM 0.7.3 released

      Groove

      GLM 0.7.3 is released. This version fixes few bugs and add few extensions -

      Download: GLM 0.7.3 (zip, 1.8 MB)
      Download: GLM 0.7.3 (7z, 635 KB)
      Link: Full changelog

      27/04/2008 - GLM 0.7.2 released


      27/04/2008 - GLM 0.7.2 released

      Groove

      GLM 0.7.2 is released. The documentation have been completed again and several issues handle with precompiler options.

      #define GLM_SWIZZLE GLM_SWIZZLE_FUNC allows to use swizzle operators with internal functions. For example, glm::vec3(1, 2, 3).zyx is replaced by glm::vec3(1, 2, 3)._zyx() with this option. @@ -260,25 +274,25 @@ #define GLM_AUTO_CAST GLM_DISABLE allows to disable automatic cast (eg: glLoadMatrixf(glm::mat4(1.0))) which could involve unfortunate issues in some cases.

      More information on these topic are available in GLM manual section 5 "Known issues". -

      Download: GLM 0.7.2 (zip, 1.8 MB)
      Download: GLM 0.7.2 (7z, 635 KB)
      Download: Full changelog

      24/03/2008 - GLM 0.7.1 released


      24/03/2008 - GLM 0.7.1 released

      Groove

      GLM 0.7.1 is available under MIT license. It fixes bugs with GCC. -

      Download: GLM 0.7.1 (zip, 1.8 MB)
      Download: GLM 0.7.1 (7z, 635 KB)
      Download: Full changelog

      22/03/2008 - GLM 0.7.0 released


      22/03/2008 - GLM 0.7.0 released

      Groove

      GLM 0.7.0 is available under MIT license. LGPL lisence have been discard due to an issue of use for console development. This release contains a lot better documentation based on Doxygen. Lot of bugs have been fixed and the documentation completed. Thanks to all people that has contributed thought bug reports and ideas to make this version a lot better! -

      Download: GLM 0.7.0 (zip, 1.8 MB)
      Download: GLM 0.7.0 (7z, 635 KB)
      Download: Full changelog

      10/12/2007 - GLM 0.6.4 released


      10/12/2007 - GLM 0.6.4 released

      Groove

      GLM 0.6.4 is available and fixes some swizzle operator issues. -

      Download: GLM 0.6.4 (zip, 1.7 MB)
      Download: GLM 0.6.4 (7z, 612 KB)
      Download: Full changelog

      05/11/2007 - GLM 0.6.3 released


      05/11/2007 - GLM 0.6.3 released

      Groove

      GLM 0.6.3 fixes accesses of matrices and a 3DSMax SDK conflict. -

      Download: GLM 0.6.3 (zip, 1.8 MB)
      Download: GLM 0.6.3 (7z, 633 KB)
      Download: Full changelog

      08/10/2007 - GLM 0.6.2 released


      08/10/2007 - GLM 0.6.2 released

      Groove

      GLM 0.6.2 fixes an error on an extension. -

      Download: GLM 0.6.2 (zip, 1.8 MB)
      Download: GLM 0.6.2 (7z, 632 KB)
      Download: Full changelog

      07/10/2007 - GLM 0.6.1 released


      07/10/2007 - GLM 0.6.1 released

      Groove

      GLM 0.6.1 is a minor update that fix an issue on extension namespace and add two more extensions. -

      Download: GLM 0.6.1 (zip, 1.8 MB)
      Download: GLM 0.6.1 (7z, 632 KB)
      Download: Full changelog

      16/09/2007 - GLM 0.6.0 released


      16/09/2007 - GLM 0.6.0 released

      Groove

      GLM 0.6.0 is available. For this release, work focus on extensions. A new mecanisum allows to integrate GLM extensions as it is actually done for GLSL extension by vendors. Lot of new extensions have been added. -

      Download: GLM 0.6.0 (zip, 1.8 MB)
      Download: GLM 0.6.0 (7z, 666 KB)
      Download: Raytracer v1.0 (exe)
      Download: Raytracer v1.0 (zip)
      Download: Full changelog

      19/02/2007 - GLM 0.5.1 released


      19/02/2007 - GLM 0.5.1 released

      Groove

      This release fixes some issues with swizzle operators. -

      Download: GLM 0.5.1 (zip, 2.3 MB)
      Download: GLM 0.5.1 (7z, 789 KB)

      26/01/2007 - Cattmull Clark subdivision sample


      26/01/2007 - Cattmull Clark subdivision sample

      Groove

      A new sample is available. It's an update of Philip Rideout's Catmull Clark subdivision program that uses GLM. Released with pleasant permission of Philip Rideout. -

      Download: CatmullClark sample (zip, 605 KB)

      06/01/2007 - GLM 0.5.0 released


      06/01/2007 - GLM 0.5.0 released

      Groove

      This release include GLSL 1.2 new feature in the core implementation. Also, it includes swizzle read and write operators and a custom options system to setup GLM.

      It includes some new extensions to extend GLSL features but they remain experimental. The next release should provide the first stable extensions. @@ -286,39 +300,39 @@ The GLM 0.5.0 packages contain some basic samples and some documentation. The ray tracer sample has been updated to GLM 0.5.0. Except for specific cases, especially with extensions, GLM 0.5 is backward compatible.

      Now, GLM development is taking advantages of SourceForge.net services: a bug tracker system and the development source code is publicly available on SF.net SVN server. -

      Download: GLM 0.5.0 (zip, 2.4 MB)
      Download: GLM 0.5.0 (7z, 843 KB)
      Download: Raytracer b3.0 (exe, 751 KB)
      Download: Raytracer b3.0 (zip, 1.1 MB)

      22/05/2006 - GLM 0.4.1 released


      22/05/2006 - GLM 0.4.1 released

      Groove

      A GLM update is available. It simply includes some examples for a sweet start with GLM.

      The examples show how to use GLM with OpenGL intermediate mode and OpenGL vertex arrays. Also, they show how to use GLM extensions to replace GLU and OpenGL function witch could slightly increase performances by decreasing the number of OpenGL states changes. -

      Download: GLM 0.4.1 (zip, 1.6 MB)
      Download: GLM 0.4.1 (7z, 521 KB)

      17/05/2006 - GLM 0.4.0 released


      17/05/2006 - GLM 0.4.0 released

      Groove

      This release introduces first GLSL 1.2 features as planed. Also, various new extensions have been added and updated. Finally, it's not anymore required to include windows.h before glm.h when windows.h is required.

      The number of features of GLM, including extensions, start to really increase the compilation time. That's why it's recommended to use precompiled headers. -

      Download: GLM 0.4.0

      23/04/2006 - Roadmap for the years

      +

      Download: GLM 0.4.0

      23/04/2006 - Roadmap for the years

      Groove

      Version 0.4 will complete matrices and vectors operators and will add GLSL 1.2 features. First, conversions simplifications will be integrated. Then, 4 per 3 matrices and outer product will be available from extensions. The transpose function is already available from extension.

      Version 0.5 will integrate GLSL 1.2 features to GLM core.

      Version 0.6 will add swizzle operators in reading and writing. (eg: vec3 v1(1.0, 2.0, 3.0); vec3 v2 = v1.xxx; v1.zyx = v;). -


      22/04/2006 - GLM 0.3.2 released

      +


      22/04/2006 - GLM 0.3.2 released

      Groove

      This release corrects two main bugs. First, a bug of the imat4 and mat4 division operators and other correct the vectors components access from texture coordinate way. -

      Download: GLM 0.3.2

      28/03/2006 - GLM 0.3.1 released

      +

      Download: GLM 0.3.2

      28/03/2006 - GLM 0.3.1 released

      Groove

      This update adds GCC 4.0 support for MacOS X and Linux and GCC 4.1 under Linux. Also, its provides some optimisations.

      Further release will prodive GLSL 1.2 compliances. -

      Download: GLM 0.3.1

      19/02/2006 - GLM 0.3 released

      +

      Download: GLM 0.3.1

      19/02/2006 - GLM 0.3 released

      Groove

      A new release of GLM is now available. It improves GLSL data type conversion and construction compliance. Also, It's adds extensions like some to manage double-precision and half-precision float numbers. Finally a Doxygen documentation has been added.

      This new release have been tested under Visual C++ 7.1, Visual C++ 8.0, GCC 3.2.3 et GCC 3.4.2. -

      Download: GLM 0.3
      Download: Raytrace
      Documentation: Online documentation

      06/05/2005 - GLM 0.2 released

      +

      Download: GLM 0.3
      Download: Raytrace
      Documentation: Online documentation

      06/05/2005 - GLM 0.2 released

      Groove

      A new release of GLM is now available. A few bugs have been fixed, the portability of GLSL into C++ has been improved, and new experimental extensions have been implemented, enhancing GLSL features.

      Project now supports quaternions, adds new features to handle colors, vectors and matrices. For example, GLM allows base colors changing, vector projected operations, and 2D/3D transforms.

      To demo the features of this new version, a sample program is included. It is a simple Ray Tracer supporting reflected and refracted rays, three lights types (point, directionnal and spot), two objects types (sphere, plan), using all of the GLM possibilities. -


      04/05/2005 - English pages

      +


      04/05/2005 - English pages

      Groove

      The english section of this site is now available. -


      21/02/2005 - GLM 0.1 is available

      +


      21/02/2005 - GLM 0.1 is available

      Groove

      This is the first public availability of GLM. This library supports part of GLSL specifications : All vectors and matrices types, and all the operators and associated functions.

      For now, there isn't detailed documentation, but you can freely have a look on GLSL specifications. Consider any incoherence with GLM as an error. Keep in mind the library is included in the namespace "glm". diff --git a/doc/src/data.xml b/doc/src/data.xml index fdfaa64a..0a53ba5a 100644 --- a/doc/src/data.xml +++ b/doc/src/data.xml @@ -3,7 +3,7 @@

      - + @@ -65,7 +65,7 @@
      - + @@ -154,9 +154,9 @@ - + - The main improvement of this version comes from the extented number of matrix contructors so that a programmer can used diffent scalar types for each parameter. + The main improvement of this version comes from the extended number of matrix constructors so that a programmer can used different scalar types for each parameter. @@ -183,7 +183,7 @@ - The quaternion implementation has been updated as well, fixing the various slerp implementation flavour (mix, shortMix and fastMix) and providing more completeness: Added interaction with GLM_GTX_epsilon and missing lowp_quat, mediump_quat and highp_quat but also none square matrix equivalents. + The quaternion implementation has been updated as well, fixing the various slerp implementation flavours (mix, shortMix and fastMix) and providing more completeness: Added interaction with GLM_GTX_epsilon and missing lowp_quat, mediump_quat and highp_quat but also none square matrix equivalents. Finally, some efforts have been put to remove warnings across all supported compilers. diff --git a/doc/src/news.xsl b/doc/src/news.xsl index 59c736f6..3ae1682a 100644 --- a/doc/src/news.xsl +++ b/doc/src/news.xsl @@ -60,10 +60,7 @@
      - - - - +

      diff --git a/doc/src/util.xsl b/doc/src/util.xsl index d33980f8..fbcc86f7 100644 --- a/doc/src/util.xsl +++ b/doc/src/util.xsl @@ -171,20 +171,22 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
      diff --git a/glm/core/func_common.hpp b/glm/core/func_common.hpp index ec564bf8..1af20fad 100644 --- a/glm/core/func_common.hpp +++ b/glm/core/func_common.hpp @@ -14,14 +14,9 @@ namespace glm { - namespace test{ - void main_core_func_common(); - }//namespace test - namespace core{ namespace function{ - //! Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. - namespace common{ + namespace common{ //!< Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. /// \addtogroup core_funcs ///@{ @@ -330,7 +325,6 @@ namespace glm genType ldexp(genType const & x, genIType const & exp); ///@} - }//namespace common }//namespace function }//namespace core diff --git a/glm/core/func_exponential.hpp b/glm/core/func_exponential.hpp index 7871397f..c3bc0bd2 100644 --- a/glm/core/func_exponential.hpp +++ b/glm/core/func_exponential.hpp @@ -12,10 +12,6 @@ namespace glm { - namespace test{ - void main_core_func_exponential(); - }//namespace test - namespace core{ namespace function{ //! Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace. 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 198397fe..102e6563 100644 --- a/glm/core/type_mat2x2.hpp +++ b/glm/core/type_mat2x2.hpp @@ -12,277 +12,268 @@ #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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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); + ////////////////////////////////////// + // Conversions + template + GLM_FUNC_DECL explicit tmat2x2( + U const & x); - 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); + 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 78403fdc..0c6e185f 100644 --- a/glm/core/type_mat2x3.hpp +++ b/glm/core/type_mat2x3.hpp @@ -12,223 +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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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; - - 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); + 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); - ////////////////////////////////////// - // 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 6801e7cb..9a56feb1 100644 --- a/glm/core/type_mat2x4.hpp +++ b/glm/core/type_mat2x4.hpp @@ -12,221 +12,212 @@ #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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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 f6d937d8..0f8feb9e 100644 --- a/glm/core/type_mat3x2.hpp +++ b/glm/core/type_mat3x2.hpp @@ -12,227 +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 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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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 2e711fa1..582a0d80 100644 --- a/glm/core/type_mat3x3.hpp +++ b/glm/core/type_mat3x3.hpp @@ -12,278 +12,270 @@ #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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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 7b36f90c..1450f2ce 100644 --- a/glm/core/type_mat3x4.hpp +++ b/glm/core/type_mat3x4.hpp @@ -12,227 +12,219 @@ #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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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 d28612b7..ba6486aa 100644 --- a/glm/core/type_mat4x2.hpp +++ b/glm/core/type_mat4x2.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 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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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 ef3fd4ba..3e3e5804 100644 --- a/glm/core/type_mat4x3.hpp +++ b/glm/core/type_mat4x3.hpp @@ -12,236 +12,230 @@ #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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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 baaed775..212b59d2 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,284 +12,276 @@ #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; + GLM_FUNC_DECL size_type length() const; + 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; - GLM_FUNC_DECL size_type length() const; - 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 diff --git a/readme.txt b/readme.txt index 33f5726a..7413a3f8 100644 --- a/readme.txt +++ b/readme.txt @@ -1,13 +1,13 @@ ================================================================================ -G-Truc Creation +OpenGL Mathematics (GLM) -------------------------------------------------------------------------------- -www.g-truc.net +glm.g-truc.net glm@g-truc.net ================================================================================ The MIT License -------------------------------------------------------------------------------- -Copyright (c) 2005 - 2011 G-Truc Creation +Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ More informations in GLM manual: http://glm.g-truc.net/glm-0.9.2.pdf ================================================================================ -GLM 0.9.2.2: 2011-06-XX +GLM 0.9.2.2: 2011-06-02 -------------------------------------------------------------------------------- - Expend matrix constructors flexibility - Improved quaternion implementation