PowerVR Software Development Kit


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

CMD2Model Class Reference

#include <PVRTModelMD2.h>

Collaboration diagram for CMD2Model:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CMD2Model (void)
 ~CMD2Model (void)
bool LoadModelFloatFromFile (const char *filename)
bool LoadModelFixedFromFile (const char *filename)
bool LoadModelFloatFromHeader (const char *headername)
bool LoadModelFixedFromHeader (const char *headername)
void SetAnim (int type)
void ScaleModel (float s)
int GetNumberOfVertices ()
void GetModelDataPntrsFloat (float time, float **pPosition, float **pTexCoord, float **pNormal, unsigned char **pColor, int *NumberOfFans, int *NumberOfStrips, int *Offset2Strips, int **pFanLengths, int **pStripLengths)
void GetModelDataPntrsFixed (float time, int **pPosition, int **pTexCoord, int **pNormal, unsigned char **pColor, int *NumberOfFans, int *NumberOfStrips, int *Offset2Strips, int **pFanLengths, int **pStripLengths)
unsigned short * GenerateTriangleList (void)

Public Attributes

int TriangleCount

Static Public Attributes

vec3_t anorms [NUMVERTEXNORMALS]
float anorms_dots [SHADEDOT_QUANT][256]
anim_t animlist [21]

Detailed Description

CMD2Model - MD2 model class object.


Constructor & Destructor Documentation



CMD2Model


CMD2Model::CMD2Model void   ) 
 

Description:
Init all Class Data



~CMD2Model


CMD2Model::~CMD2Model void   ) 
 

Description:
Free all allocated Resources

Member Function Documentation



GenerateTriangleList


unsigned short* CMD2Model::GenerateTriangleList void   ) 
 

Returns:
Index List
Description:
Outputs a triangle index list to allow for single draw call to draw the whole object. Unsigned Short data format returned.



GetModelDataPntrsFixed


void CMD2Model::GetModelDataPntrsFixed float  time,
int **  pPosition,
int **  pTexCoord,
int **  pNormal,
unsigned char **  pColor,
int *  NumberOfFans,
int *  NumberOfStrips,
int *  Offset2Strips,
int **  pFanLengths,
int **  pStripLengths
 

Outputs:
pPosition Vertex array
pTexCoord Texture coordinates array
pNormal Normal array
pColor Color array
NumberOfFans Number of fans
NumberOfStrips Number of strips
Offset2Strips Offset in bytes to strips
pFanLengths Lengths of the fans
pStripLengths Lengths of the strips
Inputs:
time Time in the animation to get the mesh at
Description:
Outputs a Vertex Position Array and optionally Normal, TexCoord and Color Arrays which can be used to render the MD2 Model. In addition the number of Fans and Strips and their respective lengths (Array) are reported. Also provide is the offset to locate the Strips. In the Arrays Fans are stored first and Strips are stored after them. This is the Fixed Format version. Do not use on objects loaded in Float Format !



GetModelDataPntrsFloat


void CMD2Model::GetModelDataPntrsFloat float  time,
float **  pPosition,
float **  pTexCoord,
float **  pNormal,
unsigned char **  pColor,
int *  NumberOfFans,
int *  NumberOfStrips,
int *  Offset2Strips,
int **  pFanLengths,
int **  pStripLengths
 

Outputs:
pPosition Vertex array
pTexCoord Texture coordinates array
pNormal Normal array
pColor Color array
NumberOfFans Number of fans
NumberOfStrips Number of strips
Offset2Strips Offset in bytes to strips
pFanLengths Lengths of the fans
pStripLengths Lengths of the strips
Inputs:
time Time in the animation to get the mesh at
Description:
Outputs a Vertex Position Array and optionally Normal, TexCoord and Color Arrays which can be used to render the MD2 Model. In addition the number of Fans and Strips and their respective lengths (Array) are reported. Also provide is the offset to locate the Strips. In the Arrays Fans are stored first and Strips are stored after them. This is the Float Format version. Do not use on objects loaded in Fixed Format !



GetNumberOfVertices


int CMD2Model::GetNumberOfVertices  ) 
 

Returns:
Number of actual vertices
Description:
Returns number of vertices in buffer.



LoadModelFixedFromFile


bool CMD2Model::LoadModelFixedFromFile const char *  filename  ) 
 

Inputs:
filename File to load from
Returns:
True if OK, False if there was a problem
Description:
Loads the specified ".MD2" file from disk into Fixed Format



LoadModelFixedFromHeader


bool CMD2Model::LoadModelFixedFromHeader const char *  headername  ) 
 

Inputs:
headername Header to load the model from
Returns:
True if OK, False if there was a problem
Description:
Loads the specified ".MD2" file from disk into Fixed Format



LoadModelFloatFromFile


bool CMD2Model::LoadModelFloatFromFile const char *  filename  ) 
 

Inputs:
filename File to load from
Returns:
True if OK, False if there was a problem
Description:
Loads the specified ".MD2" file from disk into Float Format



LoadModelFloatFromHeader


bool CMD2Model::LoadModelFloatFromHeader const char *  headername  ) 
 

Inputs:
headername Header to load the model from
Returns:
True if OK, False if there was a problem
Description:
Loads the specified ".MD2" file from disk into Float Format



ScaleModel


void CMD2Model::ScaleModel float  s  ) 
 

Inputs:
s Scale to apply
Description:
Sets the scale used when generating the Model Data.



SetAnim


void CMD2Model::SetAnim int  type  ) 
 

Inputs:
type One of the animType_t Enumerations
Description:
Selects the current Animation to playback.

Member Data Documentation



animlist


anim_t CMD2Model::animlist[21] [static]
 

animation list



anorms


vec3_t CMD2Model::anorms[ NUMVERTEXNORMALS ] [static]
 



anorms_dots


float CMD2Model::anorms_dots[ SHADEDOT_QUANT ][256] [static]
 



TriangleCount


int CMD2Model::TriangleCount
 


The documentation for this class was generated from the following file:

Copyright © 1999-2006, PowerVR Technologies and partners. PowerVR Technologies is a division of Imagination Technologies Ltd.


Generated by DOXYGEN 1.3.6