Panda3D
 All Classes Functions Variables Enumerations
bullet_utils.h
1 // Filename: bullet_utils.h
2 // Created by: enn0x (23Jan10)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef __BULLET_UTILS_H__
16 #define __BULLET_UTILS_H__
17 
18 #include "pandabase.h"
19 
20 #include "bullet_includes.h"
21 
22 #include "luse.h"
23 #include "pointerTo.h"
24 #include "pandaNode.h"
25 #include "nodePath.h"
26 
27 // Conversion from Panda3D to Bullet
28 EXPCL_PANDABULLET btVector3 LVecBase3_to_btVector3(const LVecBase3 &v);
29 EXPCL_PANDABULLET btMatrix3x3 LMatrix3_to_btMatrix3x3(const LMatrix3 &m);
30 EXPCL_PANDABULLET btTransform LMatrix4_to_btTrans(const LMatrix4 &m);
31 EXPCL_PANDABULLET btQuaternion LQuaternion_to_btQuat(const LQuaternion &q);
32 
33 // Conversion from Bullet to Panda3D
34 EXPCL_PANDABULLET LVecBase3 btVector3_to_LVecBase3(const btVector3 &v);
35 EXPCL_PANDABULLET LVector3 btVector3_to_LVector3(const btVector3 &v);
36 EXPCL_PANDABULLET LPoint3 btVector3_to_LPoint3(const btVector3 &p);
37 EXPCL_PANDABULLET LMatrix3 btMatrix3x3_to_LMatrix3(const btMatrix3x3 &m);
38 EXPCL_PANDABULLET LMatrix4 btTrans_to_LMatrix4(const btTransform &tf);
39 EXPCL_PANDABULLET LQuaternion btQuat_to_LQuaternion(const btQuaternion &q);
40 
41 EXPCL_PANDABULLET CPT(TransformState) btTrans_to_TransformState(
42  const btTransform &tf,
43  const LVecBase3 &scale=LVecBase3(1.0f, 1.0f, 1.0f));
44 
45 EXPCL_PANDABULLET btTransform TransformState_to_btTrans(
46  CPT(TransformState) ts);
47 
48 // UpAxis
49 BEGIN_PUBLISH
50 
51 enum BulletUpAxis {
52  X_up = 0,
53  Y_up = 1,
54  Z_up = 2,
55 };
56 
57 EXPCL_PANDABULLET BulletUpAxis get_default_up_axis();
58 EXPCL_PANDABULLET int get_bullet_version();
59 
60 END_PUBLISH
61 
62 #include "bullet_utils.I"
63 
64 #endif // __BULLET_UTILS_H__
This is the base class for all three-component vectors and points.
Definition: lvecBase3.h:105
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
This is the base quaternion class.
Definition: lquaternion.h:96
This is a 3-by-3 transform matrix.
Definition: lmatrix.h:110