JavaOSG Bindings

Introduction

JavaOSG is an open source set of Java bindings for OpenSceneGraph (www.openscenegraph.org), Producer (www.andesengineering.com/Producer), OpenThreads (openthreads.sourceforge.net) and OpenGL (www.opengl.org). They are distributed under the LGPL license. Credit should go to the authors of these great open source projects, notably Robert Osfield, Don Burns and Sean Spicer, and all who have contributed.

The bindings are generated by NoodleGlue (www.noodleheaven.net/NoodleGlue/), our internal wrapper generation tool, which we have used to bridge all the native code we use on our interactive music platform NoodleHeaven (www.noodleheaven.net).  It was developed primarily with OSG and other reference-counting classes in mind, as this allows Java garbage collection to work with referenced objects seamlessly. JavaOSG is the first public release of any libraries using the technology, and as such is still in beta, but we believe this technology has proven it’s stability in our own Noodle player application.

Language features supported

Well, most C and C++ features are bridged which map to a suitable equivalent in Java. See our NoodleGlue page for more details (slightly out of date now). Essentially there are a few features which we just can’t bridge due to language or JNI constraints like multiple inheritance and pure templates, although NoodleGlue does it’s best even with these using interfaces where possible for multiple inheritance and instantiated template types can be bridged. STL-derived types like list, map and set all bridge, although these are likely to change in the future to fit the Java container pattern. There are a few features, such as function pointers and passing object arrays which aren’t handled yet. However #define values, enums, structs, classes, inner classes, instantiated template classes, C functions, protected methods, operators, and loads more do bridge just fine. OSG has been a very good test case for C++ features!

JavaOSG only supports Java 1.4 and higher. This allows us to use Java’s NIO package for fast transfers or shared data over the bridge.

Building JavaOSG

This release is provided as source for each separate library, with a set of VisualStudio.NET projects for compiling on Windows, and Ant scripts to build the Java jar files for each library. A set of makefiles will (hopefully) be added when someone send them to me!

There are five separate VS.NET workspaces: NoodleGlue, OpenThreads, JavaGL, Producer and OpenSceneGraph. Build the workspace libraries in that order, and you shouldn’t get any problems. For the osg plugins make sure you have any external dependencies available in your path.

Our wrapper technology has been tested on Windows using VisualStudio.NET, and on OSX using gcc 2.9 – 3.4. I’d like to hear of anyone’s experiences with JavaOSG on any other platform, as we hope it works but just don’t know! NoodleCore uses some extreme C++ in places so maybe not all compilers will cope.

I should also warn anyone compiling these wrappers; it will take a LONG time. They are bigger than then original libraries they support, so don’t expect a quick look.

Download

Note: You must download the required versions of OSG, OT and Producer. Because of a few recent changes to JavaOSG you must get the source from here, as there are a few mods to make cross-platform issues go away, which will hopefully be in the next release of OSG and Producer.

Current version is 0.3.3.  Release date: 12/01/05.

JavaOSG Source + Docs and Dependencies:  Latest version is here (13 Mb) [This includes a few updates of Producer source from CVS for X11 compatibility]

Jar Files Pre-build set of Jar library files here  (0.9 Mb) - You must still compile the Native libraries to use these.

Windows Binaries: A set of pre-build Windows DLLs and jars are available here (6.0 Mb)

 

Services

Finally, I’d like to point out that these JavaOSG wrappers are designed as the plain vanilla set. There is plenty of scope for customization of the wrappers within our current tools, and in fact Noodle uses a custom set of OSG wrappers to allow us to do clever things in our editors, using javadoc-style tags and writing custom code into the java wrapper classes. If you need something different from this standard version, contact us and we’ll see what we can to do.

noodleglue@noodleheaven.net.

Last Update: 12/01/05