00001 /*************************************************************************** 00002 00003 This source file is part of OGREBULLET 00004 (Object-oriented Graphics Rendering Engine Bullet Wrapper) 00005 For the latest info, see http://www.ogre3d.org/phpBB2addons/viewforum.php?f=10 00006 00007 Copyright (c) 2007 tuan.kuranes@gmail.com 00008 00009 00010 00011 Permission is hereby granted, free of charge, to any person obtaining a copy 00012 of this software and associated documentation files (the "Software"), to deal 00013 in the Software without restriction, including without limitation the rights 00014 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00015 copies of the Software, and to permit persons to whom the Software is 00016 furnished to do so, subject to the following conditions: 00017 00018 The above copyright notice and this permission notice shall be included in 00019 all copies or substantial portions of the Software. 00020 00021 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00022 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00024 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00026 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00027 THE SOFTWARE. 00028 ----------------------------------------------------------------------------- 00029 */ 00030 #ifndef _OGREBULLETCOLLISIONS_OgreBtConverter_H 00031 #define _OGREBULLETCOLLISIONS_OgreBtConverter_H 00032 00033 #include "OgreBulletCollisionsPreRequisites.h" 00034 00035 #include "OgreVector3.h" 00036 #include "OgreQuaternion.h" 00037 00038 namespace OgreBulletCollisions 00039 { 00040 class OgreBtConverter 00041 { 00042 public: 00043 OgreBtConverter(){}; 00044 ~OgreBtConverter(){}; 00045 00046 static btVector3 to(const Ogre::Vector3 &V) 00047 { 00048 return btVector3(V.x, V.y, V.z); 00049 }; 00050 00051 static btQuaternion to(const Ogre::Quaternion &Q) 00052 { 00053 return btQuaternion(Q.x, Q.y, Q.z, Q.w); 00054 }; 00055 00056 }; 00057 class BtOgreConverter 00058 { 00059 public: 00060 BtOgreConverter(){}; 00061 ~BtOgreConverter(){}; 00062 00063 static Ogre::Vector3 to(const btVector3 &V) 00064 { 00065 return Ogre::Vector3(V.x(), V.y(), V.z()); 00066 }; 00067 00068 static Ogre::Quaternion to(const btQuaternion &Q) 00069 { 00070 return Ogre::Quaternion(Q.w(), Q.x(), Q.y(), Q.z()); 00071 //return Ogre::Quaternion(Q.x(), Q.y(), Q.z(), Q[3]); 00072 }; 00073 }; 00074 } 00075 #endif //_OGREBULLETCOLLISIONS_OgreBtConverter_H
1.7.1