Thrive
bullet_ogre_conversion.h
1 #include <btBulletDynamicsCommon.h>
2 
3 #include <OgreVector3.h>
4 #include <OgreQuaternion.h>
5 
6 namespace thrive{
7 
8 
10 // Bullet to Ogre
12 
13 inline Ogre::Vector3
14 bulletToOgre(
15  const btVector3& v
16 ) {
17  return Ogre::Vector3(v.x(), v.y(), v.z());
18 }
19 
20 
21 inline Ogre::Quaternion
22 bulletToOgre(
23  const btQuaternion& q
24 ) {
25  return Ogre::Quaternion(q.w(), q.x(), q.y(), q.z());
26 }
27 
29 // Ogre to Bullet
31 
32 inline btVector3
33 ogreToBullet(
34  const Ogre::Vector3& v
35 ) {
36  return btVector3(v.x, v.y, v.z);
37 }
38 
39 
40 inline btQuaternion
41 ogreToBullet(
42  const Ogre::Quaternion& q
43 ) {
44  return btQuaternion(q.x, q.y, q.z, q.w);
45 }
46 
47 }
Definition: bullet_ogre_conversion.h:6