Hi:
I have some code to update from osg1.2 to osg2.6 and confront with some
problem.
the input parameter for osgText::getGlyphQuads has changed from
osg::StateSet* stateSet
to Font::GlyphTexture* texture.
Here is my original code:
osg::Vec3 cursor_position = m_inputText->getPosition();
osg::StateSet* ss = m_inputText->getStateSet();
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//m_inputText->getGlyphQuads( ss ) has to be changed.:)
const osgText::Text::GlyphQuads * glyph_quads =
m_inputText->getGlyphQuads( ss );
if( glyph_quads )
{
int coord_size = glyph_quads->getTransformedCoords(0).size();
int input_text_size = string.size(); // # chars on line.
//assert( position <= input_text_size );
//assert( position * 4 <= coord_size );
if( position > 0 )
{
// Get position of character under cursor
// There are 4 coords per character, BottomLeft, TopLeft,
// BottomRight, TopRight. We want the BottomRight.
osg::Vec3 glyph_pos = glyph_quads->getTransformedCoords(0)[
position * 4 - 2 ];
cursor_position[0] = glyph_pos[0]; // Use only the X position
}
}
Is there anyone can tell me how to modify the above function
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org