Hi all, I'm trying to implement picking in OSG using C#. I refer to C++
examples for such an implementation.
Part of the C++ example code is as follows,
class PickHandler : public osgGA::GUIEventHandler
{
public:
PickHandler() : _mX( 0. ),_mY( 0. ) {}
bool handle( const osgGA::GUIEventAdapter& ea,
osgGA::GUIActionAdapter& aa )
{
osgViewer::Viewer* viewer =
dynamic_cast<osgViewer::Viewer*>( &aa );
if (!viewer)
return false;
....
}
bool pick( const double x, const double y,
osgViewer::Viewer* viewer )
{
....
}
.....
}
The method GUIEventHandler::handle() is overridden and the pointer to the
osgGA::GUIActionAdapter object (aa) is cast into a osgViewer::Viewer pointer
(viewer). Then the osgViewer::Viewer pointer is passed to the pick() method.
My problem is that I think such a casting from aa to viewer is infeasible in
C#. Does anyone know deal with this problem?
Thanks!
Ke Li
_________________________________________________________________
Put your friends on the big screen with Windows Vista® + Windows Live™.
http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org