#include <gauge3d/3dmath/polygon.h>
Public Methods | |
| GPolygon () | |
| Creates a polygon with no sides. | |
| GPolygon (const GTriangle &triangle) | |
| Creates a polygon equivalent to the given triangle. | |
| GPolygon (const GPolygon &other) | |
| Copy constructor. | |
| GPolygon (GVector vertices[],int num) | |
| Creates a polygon with the given vertices. | |
| ~GPolygon () | |
| Destructor. | |
| void | GetPlane (GPlane *plane)const |
| Gets the plane which the polygon is on. More... | |
| void | Resize (int num,bool copy) |
| Change the number of vertices. More... | |
| void | Split (GTriangle triangles[])const |
| Splits the polygon into triangles. More... | |
| void | Reverse () |
| Reverses the direction of the vertices. More... | |
| bool | Contains (const GVector &point) |
| Returns true if the point is on the polygon. | |
| int8 | Intersects (const GLine &line) |
| Finds whether or not the line intersects the polygon, and from which side if so. More... | |
| int | NumVertices ()const |
| The number of vertices in the polygon. | |
| GVector& | operator[] (int index) |
| Array-like access to vertices. | |
| const GVector& | operator[] (int index)const |
| Array-like access to vertices. | |
| const GPolygon& | operator= (const GPolygon other) |
| Assignment operator. | |
I recommend against using this class except when other methods are extremely inconvenient. This class uses dynamic memory, which makes it unsuitable for fast math computations.
|
|
Gets the plane which the polygon is on.
|
|
|
Change the number of vertices.
|
|
|
Splits the polygon into triangles.
|
|
|
Reverses the direction of the vertices.
|
|
|
Finds whether or not the line intersects the polygon, and from which side if so.
|
1.2.4 written by Dimitri van Heesch,
© 1997-2000