Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/physics_new/src/ogrebullet/Collisions/Utils/OgreBulletConverter.h @ 2119

Last change on this file since 2119 was 2119, checked in by rgrieder, 16 years ago

Merged physics branch into physics_new branch.

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1/***************************************************************************
2
3This source file is part of OGREBULLET
4(Object-oriented Graphics Rendering Engine Bullet Wrapper)
5For the latest info, see http://www.ogre3d.org/phpBB2addons/viewforum.php?f=10
6
7Copyright (c) 2007 tuan.kuranes@gmail.com
8
9
10
11This program is free software; you can redistribute it and/or modify it under
12the terms of the GNU Lesser General Public License as published by the Free Software
13Foundation; either version 2 of the License, or (at your option) any later
14version.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
19
20You should have received a copy of the GNU Lesser General Public License along with
21this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22Place - Suite 330, Boston, MA 02111-1307, USA, or go to
23http://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
34namespace 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
Note: See TracBrowser for help on using the repository browser.