Adding to the following email:
osgViewer::Viewer is derived from osgViewer::View and osgViewer::Viewerbase,
and osgViewer::View is derived from
osg::View and osgGA::GUIActionAdapter. These classes are modeled in a typical
way of multiple implementation inheritance which is unacceptable in C#.
Thanks!
Ke Li
From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Wed, 9 Jan 2008 16:06:42
-0700Subject: [osg-users] Implementing picking using C#
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™. Start
now!
_________________________________________________________________
Make distant family not so distant with Windows Vista® + Windows Live™.
http://www.microsoft.com/windows/digitallife/keepintouch.mspx?ocid=TXT_TAGLM_CPC_VideoChat_distantfamily_012008_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org