本文整理汇总了C++中osg::observer_ptr::setTimeMultiplier方法的典型用法代码示例。如果您正苦于以下问题:C++ observer_ptr::setTimeMultiplier方法的具体用法?C++ observer_ptr::setTimeMultiplier怎么用?C++ observer_ptr::setTimeMultiplier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::observer_ptr
的用法示例。
在下文中一共展示了observer_ptr::setTimeMultiplier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle
//.........这里部分代码省略.........
setColor(_currentGeometry.get(), osg::Vec4(1,1,1,1));
_currentImageStream = is;
if (is->getStatus() == osg::ImageStream::PLAYING)
{
is->pause();
}
else
{
is->play();
}
}
}
}
}
break;
}
case(osgGA::GUIEventAdapter::KEYDOWN):
{
if (!_currentImageStream.valid())
return false;
if (ea.getKey()=='p')
{
osg::ImageStream::StreamStatus playToggle = _currentImageStream->getStatus();
if (playToggle != osg::ImageStream::PLAYING)
{
std::cout<< _currentImageStream.get() << " Play"<<std::endl;
_currentImageStream->play();
}
else
{
// playing, so pause
std::cout<< _currentImageStream.get() << " Pause"<<std::endl;
_currentImageStream->pause();
}
return true;
}
else if (ea.getKey()=='r')
{
std::cout<< _currentImageStream.get() << " Restart"<<std::endl;
_currentImageStream->rewind();
_currentImageStream->play();
return true;
}
else if (ea.getKey()=='>')
{
std::cout << _currentImageStream.get() << " Seeking"<<std::endl;
_currentImageStream->seek(_currentImageStream->getCurrentTime() + 1.0);
return true;
}
else if (ea.getKey()=='L')
{
if ( _currentImageStream->getLoopingMode() == osg::ImageStream::LOOPING)
{
std::cout<< _currentImageStream.get() << " Toggle Looping Off"<<std::endl;
_currentImageStream->setLoopingMode( osg::ImageStream::NO_LOOPING );
}
else
{
std::cout<< _currentImageStream.get() << " Toggle Looping On"<<std::endl;
_currentImageStream->setLoopingMode( osg::ImageStream::LOOPING );
}
return true;
}
else if (ea.getKey()=='+')
{
double tm = _currentImageStream->getTimeMultiplier();
tm += 0.1;
_currentImageStream->setTimeMultiplier(tm);
std::cout << _currentImageStream.get() << " Increase speed rate "<< _currentImageStream->getTimeMultiplier() << std::endl;
return true;
}
else if (ea.getKey()=='-')
{
double tm = _currentImageStream->getTimeMultiplier();
tm -= 0.1;
_currentImageStream->setTimeMultiplier(tm);
std::cout << _currentImageStream.get() << " Decrease speed rate "<< _currentImageStream->getTimeMultiplier() << std::endl;
return true;
}
else if (ea.getKey()=='o')
{
std::cout<< _currentImageStream.get() << " Frame rate "<< _currentImageStream->getFrameRate() <<std::endl;
return true;
}
return false;
}
default:
return false;
}
return false;
}