Added new Node::getParentalNodePaths() method.
Added better handling in computeIntersections(..) of nodes that are internal to the scene graph, correctly accounting for the accumulated transforms. Changed the EventVisitor so that it only traveses active children rather than all children. Updated wrappers.
This commit is contained in:
@@ -21,26 +21,6 @@
|
||||
|
||||
using namespace osg;
|
||||
|
||||
class CollectParentPaths : public osg::NodeVisitor
|
||||
{
|
||||
public:
|
||||
CollectParentPaths() :
|
||||
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_PARENTS) {}
|
||||
|
||||
virtual void apply(osg::Node& node)
|
||||
{
|
||||
if (node.getNumParents()==0)
|
||||
{
|
||||
_nodePaths.push_back(getNodePath());
|
||||
}
|
||||
traverse(node);
|
||||
}
|
||||
|
||||
osg::NodePath _nodePath;
|
||||
typedef std::vector< osg::NodePath > NodePathList;
|
||||
NodePathList _nodePaths;
|
||||
};
|
||||
|
||||
class ApplyMatrixVisitor : public NodeVisitor
|
||||
{
|
||||
public:
|
||||
@@ -88,13 +68,12 @@ void NodeTrackerCallback::setTrackNode(osg::Node* node)
|
||||
return;
|
||||
}
|
||||
|
||||
CollectParentPaths cpp;
|
||||
node->accept(cpp);
|
||||
NodePathList parentNodePaths = node->getParentalNodePaths();
|
||||
|
||||
if (!cpp._nodePaths.empty())
|
||||
if (!parentNodePaths.empty())
|
||||
{
|
||||
osg::notify(osg::INFO)<<"NodeTrackerCallback::setTrackNode(Node*): Path set"<<std::endl;
|
||||
_trackNodePath = cpp._nodePaths[0];
|
||||
_trackNodePath = parentNodePaths[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user