14/04/2011

Building Ogre+OgreBullet+Bullet Under Uubuntu


Every one programmer wanted build his own game. I started too.
For game We need:

  1. Graphic Engine (Ogre3d)
  2. Physic Engine (Bullet)
    • Glue between Graphic and Physic (OgreBullet).
Im using Linux x86_64 (UBUNTU 10.10) with NVIDIA video card.
First what We need is set up our develepment environment. To do that we need build and install some  libraries and header files (these are files that tells our programs how to use thous libraries).

So lets start:
Prerequisites
sudo apt-get install build-essential automake libtool
sudo apt-get install libfreetype6-dev libfreeimage-dev libzzip-dev libxrandr-dev libxaw7-dev freeglut3-dev
Not Strictly Required Dependencies
sudo apt-get install nvidia-cg-toolkit libois-dev libboost-thread-dev

Quick Build
tar xjf ogre_src_v1-7-2.tar.bz2
cd ogre_src_v1-7-2
mkdir build
cd build
cmake ..
make -j2
The -j2 specifies how many parallel compilation jobs to run. Substitute the number of processor cores on your system, e.g. -j2 for a dual-core, -j4 for a quad core...
sudo make install
sudo ldconfig

cmake . -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebugInfo -DBUILD_EXTRAS=ON -DINSTALL_EXTRA_LIBS=ON
make -j2
The -j2 specifies how many parallel compilation jobs to run. Substitute the number of processor cores on your system, e.g. -j2 for a dual-core, -j4 for a quad core...
sudo make install
sudo ldconfig
i need some little tests to test is needed here to copy some libs and make symbolic links for thous.
Here We need some libs from Bullet (Extras/ConvexDecomposition/libConvexDecomposition.so.2.77) copy to /usr/local/lib and make symbolic link to it self, but haven't test it yet.

  • Last think what We need to build is OgreBullet
    1. Download OgreBullet and extract it
      tar xjf bullet-2.77.tgz
      cd bullet-2.77
    2. Update Collisions/src/Makefile.am in OgreBullet source folder (just add in the end off it )
      libOgreBulletCol_la_LIBADD = \
       $(OGRE_LIBS) \
       $(bullet_LIBS) \
       -lConvexDecomposition
      
      or Use (like i done) this patch and  execute in root folder of OgreBullet:
      patch -p0 < linux_demo.patch
    3. Compile and install it:
      chmod 755 autogen.sh
      ./autogen.sh
      (if you use -DINSTALL_EXTRA_LIBS=ON in bullet configuration)
      CXXFLAGS=-I/usr/local/include/bullet/ConvexDecomposition ./configure
      make -j2
      The -j2 specifies how many parallel compilation jobs to run. Substitute the number of processor cores on your system, e.g. -j2 for a dual-core, -j4 for a quad core...
      sudo make install
      sudo ldconfig
So now You have fully build of Ogre+bullet (glued with OgreBullet). Now set Your application (or download test tutorial) configure plugins.cfg (Change PluginFolder to /usr/local/lib/OGRE).  And build some tutorial form OgreBullet wiki or forum.

Ill post to some of my tests with OgreBullet after some time.

So that all, fill free to comment.

2 comments:

  1. I get OgreBulletCollisionsRay.cpp:87:132: error: invalid conversion from 'const btCollisionObject*' to 'btCollisionObject*' [-fpermissive] when running maek

    ReplyDelete
  2. Have same problem. Is there exists solution for this issue?

    ReplyDelete