From Farshid Lashkari, "As discussed, I've added the ability to handle Drawable objects within the NodeVisitor class. Here is an overview of the changes:
- Added apply(Drawable) and apply(Geometry) to NodeVisitor - Added accept(NodeVisitor) method to Drawable/Geometry - Added traverse(NodeVisitor) to Geode which calls accept(NodeVisitor) on all Drawables - Updated CullVisitor to use new apply(Drawable) to handle drawables. The apply(Billboard) method still manually handles the drawables since it is depends on the billboard settings. I needed to disable the traverse within billboard to prevent duplicate traversal of drawables. - Update other osgUtil node visitors (GLObjectsVisitor, IncrementalCompileOperation, ..) to use new apply(Drawable) method. "
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <osg/Transform>
|
||||
#include <osg/Camera>
|
||||
#include <osg/CameraView>
|
||||
#include <osg/Geometry>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -75,6 +76,16 @@ NodeVisitor::~NodeVisitor()
|
||||
// if (_traversalVisitor) detach from _traversalVisitor;
|
||||
}
|
||||
|
||||
void NodeVisitor::apply(Drawable& drawable)
|
||||
{
|
||||
// It all ends here...
|
||||
}
|
||||
|
||||
void NodeVisitor::apply(Geometry& drawable)
|
||||
{
|
||||
apply(static_cast<Drawable&>(drawable));
|
||||
}
|
||||
|
||||
void NodeVisitor::apply(Node& node)
|
||||
{
|
||||
traverse(node);
|
||||
|
||||
Reference in New Issue
Block a user