Building OgreBullet and Demo on Linux (patches)

igrok

01-02-2009 21:13:34

It appears that a good number of people have trouble compiling OgreBullet on Linux, and it shouldn't be that big of a problem.

These instructions were last tested with OGRE 1.6 (r8195), bullet-2.73 and OgreBullet SVN (r2635) on February 06, 2009. I use 32-bit Gentoo Linux, but you should expect these instructions to work for almost all distributions.

First, grab the code from SVN and convert the files to UNIX format:

svn co https://ogreaddons.svn.sourceforge.net/svnroot/ogreaddons/trunk/ogrebullet OgreBullet
cd OgreBullet/
for i in `find . -type f`; do dos2unix "$i"; done



If Bullet and OGRE were not installed in the default directory (i.e. /usr/include and /usr/lib), you will need to set the correct paths. I have them installed in /usr/local/include and /usr/local/lib:

export CPPFLAGS="-I/usr/local/include/OGRE -I/usr/local/include"
export LDFLAGS="-L/usr/local/lib/OGRE -L/usr/local/lib"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"



My installation of bullet did not install any of the Extras, so I had to put them in place manually:

cp bullet-2.73/Extras/ConvexDecomposition/ConvexDecomposition.h /usr/local/include/bullet/
cp bullet-2.73/Extras/ConvexDecomposition/ConvexBuilder.h /usr/local/include/bullet/
cp bullet-2.73/Extras/ConvexDecomposition/vlookup.h /usr/local/include/bullet/



Then, generate the Makefiles, configure the build for your system and compile:

chmod 755 autogen.sh
./autogen.sh
./configure --prefix=/usr/local
make && make install



As long as you didn't see any build errors, you'll have a nice new OgreBullet library installed in /usr/local/include/OgreBullet and /usr/local/lib!

Next, we'll get the Demo built (see my reply below).

igrok

04-02-2009 01:52:52

As evidenced in the forums, building the Demo is more difficult. I do have it working, but a number of the materials are not functioning correctly.

Edit: The PNG problem listed below is caused by running dos2unix on the textures.
Additionally, most of the PNG files in Demos/Media/textures/ seemed to be corrupted in SVN. I had to copy them from the "official" OgreBullet release ZIP file.

The OgreBullet Demo utilizes some media from the Ogre3D distribution. To run the Demo, I moved the OgreBullet directory to the ogre3d/Samples/ directory.

A number of patches are required as of SVN r2635. Until they are applied, you'll need to grab the zip file below.

Once the patches are applied, you will need to rebuild and re-install OgreBullet for the changes to take effect (just re-run the "make && make install" listed in my previous post). Then, you should just need to run:

cd Demos/
chmod 755 autogen.sh
./autogen.sh
./configure --prefix=/usr/local
make
./OgreBulletDemo



Due to these intricacies, I'm going to take a look at the lightweight btOgre wrapper written by Nikki. It will be cleaner on Linux and seems to fulfill my requirements.

tuan kuranes

04-02-2009 08:52:13

Thanks for the patch. I'll apply asap.

tuan kuranes

04-02-2009 09:11:37

can you post a .patch file instead ?
I have trouble applying it from copy&paste...
seems the '@' doesnt' work

igrok

06-02-2009 06:01:53

Here is a ZIP file of each patch.

tuan kuranes

06-02-2009 09:06:13

Thanks.

Hannofcart

12-11-2009 05:27:54

I suppose that the above mentioned patches were applied since to the latest SVN. However, I am not able to find the OgreBullet samples. Where are they installed? Do they have to be built separately from the rest of the OgreBullet code?

Are there any separate instructions to follow in order to build the demos?

Hannofcart

12-11-2009 19:06:42

After a little work, I have managed to get the OgreBullet demos compiled fine (I created a new project with all sources and linked the headers and libraries). However, on running the app, it fails during, what it seems to me, initialization of the resources as is evident from the following snippet of the relevant parts of the log:


...
00:38:50: Creating resource group OgreBullet
00:38:50: Added resource location '../../../ogrebullet/demos/Media' of type 'FileSystem' to resource group 'OgreBullet'
00:38:50: Added resource location '../../../ogrebullet/demos/Media/textures' of type 'FileSystem' to resource group 'OgreBullet'
00:38:50: Added resource location '../../../ogrebullet/demos/Media/overlays' of type 'FileSystem' to resource group 'OgreBullet'
00:38:50: Added resource location '../../../ogrebullet/demos/Media/materials' of type 'FileSystem' to resource group 'OgreBullet'
00:38:50: Added resource location '../../../ogrebullet/demos/Media/models' of type 'FileSystem' to resource group 'OgreBullet'
00:38:50: Added resource location '../../../ogrebullet/demos/Media/gui' of type 'FileSystem' to resource group 'OgreBullet'

...

00:38:56: Initialising resource group OgreBullet
00:38:56: Parsing scripts for resource group OgreBullet
00:38:56: Finished parsing scripts for resource group OgreBullet
00:38:57: OGRE EXCEPTION(5:ItemIdentityException): Could not find material OgreBulletDemos/TargetSights in OverlayElement::setMaterialName at OgreOverlayElement.cpp (line 332)
00:38:57: Unregistering ResourceManager for type BspLevel
00:38:57: *-*-* OGRE Shutdown


I have copied over he media resources from the Ogre saples folder as well as the OgreBullet folder. So, now basically what I need to know what resource groups the demos expect to find in my resources.cfg file (for eg. as seems to be needed in the mention of 'OgreBulletDemos/TargetSights' in the log above).

Please help.