Hey all,
I'm trying to copy just the data from a node, not it's parents or children pointers.  Ie: I want to copy the tranformations from an osg::PAT, not it's entire sub-tree.  I'm using the clone function set on SHALLOW_COPY:

osg::ref_ptr< osg::PositionAttitudeTransform > littleSquareResize = new osg::PositionAttitudeTransform;
littleSquareResize.get()->setScale( osg::Vec3( 10.0, 10.0, 11.0 ) );
littleSquareResize.get()->addChild( redCube.get() ); //redCube is an osg::Geode
 
osg::ref_ptr< osg::PositionAttitudeTransform > anotherResize =
        dynamic_cast< osg::PositionAttitudeTransform* >( littleSquareResize.get()->clone( osg::CopyOp::SHALLOW_COPY ) );
    
if( anotherResize.get()->getChild( 0 ) == littleSquareResize.get()->getChild( 0 ) )
{    
        std::cout << "they are the same" << std::endl;
        return 0;
}

program output:
>they are the same

But what is happening is the child of littleSquareResize ( redCube ) is getting copied during the clone operation.  I thought that that's what the DEEP_COPY options would have done but I'm clearly wrong.  Can someone tell me where my concept of clone has gone wrong or point me to some docs / tutorials that explain it?  Thanks a lot...
-Willy
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to