Hi Yang,
The GlyphQuads are supposed to be be internal data structures that
aren't accessed externally, so if you are needing access to them then
it suggests that public API really needs to tweaking to give you
access to what you want without grappling with the internals. Why not
have a bash at adding such an public access method and I'll review it
as poposal for an addition to the core osgText::Text implementation.
Robert.
On Sun, Oct 12, 2008 at 3:05 PM, yang zhiyuan <[EMAIL PROTECTED]> wrote:
> 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
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org