Panda3D
 All Classes Functions Variables Enumerations
bullet_utils.h
00001 // Filename: bullet_utils.h
00002 // Created by:  enn0x (23Jan10)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef __BULLET_UTILS_H__
00016 #define __BULLET_UTILS_H__
00017 
00018 #include "pandabase.h"
00019 
00020 #include "bullet_includes.h"
00021 
00022 #include "luse.h"
00023 #include "pointerTo.h"
00024 #include "pandaNode.h"
00025 #include "nodePath.h"
00026 
00027 // Conversion from Panda3D to Bullet
00028 EXPCL_PANDABULLET btVector3 LVecBase3_to_btVector3(const LVecBase3 &v);
00029 EXPCL_PANDABULLET btMatrix3x3 LMatrix3_to_btMatrix3x3(const LMatrix3 &m);
00030 EXPCL_PANDABULLET btTransform LMatrix4_to_btTrans(const LMatrix4 &m);
00031 EXPCL_PANDABULLET btQuaternion LQuaternion_to_btQuat(const LQuaternion &q);
00032 
00033 // Conversion from Bullet to Panda3D
00034 EXPCL_PANDABULLET LVecBase3 btVector3_to_LVecBase3(const btVector3 &v);
00035 EXPCL_PANDABULLET LVector3 btVector3_to_LVector3(const btVector3 &v);
00036 EXPCL_PANDABULLET LPoint3 btVector3_to_LPoint3(const btVector3 &p);
00037 EXPCL_PANDABULLET LMatrix3 btMatrix3x3_to_LMatrix3(const btMatrix3x3 &m);
00038 EXPCL_PANDABULLET LMatrix4 btTrans_to_LMatrix4(const btTransform &tf);
00039 EXPCL_PANDABULLET LQuaternion btQuat_to_LQuaternion(const btQuaternion &q);
00040 
00041 EXPCL_PANDABULLET CPT(TransformState) btTrans_to_TransformState(
00042   const btTransform &tf, 
00043   const LVecBase3 &scale=LVecBase3(1.0f, 1.0f, 1.0f));
00044 
00045 EXPCL_PANDABULLET btTransform TransformState_to_btTrans(
00046   CPT(TransformState) ts);
00047 
00048 // UpAxis
00049 BEGIN_PUBLISH
00050 
00051 enum BulletUpAxis {
00052   X_up = 0,
00053   Y_up = 1,
00054   Z_up = 2,
00055 };
00056 
00057 EXPCL_PANDABULLET BulletUpAxis get_default_up_axis();
00058 END_PUBLISH
00059 
00060 #include "bullet_utils.I"
00061 
00062 #endif // __BULLET_UTILS_H__
 All Classes Functions Variables Enumerations