2006-07-18 23:21:48 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
2003-01-22 00:45:36 +08:00
|
|
|
*
|
|
|
|
* This library is open source and may be redistributed and/or modified under
|
|
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
2002-05-29 07:43:22 +08:00
|
|
|
|
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;
|
|
|
|
|
2004-08-31 22:49:33 +08:00
|
|
|
/** A class for representing components of convex clipping volumes.
|
|
|
|
* ConvexPlanarPolygon normals should point inwards (into the volume) */
|
2005-04-12 01:14:17 +08:00
|
|
|
class OSG_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); }
|
|
|
|
|
2004-12-17 09:06:33 +08:00
|
|
|
void setVertexList(const VertexList& vertexList) { _vertexList=vertexList; }
|
|
|
|
|
2002-05-29 07:43:22 +08:00
|
|
|
VertexList& getVertexList() { return _vertexList; }
|
|
|
|
|
|
|
|
const VertexList& getVertexList() const { return _vertexList; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
VertexList _vertexList;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2005-11-18 01:44:48 +08:00
|
|
|
} // end of namespace
|
2002-05-29 07:43:22 +08:00
|
|
|
|
|
|
|
#endif
|