On 08/20/2012 09:00 AM, Peterakos wrote:
Hello.

In the example osganimationviewer in main there is the following line:
osg::Group* node = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(arguments));

How safe is this if i use only 1 model in arguments and it is not Group ?

osgDB::readNodeFiles inserts a group at the root if there's more than one model loaded, but not when only a single model is loaded. There's a (rather slim) chance that your one model might not contain a Group (or Group descendant) at the root and that the dynamic_cast would result in a NULL. If you wanted to be absolutely sure, you could put in a check for this.

Practically, almost every useful model (especially models with animations) will have some kind of group at its root.

--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to