#include <CPolygon.h>
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
|
|
constructor
|
|
constructor
|
|
polygon clipping
|
|
returns the the nearest point to the polygon perimeter
|
|
returns the minimum distance between one vertex and the vector
|
|
returns the plane in which lays the polygon
|
|
test if the vector v is inside the polygon
This code applies only to convex polygons.
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, |
|
returns what is the biggest coord of the polygons normal
|
|
returns the maximum value for the X coord
|
|
returns the maximum value for the Y coord
|
|
returns the maximum value for the Z coord
|
|
returns the smallest value for the X coord
|
|
returns the smallest value for the Y coord
|
|
returns the smallest value for the Z coord
|
|
returns a normal vector to the plane
|
|
returns a normalized normal vector
|
|
= operator
|
|
test if at least one vertex of the polygon is inside the plane
returns:
|
|
inverts vertex index
|
|
number of polygon vertex
|
|
polygon vertex
|