2002-07-17 04:07:32 +08:00
|
|
|
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
|
2002-05-29 07:43:22 +08:00
|
|
|
//Distributed under the terms of the GNU Library General Public License (LGPL)
|
|
|
|
//as published by the Free Software Foundation.
|
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
#ifndef OSG_CONVEXPLANARPOLYGON
|
|
|
|
#define OSG_CONVEXPLANARPOLYGON 1
|
2002-05-29 07:43:22 +08:00
|
|
|
|
|
|
|
#include <osg/Plane>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace osg {
|
|
|
|
|
|
|
|
class BoundingBox;
|
|
|
|
class BoundingSphere;
|
|
|
|
|
2002-06-03 23:39:41 +08:00
|
|
|
/** A class for representing convex clipping volumes made up.
|
2002-05-29 07:43:22 +08:00
|
|
|
* When adding planes, their normals should point inwards (into the volume) */
|
2002-08-29 19:02:01 +08:00
|
|
|
class SG_EXPORT ConvexPlanarPolygon
|
2002-05-29 07:43:22 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2002-08-29 19:02:01 +08:00
|
|
|
ConvexPlanarPolygon();
|
2002-05-29 07:43:22 +08:00
|
|
|
|
|
|
|
typedef std::vector<osg::Vec3> VertexList;
|
|
|
|
|
|
|
|
void add(const Vec3& v) { _vertexList.push_back(v); }
|
|
|
|
|
|
|
|
VertexList& getVertexList() { return _vertexList; }
|
|
|
|
|
|
|
|
const VertexList& getVertexList() const { return _vertexList; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
VertexList _vertexList;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end of namespace
|
|
|
|
|
|
|
|
#endif
|