Hi Nelson,

A crash of this type is normally down to users using global C pointers
to elements in the scene graph and expecting the pointers to remain
valid, even after nodes are removed from the scene.  The solution is
easy - user ref_ptr<> for these pointers, this will ensure the scene
graph is properly reference counted and objects stay around for as
long as you need them.

Robert.

On 1/26/07, Cysneros, Nelson SPAWAR <[EMAIL PROTECTED]> wrote:



Hi,  I'm new to osg and I'm having problems getting a simple task to work.

Currently I'm using a osgUtil::SceneView object to run a simulation.  The
SceneView is loaded with a osg::Group* object that contains different kinds
of nodes that are displayed in the simulation.

                                                        <- Node
                        SceneView <- Group <-   <- Node
                                                        <- Node

What I'm trying to do is, while the simulation is running the user is
presented with a list of models he can load to the simulation.  When he
selects a model, the model will be loaded only .  So that he can examine it.
 All other parts of the simulation will not be displayed.  Once he is done,
the complete simulation is display again.

Not sure how best to approach this problem but from my readings I think I
have 3 possibilities:

1)Remove all models from the current group, load only my model.

                        SceneView <- Group <-  <- New Node

2)Remove the current group and create a new group with the new model loaded
in it.

                        SceneView <- New Group <-  <- New Node

        I'm assuming that sceneView->setSceneData(NewGroup)
will work?

3)Use a Switch Node and hop around to the different children in the node.

I've tried the first two ways, but my application keeps crashing.   Any
suggestions on the way to approach this will be greatly appreciated.

By the way, I have to use SceneView, can't use Producer.

Best Regards




_______________________________________________
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