Improvements to lua/OSG integration

This commit is contained in:
Robert Osfield
2017-12-01 12:07:28 +00:00
parent 2108141b4e
commit 9944d949fc
3 changed files with 114 additions and 0 deletions

View File

@@ -64,6 +64,17 @@ static bool writeDescriptions( osgDB::OutputStream& os, const osg::Node& node )
return true;
}
struct NodeGetOrCreateStateSet : public osgDB::MethodObject
{
virtual bool run(void* objectPtr, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const
{
osg::Node* node = reinterpret_cast<osg::Node*>(objectPtr);
outputParameters.push_back(node->getOrCreateStateSet());
return true;
}
};
REGISTER_OBJECT_WRAPPER( Node,
new osg::Node,
osg::Node,
@@ -85,4 +96,6 @@ REGISTER_OBJECT_WRAPPER( Node,
}
ADD_OBJECT_SERIALIZER( StateSet, osg::StateSet, NULL ); // _stateset
ADD_METHOD_OBJECT( "getOrCreateStateSet", NodeGetOrCreateStateSet );
}