Main Page   Class Hierarchy   Compound List   File List   Compound Members  

SkinnedModel Class Reference

The SkinnedModel class is a model that is defined by a mesh attached to a skeleton. More...

#include <SkinnedModel.h>

Inheritance diagram for SkinnedModel:

AnimatedModel List of all members.

Public Methods

 SkinnedModel (const std::string &fileName)
 Loads a SkinnedModel from a X file with its skeleton.

 ~SkinnedModel ()
 Destructor.

BonegetSkeleton ()
 Returns the root Bone for the Skeleton.

void setToReference ()
 Places all joints in the reference pose.

void render ()
 Renders the model at the origin of the world.

void render (const Matrix &worldMat)
 Renders the model using the given world matrix.


Static Public Methods

std::string getDXDataObjectName (LPDIRECTXFILEDATA xObj)
 A utility method that returns the name of a data object in an X file as a std::string object.


Protected Methods

 SkinnedModel ()
 The SkinnedModel default constructor is protected because the procedure for loading animations with the model is slightly different.

void loadSkeleton (LPDIRECTXFILEDATA xObj)
 This does the real work of loading the SkinnedModel.


Detailed Description

The SkinnedModel class is a model that is defined by a mesh attached to a skeleton.

By itself it neither contains nor implements any animation, but the Skeleton can be addressed directly to modify the skeleton, and the mesh will be rendered using the changes made to the Skeleton.


Constructor & Destructor Documentation

SkinnedModel::SkinnedModel const std::string &    fileName
 

Loads a SkinnedModel from a X file with its skeleton.

No animations are loaded. Only one Mesh is allowed in the X file. A GameException is thrown if an error occured while loading.


Member Function Documentation

Bone * SkinnedModel::getSkeleton  
 

Returns the root Bone for the Skeleton.

The Skeleton can then be modified or viewed through the returned root, and any changes made will be reflected in the next render call.

void SkinnedModel::loadSkeleton LPDIRECTXFILEDATA    xObj [protected]
 

This does the real work of loading the SkinnedModel.

It is called by the public constructor, but as the loading process differs slightly in AnimatedModel, AnimatedModel will call this function in its constructor.

void SkinnedModel::render const Matrix &    worldMat
 

Renders the model using the given world matrix.

Using this input world matrix, you can rotate, translate, and scale the entire model as a whole. This is necessary because the hardware matrices must be overwritten due to the skinning process, so the Skeleton must be modified by the given Matrix.

void SkinnedModel::render  
 

Renders the model at the origin of the world.

Same effect as calling render with the identity matrix. The current world matrix set in the API is overwritten.


The documentation for this class was generated from the following files:
Generated on Wed May 14 01:38:08 2003 for CG Skeletal Animation Project by doxygen1.2.18