Hello,
For the answer, I suggest you revise the C++ docs about dynamic_cast<>
and also check the class hierarchy of OSG's node types.
dynamic_cast succeeds for any pointer to an object of class A or any
pointer to an object of a derived class of A. So even if you don't have
a proper Group at
Hello.
I forgot to mention that i check it. That's why i posted it. Cause it is
very strange to run even though there is no group as root..
osg::ref_ptr node =
dynamic_cast(osgDB::readNodeFile( "astroboy_walk.dae" ));
if(!node) {
std::cout << "Model could not be loaded " << std::endl;
retur
Hi Peterakos,
You should always check that the node set by the dynamic_cast<> is not
NULL before doing any operation on it, this is a very basic
programming practice, you shouldn't assume that the root node will
always be a Group or a subclass from Group.
Robert.
On 20 August 2012 18:15, Peterak
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(osgDB::readNodeFiles(arguments));
How safe is this if i use only 1 model in arguments and it is not Group ?
osgDB::readNodeFiles inserts a g
Hello.
In the example osganimationviewer in main there is the following line:
osg::Group* node =
dynamic_cast(osgDB::readNodeFiles(arguments));
How safe is this if i use only 1 model in arguments and it is not Group ?
Thank you for your time.
___
osg-u
5 matches
Mail list logo