[osg-users] osgdb_dae - Collada runtime database

Mattias Linde linde at acc.umu.se
Fri Sep 21 08:13:30 PDT 2007


Hi Robert,

When a Collada file is read in and parsed (with osgdb_dae plugin) the contents is stored in 
a runtime database. The data is accessed through a DAE interface which have load and save 
functionality and methods to access the object model.

Since we are working with both Collada for graphics and physics it would be really convenient 
if the same runtime database could be used for both. This would greatly simplify saving collada 
data and save time and memory (no need to parse the collada files twice and have two runtime 
databases at the same time with the same info).

When saving, the graphics state updates would be in one database and the physics in another and 
getting that into one correct collada-file would be somewhat unpleasant.

Currently we have solved this by making it possible for plugins to return a void-pointer 
virtual void* ReaderWrite::getPluginData() { return 0l; }
which plugins can overload if needed such as
virtual void* ReaderWriterDAE::getPluginData() { return reinterpret_cast<void *>(_dae); }

Then we use callbacks in the application on file loads so we get a way to access the DAE 
instance within the collada plugin.

Would it be possible to make some sort of update to OSG to solve this problem, or
perhaps you have some better suggestion how to do this?


/ Mattias



More information about the osg-users mailing list