本文整理汇总了C++中osg::SimpleSceneManagerRefPtr::getAction方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleSceneManagerRefPtr::getAction方法的具体用法?C++ SimpleSceneManagerRefPtr::getAction怎么用?C++ SimpleSceneManagerRefPtr::getAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::SimpleSceneManagerRefPtr
的用法示例。
在下文中一共展示了SimpleSceneManagerRefPtr::getAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyboard
// react to keys
void keyboard(unsigned char k, int, int)
{
switch(k)
{
case 27:
{
#ifdef OSG_WITH_NVPERFSDK
NVPMShutdown();
#endif
mgr = NULL;
tact = NULL;
debugact = NULL;
scene = NULL;
mainwin = NULL;
debugwin = NULL;
statfg = NULL;
OSG::osgExit();
exit(0);
}
#ifdef OSG_OLD_RENDER_ACTION
case 'v':
{
mgr->getAction()->setVolumeDrawing(
!mgr->getAction()->getVolumeDrawing());
std::cerr << "Volume Drawing: "
<< (mgr->getAction()->getVolumeDrawing()?"on":"off")
<< std::endl;
}
case 'z':
{
OSG::RenderAction *ract =
dynamic_cast<OSG::RenderAction *>(mgr->getAction());
ract->setZWriteTrans(!ract->getZWriteTrans());
std::cerr << "Switch TransZWrite to "
<< (ract->getZWriteTrans()?"on":"off")
<< std::endl;
}
break;
#endif
case 'r':
{
initElements();
bool buseTrav = mgr->getUseTraversalAction();
buseTrav = !buseTrav;
mgr->setUseTraversalAction(buseTrav);
}
break;
#ifdef OSG_OLD_RENDER_ACTION
case 'n':
fprintf(stderr, "1) set s sorting to %d\n", act->getStateSorting());
act->setStateSorting(!act->getStateSorting());
fprintf(stderr, "2) set s sorting to %d\n", act->getStateSorting());
break;
#endif
case 'k':
tact->setKeyGen(0);
break;
case 's':
{
OSG::UInt32 uiSId = OSG::SimpleSHLChunk ::getStaticClassId() & 0x000003FF;
OSG::UInt32 uiTId = OSG::TextureBaseChunk::getStaticClassId() & 0x000003FF;
OSG::UInt32 uiMId = OSG::MaterialChunk ::getStaticClassId() & 0x000003FF;
OSG::UInt32 uiKeyGen = (uiSId) | (uiTId << 10) | (uiMId << 20);
tact->setKeyGen(uiKeyGen);
}
break;
case 'g':
bGLFinish = !bGLFinish;
tact->setUseGLFinish(bGLFinish);
#ifdef OSG_OLD_RENDER_ACTION
act->setUseGLFinish(bGLFinish);
#endif
break;
case 'C':
{
OSG::Real32 cov = tact->getOcclusionCullingCoveredThreshold();
cov+=0.1f;
tact->setOcclusionCullingCoveredThreshold(cov);
std::cout << "Covered Threshold now: " << cov << std::endl;
}
break;
//.........这里部分代码省略.........