source: projectionDesigner/trunk/projdesigner/include/gmtl/External/OpenSGConvert.h @ 361

Last change on this file since 361 was 4, checked in by Torben Dannhauer, 15 years ago
File size: 985 bytes
RevLine 
[4]1#ifndef GMTL_OPENSG_CONVERT_H_
2#define GMTL_OPENSG_CONVERT_H_
3
4/** @file OpenSGConvert.h GMTL to OpenSG conversion functions
5*
6* methods to convert between gtml and opensg matrix classes
7*/
8
9#include <gmtl/Matrix.h>
10#include <gmtl/Generate.h>
11#include <OpenSG/OSGMatrix.h>
12
13namespace gmtl
14{
15
16/** Convert an opensg matrix to a gmtl::Matrix
17 * @param mat        the matrix to write the OpenSG matrix data into
18 * @param osg_mat    the source OpenSG matrix
19 * @return     returns the equivalent GMTL matrix
20 */
21inline
22Matrix44f& set( Matrix44f& mat, const osg::Matrix& osg_mat )
23{
24   mat.set(osg_mat.getValues());
25   return mat;
26}
27
28/** Convert a GMTL matrix to a OpenSG matrix
29 * @param osg_mat     the matrix to write the GMTL matrix data into
30 * @param mat         the source GMTL matrix
31 * @return     returns the equivalent OpenSG matrix
32 */
33inline
34osg::Matrix& set(osg::Matrix& osg_mat, const Matrix44f& mat)
35{
36   osg_mat.setValue( mat.getData() );
37   return osg_mat;
38}
39
40}
41
42#endif
43
Note: See TracBrowser for help on using the repository browser.