Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

BULLET Class Reference

#include <bullet.h>

Inheritance diagram for BULLET:

OBJECT List of all members.

Public Methods

 BULLET ()
 ~BULLET ()
void Reset ()
void Initialize ()
void Draw ()
void Delete ()

Public Attributes

int active
int leaf
int flag
int collisionnode
int collisionpoly
VECTOR OriginalPosition
VECTOR VelocityVector
VECTOR CollisionVector
VECTOR PreviousPosition
int numverts
VERTEXmodelvertlist
int numpolys
POLYGONmodelpolylist
MATRIX Matrix

Constructor & Destructor Documentation

BULLET::BULLET  
 

Definition at line 34 of file bullet.cpp.

00035 {
00036 }

BULLET::~BULLET  
 

Definition at line 38 of file bullet.cpp.

00039 {
00040 }


Member Function Documentation

void BULLET::Delete  
 

Definition at line 88 of file bullet.cpp.

References modelpolylist, and modelvertlist.

Referenced by DeleteBullets().

00089 {
00090     delete[] modelvertlist;
00091     delete[] modelpolylist;
00092 }

void BULLET::Draw  
 

Reimplemented from OBJECT.

Definition at line 58 of file bullet.cpp.

References MATRIX::Element, Matrix, modelpolylist, numpolys, OBJECT::Orientation, OBJECT::Position, MATRIX::QuatToMatrix(), VECTOR::x, VECTOR::y, and VECTOR::z.

Referenced by RenderBSP().

00059 {
00060     glPushMatrix();
00061     glTranslatef(Position.x,Position.y,Position.z);
00062     Matrix.QuatToMatrix(Orientation);
00063     glMultMatrixf(Matrix.Element);
00064 /*
00065     float mat_ambient[] = { 0.3, 0.3, 0.3, 1.0 };
00066     float mat_diffuse[] = { 0.3, 0.3, 0.3, 1.0 };
00067     glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
00068     glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);
00069 */
00070     glDisable(GL_TEXTURE_2D);
00071     for (int loop = 0; loop < numpolys; loop++)
00072     {
00073         glBegin(GL_TRIANGLES);
00074             glNormal3fv(&modelpolylist[loop].Vertex[0].normal.x);
00075             glTexCoord2f(modelpolylist[loop].Vertex[0].u, modelpolylist[loop].Vertex[0].v);
00076             glVertex3fv(&modelpolylist[loop].Vertex[0].coords.x);
00077             glTexCoord2f(modelpolylist[loop].Vertex[1].u, modelpolylist[loop].Vertex[1].v);
00078             glVertex3fv(&modelpolylist[loop].Vertex[1].coords.x);
00079             glTexCoord2f(modelpolylist[loop].Vertex[2].u, modelpolylist[loop].Vertex[2].v);
00080             glVertex3fv(&modelpolylist[loop].Vertex[2].coords.x);
00081         glEnd();
00082     }
00083     glEnable(GL_TEXTURE_2D);
00084     glPopMatrix();
00085 }

void BULLET::Initialize  
 

Definition at line 52 of file bullet.cpp.

References modelpolylist, modelvertlist, numpolys, and numverts.

Referenced by InitializeBullets().

00053 {
00054     modelvertlist = new VERTEX[numverts];
00055     modelpolylist = new POLYGON[numpolys];
00056 }

void BULLET::Reset  
 

Reimplemented from OBJECT.

Definition at line 42 of file bullet.cpp.

References OBJECT::Delta_x, OBJECT::Delta_y, OBJECT::Delta_z, MATRIX::LoadIdentity(), Matrix, OBJECT::Orientation, OBJECT::Position, VECTOR::Reset(), and QUAT::Reset().

00043 {
00044     Orientation.Reset();
00045     Position.Reset();
00046         Delta_x = 0.0;
00047         Delta_y = 0.0;
00048         Delta_z = 0.0;
00049         Matrix.LoadIdentity();
00050 }


Member Data Documentation

int BULLET::active
 

Definition at line 23 of file bullet.h.

Referenced by InitializeBullets(), RenderBSP(), UpdateBullets(), and WinMain().

int BULLET::collisionnode
 

Definition at line 26 of file bullet.h.

Referenced by UpdateBullets().

int BULLET::collisionpoly
 

Definition at line 27 of file bullet.h.

Referenced by UpdateBullets().

VECTOR BULLET::CollisionVector
 

Definition at line 30 of file bullet.h.

Referenced by UpdateBullets().

int BULLET::flag
 

Definition at line 25 of file bullet.h.

Referenced by UpdateBullets(), and WinMain().

int BULLET::leaf
 

Definition at line 24 of file bullet.h.

Referenced by RenderBSP(), and UpdateBullets().

MATRIX BULLET::Matrix
 

Definition at line 36 of file bullet.h.

Referenced by Draw(), and Reset().

POLYGON* BULLET::modelpolylist
 

Definition at line 35 of file bullet.h.

Referenced by Delete(), Draw(), Initialize(), and InitializeBullets().

VERTEX* BULLET::modelvertlist
 

Definition at line 33 of file bullet.h.

Referenced by Delete(), and Initialize().

int BULLET::numpolys
 

Definition at line 34 of file bullet.h.

Referenced by Draw(), Initialize(), and InitializeBullets().

int BULLET::numverts
 

Definition at line 32 of file bullet.h.

Referenced by Initialize(), and InitializeBullets().

VECTOR BULLET::OriginalPosition
 

Definition at line 28 of file bullet.h.

Referenced by WinMain().

VECTOR BULLET::PreviousPosition
 

Definition at line 31 of file bullet.h.

Referenced by UpdateBullets(), and WinMain().

VECTOR BULLET::VelocityVector
 

Definition at line 29 of file bullet.h.

Referenced by UpdateBullets(), and WinMain().


The documentation for this class was generated from the following files:
Generated on Fri Dec 23 05:15:51 2005 for Constructive Solid Geometry by doxygen1.2.15