Panda3D
 All Classes Functions Variables Enumerations
odeUtil.h
00001 // Filename: odeUtil.h
00002 // Created by:  joswilso (27Dec06)
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 ODEUTIL_H
00016 #define ODEUTIL_H
00017 
00018 #include "pandabase.h"
00019 #include "typedObject.h"
00020 #include "luse.h"
00021 
00022 #include "ode_includes.h"
00023 #include "odeJointCollection.h"
00024 #include "odeCollisionEntry.h"
00025 
00026 #ifdef HAVE_PYTHON
00027   #include "py_panda.h"
00028 #endif
00029 
00030 class OdeBody;
00031 class OdeJoint;
00032 class OdeGeom;
00033 
00034 ////////////////////////////////////////////////////////////////////
00035 //       Class : OdeUtil
00036 // Description : 
00037 ////////////////////////////////////////////////////////////////////
00038 class EXPCL_PANDAODE OdeUtil {
00039 PUBLISHED:
00040   static OdeJoint get_connecting_joint(const OdeBody &body1,
00041                                        const OdeBody &body2);
00042   static OdeJointCollection get_connecting_joint_list(const OdeBody &body1,
00043                                                       const OdeBody &body2);
00044   static int are_connected(const OdeBody &body1,
00045                            const OdeBody &body2);
00046   static int are_connected_excluding(const OdeBody &body1,
00047                                      const OdeBody &body2,
00048                                      const int joint_type);
00049   static PT(OdeCollisionEntry) collide(const OdeGeom &geom1, const OdeGeom &geom2,
00050                                       const short int max_contacts = 150);
00051 #ifdef HAVE_PYTHON
00052   static int collide2(const OdeGeom &geom1, const OdeGeom &geom2,
00053                       PyObject* arg, PyObject* callback);
00054 #endif
00055   static OdeGeom space_to_geom(const OdeSpace &space);
00056 
00057   static dReal OC_infinity;
00058 
00059   // RAU we can't access OC_infinity as constants are not exposed in python
00060   static dReal get_infinity() {return OC_infinity;};
00061 
00062   static int rand_get_seed() {return dRandGetSeed();};
00063 
00064   static void rand_set_seed(int s) {dRandSetSeed(s);};
00065   
00066 private:
00067 #ifdef HAVE_PYTHON
00068   static void near_callback(void*, dGeomID, dGeomID);
00069   static PyObject* _python_callback;
00070 #endif
00071 };
00072 
00073 #endif
 All Classes Functions Variables Enumerations