SourceForge.net: luabind-user

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SourceForge.net: luabind-user

Elistain
Hi,
I'm trying to use LuaBind to export OpenSceneGraph classes, in order to use those classes in lua script.However OSG uses auto pointer to hold memory, thus the destructor is declared to be protected.I choose to use the smart pointer provided by OSG to hold the class, using the follow code:
void registerOsg(lua_State* lua)
{
using namespace luabind;
module(lua)
[
class_<osg::Vec3f>("Vec3f")
.def(constructor<>())
.def(constructor<float, float, float>())
.def("valid", &osg::Vec3f::valid)
.def("set", (void(osg::Vec3f::*)(float, float, float))&osg::Vec3f::set),

class_<osg::Node, osg::ref_ptr<osg::Node>>("Node")
.def(constructor<>())
];
}
But I get the error message in which says “cannot access protected member osg::Node::~Node".I confirmed that get_pointer() function is provided by osg::ref_ptr.I also followed the way in http://sourceforge.net/mailarchive/forum.php?thread_name=cl6olp%249d1%241%40sea.gmane.org&forum_name=luabind-user, but it does not work anywhere.

So,is there any idea for me?Really appreciate your reply!

Solee




------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user