OpenSceneGraph 3.6.5
SmoothingVisitor
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGUTIL_SMOOTHINGVISITOR
15#define OSGUTIL_SMOOTHINGVISITOR 1
16
17#include <osg/NodeVisitor>
18#include <osg/Geode>
19#include <osg/Geometry>
20
21#include <osgUtil/Export>
22
23namespace osgUtil {
24
29{
30 public:
31
35
37 static void smooth(osg::Geometry& geoset, double creaseAngle=osg::PI);
38
40 virtual void apply(osg::Geometry& geom);
41
44 void setCreaseAngle(double angle) { _creaseAngle = angle; }
45 double getCreaseAngle() const { return _creaseAngle; }
46
47 protected:
48
50
51};
52
53}
54
55#endif
const double PI
Definition Math:30
The osgUtil library provides general purpose utility classes such as update, cull and draw traverses,...
Definition NodeVisitor:25
Definition Geometry:31
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
double getCreaseAngle() const
Definition SmoothingVisitor:45
static void smooth(osg::Geometry &geoset, double creaseAngle=osg::PI)
smooth geoset by creating per vertex normals.
SmoothingVisitor()
default to traversing all children.
double _creaseAngle
Definition SmoothingVisitor:49
void setCreaseAngle(double angle)
set the maximum angle, in radians, at which angle between adjacent triangles that normals are smoothe...
Definition SmoothingVisitor:44
virtual void apply(osg::Geometry &geom)
apply smoothing method to all geometries.
#define OSGUTIL_EXPORT
Definition Export:40

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.