IrrODE - an Irrlicht - ODE wrapper (now with SVN)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Hmm ... maybe I should add support for more than animated meshes as parents. I guess I had a reason to do so, but I can't remember ;)

I never saw that internal error, most internal errors I know are just written to stdout, the application did never quit (on my machine), they sometimes appear when using trimeshes. Maybe you could debug the code and give some further information, e.g. a callstack would be nice.

If you use the normal ITerrainSceneNode class it works. Half of the demos included use terrain (IrrOdePlayground and IrrOdeCar), just add a terrain in IrrEdit as child of the worldnode and then add a CIrrOdeGeomHeightfield node as child of the terrain. Should work fine that way. You could also take a look at the IrrEdit file that is used in the IrrOdeCar demo (except for the bullets the tank shoots all scene nodes are created in IrrEdit).

You don't need to load a scene before calling the ode init method (if you are speaking of CIrrOdeManager::getSharedInstance()->initODE()). CIrrOdeManager::getSharedInstance()->initPhysics() must be called after some objects are present to be initialized, this actually adds your scene to the physics while initODE just does some initialization of ODE (I think it's just one method call).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

ulao wrote: [...]
I pretty sure this is a bit premature. But is there a way to make objects collidable in the editor?
[...]
Damn ... forgot to answer that this morning ;). There is a possibility to create another plugin for IrrEdit where you can test your scene "under game-circumstances". I did already think about adding such a plugin, but as I am currently a bit short on time you will have to wait a little bit.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

Damn ... forgot to answer that this morning ;). There is a possibility to create another plugin for IrrEdit where you can test your scene "under game-circumstances". I did already think about adding such a plugin, but as I am currently a bit short on time you will have to wait a little bit.
- understandable.

Yes I mean
CIrrOdeManager::getSharedInstance()->initODE()).
and
CIrrOdeManager::getSharedInstance()->initPhysics()

I'm do my load after these. So that is, bad then, I will fix that....

Thx for the feedback, I'll stick with box for now. If I get more info I will let you know.
Last edited by ulao on Wed Jun 03, 2009 2:55 pm, edited 1 time in total.
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Some more info: I think (am currently not at home, so I can't test it) that the initODE() method and the corresponding closeODE() method only need to be called once (e.g. at startup and shutdown) whereas the initPhysics() is called whenever you load a new scene (this method always after the scene is loaded). Note: I did not yet try to load a scene, unload it and load another one, don't know if that works.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

thx for the info, I'm thinking thats my problem. I did all the init stuff then I load my scene. but I could simply move this code around.

I'm also not at home but should be able to test it later.

---------------
I'd like to confirm that would be a yes.. initOde must be after ;)


also the download seem to be fixed now ;)
-------------

About terrains.. This may have been fixed, and I'm downloading the latest but if not.. When I add a height body -> HM-> geomesh for HM and try to move the body the terrain will not follow even though its a parent to it?


err, I just finished the download and the zip file is busted?
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Hmm ... the downloaded zip file works for me (I am at work now, no Irrlicht or other things insalled, I am using the normal Windows XP functionality to open the zip ... just checked with 7zip ... doesn't work there. I'll take a look at it when I come back home :( ).

About the terrains: the tree part must look like this:

root node -> CIrrOdeWorldNode -> ITerrainSceneNode -> CIrrOdeGeomHeightfield

works this way for me (there is just a problem that sometimes the objects sink into the terrain but they don't fall through)
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

New version: I added a static library for gcc so you don't have to compile the whole IrrOde stuff. Take a look at the IrrOdEdit example application on how to use it. As I am a little bit short on time today I did not yet add a lib for VC2008, but I'll do that this weekend (I hope).

@ulao: I just uploaded a new version. This time I packed it using 7Zip. Downloaded and opened it, worked for me, I hope it works for you as well.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

Brainsaw wrote: root node -> CIrrOdeWorldNode -> ITerrainSceneNode -> CIrrOdeGeomHeightfield
No CIrrOdeBody in fron of the ITerrainSceneNode ???

Download looks better ;)

Can not compile the latest source?

Code: Select all

.\source\IrrOde\CIrrOdeManager.cpp(47) : error C2065: 'm_cStepEvent' : undeclared identifier
..\source\IrrOde\CIrrOdeManager.cpp(59) : error C2065: 'm_cStepEvent' : undeclared identifier

Code: Select all

..\source\IrrOde\geom\CIrrOdeGeom.cpp(20) : error C2660: 'IIrrOdeDevice::massAdd' : function does not take 0 arguments
..\source\IrrOde\geom\CIrrOdeGeom.cpp(55) : error C2664: 'IIrrOdeDevice::geomSetBody' : cannot convert parameter 1 from 'CIrrOdeGeom *const ' to 'irr::u32'
        There is no context in which this conversion is possible
..\source\IrrOde\geom\CIrrOdeGeom.cpp(58) : error C2664: 'IIrrOdeDevice::geomDestroy' : cannot convert parameter 1 from 'CIrrOdeGeom *const ' to 'irr::u32'
        There is no context in which this conversion is possible
..\source\IrrOde\geom\CIrrOdeGeom.cpp(74) : error C2664: 'IIrrOdeDevice::geomSetBody' : cannot convert parameter 1 from 'CIrrOdeGeom *const ' to 'irr::u32'
        There is no context in which this conversion is possible

Code: Select all

..\source\IrrOde\CIrrOdeDevice.cpp(1000) : error C2511: 'void CIrrOdeDevice::geomSetBody(CIrrOdeGeom *,CIrrOdeBody *)' : overloaded member function not found in 'CIrrOdeDevice'
        d:\game dev stuff\irrlicht\irrOde\include\IrrOde\CIrrOdeDevice.h(46) : see declaration of 'CIrrOdeDevice'
To mention a few.. Did I miss something?
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

No body for the terrain. If you want to have a static entity you just define the geoms for that and they do not have a body attached. This is the way the ODE handles static things, and the heightfield geom (like some others) are static only, so they can't be attached to a body.

Damnit ... the m_cStepEvent ... it seems that I didn't update the VC projects ... shame on me :( ... the signature of "IIrrOdeDevice::geomSetBody" has changed. Internally IrrODE is using just indexes to refer to the objects and to make the code more straight (i.e. to use the same functionality in all methods) I updated a member that I forgot before. Did you mix the download with an old version? That should not happen as you should not get in contact with the OdeDevice. I think I'll have to take a look at that again. Do you still have the older version that was working? There was no change in functionality.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

I just over wrote the source with your new stuff and tried to recompile. Anything I had is gone. Figured you included the latest. I still have a working dll so I can work but I'd like to have a new version if I can. Since you dont build a non code:Blocks version I have no choice but to rebuild the dll for every update ;(

Ever think of svn?

BTW: I made my own VC project as your pathing assumed a lot. I dont have all that environment stuff set up so I have to create paths to ode and what not. What do I need to change in my VC project that you were thinking above?
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

I hope that I can include a VC2008 .lib static library with the next uploade (on Monday?), in that case it would not be necessary to compile it on your own.

I am not that familiar with Visual Studio as I use Code::Blocks but there should be some dialog in the project settings where you can add paths for the compiler and the linker to search for includes and libs. There are only a few paths that need to be adapted when you want to re-compile my VC projects: the include directories of irrOde, ODE and Irrlicht and the paths to the ODE and Irrlicht static libs.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

I forgot I made changes to your code .. I added "irrOde/" in the needed files.. So I just directly added the folder to the string ;), works.



also, Something that is not clear, Hopeing you can shed some light

for instance.. according to the tut I set up like so:
Body -> animated mesh -> geom sphere

now when I getSceneNodeFromName to get a handle for transformations do I get the body or animated mesh? Currently I'm getting a handle to the animated mesh by its name in the editor. and for CIrrOdeBody's I get a handle to the body's name in the editor. but do I need to be transforming the body when I need to say move up or down?


UPDATE: Ok, I do need to transform the body, if you can confirm this that be great. But I'm 99.9% sure that is the case.

So I need to change all of my getMeshNodes->setPosition()'s to getPhysicalBody->setPosition()'s ( these are my function names, but its self explanatory in what I'm doing )


Another strange thing I'm seeing, and this could be something in my code, but my object is spinning and moving? Is there anything that would cause an object to spin and move??? I set gravity mode to 0 to see if gravity was doing it but its still spinning and moving. I thing its moving along the X axis.. as well as moving up? My gravity is set to 0,-10,0 so if it was a gravity issue I should be going down, right?

Just for a test ro rule it out, I tried a gravity of 0,-100,0 and there was no change.
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Normally the object should neither spin nor move at it's initial state. From the information you give I can't see why it is spinning (and moving). As long as it doesn't collide with another object only gravity should drag it down. Maybe you set the positions of the ODE objects but not of the Irrlicht nodes in your own function so it collides although you can't see the object it collides with. My intention was to let the ODE do all the movement. I think it's not a good idea to alter an object's position while the simulation is running (unless you implemented a "moving platform" as described on the ODE wiki).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
ulao
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Post by ulao »

Ah duh,, I had two object in the same space.. I'll have to look in to how to exclude two object from contacting each other.

Oh, something that would help, that I never receive a confirmation on, is there no way to see the collision boxes ( wire frames )? I tried setDebugDataVisible( true ); but its not showing anything.

BTW: I have the latest build and I fall threw my terrain. I'm not 100% sure how to set it up. So I just added my H-MAP in the editor (with a GH under it) and hopped I'd fall on it, but went thew it.

It seem if I start my object just above my terrain it start to go spinning nuts. My guess is that I'm in the terrain at this moment. But if I drop from far above I never hit it.
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Hmm ... it's hard to find out what's wrong without further data. Could you post a code snippet or, if you use IrrOdEdit, upload the .irr file somewhere (or send me a PM if you don't have a space to upload it).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Post Reply