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: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Nice to hear you got it working ;)

Note: I am just adding a replay feature to IrrOde (like the one in "Stunt Marble Racers"), and while trying to set up the new project "IrrOdeRePlayer" I got my beloved old problem again:
undefined reference to `_imp___ZN3irr5video16IdentityMaterialE'
This happens to me when I set up a new project in Code::Blocks using my wrapper, and it is solved by moving the libIrrOde.a to the top in the linker settings. Just in case you're running into the problem (or me setting up a new project and wondering ... again ;) ).
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: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

It's been a few weeks now, but here's a new version which adds some recording feature to IrrOde. This feature has been adapted from "Stunt Marble Racers". You can hit the "F2" key in the "IrrOdeCar" demo to start a recording and to stop and save it. The (yet very simple) IrrOdeRePlayer will check for this recording (located in "data/replay/car.rec") and replay it. There are still some problems, but in gereral it works.

The next steps will be:

- enhance the replayer
- add some (brute force) networking (like the networking in "Stunt Marble Racers" - just better ;) ).
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
blackMasoon
Posts: 149
Joined: Wed Sep 09, 2009 4:57 pm
Contact:

Post by blackMasoon »

Now I passed through all the initialization stuff and after adding the step method in update loop I received: "Please call ODE Initialization(dInitODE or similar) before using the library (..\ode\src\collision_kernel.cpp:256)"
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Sounds to me like you didn't call "CIrrOdeManager::initODE" somewhere in the code. Needs to be done once, normally somwhere before entering the main loop and before initializing physics.
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: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

No new phyiscal features, but I updated the IrrOdeCar demo with the latest version of the advanced particle system: now there are explosions whenever you shoot something.
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
jaxxa
Posts: 6
Joined: Fri Mar 26, 2010 2:50 am

Post by jaxxa »

Hi thanks for the great wrapper.
I am making a FPS type game and was wondering how I would go about detecting when one of my "bullet" objects has hit one of the enemies?

Also CIrrOdeBodyhas a setPosition function but I can not seen to see a getPosition function, so I was wondering how one would go about doing that.

It would be great if you could point me in the direction of some examples.
Thanks in advance for your help
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Hi,

to detect if one object has hit another you must register an IrrOdeEventListener with the queue of CIrrOdeManager. You need to handle the odeBodyMoved event that does also includes information about collisions. Check the IrrOdeCar demo. The plane, the helicopter and the tank can shoot, and the CProjectile class manages those shots (I think there is also a ProjectileManager class, but as I'm currently at work I don't have the code by hand).

I gotta check the setPosition and getPosition things, am currently not sure (see above ;) ). IIRC setPosition also sets the position of the ODE object, but it's not necessary to override the original getPosition method ... the Irrlicht scene nodes get updated automatically.

Btw: it's not a good idea to set an object's position after it is processed by the ODE part, this might lead to some instabilities. I just use setPosition before initializing the physics of an object (see CProjectile for an example).
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
jaxxa
Posts: 6
Joined: Fri Mar 26, 2010 2:50 am

Post by jaxxa »

Thanks for the quick reply.

You say it is a bad idea to directly set a objects position after it is processed.
What about a enemy object that I don't want to be effected by physics, just use physics for collision detection with I, will that be ok?
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Well ... it *should* work, but in certain cases setting the position of an object directly can lead to unwanted behaviour, especially if it's fast moving or teleporting (well ... if you set the position directly it's always teleporting, but it should be OK if you don't move it too far).

Btw: I haven't tried that (yet), but there is an article about platforms on the ODE wiki: http://opende.sourceforge.net/wiki/inde ... g_platform.

Btw2: Maybe the Kinematic State could help you: http://opende.sourceforge.net/wiki/inde ... atic_State, although I'd have to include that into the wrapper first.
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: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Btw: it just came to my mind that I *do* use the setPosition method in "Stunt Marble Racers" when a respawn is done. In this case it just leads to problems if two marbles respawn at the same time for then the marbles appear within each other and are pushed apart with some rather high force. Apart from that I haven't noticed problems in this simple case.
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: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Got a new version online:

* removed the IrrOdeMarble project
* added new attributes to CIrrOdeTorque. It's not possible to influence how much roll, pitch and yaw is applied
* Updated the IrrOdeCar demo trying to bring down the size of the replays
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
macron12388
Posts: 126
Joined: Wed Sep 29, 2010 8:23 pm

Post by macron12388 »

Hi, I am not sure if I am doing something wrong, but there seems to be an undefined reference to a class

Code: Select all

CIrrOdeSceneNode
member

Code: Select all

getMaterial(u32 iIdx)
involving a u32 argument

in

Code: Select all

path\path\libIrrOde.a
Here is debugger output

Code: Select all


-------------- Build: Debug in IrrlichtODE ---------------

Linking console executable: bin\Debug\IrrlichtODE.exe
..\..\..\..\..\irrlicht-1.7.2wODE\lib\Win32-gcc/libIrrOde.a(CIrrOdeSceneNode.o):CIrrOdeSceneNode.cpp:(.text$_ZN3irr5scene10ISceneNode11getMaterialEj[irr::scene::ISceneNode::getMaterial(unsigned int)]+0x4): undefined reference to `_imp___ZN3irr5video16IdentityMaterialE'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
 
and

Code: Select all

..\..\..\..\..\irrlicht-1.7.2wODE\lib\Win32-gcc\libIrrOde.a(CIrrOdeSceneNode.o):CIrrOdeSceneNode.cpp:(.text$_ZN3irr5scene10ISceneNode11getMaterialEj[irr::scene::ISceneNode::getMaterial(unsigned int)]+0x4)||undefined reference to `_imp___ZN3irr5video16IdentityMaterialE'|
||=== Build finished: 1 errors, 0 warnings ===|

I am using code::blocks ide.
Remark: from my development I have found out that the current ODE version 0.11.1 release doesn't work properly
with the gcc compiler. If you use the debug version everything works fine. I suggest using the statically linked
version so that gcc removes the debug symbols when compiling. This brings the filesize down quite a bit. You should
also define dNODEBUG before compiling the static link debug version of ODE so that the program won't quit on invalid
data.
I am using the gcc compiler, so I am guessing this is why it doesn't work?

I will try that solution, if that doesn't work then maybe it is something else... ?[/code]
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

macron12388 wrote:Hi, I am not sure if I am doing something wrong, but there seems to be an undefined reference to a class

Code: Select all

CIrrOdeSceneNode
member

Code: Select all

getMaterial(u32 iIdx)
involving a u32 argument

in

Code: Select all

path\path\libIrrOde.a
Here is debugger output

Code: Select all


-------------- Build: Debug in IrrlichtODE ---------------

Linking console executable: bin\Debug\IrrlichtODE.exe
..\..\..\..\..\irrlicht-1.7.2wODE\lib\Win32-gcc/libIrrOde.a(CIrrOdeSceneNode.o):CIrrOdeSceneNode.cpp:(.text$_ZN3irr5scene10ISceneNode11getMaterialEj[irr::scene::ISceneNode::getMaterial(unsigned int)]+0x4): undefined reference to `_imp___ZN3irr5video16IdentityMaterialE'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
 
and

Code: Select all

..\..\..\..\..\irrlicht-1.7.2wODE\lib\Win32-gcc\libIrrOde.a(CIrrOdeSceneNode.o):CIrrOdeSceneNode.cpp:(.text$_ZN3irr5scene10ISceneNode11getMaterialEj[irr::scene::ISceneNode::getMaterial(unsigned int)]+0x4)||undefined reference to `_imp___ZN3irr5video16IdentityMaterialE'|
||=== Build finished: 1 errors, 0 warnings ===|

I am using code::blocks ide.
Remark: from my development I have found out that the current ODE version 0.11.1 release doesn't work properly
with the gcc compiler. If you use the debug version everything works fine. I suggest using the statically linked
version so that gcc removes the debug symbols when compiling. This brings the filesize down quite a bit. You should
also define dNODEBUG before compiling the static link debug version of ODE so that the program won't quit on invalid
data.
I am using the gcc compiler, so I am guessing this is why it doesn't work?

I will try that solution, if that doesn't work then maybe it is something else... ?[/code]
I do also stumble upon this problem every now and then, so I posted the solution somewhere in this thread:
undefined reference to `_imp___ZN3irr5video16IdentityMaterialE'
This happens to me when I set up a new project in Code::Blocks using my wrapper, and it is solved by moving the libIrrOde.a to the top in the linker settings. Just in case you're running into the problem (or me setting up a new project and wondering ... again Wink ).
Seems to be an issue with the mingw linker. The problem with the debug/release version has nothing to do with it, in the release there seems to be a problem with collision detection and I couldn't figure out why so I use the hack I described.
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
macron12388
Posts: 126
Joined: Wed Sep 29, 2010 8:23 pm

Post by macron12388 »

Seems to be an issue with the mingw linker. The problem with the debug/release version has nothing to do with it, in the release there seems to be a problem with collision detection and I couldn't figure out why so I use the hack I described.
:shock: :oops: :oops: Oh my, I'm so sorry, I swear I looked through your thread looking to see if that was a common problem...hehe I guess one shouldn't try to program when very tired. Well, it's a fresh morning now and I'm ready! 8)

EDIT: It works like a charm now man, thanks a mega!
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Post by polylux »

Hey Brainsaw!

I'm trying to get your great work to compile but I stumbled upon the CAdvancedParticleSystem (in irrODECar) which you seem to have added recently. Unfortunately, this is neither part of the current version of Irrlicht nor irrODE. Can you help me on this?

Cheers,
p.
beer->setMotivationCallback(this);
Post Reply