1 | /*************************************************************************** |
---|
2 | |
---|
3 | This source file is part of OGREBULLET |
---|
4 | (Object-oriented Graphics Rendering Engine Bullet Wrapper) |
---|
5 | For the latest info, see http://www.ogre3d.org/phpBB2addons/viewforum.php?f=10 |
---|
6 | |
---|
7 | Copyright (c) 2007 tuan.kuranes@gmail.com |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | This program is free software; you can redistribute it and/or modify it under |
---|
12 | the terms of the GNU Lesser General Public License as published by the Free Software |
---|
13 | Foundation; either version 2 of the License, or (at your option) any later |
---|
14 | version. |
---|
15 | |
---|
16 | This program is distributed in the hope that it will be useful, but WITHOUT |
---|
17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
18 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
---|
19 | |
---|
20 | You should have received a copy of the GNU Lesser General Public License along with |
---|
21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
22 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
---|
23 | http://www.gnu.org/copyleft/lesser.txt. |
---|
24 | ----------------------------------------------------------------------------- |
---|
25 | */ |
---|
26 | #ifndef _OGREBULLETCOLLISIONS_OgreBtConverter_H |
---|
27 | #define _OGREBULLETCOLLISIONS_OgreBtConverter_H |
---|
28 | |
---|
29 | #include "OgreBulletCollisionsPreRequisites.h" |
---|
30 | |
---|
31 | #include "OgreVector3.h" |
---|
32 | #include "OgreQuaternion.h" |
---|
33 | |
---|
34 | namespace OgreBulletCollisions |
---|
35 | { |
---|
36 | class OgreBtConverter |
---|
37 | { |
---|
38 | public: |
---|
39 | OgreBtConverter(){}; |
---|
40 | ~OgreBtConverter(){}; |
---|
41 | |
---|
42 | static btVector3 to(const Ogre::Vector3 &V) |
---|
43 | { |
---|
44 | return btVector3(V.x, V.y, V.z); |
---|
45 | }; |
---|
46 | |
---|
47 | static btQuaternion to(const Ogre::Quaternion &Q) |
---|
48 | { |
---|
49 | return btQuaternion(Q.x, Q.y, Q.z, Q.w); |
---|
50 | }; |
---|
51 | |
---|
52 | }; |
---|
53 | class BtOgreConverter |
---|
54 | { |
---|
55 | public: |
---|
56 | BtOgreConverter(){}; |
---|
57 | ~BtOgreConverter(){}; |
---|
58 | |
---|
59 | static Ogre::Vector3 to(const btVector3 &V) |
---|
60 | { |
---|
61 | return Ogre::Vector3(V.x(), V.y(), V.z()); |
---|
62 | }; |
---|
63 | |
---|
64 | static Ogre::Quaternion to(const btQuaternion &Q) |
---|
65 | { |
---|
66 | return Ogre::Quaternion(Q.w(), Q.x(), Q.y(), Q.z()); |
---|
67 | //return Ogre::Quaternion(Q.x(), Q.y(), Q.z(), Q[3]); |
---|
68 | }; |
---|
69 | }; |
---|
70 | } |
---|
71 | #endif //_OGREBULLETCOLLISIONS_OgreBtConverter_H |
---|