Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

MilkShape Class Reference

#include <MilkShape.h>

List of all members.

Public Member Functions

 MilkShape ()
virtual ~MilkShape ()
void clear ()
bool linkBones ()
void initializeBones ()
void attachSkin ()
void renderBones ()
bool loadFromAsciiFile (const char *path, const char *filename)
void advanceAnimation (float deltaTime)
void render ()
int getNumMeshes ()
MS_MeshgetMeshes ()

Public Attributes

int numGuns
Vec3 guns [MS_PLAYER_MAX_GUNS]

Protected Attributes

float fMaxTime
float fCurrentTime
int numMeshes
MS_MeshpMeshes
int * materialIndices
int numMaterials
MS_MaterialpMaterials
int numBones
MS_BonepBones


Detailed Description

Definition at line 153 of file MilkShape.h.


Constructor & Destructor Documentation

MilkShape::MilkShape  ) 
 

Definition at line 61 of file MilkShape.cpp.

References materialIndices, numBones, numMaterials, numMeshes, pBones, pMaterials, and pMeshes.

MilkShape::~MilkShape  )  [virtual]
 

Definition at line 71 of file MilkShape.cpp.

References clear().

Here is the call graph for this function:


Member Function Documentation

void MilkShape::advanceAnimation float  deltaTime  ) 
 

Definition at line 182 of file MilkShape.cpp.

References MS_Bone::advanceTo(), fCurrentTime, numBones, and pBones.

Referenced by loadFromAsciiFile(), and Play::update().

Here is the call graph for this function:

void MilkShape::attachSkin  ) 
 

Definition at line 146 of file MilkShape.cpp.

References MS_Vec::bone, Mat4::inverseRotateVect(), Mat4::inverseTranslateVect(), MS_Bone::matFinal, numMeshes, pBones, pMeshes, MS_Mesh::vertices, MS_Vec::x, MS_Vec::y, and MS_Vec::z.

Referenced by loadFromAsciiFile().

Here is the call graph for this function:

void MilkShape::clear  ) 
 

Definition at line 75 of file MilkShape.cpp.

References MS_Bone::clear(), MS_Material::clear(), MS_Mesh::clear(), materialIndices, numBones, numMaterials, numMeshes, pBones, pMaterials, and pMeshes.

Referenced by Play::unload(), ~MilkShape(), and ObjLevel::~ObjLevel().

Here is the call graph for this function:

MS_Mesh* MilkShape::getMeshes  )  [inline]
 

Definition at line 168 of file MilkShape.h.

References pMeshes.

int MilkShape::getNumMeshes  )  [inline]
 

Definition at line 167 of file MilkShape.h.

References numMeshes.

void MilkShape::initializeBones  ) 
 

Definition at line 138 of file MilkShape.cpp.

References MS_Bone::initialize(), numBones, and pBones.

Referenced by loadFromAsciiFile().

Here is the call graph for this function:

bool MilkShape::linkBones  ) 
 

Definition at line 112 of file MilkShape.cpp.

References numBones, MS_Bone::parent, and pBones.

bool MilkShape::loadFromAsciiFile const char path,
const char filename
 

Definition at line 196 of file MilkShape.cpp.

References advanceAnimation(), attachSkin(), fCurrentTime, fMaxTime, initializeBones(), LOG_ERROR, LOG_MISC, LOG_SUCCESS, materialIndices, MS_MAX_NAME, MS_PLAYER_MAX_GUNS, numBones, numGuns, numMaterials, numMeshes, pBones, pMaterials, and pMeshes.

Referenced by ObjLevel::load().

Here is the call graph for this function:

void MilkShape::render  ) 
 

Fast render if (this->numBones == 0) { glVertexPointer(3, GL_FLOAT, sizeof(MS_Vec), this->pMeshes[k].vertices); glEnableClientState(GL_VERTEX_ARRAY);

glNormalPointer(GL_FLOAT, sizeof(MS_Normal), this->pMeshes[k].normals); glEnableClientState(GL_NORMAL_ARRAY);

glTexCoordPointer(2, GL_FLOAT, sizeof(MS_Vec), this->pMeshes[k].vertices + sizeof(float)*4); glEnableClientState(GL_TEXTURE_COORD_ARRAY);

glDrawElements(GL_TRIANGLES, this->pMeshes[k].numTriangles, GL_UNSIGNED_SHORT, this->pMeshes[k].triangles);

glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_VERTEX_ARRAY);

}

"Normal" render else { the stuff above }

Definition at line 358 of file MilkShape.cpp.

References MS_Material::activate(), MS_Vec::bone, GL_TEXTURE0_ARB, glMultiTexCoord2fARB, materialIndices, MS_Bone::matFinal, MS_Tri::n, MS_Mesh::normals, numMeshes, pBones, pMaterials, pMeshes, Mat4::rotateVect(), Mat4::translateVect(), MS_Mesh::triangles, MS_Vec::u, MS_Vec::v, MS_Tri::v, MS_Mesh::vertices, MS_Vec::x, MS_Normal::x, MS_Vec::y, MS_Normal::y, MS_Vec::z, and MS_Normal::z.

Referenced by ObjLevel::drawObjects(), and Play::drawPlayer().

Here is the call graph for this function:

void MilkShape::renderBones  ) 
 

Definition at line 176 of file MilkShape.cpp.

References numBones, pBones, and MS_Bone::render().

Here is the call graph for this function:


Member Data Documentation

float MilkShape::fCurrentTime [protected]
 

Definition at line 176 of file MilkShape.h.

Referenced by advanceAnimation(), and loadFromAsciiFile().

float MilkShape::fMaxTime [protected]
 

Definition at line 175 of file MilkShape.h.

Referenced by loadFromAsciiFile().

Vec3 MilkShape::guns[MS_PLAYER_MAX_GUNS]
 

Definition at line 172 of file MilkShape.h.

Referenced by Play::bot(), and Play::handleKeys().

int* MilkShape::materialIndices [protected]
 

Definition at line 181 of file MilkShape.h.

Referenced by clear(), loadFromAsciiFile(), MilkShape(), and render().

int MilkShape::numBones [protected]
 

Definition at line 186 of file MilkShape.h.

Referenced by advanceAnimation(), clear(), initializeBones(), linkBones(), loadFromAsciiFile(), MilkShape(), and renderBones().

int MilkShape::numGuns
 

Definition at line 171 of file MilkShape.h.

Referenced by loadFromAsciiFile().

int MilkShape::numMaterials [protected]
 

Definition at line 183 of file MilkShape.h.

Referenced by clear(), loadFromAsciiFile(), and MilkShape().

int MilkShape::numMeshes [protected]
 

Definition at line 178 of file MilkShape.h.

Referenced by attachSkin(), clear(), getNumMeshes(), loadFromAsciiFile(), MilkShape(), and render().

MS_Bone* MilkShape::pBones [protected]
 

Definition at line 187 of file MilkShape.h.

Referenced by advanceAnimation(), attachSkin(), clear(), initializeBones(), linkBones(), loadFromAsciiFile(), MilkShape(), render(), and renderBones().

MS_Material* MilkShape::pMaterials [protected]
 

Definition at line 184 of file MilkShape.h.

Referenced by clear(), loadFromAsciiFile(), MilkShape(), and render().

MS_Mesh* MilkShape::pMeshes [protected]
 

Definition at line 179 of file MilkShape.h.

Referenced by attachSkin(), clear(), getMeshes(), loadFromAsciiFile(), MilkShape(), and render().


Generated on Sun Jun 5 15:50:19 2005 for Defacto by  doxygen 1.4.3