40fefcf335
thus removing dependancy on osg::Geoset from most of the OSG, only loaders left to port now.
40 lines
985 B
Plaintext
40 lines
985 B
Plaintext
//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 OSGUTIL_SMOOTHINGVISITOR
|
|
#define OSGUTIL_SMOOTHINGVISITOR 1
|
|
|
|
#include <osg/NodeVisitor>
|
|
#include <osg/Geode>
|
|
#include <osg/Geometry>
|
|
|
|
#include <osgUtil/Export>
|
|
|
|
namespace osgUtil {
|
|
|
|
/** A smoothing visitor for calculating smoothed normals for
|
|
* osg::GeoSet's which contains surface primitives.
|
|
*/
|
|
class OSGUTIL_EXPORT SmoothingVisitor : public osg::NodeVisitor
|
|
{
|
|
public:
|
|
|
|
/// default to traversing all children.
|
|
SmoothingVisitor()
|
|
{
|
|
setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
|
|
}
|
|
|
|
/// smooth geoset by creating per vertex normals.
|
|
static void smooth(osg::Geometry& geoset);
|
|
|
|
/// apply smoothing method to all geode geosets.
|
|
virtual void apply(osg::Geode& geode);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|