From 7566152ba03b87f8eab3186c4ec3b23d1768e883 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 13 Dec 2010 12:00:48 +0000 Subject: [PATCH] Refactored extensions --- glm/gtc/matrix_operation.hpp | 33 -------------- glm/gtc/matrix_operation.inl | 17 -------- glm/gtc/matrix_projection.hpp | 40 ----------------- glm/gtc/matrix_projection.inl | 17 -------- glm/gtx/determinant.hpp | 43 ------------------- glm/gtx/determinant.inl | 13 ------ glm/gtx/matrix_access.hpp | 48 --------------------- glm/gtx/matrix_access.inl | 40 ----------------- glm/gtx/matrix_projection.hpp | 63 --------------------------- glm/gtx/matrix_projection.inl | 81 ----------------------------------- glm/gtx/matrix_selection.hpp | 79 ---------------------------------- glm/gtx/matrix_selection.inl | 65 ---------------------------- glm/gtx/simd_mat4.hpp | 0 glm/gtx/simd_mat4.inl | 0 glm/gtx/simd_vec4.hpp | 0 glm/gtx/simd_vec4.inl | 0 16 files changed, 539 deletions(-) delete mode 100644 glm/gtc/matrix_operation.hpp delete mode 100644 glm/gtc/matrix_operation.inl delete mode 100644 glm/gtc/matrix_projection.hpp delete mode 100644 glm/gtc/matrix_projection.inl delete mode 100644 glm/gtx/determinant.hpp delete mode 100644 glm/gtx/determinant.inl delete mode 100644 glm/gtx/matrix_access.hpp delete mode 100644 glm/gtx/matrix_access.inl delete mode 100644 glm/gtx/matrix_projection.hpp delete mode 100644 glm/gtx/matrix_projection.inl delete mode 100644 glm/gtx/matrix_selection.hpp delete mode 100644 glm/gtx/matrix_selection.inl create mode 100644 glm/gtx/simd_mat4.hpp create mode 100644 glm/gtx/simd_mat4.inl create mode 100644 glm/gtx/simd_vec4.hpp create mode 100644 glm/gtx/simd_vec4.inl diff --git a/glm/gtc/matrix_operation.hpp b/glm/gtc/matrix_operation.hpp deleted file mode 100644 index e1fb3003..00000000 --- a/glm/gtc/matrix_operation.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-04-29 -// Updated : 2009-04-29 -// Licence : This source is under MIT License -// File : glm/gtc/matrix_operation.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtc_matrix_operation -#define glm_gtc_matrix_operation - -// Dependency: -#include "../glm.hpp" - -namespace glm{ -namespace gtc{ -//! GLM_GTC_matrix_operation extension: Matrix operation functions -namespace matrix_operation -{ - -}//namespace matrix_operation -}//namespace gtc -}//namespace glm - -#include "matrix_operation.inl" - -namespace glm{using namespace gtc::matrix_operation;} - -#endif//glm_gtc_matrix_operation diff --git a/glm/gtc/matrix_operation.inl b/glm/gtc/matrix_operation.inl deleted file mode 100644 index e28fb547..00000000 --- a/glm/gtc/matrix_operation.inl +++ /dev/null @@ -1,17 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-04-29 -// Updated : 2009-04-29 -// Licence : This source is under MIT License -// File : glm/gtc/matrix_operation.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace gtc{ -namespace matrix_operation -{ - -}//namespace matrix_operation -}//namespace gtc -}//namespace glm diff --git a/glm/gtc/matrix_projection.hpp b/glm/gtc/matrix_projection.hpp deleted file mode 100644 index b08a92df..00000000 --- a/glm/gtc/matrix_projection.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-04-29 -// Updated : 2010-02-07 -// Licence : This source is under MIT License -// File : glm/gtc/matrix_projection.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTC_matrix_operation -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtc_matrix_projection -#define glm_gtc_matrix_projection - -// Dependency: -#include "../glm.hpp" - -namespace glm -{ - namespace test{ - bool main_gtc_matrix_projection(); - }//namespace test - - namespace gtc{ - //! GLM_GTC_matrix_projection: Varius ways to build and operate on projection matrices - namespace matrix_projection - { - - - }//namespace matrix_projection - }//namespace gtc -}//namespace glm - -#include "matrix_projection.inl" - -namespace glm{using namespace gtc::matrix_projection;} - -#endif//glm_gtc_matrix_projection diff --git a/glm/gtc/matrix_projection.inl b/glm/gtc/matrix_projection.inl deleted file mode 100644 index 70b36691..00000000 --- a/glm/gtc/matrix_projection.inl +++ /dev/null @@ -1,17 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-04-29 -// Updated : 2010-02-07 -// Licence : This source is under MIT License -// File : glm/gtc/matrix_projection.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace gtc{ -namespace matrix_projection -{ - -}//namespace matrix_projection -}//namespace gtc -}//namespace glm diff --git a/glm/gtx/determinant.hpp b/glm/gtx/determinant.hpp deleted file mode 100644 index 0652d58e..00000000 --- a/glm/gtx/determinant.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2008-04-23 -// Licence : This source is under MIT License -// File : glm/gtx/determinant.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_determinant -#define glm_gtx_determinant - -// Dependency: -#include "../glm.hpp" -#include "../gtc/matrix_operation.hpp" - -namespace glm -{ - namespace test{ - void main_gtx_determinant(); - }//namespace test - - namespace gtx{ - //! GLM_GTX_determinant extension: Compute the determinant of a matrix - namespace determinant - { - using namespace gtc::matrix_operation; - - }//namespace determinant - }//namespace gtx -}//namespace glm - -#define GLM_GTX_determinant namespace gtx::determinant -#ifndef GLM_GTX_GLOBAL -namespace glm {using GLM_GTX_determinant;} -#endif//GLM_GTC_GLOBAL - -#include "determinant.inl" - -#endif//glm_gtx_determinant diff --git a/glm/gtx/determinant.inl b/glm/gtx/determinant.inl deleted file mode 100644 index 4d577cec..00000000 --- a/glm/gtx/determinant.inl +++ /dev/null @@ -1,13 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under MIT License -// File : glm/gtx/determinant.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - -} diff --git a/glm/gtx/matrix_access.hpp b/glm/gtx/matrix_access.hpp deleted file mode 100644 index 6392ca86..00000000 --- a/glm/gtx/matrix_access.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-27 -// Updated : 2006-12-06 -// Licence : This source is under MIT License -// File : glm/gtx/matrix_access.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_matrix_access -#define glm_gtx_matrix_access - -// Dependency: -#include "../glm.hpp" - -namespace glm{ -namespace gtx{ -//! GLM_GTX_matrix_access extension: Set a column or a row of a matrix -namespace matrix_access -{ - //! Set a specific row to a matrix. - //! From GLM_GTX_matrix_access extension. - template - genType row( - const genType& m, - int index, - typename genType::row_type const & x); - - //! Set a specific column to a matrix. - //! From GLM_GTX_matrix_access extension. - template - genType column( - const genType& m, - int index, - typename genType::col_type const & x); - -}//namespace matrix_access -}//namespace gtx -}//namespace glm - -#include "matrix_access.inl" - -namespace glm{using namespace gtx::matrix_access;} - -#endif//glm_gtx_matrix_access diff --git a/glm/gtx/matrix_access.inl b/glm/gtx/matrix_access.inl deleted file mode 100644 index 85cfa3f6..00000000 --- a/glm/gtx/matrix_access.inl +++ /dev/null @@ -1,40 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-27 -// Updated : 2005-12-27 -// Licence : This source is under MIT License -// File : glm/gtx/matrix_access.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace gtx{ -namespace matrix_access{ - - template - inline genType row( - genType const & m, - int index, - typename genType::row_type const & x) - { - genType Result = m; - for(typename genType::size_type i = 0; i < genType::row_size(); ++i) - Result[i][index] = x[i]; - return Result; - } - - template - inline genType column( - genType const & m, - int index, - typename genType::col_type const & x) - { - genType Result = m; - Result[index] = x; - return Result; - } - -}//namespace matrix_access -}//namespace gtx -}//namespace glm - diff --git a/glm/gtx/matrix_projection.hpp b/glm/gtx/matrix_projection.hpp deleted file mode 100644 index 9c735d5d..00000000 --- a/glm/gtx/matrix_projection.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2009-04-29 -// Licence : This source is under MIT License -// File : glm/gtx/matrix_projection.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTC_matrix_projection -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_matrix_projection -#define glm_gtx_matrix_projection - -// Dependency: -#include "../glm.hpp" -#include "../gtc/matrix_projection.hpp" - -namespace glm -{ - namespace test{ - void main_gtx_matrix_projection(); - }//namespace test - - namespace gtx{ - //! GLM_GTX_matrix_projection: Varius ways to build and operate on projection matrices - namespace matrix_projection - { - using namespace gtc::matrix_projection; - - //! Builds a perspective projection matrix based on a field of view - //! From GLM_GTX_matrix_projection extension. - template - detail::tmat4x4 perspectiveFov( - valType const & fov, - valType const & width, - valType const & height, - valType const & zNear, - valType const & zFar); - - //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite . - //! From GLM_GTX_matrix_projection extension. - template - detail::tmat4x4 infinitePerspective( - T fovy, T aspect, T zNear); - - //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - //! From GLM_GTX_matrix_projection extension. - template - detail::tmat4x4 tweakedInfinitePerspective( - T fovy, T aspect, T zNear); - - }//namespace matrix_projection - }//namespace gtx -}//namespace glm - -#include "matrix_projection.inl" - -namespace glm{using namespace gtx::matrix_projection;} - -#endif//glm_gtx_matrix_projection diff --git a/glm/gtx/matrix_projection.inl b/glm/gtx/matrix_projection.inl deleted file mode 100644 index 8bf9416e..00000000 --- a/glm/gtx/matrix_projection.inl +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2009-04-29 -// Licence : This source is under MIT License -// File : glm/gtx/matrix_projection.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace gtx{ -namespace matrix_projection -{ - template - inline detail::tmat4x4 perspectiveFov - ( - valType const & fov, - valType const & width, - valType const & height, - valType const & zNear, - valType const & zFar - ) - { - valType rad = glm::radians(fov); - valType h = glm::cos(valType(0.5) * rad) / glm::sin(valType(0.5) * rad); - valType w = h * height / width; - - detail::tmat4x4 Result(valType(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = (zFar + zNear) / (zFar - zNear); - Result[2][3] = valType(1); - Result[3][2] = -(valType(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - inline detail::tmat4x4 infinitePerspective( - T fovy, - T aspect, - T zNear) - { - T range = tan(radians(fovy / T(2))) * zNear; - T left = -range * aspect; - T right = range * aspect; - T bottom = -range; - T top = range; - - detail::tmat4x4 Result(T(0)); - Result[0][0] = (T(2) * zNear) / (right - left); - Result[1][1] = (T(2) * zNear) / (top - bottom); - Result[2][2] = - T(1); - Result[2][3] = - T(1); - Result[3][2] = - T(2) * zNear; - return Result; - } - - template - inline detail::tmat4x4 tweakedInfinitePerspective( - T fovy, - T aspect, - T zNear) - { - T range = tan(radians(fovy / T(2))) * zNear; - T left = -range * aspect; - T right = range * aspect; - T bottom = -range; - T top = range; - - detail::tmat4x4 Result(T(0)); - Result[0][0] = (T(2) * zNear) / (right - left); - Result[1][1] = (T(2) * zNear) / (top - bottom); - Result[2][2] = T(0.0001) - T(1); - Result[2][3] = T(-1); - Result[3][2] = - (T(0.0001) - T(2)) * zNear; - return Result; - } - -}//namespace matrix_projection -}//namespace gtc -}//namespace glm diff --git a/glm/gtx/matrix_selection.hpp b/glm/gtx/matrix_selection.hpp deleted file mode 100644 index 84ba12d6..00000000 --- a/glm/gtx/matrix_selection.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2009-02-19 -// Licence : This source is under MIT License -// File : glm/gtx/matrix_selection.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_gtx_matrix_selection -#define glm_gtx_matrix_selection - -// Dependency: -#include "../glm.hpp" - -namespace glm -{ - namespace test{ - void main_gtx_matrix_selection(); - }//namespace test - - namespace gtx{ - //! GLM_GTX_matrix_selection extension: Access to matrix columns or rows. - namespace matrix_selection - { - //! Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the row index. - //! From GLM_GTX_matrix_selection extension. - template - detail::tvec2 row( - const detail::tmat2x2& m, - int index); - - //! Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the row index. - //! From GLM_GTX_matrix_selection extension. - template - detail::tvec3 row( - const detail::tmat3x3& m, - int index); - - //! Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the row index. - //! From GLM_GTX_matrix_selection extension. - template - detail::tvec4 row( - const detail::tmat4x4& m, - int index); - - //! Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the column index. - //! From GLM_GTX_matrix_selection extension. - template - detail::tvec2 column( - const detail::tmat2x2& m, - int index); - - //! Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the column index. - //! From GLM_GTX_matrix_selection extension. - template - detail::tvec3 column( - const detail::tmat3x3& m, - int index); - - //! Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the column index. - //! From GLM_GTX_matrix_selection extension. - template - detail::tvec4 column( - const detail::tmat4x4& m, - int index); - - }//namespace matrix_selection - }//namespace gtx -}//namespace glm - -#include "matrix_selection.inl" - -namespace glm{using namespace gtx::matrix_selection;} - -#endif//glm_gtx_matrix_selection diff --git a/glm/gtx/matrix_selection.inl b/glm/gtx/matrix_selection.inl deleted file mode 100644 index 813c4b7d..00000000 --- a/glm/gtx/matrix_selection.inl +++ /dev/null @@ -1,65 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2009-02-19 -// Licence : This source is under MIT License -// File : glm/gtx/matrix_selection.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm{ -namespace gtx{ -namespace matrix_selection -{ - template - inline detail::tvec2 row( - const detail::tmat2x2& m, - int index) - { - return detail::tvec2(m[0][index], m[1][index]); - } - - template - inline detail::tvec3 row( - const detail::tmat3x3& m, - int index) - { - return detail::tvec3(m[0][index], m[1][index], m[2][index]); - } - - template - inline detail::tvec4 row( - const detail::tmat4x4& m, - int index) - { - return detail::tvec4(m[0][index], m[1][index], m[2][index], m[3][index]); - } - - template - inline detail::tvec2 column( - const detail::tmat2x2& m, - int index) - { - return m[index]; - } - - template - inline detail::tvec3 column( - const detail::tmat3x3& m, - int index) - { - return m[index]; - } - - template - inline detail::tvec4 column( - const detail::tmat4x4& m, - int index) - { - return m[index]; - } - -}//namespace matrix_selection -}//namespace gtx -}//namespace glm - diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp new file mode 100644 index 00000000..e69de29b diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl new file mode 100644 index 00000000..e69de29b