class csPolygonSet : public csObject, public csPolygonParentInt A PolygonSet class is a set of polygons (amazing, isn't it :-) A PolygonSet describes a set of polygons that form a convex and (probably) closed hull
| | current_light_frame_number Current light frame number |
| | curve_texels Texture coords of curve vertices |
| | curve_vertices Curve vertices |
| | curves_center Tesselation parameter: Center of thing to determine distance from |
| | curves_scale scale param (the larger this param it, the more the curves are tesselated). |
| | draw_busy How many times are we busy drawing this polyset (recursive) |
| | max_curve_vertices Maximum number of vertices. |
| | num_curve_vertices Number of vertices. |
| | AddCurve (csCurve* curve) Add a curve to this polygonset |
| | AddCurveVertex (csVector3& v, csVector2& t) Add a curve vertex |
| | AddPolygon (csPolygonInt* spoly) Add a polygon to this polygonset |
| | AddVertex (float x, float y, float z) Just add a new vertex to the polygonset |
| | AddVertex (const csVector3& v) Just add a new vertex to the polygonset |
| | AddVertexSmart (float x, float y, float z) Add a vertex but first check if there is already a vertex close to the wanted position |
| | AddVertexSmart (const csVector3& v) Add a vertex but first check if there is already a vertex close to the wanted position |
| | CamUpdate () Make sure the camera vertices are up-to-date to the current camera frame |
| | CreateBoundingBox () Create an oriented bounding box (currently not oriented yet@@@) for this polygon set |
| | csPolygonSet () Construct a csPolygonSet |
| | CurveTexel (int i) Get the specified curve texture coordinate (texel) |
| | CurveVertex (int i) Get the specified curve vertex |
| | GetBoundingBox () Get the oriented bounding box created by CreateBoundingBox() |
| | GetCameraMinMaxZ (float& minz, float& mazx) Find the minimum and maximum Z values of all vertices in this polygon set (in camera space) |
| | GetCurve (int idx) Get the specified curve from this set |
| | GetCurve (char* name) Get the named curve from this set |
| | GetFog () Return fog structure |
| | GetNext () Get the next polygonset in its linked list |
| | GetNumCurves () Get the number of curves in this polygonset |
| | GetNumCurveVertices () Get the number of curve vertices |
| | GetNumPolygons () Get the number of polygons in this polygonset |
| | GetNumVertices () Return the number of vertices |
| | GetPolygon (char* name) Get the named polygon from this set |
| | GetPolygon (int idx) Get the specified polygon from this set |
| | GetSector () Return the sector that this polygonset belongs to |
| | GetShadows (csVector3& origin) Return a list of shadow frustrums which extend from this polygon set |
| | HasFog () Return true if this has fog |
| | IntersectCameraZPlane (float z, csVector2* clipper, int num_clip, int& num_pts) Intersect this polygon set in camera space with a polygon which coincides with plane Zc = |
| | IntersectSegment (const csVector3& start, const csVector3& end, csVector3& isect, float* pr = NULL) Intersect world-space segment with polygons of this set |
| | IsBSP () Return true if there is a BSP tree used in this sector |
| | NewPolygon (csTextureHandle* texture) Create a new polygon in this polygonset and add it |
| | Prepare () Prepare all polygons for use |
| | SetNext (csPolygonSet* next) Set the next polygonset in its linked list |
| | SetSector (csSector* sector) Set the sector that this polygonset belongs to |
| | UpdateTransformation (const csVector3& trans) Translate with the given vector if needed |
| | UpdateTransformation (const csCamera& c) Transform to the given camera if needed |
| | UseBSP () Enable the optional BSP tree |
| | Vcam (int idx) Return the camera space vector for the vertex |
| | Vobj (int idx) Return the object space vector for the vertex |
| | Vwor (int idx) Return the world space vector for the vertex |
| | ~csPolygonSet () Delete all contents of this polygonset (vertices, polygons, curves, and BSP tree) |
| | bbox Optional oriented bounding box. |
| | bsp Optional bsp tree. |
| | cam_verts Vertices in camera space. |
| | cam_verts_set Camera space vertices. |
| | curves Table of ptr to curves forming the outside of the set |
| | light_frame_number Light frame number |
| | max_curves Maximum number of curves in 'curves' array. |
| | max_polygon Maximum number of polygons in 'polygon' array. |
| | next PolygonSets are linked either in a csWorld object or in another PolygonSet (Thing in csSector for example) |
| | num_curves Number of curves used. |
| | num_polygon Number of polygons used. |
| | obj_verts Vertices in object space. |
| | polygons Table of ptr to polygons forming the outside of the set |
| | sector csSector where this polyset belongs (pointer to 'this' if it is a sector). |
| | wor_verts Vertices in world space. |
| | DrawOnePolygon (csPolygon3D* p, csPolygon2D* poly, csRenderView* d, bool use_z_buf) Draw one 3D/2D polygon combination |
| | DrawPolygonArray (csPolygonInt** polygon, int num, csRenderView* rview, bool use_z_buf) Draw the given array of polygons in the current csPolygonSet |
| | TestQueuePolygonArray (csPolygonInt** polygon, int num, csRenderView* d, csPolygon2DQueue* poly_queue) Test a number of polygons against the c-buffer and insert them to the c-buffer if visible and also add them to a queue |
| | fog Fog information |
A PolygonSet class is a set of polygons (amazing, isn't it :-) A PolygonSet describes a set of polygons that form a convex and (probably) closed hull. All polygons in a set share vertices from the same pool.A recent extension also allows PolygonSets that are not convex by adding an optional BSP tree. This BSP tree is only useful if the PolygonSet is concave. Otherwise the tree is wasted.
Every polygon in the set has a visible and an invisible face; if the vertices of the polygon are ordered clockwise then the polygon is visible. Using this feature it is possible to define two kinds of PolygonSets: in one kind the polygons are oriented such that they are visible from within the hull. In other words, the polygons form a sort of container or room where the camera can be located. We call this kind of PolygonSet a csSector (a subclass of PolygonSet). In another kind the polygons are oriented such that they are visible from the outside. We call this kind of PolygonSet a Thing (another subclass of PolygonSet).
Things and csSectors have many similarities. That's why the PolygonSet class was created: to exploit these similarities. However, there are some important differences between Things and csSectors:
- Currently, only things can move. This means that the object space coordinates of a csSector are ALWAYS equal to the world space coordinates. It would be possible to allow moveable csSectors but I don't how this should be integrated into an easy model of the world.
- Things do not require portals but can use them.
If 'pr' != NULL it will also return a value between 0 and 1
indicating where on the 'start'-'end' vector the intersection
happened.
csVector3* wor_verts
csVector3* obj_verts
csVector3* cam_verts
csTransformedSet cam_verts_set
csPolygonInt** polygons
int num_polygon
int max_polygon
csCurve** curves
int num_curves
int max_curves
csSector* sector
csBspTree* bsp
csPolygonSetBBox* bbox
long light_frame_number
void DrawOnePolygon(csPolygon3D* p, csPolygon2D* poly, csRenderView* d, bool use_z_buf)
void DrawPolygonArray(csPolygonInt** polygon, int num, csRenderView* rview, bool use_z_buf)
void* TestQueuePolygonArray(csPolygonInt** polygon, int num, csRenderView* d, csPolygon2DQueue* poly_queue)
csFog fog
static long current_light_frame_number
int draw_busy
csVector3 curves_center
float curves_scale
csVector3* curve_vertices
csVector2* curve_texels
int num_curve_vertices
int max_curve_vertices
csPolygonSet()
virtual ~csPolygonSet()
virtual void Prepare()
int AddVertex(const csVector3& v)
int AddVertex(float x, float y, float z)
int AddVertexSmart(const csVector3& v)
int AddVertexSmart(float x, float y, float z)
csVector3& Vwor(int idx)
csVector3& Vobj(int idx)
csVector3& Vcam(int idx)
void CamUpdate()
int GetNumVertices()
void AddPolygon(csPolygonInt* spoly)
csPolygon3D* NewPolygon(csTextureHandle* texture)
int GetNumPolygons()
csPolygonInt* GetPolygon(int idx)
csPolygon3D* GetPolygon(char* name)
void AddCurve(csCurve* curve)
int GetNumCurves()
csCurve* GetCurve(int idx)
csCurve* GetCurve(char* name)
int GetNumCurveVertices()
csVector3& CurveVertex(int i)
csVector2& CurveTexel(int i)
void AddCurveVertex(csVector3& v, csVector2& t)
void UseBSP()
bool IsBSP()
virtual csPolygon3D* IntersectSegment(const csVector3& start, const csVector3& end, csVector3& isect, float* pr = NULL)
void UpdateTransformation(const csCamera& c)
void UpdateTransformation(const csVector3& trans)
csPolygonSet* GetNext()
void SetNext(csPolygonSet* next)
void SetSector(csSector* sector)
csSector* GetSector()
csFrustrumList* GetShadows(csVector3& origin)
void CreateBoundingBox()
csPolygonSetBBox* GetBoundingBox()
bool HasFog()
csFog& GetFog()
void GetCameraMinMaxZ(float& minz, float& mazx)
csVector2* IntersectCameraZPlane(float z, csVector2* clipper, int num_clip, int& num_pts)
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de