17 #ifndef OSGSHADOW_CONVEXPOLYHEDRON
18 #define OSGSHADOW_CONVEXPOLYHEDRON 1
20 #include <osg/Geometry>
21 #include <osg/Polytope>
22 #include <osgShadow/Export>
58 void clear() { _faces.clear(); }
61 void setToUnitFrustum(
bool withNear=
true,
bool withFar=
true);
68 (
const Face & face0,
const Face & face1, Face & face );
70 void mergeCoplanarFaces(
const double & plane_normal_dot_tolerance = 0.0,
71 const double & plane_distance_tolerance = 0.0 );
73 void removeDuplicateVertices(
void );
76 static int pointsColinear
78 const double & edge_normal_dot_tolerance = 0.0,
79 const double & null_edge_length_tolerance = 0.0 );
81 static int isFacePolygonConvex( Face & face,
bool ignoreCollinearVertices =
true );
84 (
bool checkForNonConvexPolys =
false,
const char * errorPrefix =
NULL );
91 void cut(
const osg::Plane& plane,
const std::string& name=std::string());
99 void getPoints(Vertices& vertices)
const;
107 bool dumpGeometry(
const Face * face =
NULL,
110 const char * filename =
"convexpolyhedron.osg",
std::vector< osg::Vec3d > Vertices
static const osg::Matrix & defaultMatrix
A plane class. It can be used to represent an infinite plane.