[osg-users] [osgPlugins] plugin v8 in version 3.3.1

Robert Osfield robert.osfield at gmail.com
Mon Jan 25 00:26:58 PST 2016


Hi Soctt,

On 24 January 2016 at 22:42, Scott Duensing <scott at duensing.com> wrote:
> I'm new around here, but I plan on using V8 extensively with my current project.  Would it be hard to revive the plugin?
>
> Don't do a ton of work for one user.  Just curious.

It's not a case of reviving the plugin, the plugin was a proof of
concept integration that provide that one could build and link V8 and
invoke it in a minimal way - invoking a script.  The plugin
implementation never did any C++ object integration so the scripts you
could run wouldn't be able to create or control anything on the OSG
side.

The next step for the plugin would be create wrappers between the
OSG's C++ object interfaces (osgDB::ClassInterface) and V8 to allow
the scripts to create and control OSG objects.  This step is quite a
bit of work, i.e. a  month to two.

The OSG has close to full lua integration with the lua implementation
itself built as part of the OSG's lua plugin and integration done via
osgDB::ClassInterface.  To get an idea of how much work is involved
with V8 integration you could use the lua plugin as case study,
running word count (wc) on the OSG specific files in the lua plugin we
get:

$ wc LuaScriptEngine.cpp LuaScriptEngine.h ReaderWriterLua.cpp
  4382  11061 150795 LuaScriptEngine.cpp
   266    881   9708 LuaScriptEngine.h
   200    557   7633 ReaderWriterLua.cpp
  4848  12499 168136 total

If I were to tackle javascript integration I'd probably look for
another route than using V8, for instance that are now open source
projects that are smaller and more suitable for application
integration that fit more in with the lua level of size and complexity
i.e. minimal on both counts.

Robert.



More information about the osg-users mailing list