In file include/csengine/pol2d.h:

## class csPolygon2D : public csPoly2D

> The following class represents a 2D polygon (the 2D coordinates are perspective corrected coordinates)

## Inheritance:

### Public Methods

void AddFogPolygon(IGraphics3D* g3d, csPolygon3D* poly, csPolyPlane* plane, bool mirror, CS_ID id, int fog_type)
  Add this polygon as a back or front polygon of a fog object
void AddPerspective(csVector3& v)
  Compute the perspective transformation of a 3D vertex and add it to the polygon
void AddPerspective(float x, float y, float z)
  Compute the perspective transformation of a 3D vertex and add it to the polygon
void Draw(IGraphics2D* g2d, int col)
  Draw the polygon (wireframe version)
void DrawFilled(csRenderView* rview, csPolygon3D* poly, csPolyPlane* plane, bool use_z_buf = false)
  Draw a texture mapped polygon

### Inherited from csPoly2D:

### Public Methods

void AddVertex(float x, float y)
void AddVertex(const csVector2& v)
bool ClipAgainst(csClipper* view)
csBox& GetBoundingBox()
csVector2* GetFirst()
csVector2* GetLast()
int GetNumVertices()
csVector2* GetVertex(int i)
csVector2* GetVertices()
void MakeEmpty()
void MakeRoom(int new_max)
csVector2& operator[] (int i)
void SetVertices(csVector2 *v, int num)

### Protected Fields

csBox bbox
int max_vertices
int num_vertices
csVector2* vertices

## Documentation

> The following class represents a 2D polygon (the 2D coordinates are perspective corrected coordinates).

> This class is used as the main driver for the engine pipeline. The source Polygon is first converted to 2D using csPolygon3D::DoPerspective.

`void AddPerspective(csVector3& v)`
  Compute the perspective transformation of a 3D vertex and add it to the polygon

`void AddPerspective(float x, float y, float z)`
  Compute the perspective transformation of a 3D vertex and add it to the polygon

`void Draw(IGraphics2D* g2d, int col)`
  Draw the polygon (wireframe version)

`void DrawFilled(csRenderView* rview, csPolygon3D* poly, csPolyPlane* plane, bool use_z_buf = false)`
  Draw a texture mapped polygon. 'plane' should be a correctly transformed plane (transformed to camera space). 'poly' is only used for debugging. The plane and vertices are not used.

`void AddFogPolygon(IGraphics3D* g3d, csPolygon3D* poly, csPolyPlane* plane, bool mirror, CS_ID id, int fog_type)`
  Add this polygon as a back or front polygon of a fog object. NOTE! Don't forget to open the fog object first with g3d->OpenFogObject ();

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de