Le 25 mai 06, à 17:28, Jorge Arteaga a écrit :
Hello all users!
Using the standard example of osgpick, I want to my HUD-class object
to "know" the value of the osgText object. I have a created a class
structure of the original member function osg::Node*
createHUD(osgText::Text* updateText), but ecentially it does the same
thing.
I am aware of the the return issues regarding the osgText object, so I
have function
that take cares of that.
std::string gettext()
{
const osgText::String& item = updateText->getText();
return item.createUTF8EncodedString();
}
If I place these two lines inside in the main loop, the desired result
is obtained. But I do not want to do that.
Usage :The name of the object being pick will effect what is to be
displayed on the HUD.
If I understand well, you want updateText to take the value of the
picked osgText instance.
Then what you would need is to perform a dynamic cast in the
PickHandler to check if the picked object is of type osgText and if
result is not null, update the updateText using getText().
Antoine
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/