📄 io_impostor.cpp
字号:
#include "osgSim/Impostor"#include "osgDB/Registry"#include "osgDB/Input"#include "osgDB/Output"using namespace osgSim;using namespace osgDB;// forward declare functions to use later.bool Impostor_readLocalData(osg::Object& obj, Input& fr);bool Impostor_writeLocalData(const osg::Object& obj, Output& fw);// register the read and write functions with the osgDB::Registry.RegisterDotOsgWrapperProxy g_ImpostorProxy( new osgSim::Impostor, "Impostor", "Object Node Impostor LOD Group", &Impostor_readLocalData, &Impostor_writeLocalData);bool Impostor_readLocalData(osg::Object& obj, Input& fr){ bool iteratorAdvanced = false; Impostor& impostor = static_cast<Impostor&>(obj); if (fr.matchSequence("ImpostorThreshold %f")) { float threshold; fr[1].getFloat(threshold); impostor.setImpostorThreshold(threshold); iteratorAdvanced = true; fr+=2; } return iteratorAdvanced;}bool Impostor_writeLocalData(const osg::Object& obj, Output& fw){ const Impostor& impostor = static_cast<const Impostor&>(obj); fw.indent() << "ImpostorThreshold "<< impostor.getImpostorThreshold() << std::endl; return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -