Missing a function

rUmbl3

14-05-2006 21:45:07

As i saw today, there is a quite useful function (scene->findBody(Ogre::String)) but its only specified in nxOgre_scene.h and I cant find it anywhere else.
So when i compile my code there is always a linking error.
Would be very cool if you can add some code so its not only a stupid declaration and we can use it :)

betajaen

14-05-2006 23:50:32

Use the mouse wheel next time (half a page down on the forum)

http://www.ogre3d.org/phpBB2addons/view ... =6645#6645

:D

rUmbl3

15-05-2006 12:26:44

shit :D
seems like i forgot to wear my glasses oO
thanks for help :)

rUmbl3

15-05-2006 17:21:32

hm seems like this code is not working that fine to me as to the guy in the other thread .. I get this error when executing:
HEAP[Warfare.exe]: Invalid Address specified to RtlFreeHeap( 00B20000, 00F3DB04 )

Seems like the code dont likes me :(

someone got a clue why this happens?

betajaen

15-05-2006 18:00:07

I've never seen an error like that before.

My advice is to re-compile everything from scratch; NxOgre and your application, and make sure you copy the latest NxOgre.dll over to your application directory.

Just in case it's a dll error.

rUmbl3

15-05-2006 19:35:07

a complete recompilation didn't changed anything ... still the same error. but its now pointing to some lines in the vector header.
the error seems to be in the iterator ..

€: okay, I know now that this error happens if you delete a pointer twice ...
I will have a look at the iterator code ..

betajaen

15-05-2006 20:53:56

Ahh, it's probably that then..

Quick question are you compiling in Debug or Release?

rUmbl3

15-05-2006 21:06:09

its still release mode :)

magura

16-05-2006 01:35:30


body* scene::findBody(Ogre::String name)
{
std::vector<body*>::iterator iter;
for (iter = mBody.begin(); iter != mBody.end(); iter++)
{
if ((*iter)->getName() == name)
return(*iter);
}

return(NULL);
}


I had that code for findBody for the old (preview 2) version of nxogre, and it works fine in the current version, but it crashes on vehicle objects, so I have to store them permanently in my own objects.

betajaen

16-05-2006 09:31:59

It'd crash on vehicle objects because they are a "prefab" not a body.

I don't think there I wrote a prefab iterator but the code is almost identical to the body one anyway.

rUmbl3

16-05-2006 21:45:57

thank you magura! This works perfectly! I think i need to get some more knowledge on iterators oO