Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

gbmath::geometry::Polygon Class Reference

Polygon class. More...

#include <polygon.h>

List of all members.

Public Methods

Constructors
 Polygon ()
 .

 Polygon (const Polygon &poly)
 .

 Polygon (const V3 *verts, int numVerts)
 .

 Polygon (const std::vector< V3 > &verts)
 .

Initializers
void Set (const V3 *verts, int numVerts)
 Assumes input is set of points making a convex polygon.

void Set (const std::vector< V3 > &verts)
 Assumes input is set of points making a convex polygon.

Accessors
const std::vector< V3 > & GetVerts () const
 .

const V3GetNormal () const
 .

const PlaneGetPlane () const
 .

const std::vector< int > & GetFanIndices () const
 .

Overloaded operators
void operator= (const Polygon &poly)
 .

bool operator== (const Polygon &poly) const
 .

Operations
void ReverseWinding (const Polygon &poly)
 Reverses the winding order of the vertices in place.

int Split (const Plane &pl, Polygon &oFrontPoly, Polygon &oBackPoly, float eps=constants::Eps3)
 Splits a polygon into two using the plane.

int Stitch (const Polygon &poly1, Polygon poly2, bool swapped=false)
 Takes two polygons on the same plane and stores the combined polygon.


Detailed Description

Polygon class.


Member Function Documentation

int gbmath::geometry::Polygon::Split const Plane   pl,
Polygon &    oFrontPoly,
Polygon &    oBackPoly,
float    eps = constants::Eps3
 

Splits a polygon into two using the plane.

Parameters:
eps  Threshold to determine if splitting plane is coplanar with polygon.
Return values:
1  The polygon was successfully split into the oFrontPoly and oBackPoly.
0  If pl is on plane with the polygon.

int gbmath::geometry::Polygon::Stitch const Polygon &    poly1,
Polygon    poly2,
bool    swapped = false
 

Takes two polygons on the same plane and stores the combined polygon.

Remarks:
Assumes result polygon has no holes
Return values:
1  On success.
0  If no plane in common or no edge in common.


The documentation for this class was generated from the following file:
Generated on Mon Sep 2 14:52:34 2002 for GunBuster Engine by doxygen1.2.17