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 9 of file polygon.cpp.

References numVertices.

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

POLYGON::~POLYGON  
 

Definition at line 16 of file polygon.cpp.

00017 {
00018 }


Member Function Documentation

VECTOR POLYGON::GetNormal  
 

Definition at line 20 of file polygon.cpp.

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

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

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

void POLYGON::SetNormal  
 

Definition at line 41 of file polygon.cpp.

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

Referenced by SetGLWorld(), and SplitPolygon().

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


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 InitializeBullets(), RenderBSP(), and SetGLWorld().

float POLYGON::Scale[2]
 

Definition at line 19 of file polygon.h.

Referenced by InitializeBullets(), RenderBSP(), and SetGLWorld().

float POLYGON::Shift[2]
 

Definition at line 20 of file polygon.h.

Referenced by InitializeBullets(), RenderBSP(), and SetGLWorld().

unsigned int POLYGON::Texture
 

Definition at line 22 of file polygon.h.

Referenced by InitializeBullets(), RenderBSP(), and SetGLWorld().

VERTEX POLYGON::Vertex[3]
 

Definition at line 24 of file polygon.h.

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


The documentation for this class was generated from the following files:
Generated on Fri Dec 23 05:19:59 2005 for Particles by doxygen1.2.15