Added osg::RefNodePath class for handling node paths.

This commit is contained in:
Robert Osfield
2004-09-09 13:18:45 +00:00
parent 217fa3ec0e
commit 6a48a3ffe7
3 changed files with 108 additions and 17 deletions

View File

@@ -183,22 +183,13 @@ public:
{
osg::notify(osg::INFO)<<"getCoordinateFrame("<<position<<")"<<std::endl;
const Viewer::RefNodePath& refNodePath = _viewer->getCoordindateSystemNodePath();
// do automatic conversion between RefNodePath and NodePath.
osg::NodePath tmpPath = _viewer->getCoordindateSystemNodePath();
if (!refNodePath.empty())
if (!tmpPath.empty())
{
osg::Matrixd coordinateFrame;
// have to create a copy of the RefNodePath to create an osg::NodePath
// to allow it to be used along with the computeLocalToWorld call.
osg::NodePath tmpPath;
for(Viewer::RefNodePath::const_iterator itr=refNodePath.begin();
itr!=refNodePath.end();
++itr)
{
tmpPath.push_back(const_cast<osg::Node*>(itr->get()));
}
osg::CoordinateSystemNode* csn = dynamic_cast<osg::CoordinateSystemNode*>(tmpPath.back());
if (csn)
{