Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csPolygon2D Class Reference

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

#include <pol2d.h>

Inheritance diagram for csPolygon2D:

csPoly2D List of all members.

Public Methods

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

void AddPerspectiveUnit (const csVector3 &v)
 Compute the perspective transformation of a 3D vertex and add it to the polygon. More...

void AddPerspectiveAspect (const csVector3 &v, float ratio, float shift)
 Compute the perspective transformation of a 3D vertex and add it to the polygon. More...

void Draw (iGraphics2D *g2d, int col)
 Draw the polygon (wireframe version).

void DrawFilled (iRenderView *rview, csPolygon3D *poly, csPolyPlane *plane, csZBufMode zbufMode=CS_ZBUF_FILL)
 Draw a texture mapped polygon. More...

void FillZBuf (iRenderView *rview, csPolygon3D *poly, csPolyPlane *plane)
 Z fill the Z buffer for this polygon. More...

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. More...


Detailed Description

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

p>

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


Member Function Documentation

void csPolygon2D::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 ();

void csPolygon2D::AddPerspectiveAspect ( const csVector3 & v,
float ratio,
float shift )
 

Compute the perspective transformation of a 3D vertex and add it to the polygon.

This version computes perspective correction for a given aspect ratio and given shift value.

void csPolygon2D::AddPerspectiveUnit ( const csVector3 & v )
 

Compute the perspective transformation of a 3D vertex and add it to the polygon.

This version computes unit perspective correction for which aspect ratio is one and shift_x and shift_y are zero.

void csPolygon2D::DrawFilled ( iRenderView * rview,
csPolygon3D * poly,
csPolyPlane * plane,
csZBufMode zbufMode = CS_ZBUF_FILL )
 

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 csPolygon2D::FillZBuf ( iRenderView * rview,
csPolygon3D * poly,
csPolyPlane * plane )
 

Z fill the Z buffer for this polygon.

Nothing else is rendered.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000