Hi Jose,

Jose Luis Hidalgo wrote:
Hi Hartmut,
    osgLua maps osgIntrospection functionality so maybe is an
osgIntrospection behavior. Have you tried to do that part of code
using osgIntrospection ?( have a look at the example of the wiki ->
http://www.openscenegraph.org/osgwiki/uploads/Tasks/Marco_ref_example1.zip
)

I gave this one a try and called the static method similar to what you do in osgLua in Type.cpp however I might need to redo that with a more 'debuggable' environment ... unlike Visual Studio which tells me:

"This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information." :)

thats what I do (args is similar to the one in the example):

const Type &TrackerManager = Reflection::getType("osgSpace::TrackerManager");

const osgIntrospection::MethodInfo *mi =
TrackerManager.getCompatibleMethod("createTrackerFromPlugin",args(std::string("osgspace_mytracker")),false);
if (mi)
{
Value mytracker = mi->invoke(args(std::string("osgspace_mytracker")));
}


Anyway you can try to show the info of the reflected class, copy
show.lua and issue a showInfo(tracker) to see its methods,
constructors, ...

That seems to dump all classes/types known to the VM. I am using osgLua from the repository.

Regarding the osgLua implementation. It seems I am doing something on the edge with the osgIntrospection. Ideally I would need to have a typecast within Lua to make sure only osgIntrospect'ed methods are called.


I will try to test it with some dummy classes to see if is a specific
problem with inheritance of osgLua or not.

Cheers,
     Jose L.

Cheers,
Hartmut


On 10/19/06, Hartmut Seichter <[EMAIL PROTECTED]> wrote:
Hi,

I just wanted to give osgLua a shot (Lua is anyway my prefered scripting
language). So I got everything working and the demo works as well. I
also created an osgWrapper extension for a library we are working on.

I try to get my head around the following problem:

we have a GenericTracker* which is returned by createTrackerFromPlugin()
  ... that works as expected. However, if I call init(arg1,arg2), which
is virtual, osgIntrospection "knows" that this tracker is not a
GenericTracker it is expectantly a MyTracker tracker:

"osgLua::Exception osgartscripting.lua:17: Type not defined class
osgSpace::MyTracker"


-- load a tracker from a plugin
tracker =
osgSpace.TrackerManager.createTrackerFromPlugin("osgspace_mytracker")

-- we get the tracker, initialise it
tracker:init(video.width,video.height)

is there any chance to get around this "intelligent" behavior of
osgIntrospection or is this the specific implementation of osgLua?


Cheers,
Hartmut








_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/




_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to