Home | History | Annotate | Download | only in gtx
      1 ///////////////////////////////////////////////////////////////////////////////////
      2 /// OpenGL Mathematics (glm.g-truc.net)
      3 ///
      4 /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
      5 /// Permission is hereby granted, free of charge, to any person obtaining a copy
      6 /// of this software and associated documentation files (the "Software"), to deal
      7 /// in the Software without restriction, including without limitation the rights
      8 /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
      9 /// copies of the Software, and to permit persons to whom the Software is
     10 /// furnished to do so, subject to the following conditions:
     11 ///
     12 /// The above copyright notice and this permission notice shall be included in
     13 /// all copies or substantial portions of the Software.
     14 ///
     15 /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     16 /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     17 /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     18 /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     19 /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     20 /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     21 /// THE SOFTWARE.
     22 ///
     23 /// @ref gtx_matrix_operation
     24 /// @file glm/gtx/matrix_operation.hpp
     25 /// @date 2009-08-29 / 2011-06-07
     26 /// @author Christophe Riccio
     27 ///
     28 /// @see core (dependence)
     29 ///
     30 /// @defgroup gtx_matrix_operation GLM_GTX_matrix_operation
     31 /// @ingroup gtx
     32 ///
     33 /// @brief Build diagonal matrices from vectors.
     34 ///
     35 /// <glm/gtx/matrix_operation.hpp> need to be included to use these functionalities.
     36 ///////////////////////////////////////////////////////////////////////////////////
     37 
     38 #ifndef GLM_GTX_matrix_operation
     39 #define GLM_GTX_matrix_operation
     40 
     41 // Dependency:
     42 #include "../glm.hpp"
     43 
     44 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
     45 #	pragma message("GLM: GLM_GTX_matrix_operation extension included")
     46 #endif
     47 
     48 namespace glm
     49 {
     50 	/// @addtogroup gtx_matrix_operation
     51 	/// @{
     52 
     53 	//! Build a diagonal matrix.
     54 	//! From GLM_GTX_matrix_operation extension.
     55 	template <typename T, precision P>
     56 	GLM_FUNC_DECL detail::tmat2x2<T, P> diagonal2x2(
     57 		detail::tvec2<T, P> const & v);
     58 
     59 	//! Build a diagonal matrix.
     60 	//! From GLM_GTX_matrix_operation extension.
     61 	template <typename T, precision P>
     62 	GLM_FUNC_DECL detail::tmat2x3<T, P> diagonal2x3(
     63 		detail::tvec2<T, P> const & v);
     64 
     65 	//! Build a diagonal matrix.
     66 	//! From GLM_GTX_matrix_operation extension.
     67 	template <typename T, precision P>
     68 	GLM_FUNC_DECL detail::tmat2x4<T, P> diagonal2x4(
     69 		detail::tvec2<T, P> const & v);
     70 
     71 	//! Build a diagonal matrix.
     72 	//! From GLM_GTX_matrix_operation extension.
     73 	template <typename T, precision P>
     74 	GLM_FUNC_DECL detail::tmat3x2<T, P> diagonal3x2(
     75 		detail::tvec2<T, P> const & v);
     76 
     77 	//! Build a diagonal matrix.
     78 	//! From GLM_GTX_matrix_operation extension.
     79 	template <typename T, precision P>
     80 	GLM_FUNC_DECL detail::tmat3x3<T, P> diagonal3x3(
     81 		detail::tvec3<T, P> const & v);
     82 
     83 	//! Build a diagonal matrix.
     84 	//! From GLM_GTX_matrix_operation extension.
     85 	template <typename T, precision P>
     86 	GLM_FUNC_DECL detail::tmat3x4<T, P> diagonal3x4(
     87 		detail::tvec3<T, P> const & v);
     88 
     89 	//! Build a diagonal matrix.
     90 	//! From GLM_GTX_matrix_operation extension.
     91 	template <typename T, precision P>
     92 	GLM_FUNC_DECL detail::tmat4x2<T, P> diagonal4x2(
     93 		detail::tvec2<T, P> const & v);
     94 
     95 	//! Build a diagonal matrix.
     96 	//! From GLM_GTX_matrix_operation extension.
     97 	template <typename T, precision P>
     98 	GLM_FUNC_DECL detail::tmat4x3<T, P> diagonal4x3(
     99 		detail::tvec3<T, P> const & v);
    100 
    101 	//! Build a diagonal matrix.
    102 	//! From GLM_GTX_matrix_operation extension.
    103 	template <typename T, precision P>
    104 	GLM_FUNC_DECL detail::tmat4x4<T, P> diagonal4x4(
    105 		detail::tvec4<T, P> const & v);
    106 
    107 	/// @}
    108 }//namespace glm
    109 
    110 #include "matrix_operation.inl"
    111 
    112 #endif//GLM_GTX_matrix_operation
    113