From: <pat...@us...> - 2012-09-21 13:54:37
|
Revision: 1279 http://ggt.svn.sourceforge.net/ggt/?rev=1279&view=rev Author: patrickh Date: 2012-09-21 13:54:26 +0000 (Fri, 21 Sep 2012) Log Message: ----------- Move makeTrans() to be defined before it is used. Submitted by Kevin Godby. Modified Paths: -------------- trunk/gmtl/Generate.h Modified: trunk/gmtl/Generate.h =================================================================== --- trunk/gmtl/Generate.h 2012-08-03 22:12:41 UTC (rev 1278) +++ trunk/gmtl/Generate.h 2012-09-21 13:54:26 UTC (rev 1279) @@ -715,6 +715,30 @@ return setFrustum( result, -right, top, right, -top, nr, fr ); } + /** + * Make a translation datatype from another translation datatype. + * Typically this is from Matrix to Vec or Vec to Matrix. + * This function reads only translation information from the src datatype. + * + * @param arg the matrix to extract the translation from + * + * @pre if making an n x n matrix, then for + * - <b>vector is homogeneous:</b> SIZE of vector needs to equal number of Matrix ROWS - 1 + * - <b>vector has scale component:</b> SIZE of vector needs to equal number of Matrix ROWS + * <br>if making an n x n+1 matrix, then for + * - <b>vector is homogeneous:</b> SIZE of vector needs to equal number of Matrix ROWS + * - <b>vector has scale component:</b> SIZE of vector needs to equal number of Matrix ROWS + 1 + * @post if preconditions are not met, then function is undefined (will not compile) + */ + template<typename TRANS_TYPE, typename SRC_TYPE > + inline TRANS_TYPE makeTrans( const SRC_TYPE& arg, + Type2Type< TRANS_TYPE > t = Type2Type< TRANS_TYPE >()) + { + gmtl::ignore_unused_variable_warning(t); + TRANS_TYPE temporary; + return setTrans( temporary, arg ); + } + /** Configure a matrix from view parameters. * * Functionally equivalent to gluLookAt(), this function configures @@ -1370,30 +1394,6 @@ return setDirCos( temporary, xDestAxis, yDestAxis, zDestAxis, xSrcAxis, ySrcAxis, zSrcAxis ); } - /** - * Make a translation datatype from another translation datatype. - * Typically this is from Matrix to Vec or Vec to Matrix. - * This function reads only translation information from the src datatype. - * - * @param arg the matrix to extract the translation from - * - * @pre if making an n x n matrix, then for - * - <b>vector is homogeneous:</b> SIZE of vector needs to equal number of Matrix ROWS - 1 - * - <b>vector has scale component:</b> SIZE of vector needs to equal number of Matrix ROWS - * <br>if making an n x n+1 matrix, then for - * - <b>vector is homogeneous:</b> SIZE of vector needs to equal number of Matrix ROWS - * - <b>vector has scale component:</b> SIZE of vector needs to equal number of Matrix ROWS + 1 - * @post if preconditions are not met, then function is undefined (will not compile) - */ - template<typename TRANS_TYPE, typename SRC_TYPE > - inline TRANS_TYPE makeTrans( const SRC_TYPE& arg, - Type2Type< TRANS_TYPE > t = Type2Type< TRANS_TYPE >()) - { - gmtl::ignore_unused_variable_warning(t); - TRANS_TYPE temporary; - return setTrans( temporary, arg ); - } - /** Create a rotation datatype that will xform first vector to the second. * @pre each vec needs to be normalized. * @post This function returns a temporary object. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |