Beginning of crease angle support for SmoothingVisitor to all it duplicate vertices are creases

thus enabling separate normals for triangles adjacent to the creases.
This commit is contained in:
Robert Osfield
2010-07-30 19:39:38 +00:00
parent a71877bf2f
commit 075b1b769c
3 changed files with 276 additions and 18 deletions

View File

@@ -34,11 +34,20 @@ class OSGUTIL_EXPORT SmoothingVisitor : public osg::NodeVisitor
virtual ~SmoothingVisitor();
/// smooth geoset by creating per vertex normals.
static void smooth(osg::Geometry& geoset);
static void smooth(osg::Geometry& geoset, double creaseAngle=osg::PI);
/// apply smoothing method to all geode geosets.
virtual void apply(osg::Geode& geode);
/// set the maximum angle, in radians, at which angle between adjacent triangles that normals are smoothed
/// for edges that greater the shared vertices are duplicated
void setCreaseAngle(double angle) { _creaseAngle = angle; }
double getCreaseAngle() const { return _creaseAngle; }
protected:
double _creaseAngle;
};
}