Hey guys, this is probably more of a design problem than anything.
I have a Hud class it extends from PositionAttitudeTransform.
I have a HudController class it extends from NodeCallback.
Hud -> PositionAttitudeTransform
HudController -> NodeCallback
In order for Hud to attach an eventcallback to itself it needs to know about
HudControler.
But in order for HudController to access Huds properties after a dynamic cast
it needs to know about Hud. So I have a circular dependency problem that looks
like this:
Code:
#include "HudController.h"
Class Hud : PositionAttitudeTransform
{
this->addeventcallback(new HudController());
}
#include "Hud"
Class HudController
{
virtual void operator()(osg:Node * node, osg::NodeVisitor * nv)
{
osg::ref_ptr<-Hud-> hud = dynamic_cast<Hud*>(node);
if(hud)
// get hud properties and do stuff.
}
}
I tried a bit with forward declaration but couldn't get it to compile. I keep
getting Hud is not defined, because of the circular dependency. Any
suggestions?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62260#62260
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org