Accessing a blueprint character via nxOgre-Scene?

ocrim74

14-12-2006 13:14:07

Hi,

I have created a blueprint character in my createScene()-method in my TutorialApplication-class and I can see it working. Now I want to let it move by pressing keys. I am testing the keys in the frameStarted-method of the TutorialFrameListener-class.

How can I access the character? Is there a method like the nxOgre::scene::findBody()-method that returns my character?

Do you have any ideas?

Thanks in advance.

ocrim74 :)

betajaen

14-12-2006 13:18:03

The blueprint<character>.create will return the character instance back to you, just like scene::createBody.

Check out 606, if you haven't done so already.

ocrim74

14-12-2006 13:35:56

Hi betajen,

thank you for the just-in-time answer. ;-)

I think I know what you mean, but if I create a body I do not need save the reference (pointer) to the instance of the body. I can get a pointer to a body by using findBody().

If I have many different characters that I can switch, it would be nice if I do not need to save a pointer for each character.

Is it right that there is no list like the "body-list" available for characters?

In that case I think I should create a vector-list for my character. What do you think about that?

Thanks a lot!

ocrim74

betajaen

14-12-2006 13:59:22

A vector or map would be certainly easier for you, as there isn't a findCharacter function yet in scene.

As with bodies you shouldn't delete them by hand, scene handles this for you.