Use AnnotationEventHandler to pick up a AnnotationNode
I am Using AnnotationEventHandler to pick up a AnnotationNode,or pick up some osgText object in a AnnotationNode class specificly.
Then there is a problem,it seems the osgText's alignment and DrawMode effect the result whether it can pick up a AnnotationNode or not.
For example ,If an osgText's DrawMode is osgText::Text::BOUNDINGBOX or osgText::Text::FILLEDBOUNDINGBOX,it can pick up perfectly.
If osgText's DrawMode is only osgText::Text::TEXT ,and only has one line,it can pick perfectly.
If osgText's DrawMode is only osgText::Text::TEXT ,but has multi lines.Such as:
Then if we click the last line of osgText "C",or the half down part of "C" specificly ,it can not pick.
I have used osgEarth::TextSymbol::ALIGN_LEFT_BOTTOM as a default alignment,if I change to another alignment.It still can not fully pick up a multi lines osgText (without boundingBox) either.The only difference is which part of multi lines I can not pick.
So is there a better way I can fully pick up a mutil lines osgText in the AnnotationNode?
Re: Use AnnotationEventHandler to pick up a AnnotationNode
AnnotationEventHandler is deprecated for picking annotation objects because of limitations like this. Instead I encourage you to look into using the RTTPicker instead. (See the osgearth_pick example for usage.)