Panda3D
bullet_utils.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file bullet_utils.h
10  * @author enn0x
11  * @date 2010-01-23
12  */
13 
14 #ifndef __BULLET_UTILS_H__
15 #define __BULLET_UTILS_H__
16 
17 #include "pandabase.h"
18 
19 #include "bullet_includes.h"
20 
21 #include "luse.h"
22 #include "pointerTo.h"
23 #include "pandaNode.h"
24 #include "nodePath.h"
25 
26 // Conversion from Panda3D to Bullet
27 EXPCL_PANDABULLET btVector3 LVecBase3_to_btVector3(const LVecBase3 &v);
28 EXPCL_PANDABULLET btMatrix3x3 LMatrix3_to_btMatrix3x3(const LMatrix3 &m);
29 EXPCL_PANDABULLET btTransform LMatrix4_to_btTrans(const LMatrix4 &m);
30 EXPCL_PANDABULLET btQuaternion LQuaternion_to_btQuat(const LQuaternion &q);
31 
32 // Conversion from Bullet to Panda3D
33 EXPCL_PANDABULLET LVecBase3 btVector3_to_LVecBase3(const btVector3 &v);
34 EXPCL_PANDABULLET LVector3 btVector3_to_LVector3(const btVector3 &v);
35 EXPCL_PANDABULLET LPoint3 btVector3_to_LPoint3(const btVector3 &p);
36 EXPCL_PANDABULLET LMatrix3 btMatrix3x3_to_LMatrix3(const btMatrix3x3 &m);
37 EXPCL_PANDABULLET LMatrix4 btTrans_to_LMatrix4(const btTransform &tf);
38 EXPCL_PANDABULLET LQuaternion btQuat_to_LQuaternion(const btQuaternion &q);
39 
40 EXPCL_PANDABULLET CPT(TransformState) btTrans_to_TransformState(
41  const btTransform &tf,
42  const LVecBase3 &scale=LVecBase3(1.0f, 1.0f, 1.0f));
43 
44 EXPCL_PANDABULLET btTransform TransformState_to_btTrans(
45  CPT(TransformState) ts);
46 
47 EXPCL_PANDABULLET void get_node_transform(btTransform &trans, PandaNode *node);
48 
49 // UpAxis
50 BEGIN_PUBLISH
51 
52 enum BulletUpAxis {
53  X_up = 0,
54  Y_up = 1,
55  Z_up = 2,
56 };
57 
58 EXPCL_PANDABULLET BulletUpAxis get_default_up_axis();
59 EXPCL_PANDABULLET int get_bullet_version();
60 
61 END_PUBLISH
62 
63 #include "bullet_utils.I"
64 
65 #endif // __BULLET_UTILS_H__
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
Indicates a coordinate-system transform on vertices.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
EXPCL_PANDABULLET int get_bullet_version()
Returns the version of the linked Bullet library.