On 5/24/2011 9:28 AM, issam boughanmi wrote:
> so basicaly i want to replace the models at runtime
> i have a node callback visitor that traverse a loaded model
> and in certains conditions replace the child nodes with something like this :
> osg::Node* _node =  findNode("test"); 
> _Node = osgDB::readNodeFile("myfile.ive");
> but this have no effect 

  _node is a local pointer.

  You're only changing what _node points to. Elsewhere, the scenegraph is still 
pointing
to what _node originally pointed to.

  You need to find the parent of _node, because it has a child pointer pointing 
to
whatever _node originally pointed to. Then you need to remove that child, and 
then add the
result of readNodeFile.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. [email protected] 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
    "There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to