#include <polyint.h>
Inheritance diagram for csPolygonInt:
Public Methods | |
csPolygonInt () | |
Constructor. Init ref counter to 1. | |
void | IncRefCount () |
Increase the reference counter in this csPolygonInt. | |
bool | DecRefCount () |
Decrease the reference counter. More... | |
bool | IsReferenced () |
Return false if object is not referenced. | |
virtual csPlane3* | GetPolyPlane ()=0 |
Return the plane of this polygon. | |
virtual int | Classify (const csPlane3 &pl)=0 |
Classify this polygon with regards to a plane (in world space). More... | |
virtual int | ClassifyX (float x) |
Classify to X plane. More... | |
virtual int | ClassifyY (float y) |
Classify to Y plane. More... | |
virtual int | ClassifyZ (float z) |
Classify to Z plane. More... | |
virtual void | SplitWithPlane (csPolygonInt **front, csPolygonInt **back, const csPlane3 &plane)=0 |
Split this polygon with the given plane (A,B,C,D) and return the two resulting new polygons in 'front' and 'back'. More... | |
virtual void | SplitWithPlaneX (csPolygonInt **front, csPolygonInt **back, float x) |
Split this polygon with the X plane. More... | |
virtual void | SplitWithPlaneY (csPolygonInt **front, csPolygonInt **back, float y) |
Split this polygon with the Y plane. More... | |
virtual void | SplitWithPlaneZ (csPolygonInt **front, csPolygonInt **back, float z) |
Split this polygon with the Z plane. More... | |
virtual int | GetType ()=0 |
Return some type-id which BSP visitors can use for their own purpose. More... | |
virtual int | GetVertexCount ()=0 |
Get number of vertices for this polygon. | |
virtual int* | GetVertexIndices ()=0 |
Get pointer to array of vertex indices. | |
virtual csPolygonInt* | GetUnsplitPolygon ()=0 |
If known and if there is any, return the pointer to the original unsplit polygon. | |
virtual bool | Overlaps (csPolygonInt *overlapped)=0 |
Compare this polygon to the other one. More... | |
Friends | |
class | csPolygonIntPool |
It acts as an 'interface' in JAVA terminology. There is no data in this class and no method implementations.
The BSP tree implementation is an example of a class that uses this csPolygonInt interface. The consequence of this is that the BSP tree can be used for several sorts of polygons (even 3D or 2D ones). The csOctree class also uses csPolygonInt.
|
Classify this polygon with regards to a plane (in world space). If this poly is on same plane it returns POL_SAME_PLANE. If this poly is completely in front of the given plane it returnes POL_FRONT. If this poly is completely back of the given plane it returnes POL_BACK. Otherwise it returns POL_SPLIT_NEEDED. Reimplemented in csBspPolygon, and csPolygon3D. |
|
Classify to X plane. The default implementation just calls Classify() above with a constructed plane but this function can be overridden for more efficiency. Reimplemented in csBspPolygon, and csPolygon3D. |
|
Classify to Y plane. The default implementation just calls Classify() above with a constructed plane but this function can be overridden for more efficiency. Reimplemented in csBspPolygon, and csPolygon3D. |
|
Classify to Z plane. The default implementation just calls Classify() above with a constructed plane but this function can be overridden for more efficiency. Reimplemented in csBspPolygon, and csPolygon3D. |
|
Decrease the reference counter. This function returns false as soon as the reference counter reaches zero. The object is NOT deleted automatically in that case. |
|
Return some type-id which BSP visitors can use for their own purpose. The purpose of this is to allow several different types of polygons to be added to the same tree. With this number you can recognize them. Reimplemented in csBspPolygon, and csPolygon3D. |
|
Compare this polygon to the other one. If there exists a position in space where this polygon would overlap the other then return true. The other polygon is not guaranteed to have the same type but it is guaranteed to be part of the same set of added polygon then this one. So the type should always be known. Reimplemented in csBspPolygon, and csPolygon3D. |
|
Split this polygon with the given plane (A,B,C,D) and return the two resulting new polygons in 'front' and 'back'. The new polygons will mimic the behaviour of the parent polygon as good as possible. Note that the 'front' should be the negative side of the plane and 'back' the positive side. Reimplemented in csBspPolygon, and csPolygon3D. |
|
Split this polygon with the X plane. Default implementation just calls SplitWithPlane() with a constructed plane but this function can be overridden for more efficiency. Reimplemented in csBspPolygon. |
|
Split this polygon with the Y plane. Default implementation just calls SplitWithPlane() with a constructed plane but this function can be overridden for more efficiency. Reimplemented in csBspPolygon. |
|
Split this polygon with the Z plane. Default implementation just calls SplitWithPlane() with a constructed plane but this function can be overridden for more efficiency. Reimplemented in csBspPolygon. |