Public Methods |
| csPoly3D (int start_size=10) |
| Make a new empty polygon.
|
| csPoly3D (const csPoly3D ©) |
| Copy constructor.
|
virtual | ~csPoly3D () |
| Destructor.
|
void | MakeEmpty () |
| Initialize the polygon to empty.
|
int | GetVertexCount () const |
| Get the number of vertices.
|
csVector3* | GetVertices () const |
| Get the array with all vertices.
|
csVector3* | GetVertex (int i) const |
| Get the specified vertex.
|
csVector3& | operator[] (int i) |
| Get the specified vertex.
|
csVector3& | operator[] (int i) const |
| Get the specified vertex.
|
csVector3* | GetFirst () const |
| Get the first vertex.
|
csVector3* | GetLast () const |
| Get the last vertex.
|
bool | In (const csVector3 &v) const |
| Test if this vector is inside the polygon.
|
void | MakeRoom (int new_max) |
| Make room for at least the specified number of vertices.
|
void | SetVertexCount (int n) |
| Set the number of vertices.
|
int | AddVertex (const csVector3 &v) |
| Add a vertex (3D) to the polygon. More...
|
int | AddVertex (float x, float y, float z) |
| Add a vertex (3D) to the polygon. More...
|
void | SetVertices (csVector3 const *v, int num) |
| Set all polygon vertices at once. More...
|
bool | ProjectXPlane (const csVector3 &point, float plane_x, csPoly2D *poly2d) const |
| Project this polygon onto a X plane as seen from some point in space. More...
|
bool | ProjectYPlane (const csVector3 &point, float plane_y, csPoly2D *poly2d) const |
| Project this polygon onto a Y plane as seen from some point in space. More...
|
bool | ProjectZPlane (const csVector3 &point, float plane_z, csPoly2D *poly2d) const |
| Project this polygon onto a Z plane as seen from some point in space. More...
|
bool | ProjectAxisPlane (const csVector3 &point, int plane_nr, float plane_pos, csPoly2D *poly2d) const |
| Project this polygon onto an axis-aligned plane as seen from some point in space. More...
|
int | Classify (const csPlane3 &pl) const |
| Classify this polygon with regards to a plane. More...
|
int | ClassifyX (float x) const |
| Same as Classify() but for X plane only.
|
int | ClassifyY (float y) const |
| Same as Classify() but for Y plane only.
|
int | ClassifyZ (float z) const |
| Same as Classify() but for Z plane only.
|
void | CutToPlane (const csPlane3 &split_plane) |
| Cut this polygon with a plane and only keep the front side.
|
void | SplitWithPlane (csPoly3D &front, csPoly3D &back, const csPlane3 &split_plane) const |
| Split this polygon with the given plane (A,B,C,D).
|
void | SplitWithPlaneX (csPoly3D &front, csPoly3D &back, float x) const |
| Split this polygon to the x-plane.
|
void | SplitWithPlaneY (csPoly3D &front, csPoly3D &back, float y) const |
| Split this polygon to the y-plane.
|
void | SplitWithPlaneZ (csPoly3D &front, csPoly3D &back, float z) const |
| Split this polygon to the z-plane.
|
csVector3 | ComputeNormal () const |
| Compute the normal of this polygon.
|
csPlane3 | ComputePlane () const |
| Compute the plane of this polygon.
|
float | GetSignedArea () const |
| Calculate the signed area of this polygon.
|
csVector3 | GetCenter () const |
| Compute and get the central vertex of this polygon.
|
Static Public Methods |
bool | In (csVector3 *poly, int num_poly, const csVector3 &v) |
| Test if a vector is inside the given polygon.
|
int | Classify (const csPlane3 &pl, csVector3 *vertices, int num_vertices) |
| Static function to classify a polygon with regards to a plane. More...
|
csVector3 | ComputeNormal (csVector3 *vertices, int num) |
| Compute the normal of a polygon.
|
csPlane3 | ComputePlane (csVector3 *vertices, int num) |
| Compute the plane of a polygon.
|
Protected Attributes |
csVector3* | vertices |
| The 3D vertices.
|
int | num_vertices |
int | max_vertices |