Browse Source

First pass at integrating ODE into Panda. Using ODE v0.7

Josh Wilson 19 years ago
parent
commit
7e8990269e

+ 5 - 0
dtool/Config.pp

@@ -619,6 +619,11 @@
 #define FFMPEG_LIBS $[if $[WINDOWS_PLATFORM],libavcodec.lib libavformat.lib libavutil.lib libgcc.lib,avcodec avformat avutil]
 #defer HAVE_FFMPEG $[libtest $[FFMPEG_LPATH],$[FFMPEG_LIBS]]
 
+// Is ODE installed, and where?
+#define ODE_IPATH
+#define ODE_LPATH
+#define ODE_LIBS $[if $[WINDOWS_PLATFORM],libode.lib,libode]
+#defer HAVE_ODE $[libtest $[ODE_LPATH],$[ODE_LIBS]]
 
 // Do you want to build the DirectD tools for starting Panda clients
 // remotely?  This only affects the direct tree.  Enabling this may

+ 8 - 0
dtool/LocalSetup.pp

@@ -116,6 +116,11 @@
 #else
 #print - Did not find FFMPEG
 #endif
+#if $[HAVE_ODE]
+#print + ODE
+#else
+#print - Did not find ODE
+#endif
 #if $[HAVE_MAYA]
 #print + OpenMaya
 #else
@@ -223,6 +228,9 @@ $[cdefine HAVE_OPENCV]
 /* Define if we have FFMPEG installed and want to build for FFMPEG.  */
 $[cdefine HAVE_FFMPEG]
 
+/* Define if we have ODE installed and want to build for ODE.  */
+$[cdefine HAVE_ODE]
+
 /* Define if we have Mesa installed and want to build mesadisplay.  */
 $[cdefine HAVE_MESA]
 $[cdefine MESA_MGL]

+ 5 - 0
dtool/Package.pp

@@ -224,6 +224,11 @@
 #set FFMPEG_LIBS $[FFMPEG_LIBS]
 #set HAVE_FFMPEG $[HAVE_FFMPEG]
 
+#set ODE_IPATH $[unixfilename $[ODE_IPATH]]
+#set ODE_LPATH $[unixfilename $[ODE_LPATH]]
+#set ODE_LIBS $[ODE_LIBS]
+#set HAVE_ODE $[HAVE_ODE]
+
 #set HAVE_THREADS $[HAVE_THREADS]
 #set DEBUG_THREADS $[DEBUG_THREADS]
 #set MUTEX_SPINLOCK $[MUTEX_SPINLOCK]

+ 7 - 0
dtool/pptempl/Global.pp

@@ -176,6 +176,13 @@
   #define ffmpeg_libs $[FFMPEG_LIBS]
 #endif
 
+#if $[HAVE_ODE]
+  #define ode_ipath $[wildcard $[ODE_IPATH]]
+  #define ode_lpath $[wildcard $[ODE_LPATH]]
+  #define ode_cflags $[ODE_CFLAGS]
+  #define ode_libs $[ODE_LIBS]
+#endif
+
 #if $[HAVE_JPEG]
   #define jpeg_ipath $[wildcard $[JPEG_IPATH]]
   #define jpeg_lpath $[wildcard $[JPEG_LPATH]]

+ 2 - 1
dtool/src/parser-inc/Sources.pp

@@ -10,4 +10,5 @@
     cv.h cvtypes.h cxcore.h cxerror.h cxtypes.h highgui.h \
     avcodec.h avformat.h avio.h avutil.h common.h integer.h \
     intfloat_readwrite.h mathematics.h rational.h rtp.h \
-    rtsp.h rtspcodes.h winsock2.h
+    rtsp.h rtspcodes.h winsock2.h \
+    ode/common.h

+ 39 - 0
dtool/src/parser-inc/common.h

@@ -6,4 +6,43 @@
 #ifndef COMMON_H
 #define COMMON_H
 
+# ODE header stuff
+
+#if defined(dSINGLE)
+typedef float dReal;
+#elif defined(dDOUBLE)
+typedef double dReal;
+#else
+#error You must #define dSINGLE or dDOUBLE
+#endif
+
+typedef dReal dVector3[4];
+typedef dReal dVector4[4];
+typedef dReal dMatrix3[4*3];
+typedef dReal dMatrix4[4*4];
+typedef dReal dMatrix6[8*6];
+typedef dReal dQuaternion[4];
+
+struct dxWorld;		/* dynamics world */
+struct dxSpace;		/* collision space */
+struct dxBody;		/* rigid body (dynamics object) */
+struct dxGeom;		/* geometry (collision object) */
+struct dxJoint;
+struct dxJointNode;
+struct dxJointGroup;
+
+typedef struct dxWorld *dWorldID;
+typedef struct dxSpace *dSpaceID;
+typedef struct dxBody *dBodyID;
+typedef struct dxGeom *dGeomID;
+typedef struct dxJoint *dJointID;
+typedef struct dxJointGroup *dJointGroupID;
+
+typedef struct dJointFeedback {
+  dVector3 f1;		/* force applied to body 1 */
+  dVector3 t1;		/* torque applied to body 1 */
+  dVector3 f2;		/* force applied to body 2 */
+  dVector3 t2;		/* torque applied to body 2 */
+} dJointFeedback;
+
 #endif /* COMMON_H */