from geom to node

s3660870

04-06-2007 11:32:20

Hi, how can I get the node a geom is attached to? I tried to put the node in the geom->setUserObject(void*) but somehow it didnt work, the Method setUserObject wasn´t even tried to execute, so everytime I tried to get the node back by (Ogre::SceneNode*)(geom->getUserObject()) I got a "false" instead of my node.
What is wrong? Am I misunderstanding the purpose of userObject? Is there an easier way to get the node?
Thanks for Help.
Hans.

Happy-Howard

04-06-2007 11:52:38

I don't know why it doesn't work for you but I do it the same way and it works fine.

s3660870

04-06-2007 12:33:13

when do you attach the node? right after you´ve created the geom, don´t you?

Happy-Howard

04-06-2007 13:41:43

Well I used to attach a node. Now I attach another type of object to the geom. The type of object you attach shouldn't matter though.

I use oFusion to load my scenes and I create the geom and do the setUserObject in the callback function "OnEntityCreate".

I don't understand what you mean by "the Method setUserObject wasn´t even tried to execute"?

s3660870

04-06-2007 14:24:24

Well when I debug and set a stopPoint right before setUserObject() and then try to go through the code step by step it simply don´t stop at "setUserObject()" but oversteps it.
Could it be a problem if there is already a userObject attached?(there shouldnt be one, but who knows).

I´m quit new in C++, maybe I`m doing somekind of a newbie fault.
When I´m back home, I´ll post some code.