Hi Again,

somehow it is still not working. The setStartTick method has no effect at all. 
i tried to set the startTick in _view, _timer and both, nothing worked.

As i want to start the animation from the beginning, each time i press the play 
button, i do the folowing:


Code:

bool RecordCameraPathHandler::handle(const osgGA::GUIEventAdapter &ea, 
osgGA::GUIActionAdapter &aa)
{
        _view = dynamic_cast<osgViewer::View*>(&aa);


        // The user has requested to BEGIN playback.
        if (!_currentlyPlaying)
        {
                _view->setStartTick(_timer->tick());
                _timer->setStartTick(_timer->tick());
                std::ifstream in(_filename.c_str());
                _animPath.~ref_ptr();
                _animPathManipulator.~ref_ptr();
                _animPath = new osg::AnimationPath();
                _animPath->read(in);
                _animPathManipulator = new 
osgGA::AnimationPathManipulator(_animPath.get());
                _animPathManipulator->home(ea,aa);

                // If we successfully found our _filename file, set it and keep 
a copy
                // around of the original MatrixManipulator to restore later.
                if (_animPathManipulator.valid() && 
_animPathManipulator->valid())
                {
                        _oldManipulator = _view->getCameraManipulator();
                        _view->setCameraManipulator(_animPathManipulator.get());
                        _currentlyPlaying = true;
                }
        }

        // The user has requested to STOP playback.
        else
        {
                // Restore the old manipulator if necessary and stop playback.
                _view->setCameraManipulator(_oldManipulator);
                _currentlyPlaying = false;
                _oldManipulator = 0;
        }
}




I guess, i am doing something wrong. Please give me some support.

thanks
Felix[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18717#18717





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

Reply via email to