class csPolygonClipper : public csClipper The csPolygonClipper class can be used for clipping any convex polygon with any other polygon
| | Clip (csVector2 *Polygon, int &Count, int MaxCount, csBox *BoundingBox) Clip a set of 2D points and return them in the same array |
| | Clip (csVector2 *Polygon, csVector2* dest_poly, int Count, int &OutCount) Clip to dest_poly. |
| | csPolygonClipper (csPoly2D *Clipper, bool mirror = false, bool copy = false) Create a polygon clipper object from a set of 2D vectors. |
| | GetNumVertices () Return number of vertices for this clipper polygon. |
| | GetVertex (int i) Return vertex at index for this clipper polygon. |
| | IsInside (float x, float y) Return true if given point is inside (or on bound) of clipper polygon. |
| | ~csPolygonClipper () Destroy the polygon clipper object. |
| | ClipBox Clipping polygon bounding box |
| | ClipData Equation for all edges of clipping polygon |
| | ClipPoly Clipper polygon itself |
| | ClipPoly2D A pointer to the pooled polygon (so that we can free it later). |
| | ClipPolyVertices Number of vertices in clipper polygon |
| | SegData Private structure for keeping pre-calculated some data |
The csPolygonClipper class can be used for clipping any convex polygon with any other polygon. The clipper object should be used, if possible, for many polygons (for example, a 3D sprite can initialize a clipper object then clip all of its triangle against it at once) as the initialization of clipper polygon involves some (although not too expensive) calculations. Both clipped and clipping polygons *should* be convex as the result of intersection of two non-convex polygons can result in more than one resulting polygon, and this class does not handle that.
SegData* ClipData
csVector2* ClipPoly
csPoly2D* ClipPoly2D
int ClipPolyVertices
csBox ClipBox
csPolygonClipper(csPoly2D *Clipper, bool mirror = false, bool copy = false)
virtual ~csPolygonClipper()
virtual bool Clip(csVector2 *Polygon, csVector2* dest_poly, int Count, int &OutCount)
virtual bool Clip(csVector2 *Polygon, int &Count, int MaxCount, csBox *BoundingBox)
virtual bool IsInside(float x, float y)
virtual int GetNumVertices()
virtual const csVector2 GetVertex(int i)
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de