Hello Sanat,

   num1 = cow->asGroup()->getChild(0)->asGeode()->getNumDrawables();
   num2 = cow->asGroup()->getNumChildren();
   num3 = cow->asGeode()->getNumDrawables();

This line makes no sense. You have confirmed in the line before that cow is a Group, why do you then try to cast cow as a Geode? It can't be a Geode and a Group at the same time... (unless it were an instance of a weird class that multiply-inherits from Group and Geode, but that's a slippery slope indeed...)

num1 already gives you the number of drawables under the Geode that is under the cow (root node of the loaded file).

Also note that this is not a safe way to traverse a graph (either loaded from file or not). It's safer to write a visitor that will traverse down to the Geodes and then check the drawables. That way you don't write code that assumes a graph structure. Get used to writing visitors, they are simple and powerful.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to