Any idea?

Conor

11-03-2008 13:00:41

ok... so this code works...
NxOgre::NxString test;

for(int counter =0;counter<4;++counter)
{
test="rope" + counter;
m_Body = m_Scene->createBody(test +"; RopeCap.mesh",new CapsuleShape(2,5),NxOgre::Pose(Vector3(-50,200-counter*10,200)),"mass: 10");

if(counter>=1)
{
m_RevoluteJoint = m_Scene->createRevoluteJoint(m_Scene->getActor("rope"+(counter-1)),m_Scene->getActor("rope"+counter),Vector3(1,1,1),Vector3(-50,195-(counter-1)*10,200));
}

}


but if i set for loop to for(int counter =0;counter<5;++counter)
(only difference being <4 to <5)
suddenly i get this exception when running the program... any ideas???

---------------------------
An exception has occured!
---------------------------
OGRE EXCEPTION(5:ItemIdentityException): Unable to derive resource group for ; RopeCap.mesh automatically since the resource was not found. in ResourceGroupManager::findGroupContainingResource at e:\projects\ogrecvs\branches\eihort_vc8_clean\ogrenew\ogremain\src\ogreresourcegroupmanager.cpp (line 1368)
---------------------------
OK
---------------------------

limdor

11-03-2008 14:13:20

I think you don't have the + operator in NxString class.
May be it's for this reason.

Conor

11-03-2008 14:20:20

yeah but it would then fail all the time surely and not when i go above 4 iterations... ?

limdor

11-03-2008 14:32:18

If the operator + doesn't exist then it behaviour may be unpredictable but i'm not sure.
Print the string every loop to see if it's correct.

petrinm

11-03-2008 16:37:14

It cant find file called "; RopeCap.mesh" so the error is with strings.
Try to use Ogre::String!

betajaen

11-03-2008 16:54:27

NxOgre has built in protection for Actors with duplicate names, it will call it Test, Test1, Test2, Test3 and so on. So you don't even need to use that integer with the string.

So it goes:

m_Body = m_Scene->createBody("test;RopeCap.mesh", ... );

Conor

11-03-2008 17:16:37

NxOgre has built in protection for Actors with duplicate names, it will call it Test, Test1, Test2, Test3 and so on. So you don't even need to use that integer with the string.


hmm.. you sure thats exact syntax.. it stops working completely if i do

m_Scene->getActor("rope"),m_Scene->getActor("rope"+counter)

betajaen

11-03-2008 17:17:47

m_Scene->getActor("rope"+counter)

Is causing the problem. Use m_Scene->getActor("rope" + Ogre::StringConverter::toString(counter));

Conor

11-03-2008 21:06:38

Cool thanks that converter thing worked perfectly /thumbs up