Added a bunch of files synched with 0.8.42
This commit is contained in:
60
src/osgPlugins/osg/FrontFace.cpp
Normal file
60
src/osgPlugins/osg/FrontFace.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
#include "osg/FrontFace"
|
||||
|
||||
#include "osgDB/Registry"
|
||||
#include "osgDB/Input"
|
||||
#include "osgDB/Output"
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgDB;
|
||||
|
||||
// forward declare functions to use later.
|
||||
bool FrontFace_readLocalData(Object& obj, Input& fr);
|
||||
bool FrontFace_writeLocalData(const Object& obj, Output& fw);
|
||||
|
||||
// register the read and write functions with the osgDB::Registry.
|
||||
RegisterDotOsgWrapperProxy g_FrontFaceProxy
|
||||
(
|
||||
new osg::FrontFace,
|
||||
"FrontFace",
|
||||
"Object StateAttribute FrontFace",
|
||||
&FrontFace_readLocalData,
|
||||
&FrontFace_writeLocalData
|
||||
);
|
||||
|
||||
bool FrontFace_readLocalData(Object& obj, Input& fr)
|
||||
{
|
||||
bool iteratorAdvanced = false;
|
||||
|
||||
FrontFace& frontface = static_cast<FrontFace&>(obj);
|
||||
|
||||
if (fr[0].matchWord("mode"))
|
||||
{
|
||||
if (fr[1].matchWord("CLOCKWISE"))
|
||||
{
|
||||
frontface.setMode(FrontFace::CLOCKWISE);
|
||||
fr+=2;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
else if (fr[1].matchWord("COUNTER_CLOCKWISE"))
|
||||
{
|
||||
frontface.setMode(FrontFace::COUNTER_CLOCKWISE);
|
||||
fr+=2;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
}
|
||||
|
||||
return iteratorAdvanced;
|
||||
}
|
||||
|
||||
|
||||
bool FrontFace_writeLocalData(const Object& obj, Output& fw)
|
||||
{
|
||||
const FrontFace& frontface = static_cast<const FrontFace&>(obj);
|
||||
|
||||
switch(frontface.getMode())
|
||||
{
|
||||
case(FrontFace::CLOCKWISE): fw.indent() << "mode CLOCKWISE" << endl; break;
|
||||
case(FrontFace::COUNTER_CLOCKWISE): fw.indent() << "mode COUNTER_CLOCKWISE" << endl; break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user