#include <polygon.h>
Public Methods | |
| POLYGON () | |
| ~POLYGON () | |
| VECTOR | GetNormal () |
| void | SetNormal () |
Public Attributes | |
| TEXTURE | Texture |
| VERTEX | Vertex [3] |
| int | numVertices |
|
|
Definition at line 5 of file polygon.cpp.
00006 {
00007 }
|
|
|
Definition at line 9 of file polygon.cpp.
00010 {
00011 }
|
|
|
Definition at line 13 of file polygon.cpp. References VERTEX::coords, Vertex, VECTOR::x, VECTOR::y, and VECTOR::z. Referenced by CheckForCollision().
00014 {
00015 VECTOR temp;
00016 float ux;
00017 float uy;
00018 float uz;
00019 float vx;
00020 float vy;
00021 float vz;
00022 ux = Vertex[1].coords.x - Vertex[0].coords.x;
00023 uy = Vertex[1].coords.y - Vertex[0].coords.y;
00024 uz = Vertex[1].coords.z - Vertex[0].coords.z;
00025 vx = Vertex[2].coords.x - Vertex[0].coords.x;
00026 vy = Vertex[2].coords.y - Vertex[0].coords.y;
00027 vz = Vertex[2].coords.z - Vertex[0].coords.z;
00028 temp.x = (uy*vz)-(vy*uz);
00029 temp.y = (uz*vx)-(vz*ux);
00030 temp.z = (ux*vy)-(vx*uy);
00031 return temp;
00032 }
|
|
|
Definition at line 34 of file polygon.cpp. References VERTEX::coords, VERTEX::normal, Vertex, VECTOR::x, VECTOR::y, and VECTOR::z. Referenced by SetGLWorld().
00035 {
00036 float ux;
00037 float uy;
00038 float uz;
00039 float vx;
00040 float vy;
00041 float vz;
00042 ux = Vertex[1].coords.x - Vertex[0].coords.x;
00043 uy = Vertex[1].coords.y - Vertex[0].coords.y;
00044 uz = Vertex[1].coords.z - Vertex[0].coords.z;
00045 vx = Vertex[2].coords.x - Vertex[0].coords.x;
00046 vy = Vertex[2].coords.y - Vertex[0].coords.y;
00047 vz = Vertex[2].coords.z - Vertex[0].coords.z;
00048 Vertex[0].normal.x = (uy*vz)-(vy*uz);
00049 Vertex[0].normal.y = (uz*vx)-(vz*ux);
00050 Vertex[0].normal.z = (ux*vy)-(vx*uy);
00051 Vertex[1].normal = Vertex[0].normal;
00052 Vertex[2].normal = Vertex[0].normal;
00053 }
|
|
|
Definition at line 21 of file polygon.h. Referenced by SelectPolygon(), and SetGLWorld(). |
|
|
|
|
|
Definition at line 20 of file polygon.h. Referenced by CheckForCollision(), GetNormal(), line_plane_collision(), SelectPolygon(), SetGLWorld(), and SetNormal(). |
1.2.15