Saturday, 27 November 2010

How to Build Bullet Physics on Windows XP with MinGW


1) Download and extract Bullet 2.7.6.

I placed Bullet in:
c:\binh\tools\bullet-2.7.6


2) Modify CMakeLists.txt

Go to /bullet-2.76/CMakeLists.txt, line 125.

Change:
125 IF (USE_GLUT)

To:
125 IF (USE_GLUT AND MSVC)

Go to /bullet-2.76/CMakeLists.txt, line 128.

Change:
128 ENDIF (USE_GLUT)

To:
128 ENDIF (USE_GLUT AND MSVC)


3) Modify bChunk.h

Go to /bullet-2.76/Extras/Serialize/BulletFileLoader/bChunk.h, line 20

Change:
20 #ifdef _WIN32

To:
20 #if defined (_WIN32) && !defined (__MINGW32__)


4) Modify GL_DiaglogWindow.h

Go to /bullet-2.76/Demos/OpenGL/GL_DiaglogWindow.h, line 41

Change:
40 #else
41 #include <GL/glut.h>
42 #endif

To:
40 #else
41 #include <GL/gl.h>
42 #include <GL/glut.h>
43 #endif


5) Set environment variable

Go to the command line.

> set GLUT_INCLUDE_DIR=c:\binh\tools\bullet-2.7.6\Glut
> set INCLUDE=c:\binh\tools\bullet-2.7.6\Glut


6) Generate Makefiles

> cmake -G "MinGW Makefiles"


7) Build

> mingw32-make


Notes
  • Using the GLUT that comes with Bullet is easier than trying to use freeglut.
  • I don't know what to do with the warning messages about glu.
References
Related

3 comments:

  1. A bit unrelated to this post, but I just saw a video and thought you might be interested:

    http://www.ted.com/talks/susan_savage_rumbaugh_on_apes_that_write.html

    It starts out a little weird, literally talking about monkey sex (heh), but I think it illustrates a few important points and touches on some issues you discussed earlier in http://tb-nguyen.blogspot.com/2010/06/silly-questions-about-artificial.html .

    ReplyDelete
  2. Also, given that you're going with Bullet, have you considered how you are going to deal with movement (muscles, joints, etc)? Or does it have relevant built-in features of which I am not aware?

    ReplyDelete
  3. Hi Anonymous,

    Thanks for the link to Susan Savage Rumbaugh's talk. Much appreciated. I'll check that out soon.

    In regards to Bullet, it will require a lot of work. The useful components there are the joints. I'll be connecting neurons up to joints constrained by physics to have pseudo muscles.

    For example, a joint can have constraints similar to an elbow. I'll then have a set of neurons that can apply bicep force and another set of neurons to apply triceps force.

    ReplyDelete