add ScriptNodeCallback serializer

This commit is contained in:
mp3butcher
2017-03-28 22:37:34 +02:00
parent eb59590d77
commit 9d490bbf1c
3 changed files with 50 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ class Script : public osg::Object
META_Object(osg, Script)
void setLanguage(const std::string& language) { _language = language; dirty(); }
const std::string& getLanguage() { return _language; }
const std::string& getLanguage() const{ return _language; }
void setScript(const std::string& str) { _script = str; dirty(); }
const std::string& getScript() const { return _script; }
@@ -75,6 +75,12 @@ class OSG_EXPORT ScriptNodeCallback : public osg::NodeCallback
/** Get the script to call.*/
const osg::Script* getScript() const { return _script.get(); }
/** Set the entry point to call.*/
void setEntryPoint(const std::string& script) { _entryPoint = script; }
/** Get the script to call.*/
const std::string& getEntryPoint() const { return _entryPoint; }
/** find the ScriptEngine from looking at the UserDataContainers of nodes in scene graph above the ScriptCallback.*/
osg::ScriptEngine* getScriptEngine(osg::NodePath& nodePath);