Easiest way is to use dynamic_cast<> a feature in
C++:
Assume you read a scene from a file.
osg::Node *node =
osgDB::readNodeFile("myscene.osg")
osg::Group *group = dynamic_cast<osg::Group
*>(node)
if (group) then its a group.
osg::Geode *g = dynamic_cast<osg::Geode *>
(node)
if (g) then its a
Geode
Beware
though, dynamic_cast has been banned in some communities, as it could
POTENTIALLY introduce a performance hit...
But I
guess OpenSceneGraph is a proof of it self, that it works when you use it with
care...
/Anders
________________________________________________________________
Anders
Backman
Email:
[EMAIL PROTECTED]
HPC2N/VRlab
Phone: +46 (0)90-786 9936
Umea
university
Cellular: +46 (0)70-392 64 67
S-901 87 UMEA
SWEDEN
Fax: +46 90-786
6126
http://www.cs.umu.se/~andersb
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dorian Dussel
Sent: den 19 maj 2006 08:26
To: users OSG
Subject: [osg-users] Geode or GroupHello,How can I do to know if a node is a geode or a group ?Thanks !!!
Faites de Yahoo! votre page d'accueil sur le web pour retrouver directement vos services préférés : vérifiez vos nouveaux mails, lancez vos recherches et suivez l'actualité en temps réel. Cliquez ici.
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
