Using OGRE ODE with LiaV

From EQUIS Lab Wiki

Jump to: navigation, search

OgreOde Installation Notes

27-Jan-2010 - Cheryl Savery

These are the notes I made in order to get OgreOde and the demos associated with it to run. These instructions assume that you have already install all the Ogre files supplied for CISC 877


1) Down load OgreOde from Sourceforge http://sourceforge.net/projects/ogreode-vc/ ** download the source file not the bin, you need to click on "view all files" to see it

Unzipped OgreOde-VC_src_v0_0_1_2.zip to the folder "CISC 877 - 2010W"

2) Down load Boost C++ Libraries from Sourceforge. You just need the header files. Copy the boost folder containing the header files to the OgreOde-VC_src_v0_0_1_2\ode-0.11.1\include folder

3) At the windows command prompt, set 2 environment variables

    setx ODE_VERSION 0.11.1
    setx OGRE_HOME ..\..\..\ogre

Note: if you have already opened Visual studio, close it and open it again so it picks up the Env Variables

4) Opened file build\VC9\OgreOde_Source.sln

5) Right click on ode and click on Properties

  For the Debug configuration only
  In C/C++ -> Preprocessor -> Preprocessor Definitions add the following:
     dTRIMESH_ENABLED
     dTRIMESH_OPCODE

At this point I built ode and OPCODE. Both compiled successfully in Degug and Release

6) Right click on OgreOde_Core and click on Properties

  For the Debug configuration only
  In Linker, Inputs add  OPCODE_d.lib 
  Select All Configurations
        
  In C/C++, Additional Include Directories add "..\..\..\ogre-libraries\include"
  In Linker, Additional Link Directories add "..\..\..\ogre-libraries\lib\$(ConfigurationName)"
  In Build Events, Post-Build Events, Command Line delete "copy $(TargetPath) ..\..\bin"  (This line causes an error,  I don't know why, but the files can be all copied manually later)

7) Build OgreOde_Core

8) Right click on OgreOde_Prefab and click on Properties

  Select All Configurations
        
  In C/C++, Additional Include Directories add "..\..\..\..\ogre-libraries\include"
  In C/C++, Additional Include Directories change $(OGRE_HOME)\OgreMain\include to ..\$(OGRE_HOME)\OgreMain\include
  In Linker, Additional Link Directories add "..\..\..\..\ogre-libraries\lib\$(ConfigurationName)"
  In Build Events, Post-Build Events, Command Line delete "copy $(TargetPath) ..\..\bin"  

Build OgreOde_Prefab (the debug version did not link for me on the first try, but I didn't change anything and it went fine the 2nd time???)

9) repeat step 8 for OgreOde_Loader

10) Right click on Demo_GranTurismOgre and click on Properties

  Select All Configurations
        
  In C/C++, Additional Include Directories add "..\..\..\..\..\ogre-libraries\include"
  In C/C++, Additional Include Directories add "..\..\$(OGRE_HOME)\Dependencies\include"
  In C/C++, Additional Include Directories change $(OGRE_HOME)\OgreMain\include to ..\..\$(OGRE_HOME)\OgreMain\include
  In C/C++, Additional Include Directories change $(OGRE_HOME)\Samples\Common\include to ..\..\$(OGRE_HOME)\Samples\Common\include
  In Linker, Additional Link Directories add "..\..\..\..\..\ogre-libraries\lib\$(ConfigurationName)"
     Also everywhere you see $(OGRE_HOME) change it to ..\..\$(OGRE_HOME)
  In Build Events, Post-Build Events, Command Line delete "copy $(TargetPath) ..\..\bin"  

Build

11) To run the demo, copy the followind files from Tutorials\Release folder to the OgreOde-VC_src_v0_0_1_2\bin folder

   OIS.dll
   OgreMain.dll
   OgrePaging.dll
   OgreProperty.dll  ?? I don't think we need this one, the demos seem to run ok with out it
   OgreRTShaderSystem.dll
   OgreTerrain.dll
   Plugin_BSPSceneManager.dll
   Plugin_CgProgramManager.dll
   Plugin_OctreeSceneManager.dll
   Plugin_OctreeZone.dll
   Plugin_PCZSceneManager.dll
   Plugin_ParticleFX.dll
   RenderSystem_Direct3D10.dll
   RenderSystem_Direct3D11.dll
   RenderSystem_Direct3D9.dll
   RenderSystem_GL.dll
   cg.dll
   copy OgreOdeDemo_GranTurismOgre.exe from demos\GranTurismOgre\build\Release to the bin folder
   copy OgreOde_Core.dll from build\Release to bin
   copy OgreOde_Prefab.dll from prefab\build\Release to bin
   copy OgreOde_Loader.dll from loader\build\Release to bin

You should now be able to run the demo from the bin folder

12) Right click on Demo_SimpleScenes and click on Properties

  Select All Configurations
        
  In C/C++, Additional Include Directories add "..\..\..\..\..\ogre-libraries\include"
  In C/C++, Additional Include Directories add "..\..\$(OGRE_HOME)\Dependencies\include"
  In C/C++, Additional Include Directories change $(OGRE_HOME)\OgreMain\include to ..\..\$(OGRE_HOME)\OgreMain\include
  In C/C++, Additional Include Directories change $(OGRE_HOME)\Samples\Common\include to ..\..\$(OGRE_HOME)\Samples\Common\include
  In Linker, Additional Link Directories add "..\..\..\..\..\ogre-libraries\lib\$(ConfigurationName)"
     Also everywhere you see $(OGRE_HOME) change it to ..\..\$(OGRE_HOME)
  In Build Events, Post-Build Events, Command Line delete "copy $(TargetPath) ..\..\bin"  

Build

copy OgreOdeDemo_SimpleScenes.exe from demos\SimpleScenes\build\Release to the bin folder

You should now be able to run the demo from the bin folder

13) Repeat step 12 for Demo_Landscape

14) I have not done it yet, but should put all the dll's for debug mode into a folder to make sure those ones run too.


Using OgreOde with LIAV

In order to use OgreOde with LIAV, you need to make sure that LIAV can find all the .dll, .lib and .h files

To do this I copied the following files

Copy OgreOde_Core_d.lib from OgreOde\lib\Debug to ogre-libraries\lib\Debug
Copy OgreOde_Core.lib from OgreOde\lib\Release to ogre-libraries\lib\Release
Copy OgreOde_Loader_d.lib from OgreOde\loader\lib\Debug to ogre-libraries\lib\Debug
Copy OgreOde_Loader.lib from OgreOde\loader\lib\Release to ogre-libraries\lib\Release
Copy OgreOde_Prefab_d.lib from OgreOde\prefab\lib\Debug to ogre-libraries\lib\Debug
Copy OgreOde_Prefab.lib from OgreOde\prefab\lib\Release to ogre-libraries\lib\Release

I also copied the associated dll's to the LIAV bin\Release and bin\Debug folders

In the Project Properties, the following lines were added to the additional include directories:

   ..\..\OgreOde\include
   ..\..\OgreOde\ode-0.11.1\include

And the following lines were added under Linker -> Input -> Additional Dependancies

For Debug:
   OgreOde_Core_d.lib 
   OgreOde_Prefab_d.lib 
   OgreOde_Loader_d.lib
and for Release:
   OgreOde_Core.lib 
   OgreOde_Prefab.lib 
   OgreOde_Loader.lib

And finally, edit OgreOde\ode-0.11.1\include\ode\common.h and change uint32 on line 118 to Ogre::uint32

There may be a few other details here that I have forgotten, but these are most of the important ones.