Added new osg::OccluderNode which subclasses from osg::Group, and will

provide hooks for adding ConvexPlanerOccluders to the scene.
This commit is contained in:
Robert Osfield
2002-06-05 09:39:04 +00:00
parent 4d2dbdafac
commit 5feba17410
9 changed files with 103 additions and 15 deletions

View File

@@ -20,8 +20,6 @@ Geode::Geode(const Geode& geode,const CopyOp& copyop):
Drawable* drawable = copyop(itr->get());
if (drawable) addDrawable(drawable);
}
_occluder = dynamic_cast<ConvexPlanerOccluder*>(copyop(geode.getOccluder()));
}
Geode::~Geode()

View File

@@ -48,6 +48,7 @@ CXXFILES =\
NodeVisitor.cpp\
Notify.cpp\
Object.cpp\
OccluderNode.cpp\
Point.cpp\
PolygonMode.cpp\
PolygonOffset.cpp\

13
src/osg/OccluderNode.cpp Normal file
View File

@@ -0,0 +1,13 @@
#include <osg/OccluderNode>
using namespace osg;
OccluderNode::OccluderNode()
{
}
OccluderNode::OccluderNode(const OccluderNode& node,const CopyOp& copyop):
Group(node,copyop),
_occluder(dynamic_cast<ConvexPlanerOccluder*>(copyop(node._occluder.get())))
{
}

View File

@@ -5,6 +5,7 @@
#include <osg/Billboard>
#include <osg/LightSource>
#include <osg/ClipNode>
#include <osg/OccluderNode>
#include <osg/Notify>
#include <osg/TexEnv>
#include <osg/AlphaFunc>
@@ -710,6 +711,34 @@ void CullVisitor::apply(osg::EarthSky& node)
}
void CullVisitor::apply(osg::OccluderNode& node)
{
// need to check if occlusion node is in the occluder
// list, if so disable the appropriate ShadowOccluderVolume
std::cout<<"We are in an Occlusion node"<<&node<<std::endl;
if (isCulled(node)) return;
// push the culling mode.
pushCurrentMask();
// push the node's state.
StateSet* node_state = node.getStateSet();
if (node_state) pushStateSet(node_state);
handle_cull_callbacks_and_traverse(node);
// pop the node's state off the render graph stack.
if (node_state) popStateSet();
// pop the culling mode.
popCurrentMask();
}
void CullVisitor::apply(Impostor& node)
{