Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
G3D::MD3Model Class Reference

Quake III MD3 model loader. More...

Inherits G3D::Model.

Classes

class  Pose
 Animation pose based on AnimType and animation time. More...
 
class  Skin
 A set of materials for a MD3Model. More...
 
class  Specification
 

Public Types

enum  {
  NUM_PARTS = 3,
  NUM_ANIMATED_PARTS = 2
}
 
enum  AnimType {
  BOTH_DEATH1,
  BOTH_DEAD1,
  BOTH_DEATH2,
  BOTH_DEAD2,
  BOTH_DEATH3,
  BOTH_DEAD3,
  UPPER_GESTURE,
  UPPER_ATTACK,
  UPPER_ATTACK2,
  UPPER_DROP,
  UPPER_RAISE,
  UPPER_STAND,
  UPPER_STAND2,
  LOWER_WALKCR,
  LOWER_WALK,
  LOWER_RUN,
  LOWER_BACK,
  LOWER_SWIM,
  LOWER_JUMP,
  LOWER_LAND,
  LOWER_JUMPB,
  LOWER_LANDB,
  LOWER_IDLE,
  LOWER_IDLECR,
  LOWER_TURN,
  NUM_ANIMATIONS,
  START_BOTH = BOTH_DEATH1,
  END_BOTH = BOTH_DEAD3,
  START_UPPER = UPPER_GESTURE,
  END_UPPER = UPPER_STAND2,
  START_LOWER = LOWER_WALKCR,
  END_LOWER = LOWER_TURN
}
 All standard animation types expected to have parameters in the animation.cfg file. More...
 
enum  PartType {
  PART_LOWER,
  PART_UPPER,
  PART_HEAD
}
 
typedef shared_ptr< MD3ModelRef
 

Public Member Functions

virtual ~MD3Model ()
 
const Skin::Ref defaultSkin () const
 
const std::stringname () const
 
void pose (Array< shared_ptr< class Surface > > &posedModelArray, const CoordinateFrame &cframe, const CFrame &previousFrame, const Pose &currentPose=Pose())
 Poses then adds all available parts to posedModelArray.
 
void pose (Array< shared_ptr< class Surface > > &posedModelArray, const CoordinateFrame &cframe=CoordinateFrame(), const Pose &currentPose=Pose())
 
void simulatePose (Pose &pose, GameTime dt) const
 Advances the pose based on this character's animations.
 
CoordinateFrame weaponFrame (const CoordinateFrame &cframe=CoordinateFrame(), const Pose &pose=Pose()) const
 Return the coordinate frame of the tag_weapon; this is where a simulator should place objects carried by the character.
 

Static Public Member Functions

static MD3Model::Ref create (const Specification &spec, const std::string &name="")
 

Detailed Description

Quake III MD3 model loader.

Quake 3 uses MD3 models for both characters and non-character objects. Character objects contain three individual "models" inside of them with attachment points.

MD3Models are composed of up to four parts, which are named lower (legs), upper (torso), and head. The coordinate frame for each relative to its parent can be specified as part of the pose. Each part contains a set of triangle lists. The triangle lists may have different materials and are key-frame animated. A skin is a set of materials for the triangle lists. The model is created with a default skin, although an alternative skin may be provided as part of the pose. This allows sharing geometry over characters with different appearance.

It also contains a coordinate frame for a weapon's attachment location.

See http://bit.ly/acgNj9 for some models

BETA API Likely to receive incompatible changes in future releases.
Referenced Code:
http://icculus.org/homepages/phaethon/q3a/formats/md3format.html
Referenced Code:
http://www.misfitcode.com/misfitmodel3d/olh_quakemd3.html

Member Typedef Documentation

typedef shared_ptr<MD3Model> G3D::MD3Model::Ref

Member Enumeration Documentation

anonymous enum
Enumerator:
NUM_PARTS 
NUM_ANIMATED_PARTS 

All standard animation types expected to have parameters in the animation.cfg file.

Enumerator:
BOTH_DEATH1 
BOTH_DEAD1 
BOTH_DEATH2 
BOTH_DEAD2 
BOTH_DEATH3 
BOTH_DEAD3 
UPPER_GESTURE 
UPPER_ATTACK 
UPPER_ATTACK2 
UPPER_DROP 
UPPER_RAISE 
UPPER_STAND 
UPPER_STAND2 
LOWER_WALKCR 
LOWER_WALK 
LOWER_RUN 
LOWER_BACK 
LOWER_SWIM 
LOWER_JUMP 
LOWER_LAND 
LOWER_JUMPB 
LOWER_LANDB 
LOWER_IDLE 
LOWER_IDLECR 
LOWER_TURN 
NUM_ANIMATIONS 
START_BOTH 
END_BOTH 
START_UPPER 
END_UPPER 
START_LOWER 
END_LOWER 
Enumerator:
PART_LOWER 
PART_UPPER 
PART_HEAD 

Heads are never animated.

Constructor & Destructor Documentation

virtual G3D::MD3Model::~MD3Model ( )
virtual

Member Function Documentation

static MD3Model::Ref G3D::MD3Model::create ( const Specification spec,
const std::string name = "" 
)
static
const Skin::Ref G3D::MD3Model::defaultSkin ( ) const
inline
const std::string& G3D::MD3Model::name ( ) const
inline
void G3D::MD3Model::pose ( Array< shared_ptr< class Surface > > &  posedModelArray,
const CoordinateFrame cframe,
const CFrame previousFrame,
const Pose currentPose = Pose() 
)

Poses then adds all available parts to posedModelArray.

Each part is posed based on the animation parameters then positioned and rotated based on the appropriate tag according to Quake III model standards.

The lower.md3 part is the based. The upper.md3 part is attached to "tag_torso" in lower.md3. The head.md3 part is attached to "tag_head" in upper.md3.

The initial cframe transformation is applied to the base lower.md3 part before the whole model is posed.

Referenced by pose().

void G3D::MD3Model::pose ( Array< shared_ptr< class Surface > > &  posedModelArray,
const CoordinateFrame cframe = CoordinateFrame(),
const Pose currentPose = Pose() 
)
inline
void G3D::MD3Model::simulatePose ( Pose pose,
GameTime  dt 
) const

Advances the pose based on this character's animations.

CoordinateFrame G3D::MD3Model::weaponFrame ( const CoordinateFrame cframe = CoordinateFrame(),
const Pose pose = Pose() 
) const

Return the coordinate frame of the tag_weapon; this is where a simulator should place objects carried by the character.


documentation generated on Sat Jan 12 2013 22:49:56 using doxygen 1.8.2