#include <polygon.h>
Public Methods | |
POLYGON () | |
~POLYGON () | |
int | Compare (const POLYGON &Polygon) |
int | GetMyPosition () const |
void | SetMyPosition (int newPosition) |
bool | IsLast () |
POLYGON * | GetNext () |
void | AddPolygon (POLYGON *Poly) |
void | SetNext (POLYGON *Poly) |
POLYGON * | CopyList () |
VECTOR | GetNormal () |
void | SetNormal () |
const bool | POLYGON::operator== (const POLYGON &Poly) const |
Public Attributes | |
int | linkPosition |
POLYGON * | NextPoly |
int | id |
int | numVertices |
int | removable |
unsigned int | Texture |
float | Scale [2] |
float | Shift [2] |
float | Rotate |
VERTEX | Vertex [maxPolygonVerts] |
|
Definition at line 9 of file polygon.cpp. References NextPoly, numVertices, and Texture.
00010 { 00011 NextPoly = NULL; 00012 numVertices = 0; 00013 Texture = 0; 00014 } |
|
Definition at line 16 of file polygon.cpp.
00017 { 00018 } |
|
Definition at line 71 of file polygon.cpp. References GetNext(), IsLast(), and NextPoly. Referenced by CopyList(), CSGAddition(), and CSGClipPolygon().
|
|
Definition at line 90 of file polygon.cpp. References bigger, linkPosition, same, and smaller.
00091 { 00092 if (linkPosition < Polygon.linkPosition) 00093 return smaller; 00094 if (linkPosition > Polygon.linkPosition) 00095 return bigger; 00096 else 00097 return same; 00098 } |
|
Definition at line 54 of file polygon.cpp. References AddPolygon(), IsLast(), NextPoly, numVertices, Texture, and Vertex. Referenced by CSGAddition().
00055 { 00056 POLYGON* TempPoly = new POLYGON; 00057 00058 TempPoly->Texture = Texture; 00059 00060 TempPoly->numVertices = numVertices; 00061 00062 for (int loop = 0; loop < numVertices; loop++) 00063 TempPoly->Vertex[loop] = Vertex[loop]; 00064 00065 if (!IsLast()) 00066 TempPoly->AddPolygon(NextPoly->CopyList()); 00067 00068 return TempPoly; 00069 } |
|
Definition at line 21 of file polygon.h. References linkPosition.
00021 {return linkPosition;} |
|
Definition at line 28 of file polygon.cpp. References IsLast(), and NextPoly. Referenced by AddPolygon(), CSGAddition(), CSGClipPolygon(), DeleteList(), and SetNext().
|
|
Definition at line 100 of file polygon.cpp. References VERTEX::coords, Vertex, VECTOR::x, VECTOR::y, and VECTOR::z. Referenced by CheckForCollision(), CheckForParticleCollision(), CreateLargePortal(), and CreateLightmaps().
|
|
Definition at line 20 of file polygon.cpp. References NextPoly. Referenced by AddPolygon(), CopyList(), DeleteList(), GetNext(), and SetNext().
00021 { 00022 if (NextPoly == NULL) 00023 return true; 00024 else 00025 return false; 00026 } |
|
Definition at line 46 of file polygon.h. References VERTEX::coords, VERTEX::normal, numVertices, Texture, VERTEX::u, VERTEX::v, Vertex, VECTOR::x, VECTOR::y, and VECTOR::z.
00047 { 00048 float PolyDistance = -(Poly.Vertex[0].normal.x * Poly.Vertex[0].coords.x + Poly.Vertex[0].normal.y * Poly.Vertex[0].coords.y + Poly.Vertex[0].normal.z * Poly.Vertex[0].coords.z); 00049 float ThisDistance = -(Vertex[0].normal.x * Vertex[0].coords.x + Vertex[0].normal.y * Vertex[0].coords.y + Vertex[0].normal.z * Vertex[0].coords.z); 00050 00051 if (numVertices == Poly.numVertices) 00052 { 00053 if (PolyDistance == ThisDistance) 00054 { 00055 if (Vertex[0].normal == Poly.Vertex[0].normal) 00056 { 00057 for (int loop = 0; loop < numVertices; loop++) 00058 { 00059 if (Vertex[loop].u != Poly.Vertex[loop].u) 00060 return false; 00061 if (Vertex[loop].v != Poly.Vertex[loop].v) 00062 return false; 00063 } 00064 00065 if (Texture == Poly.Texture) 00066 return true; 00067 } 00068 } 00069 } 00070 return false; 00071 } |
|
Definition at line 22 of file polygon.h. References linkPosition.
00022 {linkPosition = newPosition;} |
|
Definition at line 36 of file polygon.cpp. References GetNext(), IsLast(), and NextPoly.
|
|
Definition at line 111 of file polygon.cpp. References VERTEX::coords, maxPolygonVerts, VERTEX::normal, Vertex, VECTOR::x, VECTOR::y, and VECTOR::z. Referenced by InitializeBullets(), InvertBrushPolygons(), InvertPolygon(), SetBrushPolygons(), SetGLWorld(), SplitPolygon(), and SplitTriangle().
00112 { 00113 VECTOR u; 00114 VECTOR v; 00115 VERTEX tempVertex; 00116 u = Vertex[1].coords - Vertex[0].coords; 00117 v = Vertex[2].coords - Vertex[0].coords; 00118 tempVertex.normal.x = (u.y*v.z)-(v.y*u.z); 00119 tempVertex.normal.y = (u.z*v.x)-(v.z*u.x); 00120 tempVertex.normal.z = (u.x*v.y)-(v.x*u.y); 00121 for (int loop = 0; loop < maxPolygonVerts; loop++) 00122 { 00123 Vertex[loop].normal = tempVertex.normal; 00124 } 00125 } |
|
Definition at line 36 of file polygon.h. Referenced by ResetBrushes(). |
|
Definition at line 23 of file polygon.h. Referenced by Compare(), GetMyPosition(), and SetMyPosition(). |
|
Definition at line 26 of file polygon.h. Referenced by AddPolygon(), CopyList(), CSGAddition(), GetNext(), IsLast(), POLYGON(), and SetNext(). |
|
Definition at line 37 of file polygon.h. Referenced by ClassifyPolygon(), CopyList(), InitializeBullets(), InvertBrushPolygons(), InvertPolygon(), POLYGON(), POLYGON::operator==(), RenderTexturedBrush(), RenderWireframeBrush(), ResetBrushes(), SplitPolygon(), and SplitTriangle(). |
|
Definition at line 38 of file polygon.h. Referenced by InitializeBullets(), and SplitPolygon(). |
|
Definition at line 42 of file polygon.h. Referenced by InitializeBullets(), RenderBSP(), and SetGLWorld(). |
|
Definition at line 40 of file polygon.h. Referenced by InitializeBullets(), RenderBSP(), and SetGLWorld(). |
|
Definition at line 41 of file polygon.h. Referenced by InitializeBullets(), RenderBSP(), and SetGLWorld(). |
|
Definition at line 39 of file polygon.h. Referenced by CopyList(), InitializeBullets(), POLYGON(), POLYGON::operator==(), RenderBSP(), RenderTexturedBrush(), SetBrushPolygons(), SetGLWorld(), and SplitPolygon(). |
|
Definition at line 43 of file polygon.h. Referenced by CheckForCollision(), CheckForParticleCollision(), ClassifyInvertedPortal(), ClassifyPolygon(), ClassifyPortal(), CopyList(), CreateDecal(), CreateLargePortal(), CreateLightmaps(), CSGClipPolygon(), FindCurrentLeaf(), GetEdgeIntersection(), GetNormal(), InitGL(), InitializeBullets(), InvertBrushPolygons(), InvertPolygon(), InvertPortals(), line_plane_collision(), POLYGON::operator==(), RenderBSP(), RenderTexturedBrush(), RenderWireframeBrush(), SetBrushPolygons(), SetGLWorld(), SetNormal(), SplitPolygon(), SplitPortal(), SplitTriangle(), and UpdateBullets(). |