本文整理汇总了C++中osgdb::Input::readObject方法的典型用法代码示例。如果您正苦于以下问题:C++ Input::readObject方法的具体用法?C++ Input::readObject怎么用?C++ Input::readObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osgdb::Input
的用法示例。
在下文中一共展示了Input::readObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SoundUpdateCB_readLocalData
bool SoundUpdateCB_readLocalData(osg::Object &obj, osgDB::Input &fr)
{
SoundUpdateCB* cb = dynamic_cast<SoundUpdateCB*>( &obj );
/************************************************************************
* Using this code, apps like osgviewer could use this kind of nodes and work,
* but they will exit with crash !
************************************************************************/
if(!SoundManager::instance()->initialized()) {
osg::notify(osg::WARN) << "osgdb_osgAudio::SoundUpdateCB_readLocalData(): WARNING!!! ";
osg::notify(osg::WARN) << "The osgAudio plugin is initializing the SoundManager. ";
osg::notify(osg::WARN) << "So surely nobody will shutdown it, and I will exit with a crash!" << std::endl;
osgAudio::SoundManager::instance()->init(16);
osgAudio::SoundManager::instance()->getEnvironment()->setDistanceModel(osgAudio::InverseDistance);
osgAudio::SoundManager::instance()->getEnvironment()->setDopplerFactor(1);
}
bool itAdvanced = false;
SoundState *ss = dynamic_cast<SoundState*>(fr.readObject());
if(ss != NULL) {
cb->setSoundState(ss);
itAdvanced = true;
}
OccludeCallback *oc = dynamic_cast<OccludeCallback*>(fr.readObject());
if(oc != NULL) {
cb->setOccludeCallback(oc);
itAdvanced = true;
}
return itAdvanced;
}
示例2: ShadowedScene_readLocalData
bool ShadowedScene_readLocalData(osg::Object& obj, osgDB::Input &fr)
{
osgShadow::ShadowedScene& ss = static_cast<osgShadow::ShadowedScene&>(obj);
bool iteratorAdvanced = false;
osg::ref_ptr<osg::Object> object=0;
while((object=fr.readObject())!=0)
{
osgShadow::ShadowTechnique* st = dynamic_cast<osgShadow::ShadowTechnique*>(object.get());
if (st) ss.setShadowTechnique(st);
iteratorAdvanced = true;
}
return iteratorAdvanced;
}