Skip to main content

History: OgreBullet Tutorial 1

Preview of version: 2

Hi!

This tutorial will guide you through the configuration of an OgreBullet project from configuring the components to creating your first compilable but empty project.
My native language is not english so if you find grammatical errors, please post a comment. Thanks!

What you need:

- Ogre 1.65 (must be already configured). It is reported that this tutorial is compatible with Ogre 1.7.1 also

- Bullet 2.76 (you can download from here: http://code.google.com/p/bullet/downloads/list)

- OgreBullet (I used rev. 2902, svn at the time of writing: https://ogreaddons.svn.sourceforge.net/svnroot/ogreaddons/trunk/ogrebullet)

IDE what I used and will refer to:
- Visual Studio 2008 C++ Express with SP1

Also good if you have:
- Ogre AppWizard (the basic project is generated with this. Wiki: The Complete Blanks Guide To Using The OGRE SDK AppWizard

Preparation

- unpack Bullet and fetch OgreBullet to a place in the hard drive
- set an environment variable:

BULLET_HOME C:\OgreSDK\AddOns\bullet-2.76 (if this is were you unpacked Bullet)

You can find the place in Windows XP following this path: open Control Panel (classic view) / System / Advanced / Environment Variables. Set it in the User Variables box.

- build Bullet in your IDE (I done it in VS2008 Express)__

''The project file for VS 2008 is here: ....\bullet-2.76\msvc\2008\BULLET_PHYSICS.sln
Build it in debug and release mode. It should compile without any problem.''

- build OgreBullet also: ....\OgreBullet\OgreBullet_SDK.sln

VS2008 converted the project without any errors for me.

When you build the debug version of the demos you may have some errors about missing .lib files.

Put these files to ....\OgreBullet\lib\Debug\:
BulletCollision.lib, can be found here: ....\bullet-2.76\msvc\2008\src\BulletCollision\Debug\
BulletDynamics.lib, can be found here: ....\bullet-2.76\msvc\2008\src\BulletDynamics\Debug\
ConvexDecomposition.lib, can be found here: ....\bullet-2.76\msvc\2008\Extras\ConvexDecomposition\Debug\
GIMPACTUtils.lib, can be found here: ....\bullet-2.76\msvc\2008\Extras\GIMPACTUtils\Debug\
LinearMath.lib, can be found here: ....\bullet-2.76\msvc\2008\src\LinearMath\Debug\

There are some files what we don't need now but you may need later. For example BulletSoftBody.lib. If something is missing when you use more components from Bullet, don't forget to copy it to the right place.

NOTE: If you want to Compile/Run the OgreBullet demos supplied with OgreBullet and it can't find resources.cfg don't wonder. This tutorial is not about these demos but I think you can solve it yourself. There are some problems with paths 😊

If you want to build the release version of the demos (or any OgreBullet project!) you have to put the Bullet .lib files to the ....\OgreBullet\lib\Release folder.
But beware! You have to put the RELEASE version of Bullet .lib files to this dir, not the same files what were listed before.

Now we have the required files, let's close this project and start a new!

Create an empty project with Bullet support

If you have Ogre Appwizard installed, create a new Ogre project:

New project – Ogre SDK Application – OgreBullet_Collision_test – Finish

I refer to the classes with the names what are generated from the project name. If you want to use another name, be careful with the different names.

If you don't have Appwizard just create a basic Ogre application what is able to create a window, fire up a FrameListener and care for keyboard/mouse input handle.

From now on I refer to Appwizard basic project.

Before we start coding (in the next tutorial) we need to do some configuration:

- Open Project\Properties (Alt+F7)
- Go to Configuration Properties\C/C++\General
- Find Additional Include Directories, open with '...' button
- Put $(BULLET_HOME)\src to the end of the list.
- Change the Configuration (in the top-left corner of the window) to Release and do the same here as well.

- Now go to Configuration Properties\Linker\Input

- Find Additional Dependencies

- Add required elements. In the end it should contain these:

OgreMain_d.lib OIS_d.lib OgreBulletCollisions_d.lib OgreBulletDynamics_d.lib bulletcollision.lib bulletdynamics.lib LinearMath.lib GIMPACTutils.lib ConvexDecomposition.lib

- Change the Configuration (in the top-left corner of the window) to Release and insert these to the same place as before:

OgreMain.lib OIS.lib OgreBulletCollisions.lib OgreBulletDynamics.lib bulletcollision.lib bulletdynamics.lib LinearMath.lib GIMPACTutils.lib ConvexDecomposition.lib


- Now close this window and go to Tools\Options\Projects and Solutions\VC++ Directories\

- Set Show directories for: Include files

- Put these into the list (your path to OgreBullet needed):

....\OgreBullet\Collisions\include

....\OgreBullet\Dynamics\include

- Change to Library files and put these to the list:

....\OgreBullet\lib\Debug

....\OgreBullet\lib\Release


Build the project. It should be working. Now you can start the next tutorial what is based on this project 😊

NOTE: source code can be found at the end of the second tutorial.

History

Information Version
Fri 02 of Sep, 2011 23:18 GMT-0000 Latin1 Added a link to the second tutorial at the end of the article. 6
Fri 02 of Sep, 2011 23:08 GMT-0000 Latin1 Spacing, syntax, spelling. 5
Mon 01 of Aug, 2011 00:20 GMT-0000 jacmoe 4
Sat 15 of Jan, 2011 14:48 GMT-0000 bsmithers Added a few notes with changes (BULLET_HOME -> BULLET_ROOT) and changed paths in Ogre 1.7.2 3
Thu 03 of Jun, 2010 02:44 GMT-0000 jacmoe 2
Thu 03 of Jun, 2010 02:37 GMT-0000 jacmoe 1