[SOLVED] [NxOgre 0.9'38] NxOgre::Body::setName() Problem

NickM

11-01-2008 21:43:08

Hi, I'm creating an NxOgre Body using a mesh called 'xxx.mesh', which looking through the NxOgre code, creates an Ogre::Entity called 'xxx.mesh-0'
I then change the name of the body using NxOgre::Body::setName() and then go on to create another body using the same mesh, during the creation NxOgre checks whether a body already exists with the name 'xxx.mesh' but of course it doesn't because I changed it, NxOgre goes ahead and creates the body, then tries to create another Ogre::Entity with the name 'xxx.mesh-0'. An Entity with that name already exists so Ogre finds the mistake and complains.

I guess NxOgre needs to change the Entity name as well when you call Body::setName() :?:
Is there a way to set the name of a Body before it's created?

NickM

11-01-2008 22:00:33

Hmm...it seems you can't set an Entities name after creating it, so I'm going to have to set the name of the NxOgre Body before it creates the Entity. :roll:

betajaen

11-01-2008 22:19:04

Body name:

mScene->createBody("bodyName; mesh.mesh", ...);

Or use an entity you have already created.

Entity* entity = mSceneMgr->createEntity(...);
mScene->createBody("bodyName; (entity) entityName", ...);

NickM

11-01-2008 22:31:58

Thanks betajaen, I just realised that I could do that, finished testing it, came on here to say and you've already replied, thanks again. :D