PixelLightAPI
.
|
A polygon is a set of vertices on a same plane. This is only a base class with vertices... to add texture coords etc. to have to derive it! More...
#include <Polygon.h>
Public Types | |
enum | ESide { Behind = -1, Coinciding = 0, InFront = 1, Spanning = 2 } |
Plane/point relation. More... | |
Public Member Functions | |
PLMATH_API | Polygon () |
Constructor. | |
PLMATH_API | Polygon (const Polygon &cSource) |
Copy constructor. | |
virtual PLMATH_API | ~Polygon () |
Destructor. | |
PLMATH_API const Plane & | GetPlane () const |
Returns the plane the polygon is on. | |
PLMATH_API const Plane & | ComputePlane () |
Computes and returns the plane the polygon is on. | |
PLMATH_API bool | CheckVerticesOnPlane () const |
Checks whether all vertices are on the polygon plane or not. | |
PLMATH_API PLCore::Array < Vector3 > & | GetVertexList () |
Returns a list of all vertices. | |
PLMATH_API bool | AddVertex (const Vector3 &vV) |
Adds a vertex to the polygon. | |
PLMATH_API bool | Split (const Plane &cSplitter, Polygon &cFrontPolygon, Polygon &cBackPolygon) |
Splits the polygon. | |
PLMATH_API Polygon & | operator= (const Polygon &cSource) |
Copy operator. | |
PLMATH_API ESide | GetSide (const Plane &cPlane) const |
Calculates the side the polygon is on. | |
PLMATH_API bool | IsInFront (const Plane &cPlane) const |
Checks whether the polygon is completely in front of the given plane. | |
PLMATH_API bool | IsBehind (const Plane &cPlane) const |
Checks whether the polygon is completely behind the given plane. | |
PLMATH_API Polygon | Clip (const Plane &cPlane) const |
Clips the polygon against a plane. | |
virtual PLMATH_API bool | CustomInit (Polygon &cPolygon) |
Initializes the data of the splitted polygon. | |
virtual PLMATH_API bool | CustomAdd (Polygon &cPolygon, PLCore::uint32 nID) |
Adds data to a polygon. | |
virtual PLMATH_API bool | CustomSplit (Polygon &cFrontPolygon, Polygon &cBackPolygon, PLCore::uint32 nID, float fDistance) |
Splits the polygon using the custom function. |
A polygon is a set of vertices on a same plane. This is only a base class with vertices... to add texture coords etc. to have to derive it!
PLMATH_API PLMath::Polygon::Polygon | ( | ) |
Constructor.
PLMATH_API PLMath::Polygon::Polygon | ( | const Polygon & | cSource | ) |
Copy constructor.
[in] | cSource | Polygon to copy |
virtual PLMATH_API PLMath::Polygon::~Polygon | ( | ) | [virtual] |
Destructor.
PLMATH_API const Plane& PLMath::Polygon::GetPlane | ( | ) | const |
Returns the plane the polygon is on.
PLMATH_API const Plane& PLMath::Polygon::ComputePlane | ( | ) |
Computes and returns the plane the polygon is on.
PLMATH_API bool PLMath::Polygon::CheckVerticesOnPlane | ( | ) | const |
Checks whether all vertices are on the polygon plane or not.
PLMATH_API PLCore::Array<Vector3>& PLMath::Polygon::GetVertexList | ( | ) |
Returns a list of all vertices.
PLMATH_API bool PLMath::Polygon::AddVertex | ( | const Vector3 & | vV | ) |
Adds a vertex to the polygon.
[in] | vV | Vertex to add |
PLMATH_API bool PLMath::Polygon::Split | ( | const Plane & | cSplitter, |
Polygon & | cFrontPolygon, | ||
Polygon & | cBackPolygon | ||
) |
Copy operator.
[in] | cSource | Source to copy from |
PLMATH_API ESide PLMath::Polygon::GetSide | ( | const Plane & | cPlane | ) | const |
Calculates the side the polygon is on.
PLMATH_API bool PLMath::Polygon::IsInFront | ( | const Plane & | cPlane | ) | const |
Checks whether the polygon is completely in front of the given plane.
PLMATH_API bool PLMath::Polygon::IsBehind | ( | const Plane & | cPlane | ) | const |
Checks whether the polygon is completely behind the given plane.
PLMATH_API Polygon PLMath::Polygon::Clip | ( | const Plane & | cPlane | ) | const |
Clips the polygon against a plane.
[in] | cPlane | Plane to clip this polygon against |
virtual PLMATH_API bool PLMath::Polygon::CustomInit | ( | Polygon & | cPolygon | ) | [virtual] |
Initializes the data of the splitted polygon.
[out] | cPolygon | Polygon which should be initialized |
virtual PLMATH_API bool PLMath::Polygon::CustomAdd | ( | Polygon & | cPolygon, |
PLCore::uint32 | nID | ||
) | [virtual] |
virtual PLMATH_API bool PLMath::Polygon::CustomSplit | ( | Polygon & | cFrontPolygon, |
Polygon & | cBackPolygon, | ||
PLCore::uint32 | nID, | ||
float | fDistance | ||
) | [virtual] |
Splits the polygon using the custom function.
[out] | cFrontPolygon | Polygon in front of the plane |
[out] | cBackPolygon | Polygon behind the plane |
[in] | nID | Current data ID |
[in] | fDistance | Distance from nID-1 to the splitter plane intersection point |
|