Setting up an Actor name manually

katzenjoghurt

15-10-2007 19:07:41

... is there any way to do so?

There is a NxOgre::Body->setName() method but it only affects the actor, yet not the entity (which seems to be rather impossible anyway to rename it after creation).

So setName() results in a crash with the second instance ... at least for me.

So is there a method to define the object's name strings in advance or am I bound to it's filename?
Didn't find anything in ActorParams or the corresponding param String though.

(Purpose: I'd like to add a prefix to the names allowing me to differentiate between "manipulateable" and "non-manipulatable" objects when clicking on them ...)

betajaen

15-10-2007 19:18:30

mBody = mScene->createBody("name of body goes here;meshName.mesh", ....);

NxOgre will handle name collisions quite well so myBody goes to myBody1, or myBody59 to myBody60 in case of a pre-existing actor with that name.

If you want to use your own entity and not let Body make it's own.

mBody = mScene->createBody("name of body goes here;(entity) entityname goes here", ....);

katzenjoghurt

15-10-2007 20:03:15

ahhh!
That's how it works! :)
I knew there must be some way.

Saw the "(entity)" String in the source but didn't make out it's purpose as I didn't look any closer at it.

Thx betajaen :D

(in fact I got a name collision when using ->setName() ... the second entity created got the same name as the first then I guess... )