I, too, am interested in this.  Currently, I am caching everything except
nodes, but this doesn't cache the geometry.  Here is the code:
   //Set cache options
   osg::ref_ptr<osgDB::ReaderWriter::Options> options = new
osgDB::ReaderWriter::Options;
   if (m_bCache){
      //Cache everything except Nodes.
      options.get()->setObjectCacheHint(
         (osgDB::ReaderWriter::Options::CacheHintOptions)
         (osgDB::ReaderWriter::Options::CacheHintOptions::CACHE_IMAGES |
         osgDB::ReaderWriter::Options::CacheHintOptions::CACHE_HEIGHTFIELDS
|
         osgDB::ReaderWriter::Options::CacheHintOptions::CACHE_ARCHIVES |
         osgDB::ReaderWriter::Options::CacheHintOptions::CACHE_OBJECTS));
   }else{  
      //Don't cache
      options.get()->setObjectCacheHint(
         osgDB::ReaderWriter::Options::CACHE_NONE);
   }
   m_pModelGraph = osgDB::readNodeFile(m_poModel->GetPath(), options.get());

This gives me individual control over switch nodes, articulates, and
animations, but doesn't cache the geometry :(


Zach

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Guthrie
Sent: Thursday, November 02, 2006 14:07
To: osg users
Subject: Re: [osg-users] Cloning everything but Geode's/Drawables

I did look at that, but copying the top level node deep would copy
everything deep, and copying to top level node would copy everything
shallow.  I really want to deep copy everything BUT the geodes.  I don't see
how to do that without deep copying everything and then going back and
replacing all the geodes with the instances in the first node.  I was hoping
to not have to do that.

On Nov 2, 2006, at 1:56 PM, Robert Osfield wrote:

> See Node::clone(CopyOp)
>
> On 11/2/06, David Guthrie <[EMAIL PROTECTED]> wrote:
>> I'm loading ive files for vehicles that have DOFTransforms in them.
>> The problem is that when we move one, all the instances move.  I 
>> assume that's simply because we are caching the node and getting the 
>> same one back, which we want, of course.  We would like to be able to 
>> clone the subgraph, but keep the same Geode instances so that we 
>> don't have to send the same geometry to the card many times.
>>
>> Is there an easy way to do this, or do I need to write special code?
>>
>> David
>> _______________________________________________
>> 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/
>

_______________________________________________
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