::ConstIterator and ::Iterator access
Posted: Sat Oct 11, 2008 8:36 am
I am restarting a thread that is currently embedded within another thread to see if I can get some answers to my problem. I have a ILightSceneNode, which has attached with it a IBillboardSceneNode (as a child node). I am using the SVN trunk. In 1.4.2 it all works fine, but due to changes in 1.5 with the declaration of ISceneNode as a virtual class problems happen.
This is what I am trying to do :
pLight is a ILightSceneNode
my compiler gives the following errors :
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(355) : error C2635: cannot convert a 'irr::scene::ISceneNode*' to a 'irr::scene::IBillboardSceneNode*'; conversion from a virtual base class is implied
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\IBillboardSceneNode.h(20) : see declaration of 'irr::scene::IBillboardSceneNode'
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(355) : error C2039: 'setSize' : is not a member of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
I have tried <dynamic_cast> - runtime error.
Please, please I need to get this resolved.
Thanks
Anton
This is what I am trying to do :
Code: Select all
core::list<ISceneNode *>::ConstIterator it;
:
:
pLight = Light->pIRRLight;
it = pLight->getChildren().begin();
if (*it)
((IBillboardSceneNode *) *it)->setSize(Size * pLight->getPosition().getDistanceFrom(pos) * A1_SIZE);
my compiler gives the following errors :
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(355) : error C2635: cannot convert a 'irr::scene::ISceneNode*' to a 'irr::scene::IBillboardSceneNode*'; conversion from a virtual base class is implied
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\IBillboardSceneNode.h(20) : see declaration of 'irr::scene::IBillboardSceneNode'
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(355) : error C2039: 'setSize' : is not a member of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
I have tried <dynamic_cast> - runtime error.
Please, please I need to get this resolved.
Thanks
Anton