2002-06-10 21:50:25 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2001 Robert Osfield
|
|
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
|
|
//as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
#ifndef OSG_COLLECTOCCLUDERSVISITOR
|
|
|
|
#define OSG_COLLECTOCCLUDERSVISITOR 1
|
|
|
|
|
|
|
|
#include <osg/NodeVisitor>
|
|
|
|
#include <osg/CullStack>
|
|
|
|
|
|
|
|
namespace osg {
|
|
|
|
|
|
|
|
class SG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::CullStack
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
CollectOccludersVisitor();
|
|
|
|
virtual ~CollectOccludersVisitor();
|
|
|
|
|
|
|
|
virtual CollectOccludersVisitor* cloneType() const { return new CollectOccludersVisitor(); }
|
|
|
|
|
|
|
|
virtual void reset();
|
|
|
|
|
|
|
|
virtual void apply(osg::Node&);
|
|
|
|
virtual void apply(osg::Transform& node);
|
|
|
|
virtual void apply(osg::Projection& node);
|
|
|
|
|
|
|
|
virtual void apply(osg::Switch& node);
|
|
|
|
virtual void apply(osg::LOD& node);
|
|
|
|
virtual void apply(osg::OccluderNode& node);
|
|
|
|
|
2002-06-14 07:46:02 +08:00
|
|
|
|
|
|
|
void setCreateDrawablesOnOccludeNodes(bool flag) { _createDrawables=flag; }
|
|
|
|
bool getCreateDrawablesOnOccludeNodes() const { return _createDrawables; }
|
|
|
|
|
2002-06-14 00:21:00 +08:00
|
|
|
void setCollectedOcculderList(const ShadowVolumeOccluderList& svol) { _occluderList = svol; }
|
|
|
|
ShadowVolumeOccluderList& getCollectedOccluderList() { return _occluderList; }
|
|
|
|
const ShadowVolumeOccluderList& getCollectedOccluderList() const { return _occluderList; }
|
2002-06-10 21:50:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
/** prevent unwanted copy construction.*/
|
|
|
|
CollectOccludersVisitor(const CollectOccludersVisitor&):osg::NodeVisitor(),osg::CullStack() {}
|
|
|
|
|
|
|
|
/** prevent unwanted copy operator.*/
|
|
|
|
CollectOccludersVisitor& operator = (const CollectOccludersVisitor&) { return *this; }
|
|
|
|
|
2002-06-14 07:46:02 +08:00
|
|
|
bool _createDrawables;
|
|
|
|
ShadowVolumeOccluderList _collectedOccluderList;
|
2002-06-10 21:50:25 +08:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|