Hi Alexandre,

On Wed, Jun 17, 2009 at 4:03 PM, Alexandre Amalric<[email protected]> wrote:
> You said
>
> AnimationPathManipulator could be modified to get the
> current viewer FrameStamp by doing a dynamic cast to osg::View and get
> the osg::FrameStamp from it rather than than FRAME event
>
>
> Dynamic cast to osg::View has to be done on wich object ?? When I try to
> dynamic cast my derived osgGA::MatrixManipulator to an osg::View the pointer
> is null.
> Could you point me in the right direction please ?


Have a look at the osgpick example as it has an example of code
casting to a View from the GUIActionHandler :

bool PickHandler::handle(const osgGA::GUIEventAdapter&
ea,osgGA::GUIActionAdapter& aa)
{
    switch(ea.getEventType())
    {
        case(osgGA::GUIEventAdapter::PUSH):
        {
            osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
            if (view) pick(view,ea);
            return false;
        }


In your case casting to an osg::View* would be sufficient as it has an
osg::FrameStamp.  osgViewer::View subclasses from osg:View so the cast
should resolve this fine.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to