New tutorial: Compile and use OgreOde

rewb0rn

20-01-2008 18:19:51

I wrote another tutorial. Had the idea for this some weeks and now I updated OgreOde and documented the process. Hope this will help all newbies with their questions and help fighting the often criticized small documentation. You find it here

dermont

21-01-2008 03:24:01

For Shoggoth you shouldn't need to comment out "visitRenderables" in OgreMovableObject.h, just update the OgreOdeBody.h and OgreOdeDebugContact.h headers with something like:


#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR > 4
void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables) {}
#endif

rewb0rn

23-01-2008 00:54:23

Thanks, I did not know. Are you sure on this? Because I wont downgrade to Eihort again to test this. If you are i will add it to the tutorial. But anyways its a question whether you want to try to keep OgreOde compatible to all future Ogre versions, which I think might get quite intricate at some point..

mesh

05-02-2008 21:12:28

Any chance of adding a section for people who use the OgreSDK?

I tried using this tutorial but I couldnt get any far with it because im using Eihort v1.4.2.

Maybe links to the appropiate versions of OgreOde and Ode would be helpful.

rewb0rn

06-02-2008 23:10:54

Sorry, but I wont switch back to Eihort. But maybe I can help if you give a description what makes you worry.

mesh

07-02-2008 18:07:23

Okies I have installed OgreSDK.

Added the ode-0.9 to the C drive

Installed the OgreOde_SourceSDK_Setup.exe file.


Next I opened the project OgreOde_Source.sln in the directory...

scripts->VC8.


Then I added the following in the tool->options->Vc++ directories...


include files:

C:/Ogre/include
C:/OgreOde/include
C:/Ode/include

library files:

C:/Ogre/lib
C:/OgreOde/lib


Now when I compile the GranTurismOgre I get the error...

cannot open include file: 'ExampleApplication.h'

rewb0rn

07-02-2008 18:58:19

Actually that has nothing to do with the ogre version and I did not describe how to compile the samples :) The "ExampleApplication.h" is part of the Ogre demos. You find it here: ogrenew\Samples\Common\include. I recommend to add that folder to your additional includes for the sample projects.

If you are trying to compile the demos already, I suppose you compiled the library successfully?

mesh

08-02-2008 15:28:41

I dont think so.



1>------ Build started: Project: Demo_GranTurismOgre, Configuration: Debug Win32 ------
1>Compiling...
1>GranTurismOgre.cpp
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(14) : error C2065: 'SET_TERM_HANDLER' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(195) : error C2065: 'mInputDevice' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(195) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(195) : error C2065: 'KC_E' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(201) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(201) : error C2065: 'KC_B' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(207) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(207) : error C2065: 'KC_N' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(213) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(213) : error C2065: 'KC_U' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(218) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(218) : error C2065: 'KC_P' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(224) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(224) : error C2065: 'KC_X' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(269) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(269) : error C2065: 'KC_J' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(270) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(270) : error C2065: 'KC_L' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(271) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(271) : error C2065: 'KC_I' : undeclared identifier
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(272) : error C2227: left of '->isKeyDown' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>c:\ogreode\demos\granturismogre\src\granturismogre.cpp(272) : error C2065: 'KC_K' : undeclared identifier
1>Build log was saved at "file://c:\OgreOde\demos\GranTurismOgre\obj\Debug\BuildLog.htm"
1>Demo_GranTurismOgre - 22 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Now I get this problem.

:(

rewb0rn

08-02-2008 17:13:59

I can not reproduce this error. I think you are using an outdated version of ois.

dermont

08-02-2008 19:42:54

@rewb0rn
With regards Shoggoth and OgreOde, yes I'm pretty sure that the above implementation of "visitRenderables" works. I've used it with Shoggoth and Eihort.

Also with Shoggoth you need to update the OgreOde Demos to remove occurances of entity->setNormaliseNormals(true).


#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR < 5
entity->setNormaliseNormals(true);
#endif


http://www.ogre3d.org/wiki/index.php/ShoggothNotes

FredFriendship

14-02-2008 07:46:37

Just out of curiosity, what are the OgreOde_Prefab and OgreOde_Loader used for?

rewb0rn

20-02-2008 17:16:48

prefab stores some high level classes like ragdolls and vehicles, loader loads them from files.

rewb0rn

22-02-2008 20:39:35

@dermon: I changed the tutorial according to your first post. Because the tutorial only covers building the library but not the samples, there are no occurances of entity->setNormaliseNormals(true).

sreek

19-04-2008 18:00:31

I followed the tutorial and was able to compile the core and the
loader. But the prefab wont compile and gives me these errors:

------ Build started: Project: OgreOde_Prefab, Configuration: Debug Win32 ------
Linking...
Creating library ..\..\lib\Debug/OgreOde_Prefab_d.lib and object ..\..\lib\Debug/OgreOde_Prefab_d.exp
OgreOdeRagdoll.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall OgreOde::Space::collide(class OgreOde::CollisionCallback *,class OgreOde::Geometry *)" (?collide@Space@OgreOde@@UAEXPAVCollisionCallback@2@PAVGeometry@2@@Z)
OgreOdeVehicle.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall OgreOde::Space::collide(class OgreOde::CollisionCallback *,class OgreOde::Geometry *)" (?collide@Space@OgreOde@@UAEXPAVCollisionCallback@2@PAVGeometry@2@@Z)
OgreOdeRagdoll.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall OgreOde::Space::collide(class OgreOde::CollisionCallback *,class OgreOde::Space *)" (?collide@Space@OgreOde@@UAEXPAVCollisionCallback@2@PAV12@@Z)
OgreOdeVehicle.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall OgreOde::Space::collide(class OgreOde::CollisionCallback *,class OgreOde::Space *)" (?collide@Space@OgreOde@@UAEXPAVCollisionCallback@2@PAV12@@Z)
OgreOdeRagdoll.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall OgreOde::Space::collide(class OgreOde::CollisionCallback *)" (?collide@Space@OgreOde@@UAEXPAVCollisionCallback@2@@Z)
OgreOdeVehicle.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall OgreOde::Space::collide(class OgreOde::CollisionCallback *)" (?collide@Space@OgreOde@@UAEXPAVCollisionCallback@2@@Z)
OgreOdeRagdoll.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall OgreOde::BallJoint::setParameter(enum OgreOde::Joint::Parameter,float,int)" (?setParameter@BallJoint@OgreOde@@UAEXW4Parameter@Joint@2@MH@Z)
OgreOdeRagdoll.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall OgreOde::BallJoint::getParameter(enum OgreOde::Joint::Parameter,int)" (?getParameter@BallJoint@OgreOde@@UAEMW4Parameter@Joint@2@H@Z)
..\..\lib\Debug/OgreOde_Prefab_d.dll : fatal error LNK1120: 5 unresolved externals
Build log was saved at "file://c:\OgreOde\prefab\obj\Debug\BuildLog.htm"
OgreOde_Prefab - 9 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I should note that I am using Eihort.
Any ideas?

rewb0rn

20-04-2008 20:45:41

Did you download the svn version? Because those functions are part of OgreOde core and if they are not included in the library it looks to me you are using another version of the project. Try to find the files the functions are implemented in and make sure they are part of the project in vc.

GypsyTiger

07-05-2008 00:35:00

@rewb0rn
With regards Shoggoth and OgreOde, yes I'm pretty sure that the above implementation of "visitRenderables" works. I've used it with Shoggoth and Eihort.

Also with Shoggoth you need to update the OgreOde Demos to remove occurances of entity->setNormaliseNormals(true).


#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR < 5
entity->setNormaliseNormals(true);
#endif


http://www.ogre3d.org/wiki/index.php/ShoggothNotes


Another little thing I had to adjust, following the same logic and references, this particular one from OgreOdeEntityInformer.cpp

#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR > 4
geom->setPosition(_node->_getDerivedPosition());
geom->setOrientation(_node->_getDerivedOrientation());
#else
geom->setPosition(_node->getWorldPosition());
geom->setOrientation(_node->getWorldOrientation());
#endif

GypsyTiger

07-05-2008 00:39:23

I'm hitting this particular compilation problem right now, where
typedef unsigned int uint32;
is being defined in 2 places, one in OgrePlatform.h as Ogre::uint32
and in odeconfig.h as uint32

The resulting error is this:

4>Landscape.cpp
4>c:\dev\odesdk\include\ode\common.h(127) : error C2872: 'uint32' : ambiguous symbol
4> could be 'c:\dev\odesdk\include\ode\odeconfig.h(47) : unsigned int uint32'
4> or 'c:\dev\ogre-svn\ogremain\include\ogreplatform.h(213) : Ogre::uint32'

rewb0rn

07-05-2008 07:56:07

1) Yes the function names have changed, but is that really part of the library or part of a demo? Because I didn't get that problem. Or maybe the code has changed after I've written the tutorial.

2) You should get it removed by writing ::uint32 instead of uint32 when it throws that error. (Maybe its using the Ogre version then you should write Ogre::uint32 instead)

GypsyTiger

07-05-2008 19:46:11

1) Yes the function names have changed, but is that really part of the library or part of a demo? Because I didn't get that problem. Or maybe the code has changed after I've written the tutorial.

2) You should get it removed by writing ::uint32 instead of uint32 when it throws that error. (Maybe its using the Ogre version then you should write Ogre::uint32 instead)


1)Looks to me to be part of the library code ogreode\src\OgreOdeEntityInformer.cpp I used the latest [ as of yesterday ] svn versions of ogre/ode/ogreode so it's quite possible I hit a new change, here's the part related in ShoggothNotes
Renderable changes

* getWorldPosition and getWorldOrientation removed from Renderable interface, not used
o NOTE: the Node::* versions of the same name have also been removed. Use _getDerivedPosition/_getDerivedOrientation instead.


2) Since the error was showing up in ode/include/config.h I didn't want to change that file. This is a patch for what worked:
Index: Landscape.h
===================================================================
--- Landscape.h (revision 2429)
+++ Landscape.h (working copy)
@@ -1,7 +1,7 @@
-#include "ExampleApplication.h"
#include "OgreOde_Core.h"
#include "OgreOde_Prefab.h"
#include "OgreOde_Loader.h"
+#include "ExampleApplication.h"

class LandscapeFrameListener : public ExampleFrameListener,
public OgreOde::TerrainGeometryHeightListener,


3) My problem now is that the demos crash at runtime. SimpleScene is the only one that draws without crashing, but it dies when any kind of physics-enabled object is created.

I guess I need to go through a very simple tutorial and create the simplest test case I can.

gmagno

27-08-2008 14:53:48

Hello, I am getting the exact same problem as GypsyTiger when running SimpleScene demo, it crashes when i press F2, F3 ..., although the application is launched ok.

An other problem is that i also get that compiling error that GypsyTiger is getting with the other demos:

common.h(115) : error C2872: 'uint32' : ambiguous symbol

Thanks in advance

rewb0rn

27-08-2008 18:30:10

Are you using Shoggoth?

About that ambigous symbol:

2) You should get it removed by writing ::uint32 instead of uint32 when it throws that error. (Maybe its using the Ogre version then you should write Ogre::uint32 instead)

gmagno

27-08-2008 19:47:11

Thanx for replying!!

I am using Ogre 1.4.8 (Eihort), and about that compiling error, I changed 'uint32' to 'unsigned int' (my pc is 32bits). I tried ::uint32 and Ogre::uint32 and got some errors when compiling Ode alone or compiling the demos, and with 'unsigned int' I get no error.

I gave up of trying to put the demos to work crrectly and tried the tutorial, and now I am getting the same runtime error as 'paco', a guy who posted here:
http://www.ogre3d.org/phpBB2addons/view ... 6f4e2718c6

I get the error exacly where he gets his:

mNode->attachObject(mBody);

Any idea of what might be the problem?

rewb0rn

28-08-2008 07:15:27

I recommend you work with Shoggoth but if you investigate into OgreOde and Eihort I'd gladly see any patch.

gmagno

28-08-2008 12:26:27

Ok, thank you anyway. See you around.

toum

25-04-2009 19:10:58

What should i compile at the end of Ogre core of this tutorial? .lib file or .dll file?

Although errors i success to compile ogreode\lib\Debug\OgreOde_Core_d.lib and ogreode\lib\Release\OgreOde_Core.lib

I am in right way??!

Thanks all !!

Toum.