Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CPolygon Class Reference

#include <CPolygon.h>

List of all members.

Public Member Functions

 CPolygon ()
 constructor

 CPolygon (zulong n)
 constructor

 CPolygon (const CPolygon &poly)
 constructor

CPolygon & operator= (const CPolygon &poly)
 = operator

CVector3 Norm () const
 returns a normal vector to the plane

CVector3 NormUnit () const
 returns a normalized normal vector

void RotateVertex ()
 inverts vertex index

zfloat Dist (const CVector3 &v) const
 returns the minimum distance between one vertex and the vector

CPlane GetPlane () const
 returns the plane in which lays the polygon

zbool IsInside (const CVector3 &v) const
 test if the vector v is inside the polygon

zfloat MinX () const
 returns the smallest value for the X coord

zfloat MinY () const
 returns the smallest value for the Y coord

zfloat MinZ () const
 returns the smallest value for the Z coord

zfloat MaxX () const
 returns the maximum value for the X coord

zfloat MaxY () const
 returns the maximum value for the Y coord

zfloat MaxZ () const
 returns the maximum value for the Z coord

CVector3 ClosestPointOnPoly (const CVector3 &p) const
 returns the the nearest point to the polygon perimeter

zuint MaxNormCoord () const
 returns what is the biggest coord of the polygons normal

zuint ClipToPlane (const CPlane &p)
 polygon clipping

zbool PolyIsInside (const CPlane &p) const
 test if at least one vertex of the polygon is inside the plane


Public Attributes

zulong uliNumvertex
 number of polygon vertex

CVectorTex3 vertex [ZD_POLYGON_MAX_POLYGON_VERTICES]
 polygon vertex


Constructor & Destructor Documentation

CPolygon::CPolygon  
 

constructor

CPolygon::CPolygon zulong    n
 

constructor

CPolygon::CPolygon const CPolygon &    poly
 

constructor


Member Function Documentation

zuint CPolygon::ClipToPlane const CPlane   p
 

polygon clipping

CVector3 CPolygon::ClosestPointOnPoly const CVector3   p const
 

returns the the nearest point to the polygon perimeter

zfloat CPolygon::Dist const CVector3   v const
 

returns the minimum distance between one vertex and the vector

CPlane CPolygon::GetPlane   const
 

returns the plane in which lays the polygon

bool CPolygon::IsInside const CVector3   v const
 

test if the vector v is inside the polygon

This code applies only to convex polygons.
Dim: Given a line segment between P0 (x0,y0) and P1 (x1,y1),
another point P (x,y) has the following relationship to the line segment.

Compute

(y - y0) (x1 - x0) - (x - x0) (y1 - y0)

if it is less than 0 then P is to the right of the line segment,
if greater than 0 it is to the left, if equal to 0 then it lies on
the line segment.

zuint CPolygon::MaxNormCoord   const
 

returns what is the biggest coord of the polygons normal

zfloat CPolygon::MaxX   const
 

returns the maximum value for the X coord

zfloat CPolygon::MaxY   const
 

returns the maximum value for the Y coord

zfloat CPolygon::MaxZ   const
 

returns the maximum value for the Z coord

zfloat CPolygon::MinX   const
 

returns the smallest value for the X coord

zfloat CPolygon::MinY   const
 

returns the smallest value for the Y coord

zfloat CPolygon::MinZ   const
 

returns the smallest value for the Z coord

CVector3 CPolygon::Norm   const
 

returns a normal vector to the plane

CVector3 CPolygon::NormUnit   const
 

returns a normalized normal vector

CPolygon & CPolygon::operator= const CPolygon &    poly
 

= operator

zbool CPolygon::PolyIsInside const CPlane   p const
 

test if at least one vertex of the polygon is inside the plane

returns:

  • TRUE: if one vertex is inside
  • FALSE: otherwise

void CPolygon::RotateVertex  
 

inverts vertex index


Member Data Documentation

zulong CPolygon::uliNumvertex
 

number of polygon vertex

CVectorTex3 CPolygon::vertex[ZD_POLYGON_MAX_POLYGON_VERTICES]
 

polygon vertex


The documentation for this class was generated from the following files:


SourceForge.net Logo