OgreODE, basic theory        

OgreODE - The basics

Greeting to you and welcome to a new series of OgreODE tutorials! They are made in a hope to make OgreODE easy to use and understand for everyone.

First of all, some definitions:

ODE is an open source, high performance library for simulating rigid body dynamics. It is fully featured, stable, mature and platform independent with an easy to use C/C++ API. It has advanced joint types and integrated collision detection with friction. ODE is useful for simulating vehicles, objects in virtual reality environments and virtual creatures. It is currently used in many computer games, 3D authoring tools and simulation tools. So, basically this is the library, which does the actual physics calculations for you. Its original author is Russell Smith.

OgreODE is a wrapper for Ogre, in other words, it is an intermediate, which allows ODE to be run with the Ogre's engine. Without it, to be able to use ODE in your application, you would have to do a lot of manual work yourself, which is surely unnecessary.

Now, onto the licensing issues.

ODE's license is very simple - basically the idea is use it, however you feel like. But, obviously, it is a common sense - acknowledge it somewhere in your product (in the manual, perhaps?) and if you make money with it - donate (you can do it at their website - ODE donatations page. Full text of the license can be found here.

With OgreOde, however it's slightly different - OgreODE is distributed under LGPL, meaning it is free, you can use, BUT as a .dll. If you want to integrate the source code into your project, then several restrictions apply (please refer to the full text at GNU.org.

Now, that we've done all of that...
Done definitions, done licensing, and you are ready (and eager ;) to go on. First things first, so let's link OgreODE to your application (provided you are using Ogre, right?).
Currently, it's been quite a while since the last official SDK, and it only works with Ogre 1.2. However, if you want it, you can easily grab it here in this thread.
Alternatively, you can grab the version from the CVS (it's in the Ogre's ogreaddons folder) and compile it yourself.
And, last but not least - you can grab this temporary SDK from this link. It is in RAR format, so, if you can't extract it, download this self-extracting .exe here.
NOTE: for those using the CVS, please refer to the included readme for installation instructions, and dont forget to download ODE from the official site.

Great, so, one way or another you have obtained your library files. What to do with them? Simple:

1) DEBUG. For debug configuration use the OgreOde_Core_d.lib and place it into your app's libraries folder (don't forget to include it as a dependancy on the configuration's page. ode.lib (from the "debug" folder) should also be placed there, and included as a dependancy.
OgreOde_Core_d.dll and ode.dll go to the "bin" (or wherever your .exe is) folder.

2) RELEASE Pretty much the same, as "DEBUG", except you use OgreOde_Core.lib/OgreOde_Core.dll (notice, no "_d") and ode.lib/ode.dll (from the "release" folder).

3) For ANY configuration - copy the "include" folder of OgreOde and ODE into your project directory and make a link to it. All the necessary files can be found in the respective "include" folder of the CVS-downloaded version, or you can grab them here. Please do not forget to include the "includes" from ODE, as well (those downloading the beforementioned .zip, all the necessary includes are already there.

Once you've done this it's time to check everything is done properly. For this type "#include <OgreOde_Core.h>" somewhere in your app (perhaps, where you include "Ogre.h" or some other "library.h"). And compile. If everything compiles well - congratulations, step 1 is over!