Al's Programming Resource Homepage  Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

POLYGON Class Reference

#include <polygon.h>

List of all members.

Public Methods

 POLYGON ()
 ~POLYGON ()
VECTOR GetNormal ()
void SetNormal ()

Public Attributes

float Scale [2]
float Shift [2]
float Rotate
unsigned int Texture
int numVertices
VERTEX Vertex [3]


Constructor & Destructor Documentation

POLYGON::POLYGON  
 

Definition at line 10 of file polygon.cpp.

References numVertices.

00011 :
00012 numVertices(3)
00013 {
00014     
00015 }

POLYGON::~POLYGON  
 

Definition at line 17 of file polygon.cpp.

00018 {
00019 }


Member Function Documentation

VECTOR POLYGON::GetNormal  
 

Definition at line 21 of file polygon.cpp.

References Vertex, VECTOR::x, VERTEX::x, VECTOR::y, VERTEX::y, VECTOR::z, and VERTEX::z.

Referenced by CheckForCollision(), CreateLargePortal(), and CreateLightmaps().

00022 {
00023         VECTOR temp; 
00024         float ux;
00025         float uy;
00026         float uz;
00027         float vx;
00028         float vy;
00029         float vz;
00030           ux = Vertex[1].x - Vertex[0].x;
00031           uy = Vertex[1].y - Vertex[0].y;
00032           uz = Vertex[1].z - Vertex[0].z;
00033           vx = Vertex[2].x - Vertex[0].x;
00034           vy = Vertex[2].y - Vertex[0].y;
00035           vz = Vertex[2].z - Vertex[0].z;
00036           temp.x = (uy*vz)-(vy*uz);
00037           temp.y = (uz*vx)-(vz*ux);
00038           temp.z = (ux*vy)-(vx*uy);
00039         return temp;
00040 }

void POLYGON::SetNormal  
 

Definition at line 42 of file polygon.cpp.

References VERTEX::nx, VERTEX::ny, VERTEX::nz, Vertex, VERTEX::x, VERTEX::y, and VERTEX::z.

Referenced by SetGLWorld(), and SplitPolygon().

00043 {
00044         float ux;
00045         float uy;
00046         float uz;
00047         float vx;
00048         float vy;
00049         float vz;
00050           ux = Vertex[1].x - Vertex[0].x;
00051           uy = Vertex[1].y - Vertex[0].y;
00052           uz = Vertex[1].z - Vertex[0].z;
00053           vx = Vertex[2].x - Vertex[0].x;
00054           vy = Vertex[2].y - Vertex[0].y;
00055           vz = Vertex[2].z - Vertex[0].z;
00056           Vertex[0].nx = (uy*vz)-(vy*uz);
00057           Vertex[0].ny = (uz*vx)-(vz*ux);
00058           Vertex[0].nz = (ux*vy)-(vx*uy);
00059         Vertex[1].nx = Vertex[0].nx;
00060           Vertex[1].ny = Vertex[0].ny;
00061           Vertex[1].nz = Vertex[0].nz;
00062           Vertex[2].nx = Vertex[0].nx;
00063           Vertex[2].ny = Vertex[0].ny;
00064           Vertex[2].nz = Vertex[0].nz;
00065 }


Member Data Documentation

int POLYGON::numVertices
 

Definition at line 23 of file polygon.h.

Referenced by SplitPolygon().

float POLYGON::Rotate
 

Definition at line 21 of file polygon.h.

Referenced by RenderBSP(), and SetGLWorld().

float POLYGON::Scale[2]
 

Definition at line 19 of file polygon.h.

Referenced by RenderBSP(), and SetGLWorld().

float POLYGON::Shift[2]
 

Definition at line 20 of file polygon.h.

Referenced by RenderBSP(), and SetGLWorld().

unsigned int POLYGON::Texture
 

Definition at line 22 of file polygon.h.

Referenced by RenderBSP(), and SetGLWorld().

VERTEX POLYGON::Vertex[3]
 

Definition at line 24 of file polygon.h.

Referenced by CheckForCollision(), ClassifyInvertedPortal(), ClassifyPortal(), CreateLargePortal(), CreateLightmaps(), FindCurrentLeaf(), GetEdgeIntersection(), GetNormal(), InitGL(), InvertPortals(), RenderBSP(), SetGLWorld(), SetNormal(), SplitPolygon(), and SplitPortal().


The documentation for this class was generated from the following files:
Generated on Fri Dec 23 05:20:42 2005 for Potentially Visible Sets by doxygen1.2.15