Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members

MD2Model Class Reference

#include <lvt/MD2Model.h>

Inheritance diagram for MD2Model:

Inheritance graph
[legend]
List of all members.

Detailed Description

An MD2 (Quake 2) Model.

Loads, renders, and animates a Quake 2 model. An MD2 model defines a number of animations (such as run, walk, jump, etc.). The current animation is selected with SetCurAnimation. An MD2 file may also specify one or more skins, which the MD2Model class will automatically load. The current skin can be selected with SetCurSkin.

Not all models specify skins in the .md2 file. For those that don't, use a Texture2D object (or a Switch of Texture2D objects) to texture the model.


Public Member Functions

bool Animate (unsigned int dTime)
 Animates the model.
const std::string GetAnimationName (int aniNum) const
 Returns the name of the animation with the given ordinal.
int GetAnimationNum (const std::string &animName) const
 Returns the number (ordinal) of the animation with the given name.
int GetNumAnimations () const
 Returns the number of animations defined for the model.
int GetNumSkins () const
 Returns the total number of skins present in the model.
const std::string GetSkinName (int skinNum) const
 Returns the name of the skin with the given ordinal.
int GetSkinNum (const std::string &skinName) const
 Returns the number (ordinal) of the skin with the given name.
bool Load (const std::string &fileName)
 Loads the model from disk, as well as any skins specified in the model.
void Render ()
 Draws the model.
 MD2Model (const std::string &fileName)
 MD2Model ()
 Constructor.
bool SetCurAnimation (const std::string &aniName)
bool SetCurAnimation (int aniNum)
 Sets the model's current animation.
bool SetCurSkin (const std::string &skinName)
bool SetCurSkin (int skinNum)
 Sets the model's current skin.


Constructor & Destructor Documentation

MD2Model  ) 
 

Constructor.

MD2Model const std::string &  fileName  ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


Member Function Documentation

bool Animate unsigned int  dTime  )  [virtual]
 

Animates the model.

Reimplemented from Node.

const std::string GetAnimationName int  aniNum  )  const
 

Returns the name of the animation with the given ordinal.

int GetAnimationNum const std::string &  animName  )  const
 

Returns the number (ordinal) of the animation with the given name.

int GetNumAnimations  )  const [inline]
 

Returns the number of animations defined for the model.

int GetNumSkins  )  const [inline]
 

Returns the total number of skins present in the model.

const std::string GetSkinName int  skinNum  )  const
 

Returns the name of the skin with the given ordinal.

int GetSkinNum const std::string &  skinName  )  const
 

Returns the number (ordinal) of the skin with the given name.

bool Load const std::string &  fileName  ) 
 

Loads the model from disk, as well as any skins specified in the model.

void Render  )  [virtual]
 

Draws the model.

Implements Node.

bool SetCurAnimation const std::string &  aniName  ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

bool SetCurAnimation int  aniNum  ) 
 

Sets the model's current animation.

bool SetCurSkin const std::string &  skinName  ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

bool SetCurSkin int  skinNum  ) 
 

Sets the model's current skin.


Generated on Thu Feb 17 09:45:47 2005 for liblvt by  doxygen 1.4.1