Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csBspPolygon Class Reference

This class represents a polygon which can be inserted dynamically in a BSP tree. More...

#include <bspbbox.h>

Inheritance diagram for csBspPolygon:

csPolygonInt List of all members.

Public Methods

 CS_DECLARE_STATIC_CLASSVAR (poly_fact, GetPolygonFact, csBspPolygonFactory) CS_DECLARE_STATIC_CLASSVAR_REF(poly_pool, GetPolygonPool, csPolygonIntPool) void Dump()
 Debug.

virtual ~csBspPolygon ()
 Destructor.

csPolyTreeBBoxGetParent ()
 Get the parent container.

void SetParent (csPolyTreeBBox *par)
 Set the parent container.

csVisObjInfoGetOriginator ()
 Get originator.

void SetOriginator (csVisObjInfo *org)
 Set originator.

csPolyIndexedGetPolygon ()
 Get the reference to the polygon.

virtual int GetVertexCount ()
 Get number of vertices.

virtual int* GetVertexIndices ()
 Get vertex index table (required for csPolygonInt).

virtual csPolygonIntGetUnsplitPolygon ()
 Get original polygon (not known for this polygon type).

void SetPolyPlane (const csPlane3 &pl)
 Set the plane for this polygon.

csPlane3GetPolyPlane ()
 Return the plane of this polygon.

int Classify (const csPlane3 &pl)
 Classify a polygon with regards to this one.

int ClassifyX (float x)
 Same as Classify() but for X plane only.

int ClassifyY (float y)
 Same as Classify() but for Y plane only.

int ClassifyZ (float z)
 Same as Classify() but for Z plane only.

void SplitWithPlane (csPolygonInt **front, csPolygonInt **back, const csPlane3 &split_plane)
 Split this polygon with the given plane (A,B,C,D).

void SplitWithPlaneX (csPolygonInt **front, csPolygonInt **back, float x)
 Split this polygon to the x-plane.

void SplitWithPlaneY (csPolygonInt **front, csPolygonInt **back, float y)
 Split this polygon to the y-plane.

void SplitWithPlaneZ (csPolygonInt **front, csPolygonInt **back, float z)
 Split this polygon to the z-plane.

int GetType ()
 Return 3 to indicate it is a bsp polygon.

void Transform (const csTransform &trans)
 Transform the plane of this polygon.

bool ClipToPlane (csPlane3 *portal_plane, const csVector3 &v_w2c, csVector3 *&pverts, int &num_verts, bool cw=true)
 Clip this polygon to the Z plane and if portal_plane is given also clip the polygon to that plane. More...

bool DoPerspective (const csTransform &trans, csVector3 *source, int num_verts, csPolygon2D *dest, bool mirror)
 Perspective correct a polygon. More...

bool Overlaps (csPolygonInt *)
 Not implemented yet! @@.

bool IntersectSegment (const csVector3 &start, const csVector3 &end, csVector3 &isect, float *pr=NULL)
 Intersect object-space segment with this polygon. More...


Friends

class  csBspPolygonFactory

Detailed Description

This class represents a polygon which can be inserted dynamically in a BSP tree.

It is specifically designed to be able to add bounding boxes to sprites and dynamic things and then add those bounding boxes to the BSP tree.


Member Function Documentation

bool csBspPolygon::ClipToPlane ( csPlane3 * portal_plane,
const csVector3 & v_w2c,
csVector3 *& pverts,
int & num_verts,
bool cw = true )
 

Clip this polygon to the Z plane and if portal_plane is given also clip the polygon to that plane.

@@ NOTE @@ This function is almost identical to the one in csPolygon3D. It should be possible to reuse that code.

bool csBspPolygon::DoPerspective ( const csTransform & trans,
csVector3 * source,
int num_verts,
csPolygon2D * dest,
bool mirror )
 

Perspective correct a polygon.

Note that this function is nearly identical to a version in csPolygon3D. It should be possible to reuse that code.

bool csBspPolygon::IntersectSegment ( const csVector3 & start,
const csVector3 & end,
csVector3 & isect,
float * pr = NULL )
 

Intersect object-space segment with this polygon.

Return true if it intersects and the intersection point in world coordinates.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000