JOEMODEL Class Reference

#include <model.h>

Collaboration diagram for JOEMODEL:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 JOEMODEL ()
 ~JOEMODEL ()
bool Load (string strFileName)
bool Load (string strFileName, bool autoloadtexture)
bool Load (string strFileName, bool autoloadtexture, JOEPACK *pack)
bool LoadFromHandle (FILE *f, JOEPACK *pack)
int BinaryRead (void *buffer, unsigned int size, unsigned int count, FILE *f, JOEPACK *pack)
void Draw (int frame, float t)
void Draw (int frame, int nextframe, float t)
void DrawStatic ()
void NewDraw (int frame, float t, VERTEX lightdir, QUATERNION rotation, int pass)
void NewDraw (int frame, int nextframe, float t, VERTEX lightdir, QUATERNION rotation, int pass)
void NoTexture (int tid)
void Texture (string texturename, int tid)
void ReflectionTexture (string texturename, int tid)
void AdditiveTexture (string texturename, int tid)
void TextureID (TEXTURE_HANDLE *texid, int tid)
void ReflectionTextureID (TEXTURE_HANDLE *texid, int tid)
void AdditiveTextureID (TEXTURE_HANDLE *texid, int tid)
void SetTU (int tuid, bool tue)
float GetRadius ()
float GetRadiusXZ ()
unsigned int GetFaces ()
bool Collide (VERTEX origin, VERTEX direction, VERTEX &outtri, bool closest)
float * GetVert (short index)
short * GetFace (short index)
float * GetNorm (short index)
short * GetNormIdx (short index)
AABBGetBBOX ()

Private Member Functions

string FileToPNG (string filename)
string FileToTexturesizePNG (string filename)
void ColorFromNormal (VERTEX &norm, VERTEX &ldir)
void TexCoordFromNormal (VERTEX &norm, VERTEX &ldir)
void CorrectEndian (struct JOEFace *p, int num)
void CorrectEndian (struct JOEVertex *p, int num)
void CorrectEndian (struct JOETexCoord *p, int num)
void ReadData (FILE *m_FilePointer, JOEPACK *pack)
void CleanUp (FILE *m_FilePointer, JOEPACK *pack)

Private Attributes

int collidecache [NUM_COLLIDE_CACHE]
int collidecachepos
AABB bbox
float radius
float radiusxz
GLuint static_list
bool loadedfile
TEXTURE_HANDLE textureid [MAX_TEXTURE_UNITS]
int texturemode [MAX_TEXTURE_UNITS]
bool tuenable [MAX_TEXTURE_UNITS]
bool autounload [MAX_TEXTURE_UNITS]
string modelpath
JOEObjectpObject

Detailed Description

Definition at line 164 of file model.h.


Constructor & Destructor Documentation

JOEMODEL::JOEMODEL  ) 
 

Definition at line 5 of file model.cpp.

References autounload, loadedfile, MAX_TEXTURE_UNITS, NULL, pObject, radius, radiusxz, texturemode, TEXTUREMODE_NOTEX, and tuenable.

JOEMODEL::~JOEMODEL  ) 
 

Definition at line 432 of file model.cpp.

References JOEFrame::faces, JOEObject::frames, JOEObject::info, JOEFrame::normals, NULL, JOEHeader::num_frames, pObject, JOEFrame::texcoords, and JOEFrame::verts.


Member Function Documentation

void JOEMODEL::AdditiveTexture string  texturename,
int  tid
 

Definition at line 1353 of file model.cpp.

References autounload, UTILITY::FileExists(), FileToPNG(), FileToTexturesizePNG(), Load(), MAX_TEXTURE_UNITS, textureid, texturemode, TEXTUREMODE_ADD, TEXTURE_HANDLE::Unload(), and utility.

Referenced by Vamos_Body::Gl_Car::exterior_model().

void JOEMODEL::AdditiveTextureID TEXTURE_HANDLE texid,
int  tid
[inline]
 

Definition at line 195 of file model.h.

References autounload, MAX_TEXTURE_UNITS, textureid, texturemode, and TEXTUREMODE_ADD.

int JOEMODEL::BinaryRead void *  buffer,
unsigned int  size,
unsigned int  count,
FILE *  f,
JOEPACK pack
 

Definition at line 28 of file model.cpp.

References NULL, and JOEPACK::Pack_fread().

Referenced by LoadFromHandle(), and ReadData().

void JOEMODEL::CleanUp FILE *  m_FilePointer,
JOEPACK pack
[private]
 

Definition at line 420 of file model.cpp.

References NULL, and JOEPACK::Pack_fclose().

bool JOEMODEL::Collide VERTEX  origin,
VERTEX  direction,
VERTEX outtri,
bool  closest
 

Definition at line 1382 of file model.cpp.

References collidecache, JOEFrame::faces, JOEObject::frames, INTERSECT_FUNCTION, NUM_COLLIDE_CACHE, pObject, VERTEX::ScaleR(), VERTEX::Set(), VERTEX::v3(), and JOEFrame::verts.

void JOEMODEL::ColorFromNormal VERTEX norm,
VERTEX ldir
[inline, private]
 

Definition at line 972 of file model.cpp.

void JOEMODEL::CorrectEndian struct JOETexCoord p,
int  num
[private]
 

Definition at line 1234 of file model.cpp.

References ENDIAN_SWAP_FLOAT, and JOETexCoord::v.

void JOEMODEL::CorrectEndian struct JOEVertex p,
int  num
[private]
 

Definition at line 1220 of file model.cpp.

References ENDIAN_SWAP_FLOAT.

void JOEMODEL::CorrectEndian struct JOEFace p,
int  num
[private]
 

Definition at line 1204 of file model.cpp.

References ENDIAN_SWAP_16, JOEFace::normalIndex, and JOEFace::textureIndex.

Referenced by ReadData().

void JOEMODEL::Draw int  frame,
int  nextframe,
float  t
 

Definition at line 499 of file model.cpp.

References JOEFrame::faces, JOEObject::frames, JOEObject::info, JOEHeader::num_faces, JOEHeader::num_frames, pObject, UTILITY::SelectTU(), VERTEX::Set(), utility, JOEFace::vertexIndex, JOEFrame::verts, VERTEX::x, VERTEX::y, and VERTEX::z.

void JOEMODEL::Draw int  frame,
float  t
 

Definition at line 489 of file model.cpp.

Referenced by LoadFromHandle().

void JOEMODEL::DrawStatic  ) 
 

Definition at line 1002 of file model.cpp.

References MAX_TEXTURE_UNITS, UTILITY::numTUs(), UTILITY::SelectTU(), and utility.

Referenced by Vamos_Body::Wheel::draw(), and Vamos_Body::Gl_Car::draw().

string JOEMODEL::FileToPNG string  filename  )  [private]
 

Definition at line 1308 of file model.cpp.

References MAX_FILENAME_LEN.

Referenced by AdditiveTexture(), ReflectionTexture(), and Texture().

string JOEMODEL::FileToTexturesizePNG string  filename  )  [private]
 

Definition at line 1323 of file model.cpp.

Referenced by AdditiveTexture(), ReflectionTexture(), and Texture().

AABB& JOEMODEL::GetBBOX  )  [inline]
 

Definition at line 212 of file model.h.

References bbox.

Referenced by OBJECTS::DrawObject().

short* JOEMODEL::GetFace short  index  )  [inline]
 

Definition at line 207 of file model.h.

References JOEFrame::faces, JOEObject::frames, pObject, and JOEFace::vertexIndex.

Referenced by Vamos_World::World::interact().

unsigned int JOEMODEL::GetFaces  )  [inline]
 

Definition at line 202 of file model.h.

References JOEObject::info, loadedfile, JOEHeader::num_faces, and pObject.

Referenced by Vamos_World::World::interact().

float* JOEMODEL::GetNorm short  index  )  [inline]
 

Definition at line 209 of file model.h.

References JOEObject::frames, JOEFrame::normals, pObject, and JOEVertex::vertex.

short* JOEMODEL::GetNormIdx short  index  )  [inline]
 

Definition at line 210 of file model.h.

References JOEFrame::faces, JOEObject::frames, JOEFace::normalIndex, and pObject.

float JOEMODEL::GetRadius  )  [inline]
 

Definition at line 199 of file model.h.

References radius.

Referenced by OBJECTS::DrawObject().

float JOEMODEL::GetRadiusXZ  )  [inline]
 

Definition at line 200 of file model.h.

References radiusxz.

float* JOEMODEL::GetVert short  index  )  [inline]
 

Definition at line 206 of file model.h.

References JOEObject::frames, pObject, JOEVertex::vertex, and JOEFrame::verts.

Referenced by Vamos_World::World::interact().

bool JOEMODEL::Load string  strFileName,
bool  autoloadtexture,
JOEPACK pack
 

Definition at line 45 of file model.cpp.

References autounload, loadedfile, MAX_TEXTURE_UNITS, modelpath, textureid, texturemode, TEXTUREMODE_NOTEX, and tuenable.

bool JOEMODEL::Load string  strFileName,
bool  autoloadtexture
 

Definition at line 40 of file model.cpp.

References Load(), and NULL.

bool JOEMODEL::Load string  strFileName  )  [inline]
 

Definition at line 171 of file model.h.

Referenced by AdditiveTexture(), OBJECTS::AddModel(), Vamos_Body::Gl_Car::exterior_model(), Vamos_Body::Gl_Car::interior_model(), Load(), ReflectionTexture(), Vamos_Body::Wheel::set_models(), and Texture().

bool JOEMODEL::LoadFromHandle FILE *  f,
JOEPACK pack
 

Definition at line 146 of file model.cpp.

References BinaryRead(), Draw(), ENDIAN_SWAP_32, JOEObject::info, JOE_VERSION, loadedfile, JOEHeader::magic, modelpath, NULL, JOEHeader::num_faces, JOEHeader::num_frames, pObject, ReadData(), static_list, and JOEHeader::version.

void JOEMODEL::NewDraw int  frame,
int  nextframe,
float  t,
VERTEX  lightdir,
QUATERNION  rotation,
int  pass
 

Definition at line 664 of file model.cpp.

void JOEMODEL::NewDraw int  frame,
float  t,
VERTEX  lightdir,
QUATERNION  rotation,
int  pass
 

Definition at line 494 of file model.cpp.

void JOEMODEL::NoTexture int  tid  )  [inline]
 

Definition at line 188 of file model.h.

References MAX_TEXTURE_UNITS, texturemode, and TEXTUREMODE_NOTEX.

void JOEMODEL::ReadData FILE *  m_FilePointer,
JOEPACK pack
[private]
 

Definition at line 195 of file model.cpp.

References BinaryRead(), CorrectEndian(), ENDIAN_SWAP_32, JOEFrame::faces, JOEObject::frames, JOEObject::info, JOEFrame::normals, JOEHeader::num_faces, JOEHeader::num_frames, JOEFrame::num_normals, JOEFrame::num_texcoords, JOEFrame::num_verts, pObject, JOEFrame::texcoords, and JOEFrame::verts.

Referenced by LoadFromHandle().

void JOEMODEL::ReflectionTexture string  texturename,
int  tid
 

Definition at line 1279 of file model.cpp.

References autounload, UTILITY::FileExists(), FileToPNG(), FileToTexturesizePNG(), Load(), MAX_TEXTURE_UNITS, textureid, texturemode, TEXTUREMODE_REFLECTION, TEXTURE_HANDLE::Unload(), and utility.

void JOEMODEL::ReflectionTextureID TEXTURE_HANDLE texid,
int  tid
[inline]
 

Definition at line 194 of file model.h.

References autounload, MAX_TEXTURE_UNITS, textureid, texturemode, and TEXTUREMODE_REFLECTION.

Referenced by Vamos_Body::Gl_Car::SetReflectionTexture().

void JOEMODEL::SetTU int  tuid,
bool  tue
[inline]
 

Definition at line 197 of file model.h.

References tuenable.

Referenced by Vamos_Body::Gl_Car::draw().

void JOEMODEL::TexCoordFromNormal VERTEX norm,
VERTEX ldir
[inline, private]
 

Definition at line 987 of file model.cpp.

void JOEMODEL::Texture string  texturename,
int  tid
 

Definition at line 1245 of file model.cpp.

References autounload, UTILITY::FileExists(), FileToPNG(), FileToTexturesizePNG(), Load(), MAX_TEXTURE_UNITS, modelpath, textureid, texturemode, TEXTUREMODE_TEX, TEXTURE_HANDLE::Unload(), and utility.

Referenced by Vamos_Body::Gl_Car::SetPaint().

void JOEMODEL::TextureID TEXTURE_HANDLE texid,
int  tid
[inline]
 

Definition at line 193 of file model.h.

References autounload, MAX_TEXTURE_UNITS, textureid, texturemode, and TEXTUREMODE_TEX.

Referenced by OBJECTS::AddModel().


Member Data Documentation

bool JOEMODEL::autounload[MAX_TEXTURE_UNITS] [private]
 

Definition at line 251 of file model.h.

Referenced by AdditiveTexture(), AdditiveTextureID(), JOEMODEL(), Load(), ReflectionTexture(), ReflectionTextureID(), Texture(), and TextureID().

AABB JOEMODEL::bbox [private]
 

Definition at line 219 of file model.h.

Referenced by GetBBOX().

int JOEMODEL::collidecache[NUM_COLLIDE_CACHE] [private]
 

Definition at line 216 of file model.h.

Referenced by Collide().

int JOEMODEL::collidecachepos [private]
 

Definition at line 217 of file model.h.

bool JOEMODEL::loadedfile [private]
 

Definition at line 229 of file model.h.

Referenced by GetFaces(), JOEMODEL(), Load(), and LoadFromHandle().

string JOEMODEL::modelpath [private]
 

Definition at line 255 of file model.h.

Referenced by Load(), LoadFromHandle(), and Texture().

JOEObject* JOEMODEL::pObject [private]
 

Definition at line 262 of file model.h.

Referenced by Collide(), Draw(), GetFace(), GetFaces(), GetNorm(), GetNormIdx(), GetVert(), JOEMODEL(), LoadFromHandle(), ReadData(), and ~JOEMODEL().

float JOEMODEL::radius [private]
 

Definition at line 224 of file model.h.

Referenced by GetRadius(), and JOEMODEL().

float JOEMODEL::radiusxz [private]
 

Definition at line 225 of file model.h.

Referenced by GetRadiusXZ(), and JOEMODEL().

GLuint JOEMODEL::static_list [private]
 

Definition at line 227 of file model.h.

Referenced by LoadFromHandle().

TEXTURE_HANDLE JOEMODEL::textureid[MAX_TEXTURE_UNITS] [private]
 

Definition at line 248 of file model.h.

Referenced by AdditiveTexture(), AdditiveTextureID(), Load(), ReflectionTexture(), ReflectionTextureID(), Texture(), and TextureID().

int JOEMODEL::texturemode[MAX_TEXTURE_UNITS] [private]
 

Definition at line 249 of file model.h.

Referenced by AdditiveTexture(), AdditiveTextureID(), JOEMODEL(), Load(), NoTexture(), ReflectionTexture(), ReflectionTextureID(), Texture(), and TextureID().

bool JOEMODEL::tuenable[MAX_TEXTURE_UNITS] [private]
 

Definition at line 250 of file model.h.

Referenced by JOEMODEL(), Load(), and SetTU().


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 04:11:53 2006 by  doxygen 1.4.6