SPIN Framework

include/bulletUtil.h

00001 // -----------------------------------------------------------------------------
00002 // |    ___  ___  _  _ _     ___                                        _      |
00003 // |   / __>| . \| || \ |   | __>_ _  ___ ._ _ _  ___  _ _ _  ___  _ _ | |__   |
00004 // |   \__ \|  _/| ||   |   | _>| '_><_> || ' ' |/ ._>| | | |/ . \| '_>| / /   |
00005 // |   <___/|_|  |_||_\_|   |_| |_|  <___||_|_|_|\___.|__/_/ \___/|_|  |_\_\   |
00006 // |                                                                           |
00007 // |---------------------------------------------------------------------------|
00008 //
00009 // http://spinframework.sourceforge.net
00010 // Copyright (C) 2009 Mike Wozniewski, Zack Settel
00011 //
00012 // Developed/Maintained by:
00013 //    Mike Wozniewski (http://www.mikewoz.com)
00014 //    Zack Settel (http://www.sheefa.net/zack)
00015 //
00016 // Principle Partners:
00017 //    Shared Reality Lab, McGill University (http://www.cim.mcgill.ca/sre)
00018 //    La Societe des Arts Technologiques (http://www.sat.qc.ca)
00019 //
00020 // Funding by:
00021 //    NSERC/Canada Council for the Arts - New Media Initiative
00022 //    Heritage Canada
00023 //    Ministere du Developpement economique, de l'Innovation et de l'Exportation
00024 //
00025 // -----------------------------------------------------------------------------
00026 //  This file is part of the SPIN Framework.
00027 //
00028 //  SPIN Framework is free software: you can redistribute it and/or modify
00029 //  it under the terms of the GNU Lesser General Public License as published by
00030 //  the Free Software Foundation, either version 3 of the License, or
00031 //  (at your option) any later version.
00032 //
00033 //  SPIN Framework is distributed in the hope that it will be useful,
00034 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00035 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00036 //  GNU Lesser General Public License for more details.
00037 //
00038 //  You should have received a copy of the GNU Lesser General Public License
00039 //  along with SPIN Framework. If not, see <http://www.gnu.org/licenses/>.
00040 // -----------------------------------------------------------------------------
00041 
00042 // NOTE: this code is originally from osgBullet (LGPL)
00043 // osgBullet is (C) Copyright 2009-2011 by Kenneth Mark Bryden
00044 
00045 #ifndef __bulletUtil_H
00046 #define __bulletUtil_H
00047 
00048 
00049 #include <osg/Matrix>
00050 #include <osg/Vec3>
00051 #include <osg/Vec4>
00052 #include <osg/Quat>
00053 
00054 #include <LinearMath/btTransform.h>
00055 
00056 
00057 namespace spin
00058 {
00059 
00060 
00066 osg::Matrix asOsgMatrix( const btTransform& t );
00067 btTransform asBtTransform( const osg::Matrix& m );
00068 
00069 osg::Matrix asOsgMatrix( const btMatrix3x3& m );
00070 btMatrix3x3 asBtMatrix3x3( const osg::Matrix& m );
00071 
00072 osg::Vec3 asOsgVec3( const btVector3& v );
00073 btVector3 asBtVector3( const osg::Vec3& v );
00074 
00075 osg::Vec4 asOsgVec4( const btVector3& v, const double w );
00076 osg::Vec4 asOsgVec4( const btVector4& v );
00077 osg::Quat asOsgQuat( const btQuaternion& q); // mikewoz
00078 btQuaternion asBtQuaternion( const osg::Quat& q); // mikewoz
00079 btVector4 asBtVector4( const osg::Vec4& v );
00080 
00082 }
00083 
00084 #endif